mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-02 04:15:52 -05:00
theme sheet order
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
// Writes every Tailwind class candidate in the panel's markup to packages/sdk/core-classes.txt,
|
||||
// which a theme stylesheet sources so it can replace the panel's, and the list's hash beside
|
||||
// the build, where Blade compares it with a theme's dist/theme.json.
|
||||
// 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.
|
||||
import { Scanner } from '@tailwindcss/oxide';
|
||||
import { createHash } from 'node:crypto';
|
||||
import { mkdirSync, writeFileSync } from 'node:fs';
|
||||
import { writeFileSync } from 'node:fs';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const root = fileURLToPath(new URL('..', import.meta.url));
|
||||
@@ -13,11 +11,5 @@ const scanner = new Scanner({
|
||||
{ base: `${root}resources/views`, pattern: '**/*.blade.php', negated: false },
|
||||
],
|
||||
});
|
||||
const contents = `${[...new Set(scanner.scan())].sort().join('\n')}\n`;
|
||||
|
||||
writeFileSync(`${root}packages/sdk/core-classes.txt`, contents);
|
||||
mkdirSync(`${root}public/assets`, { recursive: true });
|
||||
writeFileSync(
|
||||
`${root}public/assets/core-classes.json`,
|
||||
`${JSON.stringify({ hash: createHash('sha256').update(contents).digest('hex').slice(0, 16) })}\n`
|
||||
);
|
||||
writeFileSync(`${root}packages/sdk/core-classes.txt`, `${[...new Set(scanner.scan())].sort().join('\n')}\n`);
|
||||
|
||||
Reference in New Issue
Block a user