From 8cbf3f09d68804a27104c07dae89e9f0160155d2 Mon Sep 17 00:00:00 2001 From: Boshen Date: Tue, 29 Oct 2024 11:50:58 +0800 Subject: [PATCH] chore: replace `bacon` with `watchexec` --- bacon.toml | 19 ------------------- justfile | 47 ++++++++++++++++++++++++----------------------- 2 files changed, 24 insertions(+), 42 deletions(-) delete mode 100644 bacon.toml diff --git a/bacon.toml b/bacon.toml deleted file mode 100644 index b93078c388690..0000000000000 --- a/bacon.toml +++ /dev/null @@ -1,19 +0,0 @@ -[jobs.example] -command = ["just", "example"] -allow_warnings = true -need_stdout = true - -[jobs.oxlint] -command = ["cargo", "--color", "always", "run", "-p", "oxlint"] -allow_warnings = true -need_stdout = true - -[jobs.wasm] -command = ["just", "build-wasm", "dev"] -allow_warnings = true -need_stdout = true - -[jobs.coverage] -command = ["cargo", "--color", "always", "run", "-p", "oxc_coverage"] -allow_warnings = true -need_stdout = true diff --git a/justfile b/justfile index 6afa562246341..19a66d49ce418 100755 --- a/justfile +++ b/justfile @@ -16,7 +16,7 @@ alias new-typescript-rule := new-ts-rule # or install via `cargo install cargo-binstall` # Initialize the project by installing all the necessary tools. init: - cargo binstall bacon cargo-insta typos-cli cargo-shear dprint -y + cargo binstall watchexec-cli cargo-insta typos-cli cargo-shear dprint -y # When ready, run the same CI commands ready: @@ -42,27 +42,23 @@ install-hook: echo -e "#!/bin/sh\njust fmt" > .git/hooks/pre-commit chmod +x .git/hooks/pre-commit -watch: - bacon +watch *args='': + watchexec {{args}} # Run the example in `parser`, `formatter`, `linter` example tool *args='': - cargo --color always run -p oxc_{{tool}} --example {{tool}} -- {{args}} + cargo run -p oxc_{{tool}} --example {{tool}} -- {{args}} watch-example *args='': - bacon example -- {{args}} + just watch 'just example {{args}}' -# Generate AST related boilerplate code. -# Run this when AST definition is changed. -ast: - cargo run -p oxc_ast_tools - just check +# Build oxlint in release build; Run with `./target/release/oxlint`. +oxlint : + cargo oxlint -# Format all files -fmt: - cargo shear --fix # remove all unused dependencies - cargo fmt --all - dprint fmt +# Watch oxlint +watch-oxlint *args='': + just watch 'cargo run -p oxlint -- {{args}}' # Run cargo check check: @@ -76,6 +72,12 @@ test: lint: cargo lint -- --deny warnings +# Format all files +fmt: + cargo shear --fix # remove all unused dependencies + cargo fmt --all + dprint fmt + [unix] doc: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --document-private-items @@ -98,16 +100,15 @@ coverage: cargo run -p oxc_prettier_conformance cargo minsize +# Run Test262, Babel and TypeScript conformance suite conformance *args='': cargo coverage -- {{args}} -# Build oxlint in release build -oxlint: - cargo oxlint - -# Watch oxlint -watch-oxlint *args='': - bacon oxlint -- {{args}} +# Generate AST related boilerplate code. +# Run this when AST definition is changed. +ast: + cargo run -p oxc_ast_tools + just check # Get code coverage codecov: @@ -132,7 +133,7 @@ install-wasm: cargo binstall wasm-pack watch-wasm: - bacon wasm + just watch 'just build-wasm dev' build-wasm mode="release": wasm-pack build --out-dir ../../npm/oxc-wasm --target web --{{mode}} --scope oxc crates/oxc_wasm