From 657061e5280e4fea2bc7f75f015887785f99f2da Mon Sep 17 00:00:00 2001 From: Matthieu Riegler Date: Wed, 13 Aug 2025 02:32:32 +0200 Subject: [PATCH] build: patch `@angular/build` to allow fw/cli mismatch (#63098) This will allow us to build adev while the CLI and the FW major versions are mismatched. we can remove this patch once the CLI has published a v21 pre-release (or a flag to disable that error). PR Close #63098 --- package.json | 3 ++- pnpm-lock.yaml | 20 +++++++++++--------- tools/pnpm-patches/@angular__build.patch | 21 +++++++++++++++++++++ 3 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 tools/pnpm-patches/@angular__build.patch diff --git a/package.json b/package.json index 9a0304bba61..f9966e48961 100644 --- a/package.json +++ b/package.json @@ -223,7 +223,8 @@ }, "pnpm": { "patchedDependencies": { - "dagre-d3-es@7.0.11": "tools/pnpm-patches/dagre-d3-es+7.0.11.patch" + "dagre-d3-es@7.0.11": "tools/pnpm-patches/dagre-d3-es+7.0.11.patch", + "@angular/build": "tools/pnpm-patches/@angular__build.patch" }, "packageExtensions": { "grpc-gcp": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d4666e91fc0..3f0d08e8ce6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,6 +13,9 @@ packageExtensionsChecksum: sha256-3L73Fw32UVtE6x5BJxJPBtQtH/mgsr31grNpdhHP1IY= pnpmfileChecksum: sha256-+7KlkWdGv7+7wb/qym+KoHN4eBGq9TNblo2Ln6HTxz0= patchedDependencies: + '@angular/build': + hash: b8e52088ccbe9b635571913e01d7ec761946ddc95d048d0f1218fb1b71e7007e + path: tools/pnpm-patches/@angular__build.patch dagre-d3-es@7.0.11: hash: 08ae1f30d46402ef53e1486454faa875683cf4152a8aab71ac255078ebfaccdd path: tools/pnpm-patches/dagre-d3-es+7.0.11.patch @@ -38,7 +41,7 @@ importers: version: link:packages/benchpress '@angular/build': specifier: 20.2.0-next.2 - version: 20.2.0-next.2(@angular/ssr@20.2.0-next.2)(@types/node@18.19.122)(chokidar@4.0.3)(jiti@1.21.7)(karma@6.4.4)(less@4.4.0)(postcss@8.5.6)(terser@5.43.1)(tslib@2.8.1)(tsx@4.20.4)(typescript@5.9.2)(yaml@2.8.1) + version: 20.2.0-next.2(patch_hash=b8e52088ccbe9b635571913e01d7ec761946ddc95d048d0f1218fb1b71e7007e)(@angular/ssr@20.2.0-next.2)(@types/node@18.19.122)(chokidar@4.0.3)(jiti@1.21.7)(karma@6.4.4)(less@4.4.0)(postcss@8.5.6)(terser@5.43.1)(tslib@2.8.1)(tsx@4.20.4)(typescript@5.9.2)(yaml@2.8.1) '@angular/cdk': specifier: 20.2.0-next.2 version: 20.2.0-next.2(rxjs@7.8.2) @@ -537,7 +540,7 @@ importers: version: link:../packages/animations '@angular/build': specifier: 20.2.0-next.2 - version: 20.2.0-next.2(@angular/ssr@20.2.0-next.2)(@types/node@24.1.0)(chokidar@4.0.3)(jiti@1.21.7)(karma@6.4.4)(less@4.4.0)(postcss@8.5.6)(terser@5.43.1)(tslib@2.8.1)(tsx@4.20.4)(typescript@5.9.2)(yaml@2.8.1) + version: 20.2.0-next.2(patch_hash=b8e52088ccbe9b635571913e01d7ec761946ddc95d048d0f1218fb1b71e7007e)(@angular/ssr@20.2.0-next.2)(@types/node@24.1.0)(chokidar@4.0.3)(jiti@1.21.7)(karma@6.4.4)(less@4.4.0)(postcss@8.5.6)(terser@5.43.1)(tslib@2.8.1)(tsx@4.20.4)(typescript@5.9.2)(yaml@2.8.1) '@angular/cdk': specifier: 20.2.0-next.2 version: 20.2.0-next.2(rxjs@7.8.2) @@ -831,7 +834,7 @@ importers: version: link:../packages/benchpress '@angular/build': specifier: 20.2.0-next.2 - version: 20.2.0-next.2(@angular/ssr@20.2.0-next.2)(@types/node@24.1.0)(chokidar@4.0.3)(jiti@1.21.7)(karma@6.4.4)(less@4.4.0)(postcss@8.5.6)(terser@5.43.1)(tslib@2.8.1)(tsx@4.20.4)(typescript@5.9.2)(yaml@2.8.1) + version: 20.2.0-next.2(patch_hash=b8e52088ccbe9b635571913e01d7ec761946ddc95d048d0f1218fb1b71e7007e)(@angular/ssr@20.2.0-next.2)(@types/node@24.1.0)(chokidar@4.0.3)(jiti@1.21.7)(karma@6.4.4)(less@4.4.0)(postcss@8.5.6)(terser@5.43.1)(tslib@2.8.1)(tsx@4.20.4)(typescript@5.9.2)(yaml@2.8.1) '@angular/common': specifier: workspace:* version: link:../packages/common @@ -1005,7 +1008,7 @@ importers: version: link:../../../animations '@angular/build': specifier: 20.2.0-next.2 - version: 20.2.0-next.2(@angular/ssr@20.2.0-next.2)(@types/node@24.1.0)(chokidar@4.0.3)(jiti@1.21.7)(karma@6.4.4)(less@4.4.0)(postcss@8.5.6)(terser@5.43.1)(tslib@2.8.1)(tsx@4.20.4)(typescript@5.9.2)(yaml@2.8.1) + version: 20.2.0-next.2(patch_hash=b8e52088ccbe9b635571913e01d7ec761946ddc95d048d0f1218fb1b71e7007e)(@angular/ssr@20.2.0-next.2)(@types/node@24.1.0)(chokidar@4.0.3)(jiti@1.21.7)(karma@6.4.4)(less@4.4.0)(postcss@8.5.6)(terser@5.43.1)(tslib@2.8.1)(tsx@4.20.4)(typescript@5.9.2)(yaml@2.8.1) '@angular/common': specifier: workspace:* version: link:../../../common @@ -8818,7 +8821,6 @@ packages: engines: {node: '>=0.6.0', teleport: '>=0.2.0'} deprecated: |- You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other. - (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) qjobs@1.2.0: @@ -11106,7 +11108,7 @@ snapshots: '@angular-devkit/architect': 0.2002.0-next.2(chokidar@4.0.3) '@angular-devkit/build-webpack': 0.2002.0-next.2(chokidar@4.0.3)(webpack-dev-server@5.2.2(webpack@5.100.2(esbuild@0.25.8)))(webpack@5.100.2(esbuild@0.25.8)) '@angular-devkit/core': 20.2.0-next.2(chokidar@4.0.3) - '@angular/build': 20.2.0-next.2(@angular/ssr@20.2.0-next.2)(@types/node@18.19.122)(chokidar@4.0.3)(jiti@1.21.7)(karma@6.4.4)(less@4.4.0)(postcss@8.5.6)(terser@5.43.1)(tslib@2.8.1)(tsx@4.20.4)(typescript@5.9.2)(yaml@2.8.1) + '@angular/build': 20.2.0-next.2(patch_hash=b8e52088ccbe9b635571913e01d7ec761946ddc95d048d0f1218fb1b71e7007e)(@angular/ssr@20.2.0-next.2)(@types/node@18.19.122)(chokidar@4.0.3)(jiti@1.21.7)(karma@6.4.4)(less@4.4.0)(postcss@8.5.6)(terser@5.43.1)(tslib@2.8.1)(tsx@4.20.4)(typescript@5.9.2)(yaml@2.8.1) '@angular/compiler-cli': link:packages/compiler-cli '@angular/core': link:packages/core '@angular/localize': link:packages/localize @@ -11196,7 +11198,7 @@ snapshots: '@angular-devkit/architect': 0.2002.0-next.2(chokidar@4.0.3) '@angular-devkit/build-webpack': 0.2002.0-next.2(chokidar@4.0.3)(webpack-dev-server@5.2.2(webpack@5.100.2(esbuild@0.25.8)))(webpack@5.100.2(esbuild@0.25.8)) '@angular-devkit/core': 20.2.0-next.2(chokidar@4.0.3) - '@angular/build': 20.2.0-next.2(@angular/ssr@20.2.0-next.2)(@types/node@24.1.0)(chokidar@4.0.3)(jiti@1.21.7)(karma@6.4.4)(less@4.4.0)(postcss@8.5.6)(terser@5.43.1)(tslib@2.8.1)(tsx@4.20.4)(typescript@5.9.2)(yaml@2.8.1) + '@angular/build': 20.2.0-next.2(patch_hash=b8e52088ccbe9b635571913e01d7ec761946ddc95d048d0f1218fb1b71e7007e)(@angular/ssr@20.2.0-next.2)(@types/node@24.1.0)(chokidar@4.0.3)(jiti@1.21.7)(karma@6.4.4)(less@4.4.0)(postcss@8.5.6)(terser@5.43.1)(tslib@2.8.1)(tsx@4.20.4)(typescript@5.9.2)(yaml@2.8.1) '@angular/compiler-cli': link:packages/compiler-cli '@angular/core': link:packages/core '@angular/localize': link:packages/localize @@ -11317,7 +11319,7 @@ snapshots: transitivePeerDependencies: - chokidar - '@angular/build@20.2.0-next.2(@angular/ssr@20.2.0-next.2)(@types/node@18.19.122)(chokidar@4.0.3)(jiti@1.21.7)(karma@6.4.4)(less@4.4.0)(postcss@8.5.6)(terser@5.43.1)(tslib@2.8.1)(tsx@4.20.4)(typescript@5.9.2)(yaml@2.8.1)': + '@angular/build@20.2.0-next.2(patch_hash=b8e52088ccbe9b635571913e01d7ec761946ddc95d048d0f1218fb1b71e7007e)(@angular/ssr@20.2.0-next.2)(@types/node@18.19.122)(chokidar@4.0.3)(jiti@1.21.7)(karma@6.4.4)(less@4.4.0)(postcss@8.5.6)(terser@5.43.1)(tslib@2.8.1)(tsx@4.20.4)(typescript@5.9.2)(yaml@2.8.1)': dependencies: '@ampproject/remapping': 2.3.0 '@angular-devkit/architect': 0.2002.0-next.2(chokidar@4.0.3) @@ -11373,7 +11375,7 @@ snapshots: - tsx - yaml - '@angular/build@20.2.0-next.2(@angular/ssr@20.2.0-next.2)(@types/node@24.1.0)(chokidar@4.0.3)(jiti@1.21.7)(karma@6.4.4)(less@4.4.0)(postcss@8.5.6)(terser@5.43.1)(tslib@2.8.1)(tsx@4.20.4)(typescript@5.9.2)(yaml@2.8.1)': + '@angular/build@20.2.0-next.2(patch_hash=b8e52088ccbe9b635571913e01d7ec761946ddc95d048d0f1218fb1b71e7007e)(@angular/ssr@20.2.0-next.2)(@types/node@24.1.0)(chokidar@4.0.3)(jiti@1.21.7)(karma@6.4.4)(less@4.4.0)(postcss@8.5.6)(terser@5.43.1)(tslib@2.8.1)(tsx@4.20.4)(typescript@5.9.2)(yaml@2.8.1)': dependencies: '@ampproject/remapping': 2.3.0 '@angular-devkit/architect': 0.2002.0-next.2(chokidar@4.0.3) diff --git a/tools/pnpm-patches/@angular__build.patch b/tools/pnpm-patches/@angular__build.patch new file mode 100644 index 00000000000..7a9277af1c4 --- /dev/null +++ b/tools/pnpm-patches/@angular__build.patch @@ -0,0 +1,21 @@ +diff --git a/src/utils/version.js b/src/utils/version.js +index 300e98cbde4c2e0e6892b44cb8db22df96692227..ee65c768b4711def71e9f028b707080ac3ed2a7b 100755 +--- a/src/utils/version.js ++++ b/src/utils/version.js +@@ -34,10 +34,10 @@ function assertCompatibleAngularVersion(projectRoot) { + return; + } + const angularVersion = new semver_1.SemVer(angularPkgJson['version']); +- if (!(0, semver_1.satisfies)(angularVersion, supportedAngularSemver, { includePrerelease: true })) { +- console.error(`Error: The current version of "@angular/build" supports Angular versions ${supportedAngularSemver},\n` + +- `but detected Angular version ${angularVersion} instead.\n` + +- 'Please visit the link below to find instructions on how to update Angular.\nhttps://update.angular.dev/'); +- process.exit(3); +- } ++ // if (!(0, semver_1.satisfies)(angularVersion, supportedAngularSemver, { includePrerelease: true })) { ++ // console.error(`Error: The current version of "@angular/build" supports Angular versions ${supportedAngularSemver},\n` + ++ // `but detected Angular version ${angularVersion} instead.\n` + ++ // 'Please visit the link below to find instructions on how to update Angular.\nhttps://update.angular.dev/'); ++ // process.exit(3); ++ // } + }