From 16efb13dd19ae15d7ebcfa6e1abb267f66114f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=A1ko=20Hevery?= Date: Tue, 6 Dec 2016 16:21:07 -0800 Subject: [PATCH] fix: display framework version on bootstrapped component (#13252) --- modules/@angular/common/index.ts | 12 ++--------- modules/@angular/common/src/common.ts | 20 +++++++++++++++++++ modules/@angular/common/src/version.ts | 19 ++++++++++++++++++ modules/@angular/compiler-cli/index.ts | 7 +------ modules/@angular/compiler-cli/src/version.ts | 19 ++++++++++++++++++ modules/@angular/compiler/index.ts | 6 +----- modules/@angular/compiler/src/version.ts | 19 ++++++++++++++++++ modules/@angular/core/index.ts | 5 ----- modules/@angular/core/src/core.ts | 2 +- .../@angular/core/src/linker/view_utils.ts | 2 ++ modules/@angular/core/src/version.ts | 7 ++++++- modules/@angular/forms/index.ts | 5 ----- modules/@angular/forms/src/forms.ts | 2 +- modules/@angular/forms/src/version.ts | 19 ++++++++++++++++++ modules/@angular/http/index.ts | 5 ----- modules/@angular/http/src/index.ts | 1 + modules/@angular/http/src/version.ts | 19 ++++++++++++++++++ modules/@angular/language-service/index.ts | 8 +------- .../@angular/language-service/src/version.ts | 19 ++++++++++++++++++ .../platform-browser-dynamic/index.ts | 5 ----- .../src/platform-browser-dynamic.ts | 2 +- .../platform-browser-dynamic/src/version.ts | 19 ++++++++++++++++++ modules/@angular/platform-browser/index.ts | 5 ----- .../@angular/platform-browser/src/browser.ts | 11 +--------- .../platform-browser/src/platform-browser.ts | 3 ++- .../@angular/platform-browser/src/version.ts | 19 ++++++++++++++++++ .../test/browser/bootstrap_spec.ts | 3 ++- modules/@angular/platform-server/index.ts | 6 ------ .../platform-server/src/platform-server.ts | 1 + .../@angular/platform-server/src/version.ts | 19 ++++++++++++++++++ .../platform-webworker-dynamic/index.ts | 5 ----- .../src/platform-webworker-dynamic.ts | 2 +- .../platform-webworker-dynamic/src/version.ts | 19 ++++++++++++++++++ modules/@angular/platform-webworker/index.ts | 5 ----- .../src/platform-webworker.ts | 1 + .../platform-webworker/src/version.ts | 19 ++++++++++++++++++ modules/@angular/router/index.ts | 5 ----- modules/@angular/router/src/index.ts | 2 +- modules/@angular/router/src/version.ts | 19 ++++++++++++++++++ modules/@angular/upgrade/index.ts | 5 ----- modules/@angular/upgrade/src/upgrade.ts | 1 + modules/@angular/upgrade/src/version.ts | 19 ++++++++++++++++++ publish-packages.sh | 6 ------ 43 files changed, 294 insertions(+), 103 deletions(-) create mode 100644 modules/@angular/common/src/common.ts create mode 100644 modules/@angular/common/src/version.ts create mode 100644 modules/@angular/compiler-cli/src/version.ts create mode 100644 modules/@angular/compiler/src/version.ts create mode 100644 modules/@angular/forms/src/version.ts create mode 100644 modules/@angular/http/src/version.ts create mode 100644 modules/@angular/language-service/src/version.ts create mode 100644 modules/@angular/platform-browser-dynamic/src/version.ts create mode 100644 modules/@angular/platform-browser/src/version.ts create mode 100644 modules/@angular/platform-server/src/version.ts create mode 100644 modules/@angular/platform-webworker-dynamic/src/version.ts create mode 100644 modules/@angular/platform-webworker/src/version.ts create mode 100644 modules/@angular/router/src/version.ts create mode 100644 modules/@angular/upgrade/src/version.ts diff --git a/modules/@angular/common/index.ts b/modules/@angular/common/index.ts index 3b58d02c65..a55ca93ed3 100644 --- a/modules/@angular/common/index.ts +++ b/modules/@angular/common/index.ts @@ -11,14 +11,6 @@ * @description * Entry point for all public APIs of the common package. */ -export * from './src/location/index'; -export {NgLocalization} from './src/localization'; -export {CommonModule} from './src/common_module'; -export {NgClass, NgFor, NgIf, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet} from './src/directives/index'; -export {AsyncPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, JsonPipe, LowerCasePipe, CurrencyPipe, DecimalPipe, PercentPipe, SlicePipe, UpperCasePipe} from './src/pipes/index'; -import {Version} from '@angular/core'; +export * from './src/common'; -/** - * @stable - */ -export const VERSION = new Version('0.0.0-PLACEHOLDER'); \ No newline at end of file +// This file only reexports content of the `src` folder. Keep it that way. diff --git a/modules/@angular/common/src/common.ts b/modules/@angular/common/src/common.ts new file mode 100644 index 0000000000..696834f905 --- /dev/null +++ b/modules/@angular/common/src/common.ts @@ -0,0 +1,20 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * Entry point for all public APIs of the common package. + */ +export * from './location/index'; +export {NgLocalization} from './localization'; +export {CommonModule} from './common_module'; +export {NgClass, NgFor, NgIf, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet} from './directives/index'; +export {AsyncPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, JsonPipe, LowerCasePipe, CurrencyPipe, DecimalPipe, PercentPipe, SlicePipe, UpperCasePipe} from './pipes/index'; +export {VERSION} from './version'; +export {Version} from '@angular/core'; diff --git a/modules/@angular/common/src/version.ts b/modules/@angular/common/src/version.ts new file mode 100644 index 0000000000..19db5be5a5 --- /dev/null +++ b/modules/@angular/common/src/version.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * Entry point for all public APIs of the common package. + */ + +import {Version} from '@angular/core'; +/** + * @stable + */ +export const VERSION = new Version('0.0.0-PLACEHOLDER'); diff --git a/modules/@angular/compiler-cli/index.ts b/modules/@angular/compiler-cli/index.ts index b9cd406d96..3418eed737 100644 --- a/modules/@angular/compiler-cli/index.ts +++ b/modules/@angular/compiler-cli/index.ts @@ -10,9 +10,4 @@ export {CodeGenerator} from './src/codegen'; export {CompilerHost, CompilerHostContext, ModuleResolutionHostAdapter, NodeCompilerHostContext} from './src/compiler_host'; export {Extractor} from './src/extractor'; export * from '@angular/tsc-wrapped'; - -import {Version} from '@angular/core'; -/** - * @stable - */ -export const VERSION = new Version('0.0.0-PLACEHOLDER'); \ No newline at end of file +export {VERSION} from './src/version'; diff --git a/modules/@angular/compiler-cli/src/version.ts b/modules/@angular/compiler-cli/src/version.ts new file mode 100644 index 0000000000..19db5be5a5 --- /dev/null +++ b/modules/@angular/compiler-cli/src/version.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * Entry point for all public APIs of the common package. + */ + +import {Version} from '@angular/core'; +/** + * @stable + */ +export const VERSION = new Version('0.0.0-PLACEHOLDER'); diff --git a/modules/@angular/compiler/index.ts b/modules/@angular/compiler/index.ts index 473d9b8268..269417aa3e 100644 --- a/modules/@angular/compiler/index.ts +++ b/modules/@angular/compiler/index.ts @@ -21,11 +21,7 @@ *

* */ -import {Version} from '@angular/core'; -/** - * @stable - */ -export const VERSION = new Version('0.0.0-PLACEHOLDER'); +export {VERSION} from './src/version'; export * from './src/template_parser/template_ast'; export {TEMPLATE_TRANSFORMS} from './src/template_parser/template_parser'; export {CompilerConfig, RenderTypes} from './src/config'; diff --git a/modules/@angular/compiler/src/version.ts b/modules/@angular/compiler/src/version.ts new file mode 100644 index 0000000000..19db5be5a5 --- /dev/null +++ b/modules/@angular/compiler/src/version.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * Entry point for all public APIs of the common package. + */ + +import {Version} from '@angular/core'; +/** + * @stable + */ +export const VERSION = new Version('0.0.0-PLACEHOLDER'); diff --git a/modules/@angular/core/index.ts b/modules/@angular/core/index.ts index 7a625d11dc..ede0762054 100644 --- a/modules/@angular/core/index.ts +++ b/modules/@angular/core/index.ts @@ -12,10 +12,5 @@ * Entry point for all public APIs of the core package. */ export * from './src/core'; -import {Version} from './src/core'; -/** - * @stable - */ -export const VERSION = new Version('0.0.0-PLACEHOLDER'); // This file only reexports content of the `src` folder. Keep it that way. diff --git a/modules/@angular/core/src/core.ts b/modules/@angular/core/src/core.ts index 726ff833f9..94c576cb7c 100644 --- a/modules/@angular/core/src/core.ts +++ b/modules/@angular/core/src/core.ts @@ -35,4 +35,4 @@ export * from './core_private_export'; export * from './animation/metadata'; export {AnimationTransitionEvent} from './animation/animation_transition_event'; export {AnimationPlayer} from './animation/animation_player'; -export {Sanitizer, SecurityContext} from './security'; \ No newline at end of file +export {Sanitizer, SecurityContext} from './security'; diff --git a/modules/@angular/core/src/linker/view_utils.ts b/modules/@angular/core/src/linker/view_utils.ts index abe19a7a2e..b42f371b65 100644 --- a/modules/@angular/core/src/linker/view_utils.ts +++ b/modules/@angular/core/src/linker/view_utils.ts @@ -13,6 +13,7 @@ import {isPresent, looseIdentical} from '../facade/lang'; import {ViewEncapsulation} from '../metadata/view'; import {RenderComponentType, RenderDebugInfo, Renderer, RootRenderer} from '../render/api'; import {Sanitizer} from '../security'; +import {VERSION} from '../version'; import {ExpressionChangedAfterItHasBeenCheckedError} from './errors'; import {AppView} from './view'; @@ -360,6 +361,7 @@ export function selectOrCreateRenderHostElement( for (let i = 0; i < attrs.length; i += 2) { renderer.setElementAttribute(hostElement, attrs.get(i), attrs.get(i + 1)); } + renderer.setElementAttribute(hostElement, 'ng-version', VERSION.full); } else { hostElement = createRenderElement(renderer, null, elementName, attrs, debugInfo); } diff --git a/modules/@angular/core/src/version.ts b/modules/@angular/core/src/version.ts index 2d7c61e95d..3a662a849c 100644 --- a/modules/@angular/core/src/version.ts +++ b/modules/@angular/core/src/version.ts @@ -19,4 +19,9 @@ export class Version { get minor(): string { return this.full.split('.')[1]; } get patch(): string { return this.full.split('.').slice(2).join('.'); } -} \ No newline at end of file +} + +/** + * @stable + */ +export const VERSION = new Version('0.0.0-PLACEHOLDER'); diff --git a/modules/@angular/forms/index.ts b/modules/@angular/forms/index.ts index 17b6f31618..31f3a88598 100644 --- a/modules/@angular/forms/index.ts +++ b/modules/@angular/forms/index.ts @@ -11,11 +11,6 @@ * @description * Entry point for all public APIs of the forms package. */ -import {Version} from '@angular/core'; -/** - * @stable - */ -export const VERSION = new Version('0.0.0-PLACEHOLDER'); export * from './src/forms'; // This file only reexports content of the `src` folder. Keep it that way. diff --git a/modules/@angular/forms/src/forms.ts b/modules/@angular/forms/src/forms.ts index 1887c26242..16fa548f88 100644 --- a/modules/@angular/forms/src/forms.ts +++ b/modules/@angular/forms/src/forms.ts @@ -42,5 +42,5 @@ export {AsyncValidatorFn, MaxLengthValidator, MinLengthValidator, PatternValidat export {FormBuilder} from './form_builder'; export {AbstractControl, FormArray, FormControl, FormGroup} from './model'; export {NG_ASYNC_VALIDATORS, NG_VALIDATORS, Validators} from './validators'; - +export {VERSION} from './version'; export * from './form_providers'; diff --git a/modules/@angular/forms/src/version.ts b/modules/@angular/forms/src/version.ts new file mode 100644 index 0000000000..19db5be5a5 --- /dev/null +++ b/modules/@angular/forms/src/version.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * Entry point for all public APIs of the common package. + */ + +import {Version} from '@angular/core'; +/** + * @stable + */ +export const VERSION = new Version('0.0.0-PLACEHOLDER'); diff --git a/modules/@angular/http/index.ts b/modules/@angular/http/index.ts index 99b254e2d5..80106781e7 100644 --- a/modules/@angular/http/index.ts +++ b/modules/@angular/http/index.ts @@ -11,11 +11,6 @@ * @description * Entry point for all public APIs of the http package. */ -import {Version} from '@angular/core'; -/** - * @stable - */ -export const VERSION = new Version('0.0.0-PLACEHOLDER'); export * from './src/index'; // This file only reexports content of the `src` folder. Keep it that way. diff --git a/modules/@angular/http/src/index.ts b/modules/@angular/http/src/index.ts index 7d10b18249..5011be91b4 100644 --- a/modules/@angular/http/src/index.ts +++ b/modules/@angular/http/src/index.ts @@ -19,3 +19,4 @@ export {Connection, ConnectionBackend, RequestOptionsArgs, ResponseOptionsArgs, export {Request} from './static_request'; export {Response} from './static_response'; export {QueryEncoder, URLSearchParams} from './url_search_params'; +export {VERSION} from './version'; diff --git a/modules/@angular/http/src/version.ts b/modules/@angular/http/src/version.ts new file mode 100644 index 0000000000..19db5be5a5 --- /dev/null +++ b/modules/@angular/http/src/version.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * Entry point for all public APIs of the common package. + */ + +import {Version} from '@angular/core'; +/** + * @stable + */ +export const VERSION = new Version('0.0.0-PLACEHOLDER'); diff --git a/modules/@angular/language-service/index.ts b/modules/@angular/language-service/index.ts index 6c39696653..bf641571ad 100644 --- a/modules/@angular/language-service/index.ts +++ b/modules/@angular/language-service/index.ts @@ -11,17 +11,11 @@ * @description * Entry point for all public APIs of the language service package. */ -import {Version} from '@angular/core'; -import * as ts from 'typescript'; - import {LanguageServicePlugin} from './src/ts_plugin'; -/** - * @stable - */ -export const VERSION = new Version('0.0.0-PLACEHOLDER'); export {createLanguageService} from './src/language_service'; export {Completion, Completions, Declaration, Declarations, Definition, Diagnostic, Diagnostics, Hover, HoverTextSection, LanguageService, LanguageServiceHost, Location, Span, TemplateSource, TemplateSources} from './src/types'; export {TypeScriptServiceHost, createLanguageServiceFromTypescript} from './src/typescript_host'; +export {VERSION} from './src/version'; export default LanguageServicePlugin; diff --git a/modules/@angular/language-service/src/version.ts b/modules/@angular/language-service/src/version.ts new file mode 100644 index 0000000000..19db5be5a5 --- /dev/null +++ b/modules/@angular/language-service/src/version.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * Entry point for all public APIs of the common package. + */ + +import {Version} from '@angular/core'; +/** + * @stable + */ +export const VERSION = new Version('0.0.0-PLACEHOLDER'); diff --git a/modules/@angular/platform-browser-dynamic/index.ts b/modules/@angular/platform-browser-dynamic/index.ts index d98ab68d57..ced57d28bf 100644 --- a/modules/@angular/platform-browser-dynamic/index.ts +++ b/modules/@angular/platform-browser-dynamic/index.ts @@ -11,11 +11,6 @@ * @description * Entry point for all public APIs of the platform-browser-dynamic package. */ -import {Version} from '@angular/core'; -/** - * @stable - */ -export const VERSION = new Version('0.0.0-PLACEHOLDER'); export * from './src/platform-browser-dynamic'; // This file only reexports content of the `src` folder. Keep it that way. diff --git a/modules/@angular/platform-browser-dynamic/src/platform-browser-dynamic.ts b/modules/@angular/platform-browser-dynamic/src/platform-browser-dynamic.ts index ea000360a6..d66060f889 100644 --- a/modules/@angular/platform-browser-dynamic/src/platform-browser-dynamic.ts +++ b/modules/@angular/platform-browser-dynamic/src/platform-browser-dynamic.ts @@ -13,7 +13,7 @@ import {INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS} from './platform_providers' import {CachedResourceLoader} from './resource_loader/resource_loader_cache'; export * from './private_export'; - +export {VERSION} from './version'; /** * @experimental */ diff --git a/modules/@angular/platform-browser-dynamic/src/version.ts b/modules/@angular/platform-browser-dynamic/src/version.ts new file mode 100644 index 0000000000..19db5be5a5 --- /dev/null +++ b/modules/@angular/platform-browser-dynamic/src/version.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * Entry point for all public APIs of the common package. + */ + +import {Version} from '@angular/core'; +/** + * @stable + */ +export const VERSION = new Version('0.0.0-PLACEHOLDER'); diff --git a/modules/@angular/platform-browser/index.ts b/modules/@angular/platform-browser/index.ts index ca306a4c22..a83ba2315d 100644 --- a/modules/@angular/platform-browser/index.ts +++ b/modules/@angular/platform-browser/index.ts @@ -11,10 +11,5 @@ * @description * Entry point for all public APIs of the platform-browser package. */ -import {Version} from '@angular/core'; -/** - * @stable - */ -export const VERSION = new Version('0.0.0-PLACEHOLDER'); export * from './src/platform-browser'; // This file only reexports content of the `src` folder. Keep it that way. diff --git a/modules/@angular/platform-browser/src/browser.ts b/modules/@angular/platform-browser/src/browser.ts index 518563f2f1..acc086c79c 100644 --- a/modules/@angular/platform-browser/src/browser.ts +++ b/modules/@angular/platform-browser/src/browser.ts @@ -7,7 +7,7 @@ */ import {CommonModule, PlatformLocation} from '@angular/common'; -import {ApplicationModule, ErrorHandler, NgModule, Optional, PLATFORM_INITIALIZER, PlatformRef, Provider, RootRenderer, Sanitizer, SkipSelf, Testability, VERSION, createPlatformFactory, platformCore} from '@angular/core'; +import {ApplicationModule, ErrorHandler, NgModule, Optional, PLATFORM_INITIALIZER, PlatformRef, Provider, RootRenderer, Sanitizer, SkipSelf, Testability, createPlatformFactory, platformCore} from '@angular/core'; import {AnimationDriver} from '../src/dom/animation_driver'; import {WebAnimationsDriver} from '../src/dom/web_animations_driver'; @@ -29,7 +29,6 @@ import {DomSanitizer, DomSanitizerImpl} from './security/dom_sanitization_servic export const INTERNAL_BROWSER_PLATFORM_PROVIDERS: Provider[] = [ {provide: PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true}, - {provide: PLATFORM_INITIALIZER, useValue: recordAngularVersion, multi: true}, {provide: PlatformLocation, useClass: BrowserPlatformLocation} ]; @@ -55,14 +54,6 @@ export function initDomAdapter() { BrowserGetTestability.init(); } -export function recordAngularVersion(): void { - const domAdapter = getDOM(); - const body = domAdapter.getElementsByTagName(domAdapter.defaultDoc(), 'body'); - if (body.length > 0) { - domAdapter.setAttribute(body[0], 'ng-version', VERSION.full); - } -} - export function errorHandler(): ErrorHandler { return new ErrorHandler(); } diff --git a/modules/@angular/platform-browser/src/platform-browser.ts b/modules/@angular/platform-browser/src/platform-browser.ts index df5fd4aa2c..6b6f1c4a92 100644 --- a/modules/@angular/platform-browser/src/platform-browser.ts +++ b/modules/@angular/platform-browser/src/platform-browser.ts @@ -16,4 +16,5 @@ export {DOCUMENT} from './dom/dom_tokens'; export {EVENT_MANAGER_PLUGINS, EventManager} from './dom/events/event_manager'; export {HAMMER_GESTURE_CONFIG, HammerGestureConfig} from './dom/events/hammer_gestures'; export {DomSanitizer, SafeHtml, SafeResourceUrl, SafeScript, SafeStyle, SafeUrl} from './security/dom_sanitization_service'; -export * from './private_export'; \ No newline at end of file +export * from './private_export'; +export {VERSION} from './version'; diff --git a/modules/@angular/platform-browser/src/version.ts b/modules/@angular/platform-browser/src/version.ts new file mode 100644 index 0000000000..19db5be5a5 --- /dev/null +++ b/modules/@angular/platform-browser/src/version.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * Entry point for all public APIs of the common package. + */ + +import {Version} from '@angular/core'; +/** + * @stable + */ +export const VERSION = new Version('0.0.0-PLACEHOLDER'); diff --git a/modules/@angular/platform-browser/test/browser/bootstrap_spec.ts b/modules/@angular/platform-browser/test/browser/bootstrap_spec.ts index c59c300c31..b86f92e9db 100644 --- a/modules/@angular/platform-browser/test/browser/bootstrap_spec.ts +++ b/modules/@angular/platform-browser/test/browser/bootstrap_spec.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {APP_INITIALIZER, CUSTOM_ELEMENTS_SCHEMA, Compiler, Component, Directive, ErrorHandler, Inject, Input, NgModule, OnDestroy, PLATFORM_INITIALIZER, Pipe, Provider, createPlatformFactory} from '@angular/core'; +import {APP_INITIALIZER, CUSTOM_ELEMENTS_SCHEMA, Compiler, Component, Directive, ErrorHandler, Inject, Input, NgModule, OnDestroy, PLATFORM_INITIALIZER, Pipe, Provider, VERSION, createPlatformFactory} from '@angular/core'; import {ApplicationRef, destroyPlatform} from '@angular/core/src/application_ref'; import {Console} from '@angular/core/src/console'; import {ComponentRef} from '@angular/core/src/linker/component_factory'; @@ -219,6 +219,7 @@ export function main() { const refPromise = bootstrap(HelloRootCmp, testProviders); refPromise.then((ref) => { expect(el).toHaveText('hello world!'); + expect(el.getAttribute('ng-version')).toEqual(VERSION.full); async.done(); }); })); diff --git a/modules/@angular/platform-server/index.ts b/modules/@angular/platform-server/index.ts index 07e562c628..405b49a6b5 100644 --- a/modules/@angular/platform-server/index.ts +++ b/modules/@angular/platform-server/index.ts @@ -11,12 +11,6 @@ * @description * Entry point for all public APIs of the platform-server package. */ -import {Version} from '@angular/core'; - -/** - * @stable - */ -export const VERSION = new Version('0.0.0-PLACEHOLDER'); export * from './src/platform-server'; // This file only reexports content of the `src` folder. Keep it that way. diff --git a/modules/@angular/platform-server/src/platform-server.ts b/modules/@angular/platform-server/src/platform-server.ts index 28faa83c03..31c1d80ec1 100644 --- a/modules/@angular/platform-server/src/platform-server.ts +++ b/modules/@angular/platform-server/src/platform-server.ts @@ -8,3 +8,4 @@ export {ServerModule, platformDynamicServer, platformServer} from './server'; export * from './private_export'; +export {VERSION} from './version'; diff --git a/modules/@angular/platform-server/src/version.ts b/modules/@angular/platform-server/src/version.ts new file mode 100644 index 0000000000..19db5be5a5 --- /dev/null +++ b/modules/@angular/platform-server/src/version.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * Entry point for all public APIs of the common package. + */ + +import {Version} from '@angular/core'; +/** + * @stable + */ +export const VERSION = new Version('0.0.0-PLACEHOLDER'); diff --git a/modules/@angular/platform-webworker-dynamic/index.ts b/modules/@angular/platform-webworker-dynamic/index.ts index feb074be1c..d470e489e3 100644 --- a/modules/@angular/platform-webworker-dynamic/index.ts +++ b/modules/@angular/platform-webworker-dynamic/index.ts @@ -11,11 +11,6 @@ * @description * Entry point for all public APIs of the platform-browser-dynamic package. */ -import {Version} from '@angular/core'; -/** - * @stable - */ -export const VERSION = new Version('0.0.0-PLACEHOLDER'); export * from './src/platform-webworker-dynamic'; // This file only reexports content of the `src` folder. Keep it that way. diff --git a/modules/@angular/platform-webworker-dynamic/src/platform-webworker-dynamic.ts b/modules/@angular/platform-webworker-dynamic/src/platform-webworker-dynamic.ts index 36793a0acc..5e95ce464b 100644 --- a/modules/@angular/platform-webworker-dynamic/src/platform-webworker-dynamic.ts +++ b/modules/@angular/platform-webworker-dynamic/src/platform-webworker-dynamic.ts @@ -9,7 +9,7 @@ import {ResourceLoader, platformCoreDynamic} from '@angular/compiler'; import {COMPILER_OPTIONS, PlatformRef, Provider, createPlatformFactory} from '@angular/core'; import {ResourceLoaderImpl} from './private_import_platform-browser-dynamic'; - +export {VERSION} from './version'; /** * @experimental API related to bootstrapping are still under review. diff --git a/modules/@angular/platform-webworker-dynamic/src/version.ts b/modules/@angular/platform-webworker-dynamic/src/version.ts new file mode 100644 index 0000000000..19db5be5a5 --- /dev/null +++ b/modules/@angular/platform-webworker-dynamic/src/version.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * Entry point for all public APIs of the common package. + */ + +import {Version} from '@angular/core'; +/** + * @stable + */ +export const VERSION = new Version('0.0.0-PLACEHOLDER'); diff --git a/modules/@angular/platform-webworker/index.ts b/modules/@angular/platform-webworker/index.ts index 01c1060b5d..398b8da2bd 100644 --- a/modules/@angular/platform-webworker/index.ts +++ b/modules/@angular/platform-webworker/index.ts @@ -11,11 +11,6 @@ * @description * Entry point for all public APIs of the platform-webworker package. */ -import {Version} from '@angular/core'; -/** - * @stable - */ -export const VERSION = new Version('0.0.0-PLACEHOLDER'); export * from './src/platform-webworker'; // This file only reexports content of the `src` folder. Keep it that way. diff --git a/modules/@angular/platform-webworker/src/platform-webworker.ts b/modules/@angular/platform-webworker/src/platform-webworker.ts index 3b69848572..a487191199 100644 --- a/modules/@angular/platform-webworker/src/platform-webworker.ts +++ b/modules/@angular/platform-webworker/src/platform-webworker.ts @@ -10,6 +10,7 @@ import {PlatformRef, Provider} from '@angular/core'; import {WORKER_SCRIPT, platformWorkerUi} from './worker_render'; +export {VERSION} from './version'; export {ClientMessageBroker, ClientMessageBrokerFactory, FnArg, UiArguments} from './web_workers/shared/client_message_broker'; export {MessageBus, MessageBusSink, MessageBusSource} from './web_workers/shared/message_bus'; export {PRIMITIVE} from './web_workers/shared/serializer'; diff --git a/modules/@angular/platform-webworker/src/version.ts b/modules/@angular/platform-webworker/src/version.ts new file mode 100644 index 0000000000..19db5be5a5 --- /dev/null +++ b/modules/@angular/platform-webworker/src/version.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * Entry point for all public APIs of the common package. + */ + +import {Version} from '@angular/core'; +/** + * @stable + */ +export const VERSION = new Version('0.0.0-PLACEHOLDER'); diff --git a/modules/@angular/router/index.ts b/modules/@angular/router/index.ts index 6764430ba6..ca4239ecf2 100644 --- a/modules/@angular/router/index.ts +++ b/modules/@angular/router/index.ts @@ -11,11 +11,6 @@ * @description * Entry point for all public APIs of the router package. */ -import {Version} from '@angular/core'; -/** - * @stable - */ -export const VERSION = new Version('0.0.0-ROUTERPLACEHOLDER'); export * from './src/index'; // This file only reexports content of the `src` folder. Keep it that way. diff --git a/modules/@angular/router/src/index.ts b/modules/@angular/router/src/index.ts index 3bfcdc9092..85b2f112be 100644 --- a/modules/@angular/router/src/index.ts +++ b/modules/@angular/router/src/index.ts @@ -21,5 +21,5 @@ export {ActivatedRoute, ActivatedRouteSnapshot, RouterState, RouterStateSnapshot export {PRIMARY_OUTLET, Params} from './shared'; export {UrlHandlingStrategy} from './url_handling_strategy'; export {DefaultUrlSerializer, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree} from './url_tree'; - +export {VERSION} from './version'; export * from './private_export' diff --git a/modules/@angular/router/src/version.ts b/modules/@angular/router/src/version.ts new file mode 100644 index 0000000000..82903b6504 --- /dev/null +++ b/modules/@angular/router/src/version.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * Entry point for all public APIs of the common package. + */ + +import {Version} from '@angular/core'; +/** + * @stable + */ +export const VERSION = new Version('0.0.0-ROUTERPLACEHOLDER'); diff --git a/modules/@angular/upgrade/index.ts b/modules/@angular/upgrade/index.ts index fbee42bc66..f051a03df0 100644 --- a/modules/@angular/upgrade/index.ts +++ b/modules/@angular/upgrade/index.ts @@ -11,10 +11,5 @@ * @description * Entry point for all public APIs of the upgrade package. */ -import {Version} from '@angular/core'; -/** - * @stable - */ -export const VERSION = new Version('0.0.0-PLACEHOLDER'); export * from './src/upgrade'; // This file only reexports content of the `src` folder. Keep it that way. diff --git a/modules/@angular/upgrade/src/upgrade.ts b/modules/@angular/upgrade/src/upgrade.ts index bbe55ed737..31ef1c81e2 100644 --- a/modules/@angular/upgrade/src/upgrade.ts +++ b/modules/@angular/upgrade/src/upgrade.ts @@ -12,3 +12,4 @@ * Adapter allowing AngularJS v1 and Angular v2 to run side by side in the same application. */ export {UpgradeAdapter, UpgradeAdapterRef} from './upgrade_adapter'; +export {VERSION} from './version'; diff --git a/modules/@angular/upgrade/src/version.ts b/modules/@angular/upgrade/src/version.ts new file mode 100644 index 0000000000..19db5be5a5 --- /dev/null +++ b/modules/@angular/upgrade/src/version.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * Entry point for all public APIs of the common package. + */ + +import {Version} from '@angular/core'; +/** + * @stable + */ +export const VERSION = new Version('0.0.0-PLACEHOLDER'); diff --git a/publish-packages.sh b/publish-packages.sh index 3c058de443..d168aebcd2 100755 --- a/publish-packages.sh +++ b/publish-packages.sh @@ -14,12 +14,6 @@ fi ./build.sh -echo "====== RENAMING 0.0.0-PLACEHOLDER to 2.0.0-rc.${VERSION} ======" -find ./dist/packages-dist/ -type f -name package.json -print0 | xargs -0 sed -i '' "s/0\\.0\\.0-PLACEHOLDER/2.0.0-rc.${VERSION}/g" -find ./dist/packages-dist/ -type f -name "*umd.js" -print0 | xargs -0 sed -i '' "s/0\\.0\\.0-PLACEHOLDER/2.0.0-rc.${VERSION}/g" -find ./dist/packages-dist/ -type f -name index.js -print0 | xargs -0 sed -i '' "s/0\\.0\\.0-PLACEHOLDER/2.0.0-rc.${VERSION}/g" - - for PACKAGE in \ core \ compiler \