feat: V1.1 批次入库——色号表SEO页/Showcase/图纸库/帮助中心/JSON-LD/CI门禁/竞品分析

This commit is contained in:
Sisyphus committed 2026-08-15 14:41:00 +08:00
1 parent 40e2342a02
commit f53f0a2b25
104 files changed
+21760 -157

No files matched your search

+37
View File
@@ -64,6 +64,43 @@ jobs:
working-directory: perler-lab
run: npm run build
# 构建产物校验 + 新页面路由冒烟(T-109)
# 目的:① 确认 vite build 产物存在(dist/index.html + assets JS bundle,含
# /color-chart 系列 /showcase /library 等新页面的静态打包代码);
# ② 用 vite preview(自带 SPA fallback,行为等价于生产 nginx 的
# try_files $uri $uri/ /index.html)对每个新路由做直访冒烟,
# 防止「路由直访 404」回归。
- name: Verify SPA dist & route smoke
if: matrix.project.name == 'perler-lab'
working-directory: perler-lab
run: |
set -e
# ① dist 基础产物存在性校验
[ -f dist/index.html ] || { echo "❌ dist/index.html 缺失"; exit 1; }
ls dist/assets/*.js > /dev/null 2>&1 || { echo "❌ dist/assets 无 JS bundle"; exit 1; }
echo "✅ dist 产物校验通过(index.html + JS bundle)"
# ② 启动 vite preview(模拟生产 nginx,含 SPA fallback)
npx vite preview --port 4173 --strictPort > /tmp/vite-preview.log 2>&1 &
PID=$!
trap "kill $PID 2>/dev/null || true" EXIT
for i in $(seq 1 30); do
curl -sf http://localhost:4173/ > /dev/null 2>&1 && break
sleep 0.5
done
curl -sf http://localhost:4173/ > /dev/null 2>&1 || {
echo "❌ vite preview 未能启动"; cat /tmp/vite-preview.log; exit 1; }
# ③ 新页面路由直访冒烟(nginx try_files → index.html → 200)
for route in / /chibi /color-chart /color-chart/mard /color-chart/artkal-c /showcase /library; do
code=$(curl -s -o /dev/null -w '%{http_code}' "http://localhost:4173$route")
echo "GET $route → $code"
[ "$code" = "200" ] || { echo "❌ 路由 $route 返回 $code(预期 200)"; exit 1; }
done
echo "✅ 全部新页面路由冒烟通过"
# ── 构建 Docker 镜像(验证 Dockerfile 正确性) ──
build:
needs: test