// Regenerates the web app's inline sandbox stylesheet from the compiled // @colineapp/ui CSS. Run after `pnpm build:css`. import { readFileSync, writeFileSync } from "node:fs"; import { fileURLToPath } from "node:url"; import { dirname, join } from "node:path"; const here = dirname(fileURLToPath(import.meta.url)); const css = readFileSync(join(here, "../dist/styles.css"), "utf8"); const out = `// GENERATED by \`pnpm --filter @colineapp/ui build:css\` + scripts/sync-sandbox-styles.mjs. // The @colineapp/ui stylesheet served inline by the tier-2 sandbox shell // (plan ยง7.2.5). Regenerate when the UI package styles change. export const SANDBOX_STYLES_CSS: string = ${JSON.stringify(css)}; `; writeFileSync( join(here, "../../../apps/web/src/lib/apps/sandbox-styles.generated.ts"), out, ); console.log("sandbox styles synced");