Add the web runtime (DOM patcher, events, host bridge) and a browser e2e

web/ is the js-target MoonBit program: it renders app.view into the DOM with a
keyed patcher, turns pointer/touch/key events into app input, runs effects
against window.Android or demo stand-ins, and exposes window.launcher.* for the
Android shell. tests/e2e.cjs ports the legacy Playwright flows and passes
against the build; scripts/build-web.sh assembles dist/web.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
SpriteandClaude Sonnet 5.5 committed 2026-11-23 01:02:08 +00:00
1 parent 28e0284d9b
commit 637129aa4e
10 files changed
+1554

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# Builds the page: the MoonBit program (web/*.mbt, js backend) plus its static files,
# into dist/web/. With --demo the browser demo's apps.json and widgets.json come too;
# the APK build leaves them out (the shell answers those URLs itself).
set -euo pipefail
cd "$(dirname "$0")/.."
export PATH="$HOME/.moon/bin:$PATH"
moon build --target js --release
out=dist/web
rm -rf "$out" && mkdir -p "$out"
cp _build/js/release/build/web/web.js "$out/launcher.js"
cp web/index.html web/style.css "$out/"
if [ "${1:-}" = "--demo" ]; then cp web/apps.json web/widgets.json "$out/"; fi
echo "built $out ($(wc -c < "$out/launcher.js") bytes of JS)"