New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix prerelease string getting removed and add $COMPLETE version variable #918
Fix prerelease string getting removed and add $COMPLETE version variable #918
Conversation
|
||
expect(versionInfo.$NEXT_MAJOR_VERSION.version).toEqual('11.0.0') | ||
expect(versionInfo.$NEXT_MINOR_VERSION.version).toEqual('10.1.0') | ||
expect(versionInfo.$NEXT_PATCH_VERSION.version).toEqual('10.0.4') | ||
expect(versionInfo.$NEXT_PATCH_VERSION.version).toEqual('10.0.3') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was previously wrong. The next patch version after v10.0.3-alpha
is actually 10.0.3
not 10.0.4
, but it was becoming 10.0.4
before because 10.0.3-alpha
was incorrectly becoming 10.0.3
internally
@tjenkinson A PR merged resulted in some conflict 😅 Could you please take a look? |
@jetersen done! |
Co-authored-by: Joseph Petersen <josephp90@gmail.com>
Currently if the version is a prerelease the prerelease string is discarded because
semver.coerce
discards it.With this PR we now use
semver.parse
instead and fall back to coerce.It also updates
splitSemVer
to always return a string instead of sometimes aSemVer
instance (which currently becomes a string intemplate
due to it having atoString
) and sometimes string.Finally it adds a
$COMPELTE
variable that can be used to access the full version string, otherwise it's still not possible to get the prerelease info in the template.