From c9c40fb6812e0bedcb3693d778850f27543cf20d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Nison?= Date: Wed, 30 Sep 2020 01:11:04 +0200 Subject: [PATCH] Restricts to exact versions --- package.json | 2 +- sources/specUtils.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 525523f28..af837f4d6 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "yarn": "./dist/yarn.js", "yarnpkg": "./dist/yarnpkg.js" }, - "packageManager": "yarn@^2.0.0-rc.29", + "packageManager": "yarn@2.0.0-rc.29", "devDependencies": { "@babel/core": "^7.11.0", "@babel/plugin-proposal-class-properties": "^7.10.4", diff --git a/sources/specUtils.ts b/sources/specUtils.ts index a3fcb79a3..3d85e370f 100644 --- a/sources/specUtils.ts +++ b/sources/specUtils.ts @@ -12,8 +12,8 @@ export function parseSpec(raw: unknown, source?: string): Descriptor { throw new UsageError(`Invalid package manager specification in ${source}; expected a string`); const match = raw.match(/^(?!_)(.+)@(.+)$/); - if (match === null || !semver.validRange(match[2])) - throw new UsageError(`Invalid package manager specification in ${source}; expected a semver range`); + if (match === null || !semver.valid(match[2])) + throw new UsageError(`Invalid package manager specification in ${source}; expected a semver version`); if (!isSupportedPackageManager(match[1])) throw new UsageError(`Unsupported package manager specification (${match})`); @@ -109,7 +109,7 @@ export async function loadSpec(initialCwd: string): Promise { } export async function persistPmSpec(updateTarget: string, locator: Locator, message: string) { - const newSpec = `${locator.name}@^${locator.reference}`; + const newSpec = `${locator.name}@${locator.reference}`; let res: boolean; try {