-
Notifications
You must be signed in to change notification settings - Fork 14
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] ui5Framework: Allow providing exact prerelease versions #326
Conversation
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.
"latest" should not resolve with a prerelease version.
However, we should change the "versionRegExp" to allow for specifying prereleases. Same in ui5-cli:
https://github.com/SAP/ui5-cli/blob/90b1557faf72786bd87f50e121c8af769d14caca/lib/cli/commands/use.js#L22
@RandomByte so I would add a static method to the AbstractResolver to reuse the validation check in the CLI. |
Sounds good to me 👍 |
Prereleases can now be passed, but "latest" won't resolve to them.
7bf2b61
to
f23a2ca
Compare
After looking into the code we don't need a version check in the CLI. See SAP/ui5-cli#341 |
lib/ui5Framework/AbstractResolver.js
Outdated
@@ -2,7 +2,13 @@ const path = require("path"); | |||
const log = require("@ui5/logger").getLogger("ui5Framework:AbstractResolver"); | |||
const semver = require("semver"); | |||
|
|||
const versionRegExp = /^(0|[1-9]\d*)\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?$/; | |||
const VERSION_RANGE_REGEXP = new RegExp( |
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.
Where are these regex from? Or are they selfmade? If not, I would find a comment with their origin useful here
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.
Good point. I've added comments a test to check against the pattern from the JSON schema.
We might even just take the pattern from the JSON here instead of having a copy. What do you think?
|
||
// Reduced Semantic Versioning pattern | ||
// Matches MAJOR.MINOR as a simple version range to be resolved to the latest patch | ||
const VERSION_RANGE_REGEXP = /^(0|[1-9]\d*)\.(0|[1-9]\d*)$/; |
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.
I was able to simplify this one as the full pattern also matches MAJOR.MINOR.PATCH
No description provided.