#!/bin/sh # Build the two wasm bundles this site loads, then say how to run it. # # Needs wasm-pack (cargo install wasm-pack, or `nix develop`) and the # wasm32-unknown-unknown target. Nothing else in the repo depends on either — # the `wasm` CI job only runs `cargo check --target wasm32-unknown-unknown`, # which does not need a bindgen step. # # Two bundles, because there are two sides and they are separate artifacts: # # pkg/ improvise-wasm-client — the main thread: fold, keys, render # worker-pkg/ improvise-worker-server — the worker: the whole App + OPFS # # The client bundle is the SAME artifact in both deployments (over a socket, or # over a MessageChannel to the worker); only the JS bootstrap differs. The # worker bundle is the standalone deployment's server half (improvise-9x6). set -eu root=$(cd "$(dirname "$0")/.." && pwd) wasm-pack build "$root/crates/improvise-wasm-client" \ --target web --out-dir "$root/web/pkg" wasm-pack build "$root/crates/improvise-worker-server" \ --target web --out-dir "$root/web/worker-pkg" cat <<'MSG' Built. Serve the directory and open it — that is the whole application: python3 -m http.server 8080 --directory web then open http://127.0.0.1:8080/. The document lives in an in-page Web Worker and persists to this browser's private storage (OPFS). It is seeded on first load from web/demo.improv; ?doc= and ?seed= name other documents. To point the same page at a separate server process instead: improvise-ws-server your-model.improv --port 8787 then reload with ?ws=ws://127.0.0.1:8787. MSG