diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-24 19:17:23 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-24 19:17:23 -0400 |
| commit | 9f2d432f506dd36bed503bfe684b116e07681141 (patch) | |
| tree | 1ccee6c143e706a1cb5b44cf8ad4ea6b6e17fb1b /scripts/theme-studio/generate.py | |
| parent | 120e589dd7e81c7203a5d5c050ba4b5089f553a6 (diff) | |
| download | dotemacs-9f2d432f506dd36bed503bfe684b116e07681141.tar.gz dotemacs-9f2d432f506dd36bed503bfe684b116e07681141.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.py | 4 |
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) |
