-
Notifications
You must be signed in to change notification settings - Fork 518
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 "npx" target to node repo #3429
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.
Thanks!
@matthewjh sorry this got stuck for so long - the test failures look legitimate, could you take a look? |
This Pull Request has been automatically marked as stale because it has not had any activity for 6 months. It will be closed if no further activity occurs in 30 days. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs! |
c56dab4
to
03b1e42
Compare
I rebased and spent an hour debugging on Windows... :/ Thanks! |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
I want my developers to execute common node commands through
bazel run @nodejs//:xxx
, so these use the node binary that bazel manages. Anything else can result in creeping inconsistencies due to different pathways using different node versions.Npm is covered by
bazel run @nodejs//:npm
, but there is no equivalent for the npx binary.There is
npx_bin
, but this is a direct invocation of the npx-cli.js script and uses /usr/local/bin/node rather than the Bazel-managed node binary. This is misleading as the expectation would be that it's going to use the latter.Issue Number: N/A
What is the new behavior?
This PR adds an npx target to the node repo which can be invoked with Bazel run, e.g.
bazel run @nodejs//:npx
. This target works just as thenpm
target does and calls into the .js script via the Bazel-managed node executable.Does this PR introduce a breaking change?
Other information
Quesions:
Can I remove the npx_bin target?