-
Notifications
You must be signed in to change notification settings - Fork 81
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
Easy check for version compatibility? #21
Comments
Hey @garretwilson, thanks for the feedback. What you need is SemVer Expressions API (Ranges). Particularly take a look at Tilde ranges
Hope this helps. |
But what if I don't know what the major number is? I just want to make sure two things are compatible. Am I expected to convert the first version to a string, prepend a tilde, and then pass the resulting string to satisfies()? That seems convoluted and error-prone. Why should I do all this string manipulation? Besides, checking minor version compatibility is one of the central if not the central usage of semantic versions (along with minor version compatibility). There should be a dedicated method for this. |
In fact I gave you an example of what I want to do. Can you show me how to do that with jsemver, using the variables |
To be fair, now that I think about it, I can just compare the major versions manually. Still, it would be nice to have a dedicated semantic method. And what about checking patch-version compatibility (i.e. the major and minor versions are the same)? |
Ok, I get it now. The reason why there is no such method is that I strived to keep the API small and simple and add methods only when there are obvious use cases and new methods really add some value to the library. So, I believe there should be a use case for every API method. Honestly, I've never come across a use case where you'd not care about major versions. I'm not saying there isn't such use case, it's just I haven't seen one. The typical use case for versions compatibility is package/dependency managers but they really do care about major versions. Nevertheless, it's not difficult to implement it. If I correctly understand the logic behind your
I agree that manually comparing major and minor versions is not nearly convenient as having a dedicated method, so if you provide a valid use case for methods like |
Um, I thought that was self evident, and actually the use case comes by definition of semantic versioning, but since you asked: here's a quote from http://semver.org/ :
|
Also see the summary at http://semver.org/ . And the specification. Heck, read the whole thing. The whole point of semantic versioning is to know what you can depend on (or not) if certain components of the version number change. Therefore it seems obvious to me that any API working with semantic versions would want a simple, semantic method for determining if those components have changed. |
No need to be so dramatic, I know what SemVer is all about. It's just the value of such methods wasn't clear to me at first, that's why I asked you for a use case. But having given it some thought yesterday I think I came up with a valid use case on my own. So let's do it! Care to submit a pull request to the |
Unfortunately we have a tight deadline for feature completion this week, so I already wrote our own custom solution with an existing class we had. I'll keep JSemVer in mind for our next release, though. Maybe it will support everything we need by then. Good luck. |
Ok, thank you anyway for the feedback. Feel free to contact me through the issues here if you ever have any questions/suggestions regarding JSemVer in the future. Cheers. |
@zafarkhaja — If this is still outstanding, I'll work on it and submit a pull request for it. |
Hey @RobertFischer it's already done in the |
Looking forward to it! |
Hello guys! Sorry for the delay and thank you for your contributions! |
On first glance the library looks nice. But then I try to do something simple, one of the basic things of semantic versioning: check for minor-version compatibility. How do I do that?
For example:
Isn't that the whole point of semantic versioning? Maybe I missed such a comparison method in your documentation.
The text was updated successfully, but these errors were encountered: