Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature suggestion: Create separate commits per upgraded package #37

Open
olpeh opened this issue Sep 17, 2019 · 3 comments · May be fixed by #39
Open

Feature suggestion: Create separate commits per upgraded package #37

olpeh opened this issue Sep 17, 2019 · 3 comments · May be fixed by #39

Comments

@olpeh
Copy link

olpeh commented Sep 17, 2019

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:
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.lock or package-lock.json exists?
@th0r
Copy link
Owner

th0r commented Sep 17, 2019

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.lock or package-lock.json exists?

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:

  1. Introduce an option in .npm-upgrade.json which will store the name of the package manager used in current project. This option is not mandatory and may not be specified.
  2. If it present, use it. If it's not, goto 3.
  3. Search for yarn.lock or package-lock.json files. If they present, use corresponding package manager (without setting an option in config file).
  4. If lock files are not there, ask user in commit phase about package manager and set it in the config.

@olpeh
Copy link
Author

olpeh commented Sep 19, 2019

Alright, thanks for the reply. I'll improve my PoC and create a PR of it whenever I have some time.

@jareware
Copy link

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.

@olpeh olpeh linked a pull request Jan 15, 2020 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants