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:
Greg Magolan 2018-12-12 13:37:11 -08:00 committed by Miško Hevery
parent e3180818b0
commit 1cc08b4a4a
1 changed files with 2 additions and 1 deletions

View File

@ -57,7 +57,8 @@ if (isBazelManagedDeps()) {
}
// Be tolerant of versions such as "0.17.0-7-g76dc057"
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)) {
throw new Error(
`Expected angular npm version ${npmPackageVersion} to satisfy ${range}. ` +