feat!: remove the build-wasm subcommand

`build --wasm` should be used instead
This commit is contained in:
Amaan Qureshi 2024-09-07 20:18:23 -04:00
parent 10e474f488
commit cbd3bb5b9a

View file

@ -37,7 +37,6 @@ enum Commands {
InitConfig(InitConfig),
Generate(Generate),
Build(Build),
BuildWasm(BuildWasm),
Parse(Parse),
Test(Test),
Fuzz(Fuzz),
@ -124,19 +123,6 @@ struct Build {
pub debug: bool,
}
#[derive(Args)]
#[command(about = "Compile a parser to WASM", alias = "bw")]
struct BuildWasm {
#[arg(
short,
long,
help = "Run emscripten via docker even if it is installed locally"
)]
pub docker: bool,
#[arg(index = 1, num_args = 1, help = "The path to output the wasm file")]
pub path: Option<String>,
}
#[derive(Args)]
#[command(about = "Parse files", alias = "p")]
struct Parse {
@ -546,21 +532,6 @@ fn run() -> Result<()> {
}
}
Commands::BuildWasm(wasm_options) => {
eprintln!("`build-wasm` is deprecated and will be removed in v0.24.0. You should use `build --wasm` instead");
let grammar_path = current_dir.join(wasm_options.path.unwrap_or_default());
let root_path = lookup_package_json_for_path(&grammar_path.join("package.json"))
.map(|(p, _)| p.parent().unwrap().to_path_buf())?;
wasm::compile_language_to_wasm(
&loader,
Some(&root_path),
&grammar_path,
&current_dir,
None,
wasm_options.docker,
)?;
}
Commands::Parse(parse_options) => {
let config = Config::load(parse_options.config_path)?;
let output = if parse_options.output_dot {