-
Notifications
You must be signed in to change notification settings - Fork 5
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
fix: buildCommand behavior in a monorepo #60
Conversation
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.
Too risky. That would allow commands installed globally to work too, which would result in people forgetting to add a dependency because it would work on their machine. (Plus, it's always a terrible idea to rely on $PATH
in my opinion.)
Let's do some kind of upword directory search starting at cwd for node_modules/.bin/${baseCommand}
What about Or this library: https://github.com/saltyshiomix/resolve-as-bin
|
That only works on scripts in package.json, not actual binaries AFAICT.
That library uses I bet I can find something... |
https://github.com/sindresorhus/find-up looks good. I like sindresorhus's stuff. |
ed0cf11
to
6b4a9d0
Compare
@marcelltoth See if my commit works for your monorepo use case. |
Awesome! Works perfectly. |
🎉 This PR is included in version 8.2.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Assuming a fixed
node_modules
path breaks within a monorepo powered by yarn workspaces.(because the dep is hoisted up to
.../source/stoplight/elements/node_modules/.bin/
)There is no point in doing the resolution ourselves anyway. We can allow the shell to do the resolution based on PATH, which will then work regardless of where the dependency is located exactly.