WIT and WAC language tools for files and stdin
moonx moonrockz/wasm-devkit@0.3.0 --help
moonx moonrockz/wasm-devkit@0.3.0 parse example.witmise use github:moonrockz/wasm-devkit@0.3.0
mise exec -- wasm-devkit --version// Public API
package example:greeter;
interface greeter{hello: func(name: string)->string;}moonx moonrockz/wasm-devkit@0.3.0 parse hello.wit
moonx moonrockz/wasm-devkit@0.3.0 format hello.wit// Public API
package example:greeter;
interface greeter {
hello: func(name: string) -> string;
}package example:app;
import host: interface { log: func(message: string); };
let app = new example:service { host, ... };
export app.run as "run";moonx moonrockz/wasm-devkit@0.3.0 parse app.wac
moonx moonrockz/wasm-devkit@0.3.0 ast app.wac
moonx moonrockz/wasm-devkit@0.3.0 cst app.wac
moonx moonrockz/wasm-devkit@0.3.0 tokens app.wacmoonx moonrockz/wasm-devkit@0.3.0 format --check hello.wit
moonx moonrockz/wasm-devkit@0.3.0 format --write hello.wit
moonx moonrockz/wasm-devkit@0.3.0 format --check hello.witcat hello.wit | moonx moonrockz/wasm-devkit@0.3.0 format --language witGet-Content -Raw hello.wit | moonx moonrockz/wasm-devkit@0.3.0 format --language witinterface arrays { type words = list<u8, 16>; }moonx moonrockz/wasm-devkit@0.3.0 parse --all-features proposals.wit
moonx moonrockz/wasm-devkit@0.3.0 format --all-features proposals.witpackage example:types;
type callback = func() -> (value: u8);wasm-devkit decompile module.wasm
wasm-devkit decompile component.wasm --output component.wat
cat module.wasm | wasm-devkit decompile -o module.wat
wasm-devkit decompile component.wasm --compatibility wasm-tools
wasm-devkit decompile module.wasm --compatibility wabt(module
(type (;0;) (func))
(export "run" (func 0))
(func (;0;) (type 0)
)
)wasm-devkit inventory app.wasm
wasm-devkit inventory app.wasm --json --output inventory.json
wasm-devkit decompile app.wasm --split app-documents
wasm-devkit verify app-documents/root.wac
wasm-devkit decompile app.wasm --split selected --select root/component-n0
wasm-devkit decompile app.wasm --split empty --select-nonewasm-devkit parse example.wit
wasm-devkit ast example.wac
wasm-devkit cst example.wit
wasm-devkit tokens example.wac
wasm-devkit print example.wac
wasm-devkit format example.wit
wasm-devkit format --check example.wit
wasm-devkit format --write example.wac
cat example.wit | wasm-devkit parse --language wit
wasm-devkit decompile module.wasm --output module.wat
wasm-devkit decompile component.wasmwasm-devkit verify api.wit --semantic-feature preview
wasm-devkit verify ./wit --language wit --all-semantic-featureswasm-devkit verify ./wit --language wit
wasm-devkit verify ./wit/world.wit
wasm-devkit verify ./world.wit --deps-dir ./packages
wasm-devkit verify ./world.wit --dep example:dep@1.0.0=../dep
cat ./world.wit | wasm-devkit verify --language wit --base ./witpackage example:files;
interface files {
resource file {
constructor(path: string) -> result<file, string>;
read: async func() -> list<u8>;
open: static func(path: string) -> file;
position: get() -> u64;
position: set(value: u64);
}
}
world app { import files; }wasm-devkit verify ./wit --language wit --world app
wasm-devkit verify ./wit --language wit --world example:app/app@1.0.0
wasm-devkit verify ./wit --language wit --jsonwasm-devkit verify ./app.wac --dep lookup:dep=./component.wasm
wasm-devkit verify ./app.wac --deps-dir ./componentswasm-devkit verify app.wac --registry https://registry.example.org --lockfile app.lock.json
wasm-devkit verify app.wac --registry https://registry.example.org --lockfile app.lock.json --offline
wasm-devkit verify app.wac --registry https://registry.example.org --lockfile app.lock.json --refreshwasm-devkit compare left.wat right.wat
wasm-devkit compare left.wat right.wat --mode semantic
wasm-devkit compare - right.wat --mode semantic --json < left.wat