-
-
Notifications
You must be signed in to change notification settings - Fork 673
feat: add ddev npx
command
#7599
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
feat: add ddev npx
command
#7599
Conversation
Download the artifacts for this pull request:
See Testing a PR. |
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.
The command itself looks good to me, thank you!
Please update docs in these two places, to add npx
:
- https://docs.ddev.com/en/stable/users/usage/cli/#nodejs-npm-nvm-and-yarn (https://github.com/ddev/ddev/blob/main/docs/content/users/usage/cli.md?plain=1#L38)
- https://docs.ddev.com/en/stable/users/usage/commands/#npm (https://github.com/ddev/ddev/blob/main/docs/content/users/usage/commands.md?plain=1#L1233)
(There may be more places to update, search for "npm" in the *.md
files.)
f50250f
to
456c56c
Compare
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.
Rebased and updated docs.
@stasadev Thanks for the hand. Sorry, I wasn't able to get to it right away. I was busy and was planning to address it on the weekend. Let me know if there is more to do. |
The Issue
npx
is not an existing ddev command.npx
is an alias ofnpm exec --
that comes with the npm package, so no new code is needed.npx
is used to run JS code without installing it, which is often for setup, init, demos, config, and other one time executions.How This PR Solves The Issue
This allows users to
ddev npx
in the same way they can doddev npm
without having to doddev exec npx
.Manual Testing Instructions
ddev config
ddev start
ddev npx -c 'echo hello'
will say hello. Or any npx command likeddev npx @biomejs/biome init
which will setup biomejs config in your project.Automated Testing Overview
Because of those points, I decided to just check the simple local command execution part of npx via the
-c
flag. The test does a simpleecho hello
and checks if hello is returned. In combination with the above npm test, I think that should be sufficient without adding any network request to the system.Release/Deployment Notes
Does this affect anything else or have ramifications for other code? Does anything have to be done on deployment?
Nope