aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-13 15:21:04 -0500
committerCraig Jennings <c@cjennings.net>2026-06-13 15:21:04 -0500
commitc636bc94cb0aef7eaa8370e453abe86a026110da (patch)
treefc863dd9bf28e771e0fd04506c2ef07e0c4a9dc3 /scripts/theme-studio
parent601396bb6384ae6d1634137df4252896b35261df (diff)
downloaddotemacs-c636bc94cb0aef7eaa8370e453abe86a026110da.tar.gz
dotemacs-c636bc94cb0aef7eaa8370e453abe86a026110da.zip
Add theme studio generated file check
Diffstat (limited to 'scripts/theme-studio')
-rw-r--r--scripts/theme-studio/Makefile11
-rw-r--r--scripts/theme-studio/README.md2
2 files changed, 12 insertions, 1 deletions
diff --git a/scripts/theme-studio/Makefile b/scripts/theme-studio/Makefile
index a7455b3d..6cf48f66 100644
--- a/scripts/theme-studio/Makefile
+++ b/scripts/theme-studio/Makefile
@@ -13,7 +13,7 @@ HERE := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
# Optional palette seed for `gen` / `open`: make gen SEED=dupre.json
SEED ?=
-.PHONY: help test check coverage gen open
+.PHONY: help test check check-generated coverage gen open
.DEFAULT_GOAL := help
@@ -21,6 +21,7 @@ help:
@echo "theme-studio targets:"
@echo " make test - Full suite: Python + Node + browser hash gates"
@echo " make check - Fast gate: regenerate + Python + Node (no browser)"
+ @echo " make check-generated - Verify committed theme-studio.html is current"
@echo " make coverage - JS (node) + generate.py (uvx coverage) numbers"
@echo " make gen [SEED=x.json] - Regenerate theme-studio.html (optionally from a seed)"
@echo " make open [SEED=x.json] - Regenerate and open the page in Chrome"
@@ -31,6 +32,14 @@ test:
check:
@./run-tests.sh --no-browser
+check-generated:
+ @tmp="$$(mktemp)"; \
+ cp theme-studio.html "$$tmp"; \
+ restore() { cp "$$tmp" theme-studio.html; rm -f "$$tmp"; }; \
+ if ! python3 generate.py >/dev/null; then restore; exit 1; fi; \
+ if cmp -s theme-studio.html "$$tmp"; then rm -f "$$tmp"; echo "theme-studio.html is current"; \
+ else restore; echo "theme-studio.html is stale; run make gen and commit it" >&2; exit 1; fi
+
coverage:
@echo "== JS coverage (node --experimental-test-coverage) =="
@node --test --experimental-test-coverage ./*.mjs 2>/dev/null \
diff --git a/scripts/theme-studio/README.md b/scripts/theme-studio/README.md
index 77ff3a45..a5bf80fd 100644
--- a/scripts/theme-studio/README.md
+++ b/scripts/theme-studio/README.md
@@ -62,6 +62,8 @@ Node; the DOM glue is covered by the browser hash gates.
- `build-inventory.el` — refreshes `package-inventory.json` from a running
Emacs.
- `theme-studio.html` — generated output. Regenerate; don't hand-edit.
+ Use `make check-generated` before review if you want to verify the committed
+ page matches the generator without leaving the tree dirty.
## What it captures