#!/usr/bin/env bash # Builds crates/didbot-site-anim for the browser and drops the result where # `crates/didbot-serve`'s dashboard serves it from: # crates/didbot-serve/assets/dashboard/wasm/. The same crate # scripts/build-wasm.sh builds for the site, in a second output directory: # the dashboard draws its wave field (`wave.rs`), and `didbot-serve` and the # site are different served processes with no runtime relationship to each # other. The dashboard serves no TypeScript declarations, so the .d.ts files # are dropped. # # An opt-in step, not part of `cargo build --workspace` or `cargo test # --workspace`: see scripts/build-wasm.sh. The dashboard falls back to a # still background when this has not been run — see # crates/didbot-serve/src/dashboard.rs's `wasm_asset` doc comment. # # Run this before building didbot-pds, not after: crates/didbot-serve's # build.rs bakes what it finds here into the binary, so the binary carries # its own background wherever it is copied. The Dockerfile runs it that way. set -euo pipefail cd "$(dirname "$0")/.." out_dir="crates/didbot-serve/assets/dashboard/wasm" scripts/build-wasm.sh didbot-site-anim "$out_dir" site-anim rm -f "$out_dir"/*.d.ts