Skip to content

Commit

Permalink
chore: use bacon instead of cargo watch
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Oct 21, 2024
1 parent 2e8579c commit 82bc745
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
14 changes: 14 additions & 0 deletions bacon.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[jobs.example]
command = ["just", "run-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
24 changes: 12 additions & 12 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 cargo-watch cargo-insta typos-cli cargo-shear dprint -y
cargo binstall bacon cargo-insta typos-cli cargo-shear dprint -y

# When ready, run the same CI commands
ready:
Expand All @@ -42,15 +42,15 @@ install-hook:
echo -e "#!/bin/sh\njust fmt" > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

# --no-vcs-ignores: cargo-watch has a bug loading all .gitignores, including the ones listed in .gitignore
# use .ignore file getting the ignore list
# Run `cargo watch`
watch command:
cargo watch --no-vcs-ignores -i '*snap*' -x '{{command}}'
watch:
bacon

# Run the example in `parser`, `formatter`, `linter`
example tool *args='':
just watch 'run -p oxc_{{tool}} --example {{tool}} -- {{args}}'
cargo --color always run -p oxc_{{tool}} --example {{tool}} -- {{args}}

watch-example args='':
bacon example -- {{args}}

# Generate AST related boilerplate code.
# Run this when AST definition is changed.
Expand Down Expand Up @@ -101,14 +101,14 @@ coverage:
conformance *args='':
cargo coverage -- {{args}}

# Watch oxlint
watch-oxlint *args='':
just watch 'run -p oxlint -- {{args}}'

# Build oxlint in release build
oxlint:
cargo oxlint

# Watch oxlint
watch-oxlint *args='':
bacon oxlint -- {{args}}

# Get code coverage
codecov:
cargo codecov --html
Expand All @@ -132,7 +132,7 @@ install-wasm:
cargo binstall wasm-pack

watch-wasm:
cargo watch --no-vcs-ignores -i 'npm/oxc-wasm/**' -- just build-wasm dev
bacon wasm

build-wasm mode="release":
wasm-pack build --out-dir ../../npm/oxc-wasm --target web --{{mode}} --scope oxc crates/oxc_wasm
Expand Down

0 comments on commit 82bc745

Please sign in to comment.