syncpack icon indicating copy to clipboard operation
syncpack copied to clipboard

Handling SemVer pre-release labels

Open JamieMason opened this issue 3 years ago • 0 comments
trafficstars

Description

Refs https://github.com/microsoft/fluentui/pull/23342#issuecomment-1144013563

  1. SemVer has "Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.".
  2. 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-semver compare versions with additional labels and determine which is newer?

JamieMason avatar Jun 04 '22 01:06 JamieMason