Files
chandra/scripts/build-compositor-wasm.sh
T
VandClaude Opus 5.5 af774d76fe
CI / test (push) Failing after 16s
Rename the project to Chandra
moon-plasma / moonplasma / MoonPlasma / Moon Plasma become chandra / Chandra
everywhere: the WIT package (chandra:desktop, chandra:host, chandra:wm), the
MoonBit module (chandra/desktop) and generated bindings, the Rust host,
identifiers (ChandraCompositor), the session script (chandra-session) and
desktop entry (chandra.desktop), config and data paths
($XDG_CONFIG_HOME/chandra, share/chandra/modules), env vars (CHANDRA_*),
UI strings, docs and tests. The test fixture components are rebuilt against
the renamed WIT.

Saved panel.edn and state.edn are still read from the old
$XDG_CONFIG_HOME/moon-plasma until the first save writes the new copy.

The remote repository keeps its experiments/moon-plasma name for now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hi3L9oVBoRd373Qr4n
2026-11-25 17:12:57 +00:00

23 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Build the compositor itself as a wasm component: build/compositor.wasm.
# It imports only chandra:host/sys (wit/host/sys.wit) and exports `run`; the native host in
# host-wasm/ provides the imports. Needs moon and wasm-tools.
# scripts/build-compositor-wasm.sh
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"; cd "$ROOT"
export PATH="$ROOT/.tools/bin:$HOME/.moon/bin:$PATH"
for t in moon wasm-tools; do
command -v "$t" >/dev/null || { echo "error: $t not found" >&2; exit 1; }
done
moon build --target wasm --release components/compositor/gen 2>&1 | grep -E '^Error' -A8 || true
[ "${PIPESTATUS[0]}" -eq 0 ] || { echo "error: moon build failed" >&2; exit 1; }
core="_build/wasm/release/build/components/compositor/gen/gen.wasm"
[ -f "$core" ] || { echo "error: $core missing" >&2; exit 1; }
mkdir -p build
wasm-tools component embed wit/host "$core" --world compositor --encoding utf16 -o build/compositor.embed.wasm
wasm-tools component new build/compositor.embed.wasm -o build/compositor.wasm
rm -f build/compositor.embed.wasm
wasm-tools validate --features component-model build/compositor.wasm
printf 'compositor.wasm %s bytes imports=[%s]\n' "$(stat -c %s build/compositor.wasm)" \
"$(wasm-tools component wit build/compositor.wasm | sed -n 's/^ import \(.*\);/\1/p' | paste -sd, -)"