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

Add support for passing CLI arguments #54

Open
hugocxl opened this issue Feb 29, 2024 · 6 comments
Open

Add support for passing CLI arguments #54

hugocxl opened this issue Feb 29, 2024 · 6 comments

Comments

@hugocxl
Copy link

hugocxl commented Feb 29, 2024

Hi @0x80, I wonder if that could be a possibility, I am currently using isolate through cli, but I am not able to pass down any arg.

In case it makes sense, I am willing to help.

Thanks!

@0x80
Copy link
Owner

0x80 commented Feb 29, 2024

I'm open to it. It might make sense for some parameters. It was no priority for me because I didn't run into a situation myself where I felt like it would want to use them.

Most of the configurations are kind of set-and-forget I think, but I agree that it's unusual to not accept any arguments via CLI.

What would you suggest to use for arguments parsing? I am familiar with minimist and meow.

@hugocxl
Copy link
Author

hugocxl commented Mar 1, 2024

@0x80 Thanks for your reply. To provide more ctx: in our case, we are using it as part of the build script:

It'd be useful for us to be able to pass down options here.

About your question: I've used cac before. It's pretty common to see it in action in well-established projects, but I really has no preference.

Leaving some refs:

@0x80
Copy link
Owner

0x80 commented Mar 1, 2024

Could you give an example of the arguments you would like to pass during build?

I understand that arguments are useful if they differ between use-cases within the same repository, but I haven't been in a situation where I needed to change the configuration between build scripts or deployment targets.

If I understand more about your needs, then I can prioritize that maybe.

@hugocxl
Copy link
Author

hugocxl commented Mar 2, 2024

Sure, configuring "isolateDirName" and "logLevel" would be useful for me in that case

@0x80 0x80 changed the title Improve CLI use: enable passing arguments Add support for passing CLI arguments Mar 31, 2024
@matthewaptaylor
Copy link

I'd like to isolate multiple packages from the root of a monorepo because of limitations with my build pipeline, and would also find passing CLI arguments useful. I'm willing to open a PR for this @0x80 ?

@0x80
Copy link
Owner

0x80 commented May 13, 2024

Hi @matthewaptaylor I can probably start working on this soon. I don't want to promise anything but it might be this week...

That being said, if you want to go for it, I'm open to PRs too. I briefly looked into some option (command.js, cac, minimist, yargs, oclif, meow) and I think I prefer to use meow, because it's simple, modern, and sufficient. Also, I already use it in other projects, and it has no dependencies.

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

3 participants