From 970c3cc506de33f9edfdc345760b14c2a10dab3f Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Thu, 15 Oct 2020 16:18:36 +0200 Subject: [PATCH 01/15] fix(@angular-devkit/build-angular): override already existing assets in compilation With this change we align the copying of assets between `ng build` and `ng serve`. Previously in `ng serve` already copied assets where not overridden. More info: https://webpack.js.org/plugins/copy-webpack-plugin/#force Closes #18787 (cherry picked from commit 4d2f4ec2c1e7d3d5b319bb920512ad72be28b24b) --- .../src/angular-cli-files/models/webpack-configs/common.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts b/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts index 5b8143801b13..8f0b01abaad9 100644 --- a/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts +++ b/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts @@ -270,6 +270,7 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration { to: output.replace(/^\//, ''), from: glob, noErrorOnMissing: true, + force: true, globOptions: { dot: true, ignore: [ From 791f5747dc8f90bfd568e9fb91bce7fa43896513 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Thu, 15 Oct 2020 12:06:53 -0400 Subject: [PATCH 02/15] fix(@angular-devkit/build-angular): set HTML lang attribute when serving When using the non-deprecated localization options, the development server was not properly setting the HTML `lang` attribute for the application. This change ensures that the active locale is used within the application's index HTML file. Closes #18094 (cherry picked from commit 58a7deac6715cc7a5fb01981d48ed5899f66b3a6) --- .../build_angular/src/dev-server/index.ts | 7 +++- .../src/dev-server/index_spec.ts | 38 +++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/packages/angular_devkit/build_angular/src/dev-server/index.ts b/packages/angular_devkit/build_angular/src/dev-server/index.ts index 36718f05c20e..c53dcab0e501 100644 --- a/packages/angular_devkit/build_angular/src/dev-server/index.ts +++ b/packages/angular_devkit/build_angular/src/dev-server/index.ts @@ -95,6 +95,7 @@ export function serveWebpackBrowser( webpackDevServerConfig: WebpackDevServer.Configuration; port: number; projectRoot: string; + locale: string | undefined; }> { // Get the browser configuration from the target name. const rawBrowserOptions = await context.getTargetOptions(browserTarget); @@ -156,11 +157,13 @@ export function serveWebpackBrowser( webpackDevServerConfig, port, projectRoot, + locale: + browserOptions.i18nLocale || (i18n.shouldInline ? [...i18n.inlineLocales][0] : undefined), }; } return from(setup()).pipe( - switchMap(({ browserOptions, webpackConfig, webpackDevServerConfig, port, projectRoot }) => { + switchMap(({ browserOptions, webpackConfig, webpackDevServerConfig, port, projectRoot, locale }) => { options.port = port; // Resolve public host and client address. @@ -219,7 +222,7 @@ export function serveWebpackBrowser( noModuleEntrypoints: ['polyfills-es5'], postTransform: transforms.indexHtml, crossOrigin: browserOptions.crossOrigin, - lang: browserOptions.i18nLocale, + lang: locale, }), ); } diff --git a/packages/angular_devkit/build_angular/src/dev-server/index_spec.ts b/packages/angular_devkit/build_angular/src/dev-server/index_spec.ts index 4d4e9a9c33c0..a051a59d4177 100644 --- a/packages/angular_devkit/build_angular/src/dev-server/index_spec.ts +++ b/packages/angular_devkit/build_angular/src/dev-server/index_spec.ts @@ -104,4 +104,42 @@ describe('Dev Server Builder index', () => { ); await run.stop(); }); + + it('sets HTML lang attribute with the active locale', async () => { + const locale = 'fr'; + const { workspace } = await workspaces.readWorkspace(host.root(), workspaces.createWorkspaceHost(host)); + const app = workspace.projects.get('app'); + if (!app) { + fail('Test application "app" not found.'); + + return; + } + + app.extensions['i18n'] = { + locales: { + [locale]: [], + }, + }; + + const target = app.targets.get('build'); + if (!target) { + fail('Test application "app" target "build" not found.'); + + return; + } + if (!target.options) { + target.options = {}; + } + target.options.localize = [locale]; + + await workspaces.writeWorkspace(workspace, workspaces.createWorkspaceHost(host)); + + const architect = (await createArchitect(host.root())).architect; + const run = await architect.scheduleTarget(targetSpec); + const output = (await run.result) as DevServerBuilderOutput; + expect(output.success).toBe(true); + const response = await fetch('http://localhost:4200/index.html'); + expect(await response.text()).toContain(`lang="${locale}"`); + await run.stop(); + }); }); From e60cfffc8350bd3087473e547d787f55f6b51161 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Thu, 15 Oct 2020 12:28:43 -0400 Subject: [PATCH 03/15] fix(@ngtools/webpack): improve bad component resource error message The error message for when a TypeScript or JavaScript file is incorrectly used as a style or template within a component will now also provide the name of the file being incorrectly used. (cherry picked from commit 4887f595d2cfddf2abc27cba1f9a54b7bc2c6bfb) --- packages/ngtools/webpack/src/resource_loader.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ngtools/webpack/src/resource_loader.ts b/packages/ngtools/webpack/src/resource_loader.ts index 54873f7b3e1b..cb3cbc234cdb 100644 --- a/packages/ngtools/webpack/src/resource_loader.ts +++ b/packages/ngtools/webpack/src/resource_loader.ts @@ -56,7 +56,7 @@ export class WebpackResourceLoader { // Simple sanity check. if (filePath.match(/\.[jt]s$/)) { return Promise.reject( - 'Cannot use a JavaScript or TypeScript file for styleUrl or templateUrl.', + `Cannot use a JavaScript or TypeScript file (${filePath}) in a component's styleUrls or templateUrl.`, ); } From 1494f20ee6550b8b0b4d4714b01f86bf18df37a6 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Thu, 15 Oct 2020 18:00:04 -0400 Subject: [PATCH 04/15] fix(@angular-devkit/build-angular): ensure correct SRI values with differential loading Previously, the cached integrity values for a subsequent differential loading build would not be properly integrated. This resulted in builds with incorrect integrity values after an initial build. The cached differential loading builds will now use the correct integrity values on subsequent builds. Closes #18254 (cherry picked from commit eac9e994a600143815e4edd1a353a15cbfafb93d) --- .../build_angular/src/utils/action-cache.ts | 21 ++++-- .../tests/build/differential-loading-sri.ts | 73 +++++++++++++++++++ 2 files changed, 88 insertions(+), 6 deletions(-) create mode 100644 tests/legacy-cli/e2e/tests/build/differential-loading-sri.ts diff --git a/packages/angular_devkit/build_angular/src/utils/action-cache.ts b/packages/angular_devkit/build_angular/src/utils/action-cache.ts index eb99cd4579a4..e638325776df 100644 --- a/packages/angular_devkit/build_angular/src/utils/action-cache.ts +++ b/packages/angular_devkit/build_angular/src/utils/action-cache.ts @@ -33,15 +33,21 @@ export class BundleActionCache { } } - generateBaseCacheKey(content: string): string { - // Create base cache key with elements: - // * package version - different build-angular versions cause different final outputs - // * code length/hash - ensure cached version matches the same input code + generateIntegrityValue(content: string): string { const algorithm = this.integrityAlgorithm || 'sha1'; const codeHash = createHash(algorithm) .update(content) .digest('base64'); - let baseCacheKey = `${packageVersion}|${content.length}|${algorithm}-${codeHash}`; + + return `${algorithm}-${codeHash}`; + } + + generateBaseCacheKey(content: string): string { + // Create base cache key with elements: + // * package version - different build-angular versions cause different final outputs + // * code length/hash - ensure cached version matches the same input code + const integrity = this.generateIntegrityValue(content); + let baseCacheKey = `${packageVersion}|${content.length}|${integrity}`; if (!allowMangle) { baseCacheKey += '|MD'; } @@ -115,7 +121,10 @@ export class BundleActionCache { return null; } - const result: ProcessBundleResult = { name: action.name }; + const result: ProcessBundleResult = { + name: action.name, + integrity: this.generateIntegrityValue(action.code), + }; let cacheEntry = entries[CacheKey.OriginalCode]; if (cacheEntry) { diff --git a/tests/legacy-cli/e2e/tests/build/differential-loading-sri.ts b/tests/legacy-cli/e2e/tests/build/differential-loading-sri.ts new file mode 100644 index 000000000000..ab14256fbedd --- /dev/null +++ b/tests/legacy-cli/e2e/tests/build/differential-loading-sri.ts @@ -0,0 +1,73 @@ +import { createHash } from 'crypto'; +import { + appendToFile, + expectFileToMatch, + prependToFile, + readFile, + replaceInFile, + writeFile, +} from '../../utils/fs'; +import { ng } from '../../utils/process'; + +export default async function () { + // Enable Differential loading + await replaceInFile('.browserslistrc', 'not IE 11', 'IE 11'); + + const appRoutingModulePath = 'src/app/app-routing.module.ts'; + + // Add app routing. + // This is done automatically on a new app with --routing. + await writeFile( + appRoutingModulePath, + ` + import { NgModule } from '@angular/core'; + import { Routes, RouterModule } from '@angular/router'; + + const routes: Routes = []; + + @NgModule({ + imports: [RouterModule.forRoot(routes)], + exports: [RouterModule] + }) + export class AppRoutingModule { } + `, + ); + await prependToFile( + 'src/app/app.module.ts', + `import { AppRoutingModule } from './app-routing.module';`, + ); + await replaceInFile('src/app/app.module.ts', `imports: [`, `imports: [ AppRoutingModule,`); + await appendToFile('src/app/app.component.html', ''); + + await ng('generate', 'module', 'lazy', '--module=app.module', '--route', 'lazy'); + + await ng( + 'build', + '--prod', + '--subresource-integrity', + '--output-hashing=none', + '--output-path=dist/first', + ); + + // Second build used to ensure cached files use correct integrity values + await ng( + 'build', + '--prod', + '--subresource-integrity', + '--output-hashing=none', + '--output-path=dist/second', + ); + + const codeHashES5 = createHash('sha384') + .update(await readFile('dist/first/5-es5.js')) + .digest('base64'); + const codeHashES2015 = createHash('sha384') + .update(await readFile('dist/first/5-es2015.js')) + .digest('base64'); + + await expectFileToMatch('dist/first/runtime-es5.js', 'sha384-' + codeHashES5); + await expectFileToMatch('dist/first/runtime-es2015.js', 'sha384-' + codeHashES2015); + + await expectFileToMatch('dist/second/runtime-es5.js', 'sha384-' + codeHashES5); + await expectFileToMatch('dist/second/runtime-es2015.js', 'sha384-' + codeHashES2015); +} From 8b1ed419c90a9de7b593fdbdecc60f007da9469e Mon Sep 17 00:00:00 2001 From: Jaime Oliveira Date: Mon, 19 Oct 2020 11:08:39 +0200 Subject: [PATCH 05/15] fix(@angular-devkit/build-angular): add a base href to karma debug context This commits adds a base href value in the karma context iframe used to run unit tests where a unit test throws: No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document. Even if the application is fine. This is because the index.html from Angular CLI contains a base href value, but not the Karma context iframe. So when adding a unit test with a testing module that imports a NgModule, for example AppModule, which itself imports RouterModule, the unit test used to throw an error (regression appeared in router 3.1). That could be solved by either adding `RouterTestingModule` to the testing module, or by adding a provider `{ provide: APP_BASE_HREF, useValue: '/' }`, but required to understand the issue. This solves the issue in a transparent way: developers won't even encounter the problem anymore. Closes #19116 (cherry picked from commit ae94245131d883b5b060e8d6b6d05628bc448ea0) --- .../build_angular/src/angular-cli-files/plugins/karma-debug.html | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/angular_devkit/build_angular/src/angular-cli-files/plugins/karma-debug.html b/packages/angular_devkit/build_angular/src/angular-cli-files/plugins/karma-debug.html index 8c3fe313059d..44dbff5898f4 100644 --- a/packages/angular_devkit/build_angular/src/angular-cli-files/plugins/karma-debug.html +++ b/packages/angular_devkit/build_angular/src/angular-cli-files/plugins/karma-debug.html @@ -9,6 +9,7 @@ %X_UA_COMPATIBLE% Karma DEBUG RUNNER + From c430d363c29771d29e9f9c3daaa1a455d574d3ac Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 20 Oct 2020 10:14:24 +0000 Subject: [PATCH 06/15] fix(@angular-devkit/build-angular): update resolve-url-loader to version 3.1.2 Closes: #19134 (cherry picked from commit 46ef4cfb7855ae725e0ab4d7af0df41e0f553359) --- package.json | 2 +- .../angular_devkit/build_angular/package.json | 2 +- yarn.lock | 50 ++++++------------- 3 files changed, 17 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index d1281da6afb9..03a8629e30bd 100644 --- a/package.json +++ b/package.json @@ -193,7 +193,7 @@ "quicktype-core": "^6.0.15", "raw-loader": "4.0.0", "regenerator-runtime": "0.13.7", - "resolve-url-loader": "3.1.1", + "resolve-url-loader": "3.1.2", "rimraf": "3.0.2", "rollup": "2.26.5", "rxjs": "6.6.2", diff --git a/packages/angular_devkit/build_angular/package.json b/packages/angular_devkit/build_angular/package.json index 1bf4def858c1..740f8c34c449 100644 --- a/packages/angular_devkit/build_angular/package.json +++ b/packages/angular_devkit/build_angular/package.json @@ -48,7 +48,7 @@ "postcss-loader": "3.0.0", "raw-loader": "4.0.1", "regenerator-runtime": "0.13.7", - "resolve-url-loader": "3.1.1", + "resolve-url-loader": "3.1.2", "rimraf": "3.0.2", "rollup": "2.26.5", "rxjs": "6.6.2", diff --git a/yarn.lock b/yarn.lock index 65fee9112d4b..64f9b513a8fd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2078,16 +2078,13 @@ add-stream@^1.0.0: resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" integrity sha1-anmQQ3ynNtXhKI25K9MmbV9csqo= -adjust-sourcemap-loader@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/adjust-sourcemap-loader/-/adjust-sourcemap-loader-2.0.0.tgz#6471143af75ec02334b219f54bc7970c52fb29a4" - integrity sha512-4hFsTsn58+YjrU9qKzML2JSSDqKvN8mUGQ0nNIrfPi8hmIONT4L3uUaT6MKdMsZ9AjsU6D2xDkZxCkbQPxChrA== +adjust-sourcemap-loader@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/adjust-sourcemap-loader/-/adjust-sourcemap-loader-3.0.0.tgz#5ae12fb5b7b1c585e80bbb5a63ec163a1a45e61e" + integrity sha512-YBrGyT2/uVQ/c6Rr+t6ZJXniY03YtHGMJQYal368burRGYKqhx9qGTWqcBU5s1CwYY9E/ri63RYyG1IacMZtqw== dependencies: - assert "1.4.1" - camelcase "5.0.0" - loader-utils "1.2.3" - object-path "0.11.4" - regex-parser "2.2.10" + loader-utils "^2.0.0" + regex-parser "^2.2.11" adm-zip@^0.4.9: version "0.4.16" @@ -2401,13 +2398,6 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= -assert@1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" - integrity sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE= - dependencies: - util "0.10.3" - assert@^1.1.1: version "1.5.0" resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" @@ -3099,11 +3089,6 @@ camelcase-keys@^6.2.2: map-obj "^4.0.0" quick-lru "^4.0.1" -camelcase@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.0.0.tgz#03295527d58bd3cd4aa75363f35b2e8d97be2f42" - integrity sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA== - camelcase@5.3.1, camelcase@^5.0.0, camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" @@ -8675,11 +8660,6 @@ object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.0.6, object-keys@^1.1.1 resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== -object-path@0.11.4: - version "0.11.4" - resolved "https://registry.yarnpkg.com/object-path/-/object-path-0.11.4.tgz#370ae752fbf37de3ea70a861c23bba8915691949" - integrity sha1-NwrnUvvzfePqcKhhwju6iRVpGUk= - object-visit@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" @@ -10316,10 +10296,10 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regex-parser@2.2.10: - version "2.2.10" - resolved "https://registry.yarnpkg.com/regex-parser/-/regex-parser-2.2.10.tgz#9e66a8f73d89a107616e63b39d4deddfee912b37" - integrity sha512-8t6074A68gHfU8Neftl0Le6KTDwfGAj7IyjPIMSfikI2wJUTHDMaIq42bUsfVnj8mhx0R+45rdUXHGpN164avA== +regex-parser@^2.2.11: + version "2.2.11" + resolved "https://registry.yarnpkg.com/regex-parser/-/regex-parser-2.2.11.tgz#3b37ec9049e19479806e878cabe7c1ca83ccfe58" + integrity sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q== regexp.prototype.flags@^1.2.0: version "1.3.0" @@ -10494,12 +10474,12 @@ resolve-from@^4.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== -resolve-url-loader@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/resolve-url-loader/-/resolve-url-loader-3.1.1.tgz#28931895fa1eab9be0647d3b2958c100ae3c0bf0" - integrity sha512-K1N5xUjj7v0l2j/3Sgs5b8CjrrgtC70SmdCuZiJ8tSyb5J+uk3FoeZ4b7yTnH6j7ngI+Bc5bldHJIa8hYdu2gQ== +resolve-url-loader@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/resolve-url-loader/-/resolve-url-loader-3.1.2.tgz#235e2c28e22e3e432ba7a5d4e305c59a58edfc08" + integrity sha512-QEb4A76c8Mi7I3xNKXlRKQSlLBwjUV/ULFMP+G7n3/7tJZ8MG5wsZ3ucxP1Jz8Vevn6fnJsxDx9cIls+utGzPQ== dependencies: - adjust-sourcemap-loader "2.0.0" + adjust-sourcemap-loader "3.0.0" camelcase "5.3.1" compose-function "3.0.3" convert-source-map "1.7.0" From 080957d204b35db0b3ce7cf77dc6021222f83d1c Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Tue, 20 Oct 2020 16:49:58 +0200 Subject: [PATCH 07/15] ci: schedule nightly CI for 10.1.x branch --- .circleci/config.yml | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dc2277210bcb..743373e829ae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -118,7 +118,6 @@ commands: sudo apt-get update > /dev/null 2>&1 sudo apt-get install -y python python --version - # Job definitions jobs: setup: @@ -325,7 +324,7 @@ jobs: workflows: version: 2 - default_workflow: + commits: jobs: # Linux jobs - setup @@ -338,10 +337,6 @@ workflows: - build: requires: - setup - filters: - branches: - ignore: - - /docs-preview/ - e2e-cli: post-steps: - store_artifacts: @@ -420,3 +415,29 @@ workflows: - build - test - e2e-cli + + nightly: + triggers: + - schedule: + cron: "0 0 * * *" + filters: + branches: + only: + - 10.1.x + jobs: + # Linux jobs + - setup + - build: + requires: + - setup + - e2e-cli: + requires: + - build + - e2e-cli: + name: e2e-cli-ve + ve: true + requires: + - build + - test-browsers: + requires: + - build From 13ce7478633f92c88093db5830bdf7c77dc63c71 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Tue, 20 Oct 2020 10:07:15 +0200 Subject: [PATCH 08/15] fix(@angular/cli): include deprecated option in JSON help This option is used to mark deprecated options as such in AIO. (cherry picked from commit a09a2e4056bdd6ae3c75b59d9b66ba7c1aeb8b36) --- packages/angular/cli/models/interface.ts | 6 ++++++ packages/angular/cli/utilities/json-schema.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/packages/angular/cli/models/interface.ts b/packages/angular/cli/models/interface.ts index d55183f7544f..1d6e751596b1 100644 --- a/packages/angular/cli/models/interface.ts +++ b/packages/angular/cli/models/interface.ts @@ -157,6 +157,12 @@ export interface Option { * If this is falsey, do not report this option. */ userAnalytics?: number; + + /** + * Deprecation. If this flag is not false a warning will be shown on the console. Either `true` + * or a string to show the user as a notice. + */ + deprecated?: boolean | string; } /** diff --git a/packages/angular/cli/utilities/json-schema.ts b/packages/angular/cli/utilities/json-schema.ts index abd856c4196a..e2974080318a 100644 --- a/packages/angular/cli/utilities/json-schema.ts +++ b/packages/angular/cli/utilities/json-schema.ts @@ -251,6 +251,11 @@ export async function parseJsonSchemaToOptions( const xUserAnalytics = current['x-user-analytics']; const userAnalytics = typeof xUserAnalytics == 'number' ? xUserAnalytics : undefined; + // Deprecated is set only if it's true or a string. + const xDeprecated = current['x-deprecated']; + const deprecated = (xDeprecated === true || typeof xDeprecated === 'string') + ? xDeprecated : undefined; + const option: Option = { name, description: '' + (current.description === undefined ? '' : current.description), @@ -262,6 +267,7 @@ export async function parseJsonSchemaToOptions( ...format !== undefined ? { format } : {}, hidden, ...userAnalytics ? { userAnalytics } : {}, + ...deprecated !== undefined ? { deprecated } : {}, ...positional !== undefined ? { positional } : {}, }; From 8d29d87ace81bb7d1f809334161011611b7d7cbc Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Wed, 21 Oct 2020 10:53:41 +0200 Subject: [PATCH 09/15] docs: update further help section in readme (cherry picked from commit 9768230b4dd98906fe06b70ef87c7c738fe40645) --- packages/schematics/angular/library/files/README.md.template | 2 +- packages/schematics/angular/workspace/files/README.md.template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/schematics/angular/library/files/README.md.template b/packages/schematics/angular/library/files/README.md.template index d30000860412..8545804c5540 100644 --- a/packages/schematics/angular/library/files/README.md.template +++ b/packages/schematics/angular/library/files/README.md.template @@ -21,4 +21,4 @@ Run `ng test <%= name %>` to execute the unit tests via [Karma](https://karma-ru ## Further help -To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). +To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. diff --git a/packages/schematics/angular/workspace/files/README.md.template b/packages/schematics/angular/workspace/files/README.md.template index 42a51babbb5b..25d6cf773051 100644 --- a/packages/schematics/angular/workspace/files/README.md.template +++ b/packages/schematics/angular/workspace/files/README.md.template @@ -24,4 +24,4 @@ Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protrac ## Further help -To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). +To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. From c63132c208c474bc66b9aaea298b29cc597da87d Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Wed, 21 Oct 2020 14:25:55 +0200 Subject: [PATCH 10/15] docs: remove `=true` from `--next` `=true` us redundant (cherry picked from commit 5f930c984bfe01b2963bf3d432406ae2cf2e28df) --- packages/angular/cli/commands/update-long.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/angular/cli/commands/update-long.md b/packages/angular/cli/commands/update-long.md index 93be9c0f3c78..72df66ce35da 100644 --- a/packages/angular/cli/commands/update-long.md +++ b/packages/angular/cli/commands/update-long.md @@ -4,14 +4,19 @@ Perform a basic update to the current stable release of the core framework and C ng update @angular/cli @angular/core ``` -To update to the next beta or pre-release version, use the `--next=true` option. +To update to the next beta or pre-release version, use the `--next` option. To update from one major version to another, use the format -`ng update @angular/cli@^ @angular/core@^`. + +``` +ng update @angular/cli@^ @angular/core@^ +``` We recommend that you always update to the latest patch version, as it contains fixes we released since the initial major release. -For example, use the following command to take the latest 9.x.x version and use that to update. +For example, use the following command to take the latest 10.x.x version and use that to update. -`ng update @angular/cli@^9 @angular/core@^9` +``` +ng update @angular/cli@^10 @angular/core@^10 +``` For detailed information and guidance on updating your application, see the interactive [Angular Update Guide](https://update.angular.io/). From ad60c2f64d4068a0234c288d4039dffdc61c6398 Mon Sep 17 00:00:00 2001 From: Doug Parker Date: Wed, 21 Oct 2020 13:29:56 -0700 Subject: [PATCH 11/15] release: v10.2.0 --- packages/schematics/angular/utility/latest-versions.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/schematics/angular/utility/latest-versions.ts b/packages/schematics/angular/utility/latest-versions.ts index 1999fd78abaf..f535d4b973ee 100644 --- a/packages/schematics/angular/utility/latest-versions.ts +++ b/packages/schematics/angular/utility/latest-versions.ts @@ -8,7 +8,7 @@ export const latestVersions = { // These versions should be kept up to date with latest Angular peer dependencies. - Angular: '~10.1.6', + Angular: '~10.2.0', RxJs: '~6.6.0', ZoneJs: '~0.10.2', TypeScript: '~4.0.2', @@ -18,9 +18,9 @@ export const latestVersions = { // For our e2e tests, these versions must match the latest tag present on the branch. // During RC periods they will not match the latest RC until there's a new git tag, and // should not be updated. - DevkitBuildAngular: '~0.1001.7', - DevkitBuildNgPackagr: '~0.1001.7', - DevkitBuildWebpack: '~0.1001.7', + DevkitBuildAngular: '~0.1002.0', + DevkitBuildNgPackagr: '~0.1002.0', + DevkitBuildWebpack: '~0.1002.0', ngPackagr: '^10.1.0', }; From bc2efc97d75ce92538a29f4fd042f8c6a193ac3b Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Wed, 21 Oct 2020 23:46:49 +0200 Subject: [PATCH 12/15] ci: update nightly job to run on 10.2.x branch --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 743373e829ae..5b72fcc17a77 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -423,7 +423,7 @@ workflows: filters: branches: only: - - 10.1.x + - 10.2.x jobs: # Linux jobs - setup From a5bbcd56b5ef5cead726acc96f3e5b73f23d42e4 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Thu, 22 Oct 2020 14:12:33 +0200 Subject: [PATCH 13/15] test(@angular/cli): use correct version of devkit packages for universal test --- tests/legacy-cli/e2e/tests/build/platform-server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/legacy-cli/e2e/tests/build/platform-server.ts b/tests/legacy-cli/e2e/tests/build/platform-server.ts index f3e6cff75322..48f61ff81a87 100644 --- a/tests/legacy-cli/e2e/tests/build/platform-server.ts +++ b/tests/legacy-cli/e2e/tests/build/platform-server.ts @@ -12,12 +12,12 @@ export default async function () { // @nguniversal/express-engine currently relies on ^0.1000.0 of @angular-devkit/architect // which is not present in the local package registry and not semver compatible with 0.1001.0+ - const { stdout: stdout1 } = await silentNpm('pack', '@angular-devkit/architect@0.1000', '--registry=https://registry.npmjs.org'); + const { stdout: stdout1 } = await silentNpm('pack', '@angular-devkit/architect@0.1001', '--registry=https://registry.npmjs.org'); await silentNpm('publish', stdout1.trim(), '--registry=http://localhost:4873', '--tag=minor'); // @nguniversal/express-engine currently relies on ^10.0.0 of @angular-devkit/core // which is not present in the local package registry and not semver compatible prerelease version of 10.1.0 - const { stdout: stdout2 } = await silentNpm('pack', '@angular-devkit/core@10.0', '--registry=https://registry.npmjs.org'); + const { stdout: stdout2 } = await silentNpm('pack', '@angular-devkit/core@10.1', '--registry=https://registry.npmjs.org'); await silentNpm('publish', stdout2.trim(), '--registry=http://localhost:4873', '--tag=minor'); await ng('add', '@nguniversal/express-engine'); From 1ab59986de4cf23e56d6015bb2f5f3cc682b5d28 Mon Sep 17 00:00:00 2001 From: Doug Parker Date: Thu, 22 Oct 2020 09:31:03 -0700 Subject: [PATCH 14/15] Revert "release: v10.2.0" This reverts commit ad60c2f64d4068a0234c288d4039dffdc61c6398. CI failed and were unable to release. Trying again with recent fixes. --- packages/schematics/angular/utility/latest-versions.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/schematics/angular/utility/latest-versions.ts b/packages/schematics/angular/utility/latest-versions.ts index f535d4b973ee..1999fd78abaf 100644 --- a/packages/schematics/angular/utility/latest-versions.ts +++ b/packages/schematics/angular/utility/latest-versions.ts @@ -8,7 +8,7 @@ export const latestVersions = { // These versions should be kept up to date with latest Angular peer dependencies. - Angular: '~10.2.0', + Angular: '~10.1.6', RxJs: '~6.6.0', ZoneJs: '~0.10.2', TypeScript: '~4.0.2', @@ -18,9 +18,9 @@ export const latestVersions = { // For our e2e tests, these versions must match the latest tag present on the branch. // During RC periods they will not match the latest RC until there's a new git tag, and // should not be updated. - DevkitBuildAngular: '~0.1002.0', - DevkitBuildNgPackagr: '~0.1002.0', - DevkitBuildWebpack: '~0.1002.0', + DevkitBuildAngular: '~0.1001.7', + DevkitBuildNgPackagr: '~0.1001.7', + DevkitBuildWebpack: '~0.1001.7', ngPackagr: '^10.1.0', }; From 553be40c8dff56a55bcccf2a636fe1c83944c049 Mon Sep 17 00:00:00 2001 From: Doug Parker Date: Thu, 22 Oct 2020 09:31:26 -0700 Subject: [PATCH 15/15] release: v10.2.0 This reverts commit 1ab59986de4cf23e56d6015bb2f5f3cc682b5d28. Another release attempt after CI fixes. --- packages/schematics/angular/utility/latest-versions.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/schematics/angular/utility/latest-versions.ts b/packages/schematics/angular/utility/latest-versions.ts index 1999fd78abaf..f535d4b973ee 100644 --- a/packages/schematics/angular/utility/latest-versions.ts +++ b/packages/schematics/angular/utility/latest-versions.ts @@ -8,7 +8,7 @@ export const latestVersions = { // These versions should be kept up to date with latest Angular peer dependencies. - Angular: '~10.1.6', + Angular: '~10.2.0', RxJs: '~6.6.0', ZoneJs: '~0.10.2', TypeScript: '~4.0.2', @@ -18,9 +18,9 @@ export const latestVersions = { // For our e2e tests, these versions must match the latest tag present on the branch. // During RC periods they will not match the latest RC until there's a new git tag, and // should not be updated. - DevkitBuildAngular: '~0.1001.7', - DevkitBuildNgPackagr: '~0.1001.7', - DevkitBuildWebpack: '~0.1001.7', + DevkitBuildAngular: '~0.1002.0', + DevkitBuildNgPackagr: '~0.1002.0', + DevkitBuildWebpack: '~0.1002.0', ngPackagr: '^10.1.0', };