fix(bazel): fix major/minor semver check between @angular/bazel npm packager version and angular bazel repo version (#27635)
PR Close #27635
This commit is contained in:
parent
e3180818b0
commit
1cc08b4a4a
|
@ -57,7 +57,8 @@ if (isBazelManagedDeps()) {
|
||||||
}
|
}
|
||||||
// Be tolerant of versions such as "0.17.0-7-g76dc057"
|
// Be tolerant of versions such as "0.17.0-7-g76dc057"
|
||||||
const angularPackageVersion = contents.version.split('-')[0];
|
const angularPackageVersion = contents.version.split('-')[0];
|
||||||
const range = `~${angularPackageVersion}`; // should match patch version
|
// Should match only the major and minor versions
|
||||||
|
const range = `${semver.major(angularPackageVersion)}.${semver.minor(angularPackageVersion)}.x`;
|
||||||
if (!semver.satisfies(npmPackageVersion, range)) {
|
if (!semver.satisfies(npmPackageVersion, range)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Expected angular npm version ${npmPackageVersion} to satisfy ${range}. ` +
|
`Expected angular npm version ${npmPackageVersion} to satisfy ${range}. ` +
|
||||||
|
|
Loading…
Reference in New Issue