themes.ts
1import fs from "fs";
2import path from "path";
3import Theme from "./themes/common/theme";
4
5const themes: Theme[] = [];
6export default themes;
7
8const themesPath = path.resolve(`${__dirname}/themes`);
9for (const fileName of fs.readdirSync(themesPath)) {
10 const filePath = path.join(themesPath, fileName);
11 if (fs.statSync(filePath).isFile()) {
12 const theme = require(filePath);
13 themes.push(theme.dark);
14 themes.push(theme.light);
15 }
16}