Skip to content
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(plugin-api): allow non-semver versioned dependencies (#1177) #1184

Merged
merged 1 commit into from
Apr 27, 2018

Conversation

dhensche
Copy link
Contributor

npm supports multiple "version" strings when declaring deps in your
package.json. This PR is an attempt to support some of these other
formats in a plugin specification, while retaining the smart version
merging. If a semver range can be extracted, it will be used for
version conflict resolution. If not, a warning will be displayed to
the developer

npm supports multiple "version" strings when declaring deps in your
`package.json`. This PR is an attempt to support some of these other
formats in a plugin specification, while retaining the smart version
merging. If a semver range can be extracted, it will be used for
version conflict resolution. If not, a warning will be displayed to
the developer
@@ -45,6 +52,8 @@ module.exports = function resolveDeps (generatorId, to, from, sources) {

const leadRE = /^(~|\^|>=?)/
const rangeToVersion = r => r.replace(leadRE, '').replace(/x/g, '0')
const extractSemver = r => r.replace(/^.+#semver:/, '')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't semver: be optional here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to the npm docs (which do not seem to be 100% accurate), if it is just #... and not #semver:... then it is referring to a commit hash, not a semver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants