Files
shared/scripts/build-root-styles.mjs
Gabriel20xx 22887fef03 ci: expand CI checks and make consumer sync opt-in
- Add Go, npm, Python, and Java validation to CI
- Run Go tests against PostgreSQL
- Record performance fixes in the report
2026-10-19 21:14:31 +00:00

17 lines
634 B
JavaScript

import { readFile, writeFile } from 'node:fs/promises';
const source = await readFile(new URL('../packages/web-ui/dist/styles.css', import.meta.url), 'utf8');
// The token import may be written with single or double quotes, and with or without the semicolon.
const tokenImport = /^@import\s+(['"])@gabriel20xx\/design-tokens\/theme\.css\1\s*;?$/;
const componentStyles = source
.split(/\r?\n/)
.filter((line) => !tokenImport.test(line.trim()))
.join('\n')
.trimStart();
await writeFile(
new URL('../shared-styles.css', import.meta.url),
`@import './packages/design-tokens/theme.css';\n\n${componentStyles}`,
'utf8'
);