-
Notifications
You must be signed in to change notification settings - Fork 327
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
Add --target semver
option to adhere to package.json ranges
#1054
Comments
Yeah, with |
Users can of course specify their own target function, but if we add a
|
Sure, fine with me 👍🏻 |
I found another edge case - we might not always directly be able to access "@mypackage/lint": "file:lint", |
Wait, what? In semver, |
You are correct! My bad. |
--target semver
option to adhere to package.json ranges
Initial support for Please create a new issue if you have a case that does not work as expected. I'm sure there are some issues with its handling of prerelease versions, so I could use some feedback to get a better sense of the expected behavior. |
It's lovely ❤️ thanks! |
Yes, 1.6.2 satisfies ^1.5.1. |
It's just a little odd that it didn't update your package directly to the latest available version still falling under semver |
yeah, if the actual installed module is |
@rifandani This appears to be a regression with the pnpm integration. Please open a new issue and I will investigate. $ ncu --packageManager pnpm --target semver
Checking /Users/raine/projects/ncu-issues/1054/package.json
[====================] 1/1 100%
axios ^1.5.0 → ^1.5.1
Run ncu --packageManager pnpm --target semver -u to upgrade package.json
$ ncu --packageManager npm --target semver
Checking /Users/raine/projects/ncu-issues/1054/package.json
[====================] 1/1 100%
axios ^1.5.0 → ^1.6.2
Run ncu --packageManager npm --target semver -u to upgrade package.json |
It was a very dumb mistake. I published a patch to
Actually, semver should upgrade to |
thanks a lot, now package.json also updates correctly to
yeah i was wrong, it should upgrade to |
Following #1052 (comment):
@Primajin Yes, I think that's a great idea.
There are more cases that need to be handled: Basically we need to support Ranges, Advanced Ranges, and Prerelease Tags (which should set the target to
greatest
).We may want to use semver.satisfies so that we don't have to implement all of those conditions ourselves.
We still want to upgrade dependencies like
^0.1.1
according to semver, and handle that intarget
. So wouldn't we just wantfilter: (_, [{ operator }]) => operator
?The text was updated successfully, but these errors were encountered: