test: add taro route contract guardrail

This commit is contained in:
Codex
2026-07-01 01:22:34 +08:00
parent 7c0e55e419
commit 7559a33459
6 changed files with 111 additions and 2 deletions

View File

@@ -141,9 +141,12 @@ apps/taro/dist/h5-platform-admin
构建后可以先跑静态启动烟测,确认三套 H5 产物能被普通静态服务器托管、`runtime-config.json` 只含公开字段、JS/CSS 资源不 404并用 mock 后端验证 `/api/tenant/resolve` 契约:
```bash
node scripts/taro-route-contract-test.js
npm run smoke:taro:h5
```
`taro-route-contract-test` 会校验 `apps/taro/src/app.config.ts`、真实 `pages/**/index.tsx`、启动页三端跳转、H5 静态烟测入口和前端交接文档中的页面引用保持一致。新增或删除页面时必须同步路由和文档,避免 H5/小程序构建后才发现入口漂移。
H5 线上推荐每个静态目录放独立 `runtime-config.json` 覆盖公开配置,避免 API/Auth 域名变化时重打包:
```text