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

add all node_modules in parent paths to the path (monorepo) #205

Open
wmertens opened this issue Sep 5, 2019 · 3 comments
Open

add all node_modules in parent paths to the path (monorepo) #205

wmertens opened this issue Sep 5, 2019 · 3 comments

Comments

@wmertens
Copy link

wmertens commented Sep 5, 2019

Problem description:

When you use a monorepo, there could be shared tools installed in the repo root and then each package has its own unique dependencies. It would be nice to have them be in path.

Suggested solution:

when creating the PATH variable, walk up the path and add any subdirectories named node_modules/.bin.

@sezna
Copy link
Owner

sezna commented Sep 7, 2019

If I understand the problem correctly, this would allow you to run dependencies from project foo when in sibling project bar?

monorepo/
├── foo/
│   ├── node_modules/
│            └──  baz
├── bar/

E.g. running baz from within bar?

@wmertens
Copy link
Author

wmertens commented Sep 8, 2019

no, it would be like

monorepo/
├── node_modules/
│            └──  .bin/baz
├── bar/
│       └── node_modules/
│                  └──  stuff

and from bar you'd be able to run baz

@sezna
Copy link
Owner

sezna commented Sep 11, 2019

That could introduce ambiguity between bar's modules and monorepo's modules. We could define to use the more local ones preferentially, but I would think that if you have a script inside of bar, the dependencies of that script should also be contained within bar's modules. Is this not desirable in your case?

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

No branches or pull requests

2 participants