Skip to content

Commit

Permalink
fix(@angular/build): utilize bazel stamp instead of resolving peer de…
Browse files Browse the repository at this point in the history
…pendency versions

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

Closes #29504
  • Loading branch information
alan-agius4 committed Jan 28, 2025
1 parent ec05c81 commit 0ddf6aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
1 change: 1 addition & 0 deletions packages/angular/build/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ npm_package(
"//packages/angular_devkit/architect:package.json",
],
stamp_files = [
"src/utils/version.js",
"src/tools/esbuild/utils.js",
"src/utils/normalize-cache.js",
],
Expand Down
12 changes: 1 addition & 11 deletions packages/angular/build/src/utils/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,7 @@ export function assertCompatibleAngularVersion(projectRoot: string): void | neve
return;
}

let supportedAngularSemver;
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 supportedAngularSemver = '0.0.0-ANGULAR-FW-PEER-DEP';
const angularVersion = new SemVer(angularPkgJson['version']);

if (!satisfies(angularVersion, supportedAngularSemver, { includePrerelease: true })) {
Expand Down

0 comments on commit 0ddf6aa

Please sign in to comment.