mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-19 09:36:59 +03:00
Fix DESIGN.md frontmatter coverage
AI assistance: Codex reproduced the issue, implemented the focused fix, and added regression coverage.
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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 }), []);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user