-
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
symlink the metadeps with binaries into the topmost node_modules/.bin #3272
Conversation
… into the topmost node_modules .bin folder. see: yarnpkg#3059
The If you have something like:
and assume that the There is nothing in the current implementation of this PR that would guarantee that I believe result should be:
but with this solution, the Someone please correct me if I'm wrong... which I very well could be. All this package looping in the code is hard to follow sometimes 😄 |
Found a second problem; during unit testing, this fix will write the symlinks to the When this code executes during unit tests:
but the 2nd call to I'm trying to circle back and start by writing some unit tests around what behavior we actually expect. I'm not sure this will be a solvable problem in just package-linker though. I think we also need to figure out what the "correct" behavior is if we have a dependency graph like:
Which eslint is in |
@rally25rs you are awesome! could you take some time and copy everything you write here to the original issue #2874? @snagi do you want to work on this? Right now this pull request it is not enough to address the problem, I am sorry :( |
@rally25rs @voxsim I agree with the comments. I am comparing the behaviors with npm and will identify how npm is catering to these scenarios. post that will update this PR to cater these scenarios. |
Hey gang, check out #3310 - this is my 1st shot at resolving this issue. I made a new PR instead of reworking this one just because I had a branch hanging out on my laptop that I had already started... |
This is now fixed in #3310 so this PR can be closed. |
Issue #3059
Summary
When running yarn install on a dependency tree with a nested child dependency that exposes a CLI binary, the CLI bin is not symlinked into node_modules/.bin as expected. Current behavior of yarn is to symlink the script to parent module's .bin folder.
This pull request adds the functionality to symlink the binaries/scripts in both locations; current yarn behavior as well as symlink to root node_modules folder.
Test plan