derbyjs / racer

Realtime model synchronization engine for Node.js
1.18k stars 117 forks source link

0.6.0-alpha40 < 0.6.0-alpha9 according to semver -- should be 0.6.0-alpha.nn #221

Closed woodcoder closed 3 months ago

woodcoder commented 9 years ago

The alpha versioning doesn't quite follow the http://semver.org spec and as a result npm update racer can get confused and use alpha9 instead of the latest alpha40. This can cause installations to stop working unless versions are precisely specified in the pacakage.json and/or npm-shrinkwrap.json.

In this case my subscribe calls just hang as the message format changed between 9 and 40! It can be difficult to spot as the npm install thinks that 0.6.0-alpha9 satisfies ^0.6.0-alpha40 so you can only spot it by running npm list | grep racer.

To check the semver ordering, I ran npm install semver and ran the semver command line tool that outputs the versions in ascending order:

$ node_modules/.bin/semver 0.6.0-alpha40 0.6.0-alpha9 0.6.0-alpha10
0.6.0-alpha10
0.6.0-alpha40
0.6.0-alpha9
$ node_modules/.bin/semver 0.6.0-alpha.40 0.6.0-alpha.9 0.6.0-alpha.10
0.6.0-alpha.9
0.6.0-alpha.10
0.6.0-alpha.40

Unfortunately it's not possible to just switch to 0.6.0-alpha.41, it will require a 0.6.1-alpha.1:

$ node_modules/.bin/semver 0.6.0-alpha40 0.6.0-alpha.41 0.6.0-alpha9 0.6.1-alpha.1
0.6.0-alpha.41
0.6.0-alpha40
0.6.0-alpha9
0.6.1-alpha.1

I'm not quite sure why https://www.npmjs.com/package/racer lists 40 as the latest version -- perhaps it does it by date rather than semver sorting?

Anyway, I'd be grateful if you could change this for the next release (other derby components may also need updates).

craigbeck commented 3 months ago

Thanks for your contributing your issue.

We have recently been actively updating the Derby and Racer packages, and both repos are now in Typescript and published with types on npm. As we have quite a few old issues open we have made the decision to close out of date issues.

If this issue still matters to you we encourage reproducing against the current versions of the repo and opening a new issue.