mirror of
https://github.com/storytold/indd-utils.git
synced 2026-11-21 01:30:48 +01:00
tools/check_wasm.sh builds the library for wasm32-unknown-unknown, then builds a probe module (a cdylib generated under the target directory that exports a function calling `indd::convert`) and checks with Node.js that the module imports nothing: a conversion needs no file system, clock or other host function. It then converts the fetched fixtures, or the files given, in the probe module and compares each package byte for byte with the native `indd convert` output. No library change was needed: only `convert_file` and `read_header` use `std::fs`, and `convert` does not call them. The 5 fixtures and 80 corpus files give the same packages in WebAssembly as natively. The check takes about 10 s; it is documented in CLAUDE.md, CONTRIBUTING.md, README.md and ARCHITECTURE.md. There is no hosted CI. Idea from storytold/designcraft#98.