npm-upgrade
npm-upgrade copied to clipboard
Feature suggestion: Create separate commits per upgraded package
Hello, thanks for an amazing tool.
I want to update packages with separate commits (including lockfile) per package and I recently started working on a PoC for that feature in a fork.
However, I thought you might actually find this feature useful because it's such a tiny addition.
My PoC that works assuming yarn:
https://github.com/th0r/npm-upgrade/compare/master...olpeh:5897e9f68c5d6d4d1d4f3afccdd0ba7579e82f95
What do you think about this? If this is something that sounds useful, I can try to improve this PoC and create a PR about it.
Some things to be solved though:
- How to know if the user wants to use yarn or npm?
- How to check if a
yarn.lockorpackage-lock.jsonexists?
Hello, thanks for an amazing tool.
Thanks!
What do you think about this? If this is something that sounds useful, I can try to improve this PoC and create a PR about it.
It's an interesting feature but it doesn't replicate the way I upgrade modules in my projects - I do it in one run so I don't think it will be useful for me.
Let's see if this issue collects a noticeable amount of "thumb up"s I'll be happy to review and merge your PR.
- How to check if a
yarn.lockorpackage-lock.jsonexists?
Just check existence of the corresponding file in the project?
- How to know if the user wants to use yarn or npm?
Here is the flow I would use:
- Introduce an option in
.npm-upgrade.jsonwhich will store the name of the package manager used in current project. This option is not mandatory and may not be specified. - If it present, use it. If it's not, goto 3.
- Search for
yarn.lockorpackage-lock.jsonfiles. If they present, use corresponding package manager (without setting an option in config file). - If lock files are not there, ask user in commit phase about package manager and set it in the config.
Alright, thanks for the reply. I'll improve my PoC and create a PR of it whenever I have some time.
This sounds like a useful feature!
I'd never be patient enough to do the splitting by hand, but sure would appreciate the separate commits when e.g. bisecting after discovering something broke later.