-
Notifications
You must be signed in to change notification settings - Fork 3
/
justfile
60 lines (46 loc) · 2.07 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
set windows-shell := ["pwsh.exe", "-NoLogo", "-Command"]
default:
just --list
install:
cargo install --path crates/cli
test:
cargo test --all
cargo clippy --all-targets --all-features
test-accept:
cargo insta test --accept
ci:
just gen
git update-index -q --really-refresh
git diff-index --quiet HEAD crates/frontend/src/syntax/nodes.rs
just test
cargo fmt --all --check
just build-playground
gen:
cargo xtask-gen-ast
cargo fmt -- crates/frontend/src/syntax/nodes.rs
build-wasm-lib:
cd crates/wasm-lib && cargo rustc --crate-type cdylib --target wasm32-unknown-unknown --release
wasm-bindgen target/wasm32-unknown-unknown/release/wasm_lib.wasm --out-dir playground/wasm-lib/ --target web
wasm-opt -Os playground/wasm-lib/wasm_lib_bg.wasm -o playground/wasm-lib/wasm_lib_bg.wasm
run-wasm FILE:
mkdir -p build
cargo run --bin nemo compile std/* {{ FILE }} --output build/{{ without_extension(file_name(FILE)) }}.wasm
wasm-opt --enable-reference-types --enable-gc --enable-bulk-memory -O3 build/{{ without_extension(file_name(FILE)) }}.wasm -o build/{{ without_extension(file_name(FILE)) }}_opt.wasm
wasm-tools print build/{{ without_extension(file_name(FILE)) }}.wasm -o build/{{ without_extension(file_name(FILE)) }}.wast
wasm-tools print build/{{ without_extension(file_name(FILE)) }}_opt.wasm -o build/{{ without_extension(file_name(FILE)) }}_opt.wast
deno run --allow-read dev/wasm-runner.ts build/{{ without_extension(file_name(FILE)) }}.wasm
dev FILE:
watchexec --quiet --no-vcs-ignore -e nemo,rs,mjs just run-wasm {{ FILE }}
playground: build-wasm-lib
cd playground && npm i && npm run dev
build-playground: build-wasm-lib
cd playground && npm i && npm run build
update-gh-pages: build-playground
rm -r gh-pages/*
cp -r playground/dist/* gh-pages/
@run-wast FILE:
wasm-tools parse {{ FILE }}.wast -o build/{{ FILE }}.wasm
wasm-tools validate -f gc build/{{ FILE }}.wasm
node dev/run-wasm.mjs build/{{ FILE }}.wasm
dev-wast FILE:
watchexec --quiet -e wast just run-wast {{ FILE }}