Skip to content

Commit

Permalink
chore: revert hasFancyRefs
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Apr 22, 2021
1 parent 572749a commit 6232b65
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/manager/npm/extract/__snapshots__/index.spec.ts.snap
Expand Up @@ -357,7 +357,7 @@ Object {
"packageJsonName": undefined,
"packageJsonType": "app",
"pnpmShrinkwrap": undefined,
"skipInstalls": true,
"skipInstalls": false,
"yarnLock": undefined,
"yarnWorkspacesPackages": undefined,
"yarnrc": undefined,
Expand Down
11 changes: 6 additions & 5 deletions lib/manager/npm/extract/index.ts
Expand Up @@ -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;
Expand Down Expand Up @@ -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];
Expand All @@ -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)) {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 6232b65

Please sign in to comment.