Files
summercms/scripts/check-admin-dist.sh
Jakub Zych 5e50b166ef refactor(10.2-01): nest framework packages under modules
- Move remaining beach packages and embedded admin assets\n- Rewrite framework, example, build, and gate paths
2026-09-28 02:21:02 +02:00

27 lines
933 B
Bash
Executable File

#!/usr/bin/env bash
# Drift gate for the committed admin SPA build (D-04). Rebuilds admin/ from
# the committed lockfile into a temporary directory and fails when the result
# differs from modules/boardwalk/dist, the tree the Go binary embeds. After
# changing the SPA, rebuild with `npm --prefix admin run build` and commit the result.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
if [[ ! -d admin/node_modules ]]; then
npm --prefix admin ci
fi
npm --prefix admin run typecheck
TMP="$(mktemp -d)"
trap 'rm -rf "$TMP"' EXIT
(cd admin && node_modules/.bin/vite build --outDir "$TMP/dist" --emptyOutDir --logLevel warn)
if ! diff -r "$TMP/dist" modules/boardwalk/dist; then
echo "check-admin-dist: modules/boardwalk/dist is stale; run npm --prefix admin run build and commit modules/boardwalk/dist" >&2
exit 1
fi
echo "check-admin-dist: modules/boardwalk/dist matches a fresh build"