-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Support for semver hash in hosted git dependency #5858
Conversation
|
It seems like older node doesn't support the negative lookahead regex, I will look into it if this is something you want. |
Thanks a lot for the patch! I'll let @rally25rs and @imsnif look into this since they have worked on similar pieces recently.
Tests seem to be failing even on Node 10 so we need to get those fixed before we can merge or even review this. |
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.
Rejecting for CI failures.
I too ran into this issue today when attempting to use yarn in a project. |
I tried to figure out an easy way to do it without the negative lookbehind regex. But I couldn't understand the existing method too well. From the tests, all I could gather was that we should find the
All the initial tests passed, I added a bunch of new test cases. Did I miss any test cases? I can't see what some of the string splits were achieving. |
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.
Hey @lenkan - this LGTM.
I feel it's cleaner, easier to understand while keeping all previous functionality and adding this new use case.
I also think the new tests are a step up!
My only issue is with the tests being generated, as my personal opinion is that they're a little harder to work with when debugging (as opposed to "normal" imperative tests) - but since the code base is filled with such examples, I feel it's fine to leave them in. :)
Thanks for this!
Many thanks! Quick question, how long until this reaches the npm release channel? |
Summary
npm supports referencing hosted github dependencies in the format
github:user/repo#semver:^1.6.0
. This is currently not supported by yarn as it resolves the hash into#semver/^1.6.0
. Note the added/
instead of the:
.Thus, yarn outputs the error: "Couldn't find match for "semver/^1.6.0" in ...."
Motivation
Given an empty yarn package:
When running yarn:
It errors with:
Whereas
npm
resolved the dependency without errors.Test plan
Given an empty yarn package:
When running yarn:
It should resolve the dependencies: