Files
marqdo-ext-web/scripts/domain-acceptance.sh
T
cflmy 7a2c9280c0 feat: WEB-04 domain composition cases and production delivery trial
Add three composition cases driven by the same generic web Tool:
- examples/doc-site (documentation site),
- examples/research-workspace (existing section 8 workbench prototype),
- examples/quantum-editor (finite scenario/interaction design).

Add a real production delivery trial in examples/research-workbench-app
(Express + JSON persistence + static UI): validation, search, status
transitions, linked statistics, JSON errors, real file persistence; node:test
API acceptance and a Playwright browser E2E. The production app is not a runtime
dependency of the web Tool; prototype PASS is kept separate from production
PASS. docs/WEB-04-delivery.md records the design-source to implementation
mapping, intentional non-goals and task splits.

scripts/domain-acceptance.sh is the explicit domain entry: installs the built
Tool, runs check/preview/handoff for the three cases, then installs/tests the
production app incl. browser E2E, and removes the Tool. Evidence records the
real CLI/Design/Preview identities and local PASS results.

Pin the domain submodules to the merged Design (WEB-01/03) and Preview (WEB-02)
candidates; activation and root gitlink belong to WEB-05.

Refs cflmy/marqdo-ext-web#2, cflmy/marqdo#6
2026-11-27 09:02:27 +08:00

44 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# WEB-04 domain acceptance: three composition cases through the unique web Tool
# plus the real production delivery trial (Express app with API and E2E).
set -eu
: "${MARQDO_BIN:?set MARQDO_BIN to the verified marqdo executable}"
: "${MARQDO_WEB_TOOL_JSON:?set MARQDO_WEB_TOOL_JSON to the built preview tool.json}"
cd "$(dirname "$0")/.."
work="$(mktemp -d)"
trap 'rm -rf "$work"' EXIT
export MARQDO_TOOL_HOME="$work/tool-home"
"$MARQDO_BIN" tool install "$MARQDO_WEB_TOOL_JSON"
run_case() {
case_name="$1"
unit="$2"
root="examples/$case_name"
entry="$root/index.mq.md"
"$MARQDO_BIN" web check "$entry" --unit "$unit" --root "$root"
preview="$work/$case_name-preview"
"$MARQDO_BIN" web preview "$entry" --unit "$unit" --root "$root" --out "$preview"
test -f "$preview/index.html"
grep -q "Content-Security-Policy" "$preview/index.html"
grep -q "data-scenario\|data-instance" "$preview/index.html"
handoff="$work/$case_name-handoff.md"
"$MARQDO_BIN" web handoff "$entry" --unit "$unit" --root "$root" --out "$handoff"
test -s "$handoff"
grep -q "Design handoff" "$handoff"
echo "case $case_name: PASS"
}
run_case research-workspace 工作台
run_case doc-site 首页
run_case quantum-editor 编辑器
# Production delivery trial: a real framework application, not the prototype.
(
cd examples/research-workbench-app
npm install --no-audit --no-fund ${MARQDO_NPM_CACHE:+--cache "$MARQDO_NPM_CACHE"}
npm test
WORKBENCH_DATA="$work/e2e-data.json" npx playwright test
)
"$MARQDO_BIN" tool remove web
echo "PASS: WEB-04 domain composition + production delivery trial"