From 37f28f08e6d5e68fd650be9927b67361c18a3337 Mon Sep 17 00:00:00 2001 From: Tammo ter Hark Date: Sun, 22 Nov 2026 14:04:02 +0100 Subject: [PATCH] chore: stop tracking sass/ (developer-only sources, not in public repo) The .sass files are compiled locally to css/plain.css, which IS committed (LimeSurvey never compiles sass itself). sass/ is now gitignored and removed from the index; history is purged separately with git filter-repo. export_public.sh sync-guard now skips gracefully when sass/ is absent. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- .gitignore | 14 ++++++++++++++ variants/export_public.sh | 31 +++++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index bffefec..b2e808d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,17 @@ variants/README.internal.md # extra leak-check patterns for variants/export_public.sh (client names/terms/colors); # the canonical copy lives in the private repo respondage_vanilla_variants variants/leak-patterns.txt + +# Session prompt log (prompts used + results). Internal working notes — never commit, +# and export_public.sh excludes it from the public release. +prompts.md + +# Feature-request drafts for LimeSurvey core (English, well-substantiated) are +# internal too: never commit them to the public repo, and export_public.sh +# excludes them from the public release. +FEATURE_REQUEST*.md + +# sass/ sources are developer-only: they are compiled locally to css/plain.css +# (which IS committed). The .sass files themselves are not part of this repo +# and were purged from history with git filter-repo. +/sass/ diff --git a/variants/export_public.sh b/variants/export_public.sh index e8832f7..06cab1a 100644 --- a/variants/export_public.sh +++ b/variants/export_public.sh @@ -26,12 +26,39 @@ STAGE="$OUT_DIR/respondage_vanilla" VERSION="$(sed -n 's:.*\([^<]*\).*:\1:p' "$THEME_DIR/config.xml" | head -1)" ZIP_NAME="respondage_vanilla-${VERSION}-public.zip" +# 0. optional guard: css/plain.css must be in sync with sass/plain.sass. +# LimeSurvey serves the committed css/plain.css and NEVER compiles sass +# itself, so a stale compiled file would be shipped/served. If a sass +# compiler is on PATH AND the developer-local sass/ sources are present +# (sass/ is gitignored and NOT part of this repo), recompile to a temp +# file and compare; abort on drift. +if command -v sass >/dev/null 2>&1 && [ -f "$THEME_DIR/sass/plain.sass" ]; then + TMP_CSS="$(mktemp --suffix=.css)" + if sass --no-source-map "$THEME_DIR/sass/plain.sass" "$TMP_CSS" 2>/dev/null; then + # -B ignores blank-line-only changes (dart-sass adds one before the + # sourceMappingURL comment); strip that comment line: it contains the + # output file name and differs between the real and the temp output + if ! diff -qB <(sed '/sourceMappingURL/d' "$THEME_DIR/css/plain.css") <(sed '/sourceMappingURL/d' "$TMP_CSS") >/dev/null 2>&1; then + echo "ERROR: css/plain.css is stale relative to sass/plain.sass - aborting." >&2 + echo " Recompile in the theme dir, e.g.: sass sass/plain.sass css/plain.css" >&2 + echo " (a watcher like 'sass --watch sass/plain.sass css/plain.css' prevents this)" >&2 + echo " Commit the recompiled css/plain.css (+ .map); sass/ is developer-local and not committed." >&2 + rm -f "$TMP_CSS" + exit 1 + fi + fi + rm -f "$TMP_CSS" +else + echo "NOTE: 'sass' binary or local sass/ sources not present - skipped the css/plain.css sync check (sass/ is developer-local, gitignored)." >&2 +fi + rm -rf "$STAGE" mkdir -p "$STAGE" "$OUT_DIR" # 1. copy the theme, excluding .git, client variant definitions, the internal -# variants README and old exports (the generic build/export scripts are kept) -(cd "$THEME_DIR" && tar --exclude='./.git' --exclude='./dist' --exclude='./variants/*.json' --exclude='./variants/README.internal.md' --exclude='./variants/leak-patterns.txt' -cf - .) | (cd "$STAGE" && tar -xf -) +# variants README, feature-request drafts and old exports (the generic +# build/export scripts are kept) +(cd "$THEME_DIR" && tar --exclude='./.git' --exclude='./dist' --exclude='./variants/*.json' --exclude='./variants/README.internal.md' --exclude='./variants/leak-patterns.txt' --exclude='./FEATURE_REQUEST*.md' --exclude='./prompts.md' -cf - .) | (cd "$STAGE" && tar -xf -) # 2. leak check: no client-identifying strings may remain (text files only). # Client names are NOT hardcoded in this public file. Patterns are derived: