11ty-plugin-giallo/mise.toml
2026-01-23 19:48:31 +00:00

50 lines
1.4 KiB
TOML

[tools.node]
version = "24.13"
[tools.rust]
version = "1.93"
components = "rust-analyzer,rust-docs,rustfmt,clippy"
targets = "wasm32-wasip2"
[tools."github:WebAssembly/wasi-sdk"]
version_prefix = "wasi-sdk-"
version = "29"
postinstall = 'mise run link-wasi "$MISE_TOOL_INSTALL_PATH"'
[tasks.clean]
run = """
rm -r ./target || 0
rm -r ./transpiled || 0
"""
dir = "giallo-js"
[tasks.link-wasi]
hide = true
description = "[INTERNAL] Symlink the WASI artifacts installed by mise into the project directory."
usage = 'arg "<wasi_install_path>"'
run = """
mkdir -p ./build
ln -sf "${usage_wasi_install_path?}" ./build/wasi-sdk
"""
dir = "giallo-js"
[tasks.compile]
description = "Compile Rust code to wasm component."
run = """
RUSTFLAGS="-L $(pwd)/build/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi -lstatic=c++ -lstatic=c++abi" \
CC="$(pwd)/build/wasi-sdk/bin/clang" \
cargo build --target=wasm32-wasip2
"""
dir = "giallo-js"
[tasks.transpile]
alias = "build"
description = "Generate Javascript bindings for compiled wasm component."
depends = [{ task = "compile", args = ["--profile=release"] }]
run = "npx @bytecodealliance/jco transpile target/wasm32-wasip2/release/giallo_js.wasm -I sync -o transpiled"
dir = "giallo-js"
[tasks.test]
description = "Run Jest tests."
depends = [{ task = "transpile" }]
run = 'NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" npx jest'