2026-10-12 21:20:14 -04:00
|
|
|
// Writes every Tailwind class candidate in the panel's markup to packages/sdk/core-classes.txt, which
|
|
|
|
|
// theme-entry.css sources so a theme's Tailwind build orders its utilities with the panel's.
|
2026-10-12 07:47:42 -04:00
|
|
|
import { Scanner } from '@tailwindcss/oxide';
|
2026-10-12 21:20:14 -04:00
|
|
|
import { writeFileSync } from 'node:fs';
|
2026-10-12 07:47:42 -04:00
|
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
|
|
|
|
|
|
const root = fileURLToPath(new URL('..', import.meta.url));
|
|
|
|
|
const scanner = new Scanner({
|
|
|
|
|
sources: [
|
|
|
|
|
{ base: `${root}resources/scripts`, pattern: '**/*.{ts,tsx}', negated: false },
|
|
|
|
|
{ base: `${root}resources/views`, pattern: '**/*.blade.php', negated: false },
|
|
|
|
|
],
|
|
|
|
|
});
|
|
|
|
|
|
2026-10-12 21:20:14 -04:00
|
|
|
writeFileSync(`${root}packages/sdk/core-classes.txt`, `${[...new Set(scanner.scan())].sort().join('\n')}\n`);
|