3 ms·
node+npm5/yarn, ruby+gemfile, rust+cargo (and maybe a few more) are the best examples for the whole workflow around packaging. Semver ranges (dependency 1.0.x)
by rdsubhas 9y ago
node+npm5/yarn, ruby+gemfile, rust+cargo (and maybe a few more) are the best examples for the whole workflow around packaging.
Semver ranges (dependency 1.0.x) along with version pinning (lock files that represent the currently installed versions) are the best-case scenario. One can avoid the exercise of "bumping versions" every once in a while (just upgrade all packages within supported semver ranges), get the same semver compatibility guarantees, makes sure all other team members are using same versions, and most importantly the CI process is reproduceable and can be sped up with reliable, non-broken dependency caching.
The elephant in the room is Java. Despite its maturity, both mvn and gradle have poor support for ranges and pretty much no concept of lock files. Everyone is left to "bumping versions" by hand all the time, and snapshot versions are pretty much hell and lead to irreproduceable builds.
Vendoring the whole tree is only an optional add-on to semver ranges. You can't vendor a whole tree and resolve all nested dependencies if everyone is using directly pinned versions! I think the article might have a fundamental misunderstanding between versioning as a library author and as a user.
TL;DR - Semver ranges are great when coupled with version pinning and lock files. If not, there are some trade-offs, and as long as people are aware of the trade-offs, its still better than no ranges.
- rowyourboat 9y agoSnapshot versions are great. We wish npm would have them. Only use them for packages you are developing yourself, of course, and never use them outside of development.
- michaelmior 9y agonpm does have something close. You can tag versions with a name and a common convention is to use "next" as a tag. What is lacking is that I don't believe tags can be versioned so you can't have a snapshot per version as you can in Java.
- yuchi 9y agoThe “right way” to do that is to publish alpha versions of your code. Snapshotting the state of the tree into a mutable release is calling for problems. Semver also defines a (poorly supported) M.m.b-release+tstamp pattern, so you can release immutable snapshots and have a semver range do the rest. Maven-like snapshot are a requirement for an environment with poor support for transient semver-ranged dependencies, which maven is…
- dahauns 9y agoregarding java - take a look at: http://nebula-plugins.github.io/ http://nebula-plugins.github.io/ Haven't worked with them myself, but colleagues are singing high praise.