-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (24 loc) · 988 Bytes
/
index.js
File metadata and controls
30 lines (24 loc) · 988 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { rmSync, existsSync, loadTokens } from "./utils/helpers/fileSystem.js";
import { generateAllVariables } from "./utils/themeProcessing.js";
import { writeJsThemeFiles } from "./utils/jsGeneration.js";
import { writeCssThemeFiles } from "./utils/cssGeneration.js";
import { OUTPUT_PATH } from "./utils/constants.js";
// ============================================================================
// Main Execution
// ============================================================================
function main() {
const themes = loadTokens();
const { themeVariables } = generateAllVariables(themes);
try {
// Remove output directory if it exists
if (existsSync(OUTPUT_PATH)) {
rmSync(OUTPUT_PATH, { recursive: true });
}
writeJsThemeFiles(themeVariables);
writeCssThemeFiles(themeVariables);
console.log("\nTheme files generated successfully.");
} catch (error) {
console.error("\nError generating theme files:", error);
}
}
main();