Wasm panel modules, widget host, merged plasmoid host design, and shell/UI work
Panel and wasm host - The panel is built from wasm plasmoid modules (compositor/wasm: wasmer-backed host). Modules get capabilities by importing host interfaces; the host publishes data tables and serves a request queue (launch, focus window, set layout, inspector, load/unload modules). New WIT: windows, layout-control, inspector, modules, system. - Merged two competing host designs: generic tables + requests are the base; the `system` snapshot and the id-stable `windows.all/focus` (Desktop Pulse) run on top of it. - Panel widgets: load a .wasm from a path or file chooser, reorder by dragging, right-click replace/remove/add, saved to panel.edn. - Desktop widget, system sampler (sysinfo), app catalog/humanised names, Interface Explorer (inspector), real font rendering (compositor/font, assets/fonts). Compositor - Drag the divider between tiled windows; lower tiled rows leave room for the title bar. - Title-bar buttons, 12-hour clock, truncated titles, task-list/layout menus. - DRM/KMS session, tcc debug builds (vendored tinycc incl. conftest.c), justfile recipes (modules, run, test), pixi.toml. Known gaps - The sources for the pulse, tasks, layout, inspector, module-manager, moon-* and clock-digital12 modules are not in the tree yet, so `just modules` stops at pulse and the host tests that load those modules fail until they land. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
080377fd79
commit
0145981c6a
57 files changed
+11461
-221
No files matched your search
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build the panel's wasm modules (every *-widget component in scripts/components.txt)
|
||||
# into build/components/<name>.wasm, the directory the compositor loads its panel from.
|
||||
# Same steps as scripts/build.sh minus the jco/JS-host transpile, so it needs only
|
||||
# moon and wasm-tools.
|
||||
# scripts/build-modules.sh [name ...]
|
||||
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
|
||||
want=("$@")
|
||||
mkdir -p build/components
|
||||
moon build --target wasm --release 2>&1 | grep -E '^Error' -A8 || true
|
||||
[ "${PIPESTATUS[0]}" -eq 0 ] || { echo "error: moon build failed" >&2; exit 1; }
|
||||
n=0
|
||||
while read -r name world; do
|
||||
case "$name" in ''|'#'*) continue;; esac
|
||||
case "$world" in *-widget) ;; *) continue;; esac
|
||||
if [ ${#want[@]} -gt 0 ] && [[ ! " ${want[*]} " =~ " $name " ]]; then continue; fi
|
||||
core="_build/wasm/release/build/components/$name/gen/gen.wasm"
|
||||
[ -f "$core" ] || { echo "error: $core missing" >&2; exit 1; }
|
||||
out="build/components/$name.wasm"
|
||||
wasm-tools component embed wit "$core" --world "$world" --encoding utf16 -o "build/components/$name.embed.wasm"
|
||||
wasm-tools component new "build/components/$name.embed.wasm" -o "$out"
|
||||
rm -f "build/components/$name.embed.wasm"
|
||||
wasm-tools validate --features component-model "$out"
|
||||
wasm-tools component targets --world "$world" wit "$out" >/dev/null
|
||||
imports="$(wasm-tools component wit "$out" | sed -n 's/^ import moonplasma:desktop\/\([a-z-]*\)@.*;/\1/p' | grep -v '^types$' | sort | paste -sd, - || true)"
|
||||
exports="$(wasm-tools component wit "$out" | sed -n 's/^ export moonplasma:desktop\/\([a-z-]*\)@.*;/\1/p' | sort | paste -sd, -)"
|
||||
printf '{"name":"%s","world":"%s","imports":[%s],"exports":[%s]}\n' "$name" "$world" \
|
||||
"$(echo "$imports" | sed 's/\([a-z-]\+\)/"\1"/g')" "$(echo "$exports" | sed 's/\([a-z-]\+\)/"\1"/g')" \
|
||||
> "build/components/$name.meta.json"
|
||||
printf ' %-16s %-22s %7s bytes imports=[%s]\n' "$name" "$world" "$(stat -c %s "$out")" "$imports"
|
||||
n=$((n + 1))
|
||||
done < scripts/components.txt
|
||||
echo "built $n module(s) into build/components/"
|
||||
@@ -3,3 +3,11 @@ clock-digital clock-widget
|
||||
clock-binary clock-widget
|
||||
launcher launcher-widget
|
||||
shell shell
|
||||
pulse pulse-widget
|
||||
clock-digital12 clock-widget
|
||||
moon-disc clock-widget
|
||||
moon-text clock-widget
|
||||
tasks taskbar-widget
|
||||
layout layout-widget
|
||||
inspector inspector-widget
|
||||
module-manager module-manager-widget
|
||||
@@ -11,4 +11,10 @@ args=()
|
||||
for a in "$@"; do
|
||||
[ "$a" = "-DMOONBIT_NATIVE_NO_SYS_HEADER" ] || args+=("$a")
|
||||
done
|
||||
# tcc does not link libm by default; the font rasteriser needs it. Add it on link steps only.
|
||||
link=1
|
||||
for a in "${args[@]}"; do
|
||||
case "$a" in -c|-ar) link=0 ;; esac
|
||||
done
|
||||
if [ "$link" = 1 ]; then args+=(-lm); fi
|
||||
exec "$tcc" "${args[@]}"
|
||||
+2
-1
@@ -36,5 +36,6 @@ step "host integration tests (jco + Node)"
|
||||
(cd host && npm test)
|
||||
|
||||
step "pure-MoonBit native Wayland compositor + wasi-gfx + e2e tests (compositor/)"
|
||||
moon test --target native --warn-list -a compositor/renderer compositor/gfx compositor/host
|
||||
XDG_CONFIG_HOME="$(mktemp -d)" MOON_PLASMA_TEST_CONFIG=1 \
|
||||
moon test --target native --warn-list -a compositor/renderer compositor/gfx compositor/wasm compositor/host
|
||||
moon build --target native --warn-list -a compositor/bin
|
||||
Reference in new issue
Block a user