semver v0.30.0
-
WARNING: This release breaks compatibility with previous versions!
Previous versions of the semver extension incorrectly allowed some invalid prerelease and build metadata values. Details below, but BEFORE YOU UPGRADE we strongly recommend that you check for and repair any invalid semvers. You can find them using the official SemVer regular expression like so:SELECT name, version FROM packages WHERE version::text !~ '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$';
If no rows are returned, you should be good to go. If there are results, here are Examples of invalid semantic versions and how they should be repaired.
1.0.0-02799 -> 1.0.0-2799 1.0.0-0.02 -> 1.0.0-0.2 1.0.0-.20 -> 1.0.0-0.20 1.0.0+0+20 -> 1.0.0+0-20 or 1.0.0+0.20 1.0.0+.af -> 1.0.0+0.af or 1.0.0+af
And now, back to your regularly-scheduled changes.
-
Fixed an error formatting prerelease parts for semvers longer than
32 bytes. Thanks to @Nemo157 for the report and suggested fix (#48). -
Removed code that converted dashes to dots in prerelease parts. It
had been doing so on the assumption that dashes were invalid in SemVer
1.0 and 2.0 prerelease parts, but that does not turn out to be the case.
Thanks to @Nemo157 for the report (#46). -
Fixed the parsing of prerelease and metadata parts to allow leading
zeros for parts with non-numeric characters, e.g.,1.0.0-alpha.0a
, and
to disallow parts with leading zeros and only numeric characters, e.g.,
1.0.0-02799
. Thanks to @Nemo157 for the bug report, and to Joseph
Donahue for the SemVer spec expertise (#45). -
The metadata part may no longer contain plus signs other than the one
used to start the metadata part. -
The prerelease and metadata parts may no longer start with a dot.