syncpack
syncpack copied to clipboard
Handling SemVer pre-release labels
trafficstars
Description
Refs https://github.com/microsoft/fluentui/pull/23342#issuecomment-1144013563
- SemVer has "Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.".
- The following are all valid:
1.0.0-alpha,1.0.0-alpha.1,1.0.0-0.3.7,1.0.0-x.7.z.92,1.0.0-x-y-z.–.
How are these being compared? How should they be compared?
Suggested Solution
Check node-semver is being used correctly to provide this or consider a potentially unsafe opt-in comparison which uses a sort of the alphanumeric label string.
Help Needed
- Does the SemVer spec describe whether versions can be sorted by labels? or are they arbitrary metadata with no bearing on the version?
- How does npm's official package
node-semvercompare versions with additional labels and determine which is newer?