From cfc267426716e9ecf0c9833720cb35298284f699 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Tue, 27 Jul 2021 12:47:29 -0400 Subject: [PATCH] fix(@schematics/angular): ensure valid SemVer range for new project Angular packages While npm supports a package specifier with a trailing dash, the trailing dash is technically not SemVer compliant and fails with Yarn 2+. The 12.1.x branch will not have another prerelease which allows the prelease specifiers to be ignored in this case. --- packages/schematics/angular/utility/latest-versions.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/schematics/angular/utility/latest-versions.ts b/packages/schematics/angular/utility/latest-versions.ts index 58a08680b674..6447cf0a2943 100644 --- a/packages/schematics/angular/utility/latest-versions.ts +++ b/packages/schematics/angular/utility/latest-versions.ts @@ -26,9 +26,8 @@ export const latestVersions = { TsLib: '^2.2.0', // As Angular CLI works with same minor versions of Angular Framework, a tilde match for the current - // Angular CLI minor version with earliest prerelease (appended with `-`) will match the latest - // Angular Framework minor. - Angular: `~${getEarliestMinorVersion(require('../package.json')['version'])}-`, + // Angular CLI minor version will match the latest Angular Framework minor. + Angular: `~${getEarliestMinorVersion(require('../package.json')['version'])}`, // Since @angular-devkit/build-angular and @schematics/angular are always // published together from the same monorepo, and they are both