diff --git a/packages/tools/cli/bin/ua.js b/packages/tools/cli/bin/ua.js index 95279d7..be764d4 100644 --- a/packages/tools/cli/bin/ua.js +++ b/packages/tools/cli/bin/ua.js @@ -1458,6 +1458,9 @@ function cmdVerify() { const demoPath = path.join(ROOT, 'apps', 'demo', 'main.ts'); // 演示区块定义在源码里(产物是打包后的 JS) const demoSource = fs.existsSync(demoPath) ? fs.readFileSync(demoPath, 'utf8') : ''; const anchors = new Set(demoSource.match(/sec-[a-z0-9-]+/g) ?? []); // 已定义的区块锚点 + for (const raw of demoSource.match(/sec-[A-Za-z0-9-]+/g) ?? []) { + if (/[A-Z]/.test(raw)) issues.push(`demo 锚点 ${raw} 含大写字母:锚点口径只认 sec-[a-z0-9-](大写会被锚点集合静默吞掉, manifests 登记后会误报「缺 section」)`); // 防大写锚点静默失踪(g234 实踩) + } const tokenVars = new Set(loadTokenList().map((t) => t.cssVar)); // 令牌白名单:tokens.json 拍平结果 if (demoSource) issues.push(...checkDemoBundle(anchors)); // 产物与源码同步校验 if (!demoSource) console.log('verify: 未找到 apps/demo/main.ts,跳过 demo 锚点校验');