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

Bunx: support specifying package to install #7034

Open
davidlj95 opened this issue Nov 10, 2023 · 1 comment · May be fixed by #7369
Open

Bunx: support specifying package to install #7034

davidlj95 opened this issue Nov 10, 2023 · 1 comment · May be fixed by #7369
Labels
bun install Something that relates to the npm-compatible client enhancement New feature or request good first issue Something that would be good for new contributors

Comments

@davidlj95
Copy link

davidlj95 commented Nov 10, 2023

What is the problem this feature would solve?

If the binary to run is not named same as the package, you won't be able to run it with bunx. There are some binaries included in packages that don't have same name as package.

For instance, Renovate: a tool to update dependencies. Their package provides two binaries:

  1. renovate (same as package name) to run the dependencies update bot
  2. renovate-config-validator: to validate your config

You can run the bot with bunx renovate. But you can't run the renovate-config-validator using bunx right now.

Other package managers offer the -p CLI option to specify which package to install, then the first argument is the binary to run. For instance, following previous example:

  • NPM offers npm exec --package/npx -p|--package
    We can run the script with:
    • npm exec --package renovate renovate-config-validator
    • npx --package renovate renovate-config-validator
  • Yarn (berry) offers yarn dlx -p|--package
    We can run the script with:
    • yarn dlx -p renovate renovate-config-validator

What is the feature you are proposing to solve the problem?

Would be nice to have also some -p or --package to enable this use case :)

What alternatives have you considered?

Installing the dependency, then use bun run with path to script in node_modules directory. But the great of bunx is to just install and run for dependencies that won't be needed often. Like validating the configuration of your dependencies update tool.

Until then, other package managers can be used for this purpose

@davidlj95 davidlj95 added the enhancement New feature or request label Nov 10, 2023
@Electroid Electroid added bun install Something that relates to the npm-compatible client good first issue Something that would be good for new contributors labels Nov 10, 2023
@telekid
Copy link

telekid commented Nov 28, 2023

I'll take a look at this when I have a bit.

@telekid telekid linked a pull request Nov 29, 2023 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bun install Something that relates to the npm-compatible client enhancement New feature or request good first issue Something that would be good for new contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants