feat!: rename theme respondage_vanilla -> vanilla_respondage, variants -> respondage_<client>
Prompt V (prompts.md rows 51-54). Mother theme folder + <name> renamed to vanilla_respondage (version 3.3.0); client variants renamed to respondage_defensie / respondage_erasmus (<extends>vanilla_respondage</extends>, auto-derived by build.php). export_public.sh now derives the release name from the theme dir and the leak-check glob matches ../respondage_* siblings, so the public-release leak check keeps working after the rename (sabotage-tested). All doc/tooling references updated; local-only files stay gitignored. Also includes the pending uncommitted theme work from this testing week (custom options page, header logos, sticky-header options, bundled OFL fonts, per-element font overrides, font-dropdown reordering, jsdom tests) that was verified locally but not yet pushed. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
37f28f08e6
commit
cffd3cefa6
1 changed files with 3701 additions and 898 deletions
|
|
@ -1,101 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Build a PUBLIC release of the mother theme (respondage_vanilla) only.
|
||||
#
|
||||
# Client data (variant definitions variants/*.json, generated client theme
|
||||
# folders, git branches containing a client theme) must NEVER be published.
|
||||
# This script therefore:
|
||||
# 1. copies the theme WITHOUT .git, WITHOUT variants/*.json (only the
|
||||
# generic build.php and export script are kept) and without old exports;
|
||||
# 2. scans the staged copy for client-identifying strings and ABORTS if any
|
||||
# are found;
|
||||
# 3. creates a zip next to the folder.
|
||||
#
|
||||
# Usage:
|
||||
# bash variants/export_public.sh [output-dir]
|
||||
#
|
||||
# Default output dir: <limesurvey-root>/dist (deliberately NOT inside
|
||||
# upload/themes/survey/, because every folder there is scanned as a theme).
|
||||
#
|
||||
set -euo pipefail
|
||||
|
||||
THEME_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
SITE_ROOT="$(cd "$THEME_DIR/../../../.." && pwd)"
|
||||
OUT_DIR="${1:-$SITE_ROOT/dist}"
|
||||
STAGE="$OUT_DIR/respondage_vanilla"
|
||||
VERSION="$(sed -n 's:.*<version>\([^<]*\)</version>.*:\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, 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:
|
||||
# - the names of sibling variant theme folders (../<name>_vanilla next to
|
||||
# this theme, excluding this theme itself);
|
||||
# - extra patterns (names, terms, hex colors) from variants/leak-patterns.txt,
|
||||
# one regex per line. That file is gitignored here and lives in the PRIVATE
|
||||
# variants repository (respondage_vanilla_variants).
|
||||
PATTERNS=""
|
||||
MOTHER_NAME="$(basename "$THEME_DIR")"
|
||||
for d in "$THEME_DIR"/../*_vanilla; do
|
||||
[ -d "$d" ] || continue
|
||||
name="$(basename "$d")"
|
||||
[ "$name" = "$MOTHER_NAME" ] && continue
|
||||
PATTERNS="$PATTERNS|$name"
|
||||
done
|
||||
if [ -f "$THEME_DIR/variants/leak-patterns.txt" ]; then
|
||||
while IFS= read -r line; do
|
||||
case "$line" in ''|\#*) continue ;; esac
|
||||
PATTERNS="$PATTERNS|$line"
|
||||
done < "$THEME_DIR/variants/leak-patterns.txt"
|
||||
fi
|
||||
PATTERNS="${PATTERNS#|}"
|
||||
if [ -n "$PATTERNS" ] && grep -rIlE "$PATTERNS" "$STAGE"; then
|
||||
echo "ERROR: client-identifying strings found in the public export - aborting, staging removed." >&2
|
||||
echo "(patterns came from sibling *_vanilla folders and variants/leak-patterns.txt)" >&2
|
||||
rm -rf "$STAGE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 3. zip it
|
||||
(cd "$OUT_DIR" && rm -f "$ZIP_NAME" && zip -qr "$ZIP_NAME" respondage_vanilla)
|
||||
|
||||
echo "Public release created:"
|
||||
echo " folder: $STAGE"
|
||||
echo " zip: $OUT_DIR/$ZIP_NAME"
|
||||
echo
|
||||
echo "Publish ONLY this artifact (or the main branch of this repo)."
|
||||
echo "NEVER publish variants/*.json, generated client theme folders, or a git"
|
||||
echo "branch that contains a client theme - client names, colors and logos are confidential."
|
||||
Loading…
Reference in a new issue