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

pnpm dlx <pkg> should work even if the bin file of <pkg> isn't called <pkg> #4145

Closed
1 task done
zkochan opened this issue Dec 18, 2021 · 2 comments
Closed
1 task done

Comments

@zkochan
Copy link
Member

zkochan commented Dec 18, 2021

Describe the user story

Currently pnpm dlx @vue-storefront/cli init doesn't work because @vue-storefront/cli doesn't have a command called cli. But it has a command called vsf. pnpm should run vsf after installing @vue-storefront/cli. If a package has more than one commands then probably `pnpm dlx should fail.

@zkochan zkochan changed the title pnpm dlx <pkg> should work even if the bin file of <pkg> is called node <pkg> pnpm dlx <pkg> should work even if the bin file of <pkg> isn't called <pkg> Jan 16, 2022
@illright
Copy link
Contributor

I'm not sure if failing is too good of an idea, I believe we could provide a better experience with the following flow:

  1. If --package X was passed to pnpm dlx Y, then treat X as the package name and Y as the bin name, failing if package X doesn't exist or if bin Y is not present in package X
  2. If --package isn't passed to pnpm dlx Y, then treat Y as the package name.
    1. If package Y has no bins, fail
    2. If package Y has a single bin, execute it
    3. If package Y has multiple bins, provide an interactive selection

@zkochan
Copy link
Member Author

zkochan commented May 6, 2022

Solved by #4682

@zkochan zkochan closed this as completed May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants