Files
houseplan-card/test/styles-source.mjs
Codex 7d094fd2ea refactor: extract the dialogs surface styles (#266 slice 2/5)
271 блок диалогов/форм/кнопок/пикеров → src/styles/dialogs.styles.ts, склейка
[inline, chrome, dialogs]. Контрактные тесты, которые греппят CSS-исходник,
переведены на хелпер readAllStylesSource (styles.ts + все импортированные
файлы поверхностей) — greps видят весь лист на любом состоянии сплита.
Refactor-proof diff пуст; golden 129/129; npm test 1315/0.

Issue: #266
User-Visible: no
2026-08-26 01:34:20 +03:00

17 lines
685 B
JavaScript

/**
* #266: the style sheet is being split into surface files. Contract tests
* that grep the CSS source must see the WHOLE sheet regardless of the split
* state, so they read src/styles.ts plus every surface file it imports.
*/
import { readFileSync } from 'node:fs';
export function readAllStylesSource() {
const aggregatorUrl = new URL('../src/styles.ts', import.meta.url);
const aggregator = readFileSync(aggregatorUrl, 'utf8');
const parts = [aggregator];
for (const m of aggregator.matchAll(/from '\.\/styles\/([\w-]+)\.styles'/g)) {
parts.push(readFileSync(new URL(`../src/styles/${m[1]}.styles.ts`, import.meta.url), 'utf8'));
}
return parts.join('\n');
}