Skip to content

Commit

Permalink
fix: do not try to inflate a fresh lockfile
Browse files Browse the repository at this point in the history
when running an updateAll, we use Shrinkwrap.reset() to empty and reset
the lockfile metadata. however, due to _inflateAncientLockfile having a
check on meta.originalLockfileVersion, we need that property to be set
on a freshly reset lock so that _inflateAncientLockfile knows it has no
work to be done.

PR-URL: npm#293
Credit: @nlf
Close: npm#293
Reviewed-by: @ruyadorno, @isaacs
  • Loading branch information
nlf authored and isaacs committed Jun 18, 2021
1 parent 8b161b0 commit 1c295c0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions lib/shrinkwrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ class Shrinkwrap {
reset () {
this.tree = null
this[_awaitingUpdate] = new Map()
this.originalLockfileVersion = lockfileVersion
this.data = {
lockfileVersion,
requires: true,
Expand Down
1 change: 0 additions & 1 deletion test/arborist/reify.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,6 @@ t.test('warn on reifying deprecated dependency', t => {
})
const check = warningTracker()
return a.reify({ update: true }).then(() => t.match(check(), [
oldLockfileWarning,
[
'warn',
'deprecated',
Expand Down

0 comments on commit 1c295c0

Please sign in to comment.