Files
Aidan Bleser 4c6406f135 parity checker cli (#2876)
Co-authored-by: Aidan Bleser <aidanbleser35@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: AdrianGonz97 <31664583+AdrianGonz97@users.noreply.github.com>
2026-09-10 11:01:13 -07:00

28 lines
947 B
TypeScript

import fs from "node:fs/promises";
import { PRESET_STYLES } from "shadcn-svelte/preset";
/**
* Pulls the upstream style CSS verbatim. These files are intentionally not
* formatted: the order of each `@apply` list is semantic for tailwind-merge,
* so they must stay byte-for-byte identical to shadcn/ui.
*/
async function pullStyles() {
await Promise.all(
PRESET_STYLES.map(async (style) => {
console.log(`Pulling upstream style ${style}...`);
const url = `https://raw.githubusercontent.com/shadcn-ui/ui/refs/heads/main/apps/v4/registry/styles/style-${style}.css`;
const res = await fetch(url);
if (!res.ok) {
console.error(`Failed to pull style ${style}: ${url} -> ${res.status}`);
process.exitCode = 1;
return;
}
const filepath = `src/lib/registry/styles/style-${style}.css`;
await fs.writeFile(filepath, await res.text());
console.log(`Wrote style ${style} to ${filepath}`);
})
);
}
pullStyles();