mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 11:18:48 +00:00
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
17 lines
685 B
JavaScript
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');
|
|
}
|