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

Feat: add prompt command/option to select a command to run within a package #93

Open
emmenko opened this issue May 6, 2021 · 0 comments

Comments

@emmenko
Copy link

emmenko commented May 6, 2021

Hi 👋

Background

In our team we use and rely a lot on the @manypkg/cli for both our open source and private projects.

In one of our private monorepos, there are multiple application packages and we have a custom script that we run from the workspace root to prompt the developer to choose which application to start.

It's pretty simple. In fact we use @manypkg/get-packages to get the list of application names/dirs to be prompted.

Proposal

I think it might make sense to have this option built into the @manypkg/cli, so that other people can also benefit from that.

Essentially the end result would be the same as manypkg run pkg-a start, except that the pkg-a is selected from the prompt options.

Whether it would be a separate command (e.g. prompt) or a flag of the run command, that's up to discussion.

For example:

# Usage: manypkg prompt --match <glob> <script>

manypkg prompt --match @my-scope/* start

? Select the package to run the command "start" from › - Use arrow-keys. Return to submit.
❯   @my-scope/a
    @my-scope/b
    @my-scope/c
    @my-scope/d

or

# Usage: manypkg run <glob> <script> --prompt

manypkg run @my-scope/* start --prompt

? Select the package to run the command "start" from › - Use arrow-keys. Return to submit.
❯   @my-scope/a
    @my-scope/b
    @my-scope/c
    @my-scope/d

If you like the idea and are willing to accept this, I'm happy to contribute with the implementation.

Looking forward to your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant