iter(g241): verify 增加演示锚点大写防护,防大写锚点被静默吞掉误报缺段
This commit is contained in:
@@ -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 锚点校验');
|
||||
|
||||
Reference in New Issue
Block a user