Prerequisites
You need the following tools installed:- Node.js and npm - For package management and build scripts
- Rust - The Rust compiler and toolchain
- wasm32-unknown-unknown target - WebAssembly compilation target
- wasm-bindgen-cli - WASM bindings generator
Installation
Build Output
The build process outputs compiled files todist/, which contains:
- JavaScript wrapper - TypeScript-compiled JS facade
- TypeScript types - Type definitions for the API
- WASM binaries - Two WebAssembly modules:
kimg_wasm_bg.wasm- Baseline WASM targetkimg_wasm_simd_bg.wasm- SIMD-enabled build for runtimes withsimd128support
tsgo for the tracked TypeScript wrapper layer.
Project Structure
Running Tests
kimg includes comprehensive test coverage with 148 core Rust tests plus package-layer tests.Run Rust core tests
Run JavaScript tests
Run demo tests
/demo/ locally, loads the full visual suite in a headless browser, and fails if the page reports runtime failures, diagnostics, or an incomplete card set.Run package tests
Formatting
Format TypeScript sources:Local Development
The demo page atdemo/index.html loads from the dist/ directory. After building, you can open it in a browser to test the compiled WASM binaries.
For iterative development:
- Make changes to Rust or TypeScript sources
- Run
./scripts/build.shto rebuild - Refresh the demo page or re-run tests