Skip to content

add to included in package-lock.json, too? #20

@sutiwo

Description

@sutiwo

https://github.com/BigstickCarpet/version-bump-prompt#automate-your-release-process-with-a-single-command-that-can
According to the description, it is not be included in package-lock.json.

But, package-lock.json has a filed of version.
I'm glad if it is also changed together.

Activity

changed the title [-]add to included in pacage-lock.json, too?[/-] [+]add to included in package-lock.json, too?[/+] on Jul 6, 2017
JamesMessinger

JamesMessinger commented on Jul 6, 2017

@JamesMessinger
Member

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. 💩

JamesMessinger

JamesMessinger commented on Jul 6, 2017

@JamesMessinger
Member

My own thoughts....

Reasons TO update the package-lock.json

  • To keep it in sync with the package.json
  • 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.json unless 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
sutiwo

sutiwo commented on Jul 10, 2017

@sutiwo
Author

Thanks for your reply.

I think both opinions are correct.
How about set the optional flag?
Default flag is false

stephennancekivell

stephennancekivell commented on Aug 9, 2017

@stephennancekivell

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.

added a commit that references this issue on Apr 18, 2018
2f21cae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @stephennancekivell@JamesMessinger@sutiwo

      Issue actions

        add to included in package-lock.json, too? · Issue #20 · JS-DevTools/version-bump-prompt