aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/generate.py
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-24 19:17:23 -0400
committerCraig Jennings <c@cjennings.net>2026-06-24 19:17:23 -0400
commitd6b10d04b4d3f5a74bdb6beb001824b97fc98969 (patch)
tree1f04b3543403c59787b4bd6309196a4d961adf38 /scripts/theme-studio/generate.py
parent70c45532f6949e6e4b30d8db2b9b2ef831a11ebb (diff)
downloaddotemacs-d6b10d04b4d3f5a74bdb6beb001824b97fc98969.tar.gz
dotemacs-d6b10d04b4d3f5a74bdb6beb001824b97fc98969.zip
refactor(theme-studio): extract control factories to controls.js, drop dead previewFaceAttrs
I split the custom dropdown, detail-editor, and expander factories out of app.js into controls.js (205 lines), spliced back at a CONTROLS_J token by generate.py. The token sits at the exact extraction point, so the assembled page is byte-identical and every gate passes unchanged. app.js drops from 927 to 721 lines. I also removed previewFaceAttrs (function, export, and test). It was test-only dead code whose docstring stalely claimed the gate calls it. The gate uses assertPreviewFaces instead.
Diffstat (limited to 'scripts/theme-studio/generate.py')
-rw-r--r--scripts/theme-studio/generate.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/theme-studio/generate.py b/scripts/theme-studio/generate.py
index b673caefb..797fcc28e 100644
--- a/scripts/theme-studio/generate.py
+++ b/scripts/theme-studio/generate.py
@@ -133,6 +133,9 @@ if os.path.exists(os.path.join(HERE,_FONT_WOFF2)):
STYLES=STYLES.replace('url("%s")'%_FONT_WOFF2,
'url("data:font/woff2;base64,%s")'%_FONT_B64)
APP_BODY=read_text('app.js')
+# Custom dropdown / detail-editor / expander factories, split from app.js for
+# navigability and spliced in at the CONTROLS_J token. Raw (no imports/exports).
+CONTROLS_BODY=read_text('controls.js')
# Bespoke per-package preview renderers, spliced into the page <script> via the
# PREVIEWS_J token in app.js. No imports/exports, so read raw.
PREVIEWS_BODY=read_text('previews.js')
@@ -385,6 +388,7 @@ def _build():
def fill_data(s):
return (s.replace("COLORMATH_J",COLORMATH_BODY)
.replace("APP_CORE_J",APP_CORE_BODY)
+ .replace("CONTROLS_J",CONTROLS_BODY)
.replace("PREVIEWS_J",PREVIEWS_BODY)
.replace("APP_UTIL_J",APP_UTIL_BODY)
.replace("PALETTE_GENERATOR_CORE_J",PALETTE_GENERATOR_CORE_BODY)