#!/usr/bin/env bash # Phase 38 verification gate: Extensible Journal embed providers. # Runs Go (-race), Blog Editor build/Vitest/dist check, corpus byte-parity check, # vue-journal-layer unit tests + playground SSR build + SSR smoke, and framework # docs tree check across sm-journal-plugin, vue-journal-layer, and summercms.go. set -euo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" PLUGIN_DIR="$(cd "${ROOT_DIR}/../sm-journal-plugin" && pwd)" LAYER_DIR="$(cd "${ROOT_DIR}/../vue-journal-layer" && pwd)" echo "=== Phase 38 Stage 1: sm-journal-plugin Go vet & -race unit tests ===" ( cd "${PLUGIN_DIR}" go vet ./... go test -race -short ./... ) echo "=== Phase 38 Stage 2: sm-journal-plugin Blog Editor build, Vitest & dist check ===" ( cd "${PLUGIN_DIR}" npm run build npm run test bash scripts/check-dist.sh ) echo "=== Phase 38 Stage 3: Blog Editor corpus byte-parity check ===" PLUGIN_CORPUS="${PLUGIN_DIR}/tests/blogeditor/fixtures/editor-corpus.json" LAYER_CORPUS="${LAYER_DIR}/tests/fixtures/editor-corpus.json" if ! cmp -s "${PLUGIN_CORPUS}" "${LAYER_CORPUS}"; then echo "ERROR: editor-corpus.json differs between sm-journal-plugin and vue-journal-layer" >&2 diff -u "${PLUGIN_CORPUS}" "${LAYER_CORPUS}" >&2 || true exit 1 fi echo "OK: editor-corpus.json is byte-identical across sm-journal-plugin and vue-journal-layer" echo "=== Phase 38 Stage 4: vue-journal-layer unit tests, playground build & SSR smoke ===" ( cd "${LAYER_DIR}" pnpm test pnpm build:playground pnpm smoke:ssr ) echo "=== Phase 38 Stage 5: summercms.go docs tree check ===" ( cd "${ROOT_DIR}" go test ./cmd/summer -run TestDocsTree ) echo "=== Phase 38 gate: ALL STAGES PASSED ==="