You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hmmm... good question. I'm not actually sure whether version-bump-prompt should update the package-lock.json file by default or not. The package-lock.json file is a lockfile, not a manifest file, which is what package.json, bower.json, and component.json are. It serves a different purpose, so it might be unexpected/undesired to update package-lock.json. But, on the other hand, I can totally see some use-cases where that would be totally expected/desired.
I'll have to think about it a bit. In the meantime, I welcome any comments/input from others. I'd be interested to know whether anyone has strong opinions one way or the other.
For now though, you can sort-of accomplish the same behavior via the --grep argument. It simply searches-and-replaces any occurrence of the old version number with the new version number in one or more files. So, --grep package-lock.json would do the trick. Unfortunately, it might also modify other package versions in the file, if they happen to be the same as your old version. 💩
Version-bump-prompt should stay consistent with the npm version command, which does update package-lock.json
Reasons NOT TO update the package-lock.json
The purpose of package-lock.json is to hold the dependency tree for a specific version of a package. You shouldn't update the version in package-lock.jsonunless you also update the dependency tree, which is not something that version-bump-prompt can do
The npm version command does update the version number in package-lock.json, but that's because npm can also update the dependency tree
I also find it annoying that my package.json and package-lock.json get out of sync. I dont want to run npm install which may change the other things as well.
I think an optional flag defaulting to false would be good.
Activity
[-]add to included in pacage-lock.json, too?[/-][+]add to included in package-lock.json, too?[/+]JamesMessinger commentedon Jul 6, 2017
Hmmm... good question. I'm not actually sure whether version-bump-prompt should update the
package-lock.json
file by default or not. Thepackage-lock.json
file is a lockfile, not a manifest file, which is whatpackage.json
,bower.json
, andcomponent.json
are. It serves a different purpose, so it might be unexpected/undesired to updatepackage-lock.json
. But, on the other hand, I can totally see some use-cases where that would be totally expected/desired.I'll have to think about it a bit. In the meantime, I welcome any comments/input from others. I'd be interested to know whether anyone has strong opinions one way or the other.
For now though, you can sort-of accomplish the same behavior via the
--grep
argument. It simply searches-and-replaces any occurrence of the old version number with the new version number in one or more files. So,--grep package-lock.json
would do the trick. Unfortunately, it might also modify other package versions in the file, if they happen to be the same as your old version. 💩JamesMessinger commentedon Jul 6, 2017
My own thoughts....
Reasons TO update the package-lock.json
package.json
npm version
command, which does updatepackage-lock.json
Reasons NOT TO update the package-lock.json
package-lock.json
is to hold the dependency tree for a specific version of a package. You shouldn't update the version inpackage-lock.json
unless you also update the dependency tree, which is not something that version-bump-prompt can donpm version
command does update the version number inpackage-lock.json
, but that's because npm can also update the dependency treesutiwo commentedon Jul 10, 2017
Thanks for your reply.
I think both opinions are correct.
How about set the optional flag?
Default flag is
false
stephennancekivell commentedon Aug 9, 2017
I also find it annoying that my
package.json
andpackage-lock.json
get out of sync. I dont want to runnpm install
which may change the other things as well.I think an optional flag defaulting to false would be good.
Add option to support updating the package-lock.json file