-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(versioning/semver): add semver-coerced versioning #11995
feat(versioning/semver): add semver-coerced versioning #11995
Conversation
you should not be making any changes to lib/versioning/semver - you should add lib/versioning/semver-coerced |
Thanks @rarkins. That was not clear from the previous discussion, sorry. I'll do as requested. |
Could you please review this PR? I've tried to implement the |
Please use the "request review" option in GitHub in future - no need for comments |
Co-authored-by: Rhys Arkins <rhys@arkins.net>
🎉 This PR is included in version 28.3.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Changes:
This is my work in progress for issue #5623. I decided to push what I have for now to request some help/review.
The task was to wrap inputs with
semver.coerce()
and consume them to the API exported by the module. I tried to do that, but ran into problems with unit tests. The problems seem to be related to the waysemver.coerce()
handles the version string. If it finds surrounding text (non-digits), it ignores that text. So, myisValid()
function doesn't validate the version string correctly. It accepts ranges as well as malformed versions.For example:
Not sure - either I don't understand the task correctly, or
semver.coerce()
is not good for this task. Could you please review my code and advice the best way to move forward?Context:
Work in progress #5623
Documentation (please check one with an [x])
How I've tested my work (please tick one)
I have verified these changes via: