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

[Feature] Provide permanent folder with dependencies binaries #566

Closed
1 of 2 tasks
segrey opened this issue Nov 6, 2019 · 4 comments
Closed
1 of 2 tasks

[Feature] Provide permanent folder with dependencies binaries #566

segrey opened this issue Nov 6, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@segrey
Copy link
Contributor

segrey commented Nov 6, 2019

  • I'd be willing to implement this feature
  • This feature can already be implemented through a plugin

Describe the user story

Like npm / Yarn v1 generate node_modules/.bin folder with dependencies binaries, Yarn v2 could do the same. Seems currently Yarn 2 already generates a folder with dependencies binaries and prepend it to PATH when running a script from package.json with yarn run <script> command. However, it works for package.json scripts only.

What do you think about generating such a folder permanently (not temporary)?
Prepending it to PATH environment variable would allow to run dependencies binaries in a terminal more naturally, e.g. eslint instead of yarn run eslint.

Describe the solution you'd like

For example, it could be .yarn/.bin/.

Describe the drawbacks of your solution

At least more FS operations to create/populate a folder.

Describe alternatives you've considered

As an alternative, it's possible to run yarn run <dependency binary>

Additional context

For example, IntelliJ could prepend such a folder to PATH automatically, like it currently does with node_modules/.bin.

@segrey segrey added the enhancement New feature or request label Nov 6, 2019
@segrey segrey changed the title [Feature] [Feature] Provide persistent folder with dependencies binaries Nov 6, 2019
@segrey segrey changed the title [Feature] Provide persistent folder with dependencies binaries [Feature] Provide permanent folder with dependencies binaries Nov 6, 2019
@arcanis
Copy link
Member

arcanis commented Nov 6, 2019

Imo this feature could already be implemented rather easily through a plugin (by hooking on the afterAllInstalled hook) 🤔

I'm not sure adding it to the core would be very impactful as those binaries can already be called through yarn <bin-name> (even moreso once we get #565). What do you think?

@arcanis
Copy link
Member

arcanis commented Nov 6, 2019

Note that one main reason I'm not super fond of global binaries (in relation with WEB-42294) is that they obfuscate the source of the tool. For example, if running gulp something is enough to run Gulp, then it's unclear whether Gulp is installed globally or in the project. By comparison, yarn gulp is a few extra characters but clearly indicates that the tool comes from the local project.

@segrey
Copy link
Contributor Author

segrey commented Nov 7, 2019

You're right that yarn gulp clearly indicates that a local dependency is wanted. On the other hand, we haven't received any complaints regarding prepending node_modules/.bin to PATH (it's an optional feature that can be turned off in IntelliJ preferences).
Given this feature might be controversial a bit, I'd suggest to not implement it for now and close the issue. I believe it can be re-opened in the future if there is a demand for this feature. 📈

@segrey segrey closed this as completed Nov 7, 2019
@segrey
Copy link
Contributor Author

segrey commented Nov 7, 2019

Imo this feature could already be implemented rather easily through a plugin (by hooking on the afterAllInstalled hook)

Unfortunately, this is not an option for IDEs, because yarn install can be run outside IDE.

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

No branches or pull requests

2 participants