Skip to content

Commit a316dd0

Browse files
authored
fix(updater): npm7 package lock's inner version not being updated (conventional-changelog#713)
1 parent 605c1ab commit a316dd0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/updaters/types/json.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ module.exports.writeVersion = function (contents, version) {
1111
const indent = detectIndent(contents).indent
1212
const newline = detectNewline(contents)
1313
json.version = version
14+
15+
if (json.packages && json.packages['']) {
16+
// package-lock v2 stores version there too
17+
json.packages[''].version = version
18+
}
19+
1420
return stringifyPackage(json, indent, newline)
1521
}
1622

0 commit comments

Comments
 (0)