From da6fcb297a009d323a67ba5fbfb9dfb03a46ad43 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 2 Apr 2023 15:17:30 +1200 Subject: [PATCH] Compile list of available themes during build --- scripts/buildHomebrew.js | 14 ++++++ themes/codeMirror/editorThemes.json | 68 +++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 themes/codeMirror/editorThemes.json diff --git a/scripts/buildHomebrew.js b/scripts/buildHomebrew.js index 8646ab0ff..2255ca69e 100644 --- a/scripts/buildHomebrew.js +++ b/scripts/buildHomebrew.js @@ -101,7 +101,21 @@ fs.emptyDirSync('./build'); //v==---------------------------MOVE CM EDITOR THEMES -----------------------------==v// + editorThemeFiles = fs.readdirSync('./node_modules/codemirror/theme'); + + const editorThemeFile = './themes/codeMirror/editorThemes.json'; + if(fs.existsSync(editorThemeFile)) fs.rmSync(editorThemeFile); + const stream = fs.createWriteStream(editorThemeFile, { flags: 'a' }); + stream.write('[\n'); + + for (themeFile of editorThemeFiles) { + stream.write(`"${themeFile.slice(0, -4)}",\n`); + } + stream.write('"default"\n]\n'); + stream.end(); + await fs.copy('./node_modules/codemirror/theme', './build/homebrew/cm-themes'); + // await fs.copy('./themes/codeMirror', './build/themes/codeMirror'); //v==----------------------------- BUNDLE PACKAGES --------------------------------==v// diff --git a/themes/codeMirror/editorThemes.json b/themes/codeMirror/editorThemes.json new file mode 100644 index 000000000..c94cd29cf --- /dev/null +++ b/themes/codeMirror/editorThemes.json @@ -0,0 +1,68 @@ +[ +"3024-day", +"3024-night", +"abbott", +"abcdef", +"ambiance-mobile", +"ambiance", +"ayu-dark", +"ayu-mirage", +"base16-dark", +"base16-light", +"bespin", +"blackboard", +"cobalt", +"colorforth", +"darcula", +"dracula", +"duotone-dark", +"duotone-light", +"eclipse", +"elegant", +"erlang-dark", +"gruvbox-dark", +"hopscotch", +"icecoder", +"idea", +"isotope", +"juejin", +"lesser-dark", +"liquibyte", +"lucario", +"material-darker", +"material-ocean", +"material-palenight", +"material", +"mbo", +"mdn-like", +"midnight", +"monokai", +"moxer", +"neat", +"neo", +"night", +"nord", +"oceanic-next", +"panda-syntax", +"paraiso-dark", +"paraiso-light", +"pastel-on-dark", +"railscasts", +"rubyblue", +"seti", +"shadowfox", +"solarized", +"ssms", +"the-matrix", +"tomorrow-night-bright", +"tomorrow-night-eighties", +"ttcn", +"twilight", +"vibrant-ink", +"xq-dark", +"xq-light", +"yeti", +"yonce", +"zenburn", +"default" +]