8192e576cf
The WASM binding had no tests; CI only checked that artefacts existed. Adds a wasm-bindgen-test suite covering SMA reference values, EMA batch==streaming equivalence, RSI pure-uptrend behaviour, fallible constructors returning JsError, and the unequal-length batch guards from B3. Wires wasm-pack test --node into the CI wasm job. The suite type-checks on the host; it executes under wasm-pack in CI (the local environment is a non-rustup Rust install without the wasm32 target).
59 lines
1.7 KiB
TOML
59 lines
1.7 KiB
TOML
[package]
|
|
name = "wickra-wasm"
|
|
description = "WASM bindings for the Wickra streaming-first technical indicators library."
|
|
version.workspace = true
|
|
authors.workspace = true
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
homepage.workspace = true
|
|
readme.workspace = true
|
|
keywords.workspace = true
|
|
categories.workspace = true
|
|
publish = false
|
|
|
|
[lib]
|
|
crate-type = ["cdylib", "rlib"]
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
# WASM target cannot use rayon (no threads in the browser by default), so we
|
|
# depend on the local path directly with default features disabled. This also
|
|
# strips the parallel batch helpers we don't ship to JavaScript.
|
|
wickra-core = { path = "../../crates/wickra-core", default-features = false }
|
|
wasm-bindgen = "0.2"
|
|
js-sys = "0.3"
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde-wasm-bindgen = "0.6"
|
|
console_error_panic_hook = { version = "0.1", optional = true }
|
|
|
|
[features]
|
|
default = []
|
|
panic-hook = ["dep:console_error_panic_hook"]
|
|
|
|
[dev-dependencies]
|
|
wasm-bindgen-test = "0.3"
|
|
|
|
[package.metadata.wasm-pack.profile.release.wasm-bindgen]
|
|
debug-js-glue = false
|
|
demangle-name-section = true
|
|
dwarf-debug-info = false
|
|
|
|
[package.metadata.wasm-pack.profile.release]
|
|
# The wasm-opt that ships with wasm-pack is older than the WebAssembly
|
|
# features rustc enables by default (reference-types, multivalue,
|
|
# bulk-memory, sign-extension, mutable-globals, …). Listing them all keeps
|
|
# wasm-opt happy without requiring a binaryen upgrade in CI.
|
|
wasm-opt = [
|
|
'-O3',
|
|
'--enable-bulk-memory',
|
|
'--enable-mutable-globals',
|
|
'--enable-nontrapping-float-to-int',
|
|
'--enable-sign-ext',
|
|
'--enable-reference-types',
|
|
'--enable-multivalue',
|
|
]
|