test(webui): guard tailwind @source against missing perfect-design components

Add a spec that maps every component imported from perfect-design, and
every directory it imports in turn, to an @source entry in main.css.
Extend the bundle gate spec to check that utilities unique to recently
added components appear in the built CSS.
This commit is contained in:
2026-11-25 11:52:38 +00:00
parent 6bc144cc12
commit ff58b03e21
4 changed files with 138 additions and 1 deletions
+7
View File
@@ -9,6 +9,13 @@ export const DIST = fileURLToPath(new URL('../dist/assets', import.meta.url))
export const hasDist = () => existsSync(DIST)
export function readCss(dir = DIST) {
return readdirSync(dir)
.filter((f) => f.endsWith('.css'))
.map((f) => readFileSync(join(dir, f), 'utf8'))
.join('\n')
}
export function totalGzip(dir = DIST) {
return measure(dir).reduce((n, r) => n + r.gzip, 0)
}