Closed IngwiePhoenix closed 5 years ago
That's a great idea! In fact, it probably makes sense for that to be the default behavior. It'll be a major version bump, since it's not backward-compatible, but no big deal. And there will be an argument for people who want to allow different versions in different files. Something like this:
Bump the minor version number in package.json (by default), and then set the version number in other files (bower.json, component.json) to the same value as package.json.
bump --minor
Prompt for the new version number, based on the current version in package.json (by default). Once the user chooses a version, set that version in all files (package.json, bower.json, component.json)
bump --prompt
If specific file names are listed, then first file is the "master" file, and its version number will be used. This also allows you to specify files other than the default ones (package.json, bower.json, component.json).
Bump the minor version number in bower.json (the first file), and then set the version number in the other files (package.json, some_other_file.json) to the same value as bower.json.
bump --minor bower.json package.json some_other_file.json
Prompt for the new version number, based on the current version in bower.json (the first file). Once the user chooses a version, set that version in all files (bower.json, package.json, some_other_file.json)
bump --prompt bower.json package.json some_other_file.json
If you want to allow different version numbers in each file, then you just add the --different-versions
flag. That makes it work the same as it does today, but also still allows you to specify a custom list of files to be updated. Each file will be updated separately, based on the existing version number in that file.
Sounds totally fine with me! Ill just add it as an NPM script and that should have it. :)
When can I expect the bump to happen?
I'm super busy right now, so it might be a few weeks before I get this done. Feel free to send me a pull-request if you want it sooner and feel like implementing it yourself in the meantime.
Ahh okay. :) Well I'll consider it. I have quite some code going myself (the activity tab on my profile gives it away, haha)
I just released version 5.0.0, which resolves this issue.
Would be nice if we could sync the version from package.json to the other JSONs. In my case, I want to keep my composer, bower and package JSONs in sync, version-wise.
is that be possible to be added?