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

Reimplement CLI in rust #1589

Open
kdy1 opened this issue Apr 19, 2021 · 7 comments
Open

Reimplement CLI in rust #1589

kdy1 opened this issue Apr 19, 2021 · 7 comments

Comments

@kdy1
Copy link
Member

kdy1 commented Apr 19, 2021

Node binding should export runCLI.

This would help lots of cases.

@tmpfs
Copy link
Contributor

tmpfs commented Sep 7, 2021

Hey @kdy1, I keep looking at the Typescript CLI entry points and wonder why they exist and it's not just straight Rust binaries using clap (or structopt).

Is there functionality that is enabled by having the command line programs exposed as node executables? Is it part of a plan for a Javascript-based plugin system maybe?

I just wanted to look into the reason why --ignore isn't working for example and it seems like it was never implemented from what I can tell. Implementing this would be much more straightforward if it was all just Rust 🙏

@kdy1
Copy link
Member Author

kdy1 commented Sep 7, 2021

Is there functionality that is enabled by having the command line programs exposed as node executables? Is it part of a plan for a Javascript-based plugin system maybe?

No. It's because to make managing version more convenient for the end-user

@tmpfs
Copy link
Contributor

tmpfs commented Sep 13, 2021

Thanks, that helps! I will try to find some time to tackle this one as I think it would simplify things quite a bit - we should be able to remove quite a bit of typescript 👍

I assume you would prefer to use clap over structopt?

kwonoj added a commit to kwonoj/swc that referenced this issue Dec 19, 2021
kwonoj added a commit to kwonoj/swc that referenced this issue Dec 19, 2021
kwonoj added a commit to kwonoj/swc that referenced this issue Dec 19, 2021
kwonoj added a commit to kwonoj/swc that referenced this issue Dec 19, 2021
kwonoj added a commit to kwonoj/swc that referenced this issue Dec 20, 2021
@kwonoj
Copy link
Member

kwonoj commented Feb 15, 2022

It's quite late to realize but I forget js-side plugin support in @swc/cli. This may be some headache if we want 100% feature parity.

For now I'll skip those until new cli becomes stable enough. This is also related with experimental plugin stablization and may possible to think about whole plan accordingly based on those.

@kwonoj
Copy link
Member

kwonoj commented Feb 28, 2022

swc_cli is a ground to implement this. Roughly, these are the tasks need to be implemented and if anyone want to dive in, please feel free to send PR

  1. compile command
  • port rest of cli flag features in subcommand flag struct
  • watch mode implementation
  1. minify command
  2. lint command
  3. bundle command - accept JSON based configs

Currently, implementations are sort of exploration, does not have to be 1:1 match to existing @swc/cli's behavior. Specifically, there will be rough edges to deal with dynamic values which requires js runtime. We want to give suffecient time to iterate, finalize behaviors based on feedbacks & some constraints we have.

@StemCll
Copy link

StemCll commented Jul 23, 2023

Hi @kwonoj
Is this PR still valid? If not, I'd like to work on this task setting up a new one.

@stephanrotolante
Copy link

stephanrotolante commented Mar 14, 2024

Hey @kwonoj,

Is this still a good first issue? I am looking back at some of the PRs referenced in the ticket and am trying to get an understand at whats going on. I am still kind of unsure whats being asked.

If I had to guess its replace the entire nodejs cli into one thats a rust/node bind gen?

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

No branches or pull requests

5 participants