From 4d844ce6fcee4cda382c76485391d11e6fed28f0 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 30 Apr 2025 21:08:55 +0000 Subject: [PATCH 01/63] 02cb7fc release: cut the v20.0.0-next.9 release --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9d2435d3..26432756 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.8+sha-bbb08d6", + "version": "20.0.0-next.9+sha-02cb7fc", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 3e9d7776..7fbf6249 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.8+sha-bbb08d6'; +const VERSION = '20.0.0-next.9+sha-02cb7fc'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index a2ced7e0..54b01c36 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Apr 30 2025 18:45:54 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Apr 30 2025 21:08:55 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From f637fa51d10a9c4896c002272c17639f6a2da23e Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 30 Apr 2025 23:59:11 +0000 Subject: [PATCH 02/63] 8c5e5e6 refactor(@angular-devkit/schematics): add explicit return types to functions --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 26432756..0eca6b69 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-02cb7fc", + "version": "20.0.0-next.9+sha-8c5e5e6", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 7fbf6249..6a7a5fc0 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-02cb7fc'; +const VERSION = '20.0.0-next.9+sha-8c5e5e6'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 54b01c36..e9064c2a 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Apr 30 2025 21:08:55 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed Apr 30 2025 23:59:11 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From b325cd38862cc3fc6212b9ab250cee921b9cc497 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 1 May 2025 16:05:33 +0000 Subject: [PATCH 03/63] 209c8a7 build: update angular --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0eca6b69..6c07b4c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-8c5e5e6", + "version": "20.0.0-next.9+sha-209c8a7", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 6a7a5fc0..3978dd4a 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-8c5e5e6'; +const VERSION = '20.0.0-next.9+sha-209c8a7'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index e9064c2a..35459df8 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed Apr 30 2025 23:59:11 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu May 01 2025 16:05:33 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From cf39d3f66c03fadd58dbaec2b3cb1fab0777031a Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 1 May 2025 16:38:07 +0000 Subject: [PATCH 04/63] 2b28ecd build: update all non-major dependencies --- package.json | 6 +++--- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6c07b4c8..0d8a47f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-209c8a7", + "version": "20.0.0-next.9+sha-2b28ecd", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -24,8 +24,8 @@ "dependencies": { "@ampproject/remapping": "2.3.0", "@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#{BUILD_SCM_ABBREV_HASH}", - "@babel/core": "7.26.10", - "@babel/helper-annotate-as-pure": "7.25.9", + "@babel/core": "7.27.1", + "@babel/helper-annotate-as-pure": "7.27.1", "@babel/helper-split-export-declaration": "7.24.7", "@inquirer/confirm": "5.1.9", "@vitejs/plugin-basic-ssl": "2.0.0", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 3978dd4a..6519ac64 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-209c8a7'; +const VERSION = '20.0.0-next.9+sha-2b28ecd'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 35459df8..3e3a7367 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu May 01 2025 16:05:33 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu May 01 2025 16:38:07 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From d53f430c0542799322a0b62b4f43c71a0c4e4eae Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 1 May 2025 17:07:15 +0000 Subject: [PATCH 05/63] 7bb1f87 fix(@angular/build): enable unit-test reporters option --- package.json | 2 +- src/builders/unit-test/builder.js | 1 + src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0d8a47f7..c2db22cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-2b28ecd", + "version": "20.0.0-next.9+sha-7bb1f87", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/builders/unit-test/builder.js b/src/builders/unit-test/builder.js index 5562b401..34aa36ec 100644 --- a/src/builders/unit-test/builder.js +++ b/src/builders/unit-test/builder.js @@ -144,6 +144,7 @@ async function* execute(options, context, extensions = {}) { environment: browser ? 'node' : 'jsdom', watch: normalizedOptions.watch, browser, + reporters: normalizedOptions.reporters ?? ['default'], coverage: { enabled: normalizedOptions.codeCoverage, exclude: normalizedOptions.codeCoverageExclude, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 6519ac64..5bf6ed5a 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-2b28ecd'; +const VERSION = '20.0.0-next.9+sha-7bb1f87'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 3e3a7367..a3c93013 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu May 01 2025 16:38:07 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu May 01 2025 17:07:15 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From d596f6984ceabda03c44d6686e3f714ff80f5ed2 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 1 May 2025 17:41:46 +0000 Subject: [PATCH 06/63] 0aea13e refactor(@angular-devkit/core): don't use concrete type as interface --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c2db22cc..cc724e50 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-7bb1f87", + "version": "20.0.0-next.9+sha-0aea13e", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 5bf6ed5a..42c8eda4 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-7bb1f87'; +const VERSION = '20.0.0-next.9+sha-0aea13e'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index a3c93013..fbebf593 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu May 01 2025 17:07:15 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu May 01 2025 17:41:46 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 43abd7c85bfde3f3f14cc8a3f59efdff49c94de2 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 1 May 2025 20:44:20 +0000 Subject: [PATCH 07/63] a6a0b41 build: update rules_angular digest to 3ba9d67 --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index cc724e50..ee4c4144 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-0aea13e", + "version": "20.0.0-next.9+sha-a6a0b41", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 42c8eda4..a0641ee2 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-0aea13e'; +const VERSION = '20.0.0-next.9+sha-a6a0b41'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index fbebf593..4b14efe9 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu May 01 2025 17:41:46 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu May 01 2025 20:44:20 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 451450e77b1fccd899afcace0b646c45c8a95702 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 2 May 2025 11:17:55 +0000 Subject: [PATCH 08/63] 1cd65a0 fix(@angular/build): perform testing module cleanup when using Vitest --- package.json | 2 +- src/builders/unit-test/builder.js | 8 +++++++- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ee4c4144..5b47662c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-a6a0b41", + "version": "20.0.0-next.9+sha-1cd65a0", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/builders/unit-test/builder.js b/src/builders/unit-test/builder.js index 34aa36ec..0446bb03 100644 --- a/src/builders/unit-test/builder.js +++ b/src/builders/unit-test/builder.js @@ -89,8 +89,14 @@ async function* execute(options, context, extensions = {}) { loadContent: async () => { const contents = [ // Initialize the Angular testing environment - `import { getTestBed } from '@angular/core/testing';`, + `import { getTestBed, ɵgetCleanupHook as getCleanupHook } from '@angular/core/testing';`, `import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';`, + `import { beforeEach, afterEach } from 'vitest';`, + '', + // Same as https://github.com/angular/angular/blob/05a03d3f975771bb59c7eefd37c01fa127ee2229/packages/core/testing/src/test_hooks.ts#L21-L29 + `beforeEach(getCleanupHook(false));`, + `afterEach(getCleanupHook(true));`, + '', `getTestBed().initTestEnvironment(BrowserTestingModule, platformBrowserTesting(), {`, ` errorOnUnknownElements: true,`, ` errorOnUnknownProperties: true,`, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index a0641ee2..d92e2452 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-a6a0b41'; +const VERSION = '20.0.0-next.9+sha-1cd65a0'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 4b14efe9..e987a6c9 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu May 01 2025 20:44:20 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri May 02 2025 11:17:55 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From d2eed9752731a50882b4da3b432ecafb7fbaf9f7 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 2 May 2025 20:19:52 +0000 Subject: [PATCH 09/63] c8ceeca ci: try simplify windows test preparation with bazel 7 --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 5b47662c..9649280c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-1cd65a0", + "version": "20.0.0-next.9+sha-c8ceeca", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index d92e2452..e50dfa56 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-1cd65a0'; +const VERSION = '20.0.0-next.9+sha-c8ceeca'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index e987a6c9..ba80b183 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri May 02 2025 11:17:55 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri May 02 2025 20:19:52 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 491a90b3dc3a201cdcca54cd288385efeb321db2 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 2 May 2025 20:30:29 +0000 Subject: [PATCH 10/63] ba844ae fix(@angular/build): avoid internal karma request cache for assets --- package.json | 2 +- src/builders/karma/application_builder.js | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9649280c..dc283271 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-c8ceeca", + "version": "20.0.0-next.9+sha-ba844ae", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/builders/karma/application_builder.js b/src/builders/karma/application_builder.js index 699584cf..7ca73bc0 100644 --- a/src/builders/karma/application_builder.js +++ b/src/builders/karma/application_builder.js @@ -88,7 +88,7 @@ class AngularAssetsMiddleware { } switch (file.origin) { case 'disk': - this.serveFile(file.inputPath, undefined, res); + this.serveFile(file.inputPath, undefined, res, undefined, undefined, /* doNotCache */ true); break; case 'memory': // Include pathname to help with Content-Type headers. diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index e50dfa56..70fe1c18 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-c8ceeca'; +const VERSION = '20.0.0-next.9+sha-ba844ae'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index ba80b183..da9fdc22 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri May 02 2025 20:19:52 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri May 02 2025 20:30:29 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 5c382e4c419fd0d64b548cfb80e38011cdcb03f9 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Sat, 3 May 2025 16:11:37 +0000 Subject: [PATCH 11/63] 22ba074 perf(@angular/build): fix unnecessary esbuild rebuilds --- package.json | 2 +- src/tools/esbuild/bundler-context.js | 12 ++++++------ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index dc283271..7b5e3e78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-ba844ae", + "version": "20.0.0-next.9+sha-22ba074", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/tools/esbuild/bundler-context.js b/src/tools/esbuild/bundler-context.js index 08654c33..cfc3efaf 100644 --- a/src/tools/esbuild/bundler-context.js +++ b/src/tools/esbuild/bundler-context.js @@ -184,7 +184,7 @@ class BundlerContext { // When incremental always add any files from the load result cache if (this.#loadCache) { for (const file of this.#loadCache.watchFiles) { - if (!isInternalAngularFile(file)) { + if (!isInternalAngularFileOrEsBuildDefine(file)) { // watch files are fully resolved paths this.watchFiles.add(file); } @@ -198,7 +198,7 @@ class BundlerContext { if (this.incremental) { // Add input files except virtual angular files which do not exist on disk for (const input of Object.keys(result.metafile.inputs)) { - if (!isInternalAngularFile(input)) { + if (!isInternalAngularFileOrEsBuildDefine(input)) { // input file paths are always relative to the workspace root this.watchFiles.add((0, node_path_1.join)(this.workspaceRoot, input)); } @@ -324,12 +324,12 @@ class BundlerContext { #addErrorsToWatch(result) { for (const error of result.errors) { let file = error.location?.file; - if (file && !isInternalAngularFile(file)) { + if (file && !isInternalAngularFileOrEsBuildDefine(file)) { this.watchFiles.add((0, node_path_1.join)(this.workspaceRoot, file)); } for (const note of error.notes) { file = note.location?.file; - if (file && !isInternalAngularFile(file)) { + if (file && !isInternalAngularFileOrEsBuildDefine(file)) { this.watchFiles.add((0, node_path_1.join)(this.workspaceRoot, file)); } } @@ -377,6 +377,6 @@ class BundlerContext { } } exports.BundlerContext = BundlerContext; -function isInternalAngularFile(file) { - return file.startsWith('angular:'); +function isInternalAngularFileOrEsBuildDefine(file) { + return file.startsWith('angular:') || file.startsWith(' Date: Sun, 4 May 2025 10:15:39 +0000 Subject: [PATCH 12/63] ce03490 build: improve stability of windows jobs further --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7b5e3e78..26b0bd23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-22ba074", + "version": "20.0.0-next.9+sha-ce03490", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index fbdc0ec2..9270fc83 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-22ba074'; +const VERSION = '20.0.0-next.9+sha-ce03490'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 3f70ab26..a0bf87a6 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Sat May 03 2025 16:11:37 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Sun May 04 2025 10:15:39 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 8ea3a17467022be125fcbc973c27a971bd98d841 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 5 May 2025 13:11:36 +0000 Subject: [PATCH 13/63] 3fb0e3e refactor: update `Piscina` to version 5 --- package.json | 4 ++-- src/utils/normalize-cache.js | 2 +- src/utils/worker-pool.js | 2 +- uniqueId | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 26b0bd23..42bbe912 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-ce03490", + "version": "20.0.0-next.9+sha-3fb0e3e", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -40,7 +40,7 @@ "mrmime": "2.0.1", "parse5-html-rewriting-stream": "7.1.0", "picomatch": "4.0.2", - "piscina": "4.9.2", + "piscina": "5.0.0", "rollup": "4.40.1", "sass": "1.87.0", "semver": "7.7.1", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 9270fc83..05ec07de 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-ce03490'; +const VERSION = '20.0.0-next.9+sha-3fb0e3e'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/src/utils/worker-pool.js b/src/utils/worker-pool.js index 06fdcc74..378e0430 100644 --- a/src/utils/worker-pool.js +++ b/src/utils/worker-pool.js @@ -17,7 +17,7 @@ class WorkerPool extends piscina_1.Piscina { idleTimeout: 1000, // Web containers do not support transferable objects with receiveOnMessagePort which // is used when the Atomics based wait loop is enable. - useAtomics: !process.versions.webcontainer, + atomics: process.versions.webcontainer ? 'disabled' : 'sync', recordTiming: false, ...options, }; diff --git a/uniqueId b/uniqueId index a0bf87a6..3c2cf752 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Sun May 04 2025 10:15:39 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon May 05 2025 13:11:36 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 48e794ef6c9c2957a147b0918749097146bd68a1 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 5 May 2025 13:58:15 +0000 Subject: [PATCH 14/63] f3eee8e build: update all non-major dependencies --- package.json | 4 ++-- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 42bbe912..a377860e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-3fb0e3e", + "version": "20.0.0-next.9+sha-f3eee8e", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -46,7 +46,7 @@ "semver": "7.7.1", "source-map-support": "0.5.21", "tinyglobby": "0.2.13", - "vite": "6.3.4", + "vite": "6.3.5", "watchpack": "2.4.2" }, "optionalDependencies": { diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 05ec07de..02e15cd0 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-3fb0e3e'; +const VERSION = '20.0.0-next.9+sha-f3eee8e'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 3c2cf752..8e8e5f78 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon May 05 2025 13:11:36 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon May 05 2025 13:58:15 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 69b7cc10370a0d66c97682c5796fd5ed02ec17e4 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 5 May 2025 15:03:28 +0000 Subject: [PATCH 15/63] f36a272 fix(@angular/build): allow a default application `browser` option --- package.json | 2 +- src/builders/application/options.js | 15 +++++++-------- src/builders/application/schema.d.ts | 2 +- src/builders/application/schema.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index a377860e..b5f947c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-f3eee8e", + "version": "20.0.0-next.9+sha-f36a272", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/builders/application/options.js b/src/builders/application/options.js index e1989236..9e774d28 100644 --- a/src/builders/application/options.js +++ b/src/builders/application/options.js @@ -69,7 +69,7 @@ async function normalizeOptions(context, projectName, options, extensions) { if (options.forceI18nFlatOutput) { i18nOptions.flatOutput = true; } - const entryPoints = normalizeEntryPoints(workspaceRoot, options.browser, options.entryPoints); + const entryPoints = normalizeEntryPoints(workspaceRoot, projectSourceRoot, options.browser, options.entryPoints); const tsconfig = node_path_1.default.join(workspaceRoot, options.tsConfig); const optimizationOptions = (0, utils_1.normalizeOptimization)(options.optimization); const sourcemapOptions = (0, utils_1.normalizeSourceMaps)(options.sourceMap ?? false); @@ -355,23 +355,22 @@ async function getTailwindConfig(searchDirectories, workspaceRoot, context) { * @param entryPoints Set of entry points to use if provided. * @returns An object mapping entry point names to their file paths. */ -function normalizeEntryPoints(workspaceRoot, browser, entryPoints = new Set()) { +function normalizeEntryPoints(workspaceRoot, projectSourceRoot, browser, entryPoints) { if (browser === '') { throw new Error('`browser` option cannot be an empty string.'); } // `browser` and `entryPoints` are mutually exclusive. - if (browser && entryPoints.size > 0) { + if (browser && entryPoints) { throw new Error('Only one of `browser` or `entryPoints` may be provided.'); } - if (!browser && entryPoints.size === 0) { - // Schema should normally reject this case, but programmatic usages of the builder might make this mistake. - throw new Error('Either `browser` or at least one `entryPoints` value must be provided.'); - } - // Schema types force `browser` to always be provided, but it may be omitted when the builder is invoked programmatically. if (browser) { // Use `browser` alone. return { 'main': node_path_1.default.join(workspaceRoot, browser) }; } + else if (!entryPoints) { + // Default browser entry if no explicit entry points + return { 'main': node_path_1.default.join(projectSourceRoot, 'main.ts') }; + } else if (entryPoints instanceof Map) { return Object.fromEntries(Array.from(entryPoints.entries(), ([name, entryPoint]) => { // Get the full file path to a relative entry point input. Leave bare specifiers alone so they are resolved as modules. diff --git a/src/builders/application/schema.d.ts b/src/builders/application/schema.d.ts index c21de968..12550e55 100644 --- a/src/builders/application/schema.d.ts +++ b/src/builders/application/schema.d.ts @@ -27,7 +27,7 @@ export type Schema = { * The full path for the browser entry point to the application, relative to the current * workspace. */ - browser: string; + browser?: string; /** * Budget thresholds to ensure parts of your application stay within boundaries which you * set. diff --git a/src/builders/application/schema.json b/src/builders/application/schema.json index 934bfe93..ef4cbb75 100644 --- a/src/builders/application/schema.json +++ b/src/builders/application/schema.json @@ -616,7 +616,7 @@ } }, "additionalProperties": false, - "required": ["browser", "tsConfig"], + "required": ["tsConfig"], "definitions": { "assetPattern": { "oneOf": [ diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 02e15cd0..6ac3be48 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-f3eee8e'; +const VERSION = '20.0.0-next.9+sha-f36a272'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 8e8e5f78..848ba238 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon May 05 2025 13:58:15 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon May 05 2025 15:03:28 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From e8881f33eeb9841ec7831e86b92205286c1aa366 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 6 May 2025 11:00:10 +0000 Subject: [PATCH 16/63] 888d0b2 build: update all non-major dependencies --- package.json | 10 ++--- src/builders/application/execute-build.js | 5 ++- src/builders/application/i18n.js | 15 +++++++ .../angular/compilation/aot-compilation.js | 5 +-- src/tools/esbuild/bundler-context.js | 31 ++++++++++---- src/tools/esbuild/i18n-inliner-worker.d.ts | 41 +++++++++++++++++-- src/tools/esbuild/i18n-inliner-worker.js | 21 ++++++++-- src/tools/esbuild/i18n-inliner.d.ts | 5 +++ src/tools/esbuild/i18n-inliner.js | 26 ++++++++++++ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 11 files changed, 136 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index b5f947c6..878856c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-f36a272", + "version": "20.0.0-next.9+sha-888d0b2", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -31,17 +31,17 @@ "@vitejs/plugin-basic-ssl": "2.0.0", "beasties": "0.3.3", "browserslist": "^4.23.0", - "esbuild": "0.25.3", + "esbuild": "0.25.4", "https-proxy-agent": "7.0.6", "istanbul-lib-instrument": "6.0.3", "jsonc-parser": "3.3.1", - "listr2": "8.3.2", + "listr2": "8.3.3", "magic-string": "0.30.17", "mrmime": "2.0.1", "parse5-html-rewriting-stream": "7.1.0", "picomatch": "4.0.2", "piscina": "5.0.0", - "rollup": "4.40.1", + "rollup": "4.40.2", "sass": "1.87.0", "semver": "7.7.1", "source-map-support": "0.5.21", @@ -50,7 +50,7 @@ "watchpack": "2.4.2" }, "optionalDependencies": { - "lmdb": "3.2.6" + "lmdb": "3.3.0" }, "peerDependencies": { "@angular/core": "^20.0.0 || ^20.0.0-next.0", diff --git a/src/builders/application/execute-build.js b/src/builders/application/execute-build.js index 7c6901ff..10978133 100644 --- a/src/builders/application/execute-build.js +++ b/src/builders/application/execute-build.js @@ -229,8 +229,9 @@ async function executeBuild(options, context, rebuildState) { const result = await (0, execute_post_bundle_1.executePostBundleSteps)(metafile, options, executionResult.outputFiles, executionResult.assetFiles, initialFiles, // Set lang attribute to the defined source locale if present i18nOptions.hasDefinedSourceLocale ? i18nOptions.sourceLocale : undefined); - executionResult.addErrors(result.errors); - executionResult.addWarnings(result.warnings); + // Deduplicate and add errors and warnings + executionResult.addErrors([...new Set(result.errors)]); + executionResult.addWarnings([...new Set(result.warnings)]); executionResult.addPrerenderedRoutes(result.prerenderedRoutes); executionResult.outputFiles.push(...result.additionalOutputFiles); executionResult.assetFiles.push(...result.additionalAssets); diff --git a/src/builders/application/i18n.js b/src/builders/application/i18n.js index b299c6c2..97eeca66 100644 --- a/src/builders/application/i18n.js +++ b/src/builders/application/i18n.js @@ -92,6 +92,21 @@ async function inlineI18n(metafile, options, executionResult, initialFiles) { if (!i18nOptions.flatOutput) { executionResult.assetFiles = updatedAssetFiles; } + // Inline any template updates if present + if (executionResult.templateUpdates?.size) { + // The development server only allows a single locale but issue a warning if used programmatically (experimental) + // with multiple locales and template HMR. + if (i18nOptions.inlineLocales.size > 1) { + inlineResult.warnings.push(`Component HMR updates can only be inlined with a single locale. The first locale will be used.`); + } + const firstLocale = [...i18nOptions.inlineLocales][0]; + for (const [id, content] of executionResult.templateUpdates) { + const templateUpdateResult = await inliner.inlineTemplateUpdate(firstLocale, i18nOptions.locales[firstLocale].translation, content, id); + executionResult.templateUpdates.set(id, templateUpdateResult.code); + inlineResult.errors.push(...templateUpdateResult.errors); + inlineResult.warnings.push(...templateUpdateResult.warnings); + } + } return inlineResult; } /** diff --git a/src/tools/angular/compilation/aot-compilation.js b/src/tools/angular/compilation/aot-compilation.js index 6cd382f4..5d491a91 100644 --- a/src/tools/angular/compilation/aot-compilation.js +++ b/src/tools/angular/compilation/aot-compilation.js @@ -121,10 +121,7 @@ class AotCompilation extends angular_compilation_1.AngularCompilation { const updateId = encodeURIComponent(`${host.getCanonicalFileName(relativePath)}@${node.name?.text}`); const updateText = angularCompiler.emitHmrUpdateModule(node); // If compiler cannot generate an update for the component, prevent template updates. - // Also prevent template updates if $localize is directly present which also currently - // prevents a template update at runtime. - // TODO: Support localized template update modules and remove this check. - if (updateText === null || updateText.includes('$localize')) { + if (updateText === null) { // Build is needed if a template cannot be updated templateUpdates = undefined; break; diff --git a/src/tools/esbuild/bundler-context.js b/src/tools/esbuild/bundler-context.js index cfc3efaf..b68e60de 100644 --- a/src/tools/esbuild/bundler-context.js +++ b/src/tools/esbuild/bundler-context.js @@ -13,6 +13,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.BundlerContext = exports.BuildOutputFileType = void 0; const esbuild_1 = require("esbuild"); const node_assert_1 = __importDefault(require("node:assert")); +const node_module_1 = require("node:module"); const node_path_1 = require("node:path"); const load_result_cache_1 = require("./load-result-cache"); const utils_1 = require("./utils"); @@ -184,7 +185,7 @@ class BundlerContext { // When incremental always add any files from the load result cache if (this.#loadCache) { for (const file of this.#loadCache.watchFiles) { - if (!isInternalAngularFileOrEsBuildDefine(file)) { + if (!isInternalAngularFile(file)) { // watch files are fully resolved paths this.watchFiles.add(file); } @@ -198,10 +199,11 @@ class BundlerContext { if (this.incremental) { // Add input files except virtual angular files which do not exist on disk for (const input of Object.keys(result.metafile.inputs)) { - if (!isInternalAngularFileOrEsBuildDefine(input)) { - // input file paths are always relative to the workspace root - this.watchFiles.add((0, node_path_1.join)(this.workspaceRoot, input)); + if (isInternalAngularFile(input) || isInternalBundlerFile(input)) { + continue; } + // Input file paths are always relative to the workspace root + this.watchFiles.add((0, node_path_1.join)(this.workspaceRoot, input)); } } // Return if the build encountered any errors @@ -324,12 +326,12 @@ class BundlerContext { #addErrorsToWatch(result) { for (const error of result.errors) { let file = error.location?.file; - if (file && !isInternalAngularFileOrEsBuildDefine(file)) { + if (file && !isInternalAngularFile(file)) { this.watchFiles.add((0, node_path_1.join)(this.workspaceRoot, file)); } for (const note of error.notes) { file = note.location?.file; - if (file && !isInternalAngularFileOrEsBuildDefine(file)) { + if (file && !isInternalAngularFile(file)) { this.watchFiles.add((0, node_path_1.join)(this.workspaceRoot, file)); } } @@ -377,6 +379,19 @@ class BundlerContext { } } exports.BundlerContext = BundlerContext; -function isInternalAngularFileOrEsBuildDefine(file) { - return file.startsWith('angular:') || file.startsWith('" or "" + if (file[0] === '<' && file.at(-1) === '>') { + return true; + } + const DISABLED_BUILTIN = '(disabled):'; + // Disabled node builtins such as "/some/path/(disabled):fs" + const disabledIndex = file.indexOf(DISABLED_BUILTIN); + if (disabledIndex >= 0) { + return node_module_1.builtinModules.includes(file.slice(disabledIndex + DISABLED_BUILTIN.length)); + } + return false; } diff --git a/src/tools/esbuild/i18n-inliner-worker.d.ts b/src/tools/esbuild/i18n-inliner-worker.d.ts index 1d69bb53..f660a061 100644 --- a/src/tools/esbuild/i18n-inliner-worker.d.ts +++ b/src/tools/esbuild/i18n-inliner-worker.d.ts @@ -8,7 +8,7 @@ /** * The options passed to the inliner for each file request */ -interface InlineRequest { +interface InlineFileRequest { /** * The filename that should be processed. The data for the file is provided to the Worker * during Worker initialization. @@ -23,14 +23,35 @@ interface InlineRequest { */ translation?: Record; } +/** + * The options passed to the inliner for each code request + */ +interface InlineCodeRequest { + /** + * The code that should be processed. + */ + code: string; + /** + * The filename to use in error and warning messages for the provided code. + */ + filename: string; + /** + * The locale specifier that should be used during the inlining process of the file. + */ + locale: string; + /** + * The translation messages for the locale that should be used during the inlining process of the file. + */ + translation?: Record; +} /** * Inlines the provided locale and translation into a JavaScript file that contains `$localize` usage. * This function is the main entry for the Worker's action that is called by the worker pool. * * @param request An InlineRequest object representing the options for inlining - * @returns An array containing the inlined file and optional map content. + * @returns An object containing the inlined file and optional map content. */ -export default function inlineLocale(request: InlineRequest): Promise<{ +export default function inlineFile(request: InlineFileRequest): Promise<{ file: string; code: string; map: string | undefined; @@ -39,4 +60,18 @@ export default function inlineLocale(request: InlineRequest): Promise<{ message: string; }[]; }>; +/** + * Inlines the provided locale and translation into JavaScript code that contains `$localize` usage. + * This function is a secondary entry primarily for use with component HMR update modules. + * + * @param request An InlineRequest object representing the options for inlining + * @returns An object containing the inlined code. + */ +export declare function inlineCode(request: InlineCodeRequest): Promise<{ + output: string; + messages: { + type: "warning" | "error"; + message: string; + }[]; +}>; export {}; diff --git a/src/tools/esbuild/i18n-inliner-worker.js b/src/tools/esbuild/i18n-inliner-worker.js index d6079517..311b2c0a 100644 --- a/src/tools/esbuild/i18n-inliner-worker.js +++ b/src/tools/esbuild/i18n-inliner-worker.js @@ -10,7 +10,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = inlineLocale; +exports.default = inlineFile; +exports.inlineCode = inlineCode; const remapping_1 = __importDefault(require("@ampproject/remapping")); const core_1 = require("@babel/core"); const node_assert_1 = __importDefault(require("node:assert")); @@ -25,9 +26,9 @@ const { files, missingTranslation, shouldOptimize } = (node_worker_threads_1.wor * This function is the main entry for the Worker's action that is called by the worker pool. * * @param request An InlineRequest object representing the options for inlining - * @returns An array containing the inlined file and optional map content. + * @returns An object containing the inlined file and optional map content. */ -async function inlineLocale(request) { +async function inlineFile(request) { const data = files.get(request.filename); (0, node_assert_1.default)(data !== undefined, `Invalid inline request for file '${request.filename}'.`); const code = await data.text(); @@ -40,6 +41,20 @@ async function inlineLocale(request) { messages: result.diagnostics.messages, }; } +/** + * Inlines the provided locale and translation into JavaScript code that contains `$localize` usage. + * This function is a secondary entry primarily for use with component HMR update modules. + * + * @param request An InlineRequest object representing the options for inlining + * @returns An object containing the inlined code. + */ +async function inlineCode(request) { + const result = await transformWithBabel(request.code, undefined, request); + return { + output: result.code, + messages: result.diagnostics.messages, + }; +} /** * Cached instance of the `@angular/localize/tools` module. * This is used to remove the need to repeatedly import the module per file translation. diff --git a/src/tools/esbuild/i18n-inliner.d.ts b/src/tools/esbuild/i18n-inliner.d.ts index 47c2d11d..9b44032d 100644 --- a/src/tools/esbuild/i18n-inliner.d.ts +++ b/src/tools/esbuild/i18n-inliner.d.ts @@ -38,6 +38,11 @@ export declare class I18nInliner { errors: string[]; warnings: string[]; }>; + inlineTemplateUpdate(locale: string, translation: Record | undefined, templateCode: string, templateId: string): Promise<{ + code: string; + errors: string[]; + warnings: string[]; + }>; /** * Stops all active transformation tasks and shuts down all workers. * @returns A void promise that resolves when closing is complete. diff --git a/src/tools/esbuild/i18n-inliner.js b/src/tools/esbuild/i18n-inliner.js index b4e7b167..7c25cc78 100644 --- a/src/tools/esbuild/i18n-inliner.js +++ b/src/tools/esbuild/i18n-inliner.js @@ -201,6 +201,32 @@ class I18nInliner { warnings, }; } + async inlineTemplateUpdate(locale, translation, templateCode, templateId) { + const hasLocalize = templateCode.includes(LOCALIZE_KEYWORD); + if (!hasLocalize) { + return { + code: templateCode, + errors: [], + warnings: [], + }; + } + const { output, messages } = await this.#workerPool.run({ code: templateCode, filename: templateId, locale, translation }, { name: 'inlineCode' }); + const errors = []; + const warnings = []; + for (const message of messages) { + if (message.type === 'error') { + errors.push(message.message); + } + else { + warnings.push(message.message); + } + } + return { + code: output, + errors, + warnings, + }; + } /** * Stops all active transformation tasks and shuts down all workers. * @returns A void promise that resolves when closing is complete. diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 6ac3be48..03e84b18 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-f36a272'; +const VERSION = '20.0.0-next.9+sha-888d0b2'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 848ba238..0a538376 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon May 05 2025 15:03:28 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue May 06 2025 11:00:10 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 472aa8b201b6efa07322d2c515bd8cc108a9586f Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 6 May 2025 11:19:03 +0000 Subject: [PATCH 17/63] 635999d fix(@angular-devkit/build-angular): correctly set i18n subPath in webpack browser builder --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 878856c1..e37201c3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-888d0b2", + "version": "20.0.0-next.9+sha-635999d", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 03e84b18..e48439d2 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-888d0b2'; +const VERSION = '20.0.0-next.9+sha-635999d'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 0a538376..804d2d22 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue May 06 2025 11:00:10 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue May 06 2025 11:19:03 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 587fa0be40302426968b6ffd8b5e2086f959c9db Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 6 May 2025 12:56:21 +0000 Subject: [PATCH 18/63] 2c4ed32 build: update rules_angular digest to 42d4791 --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e37201c3..3378eb2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-635999d", + "version": "20.0.0-next.9+sha-2c4ed32", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index e48439d2..3f33dba5 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-635999d'; +const VERSION = '20.0.0-next.9+sha-2c4ed32'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 804d2d22..41f60bfb 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue May 06 2025 11:19:03 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue May 06 2025 12:56:21 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 6a73652e3c9a2e097f84c70ceb19aed2719fd072 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 6 May 2025 15:04:18 +0000 Subject: [PATCH 19/63] 69a3a19 build: update angular --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 3378eb2c..6163a5a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-2c4ed32", + "version": "20.0.0-next.9+sha-69a3a19", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 3f33dba5..51c05669 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-2c4ed32'; +const VERSION = '20.0.0-next.9+sha-69a3a19'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 41f60bfb..b2d6dff6 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue May 06 2025 12:56:21 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue May 06 2025 15:04:18 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From be5ac04739d0301a516624dcdd4f76c671fa635b Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 6 May 2025 18:26:29 +0000 Subject: [PATCH 20/63] e513cd4 fix(@angular/cli): add Node.js 24 as supported version --- package.json | 4 ++-- src/tools/esbuild/utils.js | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6163a5a6..f7b4110b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-69a3a19", + "version": "20.0.0-next.9+sha-e513cd4", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -112,7 +112,7 @@ }, "packageManager": "pnpm@9.15.6", "engines": { - "node": "^20.11.1 || >=22.11.0", + "node": "^20.11.1 || ^22.11.0 || >=24.0.0", "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", "yarn": ">= 1.13.0" }, diff --git a/src/tools/esbuild/utils.js b/src/tools/esbuild/utils.js index d54ddf26..e6542ded 100644 --- a/src/tools/esbuild/utils.js +++ b/src/tools/esbuild/utils.js @@ -315,7 +315,7 @@ function transformSupportedBrowsersToTargets(supportedBrowsers) { } return transformed; } -const SUPPORTED_NODE_VERSIONS = '^20.11.1 || >=22.11.0'; +const SUPPORTED_NODE_VERSIONS = '^20.11.1 || ^22.11.0 || >=24.0.0'; /** * Transform supported Node.js versions to esbuild target. * @see https://esbuild.github.io/api/#target diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 51c05669..f78e36f0 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-69a3a19'; +const VERSION = '20.0.0-next.9+sha-e513cd4'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index b2d6dff6..0a9c8453 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue May 06 2025 15:04:18 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue May 06 2025 18:26:29 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From f50c4ebdf1e907957b2dae956303d13180e3ed23 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 7 May 2025 10:46:26 +0000 Subject: [PATCH 21/63] a51b85f build: update all non-major dependencies --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f7b4110b..c11c506c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-e513cd4", + "version": "20.0.0-next.9+sha-a51b85f", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index f78e36f0..18633d06 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-e513cd4'; +const VERSION = '20.0.0-next.9+sha-a51b85f'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 0a9c8453..8b2f5591 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue May 06 2025 18:26:29 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed May 07 2025 10:46:26 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 645cdd0e098f97090778c4e4265ae18b858393be Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 7 May 2025 11:34:31 +0000 Subject: [PATCH 22/63] 7bba1ce build: update angular --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c11c506c..433a946f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-a51b85f", + "version": "20.0.0-next.9+sha-7bba1ce", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 18633d06..9024c187 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-a51b85f'; +const VERSION = '20.0.0-next.9+sha-7bba1ce'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 8b2f5591..ad1a53b4 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed May 07 2025 10:46:26 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed May 07 2025 11:34:31 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 2fd13b524d6645eaea2d0f91c1457e9afc7d3946 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 7 May 2025 16:25:48 +0000 Subject: [PATCH 23/63] 5afac28 refactor(@angular-devkit/core): use more precise iterator typings --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 433a946f..88aade18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-7bba1ce", + "version": "20.0.0-next.9+sha-5afac28", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 9024c187..c1fb44a8 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-7bba1ce'; +const VERSION = '20.0.0-next.9+sha-5afac28'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index ad1a53b4..1bb43653 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed May 07 2025 11:34:31 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed May 07 2025 16:25:48 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From debdb5552bac00bf01219132e414b353bede8af0 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 7 May 2025 16:43:35 +0000 Subject: [PATCH 24/63] a3e35ee build: lock file maintenance --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 88aade18..33d62fae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-5afac28", + "version": "20.0.0-next.9+sha-a3e35ee", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index c1fb44a8..30336d61 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-5afac28'; +const VERSION = '20.0.0-next.9+sha-a3e35ee'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 1bb43653..b408e2a0 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed May 07 2025 16:25:48 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed May 07 2025 16:43:35 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 9a8eca0bf918c20cbdc9f1b133d4cd13c0a0b1f6 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 7 May 2025 17:14:39 +0000 Subject: [PATCH 25/63] f1213e3 ci: enable e2e test runs on Node.js 24 --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 33d62fae..61ee01bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-a3e35ee", + "version": "20.0.0-next.9+sha-f1213e3", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 30336d61..a753a93d 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-a3e35ee'; +const VERSION = '20.0.0-next.9+sha-f1213e3'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index b408e2a0..49b7235a 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed May 07 2025 16:43:35 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed May 07 2025 17:14:39 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 55ea013a4a61e9f19288b06cd7d152938528a2a1 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 7 May 2025 20:06:08 +0000 Subject: [PATCH 26/63] d60503c release: cut the v20.0.0-rc.0 release --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 61ee01bd..27c314fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-next.9+sha-f1213e3", + "version": "20.0.0-rc.0+sha-d60503c", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index a753a93d..6f08da2f 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-next.9+sha-f1213e3'; +const VERSION = '20.0.0-rc.0+sha-d60503c'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 49b7235a..8d48cf17 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed May 07 2025 17:14:39 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed May 07 2025 20:06:08 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 4919ad1a5d41e81bee93cc4898e2126e71d308b4 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 8 May 2025 17:04:54 +0000 Subject: [PATCH 27/63] 247cd33 fix(@angular/build): show unit-test error for missing vitest package --- package.json | 2 +- src/builders/unit-test/builder.js | 87 ++++++++++++++++++----------- src/builders/unit-test/options.d.ts | 2 +- src/builders/unit-test/options.js | 5 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 6 files changed, 61 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index 27c314fb..0e2d65e9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-d60503c", + "version": "20.0.0-rc.0+sha-247cd33", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/builders/unit-test/builder.js b/src/builders/unit-test/builder.js index 0446bb03..54bd31ba 100644 --- a/src/builders/unit-test/builder.js +++ b/src/builders/unit-test/builder.js @@ -16,6 +16,7 @@ const node_crypto_1 = require("node:crypto"); const node_module_1 = require("node:module"); const node_path_1 = __importDefault(require("node:path")); const virtual_module_plugin_1 = require("../../tools/esbuild/virtual-module-plugin"); +const error_1 = require("../../utils/error"); const load_esm_1 = require("../../utils/load-esm"); const application_1 = require("../application"); const results_1 = require("../application/results"); @@ -27,6 +28,7 @@ const options_1 = require("./options"); /** * @experimental Direct usage of this function is considered experimental. */ +// eslint-disable-next-line max-lines-per-function async function* execute(options, context, extensions = {}) { // Determine project name from builder context target const projectName = context.target?.project; @@ -55,7 +57,19 @@ async function* execute(options, context, extensions = {}) { } const entryPoints = (0, find_tests_1.getTestEntrypoints)(testFiles, { projectSourceRoot, workspaceRoot }); entryPoints.set('init-testbed', 'angular:test-bed-init'); - const { startVitest } = await (0, load_esm_1.loadEsmModule)('vitest/node'); + let vitestNodeModule; + try { + vitestNodeModule = await (0, load_esm_1.loadEsmModule)('vitest/node'); + } + catch (error) { + (0, error_1.assertIsError)(error); + if (error.code !== 'ERR_MODULE_NOT_FOUND') { + throw error; + } + context.logger.error('The `vitest` package was not found. Please install the package and rerun the test command.'); + return; + } + const { startVitest } = vitestNodeModule; // Setup test file build options based on application build target options const buildTargetOptions = (await context.validateOptions(await context.getTargetOptions(normalizedOptions.buildTarget), await context.getBuilderNameForTarget(normalizedOptions.buildTarget))); if (buildTargetOptions.polyfills?.includes('zone.js')) { @@ -65,6 +79,7 @@ async function* execute(options, context, extensions = {}) { const buildOptions = { ...buildTargetOptions, watch: normalizedOptions.watch, + incrementalResults: normalizedOptions.watch, outputPath, index: false, browser: undefined, @@ -128,39 +143,47 @@ async function* execute(options, context, extensions = {}) { })), }; } - for await (const result of (0, application_1.buildApplicationInternal)(buildOptions, context, extensions)) { - if (result.kind === results_1.ResultKind.Failure) { - continue; - } - else if (result.kind !== results_1.ResultKind.Full) { - node_assert_1.default.fail('A full build result is required from the application builder.'); + const setupFiles = ['init-testbed.js']; + if (buildTargetOptions?.polyfills?.length) { + setupFiles.push('polyfills.js'); + } + try { + for await (const result of (0, application_1.buildApplicationInternal)(buildOptions, context, extensions)) { + if (result.kind === results_1.ResultKind.Failure) { + continue; + } + else if (result.kind !== results_1.ResultKind.Full && result.kind !== results_1.ResultKind.Incremental) { + node_assert_1.default.fail('A full and/or incremental build result is required from the application builder.'); + } + (0, node_assert_1.default)(result.files, 'Builder did not provide result files.'); + await (0, application_builder_1.writeTestFiles)(result.files, outputPath); + instance ??= await startVitest('test', undefined /* cliFilters */, undefined /* options */, { + test: { + root: outputPath, + setupFiles, + // Use `jsdom` if no browsers are explicitly configured. + // `node` is effectively no "environment" and the default. + environment: browser ? 'node' : 'jsdom', + watch: normalizedOptions.watch, + browser, + reporters: normalizedOptions.reporters ?? ['default'], + coverage: { + enabled: normalizedOptions.codeCoverage, + exclude: normalizedOptions.codeCoverageExclude, + excludeAfterRemap: true, + }, + }, + }); + // Check if all the tests pass to calculate the result + const testModules = instance.state.getTestModules(); + yield { success: testModules.every((testModule) => testModule.ok()) }; } - (0, node_assert_1.default)(result.files, 'Builder did not provide result files.'); - await (0, application_builder_1.writeTestFiles)(result.files, outputPath); - const setupFiles = ['init-testbed.js']; - if (buildTargetOptions?.polyfills?.length) { - setupFiles.push('polyfills.js'); + } + finally { + if (normalizedOptions.watch) { + // Vitest will automatically close if not using watch mode + await instance?.close(); } - instance ??= await startVitest('test', undefined /* cliFilters */, undefined /* options */, { - test: { - root: outputPath, - setupFiles, - // Use `jsdom` if no browsers are explicitly configured. - // `node` is effectively no "environment" and the default. - environment: browser ? 'node' : 'jsdom', - watch: normalizedOptions.watch, - browser, - reporters: normalizedOptions.reporters ?? ['default'], - coverage: { - enabled: normalizedOptions.codeCoverage, - exclude: normalizedOptions.codeCoverageExclude, - excludeAfterRemap: true, - }, - }, - }); - // Check if all the tests pass to calculate the result - const testModules = instance.state.getTestModules(); - yield { success: testModules.every((testModule) => testModule.ok()) }; } } function findBrowserProvider(projectSourceRoot) { diff --git a/src/builders/unit-test/options.d.ts b/src/builders/unit-test/options.d.ts index 14b0b853..b0ab5800 100644 --- a/src/builders/unit-test/options.d.ts +++ b/src/builders/unit-test/options.d.ts @@ -22,5 +22,5 @@ export declare function normalizeOptions(context: BuilderContext, projectName: s tsConfig: string; reporters: string[] | undefined; browsers: string[] | undefined; - watch: boolean; + watch: boolean | undefined; }>; diff --git a/src/builders/unit-test/options.js b/src/builders/unit-test/options.js index b81176b3..ed00423f 100644 --- a/src/builders/unit-test/options.js +++ b/src/builders/unit-test/options.js @@ -26,7 +26,7 @@ async function normalizeOptions(context, projectName, options) { // Target specifier defaults to the current project's build target using a development configuration const buildTargetSpecifier = options.buildTarget ?? `::development`; const buildTarget = (0, architect_1.targetFromTargetString)(buildTargetSpecifier, projectName, 'build'); - const { codeCoverage, codeCoverageExclude, tsConfig, runner, reporters, browsers } = options; + const { codeCoverage, codeCoverageExclude, tsConfig, runner, reporters, browsers, watch } = options; return { // Project/workspace information workspaceRoot, @@ -43,8 +43,7 @@ async function normalizeOptions(context, projectName, options) { tsConfig, reporters, browsers, - // TODO: Implement watch support - watch: false, + watch, }; } /** diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 6f08da2f..dafa7d4b 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-d60503c'; +const VERSION = '20.0.0-rc.0+sha-247cd33'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 8d48cf17..7120c945 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed May 07 2025 20:06:08 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu May 08 2025 17:04:54 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 59ae4df72298704cc99e6ac042e7b32c9d4badd4 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 8 May 2025 17:47:20 +0000 Subject: [PATCH 28/63] 7b718d1 build: update rules_angular digest to e35da73 --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0e2d65e9..fa5b19d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-247cd33", + "version": "20.0.0-rc.0+sha-7b718d1", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index dafa7d4b..a2cff098 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-247cd33'; +const VERSION = '20.0.0-rc.0+sha-7b718d1'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 7120c945..b0fdb63d 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu May 08 2025 17:04:54 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu May 08 2025 17:47:20 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 15c343fdc215e2a88c9f199fd0549613e9a97aca Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 8 May 2025 22:30:20 +0000 Subject: [PATCH 29/63] 9119af8 build: update angular --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index fa5b19d2..09a6b4fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-7b718d1", + "version": "20.0.0-rc.0+sha-9119af8", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index a2cff098..c289fabd 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-7b718d1'; +const VERSION = '20.0.0-rc.0+sha-9119af8'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index b0fdb63d..f5df03ff 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu May 08 2025 17:47:20 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu May 08 2025 22:30:20 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 97fcd92d1359764448563d8efcba2f4dbc496370 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 12 May 2025 08:11:20 +0000 Subject: [PATCH 30/63] f36237f ci: refactor renovate config to use dev-infra preset --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 09a6b4fb..f7e13fe3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-9119af8", + "version": "20.0.0-rc.0+sha-f36237f", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index c289fabd..c6bac9ba 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-9119af8'; +const VERSION = '20.0.0-rc.0+sha-f36237f'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index f5df03ff..56df0e27 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu May 08 2025 22:30:20 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon May 12 2025 08:11:19 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 8fed0de4bd91d402dc593a1a45051049999a5875 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 12 May 2025 08:51:06 +0000 Subject: [PATCH 31/63] 0f8594f build: update pnpm to v9.15.9 --- package.json | 4 ++-- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f7e13fe3..5749e573 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-f36237f", + "version": "20.0.0-rc.0+sha-0f8594f", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -110,7 +110,7 @@ "type": "git", "url": "https://github.com/angular/angular-cli.git" }, - "packageManager": "pnpm@9.15.6", + "packageManager": "pnpm@9.15.9", "engines": { "node": "^20.11.1 || ^22.11.0 || >=24.0.0", "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index c6bac9ba..d6615b62 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-f36237f'; +const VERSION = '20.0.0-rc.0+sha-0f8594f'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 56df0e27..a37e3d03 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon May 12 2025 08:11:19 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon May 12 2025 08:51:06 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 1db5a69b5a8cde26fcd2cc4db3c6bbc08684c7d0 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 12 May 2025 09:02:54 +0000 Subject: [PATCH 32/63] a01dc23 build: update rules_angular digest to 7fb42d2 --- package.json | 6 +++--- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 5749e573..f65b2237 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-0f8594f", + "version": "20.0.0-rc.0+sha-a01dc23", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -27,7 +27,7 @@ "@babel/core": "7.27.1", "@babel/helper-annotate-as-pure": "7.27.1", "@babel/helper-split-export-declaration": "7.24.7", - "@inquirer/confirm": "5.1.9", + "@inquirer/confirm": "5.1.10", "@vitejs/plugin-basic-ssl": "2.0.0", "beasties": "0.3.3", "browserslist": "^4.23.0", @@ -42,7 +42,7 @@ "picomatch": "4.0.2", "piscina": "5.0.0", "rollup": "4.40.2", - "sass": "1.87.0", + "sass": "1.88.0", "semver": "7.7.1", "source-map-support": "0.5.21", "tinyglobby": "0.2.13", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index d6615b62..f2c225a5 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-0f8594f'; +const VERSION = '20.0.0-rc.0+sha-a01dc23'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index a37e3d03..6b2448d9 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon May 12 2025 08:51:06 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon May 12 2025 09:02:54 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 760eb58c9683d6c60fd6e2e38f1bb62c4997132e Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 12 May 2025 09:49:52 +0000 Subject: [PATCH 33/63] a7ad8e1 build: lock file maintenance --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f65b2237..ed1b2de7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-a01dc23", + "version": "20.0.0-rc.0+sha-a7ad8e1", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index f2c225a5..d375d068 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-a01dc23'; +const VERSION = '20.0.0-rc.0+sha-a7ad8e1'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 6b2448d9..37468b9e 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon May 12 2025 09:02:54 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon May 12 2025 09:49:52 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 162c167e9790ea05e27a1eccfa59ef83480db380 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 12 May 2025 13:23:51 +0000 Subject: [PATCH 34/63] 0af4e10 build: update cross-repo angular dependencies --- package.json | 2 +- src/utils/load-proxy-config.js | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ed1b2de7..274923fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-a7ad8e1", + "version": "20.0.0-rc.0+sha-0af4e10", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/load-proxy-config.js b/src/utils/load-proxy-config.js index f8a7088a..de865595 100644 --- a/src/utils/load-proxy-config.js +++ b/src/utils/load-proxy-config.js @@ -93,7 +93,7 @@ async function loadProxyConfiguration(root, proxyConfig) { } catch (e) { (0, error_1.assertIsError)(e); - if (e.code === 'ERR_REQUIRE_ESM') { + if (e.code === 'ERR_REQUIRE_ESM' || e.code === 'ERR_REQUIRE_ASYNC_MODULE') { // Load the ESM configuration file using the TypeScript dynamic import workaround. // Once TypeScript provides support for keeping the dynamic import this workaround can be // changed to a direct dynamic import. diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index d375d068..4e158f01 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-a7ad8e1'; +const VERSION = '20.0.0-rc.0+sha-0af4e10'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 37468b9e..7882b7c7 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon May 12 2025 09:49:52 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon May 12 2025 13:23:51 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From a06d58f9470ba7f9252b42cadfd788898783950e Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 12 May 2025 13:39:15 +0000 Subject: [PATCH 35/63] e36bf96 fix(@angular/build): allow TestBed provider configuration with vitest unit-testing --- package.json | 2 +- src/builders/unit-test/builder.js | 15 ++++++++++++++- src/builders/unit-test/options.d.ts | 1 + src/builders/unit-test/options.js | 1 + src/builders/unit-test/schema.d.ts | 5 +++++ src/builders/unit-test/schema.json | 5 +++++ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 8 files changed, 29 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 274923fb..39d2fb3e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-0af4e10", + "version": "20.0.0-rc.0+sha-e36bf96", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/builders/unit-test/builder.js b/src/builders/unit-test/builder.js index 54bd31ba..6592b574 100644 --- a/src/builders/unit-test/builder.js +++ b/src/builders/unit-test/builder.js @@ -104,15 +104,28 @@ async function* execute(options, context, extensions = {}) { loadContent: async () => { const contents = [ // Initialize the Angular testing environment + `import { NgModule } from '@angular/core';`, `import { getTestBed, ɵgetCleanupHook as getCleanupHook } from '@angular/core/testing';`, `import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';`, `import { beforeEach, afterEach } from 'vitest';`, '', + normalizedOptions.providersFile + ? `import providers from './${node_path_1.default + .relative(projectSourceRoot, normalizedOptions.providersFile) + .replace(/.[mc]?ts$/, '') + .replace(/\\/g, '/')}'` + : 'const providers = [];', + '', // Same as https://github.com/angular/angular/blob/05a03d3f975771bb59c7eefd37c01fa127ee2229/packages/core/testing/src/test_hooks.ts#L21-L29 `beforeEach(getCleanupHook(false));`, `afterEach(getCleanupHook(true));`, '', - `getTestBed().initTestEnvironment(BrowserTestingModule, platformBrowserTesting(), {`, + `@NgModule({`, + ` providers,`, + `})`, + `export class TestModule {}`, + '', + `getTestBed().initTestEnvironment([BrowserTestingModule, TestModule], platformBrowserTesting(), {`, ` errorOnUnknownElements: true,`, ` errorOnUnknownProperties: true,`, '});', diff --git a/src/builders/unit-test/options.d.ts b/src/builders/unit-test/options.d.ts index b0ab5800..1cc1fd55 100644 --- a/src/builders/unit-test/options.d.ts +++ b/src/builders/unit-test/options.d.ts @@ -23,4 +23,5 @@ export declare function normalizeOptions(context: BuilderContext, projectName: s reporters: string[] | undefined; browsers: string[] | undefined; watch: boolean | undefined; + providersFile: string | undefined; }>; diff --git a/src/builders/unit-test/options.js b/src/builders/unit-test/options.js index ed00423f..3c3d8232 100644 --- a/src/builders/unit-test/options.js +++ b/src/builders/unit-test/options.js @@ -44,6 +44,7 @@ async function normalizeOptions(context, projectName, options) { reporters, browsers, watch, + providersFile: options.providersFile && node_path_1.default.join(workspaceRoot, options.providersFile), }; } /** diff --git a/src/builders/unit-test/schema.d.ts b/src/builders/unit-test/schema.d.ts index 44100590..51f6d129 100644 --- a/src/builders/unit-test/schema.d.ts +++ b/src/builders/unit-test/schema.d.ts @@ -34,6 +34,11 @@ export type Schema = { * instead. */ include?: string[]; + /** + * TypeScript file that exports an array of Angular providers to use during test execution. + * The array must be a default export. + */ + providersFile?: string; /** * Test runner reporters to use. Directly passed to the test runner. */ diff --git a/src/builders/unit-test/schema.json b/src/builders/unit-test/schema.json index 223aa149..8cc91c7d 100644 --- a/src/builders/unit-test/schema.json +++ b/src/builders/unit-test/schema.json @@ -65,6 +65,11 @@ "items": { "type": "string" } + }, + "providersFile": { + "type": "string", + "description": "TypeScript file that exports an array of Angular providers to use during test execution. The array must be a default export.", + "minLength": 1 } }, "additionalProperties": false, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 4e158f01..57145e70 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-0af4e10'; +const VERSION = '20.0.0-rc.0+sha-e36bf96'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 7882b7c7..1eb84760 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon May 12 2025 13:23:51 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon May 12 2025 13:39:15 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From ad8abf473fce345b1831a18a336de92610f99448 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 12 May 2025 14:50:07 +0000 Subject: [PATCH 36/63] 8cbb78d build: lock file maintenance --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 39d2fb3e..358f9a1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-e36bf96", + "version": "20.0.0-rc.0+sha-8cbb78d", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 57145e70..639b56fa 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-e36bf96'; +const VERSION = '20.0.0-rc.0+sha-8cbb78d'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 1eb84760..51cf2a88 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon May 12 2025 13:39:15 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon May 12 2025 14:50:07 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 067accc3aaf61002e3c9dc1ef711ab7374554e55 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 13 May 2025 10:21:21 +0000 Subject: [PATCH 37/63] fa3dc63 fix(@angular/build): show unit-test error for missing vitest browser package --- package.json | 2 +- src/builders/unit-test/builder.js | 57 +++++++++++++++++++++---------- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 42 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 358f9a1a..9f5582fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-8cbb78d", + "version": "20.0.0-rc.0+sha-fa3dc63", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/builders/unit-test/builder.js b/src/builders/unit-test/builder.js index 6592b574..d893787d 100644 --- a/src/builders/unit-test/builder.js +++ b/src/builders/unit-test/builder.js @@ -140,22 +140,12 @@ async function* execute(options, context, extensions = {}) { extensions.codePlugins.unshift(virtualTestBedInit); let instance; // Setup vitest browser options if configured - let browser; - if (normalizedOptions.browsers) { - const provider = findBrowserProvider(projectSourceRoot); - if (!provider) { - context.logger.error('The "browsers" option requires either "playwright" or "webdriverio" to be installed within the project.' + - ' Please install one of these packages and rerun the test command.'); - return { success: false }; - } - browser = { - enabled: true, - provider, - instances: normalizedOptions.browsers.map((browserName) => ({ - browser: browserName, - })), - }; + const { browser, errors } = setupBrowserConfiguration(normalizedOptions.browsers, projectSourceRoot); + if (errors?.length) { + errors.forEach((error) => context.logger.error(error)); + return { success: false }; } + // Add setup file entries for TestBed initialization and project polyfills const setupFiles = ['init-testbed.js']; if (buildTargetOptions?.polyfills?.length) { setupFiles.push('polyfills.js'); @@ -199,9 +189,8 @@ async function* execute(options, context, extensions = {}) { } } } -function findBrowserProvider(projectSourceRoot) { - const projectResolver = (0, node_module_1.createRequire)(projectSourceRoot + '/').resolve; - // These must be installed in the project to be used +function findBrowserProvider(projectResolver) { + // One of these must be installed in the project to use browser testing const vitestBuiltinProviders = ['playwright', 'webdriverio']; for (const providerName of vitestBuiltinProviders) { try { @@ -211,3 +200,35 @@ function findBrowserProvider(projectSourceRoot) { catch { } } } +function setupBrowserConfiguration(browsers, projectSourceRoot) { + if (browsers === undefined) { + return {}; + } + const projectResolver = (0, node_module_1.createRequire)(projectSourceRoot + '/').resolve; + let errors; + try { + projectResolver('@vitest/browser'); + } + catch { + errors ??= []; + errors.push('The "browsers" option requires the "@vitest/browser" package to be installed within the project.' + + ' Please install this package and rerun the test command.'); + } + const provider = findBrowserProvider(projectResolver); + if (!provider) { + errors ??= []; + errors.push('The "browsers" option requires either "playwright" or "webdriverio" to be installed within the project.' + + ' Please install one of these packages and rerun the test command.'); + } + if (errors) { + return { errors }; + } + const browser = { + enabled: true, + provider, + instances: browsers.map((browserName) => ({ + browser: browserName, + })), + }; + return { browser }; +} diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 639b56fa..a45ea164 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-8cbb78d'; +const VERSION = '20.0.0-rc.0+sha-fa3dc63'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 51cf2a88..96e40c20 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon May 12 2025 14:50:07 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue May 13 2025 10:21:21 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From caeb8d58b7ab437da5f5015b8be8556e280b31a8 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 13 May 2025 12:45:59 +0000 Subject: [PATCH 38/63] 0568c9c build: update TypeScript integrity to 5.8.3 --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9f5582fd..fc7b1de2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-fa3dc63", + "version": "20.0.0-rc.0+sha-0568c9c", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index a45ea164..b6ad2c10 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-fa3dc63'; +const VERSION = '20.0.0-rc.0+sha-0568c9c'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 96e40c20..f9ff9bda 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue May 13 2025 10:21:21 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue May 13 2025 12:45:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 510ecab22c11920f26a707ea0b36c3b742466bfd Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 13 May 2025 14:18:56 +0000 Subject: [PATCH 39/63] f86837a build: update rules_angular digest to c0d7927 --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index fc7b1de2..a602a8ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-0568c9c", + "version": "20.0.0-rc.0+sha-f86837a", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index b6ad2c10..54e4d0a6 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-0568c9c'; +const VERSION = '20.0.0-rc.0+sha-f86837a'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index f9ff9bda..d2d71327 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue May 13 2025 12:45:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue May 13 2025 14:18:56 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 0a7c69c3999b93f3f8462f095c4c085fbd67e1e7 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 13 May 2025 14:35:44 +0000 Subject: [PATCH 40/63] cb9d605 build: update all non-major dependencies --- package.json | 4 ++-- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a602a8ed..a8bee398 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-f86837a", + "version": "20.0.0-rc.0+sha-cb9d605", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -43,7 +43,7 @@ "piscina": "5.0.0", "rollup": "4.40.2", "sass": "1.88.0", - "semver": "7.7.1", + "semver": "7.7.2", "source-map-support": "0.5.21", "tinyglobby": "0.2.13", "vite": "6.3.5", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 54e4d0a6..2a0012b7 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-f86837a'; +const VERSION = '20.0.0-rc.0+sha-cb9d605'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index d2d71327..3bb0bf5e 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue May 13 2025 14:18:56 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue May 13 2025 14:35:44 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From c21be9995705c7b5e1ed4dbf0cae8184ab815515 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 13 May 2025 17:20:50 +0000 Subject: [PATCH 41/63] c7f2cb5 fix(@angular/build): provide vitest globals in unit-test builder --- package.json | 2 +- src/builders/unit-test/builder.js | 1 + src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a8bee398..2652bc96 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-cb9d605", + "version": "20.0.0-rc.0+sha-c7f2cb5", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/builders/unit-test/builder.js b/src/builders/unit-test/builder.js index d893787d..bcd12bb0 100644 --- a/src/builders/unit-test/builder.js +++ b/src/builders/unit-test/builder.js @@ -163,6 +163,7 @@ async function* execute(options, context, extensions = {}) { instance ??= await startVitest('test', undefined /* cliFilters */, undefined /* options */, { test: { root: outputPath, + globals: true, setupFiles, // Use `jsdom` if no browsers are explicitly configured. // `node` is effectively no "environment" and the default. diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 2a0012b7..e7b75c2c 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-cb9d605'; +const VERSION = '20.0.0-rc.0+sha-c7f2cb5'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 3bb0bf5e..1b3fef7e 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue May 13 2025 14:35:44 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue May 13 2025 17:20:49 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 54a3878a182e657c29e8f24a85bebcf0f5fef1fa Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 14 May 2025 11:19:34 +0000 Subject: [PATCH 42/63] 0d40cde fix(@angular/build): setup unit-test polyfills before TestBed init --- package.json | 2 +- src/builders/unit-test/builder.js | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 2652bc96..81f2381d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-c7f2cb5", + "version": "20.0.0-rc.0+sha-0d40cde", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/builders/unit-test/builder.js b/src/builders/unit-test/builder.js index bcd12bb0..8e9979f9 100644 --- a/src/builders/unit-test/builder.js +++ b/src/builders/unit-test/builder.js @@ -148,7 +148,7 @@ async function* execute(options, context, extensions = {}) { // Add setup file entries for TestBed initialization and project polyfills const setupFiles = ['init-testbed.js']; if (buildTargetOptions?.polyfills?.length) { - setupFiles.push('polyfills.js'); + setupFiles.unshift('polyfills.js'); } try { for await (const result of (0, application_1.buildApplicationInternal)(buildOptions, context, extensions)) { diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index e7b75c2c..a1a3dc07 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-c7f2cb5'; +const VERSION = '20.0.0-rc.0+sha-0d40cde'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 1b3fef7e..98a645db 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue May 13 2025 17:20:49 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed May 14 2025 11:19:34 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From d443b89ae507f02b182d358d2c94d4e2f72a6737 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 14 May 2025 13:36:59 +0000 Subject: [PATCH 43/63] 255bc55 build: update dependency terser to v5.39.1 --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 81f2381d..299ea453 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-0d40cde", + "version": "20.0.0-rc.0+sha-255bc55", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index a1a3dc07..c21a4196 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-0d40cde'; +const VERSION = '20.0.0-rc.0+sha-255bc55'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 98a645db..c25a1ce9 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed May 14 2025 11:19:34 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed May 14 2025 13:36:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 16dcabf7f44f6a10acee7c5a8458f2ba6f5fc7da Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 14 May 2025 16:39:18 +0000 Subject: [PATCH 44/63] 3cf6ab0 fix(@schematics/angular): support using default browser option when not present --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 299ea453..22a7f9bb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-255bc55", + "version": "20.0.0-rc.0+sha-3cf6ab0", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index c21a4196..73b25b30 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-255bc55'; +const VERSION = '20.0.0-rc.0+sha-3cf6ab0'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index c25a1ce9..394e202d 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed May 14 2025 13:36:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed May 14 2025 16:39:18 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From df4d5fb1076e233bd01294d95e787602d340697c Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 14 May 2025 18:17:27 +0000 Subject: [PATCH 45/63] c2030ed release: cut the v20.0.0-rc.1 release --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 22a7f9bb..d12bec94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.0+sha-3cf6ab0", + "version": "20.0.0-rc.1+sha-c2030ed", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 73b25b30..c40a3adb 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.0+sha-3cf6ab0'; +const VERSION = '20.0.0-rc.1+sha-c2030ed'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 394e202d..a2718b8f 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed May 14 2025 16:39:18 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed May 14 2025 18:17:27 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From be069a82adb65827f157b38614891b153a5df575 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 14 May 2025 19:47:55 +0000 Subject: [PATCH 46/63] d2bfc6b fix(@angular/build): revert setup unit-test polyfills before TestBed init --- package.json | 2 +- src/builders/unit-test/builder.js | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index d12bec94..14c0b1df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.1+sha-c2030ed", + "version": "20.0.0-rc.1+sha-d2bfc6b", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/builders/unit-test/builder.js b/src/builders/unit-test/builder.js index 8e9979f9..bcd12bb0 100644 --- a/src/builders/unit-test/builder.js +++ b/src/builders/unit-test/builder.js @@ -148,7 +148,7 @@ async function* execute(options, context, extensions = {}) { // Add setup file entries for TestBed initialization and project polyfills const setupFiles = ['init-testbed.js']; if (buildTargetOptions?.polyfills?.length) { - setupFiles.unshift('polyfills.js'); + setupFiles.push('polyfills.js'); } try { for await (const result of (0, application_1.buildApplicationInternal)(buildOptions, context, extensions)) { diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index c40a3adb..904fb7c5 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.1+sha-c2030ed'; +const VERSION = '20.0.0-rc.1+sha-d2bfc6b'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index a2718b8f..65e58162 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed May 14 2025 18:17:27 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed May 14 2025 19:47:55 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 5d146935bf7122d583229d3d822b569a7a4265c3 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 14 May 2025 20:19:59 +0000 Subject: [PATCH 47/63] bbd35bd release: cut the v20.0.0-rc.2 release --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 14c0b1df..51146f84 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.1+sha-d2bfc6b", + "version": "20.0.0-rc.2+sha-bbd35bd", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 904fb7c5..17fe0286 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.1+sha-d2bfc6b'; +const VERSION = '20.0.0-rc.2+sha-bbd35bd'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 65e58162..7c96bbae 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed May 14 2025 19:47:55 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed May 14 2025 20:19:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 53518a1a0f45ae6af5d3fb12d13c199c1d01cf2d Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 15 May 2025 08:47:03 +0000 Subject: [PATCH 48/63] a5caafd build: update dependency node to v22.15.1 --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 51146f84..9bbf1f11 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.2+sha-bbd35bd", + "version": "20.0.0-rc.2+sha-a5caafd", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 17fe0286..453dedba 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.2+sha-bbd35bd'; +const VERSION = '20.0.0-rc.2+sha-a5caafd'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 7c96bbae..de3b4b7e 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed May 14 2025 20:19:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu May 15 2025 08:47:03 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 9ea4ca92e815d75cce31ef77f985d17067e7ba9c Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 15 May 2025 13:27:31 +0000 Subject: [PATCH 49/63] 9c29cf7 refactor: remove unused function --- package.json | 2 +- src/builders/unit-test/options.js | 13 ------------- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 9bbf1f11..f540ae18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.2+sha-a5caafd", + "version": "20.0.0-rc.2+sha-9c29cf7", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/builders/unit-test/options.js b/src/builders/unit-test/options.js index 3c3d8232..43935f22 100644 --- a/src/builders/unit-test/options.js +++ b/src/builders/unit-test/options.js @@ -47,16 +47,3 @@ async function normalizeOptions(context, projectName, options) { providersFile: options.providersFile && node_path_1.default.join(workspaceRoot, options.providersFile), }; } -/** - * Normalize a directory path string. - * Currently only removes a trailing slash if present. - * @param path A path string. - * @returns A normalized path string. - */ -function normalizeDirectoryPath(path) { - const last = path[path.length - 1]; - if (last === '/' || last === '\\') { - return path.slice(0, -1); - } - return path; -} diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 453dedba..16e7985f 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.2+sha-a5caafd'; +const VERSION = '20.0.0-rc.2+sha-9c29cf7'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index de3b4b7e..06e895bd 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu May 15 2025 08:47:03 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu May 15 2025 13:27:31 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 885182fbe36f69fd933b2da0113c396588c63e12 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 15 May 2025 21:15:58 +0000 Subject: [PATCH 50/63] eee816f fix(@angular/build): use global unit-test hooks during TestBed init --- package.json | 2 +- src/builders/unit-test/builder.js | 19 ++++++++++++++++--- src/builders/unit-test/karma-bridge.js | 3 +++ src/builders/unit-test/options.d.ts | 1 + src/builders/unit-test/options.js | 1 + src/builders/unit-test/schema.d.ts | 4 ++++ src/builders/unit-test/schema.json | 5 +++++ src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 9 files changed, 33 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index f540ae18..7dd49ec3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.2+sha-9c29cf7", + "version": "20.0.0-rc.2+sha-eee816f", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/builders/unit-test/builder.js b/src/builders/unit-test/builder.js index bcd12bb0..c49b4e94 100644 --- a/src/builders/unit-test/builder.js +++ b/src/builders/unit-test/builder.js @@ -107,7 +107,6 @@ async function* execute(options, context, extensions = {}) { `import { NgModule } from '@angular/core';`, `import { getTestBed, ɵgetCleanupHook as getCleanupHook } from '@angular/core/testing';`, `import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';`, - `import { beforeEach, afterEach } from 'vitest';`, '', normalizedOptions.providersFile ? `import providers from './${node_path_1.default @@ -140,7 +139,7 @@ async function* execute(options, context, extensions = {}) { extensions.codePlugins.unshift(virtualTestBedInit); let instance; // Setup vitest browser options if configured - const { browser, errors } = setupBrowserConfiguration(normalizedOptions.browsers, projectSourceRoot); + const { browser, errors } = setupBrowserConfiguration(normalizedOptions.browsers, normalizedOptions.debug, projectSourceRoot); if (errors?.length) { errors.forEach((error) => context.logger.error(error)); return { success: false }; @@ -150,6 +149,13 @@ async function* execute(options, context, extensions = {}) { if (buildTargetOptions?.polyfills?.length) { setupFiles.push('polyfills.js'); } + const debugOptions = normalizedOptions.debug + ? { + inspectBrk: true, + isolate: false, + fileParallelism: false, + } + : {}; try { for await (const result of (0, application_1.buildApplicationInternal)(buildOptions, context, extensions)) { if (result.kind === results_1.ResultKind.Failure) { @@ -176,6 +182,7 @@ async function* execute(options, context, extensions = {}) { exclude: normalizedOptions.codeCoverageExclude, excludeAfterRemap: true, }, + ...debugOptions, }, }); // Check if all the tests pass to calculate the result @@ -201,7 +208,7 @@ function findBrowserProvider(projectResolver) { catch { } } } -function setupBrowserConfiguration(browsers, projectSourceRoot) { +function setupBrowserConfiguration(browsers, debug, projectSourceRoot) { if (browsers === undefined) { return {}; } @@ -221,6 +228,12 @@ function setupBrowserConfiguration(browsers, projectSourceRoot) { errors.push('The "browsers" option requires either "playwright" or "webdriverio" to be installed within the project.' + ' Please install one of these packages and rerun the test command.'); } + // Vitest current requires the playwright browser provider to use the inspect-brk option used by "debug" + if (debug && provider !== 'playwright') { + errors ??= []; + errors.push('Debugging browser mode tests currently requires the use of "playwright".' + + ' Please install this package and rerun the test command.'); + } if (errors) { return { errors }; } diff --git a/src/builders/unit-test/karma-bridge.js b/src/builders/unit-test/karma-bridge.js index f048d510..36a4e996 100644 --- a/src/builders/unit-test/karma-bridge.js +++ b/src/builders/unit-test/karma-bridge.js @@ -42,6 +42,9 @@ var __importStar = (this && this.__importStar) || (function () { Object.defineProperty(exports, "__esModule", { value: true }); exports.useKarmaBuilder = useKarmaBuilder; async function useKarmaBuilder(context, unitTestOptions) { + if (unitTestOptions.debug) { + context.logger.warn('The "karma" test runner does not support the "debug" option. The option will be ignored.'); + } const buildTargetOptions = (await context.validateOptions(await context.getTargetOptions(unitTestOptions.buildTarget), await context.getBuilderNameForTarget(unitTestOptions.buildTarget))); const options = { tsConfig: unitTestOptions.tsConfig, diff --git a/src/builders/unit-test/options.d.ts b/src/builders/unit-test/options.d.ts index 1cc1fd55..f7c6d6d6 100644 --- a/src/builders/unit-test/options.d.ts +++ b/src/builders/unit-test/options.d.ts @@ -23,5 +23,6 @@ export declare function normalizeOptions(context: BuilderContext, projectName: s reporters: string[] | undefined; browsers: string[] | undefined; watch: boolean | undefined; + debug: boolean; providersFile: string | undefined; }>; diff --git a/src/builders/unit-test/options.js b/src/builders/unit-test/options.js index 43935f22..95f98dde 100644 --- a/src/builders/unit-test/options.js +++ b/src/builders/unit-test/options.js @@ -44,6 +44,7 @@ async function normalizeOptions(context, projectName, options) { reporters, browsers, watch, + debug: options.debug ?? false, providersFile: options.providersFile && node_path_1.default.join(workspaceRoot, options.providersFile), }; } diff --git a/src/builders/unit-test/schema.d.ts b/src/builders/unit-test/schema.d.ts index 51f6d129..cacb6c80 100644 --- a/src/builders/unit-test/schema.d.ts +++ b/src/builders/unit-test/schema.d.ts @@ -21,6 +21,10 @@ export type Schema = { * Globs to exclude from code coverage. */ codeCoverageExclude?: string[]; + /** + * Initialize the test runner to support using the Node Inspector for test debugging. + */ + debug?: boolean; /** * Globs of files to exclude, relative to the project root. */ diff --git a/src/builders/unit-test/schema.json b/src/builders/unit-test/schema.json index 8cc91c7d..764a751a 100644 --- a/src/builders/unit-test/schema.json +++ b/src/builders/unit-test/schema.json @@ -46,6 +46,11 @@ "type": "boolean", "description": "Run build when files change." }, + "debug": { + "type": "boolean", + "description": "Initialize the test runner to support using the Node Inspector for test debugging.", + "default": false + }, "codeCoverage": { "type": "boolean", "description": "Output a code coverage report.", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 16e7985f..a887c198 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.2+sha-9c29cf7'; +const VERSION = '20.0.0-rc.2+sha-eee816f'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 06e895bd..50dc97fd 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu May 15 2025 13:27:31 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu May 15 2025 21:15:58 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 95428cfeb4eaad164d292922625b421eeecdc8c9 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Thu, 15 May 2025 21:24:01 +0000 Subject: [PATCH 51/63] 059c10e fix(@angular/ssr): SSR should work without `@angular/router` --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7dd49ec3..2f8cbef2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.2+sha-eee816f", + "version": "20.0.0-rc.2+sha-059c10e", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index a887c198..15a2e266 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.2+sha-eee816f'; +const VERSION = '20.0.0-rc.2+sha-059c10e'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 50dc97fd..01c21f67 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu May 15 2025 21:15:58 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Thu May 15 2025 21:24:01 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From e9e7c8038915f61db9a2da03e13137f52b47f1cc Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 16 May 2025 02:13:07 +0000 Subject: [PATCH 52/63] b155ba1 fix(@angular/build): enable unit-test builder watch outside CI --- package.json | 2 +- src/builders/unit-test/options.d.ts | 2 +- src/builders/unit-test/options.js | 5 +++-- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 2f8cbef2..0e93a1f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.2+sha-059c10e", + "version": "20.0.0-rc.2+sha-b155ba1", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/builders/unit-test/options.d.ts b/src/builders/unit-test/options.d.ts index f7c6d6d6..69715766 100644 --- a/src/builders/unit-test/options.d.ts +++ b/src/builders/unit-test/options.d.ts @@ -22,7 +22,7 @@ export declare function normalizeOptions(context: BuilderContext, projectName: s tsConfig: string; reporters: string[] | undefined; browsers: string[] | undefined; - watch: boolean | undefined; + watch: boolean; debug: boolean; providersFile: string | undefined; }>; diff --git a/src/builders/unit-test/options.js b/src/builders/unit-test/options.js index 95f98dde..75437dbf 100644 --- a/src/builders/unit-test/options.js +++ b/src/builders/unit-test/options.js @@ -15,6 +15,7 @@ const architect_1 = require("@angular-devkit/architect"); const node_path_1 = __importDefault(require("node:path")); const normalize_cache_1 = require("../../utils/normalize-cache"); const project_metadata_1 = require("../../utils/project-metadata"); +const tty_1 = require("../../utils/tty"); async function normalizeOptions(context, projectName, options) { // Setup base paths based on workspace root and project information const workspaceRoot = context.workspaceRoot; @@ -26,7 +27,7 @@ async function normalizeOptions(context, projectName, options) { // Target specifier defaults to the current project's build target using a development configuration const buildTargetSpecifier = options.buildTarget ?? `::development`; const buildTarget = (0, architect_1.targetFromTargetString)(buildTargetSpecifier, projectName, 'build'); - const { codeCoverage, codeCoverageExclude, tsConfig, runner, reporters, browsers, watch } = options; + const { codeCoverage, codeCoverageExclude, tsConfig, runner, reporters, browsers } = options; return { // Project/workspace information workspaceRoot, @@ -43,7 +44,7 @@ async function normalizeOptions(context, projectName, options) { tsConfig, reporters, browsers, - watch, + watch: options.watch ?? (0, tty_1.isTTY)(), debug: options.debug ?? false, providersFile: options.providersFile && node_path_1.default.join(workspaceRoot, options.providersFile), }; diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 15a2e266..db3700e5 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.2+sha-059c10e'; +const VERSION = '20.0.0-rc.2+sha-b155ba1'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 01c21f67..1d9ce4ba 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Thu May 15 2025 21:24:01 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri May 16 2025 02:13:07 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From ce2ac3a77cef88552c3df493fab866c2c74c5f51 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 16 May 2025 13:20:14 +0000 Subject: [PATCH 53/63] 4b57934 build: update dev-infra for latest RBE changes --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0e93a1f6..e936aeb5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.2+sha-b155ba1", + "version": "20.0.0-rc.2+sha-4b57934", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index db3700e5..1e0df1ec 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.2+sha-b155ba1'; +const VERSION = '20.0.0-rc.2+sha-4b57934'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 1d9ce4ba..424c2f56 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri May 16 2025 02:13:07 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri May 16 2025 13:20:14 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From e773040db8bed00ca490130dba3e7cc9fcea4059 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Fri, 16 May 2025 17:02:20 +0000 Subject: [PATCH 54/63] b264517 build: update dependency aspect_rules_ts to v3.6.0 --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e936aeb5..afdc31b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.2+sha-4b57934", + "version": "20.0.0-rc.2+sha-b264517", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 1e0df1ec..c242525b 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.2+sha-4b57934'; +const VERSION = '20.0.0-rc.2+sha-b264517'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 424c2f56..c735ba43 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri May 16 2025 13:20:14 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Fri May 16 2025 17:02:20 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 3c05177b1cc5bb84494bc5695a4e916aaadad9b8 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 19 May 2025 12:43:25 +0000 Subject: [PATCH 55/63] 5b43174 fix(@angular/pwa): remove `background_color` and `theme_color` from manifest --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index afdc31b4..29642acd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.2+sha-b264517", + "version": "20.0.0-rc.2+sha-5b43174", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index c242525b..bf115506 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.2+sha-b264517'; +const VERSION = '20.0.0-rc.2+sha-5b43174'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index c735ba43..42ac18b8 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Fri May 16 2025 17:02:20 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon May 19 2025 12:43:25 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 9f937e4dcc3a7079c515f2fed36673f48ebdfd15 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Mon, 19 May 2025 17:24:45 +0000 Subject: [PATCH 56/63] aec9504 fix(@angular/build): exclude only source test files with unit-test vitest support --- package.json | 2 +- src/builders/unit-test/builder.js | 16 +++++++++++++++- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 29642acd..5e9d66a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.2+sha-5b43174", + "version": "20.0.0-rc.2+sha-aec9504", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/builders/unit-test/builder.js b/src/builders/unit-test/builder.js index c49b4e94..3f787bfe 100644 --- a/src/builders/unit-test/builder.js +++ b/src/builders/unit-test/builder.js @@ -179,11 +179,25 @@ async function* execute(options, context, extensions = {}) { reporters: normalizedOptions.reporters ?? ['default'], coverage: { enabled: normalizedOptions.codeCoverage, - exclude: normalizedOptions.codeCoverageExclude, excludeAfterRemap: true, }, ...debugOptions, }, + plugins: [ + { + name: 'angular-coverage-exclude', + configureVitest(context) { + // Adjust coverage excludes to not include the otherwise automatically inserted included unit tests. + // Vite does this as a convenience but is problematic for the bundling strategy employed by the + // builder's test setup. To workaround this, the excludes are adjusted here to only automatically + // exclude the TypeScript source test files. + context.project.config.coverage.exclude = [ + ...(normalizedOptions.codeCoverageExclude ?? []), + '**/*.{test,spec}.?(c|m)ts', + ]; + }, + }, + ], }); // Check if all the tests pass to calculate the result const testModules = instance.state.getTestModules(); diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index bf115506..72c6036d 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.2+sha-5b43174'; +const VERSION = '20.0.0-rc.2+sha-aec9504'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 42ac18b8..2eb3db60 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon May 19 2025 12:43:25 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Mon May 19 2025 17:24:45 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 13c3f6fee49a8038a51dfefedd5c376a1b8602c7 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 20 May 2025 12:38:38 +0000 Subject: [PATCH 57/63] 787e510 fix(@angular/cli): update min Node.js support to 20.19, 22.12, and 24.0 --- package.json | 4 ++-- src/tools/esbuild/utils.js | 2 +- src/utils/load-proxy-config.js | 9 +++++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 5e9d66a4..cd926af5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.2+sha-aec9504", + "version": "20.0.0-rc.2+sha-787e510", "description": "Official build system for Angular", "keywords": [ "Angular CLI", @@ -112,7 +112,7 @@ }, "packageManager": "pnpm@9.15.9", "engines": { - "node": "^20.11.1 || ^22.11.0 || >=24.0.0", + "node": "^20.19.0 || ^22.12.0 || >=24.0.0", "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", "yarn": ">= 1.13.0" }, diff --git a/src/tools/esbuild/utils.js b/src/tools/esbuild/utils.js index e6542ded..d2d4761b 100644 --- a/src/tools/esbuild/utils.js +++ b/src/tools/esbuild/utils.js @@ -315,7 +315,7 @@ function transformSupportedBrowsersToTargets(supportedBrowsers) { } return transformed; } -const SUPPORTED_NODE_VERSIONS = '^20.11.1 || ^22.11.0 || >=24.0.0'; +const SUPPORTED_NODE_VERSIONS = '^20.19.0 || ^22.12.0 || >=24.0.0'; /** * Transform supported Node.js versions to esbuild target. * @see https://esbuild.github.io/api/#target diff --git a/src/utils/load-proxy-config.js b/src/utils/load-proxy-config.js index de865595..2f89d612 100644 --- a/src/utils/load-proxy-config.js +++ b/src/utils/load-proxy-config.js @@ -78,8 +78,7 @@ async function loadProxyConfiguration(root, proxyConfig) { // Load the ESM configuration file using the TypeScript dynamic import workaround. // Once TypeScript provides support for keeping the dynamic import this workaround can be // changed to a direct dynamic import. - proxyConfiguration = (await (0, load_esm_1.loadEsmModule)((0, node_url_1.pathToFileURL)(proxyPath))) - .default; + proxyConfiguration = await (0, load_esm_1.loadEsmModule)((0, node_url_1.pathToFileURL)(proxyPath)); break; case '.cjs': proxyConfiguration = require(proxyPath); @@ -97,13 +96,15 @@ async function loadProxyConfiguration(root, proxyConfig) { // Load the ESM configuration file using the TypeScript dynamic import workaround. // Once TypeScript provides support for keeping the dynamic import this workaround can be // changed to a direct dynamic import. - proxyConfiguration = (await (0, load_esm_1.loadEsmModule)((0, node_url_1.pathToFileURL)(proxyPath))) - .default; + proxyConfiguration = await (0, load_esm_1.loadEsmModule)((0, node_url_1.pathToFileURL)(proxyPath)); break; } throw e; } } + if ('default' in proxyConfiguration) { + proxyConfiguration = proxyConfiguration.default; + } return normalizeProxyConfiguration(proxyConfiguration); } /** diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 72c6036d..087a3772 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.2+sha-aec9504'; +const VERSION = '20.0.0-rc.2+sha-787e510'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 2eb3db60..7062930f 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Mon May 19 2025 17:24:45 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue May 20 2025 12:38:38 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From d6ead0525c5d8fdf5d81111061e227b9d4d506c9 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 20 May 2025 14:56:46 +0000 Subject: [PATCH 58/63] 36c2a82 build: update rules_angular digest to 5b9b1fc --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index cd926af5..1bf51ace 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.2+sha-787e510", + "version": "20.0.0-rc.2+sha-36c2a82", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 087a3772..466e6f65 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.2+sha-787e510'; +const VERSION = '20.0.0-rc.2+sha-36c2a82'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 7062930f..697d2a44 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue May 20 2025 12:38:38 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue May 20 2025 14:56:46 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 1295ef146ff38a1a555973b3391bbacb4db83e6c Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Tue, 20 May 2025 15:50:59 +0000 Subject: [PATCH 59/63] a42e045 fix(@angular-devkit/build-angular): respect i18nDuplicateTranslation option when duplicates exist --- package.json | 2 +- src/builders/extract-i18n/builder.js | 13 ++++++++++--- src/builders/extract-i18n/options.d.ts | 6 +++++- src/builders/extract-i18n/options.js | 5 ++++- src/builders/extract-i18n/schema.d.ts | 12 ++++++++++++ src/builders/extract-i18n/schema.js | 11 ++++++++++- src/builders/extract-i18n/schema.json | 5 +++++ src/utils/i18n-options.d.ts | 2 -- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 10 files changed, 49 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 1bf51ace..236a976a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.2+sha-36c2a82", + "version": "20.0.0-rc.2+sha-a42e045", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/builders/extract-i18n/builder.js b/src/builders/extract-i18n/builder.js index 19b0f374..bcf5ec01 100644 --- a/src/builders/extract-i18n/builder.js +++ b/src/builders/extract-i18n/builder.js @@ -100,13 +100,20 @@ async function execute(options, context, extensions) { return node_path_1.default.relative(from, to); }, }; + const duplicateTranslationBehavior = normalizedOptions.i18nOptions.duplicateTranslationBehavior; const diagnostics = checkDuplicateMessages( // eslint-disable-next-line @typescript-eslint/no-explicit-any - checkFileSystem, extractionResult.messages, normalizedOptions.i18nOptions.i18nDuplicateTranslation || 'warning', + checkFileSystem, extractionResult.messages, duplicateTranslationBehavior, // eslint-disable-next-line @typescript-eslint/no-explicit-any extractionResult.basePath); - if (diagnostics.messages.length > 0) { - context.logger.warn(diagnostics.formatDiagnostics('')); + if (diagnostics.messages.length > 0 && duplicateTranslationBehavior !== 'ignore') { + if (duplicateTranslationBehavior === 'error') { + context.logger.error(`Extraction Failed: ${diagnostics.formatDiagnostics('')}`); + return { success: false }; + } + else { + context.logger.warn(diagnostics.formatDiagnostics('')); + } } // Serialize all extracted messages const serializer = await createSerializer(localizeToolsModule, normalizedOptions.format, normalizedOptions.i18nOptions.sourceLocale, extractionResult.basePath, extractionResult.useLegacyIds, diagnostics); diff --git a/src/builders/extract-i18n/options.d.ts b/src/builders/extract-i18n/options.d.ts index b23a5b83..c2c4ace5 100644 --- a/src/builders/extract-i18n/options.d.ts +++ b/src/builders/extract-i18n/options.d.ts @@ -5,7 +5,9 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ +import { type DiagnosticHandlingStrategy } from '@angular/localize/tools'; import { BuilderContext } from '@angular-devkit/architect'; +import { type I18nOptions } from '../../utils/i18n-options'; import { Schema as ExtractI18nOptions, Format } from './schema'; export type NormalizedExtractI18nOptions = Awaited>; /** @@ -22,7 +24,9 @@ export declare function normalizeOptions(context: BuilderContext, projectName: s workspaceRoot: string; projectRoot: string; buildTarget: import("@angular-devkit/architect").Target; - i18nOptions: import("../../utils/i18n-options").I18nOptions; + i18nOptions: I18nOptions & { + duplicateTranslationBehavior: DiagnosticHandlingStrategy; + }; format: Format.Arb | Format.Json | Format.LegacyMigrate | Format.Xliff | Format.Xliff2 | Format.Xmb; outFile: string; progress: boolean; diff --git a/src/builders/extract-i18n/options.js b/src/builders/extract-i18n/options.js index b3b50d51..d7b5fe54 100644 --- a/src/builders/extract-i18n/options.js +++ b/src/builders/extract-i18n/options.js @@ -33,7 +33,10 @@ async function normalizeOptions(context, projectName, options) { // Target specifier defaults to the current project's build target with no specified configuration const buildTargetSpecifier = options.buildTarget ?? ':'; const buildTarget = (0, architect_1.targetFromTargetString)(buildTargetSpecifier, projectName, 'build'); - const i18nOptions = (0, i18n_options_1.createI18nOptions)(projectMetadata, /** inline */ false, context.logger); + const i18nOptions = { + ...(0, i18n_options_1.createI18nOptions)(projectMetadata, /** inline */ false, context.logger), + duplicateTranslationBehavior: options.i18nDuplicateTranslation || 'warning', + }; // Normalize xliff format extensions let format = options.format; switch (format) { diff --git a/src/builders/extract-i18n/schema.d.ts b/src/builders/extract-i18n/schema.d.ts index fa72d336..b5911201 100644 --- a/src/builders/extract-i18n/schema.d.ts +++ b/src/builders/extract-i18n/schema.d.ts @@ -12,6 +12,10 @@ export type Schema = { * Output format for the generated file. */ format?: Format; + /** + * How to handle duplicate translations. + */ + i18nDuplicateTranslation?: I18NDuplicateTranslation; /** * Name of the file to output. */ @@ -39,3 +43,11 @@ export declare enum Format { Xliff2 = "xliff2", Xmb = "xmb" } +/** + * How to handle duplicate translations. + */ +export declare enum I18NDuplicateTranslation { + Error = "error", + Ignore = "ignore", + Warning = "warning" +} diff --git a/src/builders/extract-i18n/schema.js b/src/builders/extract-i18n/schema.js index 6f767a2e..3904eb68 100644 --- a/src/builders/extract-i18n/schema.js +++ b/src/builders/extract-i18n/schema.js @@ -2,7 +2,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE // CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...). Object.defineProperty(exports, "__esModule", { value: true }); -exports.Format = void 0; +exports.I18NDuplicateTranslation = exports.Format = void 0; /** * Output format for the generated file. */ @@ -18,3 +18,12 @@ var Format; Format["Xliff2"] = "xliff2"; Format["Xmb"] = "xmb"; })(Format || (exports.Format = Format = {})); +/** + * How to handle duplicate translations. + */ +var I18NDuplicateTranslation; +(function (I18NDuplicateTranslation) { + I18NDuplicateTranslation["Error"] = "error"; + I18NDuplicateTranslation["Ignore"] = "ignore"; + I18NDuplicateTranslation["Warning"] = "warning"; +})(I18NDuplicateTranslation || (exports.I18NDuplicateTranslation = I18NDuplicateTranslation = {})); diff --git a/src/builders/extract-i18n/schema.json b/src/builders/extract-i18n/schema.json index 9ab939b0..08a118ad 100644 --- a/src/builders/extract-i18n/schema.json +++ b/src/builders/extract-i18n/schema.json @@ -27,6 +27,11 @@ "outFile": { "type": "string", "description": "Name of the file to output." + }, + "i18nDuplicateTranslation": { + "type": "string", + "description": "How to handle duplicate translations.", + "enum": ["error", "warning", "ignore"] } }, "additionalProperties": false diff --git a/src/utils/i18n-options.d.ts b/src/utils/i18n-options.d.ts index 364132b0..481a3221 100644 --- a/src/utils/i18n-options.d.ts +++ b/src/utils/i18n-options.d.ts @@ -5,7 +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.dev/license */ -import { DiagnosticHandlingStrategy } from '@angular/localize/tools'; import type { TranslationLoader } from './load-translations'; export interface LocaleDescription { files: { @@ -25,7 +24,6 @@ export interface I18nOptions { flatOutput?: boolean; readonly shouldInline: boolean; hasDefinedSourceLocale?: boolean; - i18nDuplicateTranslation?: DiagnosticHandlingStrategy; } export declare function createI18nOptions(projectMetadata: { i18n?: unknown; diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 466e6f65..dab9fa9c 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.2+sha-36c2a82'; +const VERSION = '20.0.0-rc.2+sha-a42e045'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 697d2a44..97af024d 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue May 20 2025 14:56:46 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Tue May 20 2025 15:50:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From c14de20c364b662933cdd07d170816bf187c66da Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 21 May 2025 07:41:18 +0000 Subject: [PATCH 60/63] 7877d9a fix(@angular/build): ensure disabled vitest config loading --- package.json | 2 +- src/builders/unit-test/builder.js | 5 ++++- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 236a976a..9fc7b259 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.2+sha-a42e045", + "version": "20.0.0-rc.2+sha-7877d9a", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/builders/unit-test/builder.js b/src/builders/unit-test/builder.js index 3f787bfe..1ceb2e88 100644 --- a/src/builders/unit-test/builder.js +++ b/src/builders/unit-test/builder.js @@ -166,7 +166,10 @@ async function* execute(options, context, extensions = {}) { } (0, node_assert_1.default)(result.files, 'Builder did not provide result files.'); await (0, application_builder_1.writeTestFiles)(result.files, outputPath); - instance ??= await startVitest('test', undefined /* cliFilters */, undefined /* options */, { + instance ??= await startVitest('test', undefined /* cliFilters */, { + // Disable configuration file resolution/loading + config: false, + }, { test: { root: outputPath, globals: true, diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index dab9fa9c..dd9044de 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.2+sha-a42e045'; +const VERSION = '20.0.0-rc.2+sha-7877d9a'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 97af024d..aab50360 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Tue May 20 2025 15:50:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed May 21 2025 07:41:18 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From ecb32af6be94608772eca7d6fa9ca501e3652677 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 21 May 2025 11:14:59 +0000 Subject: [PATCH 61/63] 4f515ad release: cut the v20.0.0-rc.3 release --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9fc7b259..05a8d494 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.2+sha-7877d9a", + "version": "20.0.0-rc.3+sha-4f515ad", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index dd9044de..8d5e2c57 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.2+sha-7877d9a'; +const VERSION = '20.0.0-rc.3+sha-4f515ad'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index aab50360..5443a821 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed May 21 2025 07:41:18 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed May 21 2025 11:14:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 45bd797d2ed84162d17f24330e84ab3049c418b7 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 21 May 2025 13:03:43 +0000 Subject: [PATCH 62/63] be8cfba build: update ora to version 8 --- package.json | 2 +- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 05a8d494..dfc13e96 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.3+sha-4f515ad", + "version": "20.0.0-rc.3+sha-be8cfba", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 8d5e2c57..94c5309e 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.3+sha-4f515ad'; +const VERSION = '20.0.0-rc.3+sha-be8cfba'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 5443a821..556f0f2c 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed May 21 2025 11:14:59 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed May 21 2025 13:03:43 GMT+0000 (Coordinated Universal Time) \ No newline at end of file From 61375c3da8fe1ef9dd6f2de1812fe34fb3d811c9 Mon Sep 17 00:00:00 2001 From: Angular Builds Date: Wed, 21 May 2025 14:06:54 +0000 Subject: [PATCH 63/63] b776d32 refactor(@angular/build): check that AOT is enabled in HMR logic --- package.json | 2 +- src/builders/dev-server/vite-server.js | 7 +++---- src/utils/normalize-cache.js | 2 +- uniqueId | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index dfc13e96..65a0aa80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/build", - "version": "20.0.0-rc.3+sha-be8cfba", + "version": "20.0.0-rc.3+sha-b776d32", "description": "Official build system for Angular", "keywords": [ "Angular CLI", diff --git a/src/builders/dev-server/vite-server.js b/src/builders/dev-server/vite-server.js index 472a92b5..2c9090c2 100644 --- a/src/builders/dev-server/vite-server.js +++ b/src/builders/dev-server/vite-server.js @@ -114,13 +114,12 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context // https://nodejs.org/api/process.html#processsetsourcemapsenabledval process.setSourceMapsEnabled(true); } + const componentsHmrCanBeUsed = browserOptions.aot && serverOptions.liveReload && serverOptions.hmr; // Enable to support link-based component style hot reloading (`NG_HMR_CSTYLES=1` can be used to enable) - browserOptions.externalRuntimeStyles = - serverOptions.liveReload && serverOptions.hmr && environment_options_1.useComponentStyleHmr; + browserOptions.externalRuntimeStyles = componentsHmrCanBeUsed && environment_options_1.useComponentStyleHmr; // Enable to support component template hot replacement (`NG_HMR_TEMPLATE=0` can be used to disable selectively) // This will also replace file-based/inline styles as code if external runtime styles are not enabled. - browserOptions.templateUpdates = - serverOptions.liveReload && serverOptions.hmr && environment_options_1.useComponentTemplateHmr; + browserOptions.templateUpdates = componentsHmrCanBeUsed && environment_options_1.useComponentTemplateHmr; browserOptions.incrementalResults = true; // Setup the prebundling transformer that will be shared across Vite prebundling requests const prebundleTransformer = new internal_1.JavaScriptTransformer( diff --git a/src/utils/normalize-cache.js b/src/utils/normalize-cache.js index 94c5309e..53c08ce3 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 = normalizeCacheOptions; const node_path_1 = require("node:path"); /** Version placeholder is replaced during the build process with actual package version */ -const VERSION = '20.0.0-rc.3+sha-be8cfba'; +const VERSION = '20.0.0-rc.3+sha-b776d32'; function hasCacheMetadata(value) { return (!!value && typeof value === 'object' && diff --git a/uniqueId b/uniqueId index 556f0f2c..082e4924 100644 --- a/uniqueId +++ b/uniqueId @@ -1 +1 @@ -Wed May 21 2025 13:03:43 GMT+0000 (Coordinated Universal Time) \ No newline at end of file +Wed May 21 2025 14:06:54 GMT+0000 (Coordinated Universal Time) \ No newline at end of file