-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
66 lines (52 loc) · 1.65 KB
/
justfile
File metadata and controls
66 lines (52 loc) · 1.65 KB
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
61
62
63
64
65
66
cargo-web := "RUSTFLAGS='-C target-feature=+atomics,+bulk-memory --cfg getrandom_backend=\"wasm_js\"' \
rustup run nightly-2025-06-30 \
cargo -Z build-std=std,panic_abort"
_default:
just --list
# Build a web application in `pkg/`
dist:
just _build-web
wasm-opt -O pkg/halfspace_bg.wasm -o pkg/halfspace_bg.opt.wasm
just _copy
# Build a web application in `pkg/` without `wasm-opt` optimization
dist-fast:
just _build-web
just _copy
_build-web:
{{cargo-web}} build --lib --release --target wasm32-unknown-unknown
wasm-bindgen target/wasm32-unknown-unknown/release/halfspace.wasm --out-dir pkg --target web
_copy:
mv pkg/halfspace_bg.wasm pkg/halfspace_bg.wasm
cp -r web/index.html pkg
cp -r web/htaccess pkg/.htaccess
_serve:
npx serve -c ../web/serve.json pkg
# Build and serve the web application
serve:
just dist
just _serve
# Build and serve the web application without optimization
serve-fast:
just dist-fast
just _serve
# Run `cargo check` for both native and web builds
check:
just check-native
just check-web
# Run `cargo check` for the native build
check-native:
cargo check
# Run `cargo check` for the web build
check-web:
{{cargo-web}} check --lib --target=wasm32-unknown-unknown
# Run `cargo clippy` for both native and web builds
clippy:
cargo clippy
{{cargo-web}} clippy --lib --target=wasm32-unknown-unknown
# Checks all of the shaders with `naga`
naga:
naga --bulk-validate shaders/*.wgsl
# Deploy the demo to `mattkeeter.com/projects/halfspace/demo`
deploy:
just dist
rsync -avz --delete -e ssh ./pkg/ mkeeter@mattkeeter.com:mattkeeter.com/projects/halfspace/demo