zed/styles/buildThemes.ts
Nathan Sobo 93c0c2af0a Start loading new theme JSON format instead of TOML
Replaced remaining extends with javascript object extension.
Moved tokens/core.ts to tokens.ts and massaged the types to make it more
obvious when types don't match up.

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-04-01 13:34:39 -07:00

17 lines
579 B
TypeScript

import * as fs from "fs";
import * as path from "path";
import dark from "./themes/dark";
import light from "./themes/light";
import app from "./styleTree/app";
import decamelizeTree from "./utils/decamelizeTree";
const themes = [dark, light];
for (let theme of themes) {
let styleTree = decamelizeTree(app(theme));
let styleTreeJSON = JSON.stringify(styleTree, null, 2);
let outPath = path.resolve(
`${__dirname}/../crates/zed/assets/themes/${theme.name}.json`
);
fs.writeFileSync(outPath, styleTreeJSON);
console.log(`Generated ${outPath}`);
}