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(npm): handle github dependencies with semver versions #28261
base: main
Are you sure you want to change the base?
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.
Also needs a test added
} else if ( | ||
depRefPart.startsWith('semver:') && | ||
isVersion(depRefPart.slice('semver:'.length)) | ||
) { |
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.
) { | |
) { | |
// <protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish> | #semver:<semver>] | |
// https://docs.npmjs.com/cli/v10/configuring-npm/package-json#git-urls-as-dependencies |
@@ -180,6 +180,16 @@ export function extractDependency( | |||
dep.datasource = GithubTagsDatasource.id; | |||
dep.versioning = npmVersioningId; | |||
dep.packageName = githubOwnerRepo; | |||
} else if ( | |||
depRefPart.startsWith('semver:') && | |||
isVersion(depRefPart.slice('semver:'.length)) |
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.
use substring (perf)
isVersion(depRefPart.slice('semver:'.length)) | ||
) { | ||
dep.currentRawValue = dep.currentValue; | ||
dep.currentValue = depRefPart.slice('semver:'.length); |
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.
same
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.
Needs tests added
Changes
The npm manager supports extracting the correct version from strings like
github:renovatebot/renovate#semver:37.280.0
.Context
NPM supports those dependencies but renovate not yet.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: