[package]
name = "tishlang_wasm_runtime"
version = "1.3.8"
edition = "2021"
description = "Tish VM compiled to WebAssembly (browser + Wasmtime/WASI)"
license-file = { workspace = true }
repository = { workspace = true }

[lib]
crate-type = ["cdylib", "rlib"]

[features]
# For wasm32-unknown-unknown (browser): wasm-bindgen, console output
browser = ["dep:wasm-bindgen", "tishlang_vm/wasm"]
# Built-in modules for WASI (wasm32-wasip1): file I/O, process, http
fs = ["tishlang_vm/fs"]
process = ["tishlang_vm/process"]
http = ["tishlang_vm/http"]

[dependencies]
tishlang_bytecode = { path = "../tish_bytecode", version = ">=0.1" }
tishlang_vm = { path = "../tish_vm", version = ">=0.1" }
wasm-bindgen = { version = "0.2", optional = true }

# rand_core → getrandom 0.4 needs wasm_js on wasm32-unknown-unknown (browser VM build).
[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.4", features = ["wasm_js"] }
