buildThemes.ts

 1import * as fs from "fs";
 2import * as path from "path";
 3import app from "./styleTree/app";
 4import dark from "./themes/dark";
 5import light from "./themes/light";
 6import snakeCase from "./utils/snakeCase";
 7
 8const themes = [dark, light];
 9for (let theme of themes) {
10    let styleTree = snakeCase(app(theme));
11    let styleTreeJSON = JSON.stringify(styleTree, null, 2);
12    let outPath = path.resolve(
13        `${__dirname}/../../crates/zed/assets/themes/${theme.name}.json`
14    );
15    fs.writeFileSync(outPath, styleTreeJSON);
16    console.log(`- ${outPath} created`);
17}