add all node_modules in parent paths to the path (monorepo)
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.
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?
no, it would be like
monorepo/
├── node_modules/
│ └── .bin/baz
├── bar/
│ └── node_modules/
│ └── stuff
and from bar you'd be able to run baz
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?