@kuncat/avoidant
v0.3.1
Published
WebAssembly compilation target
Readme
Avoidant
Developing
Prerequisites
WebAssembly compilation target
rustup target add wasm32-unknown-unknownwasm-pack
cargo install wasm-packNightly Rust toolchain (required for WebAssembly threads via wasm-bindgen-rayon)
rustup toolchain install nightly --component rust-src --target wasm32-unknown-unknownOn static hosting, ensure cross-origin isolation headers (for browser WebAssembly threads):
Cross-Origin-Opener-Policy: same-origin and
Cross-Origin-Embedder-Policy: require-corp
Running
Install dependencies with npm install then start a development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --openBuilding
WASM
npm run build:wasmApp
npm run buildYou can preview the production build with npm run preview.
Testing
WASM Headless Browser test
cd crates/game && wasm-pack test --headless --firefoxMultiplayer
The existing New Game menu offers Solo, Collaborative and Territory. All multiplayer modes require a Kuncat account and use the trusted Rust authority. Collaborative games share reveals and a team score; territory use their respective competitive rules. Invitations join through the same menu and login flow. Solo stays local and does not require an account. Iroh transport and peer host/join APIs have been removed.
See the implementation plan for rules, identity and
architecture diagrams, and the server guide for deployment.
The component's optional competitive configuration supplies the server URL and
Kuncat account client for all multiplayer modes. Without configuration,
multiplayer controls remain disabled. The sibling website configures shared OIDC;
the sibling infra repository provisions identity, database and Workers.
npm ci
npm --prefix server ci
npm run dev:multiplayer -- --hostThe local launcher supplies test accounts to the ordinary menu. Production builds exclude that adapter. Open the printed player URLs, choose New Game and a mode, then share the invitation link. No cloud provisioning is needed for local play.
cargo test -p avoidant --lib
cargo test -p avoidant-competitive
npm --prefix server testThe shared menu uses DaisyUI 5 with Tailwind 4. Consumers of the Svelte package
must install daisyui and enable its Tailwind plugin (themes winter and night),
as configured in src/app.css and the sibling games site's stylesheet.
