From d4b1bb2ac374ed1297eb4eb53f6aaac18e0cc1fd Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 26 Mar 2024 15:42:24 +0000 Subject: [PATCH 0001/1223] 7682a71 build: address pre-release validation failure --- package.json | 10 +++++----- uniqueId | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index ab20343a7..12eb86d29 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.0+sha-daa0b95", + "version": "18.0.0-next.0+sha-7682a71", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#daa0b95", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#daa0b95", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#daa0b95", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#7682a71", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#7682a71", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#7682a71", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#daa0b95", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#7682a71", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/uniqueId b/uniqueId index 0a8832f9c..28c666bf0 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Mar 25 2024 19:41:56 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Mar 26 2024 15:42:24 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From d58257f1ad0c2ef22f1762a1d4800360f24389fa Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 26 Mar 2024 16:19:21 +0000 Subject: [PATCH 0002/1223] b454690 refactor(@angular-devkit/build-angular): update babel application preset with new plugin import location --- package.json | 10 +++++----- src/tools/babel/presets/application.js | 7 ++++--- uniqueId | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 12eb86d29..65c4d9789 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.0+sha-7682a71", + "version": "18.0.0-next.0+sha-b454690", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#7682a71", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#7682a71", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#7682a71", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#b454690", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#b454690", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#b454690", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#7682a71", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#b454690", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/tools/babel/presets/application.js b/src/tools/babel/presets/application.js index e498f074d..8ae67a984 100644 --- a/src/tools/babel/presets/application.js +++ b/src/tools/babel/presets/application.js @@ -147,11 +147,12 @@ function default_1(api, options) { needRuntimeTransform = true; } if (options.optimize) { + const { adjustStaticMembers, adjustTypeScriptEnums, elideAngularMetadata, markTopLevelPure, } = require('../plugins'); if (options.optimize.pureTopLevel) { - plugins.push(require('../plugins/pure-toplevel-functions').default); + plugins.push(markTopLevelPure); } - plugins.push(require('../plugins/elide-angular-metadata').default, [require('../plugins/adjust-typescript-enums').default, { loose: true }], [ - require('../plugins/adjust-static-class-members').default, + plugins.push(elideAngularMetadata, adjustTypeScriptEnums, [ + adjustStaticMembers, { wrapDecorators: options.optimize.wrapDecorators }, ]); } diff --git a/uniqueId b/uniqueId index 28c666bf0..c89129c97 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Mar 26 2024 15:42:24 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Mar 26 2024 16:19:21 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 0971bca2726a025125092254f22ee0d9119911eb Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 27 Mar 2024 07:00:11 +0000 Subject: [PATCH 0003/1223] 982139b build: update all non-major dependencies --- package.json | 10 +++++----- uniqueId | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 65c4d9789..d7c7d0716 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.0+sha-b454690", + "version": "18.0.0-next.0+sha-982139b", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#b454690", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#b454690", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#b454690", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#982139b", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#982139b", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#982139b", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#b454690", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#982139b", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/uniqueId b/uniqueId index c89129c97..a7e035308 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Mar 26 2024 16:19:21 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Mar 27 2024 07:00:11 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From dec8d9420d62f305e0c50aa83b8454a3024ea613 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 27 Mar 2024 11:52:36 +0000 Subject: [PATCH 0004/1223] 8442216 build: narrow down supported TypeScript versions --- package.json | 12 ++++++------ uniqueId | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index d7c7d0716..4ddc895a0 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.0+sha-982139b", + "version": "18.0.0-next.0+sha-8442216", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#982139b", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#982139b", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#982139b", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#8442216", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#8442216", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#8442216", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#982139b", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#8442216", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", @@ -86,7 +86,7 @@ "ng-packagr": "^18.0.0-next.0", "protractor": "^7.0.0", "tailwindcss": "^2.0.0 || ^3.0.0", - "typescript": ">=5.2 <5.5" + "typescript": ">=5.4 <5.5" }, "peerDependenciesMeta": { "@angular/localize": { diff --git a/uniqueId b/uniqueId index a7e035308..2431e8a01 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Mar 27 2024 07:00:11 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Mar 27 2024 11:52:36 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 2c4b33c4f25171fe9565c7891730b25b5443371e Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 28 Mar 2024 20:21:51 +0000 Subject: [PATCH 0005/1223] b87b843 refactor(@angular-devkit/build-angular): remove unneeded package version from inline font cache key --- package.json | 10 +++++----- src/utils/index-file/inline-fonts.d.ts | 2 -- src/utils/index-file/inline-fonts.js | 8 +++----- src/utils/normalize-cache.js | 9 +++++---- uniqueId | 2 +- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 4ddc895a0..5020a7ad5 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.0+sha-8442216", + "version": "18.0.0-next.0+sha-b87b843", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#8442216", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#8442216", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#8442216", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#b87b843", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#b87b843", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#b87b843", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#8442216", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#b87b843", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/index-file/inline-fonts.d.ts b/src/utils/index-file/inline-fonts.d.ts index 91c8fee57..b2e204cf1 100644 --- a/src/utils/index-file/inline-fonts.d.ts +++ b/src/utils/index-file/inline-fonts.d.ts @@ -5,8 +5,6 @@ * 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 */ -/// -import { URL } from 'node:url'; import { NormalizedCachedOptions } from '../normalize-cache'; export interface InlineFontsOptions { minify?: boolean; diff --git a/src/utils/index-file/inline-fonts.js b/src/utils/index-file/inline-fonts.js index a043049ff..65ca38418 100644 --- a/src/utils/index-file/inline-fonts.js +++ b/src/utils/index-file/inline-fonts.js @@ -36,8 +36,6 @@ const node_crypto_1 = require("node:crypto"); const promises_1 = require("node:fs/promises"); const https = __importStar(require("node:https")); const node_path_1 = require("node:path"); -const node_url_1 = require("node:url"); -const package_version_1 = require("../package-version"); const html_rewriting_stream_1 = require("./html-rewriting-stream"); const SUPPORTED_PROVIDERS = { 'fonts.googleapis.com': { @@ -161,7 +159,7 @@ class InlineFontsProcessor { async getResponse(url) { let cacheFile; if (this.cachePath) { - const key = (0, node_crypto_1.createHash)(CONTENT_HASH_ALGORITHM).update(`${package_version_1.VERSION}|${url}`).digest('hex'); + const key = (0, node_crypto_1.createHash)(CONTENT_HASH_ALGORITHM).update(`${url}`).digest('hex'); cacheFile = (0, node_path_1.join)(this.cachePath, key); } if (cacheFile) { @@ -226,7 +224,7 @@ class InlineFontsProcessor { return data; } async processURL(url) { - const normalizedURL = url instanceof node_url_1.URL ? url : this.createNormalizedUrl(url); + const normalizedURL = url instanceof URL ? url : this.createNormalizedUrl(url); if (!normalizedURL) { return; } @@ -255,7 +253,7 @@ class InlineFontsProcessor { } createNormalizedUrl(value) { // Need to convert '//' to 'https://' because the URL parser will fail with '//'. - const url = new node_url_1.URL(value.startsWith('//') ? `https:${value}` : value, 'resolve://'); + const url = new URL(value.startsWith('//') ? `https:${value}` : value, 'resolve://'); switch (url.protocol) { case 'http:': case 'https:': diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 02de75634..a703695ee 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -8,8 +8,9 @@ */ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; -const path_1 = require("path"); -const package_version_1 = require("./package-version"); +const node_path_1 = require("node:path"); +/** Version placeholder is replaced during the build process with actual package version */ +const VERSION = '18.0.0-next.0+sha-b87b843'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && @@ -33,11 +34,11 @@ function normalizeCacheOptions(projectMetadata, worspaceRoot) { break; } } - const cacheBasePath = (0, path_1.resolve)(worspaceRoot, path); + const cacheBasePath = (0, node_path_1.resolve)(worspaceRoot, path); return { enabled: cacheEnabled, basePath: cacheBasePath, - path: (0, path_1.join)(cacheBasePath, package_version_1.VERSION), + path: (0, node_path_1.join)(cacheBasePath, VERSION), }; } exports.normalizeCacheOptions = normalizeCacheOptions; diff --git a/uniqueId b/uniqueId index 2431e8a01..3072be83d 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Mar 27 2024 11:52:36 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Mar 28 2024 20:21:51 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 62eb9e0e97d1bd855e3fba6749955c8895ca0eb4 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 28 Mar 2024 20:45:25 +0000 Subject: [PATCH 0006/1223] ea55c48 build: update @bazel/buildifier to v7.1.0 --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 5020a7ad5..ffbc62342 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.0+sha-b87b843", + "version": "18.0.0-next.0+sha-ea55c48", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#b87b843", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#b87b843", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#b87b843", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#ea55c48", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#ea55c48", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#ea55c48", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#b87b843", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#ea55c48", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index a703695ee..6a814f0fe 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.0+sha-b87b843'; +const VERSION = '18.0.0-next.0+sha-ea55c48'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 3072be83d..d5bb63126 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Mar 28 2024 20:21:51 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Mar 28 2024 20:45:25 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From af2e0bab2179506b96f732c05a2094d83f9338f7 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 28 Mar 2024 21:33:43 +0000 Subject: [PATCH 0007/1223] cf4369f build: update angular --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index ffbc62342..2dbbe83e8 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.0+sha-ea55c48", + "version": "18.0.0-next.0+sha-cf4369f", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#ea55c48", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#ea55c48", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#ea55c48", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#cf4369f", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#cf4369f", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#cf4369f", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#ea55c48", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#cf4369f", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 6a814f0fe..2bf4eab27 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.0+sha-ea55c48'; +const VERSION = '18.0.0-next.0+sha-cf4369f'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index d5bb63126..8db365489 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Mar 28 2024 20:45:25 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Mar 28 2024 21:33:43 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 28f4c1390682c179ba0f459489f4ba065043bf65 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 28 Mar 2024 22:02:36 +0000 Subject: [PATCH 0008/1223] fc7d796 release: cut the v18.0.0-next.1 release --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 2dbbe83e8..8bf5723b4 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.0+sha-cf4369f", + "version": "18.0.0-next.1+sha-fc7d796", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#cf4369f", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#cf4369f", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#cf4369f", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#fc7d796", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#fc7d796", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#fc7d796", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#cf4369f", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#fc7d796", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 2bf4eab27..d3911707b 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.0+sha-cf4369f'; +const VERSION = '18.0.0-next.1+sha-fc7d796'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 8db365489..eaf04b88e 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Mar 28 2024 21:33:43 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Mar 28 2024 22:02:36 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From cb75e3fe4c9e6e34520c2e3f94de6ae6dc436bfb Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 29 Mar 2024 14:17:46 +0000 Subject: [PATCH 0009/1223] 508d97d feat(@schematics/angular): use ngZoneEventCoalescing option by default (module bootstrap) --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 8bf5723b4..a476654b5 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.1+sha-fc7d796", + "version": "18.0.0-next.1+sha-508d97d", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#fc7d796", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#fc7d796", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#fc7d796", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#508d97d", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#508d97d", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#508d97d", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#fc7d796", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#508d97d", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index d3911707b..25b6f5cff 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.1+sha-fc7d796'; +const VERSION = '18.0.0-next.1+sha-508d97d'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index eaf04b88e..b6fbfee28 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Mar 28 2024 22:02:36 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Mar 29 2024 14:17:46 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 7b9ff0086996a6f816c41a65f087a310b1ef674c Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Sat, 30 Mar 2024 02:31:20 +0000 Subject: [PATCH 0010/1223] 1573293 fix(@schematics/angular): add spaces around eventCoalescing option --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index a476654b5..24b887b3a 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.1+sha-508d97d", + "version": "18.0.0-next.1+sha-1573293", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#508d97d", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#508d97d", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#508d97d", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#1573293", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#1573293", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#1573293", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#508d97d", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#1573293", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 25b6f5cff..c790d54df 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.1+sha-508d97d'; +const VERSION = '18.0.0-next.1+sha-1573293'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index b6fbfee28..06d963f85 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Mar 29 2024 14:17:46 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Sat Mar 30 2024 02:31:20 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 6e20c8d02dceeb7d0268ac4aa53ded867528569d Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 1 Apr 2024 16:21:18 +0000 Subject: [PATCH 0011/1223] f97c0f3 build: update dependency ajv-formats to v3 --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 24b887b3a..122b790cd 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.1+sha-1573293", + "version": "18.0.0-next.1+sha-f97c0f3", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#1573293", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#1573293", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#1573293", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#f97c0f3", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#f97c0f3", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#f97c0f3", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#1573293", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#f97c0f3", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index c790d54df..a7da970bc 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.1+sha-1573293'; +const VERSION = '18.0.0-next.1+sha-f97c0f3'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 06d963f85..a8f0f6a08 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Sat Mar 30 2024 02:31:20 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Apr 01 2024 16:21:18 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From c1923de1b70a2043eaf7916d17330ee16e1583de Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 2 Apr 2024 16:21:13 +0000 Subject: [PATCH 0012/1223] 83b943a refactor(@angular-devkit/build-angular): use single search directory list for postcss/tailwind configuration setup --- package.json | 10 +++++----- src/builders/application/options.js | 15 ++++++++------- src/utils/normalize-cache.js | 2 +- src/utils/postcss-configuration.d.ts | 8 +++++++- src/utils/postcss-configuration.js | 17 +++++++++++++---- uniqueId | 2 +- 6 files changed, 35 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 122b790cd..23d5b24d6 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.1+sha-f97c0f3", + "version": "18.0.0-next.1+sha-83b943a", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#f97c0f3", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#f97c0f3", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#f97c0f3", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#83b943a", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#83b943a", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#83b943a", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#f97c0f3", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#83b943a", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/builders/application/options.js b/src/builders/application/options.js index b5d327cd3..cdf5b19a2 100644 --- a/src/builders/application/options.js +++ b/src/builders/application/options.js @@ -21,7 +21,6 @@ const environment_options_1 = require("../../utils/environment-options"); const i18n_options_1 = require("../../utils/i18n-options"); const normalize_cache_1 = require("../../utils/normalize-cache"); const postcss_configuration_1 = require("../../utils/postcss-configuration"); -const tailwind_1 = require("../../utils/tailwind"); const schema_1 = require("./schema"); /** * Normalize the user provided options by creating full paths for all path based options @@ -108,11 +107,13 @@ async function normalizeOptions(context, projectName, options, extensions) { loaderExtensions[extension] = value; } } - const postcssConfiguration = await (0, postcss_configuration_1.loadPostcssConfiguration)(workspaceRoot, projectRoot); + // A configuration file can exist in the project or workspace root + const searchDirectories = await (0, postcss_configuration_1.generateSearchDirectories)([projectRoot, workspaceRoot]); + const postcssConfiguration = await (0, postcss_configuration_1.loadPostcssConfiguration)(searchDirectories); // Skip tailwind configuration if postcss is customized const tailwindConfiguration = postcssConfiguration ? undefined - : await getTailwindConfig(workspaceRoot, projectRoot, context); + : await getTailwindConfig(searchDirectories, workspaceRoot, context); const globalStyles = normalizeGlobalEntries(options.styles, 'styles'); const globalScripts = normalizeGlobalEntries(options.scripts, 'scripts'); let indexHtmlOptions; @@ -230,13 +231,13 @@ async function normalizeOptions(context, projectName, options, extensions) { }; } exports.normalizeOptions = normalizeOptions; -async function getTailwindConfig(workspaceRoot, projectRoot, context) { - const tailwindConfigurationPath = await (0, tailwind_1.findTailwindConfigurationFile)(workspaceRoot, projectRoot); +async function getTailwindConfig(searchDirectories, workspaceRoot, context) { + const tailwindConfigurationPath = (0, postcss_configuration_1.findTailwindConfiguration)(searchDirectories); if (!tailwindConfigurationPath) { return undefined; } - // Create a node resolver at the project root as a directory - const resolver = (0, node_module_1.createRequire)(projectRoot + '/'); + // Create a node resolver from the configuration file + const resolver = (0, node_module_1.createRequire)(tailwindConfigurationPath); try { return { file: tailwindConfigurationPath, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index a7da970bc..766f432eb 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.1+sha-f97c0f3'; +const VERSION = '18.0.0-next.1+sha-83b943a'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/src/utils/postcss-configuration.d.ts b/src/utils/postcss-configuration.d.ts index 3895933fe..2e23bb5cf 100644 --- a/src/utils/postcss-configuration.d.ts +++ b/src/utils/postcss-configuration.d.ts @@ -8,4 +8,10 @@ export interface PostcssConfiguration { plugins: [name: string, options?: object | string][]; } -export declare function loadPostcssConfiguration(workspaceRoot: string, projectRoot: string): Promise; +export interface SearchDirectory { + root: string; + files: Set; +} +export declare function generateSearchDirectories(roots: string[]): Promise; +export declare function findTailwindConfiguration(searchDirectories: SearchDirectory[]): string | undefined; +export declare function loadPostcssConfiguration(searchDirectories: SearchDirectory[]): Promise; diff --git a/src/utils/postcss-configuration.js b/src/utils/postcss-configuration.js index 6eefb7c10..c95fdcc8e 100644 --- a/src/utils/postcss-configuration.js +++ b/src/utils/postcss-configuration.js @@ -7,16 +7,23 @@ * found in the LICENSE file at https://angular.io/license */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.loadPostcssConfiguration = void 0; +exports.loadPostcssConfiguration = exports.findTailwindConfiguration = exports.generateSearchDirectories = void 0; const promises_1 = require("node:fs/promises"); const node_path_1 = require("node:path"); const postcssConfigurationFiles = ['postcss.config.json', '.postcssrc.json']; +const tailwindConfigFiles = [ + 'tailwind.config.js', + 'tailwind.config.cjs', + 'tailwind.config.mjs', + 'tailwind.config.ts', +]; async function generateSearchDirectories(roots) { return await Promise.all(roots.map((root) => (0, promises_1.readdir)(root, { withFileTypes: true }).then((entries) => ({ root, files: new Set(entries.filter((entry) => entry.isFile()).map((entry) => entry.name)), })))); } +exports.generateSearchDirectories = generateSearchDirectories; function findFile(searchDirectories, potentialFiles) { for (const { root, files } of searchDirectories) { for (const potential of potentialFiles) { @@ -27,14 +34,16 @@ function findFile(searchDirectories, potentialFiles) { } return undefined; } +function findTailwindConfiguration(searchDirectories) { + return findFile(searchDirectories, tailwindConfigFiles); +} +exports.findTailwindConfiguration = findTailwindConfiguration; async function readPostcssConfiguration(configurationFile) { const data = await (0, promises_1.readFile)(configurationFile, 'utf-8'); const config = JSON.parse(data); return config; } -async function loadPostcssConfiguration(workspaceRoot, projectRoot) { - // A configuration file can exist in the project or workspace root - const searchDirectories = await generateSearchDirectories([projectRoot, workspaceRoot]); +async function loadPostcssConfiguration(searchDirectories) { const configPath = findFile(searchDirectories, postcssConfigurationFiles); if (!configPath) { return undefined; diff --git a/uniqueId b/uniqueId index a8f0f6a08..d2f1b544a 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Apr 01 2024 16:21:18 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Apr 02 2024 16:21:13 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From d4a1b448fd6eb612f7e3d3414b50f9a9c5c281f7 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 2 Apr 2024 16:27:17 +0000 Subject: [PATCH 0013/1223] 9f74174 build: add missing dep in test to fix CI --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 23d5b24d6..7a1946612 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.1+sha-83b943a", + "version": "18.0.0-next.1+sha-9f74174", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#83b943a", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#83b943a", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#83b943a", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#9f74174", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#9f74174", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#9f74174", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#83b943a", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#9f74174", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 766f432eb..ec86d042f 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.1+sha-83b943a'; +const VERSION = '18.0.0-next.1+sha-9f74174'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index d2f1b544a..ed6fc0074 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Apr 02 2024 16:21:13 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Apr 02 2024 16:27:17 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 9555650c33e8439efc3571c3a157bc83f384ce20 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 2 Apr 2024 17:12:04 +0000 Subject: [PATCH 0014/1223] 16d8c55 Revert "build: update @bazel/buildifier to v7.1.0" --- package.json | 22 +++++++++++----------- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 7a1946612..e51b5a58c 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.1+sha-9f74174", + "version": "18.0.0-next.1+sha-16d8c55", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#9f74174", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#9f74174", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#9f74174", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#16d8c55", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#16d8c55", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#16d8c55", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#9f74174", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#16d8c55", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", @@ -34,7 +34,7 @@ "fast-glob": "3.3.2", "https-proxy-agent": "7.0.4", "http-proxy-middleware": "2.0.6", - "inquirer": "9.2.16", + "inquirer": "9.2.17", "jsonc-parser": "3.2.1", "karma-source-map-support": "1.4.0", "less": "4.2.0", @@ -47,7 +47,7 @@ "open": "8.4.2", "ora": "5.4.1", "parse5-html-rewriting-stream": "7.0.0", - "picomatch": "4.0.1", + "picomatch": "4.0.2", "piscina": "4.4.0", "postcss": "8.4.38", "postcss-loader": "8.1.1", @@ -58,14 +58,14 @@ "semver": "7.6.0", "source-map-loader": "5.0.0", "source-map-support": "0.5.21", - "terser": "5.29.2", + "terser": "5.30.0", "tree-kill": "1.2.2", "tslib": "2.6.2", - "undici": "6.10.1", - "vite": "5.2.6", + "undici": "6.10.2", + "vite": "5.2.7", "watchpack": "2.4.1", "webpack": "5.91.0", - "webpack-dev-middleware": "7.1.1", + "webpack-dev-middleware": "7.2.1", "webpack-dev-server": "5.0.4", "webpack-merge": "5.10.0", "webpack-subresource-integrity": "5.1.0" diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index ec86d042f..922ec3d46 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.1+sha-9f74174'; +const VERSION = '18.0.0-next.1+sha-16d8c55'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index ed6fc0074..827cd69da 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Apr 02 2024 16:27:17 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Apr 02 2024 17:12:04 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From beec6b4f18ead652c9d74ca20fa2716685395752 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 2 Apr 2024 18:55:32 +0000 Subject: [PATCH 0015/1223] a673baf Revert "fix(@schematics/angular): rename SSR port env variable" --- package.json | 10 +++++----- src/builders/ssr-dev-server/index.js | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index e51b5a58c..3c7b1f437 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.1+sha-16d8c55", + "version": "18.0.0-next.1+sha-a673baf", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#16d8c55", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#16d8c55", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#16d8c55", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#a673baf", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#a673baf", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#a673baf", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#16d8c55", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#a673baf", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/builders/ssr-dev-server/index.js b/src/builders/ssr-dev-server/index.js index 71eec8ab9..5c3fb481c 100644 --- a/src/builders/ssr-dev-server/index.js +++ b/src/builders/ssr-dev-server/index.js @@ -156,7 +156,7 @@ exports.log = log; function startNodeServer(serverOutput, port, logger, inspectMode = false) { const outputPath = serverOutput.outputPath; const path = (0, path_1.join)(outputPath, 'main.js'); - const env = { ...process.env, SSR_PORT: '' + port, PORT: '' + port }; + const env = { ...process.env, PORT: '' + port }; const args = ['--enable-source-maps', `"${path}"`]; if (inspectMode) { args.unshift('--inspect-brk'); diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 922ec3d46..f8feb2a73 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.1+sha-16d8c55'; +const VERSION = '18.0.0-next.1+sha-a673baf'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 827cd69da..6f09fa109 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Apr 02 2024 17:12:04 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Apr 02 2024 18:55:32 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 303b26393f902d901ec07d3bc5acd6b74b88c517 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 2 Apr 2024 21:05:21 +0000 Subject: [PATCH 0016/1223] a5220b6 docs: release notes for the v17.3.3 release --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 3c7b1f437..5db1dfff2 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.1+sha-a673baf", + "version": "18.0.0-next.1+sha-a5220b6", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#a673baf", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#a673baf", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#a673baf", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#a5220b6", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#a5220b6", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#a5220b6", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#a673baf", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#a5220b6", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index f8feb2a73..40f72d386 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.1+sha-a673baf'; +const VERSION = '18.0.0-next.1+sha-a5220b6'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 6f09fa109..dd9ab7ff5 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Apr 02 2024 18:55:32 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Apr 02 2024 21:05:21 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From cb16bdf117731063a6a4ed868cfcd1493fe6eddb Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 2 Apr 2024 22:31:29 +0000 Subject: [PATCH 0017/1223] fe19259 build: update all non-major dependencies --- package.json | 14 +++++++------- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 5db1dfff2..b73bdcc84 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.1+sha-a5220b6", + "version": "18.0.0-next.1+sha-fe19259", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#a5220b6", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#a5220b6", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#a5220b6", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#fe19259", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#fe19259", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#fe19259", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#a5220b6", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#fe19259", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", @@ -58,10 +58,10 @@ "semver": "7.6.0", "source-map-loader": "5.0.0", "source-map-support": "0.5.21", - "terser": "5.30.0", + "terser": "5.30.2", "tree-kill": "1.2.2", "tslib": "2.6.2", - "undici": "6.10.2", + "undici": "6.11.1", "vite": "5.2.7", "watchpack": "2.4.1", "webpack": "5.91.0", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 40f72d386..014dd5e4d 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.1+sha-a5220b6'; +const VERSION = '18.0.0-next.1+sha-fe19259'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index dd9ab7ff5..95eca99e1 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Apr 02 2024 21:05:21 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Apr 02 2024 22:31:29 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From c3b5723d32a8bca1fb4af0bf7b8a06f7dc789215 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 3 Apr 2024 16:37:51 +0000 Subject: [PATCH 0018/1223] 3efd0b0 release: cut the v18.0.0-next.2 release --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index b73bdcc84..991ca905c 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.1+sha-fe19259", + "version": "18.0.0-next.2+sha-3efd0b0", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#fe19259", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#fe19259", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#fe19259", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#3efd0b0", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#3efd0b0", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#3efd0b0", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#fe19259", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#3efd0b0", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 014dd5e4d..43bebee5d 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.1+sha-fe19259'; +const VERSION = '18.0.0-next.2+sha-3efd0b0'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 95eca99e1..6a4374bc8 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Apr 02 2024 22:31:29 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Apr 03 2024 16:37:51 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 1f3bd0f8c7b9b920b1033928d4752a6d6c694f9a Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 3 Apr 2024 17:56:48 +0000 Subject: [PATCH 0019/1223] 86608d5 ci: disable updating `build_bazel_rules_nodejs` --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 991ca905c..924de4e40 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-3efd0b0", + "version": "18.0.0-next.2+sha-86608d5", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#3efd0b0", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#3efd0b0", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#3efd0b0", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#86608d5", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#86608d5", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#86608d5", "@babel/core": "7.24.3", "@babel/generator": "7.24.1", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.3", "@babel/runtime": "7.24.1", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#3efd0b0", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#86608d5", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 43bebee5d..8f7c97b6a 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-3efd0b0'; +const VERSION = '18.0.0-next.2+sha-86608d5'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 6a4374bc8..f019f5ecd 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Apr 03 2024 16:37:51 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Apr 03 2024 17:56:48 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 3239e6e8a48ccf1a136e6bf84b1bf53b2dc208b0 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 3 Apr 2024 20:35:38 +0000 Subject: [PATCH 0020/1223] c0e68e8 build: update all non-major dependencies --- package.json | 24 ++++++++++++------------ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 924de4e40..b890679f8 100644 --- a/package.json +++ b/package.json @@ -1,26 +1,26 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-86608d5", + "version": "18.0.0-next.2+sha-c0e68e8", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#86608d5", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#86608d5", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#86608d5", - "@babel/core": "7.24.3", - "@babel/generator": "7.24.1", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#c0e68e8", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#c0e68e8", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#c0e68e8", + "@babel/core": "7.24.4", + "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", "@babel/helper-split-export-declaration": "7.22.6", "@babel/plugin-transform-async-generator-functions": "7.24.3", "@babel/plugin-transform-async-to-generator": "7.24.1", "@babel/plugin-transform-runtime": "7.24.3", - "@babel/preset-env": "7.24.3", - "@babel/runtime": "7.24.1", + "@babel/preset-env": "7.24.4", + "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#86608d5", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#c0e68e8", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", @@ -29,7 +29,7 @@ "browserslist": "^4.21.5", "copy-webpack-plugin": "11.0.0", "critters": "0.0.22", - "css-loader": "6.10.0", + "css-loader": "6.11.0", "esbuild-wasm": "0.20.2", "fast-glob": "3.3.2", "https-proxy-agent": "7.0.4", @@ -58,11 +58,11 @@ "semver": "7.6.0", "source-map-loader": "5.0.0", "source-map-support": "0.5.21", - "terser": "5.30.2", + "terser": "5.30.3", "tree-kill": "1.2.2", "tslib": "2.6.2", "undici": "6.11.1", - "vite": "5.2.7", + "vite": "5.2.8", "watchpack": "2.4.1", "webpack": "5.91.0", "webpack-dev-middleware": "7.2.1", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 8f7c97b6a..480f39e05 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-86608d5'; +const VERSION = '18.0.0-next.2+sha-c0e68e8'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index f019f5ecd..1ba77d59c 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Apr 03 2024 17:56:48 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Apr 03 2024 20:35:38 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 94e46081babf3a706deb041f6c10b3f8a8283d83 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Sat, 6 Apr 2024 13:52:17 +0000 Subject: [PATCH 0021/1223] 84e4a81 build: update dependency css-loader to v7 --- package.json | 12 ++++++------ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index b890679f8..42bc9c79d 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-c0e68e8", + "version": "18.0.0-next.2+sha-84e4a81", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#c0e68e8", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#c0e68e8", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#c0e68e8", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#84e4a81", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#84e4a81", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#84e4a81", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#c0e68e8", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#84e4a81", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", @@ -29,7 +29,7 @@ "browserslist": "^4.21.5", "copy-webpack-plugin": "11.0.0", "critters": "0.0.22", - "css-loader": "6.11.0", + "css-loader": "7.0.0", "esbuild-wasm": "0.20.2", "fast-glob": "3.3.2", "https-proxy-agent": "7.0.4", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 480f39e05..52a8c5d1b 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-c0e68e8'; +const VERSION = '18.0.0-next.2+sha-84e4a81'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 1ba77d59c..e4e3f4985 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Apr 03 2024 20:35:38 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Sat Apr 06 2024 13:52:17 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 49032b2eb4028bb1ec923ff065b5de3c61e6fd3a Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 8 Apr 2024 03:18:20 +0000 Subject: [PATCH 0022/1223] 5ccddfe build: update dependency typescript to v5.4.4 --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 42bc9c79d..3ce6e6c12 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-84e4a81", + "version": "18.0.0-next.2+sha-5ccddfe", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#84e4a81", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#84e4a81", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#84e4a81", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#5ccddfe", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#5ccddfe", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#5ccddfe", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#84e4a81", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#5ccddfe", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 52a8c5d1b..080159001 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-84e4a81'; +const VERSION = '18.0.0-next.2+sha-5ccddfe'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index e4e3f4985..9971d2780 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Sat Apr 06 2024 13:52:17 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Apr 08 2024 03:18:20 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From d51da0d112c020d0b78436aea7f94d566e98e811 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 8 Apr 2024 12:29:33 +0000 Subject: [PATCH 0023/1223] 39624a3 build: update angular --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 3ce6e6c12..f6bf08400 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-5ccddfe", + "version": "18.0.0-next.2+sha-39624a3", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#5ccddfe", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#5ccddfe", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#5ccddfe", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#39624a3", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#39624a3", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#39624a3", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#5ccddfe", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#39624a3", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 080159001..c566ca5fe 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-5ccddfe'; +const VERSION = '18.0.0-next.2+sha-39624a3'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 9971d2780..2126ab44e 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Apr 08 2024 03:18:20 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Apr 08 2024 12:29:33 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From bc331333bd5621e741eefba2b81fe3935c8d3fd8 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 8 Apr 2024 14:00:25 +0000 Subject: [PATCH 0024/1223] afa76bb fix(@angular-devkit/build-angular): ensure esbuild-based builders exclusively produce ESM output --- package.json | 10 +++++----- src/tools/esbuild/angular/compiler-plugin.js | 16 ++++++++++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index f6bf08400..6c70e1136 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-39624a3", + "version": "18.0.0-next.2+sha-afa76bb", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#39624a3", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#39624a3", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#39624a3", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#afa76bb", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#afa76bb", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#afa76bb", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#39624a3", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#afa76bb", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/tools/esbuild/angular/compiler-plugin.js b/src/tools/esbuild/angular/compiler-plugin.js index f633ebb96..25e1e50ee 100644 --- a/src/tools/esbuild/angular/compiler-plugin.js +++ b/src/tools/esbuild/angular/compiler-plugin.js @@ -341,16 +341,16 @@ exports.createCompilerPlugin = createCompilerPlugin; function createCompilerOptionsTransformer(setupWarnings, pluginOptions, preserveSymlinks) { return (compilerOptions) => { // target of 9 is ES2022 (using the number avoids an expensive import of typescript just for an enum) - if (compilerOptions.target === undefined || compilerOptions.target < 9) { + if (compilerOptions.target === undefined || compilerOptions.target < 9 /** ES2022 */) { // If 'useDefineForClassFields' is already defined in the users project leave the value as is. // Otherwise fallback to false due to https://github.com/microsoft/TypeScript/issues/45995 // which breaks the deprecated `@Effects` NGRX decorator and potentially other existing code as well. - compilerOptions.target = 9; + compilerOptions.target = 9 /** ES2022 */; compilerOptions.useDefineForClassFields ??= false; // Only add the warning on the initial build setupWarnings?.push({ - text: 'TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022" and ' + - '"false" respectively by the Angular CLI.', + text: `TypeScript compiler options 'target' and 'useDefineForClassFields' are set to 'ES2022' and ` + + `'false' respectively by the Angular CLI.`, location: { file: pluginOptions.tsconfig }, notes: [ { @@ -377,6 +377,14 @@ function createCompilerOptionsTransformer(setupWarnings, pluginOptions, preserve else { compilerOptions.incremental = false; } + if (compilerOptions.module === undefined || compilerOptions.module < 5 /** ES2015 */) { + compilerOptions.module = 7; /** ES2022 */ + setupWarnings?.push({ + text: `TypeScript compiler options 'module' values 'CommonJS', 'UMD', 'System' and 'AMD' are not supported.`, + location: null, + notes: [{ text: `The 'module' option will be set to 'ES2022' instead.` }], + }); + } return { ...compilerOptions, noEmitOnError: false, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index c566ca5fe..393ec8403 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-39624a3'; +const VERSION = '18.0.0-next.2+sha-afa76bb'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 2126ab44e..c47794882 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Apr 08 2024 12:29:33 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Apr 08 2024 14:00:25 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From e7501e7bf2b0d9139c2383451026be6aa10b3bc4 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 8 Apr 2024 14:16:30 +0000 Subject: [PATCH 0025/1223] 6bd4f5f build: remove `eslintignore` file --- package.json | 14 ++++++------- src/tools/sass/sass-service.d.ts | 25 +++++++++++++++++++++- src/tools/sass/worker.js | 36 ++++++++++++++++++++++++++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 5 files changed, 65 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 6c70e1136..4c95f4217 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-afa76bb", + "version": "18.0.0-next.2+sha-6bd4f5f", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#afa76bb", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#afa76bb", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#afa76bb", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#6bd4f5f", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#6bd4f5f", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#6bd4f5f", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#afa76bb", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#6bd4f5f", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", @@ -41,7 +41,7 @@ "less-loader": "12.2.0", "license-webpack-plugin": "4.0.2", "loader-utils": "3.2.1", - "magic-string": "0.30.8", + "magic-string": "0.30.9", "mini-css-extract-plugin": "2.8.1", "mrmime": "2.0.0", "open": "8.4.2", @@ -53,7 +53,7 @@ "postcss-loader": "8.1.1", "resolve-url-loader": "5.0.0", "rxjs": "7.8.1", - "sass": "1.72.0", + "sass": "1.74.1", "sass-loader": "14.1.1", "semver": "7.6.0", "source-map-loader": "5.0.0", diff --git a/src/tools/sass/sass-service.d.ts b/src/tools/sass/sass-service.d.ts index 889639160..10953900b 100644 --- a/src/tools/sass/sass-service.d.ts +++ b/src/tools/sass/sass-service.d.ts @@ -5,7 +5,30 @@ * 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 */ -import { CompileResult, StringOptions } from 'sass'; +import { CompileResult, Deprecation, SourceSpan, StringOptions } from 'sass'; +export interface SerializableVersion { + major: number; + minor: number; + patch: number; +} +export interface SerializableDeprecation extends Omit { + /** The version this deprecation first became active in. */ + deprecatedIn: SerializableVersion | null; + /** The version this deprecation became obsolete in. */ + obsoleteIn: SerializableVersion | null; +} +export type SerializableWarningMessage = ({ + deprecation: true; + deprecationType: SerializableDeprecation; +} | { + deprecation: false; +}) & { + message: string; + span?: Omit & { + url?: string; + }; + stack?: string; +}; /** * A Sass renderer implementation that provides an interface that can be used by Webpack's * `sass-loader`. The implementation uses a Worker thread to perform the Sass rendering diff --git a/src/tools/sass/worker.js b/src/tools/sass/worker.js index 0af760540..e9f9008f6 100644 --- a/src/tools/sass/worker.js +++ b/src/tools/sass/worker.js @@ -77,13 +77,15 @@ node_worker_threads_1.parentPort.on('message', (message) => { importer: relativeImporter, logger: hasLogger ? { - warn(message, { deprecation, span, stack }) { + warn(message, warnOptions) { warnings ??= []; warnings.push({ + ...warnOptions, message, - deprecation, - stack, - span: span && convertSourceSpan(span), + span: warnOptions.span && convertSourceSpan(warnOptions.span), + ...convertDeprecation(warnOptions.deprecation, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + warnOptions.deprecationType), }); }, } @@ -162,3 +164,29 @@ function convertSourceSpan(span) { url: span.url ? (0, node_url_1.fileURLToPath)(span.url) : undefined, }; } +function convertDeprecation(deprecation, deprecationType) { + if (!deprecation || !deprecationType) { + return { deprecation: false }; + } + const { obsoleteIn, deprecatedIn, ...rest } = deprecationType; + return { + deprecation: true, + deprecationType: { + ...rest, + obsoleteIn: obsoleteIn + ? { + major: obsoleteIn.major, + minor: obsoleteIn.minor, + patch: obsoleteIn.patch, + } + : null, + deprecatedIn: deprecatedIn + ? { + major: deprecatedIn.major, + minor: deprecatedIn.minor, + patch: deprecatedIn.patch, + } + : null, + }, + }; +} diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 393ec8403..9b9183d00 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-afa76bb'; +const VERSION = '18.0.0-next.2+sha-6bd4f5f'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index c47794882..5ac90f1e0 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Apr 08 2024 14:00:25 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Apr 08 2024 14:16:30 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From b19665abe9eb032f5759cfc0851fd75c997df713 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 8 Apr 2024 15:05:53 +0000 Subject: [PATCH 0026/1223] 03eee05 refactor(@angular/cli): remove `ng doc` command --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 4c95f4217..5700c5868 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-6bd4f5f", + "version": "18.0.0-next.2+sha-03eee05", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#6bd4f5f", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#6bd4f5f", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#6bd4f5f", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#03eee05", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#03eee05", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#03eee05", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#6bd4f5f", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#03eee05", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 9b9183d00..a056adb6c 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-6bd4f5f'; +const VERSION = '18.0.0-next.2+sha-03eee05'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 5ac90f1e0..ee2e3310b 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Apr 08 2024 14:16:30 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Apr 08 2024 15:05:53 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 62c618dbbadd02beb9add1fb81cfb45b86d088cc Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 8 Apr 2024 17:41:42 +0000 Subject: [PATCH 0027/1223] 2a5caf1 build: lock file maintenance --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 5700c5868..4170702cc 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-03eee05", + "version": "18.0.0-next.2+sha-2a5caf1", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#03eee05", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#03eee05", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#03eee05", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2a5caf1", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#2a5caf1", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#2a5caf1", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#03eee05", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#2a5caf1", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index a056adb6c..fcfcd25ed 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-03eee05'; +const VERSION = '18.0.0-next.2+sha-2a5caf1'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index ee2e3310b..8bdd9d61d 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Apr 08 2024 15:05:53 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Apr 08 2024 17:41:42 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 563877d4ba5109d6655c0e133afa172761268dda Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 9 Apr 2024 11:54:50 +0000 Subject: [PATCH 0028/1223] 6d9a06a refactor(@angular-devkit/architect): allow aliasing builder names in package builder manifest --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 4170702cc..805375059 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-2a5caf1", + "version": "18.0.0-next.2+sha-6d9a06a", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2a5caf1", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#2a5caf1", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#2a5caf1", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#6d9a06a", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#6d9a06a", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#6d9a06a", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#2a5caf1", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#6d9a06a", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index fcfcd25ed..e474fa854 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-2a5caf1'; +const VERSION = '18.0.0-next.2+sha-6d9a06a'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 8bdd9d61d..681fb3cc8 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Apr 08 2024 17:41:42 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Apr 09 2024 11:54:50 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From f16b59abaeeaae8075314a4375ff97958256c2fe Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 9 Apr 2024 16:27:31 +0000 Subject: [PATCH 0029/1223] 422edd7 docs: replace links links to aio with links to adev --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 805375059..d82505fbe 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-6d9a06a", + "version": "18.0.0-next.2+sha-422edd7", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#6d9a06a", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#6d9a06a", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#6d9a06a", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#422edd7", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#422edd7", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#422edd7", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#6d9a06a", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#422edd7", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index e474fa854..2b20d901b 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-6d9a06a'; +const VERSION = '18.0.0-next.2+sha-422edd7'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 681fb3cc8..376debf13 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Apr 09 2024 11:54:50 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Apr 09 2024 16:27:31 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From ddbebae429e1e7f05e17cfe295e17b73dfb96bfa Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 10 Apr 2024 08:56:37 +0000 Subject: [PATCH 0030/1223] aea9ea6 build: update all non-major dependencies --- package.json | 14 +++++++------- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index d82505fbe..a5158349b 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-422edd7", + "version": "18.0.0-next.2+sha-aea9ea6", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#422edd7", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#422edd7", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#422edd7", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#aea9ea6", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#aea9ea6", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#aea9ea6", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#422edd7", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#aea9ea6", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", @@ -29,7 +29,7 @@ "browserslist": "^4.21.5", "copy-webpack-plugin": "11.0.0", "critters": "0.0.22", - "css-loader": "7.0.0", + "css-loader": "7.1.0", "esbuild-wasm": "0.20.2", "fast-glob": "3.3.2", "https-proxy-agent": "7.0.4", @@ -61,7 +61,7 @@ "terser": "5.30.3", "tree-kill": "1.2.2", "tslib": "2.6.2", - "undici": "6.11.1", + "undici": "6.12.0", "vite": "5.2.8", "watchpack": "2.4.1", "webpack": "5.91.0", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 2b20d901b..282f025c9 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-422edd7'; +const VERSION = '18.0.0-next.2+sha-aea9ea6'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 376debf13..bc0eb5aaf 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Apr 09 2024 16:27:31 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Apr 10 2024 08:56:37 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 698912a8a0681f102fedfcb0c7d399a9b7e7f2a4 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 10 Apr 2024 13:57:47 +0000 Subject: [PATCH 0031/1223] d482c65 docs: fix image url for completion command --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index a5158349b..6f134f5e7 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-aea9ea6", + "version": "18.0.0-next.2+sha-d482c65", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#aea9ea6", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#aea9ea6", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#aea9ea6", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#d482c65", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#d482c65", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#d482c65", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#aea9ea6", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#d482c65", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 282f025c9..463e23c61 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-aea9ea6'; +const VERSION = '18.0.0-next.2+sha-d482c65'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index bc0eb5aaf..afc3f865a 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Apr 10 2024 08:56:37 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Apr 10 2024 13:57:47 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 9c5d622e593f398b72d84a471ba6dd5b19fe4f19 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 10 Apr 2024 14:03:06 +0000 Subject: [PATCH 0032/1223] 733fba2 build: update dependency http-proxy-middleware to v3 --- package.json | 12 +++--- src/builders/dev-server/vite-server.js | 2 +- src/builders/ssr-dev-server/index.js | 56 +++++++++++++------------- src/utils/load-proxy-config.d.ts | 2 +- src/utils/load-proxy-config.js | 7 +--- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 7 files changed, 40 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index 6f134f5e7..3b8bfa50a 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-d482c65", + "version": "18.0.0-next.2+sha-733fba2", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#d482c65", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#d482c65", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#d482c65", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#733fba2", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#733fba2", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#733fba2", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#d482c65", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#733fba2", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", @@ -33,7 +33,7 @@ "esbuild-wasm": "0.20.2", "fast-glob": "3.3.2", "https-proxy-agent": "7.0.4", - "http-proxy-middleware": "2.0.6", + "http-proxy-middleware": "3.0.0", "inquirer": "9.2.17", "jsonc-parser": "3.2.1", "karma-source-map-support": "1.4.0", diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index f515d6d74..29733b161 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -332,7 +332,7 @@ function analyzeResultFiles(normalizePath, htmlIndexPath, resultFiles, generated } } async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks, externalMetadata, ssr, prebundleTransformer, target, prebundleLoaderExtensions, extensionMiddleware, indexHtmlTransformer, thirdPartySourcemaps = false) { - const proxy = await (0, utils_2.loadProxyConfiguration)(serverOptions.workspaceRoot, serverOptions.proxyConfig, true); + const proxy = await (0, utils_2.loadProxyConfiguration)(serverOptions.workspaceRoot, serverOptions.proxyConfig); // dynamically import Vite for ESM compatibility const { normalizePath } = await (0, load_esm_1.loadEsmModule)('vite'); // Path will not exist on disk and only used to provide separate path for Vite requests diff --git a/src/builders/ssr-dev-server/index.js b/src/builders/ssr-dev-server/index.js index 5c3fb481c..2912c143f 100644 --- a/src/builders/ssr-dev-server/index.js +++ b/src/builders/ssr-dev-server/index.js @@ -223,21 +223,24 @@ async function initBrowserSync(browserSyncInstance, nodeServerPort, options, con if (hasPathname) { const { createProxyMiddleware } = await Promise.resolve().then(() => __importStar(require('http-proxy-middleware'))); // Remove leading slash - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - (bsOptions.scriptPath = (p) => p.substring(1)), - (bsOptions.middleware = [ - createProxyMiddleware(defaultSocketIoPath, { - target: url.format({ - protocol: 'http', - hostname: host, - port: bsPort, - pathname: path, - }), - ws: true, - logLevel: 'silent', - // eslint-disable-next-line @typescript-eslint/no-explicit-any + bsOptions.scriptPath = (p) => p.substring(1); + bsOptions.middleware = [ + createProxyMiddleware({ + pathFilter: defaultSocketIoPath, + target: url.format({ + protocol: 'http', + hostname: host, + port: bsPort, + pathname: path, }), - ]); + ws: true, + logger: { + info: () => { }, + warn: () => { }, + error: () => { }, + }, + }), + ]; } } if (proxyConfig) { @@ -283,21 +286,18 @@ function getSslConfig(root, options) { return ssl; } async function getProxyConfig(root, proxyConfig) { - const proxy = await (0, utils_1.loadProxyConfiguration)(root, proxyConfig, false); - const createdProxies = []; + const proxy = await (0, utils_1.loadProxyConfiguration)(root, proxyConfig); + if (!proxy) { + return []; + } const { createProxyMiddleware } = await Promise.resolve().then(() => __importStar(require('http-proxy-middleware'))); - for (const [key, context] of Object.entries(proxy)) { - if (typeof key === 'string') { - createdProxies.push(createProxyMiddleware(key.replace(/^\*$/, '**').replace(/\/\*$/, ''), - // eslint-disable-next-line @typescript-eslint/no-explicit-any - context)); - } - else { - createdProxies.push( + return Object.entries(proxy).map(([key, context]) => { + const filterRegExp = new RegExp(key); + return createProxyMiddleware({ + pathFilter: (pathname) => filterRegExp.test(pathname), // eslint-disable-next-line @typescript-eslint/no-explicit-any - createProxyMiddleware(key, context)); - } - } - return createdProxies; + ...context, + }); + }); } exports.default = (0, architect_1.createBuilder)(execute); diff --git a/src/utils/load-proxy-config.d.ts b/src/utils/load-proxy-config.d.ts index 184e9ecb1..5ea224151 100644 --- a/src/utils/load-proxy-config.d.ts +++ b/src/utils/load-proxy-config.d.ts @@ -5,4 +5,4 @@ * 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 */ -export declare function loadProxyConfiguration(root: string, proxyConfig: string | undefined, normalize?: boolean): Promise; +export declare function loadProxyConfiguration(root: string, proxyConfig: string | undefined): Promise | undefined>; diff --git a/src/utils/load-proxy-config.js b/src/utils/load-proxy-config.js index 61ea7fead..cd8681f7c 100644 --- a/src/utils/load-proxy-config.js +++ b/src/utils/load-proxy-config.js @@ -39,7 +39,7 @@ const node_url_1 = require("node:url"); const picomatch_1 = require("picomatch"); const error_1 = require("./error"); const load_esm_1 = require("./load-esm"); -async function loadProxyConfiguration(root, proxyConfig, normalize = false) { +async function loadProxyConfiguration(root, proxyConfig) { if (!proxyConfig) { return undefined; } @@ -94,10 +94,7 @@ async function loadProxyConfiguration(root, proxyConfig, normalize = false) { throw e; } } - if (normalize) { - proxyConfiguration = normalizeProxyConfiguration(proxyConfiguration); - } - return proxyConfiguration; + return normalizeProxyConfiguration(proxyConfiguration); } exports.loadProxyConfiguration = loadProxyConfiguration; /** diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 463e23c61..ada061d3c 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-d482c65'; +const VERSION = '18.0.0-next.2+sha-733fba2'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index afc3f865a..cb3710d2e 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Apr 10 2024 13:57:47 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Apr 10 2024 14:03:06 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 0dd43098fa59bed197abe8714a0a6b598a9e13c2 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 10 Apr 2024 15:05:00 +0000 Subject: [PATCH 0033/1223] 2acf95a fix(@angular-devkit/build-angular): do not generate an `index.html` file in the browser directory when using SSR. --- package.json | 10 ++--- src/builders/application/options.js | 67 ++++++++++++++++++----------- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 49 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index 3b8bfa50a..5180d906e 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-733fba2", + "version": "18.0.0-next.2+sha-2acf95a", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#733fba2", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#733fba2", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#733fba2", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2acf95a", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#2acf95a", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#2acf95a", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#733fba2", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#2acf95a", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/builders/application/options.js b/src/builders/application/options.js index cdf5b19a2..dbe24e64c 100644 --- a/src/builders/application/options.js +++ b/src/builders/application/options.js @@ -114,29 +114,6 @@ async function normalizeOptions(context, projectName, options, extensions) { const tailwindConfiguration = postcssConfiguration ? undefined : await getTailwindConfig(searchDirectories, workspaceRoot, context); - const globalStyles = normalizeGlobalEntries(options.styles, 'styles'); - const globalScripts = normalizeGlobalEntries(options.scripts, 'scripts'); - let indexHtmlOptions; - // index can never have a value of `true` but in the schema it's of type `boolean`. - if (typeof options.index !== 'boolean') { - indexHtmlOptions = { - input: node_path_1.default.join(workspaceRoot, typeof options.index === 'string' ? options.index : options.index.input), - // The output file will be created within the configured output path - output: typeof options.index === 'string' - ? node_path_1.default.basename(options.index) - : options.index.output || 'index.html', - insertionOrder: [ - ['polyfills', true], - ...globalStyles.filter((s) => s.initial).map((s) => [s.name, false]), - ...globalScripts.filter((s) => s.initial).map((s) => [s.name, false]), - ['main', true], - // [name, esm] - ], - transformer: extensions?.indexHtmlTransformer, - // Preload initial defaults to true - preloadInitial: typeof options.index !== 'object' || (options.index.preloadInitial ?? true), - }; - } let serverEntryPoint; if (options.server) { serverEntryPoint = node_path_1.default.join(workspaceRoot, options.server); @@ -168,8 +145,48 @@ async function normalizeOptions(context, projectName, options, extensions) { route: 'shell', }; } - if ((appShellOptions || ssrOptions || prerenderOptions) && !serverEntryPoint) { - throw new Error('The "server" option is required when enabling "ssr", "prerender" or "app-shell".'); + const globalStyles = normalizeGlobalEntries(options.styles, 'styles'); + const globalScripts = normalizeGlobalEntries(options.scripts, 'scripts'); + let indexHtmlOptions; + // index can never have a value of `true` but in the schema it's of type `boolean`. + if (typeof options.index !== 'boolean') { + let indexOutput; + // The output file will be created within the configured output path + if (typeof options.index === 'string') { + /** + * If SSR is activated, create a distinct entry file for the `index.html`. + * This is necessary because numerous server/cloud providers automatically serve the `index.html` as a static file + * if it exists (handling SSG). + * For instance, accessing `foo.com/` would lead to `foo.com/index.html` being served instead of hitting the server. + */ + const indexBaseName = node_path_1.default.basename(options.index); + indexOutput = ssrOptions && indexBaseName === 'index.html' ? 'index.csr.html' : indexBaseName; + } + else { + indexOutput = options.index.output || 'index.html'; + } + indexHtmlOptions = { + input: node_path_1.default.join(workspaceRoot, typeof options.index === 'string' ? options.index : options.index.input), + output: indexOutput, + insertionOrder: [ + ['polyfills', true], + ...globalStyles.filter((s) => s.initial).map((s) => [s.name, false]), + ...globalScripts.filter((s) => s.initial).map((s) => [s.name, false]), + ['main', true], + // [name, esm] + ], + transformer: extensions?.indexHtmlTransformer, + // Preload initial defaults to true + preloadInitial: typeof options.index !== 'object' || (options.index.preloadInitial ?? true), + }; + } + if (appShellOptions || ssrOptions || prerenderOptions) { + if (!serverEntryPoint) { + throw new Error('The "server" option is required when enabling "ssr", "prerender" or "app-shell".'); + } + if (!indexHtmlOptions) { + throw new Error('The "index" option cannot be set to false when enabling "ssr", "prerender" or "app-shell".'); + } } // Initial options to keep const { allowedCommonJsDependencies, aot, baseHref, crossOrigin, externalDependencies, extractLicenses, inlineStyleLanguage = 'css', outExtension, serviceWorker, poll, polyfills, statsJson, stylePreprocessorOptions, subresourceIntegrity, verbose, watch, progress = true, externalPackages, deleteOutputPath, namedChunks, budgets, deployUrl, clearScreen, define, } = options; diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index ada061d3c..9ecf67982 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-733fba2'; +const VERSION = '18.0.0-next.2+sha-2acf95a'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index cb3710d2e..f1b218d4e 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Apr 10 2024 14:03:06 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Apr 10 2024 15:05:00 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 294eb214793000563d31ac4f21441409253f9e6b Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 11 Apr 2024 11:47:54 +0000 Subject: [PATCH 0034/1223] 75a01d6 refactor(@angular-devkit/build-angular): directly resolve asset files in application builder --- package.json | 10 +++---- src/builders/application/execute-build.js | 6 ++-- src/utils/normalize-cache.js | 2 +- src/utils/resolve-assets.d.ts | 18 ++++++++++++ src/utils/resolve-assets.js | 35 +++++++++++++++++++++++ uniqueId | 2 +- 6 files changed, 62 insertions(+), 11 deletions(-) create mode 100644 src/utils/resolve-assets.d.ts create mode 100644 src/utils/resolve-assets.js diff --git a/package.json b/package.json index 5180d906e..1abddf7a3 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-2acf95a", + "version": "18.0.0-next.2+sha-75a01d6", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#2acf95a", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#2acf95a", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#2acf95a", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#75a01d6", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#75a01d6", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#75a01d6", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#2acf95a", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#75a01d6", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/builders/application/execute-build.js b/src/builders/application/execute-build.js index 2ad32101c..39277eadb 100644 --- a/src/builders/application/execute-build.js +++ b/src/builders/application/execute-build.js @@ -16,7 +16,7 @@ const commonjs_checker_1 = require("../../tools/esbuild/commonjs-checker"); const license_extractor_1 = require("../../tools/esbuild/license-extractor"); const utils_1 = require("../../tools/esbuild/utils"); const bundle_calculator_1 = require("../../utils/bundle-calculator"); -const copy_assets_1 = require("../../utils/copy-assets"); +const resolve_assets_1 = require("../../utils/resolve-assets"); const supported_browsers_1 = require("../../utils/supported-browsers"); const execute_post_bundle_1 = require("./execute-post-bundle"); const i18n_1 = require("./i18n"); @@ -86,9 +86,7 @@ async function executeBuild(options, context, rebuildState) { } // Copy assets if (assets) { - // The webpack copy assets helper is used with no base paths defined. This prevents the helper - // from directly writing to disk. This should eventually be replaced with a more optimized helper. - executionResult.addAssets(await (0, copy_assets_1.copyAssets)(assets, [], workspaceRoot)); + executionResult.addAssets(await (0, resolve_assets_1.resolveAssets)(assets, workspaceRoot)); } // Extract and write licenses for used packages if (options.extractLicenses) { diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 9ecf67982..52126069d 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-2acf95a'; +const VERSION = '18.0.0-next.2+sha-75a01d6'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/src/utils/resolve-assets.d.ts b/src/utils/resolve-assets.d.ts new file mode 100644 index 000000000..2f7444eaf --- /dev/null +++ b/src/utils/resolve-assets.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright Google LLC 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 + */ +export declare function resolveAssets(entries: { + glob: string; + ignore?: string[]; + input: string; + output: string; + flatten?: boolean; + followSymlinks?: boolean; +}[], root: string): Promise<{ + source: string; + destination: string; +}[]>; diff --git a/src/utils/resolve-assets.js b/src/utils/resolve-assets.js new file mode 100644 index 000000000..c037c29e0 --- /dev/null +++ b/src/utils/resolve-assets.js @@ -0,0 +1,35 @@ +"use strict"; +/** + * @license + * Copyright Google LLC 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 + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveAssets = void 0; +const fast_glob_1 = __importDefault(require("fast-glob")); +const node_path_1 = __importDefault(require("node:path")); +async function resolveAssets(entries, root) { + const defaultIgnore = ['.gitkeep', '**/.DS_Store', '**/Thumbs.db']; + const outputFiles = []; + for (const entry of entries) { + const cwd = node_path_1.default.resolve(root, entry.input); + const files = await (0, fast_glob_1.default)(entry.glob, { + cwd, + dot: true, + ignore: entry.ignore ? defaultIgnore.concat(entry.ignore) : defaultIgnore, + followSymbolicLinks: entry.followSymlinks, + }); + for (const file of files) { + const src = node_path_1.default.join(cwd, file); + const filePath = entry.flatten ? node_path_1.default.basename(file) : file; + outputFiles.push({ source: src, destination: node_path_1.default.join(entry.output, filePath) }); + } + } + return outputFiles; +} +exports.resolveAssets = resolveAssets; diff --git a/uniqueId b/uniqueId index f1b218d4e..60d57ef8d 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Apr 10 2024 15:05:00 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Apr 11 2024 11:47:54 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From d95176600e710cd9dfaa1a5e7d36c8188ffb871c Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 11 Apr 2024 11:55:51 +0000 Subject: [PATCH 0035/1223] 344193f build: update angular --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 1abddf7a3..ec2ce3cac 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-75a01d6", + "version": "18.0.0-next.2+sha-344193f", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#75a01d6", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#75a01d6", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#75a01d6", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#344193f", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#344193f", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#344193f", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#75a01d6", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#344193f", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 52126069d..17a14a423 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-75a01d6'; +const VERSION = '18.0.0-next.2+sha-344193f'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 60d57ef8d..0a10f7056 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Apr 11 2024 11:47:54 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Apr 11 2024 11:55:51 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 08286ab578259787d77dda54b646d3427f7d0faa Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 11 Apr 2024 15:19:29 +0000 Subject: [PATCH 0036/1223] 1a602fc docs: release notes for the v16.2.14 release --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index ec2ce3cac..777015068 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-344193f", + "version": "18.0.0-next.2+sha-1a602fc", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#344193f", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#344193f", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#344193f", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#1a602fc", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#1a602fc", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#1a602fc", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#344193f", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#1a602fc", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 17a14a423..b131c7ca8 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-344193f'; +const VERSION = '18.0.0-next.2+sha-1a602fc'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 0a10f7056..695c00267 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Apr 11 2024 11:55:51 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Apr 11 2024 15:19:29 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 99fa2c8f355e331b346e26edd0f1be430cda7e28 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 11 Apr 2024 16:16:13 +0000 Subject: [PATCH 0037/1223] 03d0fca docs: release notes for the v17.3.4 release --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 777015068..e71be9f60 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-1a602fc", + "version": "18.0.0-next.2+sha-03d0fca", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#1a602fc", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#1a602fc", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#1a602fc", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#03d0fca", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#03d0fca", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#03d0fca", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#1a602fc", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#03d0fca", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index b131c7ca8..474f47bbb 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-1a602fc'; +const VERSION = '18.0.0-next.2+sha-03d0fca'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 695c00267..cdba4e527 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Apr 11 2024 15:19:29 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Apr 11 2024 16:16:13 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 84bb536ab82dfba6377cff970c0a077cd80cec73 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 11 Apr 2024 17:44:16 +0000 Subject: [PATCH 0038/1223] dcee94b refactor(@angular-devkit/build-angular): split Webpack-specific functionality from i18n option creation --- package.json | 10 +- src/builders/dev-server/webpack-server.js | 4 +- src/utils/action-executor.d.ts | 2 +- src/utils/i18n-inlining.d.ts | 2 +- src/utils/i18n-options.d.ts | 11 +-- src/utils/i18n-options.js | 101 +------------------- src/utils/i18n-webpack.d.ts | 16 ++++ src/utils/i18n-webpack.js | 108 ++++++++++++++++++++++ src/utils/normalize-cache.js | 2 +- src/utils/output-paths.d.ts | 2 +- src/utils/webpack-browser-config.d.ts | 2 +- src/utils/webpack-browser-config.js | 4 +- uniqueId | 2 +- 13 files changed, 145 insertions(+), 121 deletions(-) create mode 100644 src/utils/i18n-webpack.d.ts create mode 100644 src/utils/i18n-webpack.js diff --git a/package.json b/package.json index e71be9f60..4a28d27e7 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-03d0fca", + "version": "18.0.0-next.2+sha-dcee94b", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#03d0fca", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#03d0fca", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#03d0fca", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#dcee94b", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#dcee94b", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#dcee94b", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#03d0fca", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#dcee94b", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/builders/dev-server/webpack-server.js b/src/builders/dev-server/webpack-server.js index d5b5d9435..2176dcf67 100644 --- a/src/builders/dev-server/webpack-server.js +++ b/src/builders/dev-server/webpack-server.js @@ -42,7 +42,7 @@ const service_worker_plugin_1 = require("../../tools/webpack/plugins/service-wor const stats_1 = require("../../tools/webpack/utils/stats"); const utils_1 = require("../../utils"); const color_1 = require("../../utils/color"); -const i18n_options_1 = require("../../utils/i18n-options"); +const i18n_webpack_1 = require("../../utils/i18n-webpack"); const load_translations_1 = require("../../utils/load-translations"); const package_chunk_sort_1 = require("../../utils/package-chunk-sort"); const version_1 = require("../../utils/version"); @@ -266,7 +266,7 @@ async function setupLocalize(locale, i18n, browserOptions, webpackConfig, cacheO compiler.hooks.thisCompilation.tap('build-angular', (compilation) => { if (i18n.shouldInline && i18nLoaderOptions.translation === undefined) { // Reload translations - (0, i18n_options_1.loadTranslations)(locale, localeDescription, context.workspaceRoot, loader, { + (0, i18n_webpack_1.loadTranslations)(locale, localeDescription, context.workspaceRoot, loader, { warn(message) { (0, webpack_diagnostics_1.addWarning)(compilation, message); }, diff --git a/src/utils/action-executor.d.ts b/src/utils/action-executor.d.ts index 8cf0d46ec..59a872665 100644 --- a/src/utils/action-executor.d.ts +++ b/src/utils/action-executor.d.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ import { InlineOptions } from './bundle-inline-options'; -import { I18nOptions } from './i18n-options'; +import { I18nOptions } from './i18n-webpack'; export declare class BundleActionExecutor { private workerOptions; private workerPool?; diff --git a/src/utils/i18n-inlining.d.ts b/src/utils/i18n-inlining.d.ts index 9efffb61b..e4f90af74 100644 --- a/src/utils/i18n-inlining.d.ts +++ b/src/utils/i18n-inlining.d.ts @@ -7,5 +7,5 @@ */ import { BuilderContext } from '@angular-devkit/architect'; import { EmittedFiles } from '@angular-devkit/build-webpack'; -import { I18nOptions } from './i18n-options'; +import { I18nOptions } from './i18n-webpack'; export declare function i18nInlineEmittedFiles(context: BuilderContext, emittedFiles: EmittedFiles[], i18n: I18nOptions, baseOutputPath: string, outputPaths: string[], scriptsEntryPointName: string[], emittedPath: string, missingTranslation: 'error' | 'warning' | 'ignore' | undefined): Promise; diff --git a/src/utils/i18n-options.d.ts b/src/utils/i18n-options.d.ts index f5c4d775a..ea1e4d63c 100644 --- a/src/utils/i18n-options.d.ts +++ b/src/utils/i18n-options.d.ts @@ -5,10 +5,7 @@ * 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 */ -import { BuilderContext } from '@angular-devkit/architect'; -import { Schema as BrowserBuilderSchema, I18NTranslation } from '../builders/browser/schema'; -import { Schema as ServerBuilderSchema } from '../builders/server/schema'; -import { TranslationLoader } from './load-translations'; +import type { TranslationLoader } from './load-translations'; export interface LocaleDescription { files: { path: string; @@ -30,11 +27,7 @@ export interface I18nOptions { export declare function createI18nOptions(projectMetadata: { i18n?: unknown; }, inline?: boolean | string[]): I18nOptions; -export declare function configureI18nBuild(context: BuilderContext, options: T): Promise<{ - buildOptions: T; - i18n: I18nOptions; -}>; export declare function loadTranslations(locale: string, desc: LocaleDescription, workspaceRoot: string, loader: TranslationLoader, logger: { warn: (message: string) => void; error: (message: string) => void; -}, usedFormats?: Set, duplicateTranslation?: I18NTranslation): void; +}, usedFormats?: Set, duplicateTranslation?: 'ignore' | 'error' | 'warning'): void; diff --git a/src/utils/i18n-options.js b/src/utils/i18n-options.js index 8123fb735..bb65ce96d 100644 --- a/src/utils/i18n-options.js +++ b/src/utils/i18n-options.js @@ -10,18 +10,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.loadTranslations = exports.configureI18nBuild = exports.createI18nOptions = void 0; -const node_fs_1 = __importDefault(require("node:fs")); -const node_module_1 = require("node:module"); -const node_os_1 = __importDefault(require("node:os")); +exports.loadTranslations = exports.createI18nOptions = void 0; const node_path_1 = __importDefault(require("node:path")); -const schema_1 = require("../builders/browser/schema"); -const read_tsconfig_1 = require("../utils/read-tsconfig"); -const load_translations_1 = require("./load-translations"); -/** - * The base module location used to search for locale specific data. - */ -const LOCALE_DATA_BASE_MODULE = '@angular/common/locales/global'; function normalizeTranslationFileOption(option, locale, expectObjectInError) { if (typeof option === 'string') { return [option]; @@ -123,89 +113,6 @@ function createI18nOptions(projectMetadata, inline) { return i18n; } exports.createI18nOptions = createI18nOptions; -async function configureI18nBuild(context, options) { - if (!context.target) { - throw new Error('The builder requires a target.'); - } - const buildOptions = { ...options }; - const tsConfig = await (0, read_tsconfig_1.readTsconfig)(buildOptions.tsConfig, context.workspaceRoot); - const metadata = await context.getProjectMetadata(context.target); - const i18n = createI18nOptions(metadata, buildOptions.localize); - // No additional processing needed if no inlining requested and no source locale defined. - if (!i18n.shouldInline && !i18n.hasDefinedSourceLocale) { - return { buildOptions, i18n }; - } - const projectRoot = node_path_1.default.join(context.workspaceRoot, metadata.root || ''); - // The trailing slash is required to signal that the path is a directory and not a file. - const projectRequire = (0, node_module_1.createRequire)(projectRoot + '/'); - const localeResolver = (locale) => projectRequire.resolve(node_path_1.default.join(LOCALE_DATA_BASE_MODULE, locale)); - // Load locale data and translations (if present) - let loader; - const usedFormats = new Set(); - for (const [locale, desc] of Object.entries(i18n.locales)) { - if (!i18n.inlineLocales.has(locale) && locale !== i18n.sourceLocale) { - continue; - } - let localeDataPath = findLocaleDataPath(locale, localeResolver); - if (!localeDataPath) { - const [first] = locale.split('-'); - if (first) { - localeDataPath = findLocaleDataPath(first.toLowerCase(), localeResolver); - if (localeDataPath) { - context.logger.warn(`Locale data for '${locale}' cannot be found. Using locale data for '${first}'.`); - } - } - } - if (!localeDataPath) { - context.logger.warn(`Locale data for '${locale}' cannot be found. No locale data will be included for this locale.`); - } - else { - desc.dataPath = localeDataPath; - } - if (!desc.files.length) { - continue; - } - loader ??= await (0, load_translations_1.createTranslationLoader)(); - loadTranslations(locale, desc, context.workspaceRoot, loader, { - warn(message) { - context.logger.warn(message); - }, - error(message) { - throw new Error(message); - }, - }, usedFormats, buildOptions.i18nDuplicateTranslation); - if (usedFormats.size > 1 && tsConfig.options.enableI18nLegacyMessageIdFormat !== false) { - // This limitation is only for legacy message id support (defaults to true as of 9.0) - throw new Error('Localization currently only supports using one type of translation file format for the entire application.'); - } - } - // If inlining store the output in a temporary location to facilitate post-processing - if (i18n.shouldInline) { - // TODO: we should likely save these in the .angular directory in the next major version. - // We'd need to do a migration to add the temp directory to gitignore. - const tempPath = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_fs_1.default.realpathSync(node_os_1.default.tmpdir()), 'angular-cli-i18n-')); - buildOptions.outputPath = tempPath; - process.on('exit', () => { - try { - node_fs_1.default.rmSync(tempPath, { force: true, recursive: true, maxRetries: 3 }); - } - catch { } - }); - } - return { buildOptions, i18n }; -} -exports.configureI18nBuild = configureI18nBuild; -function findLocaleDataPath(locale, resolver) { - // Remove private use subtags - const scrubbedLocale = locale.replace(/-x(-[a-zA-Z0-9]{1,8})+$/, ''); - try { - return resolver(scrubbedLocale); - } - catch { - // fallback to known existing en-US locale data as of 14.0 - return scrubbedLocale === 'en-US' ? findLocaleDataPath('en', resolver) : null; - } -} function loadTranslations(locale, desc, workspaceRoot, loader, logger, usedFormats, duplicateTranslation) { let translations = undefined; for (const file of desc.files) { @@ -230,12 +137,12 @@ function loadTranslations(locale, desc, workspaceRoot, loader, logger, usedForma if (translations[id] !== undefined) { const duplicateTranslationMessage = `[${file.path}]: Duplicate translations for message '${id}' when merging.`; switch (duplicateTranslation) { - case schema_1.I18NTranslation.Ignore: + case 'ignore': break; - case schema_1.I18NTranslation.Error: + case 'error': logger.error(`ERROR ${duplicateTranslationMessage}`); break; - case schema_1.I18NTranslation.Warning: + case 'warning': default: logger.warn(`WARNING ${duplicateTranslationMessage}`); break; diff --git a/src/utils/i18n-webpack.d.ts b/src/utils/i18n-webpack.d.ts new file mode 100644 index 000000000..eb889bb0e --- /dev/null +++ b/src/utils/i18n-webpack.d.ts @@ -0,0 +1,16 @@ +/** + * @license + * Copyright Google LLC 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 + */ +import { BuilderContext } from '@angular-devkit/architect'; +import { Schema as BrowserBuilderSchema } from '../builders/browser/schema'; +import { Schema as ServerBuilderSchema } from '../builders/server/schema'; +import { I18nOptions, loadTranslations } from './i18n-options'; +export { I18nOptions, loadTranslations }; +export declare function configureI18nBuild(context: BuilderContext, options: T): Promise<{ + buildOptions: T; + i18n: I18nOptions; +}>; diff --git a/src/utils/i18n-webpack.js b/src/utils/i18n-webpack.js new file mode 100644 index 000000000..0dbdab5c9 --- /dev/null +++ b/src/utils/i18n-webpack.js @@ -0,0 +1,108 @@ +"use strict"; +/** + * @license + * Copyright Google LLC 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 + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.configureI18nBuild = exports.loadTranslations = void 0; +const node_fs_1 = __importDefault(require("node:fs")); +const node_module_1 = require("node:module"); +const node_os_1 = __importDefault(require("node:os")); +const node_path_1 = __importDefault(require("node:path")); +const read_tsconfig_1 = require("../utils/read-tsconfig"); +const i18n_options_1 = require("./i18n-options"); +Object.defineProperty(exports, "loadTranslations", { enumerable: true, get: function () { return i18n_options_1.loadTranslations; } }); +const load_translations_1 = require("./load-translations"); +/** + * The base module location used to search for locale specific data. + */ +const LOCALE_DATA_BASE_MODULE = '@angular/common/locales/global'; +async function configureI18nBuild(context, options) { + if (!context.target) { + throw new Error('The builder requires a target.'); + } + const buildOptions = { ...options }; + const tsConfig = await (0, read_tsconfig_1.readTsconfig)(buildOptions.tsConfig, context.workspaceRoot); + const metadata = await context.getProjectMetadata(context.target); + const i18n = (0, i18n_options_1.createI18nOptions)(metadata, buildOptions.localize); + // No additional processing needed if no inlining requested and no source locale defined. + if (!i18n.shouldInline && !i18n.hasDefinedSourceLocale) { + return { buildOptions, i18n }; + } + const projectRoot = node_path_1.default.join(context.workspaceRoot, metadata.root || ''); + // The trailing slash is required to signal that the path is a directory and not a file. + const projectRequire = (0, node_module_1.createRequire)(projectRoot + '/'); + const localeResolver = (locale) => projectRequire.resolve(node_path_1.default.join(LOCALE_DATA_BASE_MODULE, locale)); + // Load locale data and translations (if present) + let loader; + const usedFormats = new Set(); + for (const [locale, desc] of Object.entries(i18n.locales)) { + if (!i18n.inlineLocales.has(locale) && locale !== i18n.sourceLocale) { + continue; + } + let localeDataPath = findLocaleDataPath(locale, localeResolver); + if (!localeDataPath) { + const [first] = locale.split('-'); + if (first) { + localeDataPath = findLocaleDataPath(first.toLowerCase(), localeResolver); + if (localeDataPath) { + context.logger.warn(`Locale data for '${locale}' cannot be found. Using locale data for '${first}'.`); + } + } + } + if (!localeDataPath) { + context.logger.warn(`Locale data for '${locale}' cannot be found. No locale data will be included for this locale.`); + } + else { + desc.dataPath = localeDataPath; + } + if (!desc.files.length) { + continue; + } + loader ??= await (0, load_translations_1.createTranslationLoader)(); + (0, i18n_options_1.loadTranslations)(locale, desc, context.workspaceRoot, loader, { + warn(message) { + context.logger.warn(message); + }, + error(message) { + throw new Error(message); + }, + }, usedFormats, buildOptions.i18nDuplicateTranslation); + if (usedFormats.size > 1 && tsConfig.options.enableI18nLegacyMessageIdFormat !== false) { + // This limitation is only for legacy message id support (defaults to true as of 9.0) + throw new Error('Localization currently only supports using one type of translation file format for the entire application.'); + } + } + // If inlining store the output in a temporary location to facilitate post-processing + if (i18n.shouldInline) { + // TODO: we should likely save these in the .angular directory in the next major version. + // We'd need to do a migration to add the temp directory to gitignore. + const tempPath = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_fs_1.default.realpathSync(node_os_1.default.tmpdir()), 'angular-cli-i18n-')); + buildOptions.outputPath = tempPath; + process.on('exit', () => { + try { + node_fs_1.default.rmSync(tempPath, { force: true, recursive: true, maxRetries: 3 }); + } + catch { } + }); + } + return { buildOptions, i18n }; +} +exports.configureI18nBuild = configureI18nBuild; +function findLocaleDataPath(locale, resolver) { + // Remove private use subtags + const scrubbedLocale = locale.replace(/-x(-[a-zA-Z0-9]{1,8})+$/, ''); + try { + return resolver(scrubbedLocale); + } + catch { + // fallback to known existing en-US locale data as of 14.0 + return scrubbedLocale === 'en-US' ? findLocaleDataPath('en', resolver) : null; + } +} diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 474f47bbb..c655ae622 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-03d0fca'; +const VERSION = '18.0.0-next.2+sha-dcee94b'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/src/utils/output-paths.d.ts b/src/utils/output-paths.d.ts index 039b07c14..beb43dd87 100644 --- a/src/utils/output-paths.d.ts +++ b/src/utils/output-paths.d.ts @@ -5,5 +5,5 @@ * 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 */ -import { I18nOptions } from './i18n-options'; +import { I18nOptions } from './i18n-webpack'; export declare function ensureOutputPaths(baseOutputPath: string, i18n: I18nOptions): Map; diff --git a/src/utils/webpack-browser-config.d.ts b/src/utils/webpack-browser-config.d.ts index 5f50fab61..152ae9679 100644 --- a/src/utils/webpack-browser-config.d.ts +++ b/src/utils/webpack-browser-config.d.ts @@ -10,7 +10,7 @@ import { Configuration } from 'webpack'; import { Schema as BrowserBuilderSchema } from '../builders/browser/schema'; import { NormalizedBrowserBuilderSchema } from '../utils'; import { WebpackConfigOptions } from '../utils/build-options'; -import { I18nOptions } from './i18n-options'; +import { I18nOptions } from './i18n-webpack'; export type BrowserWebpackConfigOptions = WebpackConfigOptions; export type WebpackPartialGenerator = (configurationOptions: BrowserWebpackConfigOptions) => (Promise | Configuration)[]; export declare function generateWebpackConfig(workspaceRoot: string, projectRoot: string, sourceRoot: string | undefined, projectName: string, options: NormalizedBrowserBuilderSchema, webpackPartialGenerator: WebpackPartialGenerator, logger: BuilderContext['logger'], extraBuildOptions: Partial): Promise; diff --git a/src/utils/webpack-browser-config.js b/src/utils/webpack-browser-config.js index a294940d9..569c5ecc8 100644 --- a/src/utils/webpack-browser-config.js +++ b/src/utils/webpack-browser-config.js @@ -37,7 +37,7 @@ const webpack_merge_1 = require("webpack-merge"); const builder_watch_plugin_1 = require("../tools/webpack/plugins/builder-watch-plugin"); const utils_1 = require("../utils"); const read_tsconfig_1 = require("../utils/read-tsconfig"); -const i18n_options_1 = require("./i18n-options"); +const i18n_webpack_1 = require("./i18n-webpack"); async function generateWebpackConfig(workspaceRoot, projectRoot, sourceRoot, projectName, options, webpackPartialGenerator, logger, extraBuildOptions) { // Ensure Build Optimizer is only used with AOT. if (options.buildOptimizer && !options.aot) { @@ -63,7 +63,7 @@ async function generateWebpackConfig(workspaceRoot, projectRoot, sourceRoot, pro } exports.generateWebpackConfig = generateWebpackConfig; async function generateI18nBrowserWebpackConfigFromContext(options, context, webpackPartialGenerator, extraBuildOptions = {}) { - const { buildOptions, i18n } = await (0, i18n_options_1.configureI18nBuild)(context, options); + const { buildOptions, i18n } = await (0, i18n_webpack_1.configureI18nBuild)(context, options); const result = await generateBrowserWebpackConfigFromContext(buildOptions, context, (wco) => { return webpackPartialGenerator(wco); }, extraBuildOptions); diff --git a/uniqueId b/uniqueId index cdba4e527..d346e15cb 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Apr 11 2024 16:16:13 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Apr 11 2024 17:44:16 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From ac09a0bb42e968af86cd6024649b8677a6016c20 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 11 Apr 2024 22:32:59 +0000 Subject: [PATCH 0039/1223] f3024aa build: update dependency typescript to v5.4.5 --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 4a28d27e7..ac174d36b 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-dcee94b", + "version": "18.0.0-next.2+sha-f3024aa", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#dcee94b", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#dcee94b", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#dcee94b", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#f3024aa", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#f3024aa", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#f3024aa", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#dcee94b", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#f3024aa", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index c655ae622..ba3335ebb 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-dcee94b'; +const VERSION = '18.0.0-next.2+sha-f3024aa'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index d346e15cb..c7e8d1629 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Apr 11 2024 17:44:16 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu Apr 11 2024 22:32:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From e5c7f201d14ec1085cb74e8ffe2aba895ba59bee Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 12 Apr 2024 13:33:02 +0000 Subject: [PATCH 0040/1223] 4fe345a build: update all non-major dependencies --- package.json | 18 +++++++-------- .../stylesheets/css-resource-plugin.js | 23 ++++++++++++------- src/tools/sass/rebasing-importer.js | 9 +++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 5 files changed, 29 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index ac174d36b..04323ddf8 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-f3024aa", + "version": "18.0.0-next.2+sha-4fe345a", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#f3024aa", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#f3024aa", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#f3024aa", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#4fe345a", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#4fe345a", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#4fe345a", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#f3024aa", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#4fe345a", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", @@ -29,7 +29,7 @@ "browserslist": "^4.21.5", "copy-webpack-plugin": "11.0.0", "critters": "0.0.22", - "css-loader": "7.1.0", + "css-loader": "7.1.1", "esbuild-wasm": "0.20.2", "fast-glob": "3.3.2", "https-proxy-agent": "7.0.4", @@ -53,15 +53,15 @@ "postcss-loader": "8.1.1", "resolve-url-loader": "5.0.0", "rxjs": "7.8.1", - "sass": "1.74.1", - "sass-loader": "14.1.1", + "sass": "1.75.0", + "sass-loader": "14.2.0", "semver": "7.6.0", "source-map-loader": "5.0.0", "source-map-support": "0.5.21", "terser": "5.30.3", "tree-kill": "1.2.2", "tslib": "2.6.2", - "undici": "6.12.0", + "undici": "6.13.0", "vite": "5.2.8", "watchpack": "2.4.1", "webpack": "5.91.0", diff --git a/src/tools/esbuild/stylesheets/css-resource-plugin.js b/src/tools/esbuild/stylesheets/css-resource-plugin.js index 4d8f544cb..478dda07f 100644 --- a/src/tools/esbuild/stylesheets/css-resource-plugin.js +++ b/src/tools/esbuild/stylesheets/css-resource-plugin.js @@ -30,31 +30,38 @@ function createCssResourcePlugin(cache) { name: 'angular-css-resource', setup(build) { build.onResolve({ filter: /.*/ }, async (args) => { + const { importer, path, kind, resolveDir, namespace, pluginData = {} } = args; // Only attempt to resolve url tokens which only exist inside CSS. // Also, skip this plugin if already attempting to resolve the url-token. - if (args.kind !== 'url-token' || args.pluginData?.[CSS_RESOURCE_RESOLUTION]) { + if (kind !== 'url-token' || pluginData[CSS_RESOURCE_RESOLUTION]) { return null; } + let [containingDir, resourceUrl] = path.split('||file:', 2); + if (resourceUrl === undefined) { + // This can happen due to early exit checks in rebasing-importer + // logic such as when the url is an external URL. + resourceUrl = containingDir; + containingDir = ''; + } // If root-relative, absolute or protocol relative url, mark as external to leave the // path/URL in place. - if (/^((?:\w+:)?\/\/|data:|chrome:|#|\/)/.test(args.path)) { + if (/^((?:\w+:)?\/\/|data:|chrome:|#|\/)/.test(resourceUrl)) { return { - path: args.path, + path: resourceUrl, external: true, }; } - const { importer, kind, resolveDir, namespace, pluginData = {} } = args; pluginData[CSS_RESOURCE_RESOLUTION] = true; - const result = await build.resolve(args.path, { + const result = await build.resolve(resourceUrl, { importer, kind, namespace, pluginData, - resolveDir, + resolveDir: (0, node_path_1.join)(resolveDir, containingDir), }); if (result.errors.length) { const error = result.errors[0]; - if (args.path[0] === '~') { + if (resourceUrl[0] === '~') { error.notes = [ { location: null, @@ -62,7 +69,7 @@ function createCssResourcePlugin(cache) { }, ]; } - else if (args.path[0] === '^') { + else if (resourceUrl[0] === '^') { error.notes = [ { location: null, diff --git a/src/tools/sass/rebasing-importer.js b/src/tools/sass/rebasing-importer.js index ca1fbdbeb..fabfcc06b 100644 --- a/src/tools/sass/rebasing-importer.js +++ b/src/tools/sass/rebasing-importer.js @@ -69,16 +69,13 @@ class UrlRebasingImporter { if (value.length === 0 || value[0] === '~' || value[0] === '^') { continue; } - // Skip if value is a Sass variable. - // Sass variable usage either starts with a `$` or contains a namespace and a `.$` - if (value[0] === '$' || /^\w+\.\$/.test(value)) { - continue; - } // Skip if root-relative, absolute or protocol relative url if (/^((?:\w+:)?\/\/|data:|chrome:|#|\/)/.test(value)) { continue; } - const rebasedPath = (0, node_path_1.relative)(this.entryDirectory, (0, node_path_1.join)(stylesheetDirectory, value)); + // Sass variable usage either starts with a `$` or contains a namespace and a `.$` + const valueNormalized = value[0] === '$' || /^\w+\.\$/.test(value) ? `#{${value}}` : value; + const rebasedPath = (0, node_path_1.relative)(this.entryDirectory, stylesheetDirectory) + '||file:' + valueNormalized; // Normalize path separators and escape characters // https://developer.mozilla.org/en-US/docs/Web/CSS/url#syntax const rebasedUrl = ensureRelative(rebasedPath.replace(/\\/g, '/').replace(/[()\s'"]/g, '\\$&')); diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index ba3335ebb..c5dc4b9f3 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-f3024aa'; +const VERSION = '18.0.0-next.2+sha-4fe345a'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index c7e8d1629..e25396e15 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu Apr 11 2024 22:32:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri Apr 12 2024 13:33:02 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From dd8f8f9dfada4733f45b1699aedb386a88c2a340 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 15 Apr 2024 10:40:09 +0000 Subject: [PATCH 0041/1223] 7549f1b build: update angular --- package.json | 12 +- src/tools/esbuild/utils.js | 4 +- src/tools/webpack/utils/stats.d.ts | 13 -- src/tools/webpack/utils/stats.js | 210 +---------------------------- src/utils/bundle-calculator.js | 10 +- src/utils/format-bytes.d.ts | 8 ++ src/utils/format-bytes.js | 22 +++ src/utils/normalize-cache.js | 2 +- src/utils/stats-table.d.ts | 20 +++ src/utils/stats-table.js | 205 ++++++++++++++++++++++++++++ uniqueId | 2 +- 11 files changed, 273 insertions(+), 235 deletions(-) create mode 100644 src/utils/format-bytes.d.ts create mode 100644 src/utils/format-bytes.js create mode 100644 src/utils/stats-table.d.ts create mode 100644 src/utils/stats-table.js diff --git a/package.json b/package.json index 04323ddf8..333553934 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-4fe345a", + "version": "18.0.0-next.2+sha-7549f1b", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#4fe345a", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#4fe345a", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#4fe345a", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#7549f1b", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#7549f1b", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#7549f1b", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#4fe345a", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#7549f1b", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", @@ -34,7 +34,7 @@ "fast-glob": "3.3.2", "https-proxy-agent": "7.0.4", "http-proxy-middleware": "3.0.0", - "inquirer": "9.2.17", + "inquirer": "9.2.18", "jsonc-parser": "3.2.1", "karma-source-map-support": "1.4.0", "less": "4.2.0", diff --git a/src/tools/esbuild/utils.js b/src/tools/esbuild/utils.js index 483cdeae2..8512687de 100644 --- a/src/tools/esbuild/utils.js +++ b/src/tools/esbuild/utils.js @@ -20,7 +20,7 @@ const node_url_1 = require("node:url"); const node_zlib_1 = require("node:zlib"); const semver_1 = require("semver"); const spinner_1 = require("../../utils/spinner"); -const stats_1 = require("../webpack/utils/stats"); +const stats_table_1 = require("../../utils/stats-table"); const bundler_context_1 = require("./bundler-context"); function logBuildStats(metafile, initial, budgetFailures, colors, changedFiles, estimatedTransferSizes, ssrOutputEnabled, verbose) { const browserStats = []; @@ -65,7 +65,7 @@ function logBuildStats(metafile, initial, budgetFailures, colors, changedFiles, } } if (browserStats.length > 0 || serverStats.length > 0) { - const tableText = (0, stats_1.generateEsbuildBuildStatsTable)([browserStats, serverStats], colors, unchangedCount === 0, !!estimatedTransferSizes, budgetFailures, verbose); + const tableText = (0, stats_table_1.generateEsbuildBuildStatsTable)([browserStats, serverStats], colors, unchangedCount === 0, !!estimatedTransferSizes, budgetFailures, verbose); return tableText + '\n'; } else if (changedFiles !== undefined) { diff --git a/src/tools/webpack/utils/stats.d.ts b/src/tools/webpack/utils/stats.d.ts index 7925beb64..1883af435 100644 --- a/src/tools/webpack/utils/stats.d.ts +++ b/src/tools/webpack/utils/stats.d.ts @@ -11,19 +11,6 @@ import { Configuration, StatsCompilation } from 'webpack'; import { Schema as BrowserBuilderOptions } from '../../../builders/browser/schema'; import { BudgetCalculatorResult } from '../../../utils/bundle-calculator'; import { WebpackStatsOptions } from './helpers'; -export declare function formatSize(size: number): string; -export type BundleStatsData = [ - files: string, - names: string, - rawSize: number | string, - estimatedTransferSize: number | string -]; -export interface BundleStats { - initial: boolean; - stats: BundleStatsData; -} -export declare function generateEsbuildBuildStatsTable([browserStats, serverStats]: [browserStats: BundleStats[], serverStats: BundleStats[]], colors: boolean, showTotalSize: boolean, showEstimatedTransferSize: boolean, budgetFailures?: BudgetCalculatorResult[], verbose?: boolean): string; -export declare function generateBuildStatsTable(data: BundleStats[], colors: boolean, showTotalSize: boolean, showEstimatedTransferSize: boolean, budgetFailures?: BudgetCalculatorResult[]): string; export declare function statsWarningsToString(json: StatsCompilation, statsConfig: WebpackStatsOptions): string; export declare function statsErrorsToString(json: StatsCompilation, statsConfig: WebpackStatsOptions): string; export declare function statsHasErrors(json: StatsCompilation): boolean; diff --git a/src/tools/webpack/utils/stats.js b/src/tools/webpack/utils/stats.js index f87fc0048..1d2fa764a 100644 --- a/src/tools/webpack/utils/stats.js +++ b/src/tools/webpack/utils/stats.js @@ -33,26 +33,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.webpackStatsLogger = exports.generateBuildEventStats = exports.createWebpackLoggingCallback = exports.statsHasWarnings = exports.statsHasErrors = exports.statsErrorsToString = exports.statsWarningsToString = exports.generateBuildStatsTable = exports.generateEsbuildBuildStatsTable = exports.formatSize = void 0; +exports.webpackStatsLogger = exports.generateBuildEventStats = exports.createWebpackLoggingCallback = exports.statsHasWarnings = exports.statsHasErrors = exports.statsErrorsToString = exports.statsWarningsToString = void 0; const node_assert_1 = __importDefault(require("node:assert")); const path = __importStar(require("node:path")); -const node_util_1 = require("node:util"); const utils_1 = require("../../../utils"); const color_1 = require("../../../utils/color"); +const stats_table_1 = require("../../../utils/stats-table"); const async_chunks_1 = require("./async-chunks"); const helpers_1 = require("./helpers"); -function formatSize(size) { - if (size <= 0) { - return '0 bytes'; - } - const abbreviations = ['bytes', 'kB', 'MB', 'GB']; - const index = Math.floor(Math.log(size) / Math.log(1024)); - const roundedSize = size / Math.pow(1024, index); - // bytes don't have a fraction - const fractionDigits = index === 0 ? 0 : 2; - return `${roundedSize.toFixed(fractionDigits)} ${abbreviations[index]}`; -} -exports.formatSize = formatSize; function getBuildDuration(webpackStats) { (0, node_assert_1.default)(webpackStats.builtAt, 'buildAt cannot be undefined'); (0, node_assert_1.default)(webpackStats.time, 'time cannot be undefined'); @@ -72,198 +60,6 @@ function generateBundleStats(info) { stats: [files, names, rawSize, estimatedTransferSize], }; } -function generateEsbuildBuildStatsTable([browserStats, serverStats], colors, showTotalSize, showEstimatedTransferSize, budgetFailures, verbose) { - const bundleInfo = generateBuildStatsData(browserStats, colors, showTotalSize, showEstimatedTransferSize, budgetFailures, verbose); - if (serverStats.length) { - const m = (x) => (colors ? color_1.colors.magenta(x) : x); - if (browserStats.length) { - bundleInfo.unshift([m('Browser bundles')]); - // Add seperators between browser and server logs - bundleInfo.push([], []); - } - bundleInfo.push([m('Server bundles')], ...generateBuildStatsData(serverStats, colors, false, false, undefined, verbose)); - } - return generateTableText(bundleInfo, colors); -} -exports.generateEsbuildBuildStatsTable = generateEsbuildBuildStatsTable; -function generateBuildStatsTable(data, colors, showTotalSize, showEstimatedTransferSize, budgetFailures) { - const bundleInfo = generateBuildStatsData(data, colors, showTotalSize, showEstimatedTransferSize, budgetFailures, true); - return generateTableText(bundleInfo, colors); -} -exports.generateBuildStatsTable = generateBuildStatsTable; -function generateBuildStatsData(data, colors, showTotalSize, showEstimatedTransferSize, budgetFailures, verbose) { - if (data.length === 0) { - return []; - } - const g = (x) => (colors ? color_1.colors.green(x) : x); - const c = (x) => (colors ? color_1.colors.cyan(x) : x); - const r = (x) => (colors ? color_1.colors.redBright(x) : x); - const y = (x) => (colors ? color_1.colors.yellowBright(x) : x); - const bold = (x) => (colors ? color_1.colors.bold(x) : x); - const dim = (x) => (colors ? color_1.colors.dim(x) : x); - const getSizeColor = (name, file, defaultColor = c) => { - const severity = budgets.get(name) || (file && budgets.get(file)); - switch (severity) { - case 'warning': - return y; - case 'error': - return r; - default: - return defaultColor; - } - }; - const changedEntryChunksStats = []; - const changedLazyChunksStats = []; - let initialTotalRawSize = 0; - let changedLazyChunksCount = 0; - let initialTotalEstimatedTransferSize; - const maxLazyChunksWithoutBudgetFailures = 15; - const budgets = new Map(); - if (budgetFailures) { - for (const { label, severity } of budgetFailures) { - // In some cases a file can have multiple budget failures. - // Favor error. - if (label && (!budgets.has(label) || budgets.get(label) === 'warning')) { - budgets.set(label, severity); - } - } - } - // Sort descending by raw size - data.sort((a, b) => { - if (a.stats[2] > b.stats[2]) { - return -1; - } - if (a.stats[2] < b.stats[2]) { - return 1; - } - return 0; - }); - for (const { initial, stats } of data) { - const [files, names, rawSize, estimatedTransferSize] = stats; - if (!initial && - !verbose && - changedLazyChunksStats.length >= maxLazyChunksWithoutBudgetFailures && - !budgets.has(names) && - !budgets.has(files)) { - // Limit the number of lazy chunks displayed in the stats table when there is no budget failure and not in verbose mode. - changedLazyChunksCount++; - continue; - } - const getRawSizeColor = getSizeColor(names, files); - let data; - if (showEstimatedTransferSize) { - data = [ - g(files), - dim(names), - getRawSizeColor(typeof rawSize === 'number' ? formatSize(rawSize) : rawSize), - c(typeof estimatedTransferSize === 'number' - ? formatSize(estimatedTransferSize) - : estimatedTransferSize), - ]; - } - else { - data = [ - g(files), - dim(names), - getRawSizeColor(typeof rawSize === 'number' ? formatSize(rawSize) : rawSize), - '', - ]; - } - if (initial) { - changedEntryChunksStats.push(data); - if (typeof rawSize === 'number') { - initialTotalRawSize += rawSize; - } - if (showEstimatedTransferSize && typeof estimatedTransferSize === 'number') { - if (initialTotalEstimatedTransferSize === undefined) { - initialTotalEstimatedTransferSize = 0; - } - initialTotalEstimatedTransferSize += estimatedTransferSize; - } - } - else { - changedLazyChunksStats.push(data); - changedLazyChunksCount++; - } - } - const bundleInfo = []; - const baseTitles = ['Names', 'Raw size']; - if (showEstimatedTransferSize) { - baseTitles.push('Estimated transfer size'); - } - // Entry chunks - if (changedEntryChunksStats.length) { - bundleInfo.push(['Initial chunk files', ...baseTitles].map(bold), ...changedEntryChunksStats); - if (showTotalSize) { - const initialSizeTotalColor = getSizeColor('bundle initial', undefined, (x) => x); - const totalSizeElements = [ - ' ', - 'Initial total', - initialSizeTotalColor(formatSize(initialTotalRawSize)), - ]; - if (showEstimatedTransferSize) { - totalSizeElements.push(typeof initialTotalEstimatedTransferSize === 'number' - ? formatSize(initialTotalEstimatedTransferSize) - : '-'); - } - bundleInfo.push([], totalSizeElements.map(bold)); - } - } - // Seperator - if (changedEntryChunksStats.length && changedLazyChunksStats.length) { - bundleInfo.push([]); - } - // Lazy chunks - if (changedLazyChunksStats.length) { - bundleInfo.push(['Lazy chunk files', ...baseTitles].map(bold), ...changedLazyChunksStats); - if (changedLazyChunksCount > changedLazyChunksStats.length) { - bundleInfo.push([ - dim(`...and ${changedLazyChunksCount - changedLazyChunksStats.length} more lazy chunks files. ` + - 'Use "--verbose" to show all the files.'), - ]); - } - } - return bundleInfo; -} -function generateTableText(bundleInfo, colors) { - const skipText = (value) => value.includes('...and '); - const longest = []; - for (const item of bundleInfo) { - for (let i = 0; i < item.length; i++) { - if (item[i] === undefined) { - continue; - } - const currentItem = item[i].toString(); - if (skipText(currentItem)) { - continue; - } - const currentLongest = (longest[i] ??= 0); - const currentItemLength = (0, node_util_1.stripVTControlCharacters)(currentItem).length; - if (currentLongest < currentItemLength) { - longest[i] = currentItemLength; - } - } - } - const seperator = colors ? color_1.colors.dim(' | ') : ' | '; - const outputTable = []; - for (const item of bundleInfo) { - for (let i = 0; i < longest.length; i++) { - if (item[i] === undefined) { - continue; - } - const currentItem = item[i].toString(); - if (skipText(currentItem)) { - continue; - } - const currentItemLength = (0, node_util_1.stripVTControlCharacters)(currentItem).length; - const stringPad = ' '.repeat(longest[i] - currentItemLength); - // Values in columns at index 2 and 3 (Raw and Estimated sizes) are always right aligned. - item[i] = i >= 2 ? stringPad + currentItem : currentItem + stringPad; - } - outputTable.push(item.join(seperator)); - } - return outputTable.join('\n'); -} // We use this cache because we can have multiple builders running in the same process, // where each builder has different output path. // Ideally, we should create the logging callback as a factory, but that would need a refactoring. @@ -309,7 +105,7 @@ statsConfig, budgetFailures) { } unchangedChunkNumber = json.chunks.length - changedChunksStats.length; runsCache.add(json.outputPath || ''); - const statsTable = generateBuildStatsTable(changedChunksStats, colors, unchangedChunkNumber === 0, hasEstimatedTransferSizes, budgetFailures); + const statsTable = (0, stats_table_1.generateBuildStatsTable)(changedChunksStats, colors, unchangedChunkNumber === 0, hasEstimatedTransferSizes, budgetFailures); // In some cases we do things outside of webpack context // Such us index generation, service worker augmentation etc... // This will correct the time and include these. diff --git a/src/utils/bundle-calculator.js b/src/utils/bundle-calculator.js index 0500364ef..b5a1d8157 100644 --- a/src/utils/bundle-calculator.js +++ b/src/utils/bundle-calculator.js @@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.checkThresholds = exports.checkBudgets = exports.calculateThresholds = exports.ThresholdSeverity = void 0; const schema_1 = require("../builders/browser/schema"); -const stats_1 = require("../tools/webpack/utils/stats"); +const format_bytes_1 = require("./format-bytes"); var ThresholdType; (function (ThresholdType) { ThresholdType["Max"] = "maximum"; @@ -273,11 +273,11 @@ function* checkThresholds(thresholds, size, label) { if (size <= threshold.limit) { continue; } - const sizeDifference = (0, stats_1.formatSize)(size - threshold.limit); + const sizeDifference = (0, format_bytes_1.formatSize)(size - threshold.limit); yield { severity: threshold.severity, label, - message: `${label} exceeded maximum budget. Budget ${(0, stats_1.formatSize)(threshold.limit)} was not met by ${sizeDifference} with a total of ${(0, stats_1.formatSize)(size)}.`, + message: `${label} exceeded maximum budget. Budget ${(0, format_bytes_1.formatSize)(threshold.limit)} was not met by ${sizeDifference} with a total of ${(0, format_bytes_1.formatSize)(size)}.`, }; break; } @@ -285,11 +285,11 @@ function* checkThresholds(thresholds, size, label) { if (size >= threshold.limit) { continue; } - const sizeDifference = (0, stats_1.formatSize)(threshold.limit - size); + const sizeDifference = (0, format_bytes_1.formatSize)(threshold.limit - size); yield { severity: threshold.severity, label, - message: `${label} failed to meet minimum budget. Budget ${(0, stats_1.formatSize)(threshold.limit)} was not met by ${sizeDifference} with a total of ${(0, stats_1.formatSize)(size)}.`, + message: `${label} failed to meet minimum budget. Budget ${(0, format_bytes_1.formatSize)(threshold.limit)} was not met by ${sizeDifference} with a total of ${(0, format_bytes_1.formatSize)(size)}.`, }; break; } diff --git a/src/utils/format-bytes.d.ts b/src/utils/format-bytes.d.ts new file mode 100644 index 000000000..b81baec23 --- /dev/null +++ b/src/utils/format-bytes.d.ts @@ -0,0 +1,8 @@ +/** + * @license + * Copyright Google LLC 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 + */ +export declare function formatSize(size: number): string; diff --git a/src/utils/format-bytes.js b/src/utils/format-bytes.js new file mode 100644 index 000000000..b7d869ccd --- /dev/null +++ b/src/utils/format-bytes.js @@ -0,0 +1,22 @@ +"use strict"; +/** + * @license + * Copyright Google LLC 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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.formatSize = void 0; +function formatSize(size) { + if (size <= 0) { + return '0 bytes'; + } + const abbreviations = ['bytes', 'kB', 'MB', 'GB']; + const index = Math.floor(Math.log(size) / Math.log(1024)); + const roundedSize = size / Math.pow(1024, index); + // bytes don't have a fraction + const fractionDigits = index === 0 ? 0 : 2; + return `${roundedSize.toFixed(fractionDigits)} ${abbreviations[index]}`; +} +exports.formatSize = formatSize; diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index c5dc4b9f3..ac30a4ff8 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-4fe345a'; +const VERSION = '18.0.0-next.2+sha-7549f1b'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/src/utils/stats-table.d.ts b/src/utils/stats-table.d.ts new file mode 100644 index 000000000..47f912262 --- /dev/null +++ b/src/utils/stats-table.d.ts @@ -0,0 +1,20 @@ +/** + * @license + * Copyright Google LLC 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 + */ +import { BudgetCalculatorResult } from './bundle-calculator'; +export type BundleStatsData = [ + files: string, + names: string, + rawSize: number | string, + estimatedTransferSize: number | string +]; +export interface BundleStats { + initial: boolean; + stats: BundleStatsData; +} +export declare function generateEsbuildBuildStatsTable([browserStats, serverStats]: [browserStats: BundleStats[], serverStats: BundleStats[]], colors: boolean, showTotalSize: boolean, showEstimatedTransferSize: boolean, budgetFailures?: BudgetCalculatorResult[], verbose?: boolean): string; +export declare function generateBuildStatsTable(data: BundleStats[], colors: boolean, showTotalSize: boolean, showEstimatedTransferSize: boolean, budgetFailures?: BudgetCalculatorResult[]): string; diff --git a/src/utils/stats-table.js b/src/utils/stats-table.js new file mode 100644 index 000000000..b1c69a089 --- /dev/null +++ b/src/utils/stats-table.js @@ -0,0 +1,205 @@ +"use strict"; +/** + * @license + * Copyright Google LLC 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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.generateBuildStatsTable = exports.generateEsbuildBuildStatsTable = void 0; +const node_util_1 = require("node:util"); +const color_1 = require("./color"); +const format_bytes_1 = require("./format-bytes"); +function generateEsbuildBuildStatsTable([browserStats, serverStats], colors, showTotalSize, showEstimatedTransferSize, budgetFailures, verbose) { + const bundleInfo = generateBuildStatsData(browserStats, colors, showTotalSize, showEstimatedTransferSize, budgetFailures, verbose); + if (serverStats.length) { + const m = (x) => (colors ? color_1.colors.magenta(x) : x); + if (browserStats.length) { + bundleInfo.unshift([m('Browser bundles')]); + // Add seperators between browser and server logs + bundleInfo.push([], []); + } + bundleInfo.push([m('Server bundles')], ...generateBuildStatsData(serverStats, colors, false, false, undefined, verbose)); + } + return generateTableText(bundleInfo, colors); +} +exports.generateEsbuildBuildStatsTable = generateEsbuildBuildStatsTable; +function generateBuildStatsTable(data, colors, showTotalSize, showEstimatedTransferSize, budgetFailures) { + const bundleInfo = generateBuildStatsData(data, colors, showTotalSize, showEstimatedTransferSize, budgetFailures, true); + return generateTableText(bundleInfo, colors); +} +exports.generateBuildStatsTable = generateBuildStatsTable; +function generateBuildStatsData(data, colors, showTotalSize, showEstimatedTransferSize, budgetFailures, verbose) { + if (data.length === 0) { + return []; + } + const g = (x) => (colors ? color_1.colors.green(x) : x); + const c = (x) => (colors ? color_1.colors.cyan(x) : x); + const r = (x) => (colors ? color_1.colors.redBright(x) : x); + const y = (x) => (colors ? color_1.colors.yellowBright(x) : x); + const bold = (x) => (colors ? color_1.colors.bold(x) : x); + const dim = (x) => (colors ? color_1.colors.dim(x) : x); + const getSizeColor = (name, file, defaultColor = c) => { + const severity = budgets.get(name) || (file && budgets.get(file)); + switch (severity) { + case 'warning': + return y; + case 'error': + return r; + default: + return defaultColor; + } + }; + const changedEntryChunksStats = []; + const changedLazyChunksStats = []; + let initialTotalRawSize = 0; + let changedLazyChunksCount = 0; + let initialTotalEstimatedTransferSize; + const maxLazyChunksWithoutBudgetFailures = 15; + const budgets = new Map(); + if (budgetFailures) { + for (const { label, severity } of budgetFailures) { + // In some cases a file can have multiple budget failures. + // Favor error. + if (label && (!budgets.has(label) || budgets.get(label) === 'warning')) { + budgets.set(label, severity); + } + } + } + // Sort descending by raw size + data.sort((a, b) => { + if (a.stats[2] > b.stats[2]) { + return -1; + } + if (a.stats[2] < b.stats[2]) { + return 1; + } + return 0; + }); + for (const { initial, stats } of data) { + const [files, names, rawSize, estimatedTransferSize] = stats; + if (!initial && + !verbose && + changedLazyChunksStats.length >= maxLazyChunksWithoutBudgetFailures && + !budgets.has(names) && + !budgets.has(files)) { + // Limit the number of lazy chunks displayed in the stats table when there is no budget failure and not in verbose mode. + changedLazyChunksCount++; + continue; + } + const getRawSizeColor = getSizeColor(names, files); + let data; + if (showEstimatedTransferSize) { + data = [ + g(files), + dim(names), + getRawSizeColor(typeof rawSize === 'number' ? (0, format_bytes_1.formatSize)(rawSize) : rawSize), + c(typeof estimatedTransferSize === 'number' + ? (0, format_bytes_1.formatSize)(estimatedTransferSize) + : estimatedTransferSize), + ]; + } + else { + data = [ + g(files), + dim(names), + getRawSizeColor(typeof rawSize === 'number' ? (0, format_bytes_1.formatSize)(rawSize) : rawSize), + '', + ]; + } + if (initial) { + changedEntryChunksStats.push(data); + if (typeof rawSize === 'number') { + initialTotalRawSize += rawSize; + } + if (showEstimatedTransferSize && typeof estimatedTransferSize === 'number') { + if (initialTotalEstimatedTransferSize === undefined) { + initialTotalEstimatedTransferSize = 0; + } + initialTotalEstimatedTransferSize += estimatedTransferSize; + } + } + else { + changedLazyChunksStats.push(data); + changedLazyChunksCount++; + } + } + const bundleInfo = []; + const baseTitles = ['Names', 'Raw size']; + if (showEstimatedTransferSize) { + baseTitles.push('Estimated transfer size'); + } + // Entry chunks + if (changedEntryChunksStats.length) { + bundleInfo.push(['Initial chunk files', ...baseTitles].map(bold), ...changedEntryChunksStats); + if (showTotalSize) { + const initialSizeTotalColor = getSizeColor('bundle initial', undefined, (x) => x); + const totalSizeElements = [ + ' ', + 'Initial total', + initialSizeTotalColor((0, format_bytes_1.formatSize)(initialTotalRawSize)), + ]; + if (showEstimatedTransferSize) { + totalSizeElements.push(typeof initialTotalEstimatedTransferSize === 'number' + ? (0, format_bytes_1.formatSize)(initialTotalEstimatedTransferSize) + : '-'); + } + bundleInfo.push([], totalSizeElements.map(bold)); + } + } + // Seperator + if (changedEntryChunksStats.length && changedLazyChunksStats.length) { + bundleInfo.push([]); + } + // Lazy chunks + if (changedLazyChunksStats.length) { + bundleInfo.push(['Lazy chunk files', ...baseTitles].map(bold), ...changedLazyChunksStats); + if (changedLazyChunksCount > changedLazyChunksStats.length) { + bundleInfo.push([ + dim(`...and ${changedLazyChunksCount - changedLazyChunksStats.length} more lazy chunks files. ` + + 'Use "--verbose" to show all the files.'), + ]); + } + } + return bundleInfo; +} +function generateTableText(bundleInfo, colors) { + const skipText = (value) => value.includes('...and '); + const longest = []; + for (const item of bundleInfo) { + for (let i = 0; i < item.length; i++) { + if (item[i] === undefined) { + continue; + } + const currentItem = item[i].toString(); + if (skipText(currentItem)) { + continue; + } + const currentLongest = (longest[i] ??= 0); + const currentItemLength = (0, node_util_1.stripVTControlCharacters)(currentItem).length; + if (currentLongest < currentItemLength) { + longest[i] = currentItemLength; + } + } + } + const seperator = colors ? color_1.colors.dim(' | ') : ' | '; + const outputTable = []; + for (const item of bundleInfo) { + for (let i = 0; i < longest.length; i++) { + if (item[i] === undefined) { + continue; + } + const currentItem = item[i].toString(); + if (skipText(currentItem)) { + continue; + } + const currentItemLength = (0, node_util_1.stripVTControlCharacters)(currentItem).length; + const stringPad = ' '.repeat(longest[i] - currentItemLength); + // Values in columns at index 2 and 3 (Raw and Estimated sizes) are always right aligned. + item[i] = i >= 2 ? stringPad + currentItem : currentItem + stringPad; + } + outputTable.push(item.join(seperator)); + } + return outputTable.join('\n'); +} diff --git a/uniqueId b/uniqueId index e25396e15..f87257af0 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri Apr 12 2024 13:33:02 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Apr 15 2024 10:40:09 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 3f606d78e4a112d2e38bd5861a61380c8429470a Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 15 Apr 2024 13:53:34 +0000 Subject: [PATCH 0042/1223] 4d27c38 refactor(@angular-devkit/build-angular): reduce Webpack specific overlap in bundle budget calculator --- package.json | 10 +++---- .../any-component-style-budget-checker.d.ts | 4 +-- .../any-component-style-budget-checker.js | 29 +++++++++---------- src/utils/bundle-calculator.d.ts | 10 +++---- src/utils/bundle-calculator.js | 5 ++-- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 7 files changed, 30 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index 333553934..521e6cc2f 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-7549f1b", + "version": "18.0.0-next.2+sha-4d27c38", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#7549f1b", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#7549f1b", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#7549f1b", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#4d27c38", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#4d27c38", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#4d27c38", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#7549f1b", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#4d27c38", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/tools/webpack/plugins/any-component-style-budget-checker.d.ts b/src/tools/webpack/plugins/any-component-style-budget-checker.d.ts index dd9604a7b..bd12f5a08 100644 --- a/src/tools/webpack/plugins/any-component-style-budget-checker.d.ts +++ b/src/tools/webpack/plugins/any-component-style-budget-checker.d.ts @@ -6,13 +6,13 @@ * found in the LICENSE file at https://angular.io/license */ import { Compiler } from 'webpack'; -import { Budget } from '../../../builders/browser/schema'; +import { BudgetEntry } from '../../../utils/bundle-calculator'; /** * Check budget sizes for component styles by emitting a warning or error if a * budget is exceeded by a particular component's styles. */ export declare class AnyComponentStyleBudgetChecker { private readonly budgets; - constructor(budgets: Budget[]); + constructor(budgets: BudgetEntry[]); apply(compiler: Compiler): void; } diff --git a/src/tools/webpack/plugins/any-component-style-budget-checker.js b/src/tools/webpack/plugins/any-component-style-budget-checker.js index a4ede09af..2c83d2de4 100644 --- a/src/tools/webpack/plugins/any-component-style-budget-checker.js +++ b/src/tools/webpack/plugins/any-component-style-budget-checker.js @@ -33,7 +33,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.AnyComponentStyleBudgetChecker = void 0; const path = __importStar(require("path")); const webpack_1 = require("webpack"); -const schema_1 = require("../../../builders/browser/schema"); const bundle_calculator_1 = require("../../../utils/bundle-calculator"); const webpack_diagnostics_1 = require("../../../utils/webpack-diagnostics"); const PLUGIN_NAME = 'AnyComponentStyleBudgetChecker'; @@ -44,7 +43,7 @@ const PLUGIN_NAME = 'AnyComponentStyleBudgetChecker'; class AnyComponentStyleBudgetChecker { budgets; constructor(budgets) { - this.budgets = budgets.filter((budget) => budget.type === schema_1.Type.AnyComponentStyle); + this.budgets = budgets.filter((budget) => budget.type === bundle_calculator_1.BudgetType.AnyComponentStyle); } apply(compiler) { compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => { @@ -64,22 +63,20 @@ class AnyComponentStyleBudgetChecker { const componentStyles = Object.keys(compilation.assets) .filter((name) => cssExtensions.includes(path.extname(name))) .map((name) => ({ + name, size: compilation.assets[name].size(), - label: name, + componentStyle: true, })); - const thresholds = this.budgets.flatMap((budget) => [...(0, bundle_calculator_1.calculateThresholds)(budget)]); - for (const { size, label } of componentStyles) { - for (const { severity, message } of (0, bundle_calculator_1.checkThresholds)(thresholds[Symbol.iterator](), size, label)) { - switch (severity) { - case bundle_calculator_1.ThresholdSeverity.Warning: - (0, webpack_diagnostics_1.addWarning)(compilation, message); - break; - case bundle_calculator_1.ThresholdSeverity.Error: - (0, webpack_diagnostics_1.addError)(compilation, message); - break; - default: - assertNever(severity); - } + for (const { severity, message } of (0, bundle_calculator_1.checkBudgets)(this.budgets, { chunks: [], assets: componentStyles }, true)) { + switch (severity) { + case bundle_calculator_1.ThresholdSeverity.Warning: + (0, webpack_diagnostics_1.addWarning)(compilation, message); + break; + case bundle_calculator_1.ThresholdSeverity.Error: + (0, webpack_diagnostics_1.addError)(compilation, message); + break; + default: + assertNever(severity); } } }); diff --git a/src/utils/bundle-calculator.d.ts b/src/utils/bundle-calculator.d.ts index 1e509ee13..898ea84b7 100644 --- a/src/utils/bundle-calculator.d.ts +++ b/src/utils/bundle-calculator.d.ts @@ -5,7 +5,8 @@ * 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 */ -import { Budget } from '../builders/browser/schema'; +import { Budget as BudgetEntry, Type as BudgetType } from '../builders/application/schema'; +export { BudgetEntry, BudgetType }; export interface Threshold { limit: number; type: ThresholdType; @@ -38,7 +39,6 @@ export interface BudgetStats { chunks?: BudgetChunk[]; assets?: BudgetAsset[]; } -export declare function calculateThresholds(budget: Budget): IterableIterator; -export declare function checkBudgets(budgets: Budget[], stats: BudgetStats, checkComponentStyles?: boolean): IterableIterator; -export declare function checkThresholds(thresholds: IterableIterator, size: number, label?: string): IterableIterator; -export {}; +export declare function calculateThresholds(budget: BudgetEntry): IterableIterator; +export declare function checkBudgets(budgets: BudgetEntry[], stats: BudgetStats, checkComponentStyles?: boolean): IterableIterator; +export declare function checkThresholds(thresholds: Iterable, size: number, label?: string): IterableIterator; diff --git a/src/utils/bundle-calculator.js b/src/utils/bundle-calculator.js index b5a1d8157..80b40dfac 100644 --- a/src/utils/bundle-calculator.js +++ b/src/utils/bundle-calculator.js @@ -7,8 +7,9 @@ * found in the LICENSE file at https://angular.io/license */ Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkThresholds = exports.checkBudgets = exports.calculateThresholds = exports.ThresholdSeverity = void 0; -const schema_1 = require("../builders/browser/schema"); +exports.checkThresholds = exports.checkBudgets = exports.calculateThresholds = exports.ThresholdSeverity = exports.BudgetType = void 0; +const schema_1 = require("../builders/application/schema"); +Object.defineProperty(exports, "BudgetType", { enumerable: true, get: function () { return schema_1.Type; } }); const format_bytes_1 = require("./format-bytes"); var ThresholdType; (function (ThresholdType) { diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index ac30a4ff8..5a274ec48 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-7549f1b'; +const VERSION = '18.0.0-next.2+sha-4d27c38'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index f87257af0..86256387e 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Apr 15 2024 10:40:09 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon Apr 15 2024 13:53:34 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 1ca4af84f80dd72a0a9c384946b850f883a64918 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 16 Apr 2024 09:57:45 +0000 Subject: [PATCH 0043/1223] 51d956b build: update all non-major dependencies --- package.json | 12 ++++++------ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 521e6cc2f..1c2f8c11f 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-4d27c38", + "version": "18.0.0-next.2+sha-51d956b", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#4d27c38", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#4d27c38", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#4d27c38", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#51d956b", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#51d956b", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#51d956b", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#4d27c38", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#51d956b", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", @@ -62,7 +62,7 @@ "tree-kill": "1.2.2", "tslib": "2.6.2", "undici": "6.13.0", - "vite": "5.2.8", + "vite": "5.2.9", "watchpack": "2.4.1", "webpack": "5.91.0", "webpack-dev-middleware": "7.2.1", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 5a274ec48..5c5a80a7f 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-4d27c38'; +const VERSION = '18.0.0-next.2+sha-51d956b'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 86256387e..f707ef99a 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon Apr 15 2024 13:53:34 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Apr 16 2024 09:57:45 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From a071ee3fcd5832fc8556bfe8b71ea9069eb4b2b9 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 16 Apr 2024 15:23:03 +0000 Subject: [PATCH 0044/1223] 63dab46 build: update github/codeql-action action to v3.25.0 --- package.json | 10 +++++----- src/builders/dev-server/vite-server.js | 4 ++-- src/utils/index-file/inline-fonts.js | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 1c2f8c11f..34f414f67 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-51d956b", + "version": "18.0.0-next.2+sha-63dab46", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#51d956b", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#51d956b", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#51d956b", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#63dab46", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#63dab46", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#63dab46", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#51d956b", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#63dab46", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index 29733b161..1dc97c23d 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -260,7 +260,7 @@ function handleUpdate(normalizePath, generatedFiles, server, serverOptions, logg if (serverOptions.liveReload || serverOptions.hmr) { if (updatedFiles.every((f) => f.endsWith('.css'))) { const timestamp = Date.now(); - server.ws.send({ + server.hot.send({ type: 'update', updates: updatedFiles.map((filePath) => { return { @@ -277,7 +277,7 @@ function handleUpdate(normalizePath, generatedFiles, server, serverOptions, logg } // Send reload command to clients if (serverOptions.liveReload) { - server.ws.send({ + server.hot.send({ type: 'full-reload', path: '*', }); diff --git a/src/utils/index-file/inline-fonts.js b/src/utils/index-file/inline-fonts.js index 65ca38418..42bc36b75 100644 --- a/src/utils/index-file/inline-fonts.js +++ b/src/utils/index-file/inline-fonts.js @@ -143,7 +143,7 @@ class InlineFontsProcessor { if (hrefAttr) { const href = hrefAttr.value; const cssContent = hrefsContent.get(href); - rewriter.emitRaw(``); + rewriter.emitRaw(``); } else { rewriter.emitStartTag(tag); diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 5c5a80a7f..ecc86ca88 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-51d956b'; +const VERSION = '18.0.0-next.2+sha-63dab46'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index f707ef99a..69f6065d3 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Apr 16 2024 09:57:45 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue Apr 16 2024 15:23:03 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 68a8a0cd71d06bbce7b3eb4a88bab7a817696885 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 17 Apr 2024 08:27:40 +0000 Subject: [PATCH 0045/1223] 6313036 test: move builder testing infrastructure to separate bazel target module --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 34f414f67..c698dfa0d 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-63dab46", + "version": "18.0.0-next.2+sha-6313036", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#63dab46", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#63dab46", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#63dab46", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#6313036", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#6313036", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#6313036", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#63dab46", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#6313036", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index ecc86ca88..430f22093 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-63dab46'; +const VERSION = '18.0.0-next.2+sha-6313036'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 69f6065d3..79ff1f27e 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue Apr 16 2024 15:23:03 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Apr 17 2024 08:27:40 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 2288435b3373bc02c3b35768c2e0358168c195b1 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 17 Apr 2024 13:45:30 +0000 Subject: [PATCH 0046/1223] 1c3ff61 fix(@angular-devkit/build-angular): address `Unable to deserialize cloned data` issue with Yarn PnP --- package.json | 10 +++++----- src/tools/esbuild/javascript-transformer.js | 6 +++++- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index c698dfa0d..59f312835 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-6313036", + "version": "18.0.0-next.2+sha-1c3ff61", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#6313036", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#6313036", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#6313036", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#1c3ff61", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#1c3ff61", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#1c3ff61", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#6313036", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#1c3ff61", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/tools/esbuild/javascript-transformer.js b/src/tools/esbuild/javascript-transformer.js index 88551bfe6..bd0b5bb28 100644 --- a/src/tools/esbuild/javascript-transformer.js +++ b/src/tools/esbuild/javascript-transformer.js @@ -87,7 +87,11 @@ class JavaScriptTransformer { skipLinker, sideEffects, ...this.#commonOptions, - }, { transferList: [data.buffer] })); + }, { + // The below is disable as with Yarn PNP this causes build failures with the below message + // `Unable to deserialize cloned data`. + transferList: process.versions.pnp ? undefined : [data.buffer], + })); // If there is a cache then store the result if (this.cache && cacheKey) { try { diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 430f22093..1180280e1 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-6313036'; +const VERSION = '18.0.0-next.2+sha-1c3ff61'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 79ff1f27e..7634072c1 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Apr 17 2024 08:27:40 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Apr 17 2024 13:45:30 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 01ff753b2ccfe128188bf548bb24830685de7ea3 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 17 Apr 2024 14:12:57 +0000 Subject: [PATCH 0047/1223] c43a353 docs: release notes for the v17.3.5 release --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 59f312835..fc4a7f25f 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-1c3ff61", + "version": "18.0.0-next.2+sha-c43a353", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#1c3ff61", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#1c3ff61", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#1c3ff61", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#c43a353", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#c43a353", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#c43a353", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#1c3ff61", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#c43a353", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 1180280e1..cbb8632ed 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-1c3ff61'; +const VERSION = '18.0.0-next.2+sha-c43a353'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 7634072c1..7d61d9c05 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Apr 17 2024 13:45:30 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Apr 17 2024 14:12:57 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From ba1a500f3381779a9c7907f35a091f5b56138e42 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 17 Apr 2024 16:55:35 +0000 Subject: [PATCH 0048/1223] adf1197 build: update angular --- package.json | 10 +++++----- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index fc4a7f25f..d32ae363a 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-c43a353", + "version": "18.0.0-next.2+sha-adf1197", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#c43a353", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#c43a353", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#c43a353", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#adf1197", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#adf1197", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#adf1197", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#c43a353", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#adf1197", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index cbb8632ed..172344213 100644 --- a/src/utils/normalize-cache.js +++ b/src/utils/normalize-cache.js @@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeCacheOptions = void 0; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '18.0.0-next.2+sha-c43a353'; +const VERSION = '18.0.0-next.2+sha-adf1197'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 7d61d9c05..e02ec8618 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Apr 17 2024 14:12:57 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Apr 17 2024 16:55:35 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 8be70e301d995fa74ce5f1029dae35aa0496b128 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 17 Apr 2024 17:33:38 +0000 Subject: [PATCH 0049/1223] d51cb59 feat(@angular-devkit/build-angular): inject event-dispatch in SSR HTML page --- package.json | 10 ++-- .../application/execute-post-bundle.js | 21 +++---- src/builders/browser/index.js | 2 +- src/tools/esbuild/index-html-generator.d.ts | 4 +- src/tools/esbuild/index-html-generator.js | 58 ++---------------- .../plugins/index-html-webpack-plugin.js | 2 +- .../add-event-dispatch-contract.d.ts | 8 +++ .../index-file/add-event-dispatch-contract.js | 28 +++++++++ src/utils/index-file/augment-index-html.js | 1 + .../index-file/index-html-generator.d.ts | 14 ++++- src/utils/index-file/index-html-generator.js | 60 ++++++++++++------- .../{style-nonce.d.ts => nonce.d.ts} | 4 +- .../index-file/{style-nonce.js => nonce.js} | 12 ++-- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 15 files changed, 121 insertions(+), 107 deletions(-) create mode 100644 src/utils/index-file/add-event-dispatch-contract.d.ts create mode 100644 src/utils/index-file/add-event-dispatch-contract.js rename src/utils/index-file/{style-nonce.d.ts => nonce.d.ts} (77%) rename src/utils/index-file/{style-nonce.js => nonce.js} (84%) diff --git a/package.json b/package.json index d32ae363a..aa5b6dad3 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "@angular-devkit/build-angular", - "version": "18.0.0-next.2+sha-adf1197", + "version": "18.0.0-next.2+sha-d51cb59", "description": "Angular Webpack Build Facade", "main": "src/index.js", "typings": "src/index.d.ts", "builders": "builders.json", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#adf1197", - "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#adf1197", - "@angular-devkit/core": "github:angular/angular-devkit-core-builds#adf1197", + "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#d51cb59", + "@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#d51cb59", + "@angular-devkit/core": "github:angular/angular-devkit-core-builds#d51cb59", "@babel/core": "7.24.4", "@babel/generator": "7.24.4", "@babel/helper-annotate-as-pure": "7.22.5", @@ -20,7 +20,7 @@ "@babel/preset-env": "7.24.4", "@babel/runtime": "7.24.4", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "github:angular/ngtools-webpack-builds#adf1197", + "@ngtools/webpack": "github:angular/ngtools-webpack-builds#d51cb59", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.19", diff --git a/src/builders/application/execute-post-bundle.js b/src/builders/application/execute-post-bundle.js index db5107796..976eb3d04 100644 --- a/src/builders/application/execute-post-bundle.js +++ b/src/builders/application/execute-post-bundle.js @@ -32,37 +32,34 @@ async function executePostBundleSteps(options, outputFiles, assetFiles, initialF const allErrors = []; const allWarnings = []; const prerenderedRoutes = []; - const { serviceWorker, indexHtmlOptions, optimizationOptions, sourcemapOptions, ssrOptions, prerenderOptions, appShellOptions, workspaceRoot, verbose, } = options; + const { serviceWorker, indexHtmlOptions, optimizationOptions, sourcemapOptions, prerenderOptions, appShellOptions, workspaceRoot, verbose, } = options; /** * Index HTML content without CSS inlining to be used for server rendering (AppShell, SSG and SSR). * * NOTE: we don't perform critical CSS inlining as this will be done during server rendering. */ - let indexContentOutputNoCssInlining; + let ssrIndexContent; // When using prerender/app-shell the index HTML file can be regenerated. // Thus, we use a Map so that we do not generate 2 files with the same filename. const additionalHtmlOutputFiles = new Map(); // Generate index HTML file // If localization is enabled, index generation is handled in the inlining process. if (indexHtmlOptions) { - const { content, contentWithoutCriticalCssInlined, errors, warnings } = await (0, index_html_generator_1.generateIndexHtml)(initialFiles, outputFiles, { - ...options, - optimizationOptions, - }, locale); - indexContentOutputNoCssInlining = contentWithoutCriticalCssInlined; + const { csrContent, ssrContent, errors, warnings } = await (0, index_html_generator_1.generateIndexHtml)(initialFiles, outputFiles, options, locale); allErrors.push(...errors); allWarnings.push(...warnings); - additionalHtmlOutputFiles.set(indexHtmlOptions.output, (0, utils_1.createOutputFileFromText)(indexHtmlOptions.output, content, bundler_context_1.BuildOutputFileType.Browser)); - if (ssrOptions) { + additionalHtmlOutputFiles.set(indexHtmlOptions.output, (0, utils_1.createOutputFileFromText)(indexHtmlOptions.output, csrContent, bundler_context_1.BuildOutputFileType.Browser)); + if (ssrContent) { const serverIndexHtmlFilename = 'index.server.html'; - additionalHtmlOutputFiles.set(serverIndexHtmlFilename, (0, utils_1.createOutputFileFromText)(serverIndexHtmlFilename, contentWithoutCriticalCssInlined, bundler_context_1.BuildOutputFileType.Server)); + additionalHtmlOutputFiles.set(serverIndexHtmlFilename, (0, utils_1.createOutputFileFromText)(serverIndexHtmlFilename, ssrContent, bundler_context_1.BuildOutputFileType.Server)); + ssrIndexContent = ssrContent; } } // Pre-render (SSG) and App-shell // If localization is enabled, prerendering is handled in the inlining process. if (prerenderOptions || appShellOptions) { - (0, node_assert_1.default)(indexContentOutputNoCssInlining, 'The "index" option is required when using the "ssg" or "appShell" options.'); - const { output, warnings, errors, prerenderedRoutes: generatedRoutes, } = await (0, prerender_1.prerenderPages)(workspaceRoot, appShellOptions, prerenderOptions, outputFiles, assetFiles, indexContentOutputNoCssInlining, sourcemapOptions.scripts, optimizationOptions.styles.inlineCritical, environment_options_1.maxWorkers, verbose); + (0, node_assert_1.default)(ssrIndexContent, 'The "index" option is required when using the "ssg" or "appShell" options.'); + const { output, warnings, errors, prerenderedRoutes: generatedRoutes, } = await (0, prerender_1.prerenderPages)(workspaceRoot, appShellOptions, prerenderOptions, outputFiles, assetFiles, ssrIndexContent, sourcemapOptions.scripts, optimizationOptions.styles.inlineCritical, environment_options_1.maxWorkers, verbose); allErrors.push(...errors); allWarnings.push(...warnings); prerenderedRoutes.push(...Array.from(generatedRoutes)); diff --git a/src/builders/browser/index.js b/src/builders/browser/index.js index 8f699053e..851968751 100644 --- a/src/builders/browser/index.js +++ b/src/builders/browser/index.js @@ -229,7 +229,7 @@ function buildWebpackBrowser(options, context, transforms = {}) { let hasErrors = false; for (const [locale, outputPath] of outputPaths.entries()) { try { - const { content, warnings, errors } = await indexHtmlGenerator.process({ + const { csrContent: content, warnings, errors, } = await indexHtmlGenerator.process({ baseHref: getLocaleBaseHref(i18n, locale) ?? options.baseHref, // i18nLocale is used when Ivy is disabled lang: locale || undefined, diff --git a/src/tools/esbuild/index-html-generator.d.ts b/src/tools/esbuild/index-html-generator.d.ts index e97c5935e..d0b703810 100644 --- a/src/tools/esbuild/index-html-generator.d.ts +++ b/src/tools/esbuild/index-html-generator.d.ts @@ -8,8 +8,8 @@ import { NormalizedApplicationBuildOptions } from '../../builders/application/options'; import { BuildOutputFile, InitialFileRecord } from './bundler-context'; export declare function generateIndexHtml(initialFiles: Map, outputFiles: BuildOutputFile[], buildOptions: NormalizedApplicationBuildOptions, lang?: string): Promise<{ - content: string; - contentWithoutCriticalCssInlined: string; + csrContent: string; + ssrContent?: string; warnings: string[]; errors: string[]; }>; diff --git a/src/tools/esbuild/index-html-generator.js b/src/tools/esbuild/index-html-generator.js index c13234f0f..a256571fa 100644 --- a/src/tools/esbuild/index-html-generator.js +++ b/src/tools/esbuild/index-html-generator.js @@ -6,29 +6,6 @@ * 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 */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; @@ -78,19 +55,16 @@ async function generateIndexHtml(initialFiles, outputFiles, buildOptions, lang) indexPath: indexHtmlOptions.input, entrypoints: indexHtmlOptions.insertionOrder, sri: subresourceIntegrity, - optimization: { - ...optimizationOptions, - styles: { - ...optimizationOptions.styles, - inlineCritical: false, // Disable critical css inline as for SSR and SSG this will be done during rendering. - }, - }, + optimization: optimizationOptions, crossOrigin: crossOrigin, deployUrl: buildOptions.publicPath, postTransform: indexHtmlOptions.transformer, + generateDedicatedSSRContent: !!(buildOptions.ssrOptions || + buildOptions.prerenderOptions || + buildOptions.appShellOptions), }); indexHtmlGenerator.readAsset = readAsset; - const transformResult = await indexHtmlGenerator.process({ + return indexHtmlGenerator.process({ baseHref, lang, outputPath: virtualOutputPath, @@ -103,27 +77,5 @@ async function generateIndexHtml(initialFiles, outputFiles, buildOptions, lang) })), hints, }); - const contentWithoutCriticalCssInlined = transformResult.content; - if (!optimizationOptions.styles.inlineCritical) { - return { - ...transformResult, - contentWithoutCriticalCssInlined, - }; - } - const { InlineCriticalCssProcessor } = await Promise.resolve().then(() => __importStar(require('../../utils/index-file/inline-critical-css'))); - const inlineCriticalCssProcessor = new InlineCriticalCssProcessor({ - minify: false, // CSS has already been minified during the build. - deployUrl: buildOptions.publicPath, - readAsset, - }); - const { content, errors, warnings } = await inlineCriticalCssProcessor.process(contentWithoutCriticalCssInlined, { - outputPath: virtualOutputPath, - }); - return { - errors: [...transformResult.errors, ...errors], - warnings: [...transformResult.warnings, ...warnings], - content, - contentWithoutCriticalCssInlined, - }; } exports.generateIndexHtml = generateIndexHtml; diff --git a/src/tools/webpack/plugins/index-html-webpack-plugin.js b/src/tools/webpack/plugins/index-html-webpack-plugin.js index 4830c57aa..5052d026e 100644 --- a/src/tools/webpack/plugins/index-html-webpack-plugin.js +++ b/src/tools/webpack/plugins/index-html-webpack-plugin.js @@ -51,7 +51,7 @@ class IndexHtmlWebpackPlugin extends index_html_generator_1.IndexHtmlGenerator { }); } } - const { content, warnings, errors } = await this.process({ + const { csrContent: content, warnings, errors, } = await this.process({ files, outputPath: (0, path_1.dirname)(this.options.outputPath), baseHref: this.options.baseHref, diff --git a/src/utils/index-file/add-event-dispatch-contract.d.ts b/src/utils/index-file/add-event-dispatch-contract.d.ts new file mode 100644 index 000000000..f48724432 --- /dev/null +++ b/src/utils/index-file/add-event-dispatch-contract.d.ts @@ -0,0 +1,8 @@ +/** + * @license + * Copyright Google LLC 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 + */ +export declare function addEventDispatchContract(html: string): Promise; diff --git a/src/utils/index-file/add-event-dispatch-contract.js b/src/utils/index-file/add-event-dispatch-contract.js new file mode 100644 index 000000000..21cce5d36 --- /dev/null +++ b/src/utils/index-file/add-event-dispatch-contract.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright Google LLC 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 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.addEventDispatchContract = void 0; +const promises_1 = require("node:fs/promises"); +const html_rewriting_stream_1 = require("./html-rewriting-stream"); +let jsActionContractScript; +async function addEventDispatchContract(html) { + const { rewriter, transformedContent } = await (0, html_rewriting_stream_1.htmlRewritingStream)(html); + jsActionContractScript ??= + ''; + rewriter.on('startTag', (tag) => { + rewriter.emitStartTag(tag); + if (tag.tagName === 'body') { + rewriter.emitRaw(jsActionContractScript); + } + }); + return transformedContent(); +} +exports.addEventDispatchContract = addEventDispatchContract; diff --git a/src/utils/index-file/augment-index-html.js b/src/utils/index-file/augment-index-html.js index 359ac4264..5cf6bed4f 100644 --- a/src/utils/index-file/augment-index-html.js +++ b/src/utils/index-file/augment-index-html.js @@ -152,6 +152,7 @@ async function augmentIndexHtml(params) { foundPreconnects.add(href); } } + break; } rewriter.emitStartTag(tag); }) diff --git a/src/utils/index-file/index-html-generator.d.ts b/src/utils/index-file/index-html-generator.d.ts index 842a6d878..45c896428 100644 --- a/src/utils/index-file/index-html-generator.d.ts +++ b/src/utils/index-file/index-html-generator.d.ts @@ -30,18 +30,28 @@ export interface IndexHtmlGeneratorOptions { optimization?: NormalizedOptimizationOptions; cache?: NormalizedCachedOptions; imageDomains?: string[]; + generateDedicatedSSRContent?: boolean; } export type IndexHtmlTransform = (content: string) => Promise; -export interface IndexHtmlTransformResult { +export interface IndexHtmlPluginTransformResult { content: string; warnings: string[]; errors: string[]; } +export interface IndexHtmlProcessResult { + csrContent: string; + ssrContent?: string; + warnings: string[]; + errors: string[]; +} export declare class IndexHtmlGenerator { readonly options: IndexHtmlGeneratorOptions; private readonly plugins; + private readonly csrPlugins; + private readonly ssrPlugins; constructor(options: IndexHtmlGeneratorOptions); - process(options: IndexHtmlGeneratorProcessOptions): Promise; + process(options: IndexHtmlGeneratorProcessOptions): Promise; + private runPlugins; readAsset(path: string): Promise; protected readIndex(path: string): Promise; } diff --git a/src/utils/index-file/index-html-generator.js b/src/utils/index-file/index-html-generator.js index 83e50472a..9d9d2d5d0 100644 --- a/src/utils/index-file/index-html-generator.js +++ b/src/utils/index-file/index-html-generator.js @@ -10,36 +10,53 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.IndexHtmlGenerator = void 0; const promises_1 = require("node:fs/promises"); const node_path_1 = require("node:path"); +const add_event_dispatch_contract_1 = require("./add-event-dispatch-contract"); const augment_index_html_1 = require("./augment-index-html"); const inline_critical_css_1 = require("./inline-critical-css"); const inline_fonts_1 = require("./inline-fonts"); -const style_nonce_1 = require("./style-nonce"); +const nonce_1 = require("./nonce"); class IndexHtmlGenerator { options; plugins; + csrPlugins = []; + ssrPlugins = []; constructor(options) { this.options = options; - const extraPlugins = []; - if (this.options.optimization?.fonts.inline) { - extraPlugins.push(inlineFontsPlugin(this)); + const extraCommonPlugins = []; + if (options?.optimization?.fonts.inline) { + extraCommonPlugins.push(inlineFontsPlugin(this), nonce_1.addNonce); } - if (this.options.optimization?.styles.inlineCritical) { - extraPlugins.push(inlineCriticalCssPlugin(this)); + // Common plugins + this.plugins = [augmentIndexHtmlPlugin(this), ...extraCommonPlugins, postTransformPlugin(this)]; + // CSR plugins + if (options?.optimization?.styles?.inlineCritical) { + this.csrPlugins.push(inlineCriticalCssPlugin(this)); + } + // SSR plugins + if (options.generateDedicatedSSRContent) { + this.ssrPlugins.push(addEventDispatchContractPlugin(), addNoncePlugin()); } - this.plugins = [ - augmentIndexHtmlPlugin(this), - ...extraPlugins, - // Runs after the `extraPlugins` to capture any nonce or - // `style` tags that might've been added by them. - addStyleNoncePlugin(), - postTransformPlugin(this), - ]; } async process(options) { let content = await this.readIndex(this.options.indexPath); const warnings = []; const errors = []; - for (const plugin of this.plugins) { + content = await this.runPlugins(content, this.plugins, options, warnings, errors); + const [csrContent, ssrContent] = await Promise.all([ + this.runPlugins(content, this.csrPlugins, options, warnings, errors), + this.ssrPlugins.length + ? this.runPlugins(content, this.ssrPlugins, options, warnings, errors) + : undefined, + ]); + return { + ssrContent, + csrContent, + warnings, + errors, + }; + } + async runPlugins(content, plugins, options, warnings, errors) { + for (const plugin of plugins) { const result = await plugin(content, options); if (typeof result === 'string') { content = result; @@ -54,11 +71,7 @@ class IndexHtmlGenerator { } } } - return { - content, - warnings, - errors, - }; + return content; } async readAsset(path) { try { @@ -111,9 +124,12 @@ function inlineCriticalCssPlugin(generator) { }); return async (html, options) => inlineCriticalCssProcessor.process(html, { outputPath: options.outputPath }); } -function addStyleNoncePlugin() { - return (html) => (0, style_nonce_1.addStyleNonce)(html); +function addNoncePlugin() { + return (html) => (0, nonce_1.addNonce)(html); } function postTransformPlugin({ options }) { return async (html) => (options.postTransform ? options.postTransform(html) : html); } +function addEventDispatchContractPlugin() { + return (html) => (0, add_event_dispatch_contract_1.addEventDispatchContract)(html); +} diff --git a/src/utils/index-file/style-nonce.d.ts b/src/utils/index-file/nonce.d.ts similarity index 77% rename from src/utils/index-file/style-nonce.d.ts rename to src/utils/index-file/nonce.d.ts index 10ab07346..e4bf01732 100644 --- a/src/utils/index-file/style-nonce.d.ts +++ b/src/utils/index-file/nonce.d.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ /** - * Finds the `ngCspNonce` value and copies it to all inline ``); - } - else { - rewriter.emitStartTag(tag); - } - break; - default: - rewriter.emitStartTag(tag); - break; - } - }); - return transformedContent(); - } - async getResponse(url) { - let cacheFile; - if (this.cachePath) { - const key = (0, node_crypto_1.createHash)(CONTENT_HASH_ALGORITHM).update(`${url}`).digest('hex'); - cacheFile = (0, node_path_1.join)(this.cachePath, key); - } - if (cacheFile) { - try { - const data = await (0, promises_1.readFile)(cacheFile, 'utf8'); - // Check for valid content via stored hash - if (data.length > CONTENT_HASH_LENGTH) { - const storedHash = data.slice(0, CONTENT_HASH_LENGTH); - const content = data.slice(CONTENT_HASH_LENGTH); - const contentHash = (0, node_crypto_1.createHash)(CONTENT_HASH_ALGORITHM).update(content).digest('base64'); - if (storedHash === contentHash) { - // Return valid content - return content; - } - else { - // Delete corrupted cache content - await (0, promises_1.rm)(cacheFile); - } - } - } - catch { } - } - let agent; - const httpsProxy = process.env.HTTPS_PROXY ?? process.env.https_proxy; - if (httpsProxy) { - agent = new https_proxy_agent_1.HttpsProxyAgent(httpsProxy); - } - const data = await new Promise((resolve, reject) => { - let rawResponse = ''; - https - .get(url, { - agent, - headers: { - /** - * Always use a Windows UA. This is because Google fonts will including hinting in fonts for Windows. - * Hinting is a technique used with Windows files to improve appearance however - * results in 20-50% larger file sizes. - * - * @see http://google3/java/com/google/fonts/css/OpenSansWebFontsCssBuilder.java?l=22 - * @see https://fonts.google.com/knowledge/glossary/hinting (short) - * @see https://glyphsapp.com/learn/hinting-manual-truetype-hinting (deep dive) - */ - 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', - }, - }, (res) => { - if (res.statusCode !== 200) { - reject(new Error(`Inlining of fonts failed. ${url} returned status code: ${res.statusCode}.`)); - return; - } - res.on('data', (chunk) => (rawResponse += chunk)).on('end', () => resolve(rawResponse)); - }) - .on('error', (e) => reject(new Error(`Inlining of fonts failed. An error has occurred while retrieving ${url} over the internet.\n` + - e.message))); - }); - if (cacheFile) { - try { - const dataHash = (0, node_crypto_1.createHash)(CONTENT_HASH_ALGORITHM).update(data).digest('hex'); - await (0, promises_1.writeFile)(cacheFile, dataHash + data); - } - catch { } - } - return data; - } - async processURL(url) { - const normalizedURL = url instanceof URL ? url : this.createNormalizedUrl(url); - if (!normalizedURL) { - return; - } - const provider = this.getFontProviderDetails(normalizedURL); - if (!provider) { - return undefined; - } - let cssContent = await this.getResponse(normalizedURL); - if (this.options.minify) { - cssContent = cssContent - // Comments. - .replace(/\/\*([\s\S]*?)\*\//g, '') - // New lines. - .replace(/\n/g, '') - // Safe spaces. - .replace(/\s?[{:;]\s+/g, (s) => s.trim()); - } - return cssContent; - } - canInlineRequest(url) { - const normalizedUrl = this.createNormalizedUrl(url); - return normalizedUrl ? !!this.getFontProviderDetails(normalizedUrl) : false; - } - getFontProviderDetails(url) { - return SUPPORTED_PROVIDERS[url.hostname]; - } - createNormalizedUrl(value) { - // Need to convert '//' to 'https://' because the URL parser will fail with '//'. - const url = new URL(value.startsWith('//') ? `https:${value}` : value, 'resolve://'); - switch (url.protocol) { - case 'http:': - case 'https:': - url.protocol = 'https:'; - return url; - default: - return undefined; - } - } -} -exports.InlineFontsProcessor = InlineFontsProcessor; diff --git a/src/utils/index-file/nonce.d.ts b/src/utils/index-file/nonce.d.ts deleted file mode 100644 index e4bf01732..000000000 --- a/src/utils/index-file/nonce.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @license - * Copyright Google LLC 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 - */ -/** - * Finds the `ngCspNonce` value and copies it to all inline `