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

Allow upgrade-interactive to perform updates only one version newer than current #5412

Open
StephanBijzitter opened this issue Feb 26, 2018 · 3 comments

Comments

@StephanBijzitter
Copy link

StephanBijzitter commented Feb 26, 2018

Do you want to request a feature or report a bug?
I want to request a feature that adds more functionality to upgrade-interactive. I'm proposing the new functionality to be usable through a new --closest flag.

What is the current behavior?
yarn upgrade-interactive --latest allows you to select dependencies that you wish to update to their latest version.

While this is in most cases very useful, sometimes the latest version doesn't work with your setup and you want to know which version is the newest that supports your project.

What is the expected behavior?
For example, I have a dependency foo and my currently installed version is 1.2.3. The registry contains three newer versions: 1.2.4, 1.2.5 and 1.3.0.

--latest will propose updating to 1.3.0, which is certainly valid. But it appears that foo does not adhere to SemVer very well and 1.3.0 breaks my project.

In this case I would like to update to 1.2.4. That will allow me to test if my project is still working, before running the command again to update to 1.2.5.

Perhaps this can be done with a new --closest flag? This flag would then update your dependency to the version that is closest to the currently installed version.

Please mention your node.js, yarn and operating system version.
Yarn 1.3.2 on OS X 10.13.3

@ghost ghost assigned rally25rs Feb 26, 2018
@ghost ghost added the triaged label Feb 26, 2018
@kaylie-alexa
Copy link
Member

This can be done by not passing the --latest flag, i.e. if you had in your package.json foo@^1.2.3 or foo@~1.2.3, upgrade and upgrade-interactive will respect the semver and fetch 1.3.0 or 1.2.5 based on your range. Does that cover your use case?

@StephanBijzitter
Copy link
Author

StephanBijzitter commented Feb 26, 2018

It does not, without --latest, it proposes the "latest within semver range", but the first version I would like it to be would be 1.2.4 rather than 1.2.5 or 1.3.0 (even if using ^)

@kaylie-alexa
Copy link
Member

I see what you're saying--yeah so that wouldn't be covered in proper semver upgrades and would be a new feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants