Fix DESIGN.md frontmatter coverage

AI assistance: Codex reproduced the issue, implemented the focused fix, and added regression coverage.
This commit is contained in:
Paul Bakaus
2026-07-30 09:06:27 -07:00
parent 6b342244e9
commit a209eeb0bd
2 changed files with 23 additions and 1 deletions
+1 -1
View File
@@ -126,7 +126,7 @@ export function checkDesignCoverage({ design, designPath, parseDesignMd }) {
return [];
}
const missing = ['colors', 'typography', 'components']
.filter((section) => !model[section]);
.filter((section) => !model[section] && !model.frontmatter?.[section]);
if (!missing.length) return [];
return [finding({
id: 'design-md-coverage',
+22
View File
@@ -172,6 +172,28 @@ describe('checkDesignCoverage', () => {
assert.deepEqual(checkDesignCoverage({ design, designPath: 'DESIGN.md', parseDesignMd }), []);
});
it('counts machine-readable frontmatter as section coverage', () => {
const design = [
'---',
'name: X',
'colors:',
' ink: "#111111"',
'typography:',
' body:',
' fontFamily: Inter',
'components:',
' button:',
' backgroundColor: "{colors.ink}"',
'---',
'',
'# Design System: X',
'',
'See the canonical source for prose guidance.',
'',
].join('\n');
assert.deepEqual(checkDesignCoverage({ design, designPath: 'DESIGN.md', parseDesignMd }), []);
});
it('reports nothing without a DESIGN.md', () => {
assert.deepEqual(checkDesignCoverage({ design: null, parseDesignMd }), []);
});