fix(@angular/build): utilize bazel stamp instead of resolving peer dependency versions

This update replaces the resolution of peer dependency versions with the use of the Bazel stamp for improved consistency and reliability.

Closes #29504
This commit is contained in:
Alan Agius 2025-01-28 15:01:57 +00:00 committed by Alan Agius
parent ec05c814ee
commit 0ddf6aafaa
2 changed files with 2 additions and 11 deletions

View File

@ -224,6 +224,7 @@ npm_package(
"//packages/angular_devkit/architect:package.json", "//packages/angular_devkit/architect:package.json",
], ],
stamp_files = [ stamp_files = [
"src/utils/version.js",
"src/tools/esbuild/utils.js", "src/tools/esbuild/utils.js",
"src/utils/normalize-cache.js", "src/utils/normalize-cache.js",
], ],

View File

@ -56,17 +56,7 @@ export function assertCompatibleAngularVersion(projectRoot: string): void | neve
return; return;
} }
let supportedAngularSemver; const supportedAngularSemver = '0.0.0-ANGULAR-FW-PEER-DEP';
try {
supportedAngularSemver = projectRequire('@angular/build/package.json')['peerDependencies'][
'@angular/compiler-cli'
];
} catch {
supportedAngularSemver = projectRequire('@angular-devkit/build-angular/package.json')[
'peerDependencies'
]['@angular/compiler-cli'];
}
const angularVersion = new SemVer(angularPkgJson['version']); const angularVersion = new SemVer(angularPkgJson['version']);
if (!satisfies(angularVersion, supportedAngularSemver, { includePrerelease: true })) { if (!satisfies(angularVersion, supportedAngularSemver, { includePrerelease: true })) {