执行 ROADMAP 的 S1-P2(npm 分发)与 S1-P3(CI 回归)。
P3 · CI 回归流水线
- .github/workflows/regression.yml:push/PR 自动跑回归,失败阻断
含 playwright 浏览器缓存、零依赖自检、服务就绪轮询、报告上传、
GitHub Step Summary 输出
- tools/run-regression.mjs 重构:
· 路径基于脚本位置(不再依赖 cwd,CI 更稳)
· 环境自检:服务未起退出码 2、playwright 缺失退出码 2
· 断言超时后重试一次(吸取 _collect.html 的偶发教训)
· 超时与断言失败分开统计(timedOut 字段)
· 失败时打印明细并 exit 1,全部通过 exit 0
P2 · npm 分发
- package.json:aurora-admin-design,dependencies 为空(零运行时依赖铁律)
playwright 放 devDependencies(CI 专用)
- tools/build-dist.mjs:零依赖构建脚本,产出 dist/
tokens/{tokens.css,tokens.json(DTCG),figma.json}
components/{<slug>.css ×79, index.css 聚合, <slug>.html ×79}
manifest.json(含 SHA 校验和) + README.md
- .npmignore / .gitignore 更新(dist/ node_modules/ 不入库)
- npm pack 实测:115.9 KB 压缩 / 566 KB 解压 / 167 文件 / 无 site|tests 泄漏
实测发现的三个缺陷(全部修复)
1. package.json 加 "type": "module" 会让 site/dev-server.js(CJS)崩溃
—— 移除该字段,靠 .mjs 扩展名区分模块系统
2. dist 里 HTML 引用 ../tokens/colors_and_type.css 但产物是 tokens.css
—— 路径对但文件不存在,产物是坏的。重写全部引用规则
(含 index.css 的 @import 从 ./tokens/ 改为 ../tokens/)
3. 断言总数不确定:icon-contrast 是条件性推入(依赖渲染时机),
导致同一页不同次运行总数不同(960 vs 961)
—— 改为恒定输出一条(无问题=pass,有问题=skip),
断言数从 960 稳定为 1038,连跑两次完全一致
4. 顺带修 na 与 skip 重复计算(na = total - denom,但 skip 已是同一批)
—— 统一为 na = skip,算术自洽:pass+fail+skip = total
验证
- runner:passRate 100% | 79 页全通过 | 1003/1003 | N/A 35 | exit 0
- collector:完全同口径(total 1038 / pass 1003 / fail 0 / skip 35)
- dist:79/79 页面浏览器实测正常(令牌解析、无加载失败)
- 连跑两次数字完全一致(可复现)
49 lines
1.2 KiB
JSON
49 lines
1.2 KiB
JSON
{
|
|
"name": "aurora-admin-design",
|
|
"version": "1.4.1",
|
|
"lockfileVersion": 3,
|
|
"requires": true,
|
|
"packages": {
|
|
"": {
|
|
"name": "aurora-admin-design",
|
|
"version": "1.4.1",
|
|
"license": "MIT",
|
|
"devDependencies": {
|
|
"playwright": "^1.48.0"
|
|
},
|
|
"engines": {
|
|
"node": ">=18"
|
|
}
|
|
},
|
|
"node_modules/playwright": {
|
|
"version": "1.63.0",
|
|
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.63.0.tgz",
|
|
"integrity": "sha512-+7ziBLidS4NaNCdt57SUDT+wYmmd5fmiQejUic/kb+YsYSCPyOOE9sebzMjNmQrsnNpDJqd4WHvV/8lfKfUDUg==",
|
|
"dev": true,
|
|
"license": "Apache-2.0",
|
|
"dependencies": {
|
|
"playwright-core": "1.63.0"
|
|
},
|
|
"bin": {
|
|
"playwright": "cli.js"
|
|
},
|
|
"engines": {
|
|
"node": ">=20"
|
|
}
|
|
},
|
|
"node_modules/playwright-core": {
|
|
"version": "1.63.0",
|
|
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.63.0.tgz",
|
|
"integrity": "sha512-rYCsBF/M5HjUch52bbtVONEFjv6Xu8sm8h72dNlR5bzIE1fvC/bxgspzkjSfU+MweEMmPM8KJebG6nnyxo5mCg==",
|
|
"dev": true,
|
|
"license": "Apache-2.0",
|
|
"bin": {
|
|
"playwright-core": "cli.js"
|
|
},
|
|
"engines": {
|
|
"node": ">=20"
|
|
}
|
|
}
|
|
}
|
|
}
|