-
Notifications
You must be signed in to change notification settings - Fork 333
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
Target as a function #1052
Target as a function #1052
Conversation
Use the same approach we used for filterFunction(name, semverutils.parseRange(version))
I currently test against a package I control, https://github.com/raineorshine/ncu-test-v2, which will always have I think mocking the npm response would be a much better approach. I wish I had done that from the beginning. You're welcome to use either approach.
I did some digging and turns out that was a bug! I was missing |
OK will bring in the changes in the coming week and then open up the PR for final review 🤞🏻 |
Alrighty ready for review 🤞🏻 🎉 |
One last thing - should we somehow add the two filter + target as a new param/cli option? target: (name, [{ operator }]) => operator === '^' ? 'minor' : operator === '~' ? 'patch' : 'latest',
filter: (_, [{ major, operator }]) => !(major === '0' || major === undefined || operator === undefined) |
Let's discuss in a separate issue. There's a bit more complexity to that. |
Published in |
Oops! Yes, I forgot target was used in a user message. Let's say "target package versions":
|
Closes #1034
Related: #958, #950, #581
The idea is to pass a function to target so that one can for example create a version of
semver
-like target:'minor'
for'^'
'patch'
for'~'
(with the recent introduction in #1050 of filter as a function both can be combined to filter out pinned versions and versions that start with a
0
- re: #958) to fully achieve "safe" semver like versioning 🎉