Open kdy1 opened 3 years ago
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 :pray:
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
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 :+1:
I assume you would prefer to use clap
over structopt
?
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.
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
compile
command
watch
mode implementationminify
commandlint
commandbundle
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.
Hi @kwonoj Is this PR still valid? If not, I'd like to work on this task setting up a new one.
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?
Node binding should export
runCLI
.This would help lots of cases.