From 0594ccf92afea316d8fe590ed5cf9ec580b25ba5 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 27 Jan 2026 15:01:57 +0000 Subject: [PATCH] fix: skip a2ui bundling when sources are excluded --- scripts/bundle-a2ui.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/bundle-a2ui.sh b/scripts/bundle-a2ui.sh index a1cf7ff2b..304002324 100755 --- a/scripts/bundle-a2ui.sh +++ b/scripts/bundle-a2ui.sh @@ -10,12 +10,21 @@ trap on_error ERR ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" HASH_FILE="$ROOT_DIR/src/canvas-host/a2ui/.bundle.hash" OUTPUT_FILE="$ROOT_DIR/src/canvas-host/a2ui/a2ui.bundle.js" +A2UI_RENDERER_DIR="$ROOT_DIR/vendor/a2ui/renderers/lit" +A2UI_APP_DIR="$ROOT_DIR/apps/shared/ClawdbotKit/Tools/CanvasA2UI" + +# Docker builds exclude vendor/apps via .dockerignore. +# In that environment we must keep the prebuilt bundle. +if [[ ! -d "$A2UI_RENDERER_DIR" || ! -d "$A2UI_APP_DIR" ]]; then + echo "A2UI sources missing; keeping prebuilt bundle." + exit 0 +fi INPUT_PATHS=( "$ROOT_DIR/package.json" "$ROOT_DIR/pnpm-lock.yaml" - "$ROOT_DIR/vendor/a2ui/renderers/lit" - "$ROOT_DIR/apps/shared/ClawdbotKit/Tools/CanvasA2UI" + "$A2UI_RENDERER_DIR" + "$A2UI_APP_DIR" ) collect_files() { @@ -46,7 +55,7 @@ if [[ -f "$HASH_FILE" ]]; then fi fi -pnpm -s exec tsc -p vendor/a2ui/renderers/lit/tsconfig.json -rolldown -c apps/shared/ClawdbotKit/Tools/CanvasA2UI/rolldown.config.mjs +pnpm -s exec tsc -p "$A2UI_RENDERER_DIR/tsconfig.json" +rolldown -c "$A2UI_APP_DIR/rolldown.config.mjs" echo "$current_hash" > "$HASH_FILE"