Files
wangjia 05203a9b5b
Design Source Checks / design-source (push) Failing after 14m23s
refactor: 原型迁移 .superpowers/prototype → design/prototype(与 CONTRACT 同目录)
- git mv 全目录(历史保留);.gitignore 收敛为整个 .superpowers/ 忽略
- 全仓 16 处引用同步(CI checks.yml / l1-sync / screens.mjs / hooks /
  CLAUDE.md / CONTRACT / SSR 模板注释 / docs / web 注释)
- 修 pre-commit 路径正则残留;5180 评审服务已切新路径
- 验证:check-ds 12 道 / l1-sync 6 道 / fidelity 抽查全过

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
2026-07-07 18:47:31 +08:00

30 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
# 原型设计系统守门闸(本地 pre-commit)。
# 仅当本次提交动了原型(design/prototype/)时跑 check-ds.mjs 的 12 道检查;
# 任一违规 → 阻止提交。临时跳过:git commit --no-verify。
#
# 安装(每台机器一次,把仓库内本脚本接到 git 钩子):
# sh scripts/hooks/install.sh
root="$(git rev-parse --show-toplevel)"
gate="$root/design/prototype/tools/check-ds.mjs"
# 没动原型 → 直接放行
if ! git diff --cached --name-only | grep -q '^design/prototype/'; then
exit 0
fi
if [ ! -f "$gate" ]; then
echo "[ds-gate] ⚠ 找不到 $gate,跳过设计系统检查。"
exit 0
fi
echo "[ds-gate] 原型有改动,跑设计系统守门闸(12 道)…"
if ! node "$gate" >/dev/null 2>&1; then
echo "[ds-gate] ✗ 设计系统检查未通过,提交已阻止。"
echo "[ds-gate] 详情:node design/prototype/tools/check-ds.mjs"
echo "[ds-gate] 跳过:git commit --no-verify"
exit 1
fi
echo "[ds-gate] ✓ 设计系统 12 道闸全过。"
exit 0