Skip to content
Snippets Groups Projects
Unverified Commit 9b6b59de authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

feat(npm): efficient update-lockfile reuse for lockfileVersion>=2 (#14097)

parent 31aab158
No related branches found
No related tags found
No related merge requests found
......@@ -39,10 +39,6 @@ export async function updateLockedDependency(
logger.warn({ err }, 'Failed to parse files');
return { status: 'update-failed' };
}
if (packageLockJson.lockfileVersion === 2) {
logger.debug('Only lockfileVersion 1 is supported');
return { status: 'update-failed' };
}
const lockedDeps = getLockedDependencies(
packageLockJson,
depName,
......@@ -67,7 +63,12 @@ export async function updateLockedDependency(
);
status = 'already-updated';
} else {
if (allowHigherOrRemoved) {
if (packageLockJson.lockfileVersion !== 1) {
logger.debug(
`Found lockfileVersion ${packageLockJson.lockfileVersion}`
);
status = 'update-failed';
} else if (allowHigherOrRemoved) {
// it's acceptable if the package is no longer present
const anyVersionLocked = getLockedDependencies(
packageLockJson,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment