Fix WESP UI after git clone: serve from public/wesp and materialize static.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
влад
2026-07-16 11:43:25 +03:00
co-authored by Cursor
parent 2c294424ef
commit 5dfa06ddbe
8 changed files with 49 additions and 36 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
# Build apps/web/public/static from git-tracked public/wesp.
# Optionally refresh public/wesp from an external WESP hub checkout first.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
WESP_EXTERNAL="${WESP_STATIC:-$ROOT/../wesp/static}"
SRC="$ROOT/apps/web/public/wesp"
DEST="$ROOT/apps/web/public/static"
if [ ! -d "$SRC" ]; then
echo "WESP UI source not found: $SRC" >&2
exit 1
fi
if [ -d "$WESP_EXTERNAL" ]; then
rsync -a --delete \
--exclude '.DS_Store' \
"$WESP_EXTERNAL/" "$SRC/"
echo "Refreshed $SRC from $WESP_EXTERNAL"
fi
mkdir -p "$DEST"
rsync -a --delete \
--exclude '.DS_Store' \
"$SRC/" "$DEST/"
echo "Materialized WESP static: $SRC -> $DEST"
+4 -32
View File
@@ -1,36 +1,8 @@
#!/usr/bin/env bash
# Mirror WESP zootech + admin static UI into site web public/static (1:1 paths).
# Sync WESP UI: optional external hub refresh, then materialize public/static.
# External source: WESP_STATIC or ../wesp/static (when present).
# Fallback: git-tracked apps/web/public/wesp (works after clone without WESP repo).
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
WESP_STATIC="${WESP_STATIC:-$ROOT/../wesp/static}"
DEST="$ROOT/apps/web/public/static"
ORCH_BOOT="$ROOT/apps/web/public/wesp/js/wesp-orchestrator-boot.js"
AUTH_BRIDGE_SRC="$ROOT/apps/web/public/wesp/js/wesp-orchestrator-auth-bridge.js"
if [ ! -d "$WESP_STATIC" ]; then
echo "WESP static not found: $WESP_STATIC" >&2
exit 1
fi
mkdir -p "$DEST"
# Full mirror: same /static/* and page HTML paths as on the WESP hub.
rsync -a --delete \
--exclude '.DS_Store' \
"$WESP_STATIC/" "$DEST/"
# Orchestrator-only adapters (never overwritten by hub copy).
mkdir -p "$DEST/js"
if [ -f "$ORCH_BOOT" ]; then
cp "$ORCH_BOOT" "$DEST/js/wesp-orchestrator-boot.js"
fi
if [ -f "$AUTH_BRIDGE_SRC" ]; then
cp "$AUTH_BRIDGE_SRC" "$DEST/js/wesp-orchestrator-auth-bridge.js"
fi
LOGIN_ADAPTER_SRC="$ROOT/apps/web/public/wesp/js/wesp-orchestrator-login.js"
if [ -f "$LOGIN_ADAPTER_SRC" ]; then
cp "$LOGIN_ADAPTER_SRC" "$DEST/js/wesp-orchestrator-login.js"
fi
echo "Synced WESP static from $WESP_STATIC -> $DEST"
exec bash "$ROOT/scripts/materialize-wesp-static.sh"