From 6232b654be38e63d78ac97278f372d7daf80836a Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Thu, 22 Apr 2021 07:58:49 +0200 Subject: [PATCH] chore: revert hasFancyRefs --- .../npm/extract/__snapshots__/index.spec.ts.snap | 2 +- lib/manager/npm/extract/index.ts | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/manager/npm/extract/__snapshots__/index.spec.ts.snap b/lib/manager/npm/extract/__snapshots__/index.spec.ts.snap index 4898775c004ac5..4d7be39d441995 100644 --- a/lib/manager/npm/extract/__snapshots__/index.spec.ts.snap +++ b/lib/manager/npm/extract/__snapshots__/index.spec.ts.snap @@ -357,7 +357,7 @@ Object { "packageJsonName": undefined, "packageJsonType": "app", "pnpmShrinkwrap": undefined, - "skipInstalls": true, + "skipInstalls": false, "yarnLock": undefined, "yarnWorkspacesPackages": undefined, "yarnrc": undefined, diff --git a/lib/manager/npm/extract/index.ts b/lib/manager/npm/extract/index.ts index c10c120f9a87cd..b6192925fe83f7 100644 --- a/lib/manager/npm/extract/index.ts +++ b/lib/manager/npm/extract/index.ts @@ -126,7 +126,7 @@ export async function extractPackageFile( let lernaJsonFile: string; let lernaPackages: string[]; let lernaClient: 'yarn' | 'npm'; - let hasFileRefs = false; + let hasFancyRefs = false; let lernaJson: { packages: string[]; npmClient: string; @@ -224,6 +224,7 @@ export async function extractPackageFile( if (dep.currentValue.startsWith('npm:')) { dep.npmPackageAlias = true; + hasFancyRefs = true; const valSplit = dep.currentValue.replace('npm:', '').split('@'); if (valSplit.length === 2) { dep.lookupName = valSplit[0]; @@ -237,7 +238,7 @@ export async function extractPackageFile( } if (dep.currentValue.startsWith('file:')) { dep.skipReason = SkipReason.File; - hasFileRefs = true; + hasFancyRefs = true; return dep; } if (isValid(dep.currentValue)) { @@ -345,11 +346,11 @@ export async function extractPackageFile( } let skipInstalls = config.skipInstalls; if (skipInstalls === null) { - if (hasFileRefs) { + if (hasFancyRefs) { // https://github.com/npm/cli/issues/1432 // Explanation: - // - npm install --package-lock-only is buggy for transitive deps in file: references - // - So we set skipInstalls to false if file: refs are found *and* the user hasn't explicitly set the value already + // - npm install --package-lock-only is buggy for transitive deps in file: and npm: references + // - So we set skipInstalls to false if file: or npm: refs are found *and* the user hasn't explicitly set the value already logger.debug('Automatically setting skipInstalls to false'); skipInstalls = false; } else {