Named snapshot versions have semver sorting conflicts
See original GitHub issueAffected Packages
"@changesets/cli": "^2.22.0"
Problem
I’ve recently published multiple snapshot versions with different names, and tried to update from one to the other. My package manager (yarn classic) failed to install the newer transitive snapshot version, because the previous one’s name was considered newer. This is probably because the named versions are ordered alphabetically.
From this example, you can see that even though the snapshot with name “semantic-colors” has the latest timestamp, it is ordered to be lower than the older “theme-provider” snapshot. https://semvercompare.azurewebsites.net/?version=0.0.0-semantic-colors-20220527130647&version=0.0.0-theme-provider-20220526071429
Proposed solution
Reverse the order of the timestamp and snapshot name in the version. The following example has the timestamp and name switched and the versions are ordered correctly: https://semvercompare.azurewebsites.net/?version=0.0.0-20220527130647-semantic-colors&version=0.0.0-20220526071429-theme-provider
Issue Analytics
- State:
- Created a year ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
This seems to be fixed by now, versions are without caret and some sort of templating is also possible, I believe.
I would probably accept a PR implementing this as a default for snapshot releases 😉