-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: supports “prerelease” versions #271
Conversation
src/grammar/base.pegjs
Outdated
@@ -35,7 +35,7 @@ description = "\"" _ inner:(!"\"" i:. {return i})* "\"" { | |||
} | |||
|
|||
// version | |||
semver = semver:([0-9]+ "." [0-9]+ "." [0-9]+) { return semver.flat().join(""); } | |||
semver = semver:([0-9]+ "." [0-9]+ "." [0-9]+ ("-" [a-zA-Z0-9.-]+)?) { return semver.flat().flat().join(""); } |
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.
what a ugly flat here.
The flat() method of Array can specific a depth as you want.
flat(2), flat(Infinity)
And please take a test on the api-specs to see if the config/*.json are working well with this format of version definition. |
|
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.
lgtm
Context:
The VMA app uses the python semver package that supports “prerelease” versions, as well as the usual Major.Minor.Patch. The semver format goes something like Major.Minor.Patch[-prerelease_id.#] where prerelease_id is a text string - for us it’s “dev” for all of the intermediate versions we build and deploy to our DEV environment and “hotfix” for any intermediate versions that we might need to create in our PROD environment because our DEV environment has diverged too far from PROD.