Open willhlaw opened 10 years ago
Will, thanks for the nudge to get with the mainstream on semantic versioning.
There are some stand-out differences, not limited to '~' and '^'. Notably, the support for non-numeric labels following versions that interact subtly with the range logic.
I may be able to cram the extra logic into what I already have in version.go. Otherwise, I may have to port node-semver just to get it right.
Right. I wonder what the tradeoff is.
On a cursory search, I did not find any go semver library that is handling the non-numeric qualifiers, but looking at github.com/jm/go-semver and github.com/coreos/go-semver, you're pretty close. I should think your version.go should not only be able to handle major, minor and patch, but also prelease "1.2.5-beta1" and build "1.2.4+939".
Re-scoped the ticket. Basically all we need now is support for '^' and '~' if it's really neaded, and add support for non-numeric tokens in the match expression.
Great effort here. I see that you have / are planning some versioning capabilities. Perhaps, grapnel should extend the version range concept to accommodate semantic versioning based on semver. Spec for semver is at http://semver.org/
NPM is one of the latest, well written, and heavily used implementations of semver (So is Bower). Many developers are not only beginning to follow semver after the first 1.0 release (anything is game during 0.x development) of their project, but also are adhering to the paradigm of loosely pinning their dependencies via ~ and ^ notations. See https://www.npmjs.org/doc/misc/semver.html
Here's an early 2014 discussion about how [well] developers are doing semver in node.js/nom on reddit, http://www.reddit.com/r/node/comments/1wo7n4/people_misunderstand_and_and_semver_in_nodejsnpm/