Sync Large Table runtime to consuming portals

This commit is contained in:
gitea_admin committed 2026-09-27 08:25:12 +02:00
1 parent 5134b61237
commit 09966cea10
2 files changed
+32 -1

No files matched your search

+19 -1
View File
@@ -7,6 +7,7 @@ Der Styleguide bleibt in diesem Repository die Source of Truth. Der Sync verteil
- den deploy-relevanten CSS-Upstream versioniert als `public/assets/styleguide.upstream.css` - den deploy-relevanten CSS-Upstream versioniert als `public/assets/styleguide.upstream.css`
- die vollstaendige Styleguide-Dokumentation gespiegelt nach `docs/styleguide` - die vollstaendige Styleguide-Dokumentation gespiegelt nach `docs/styleguide`
- die portal-spezifische Fertig-CSS-Datei als `public/assets/styles.css` - die portal-spezifische Fertig-CSS-Datei als `public/assets/styles.css`
- die konsumierbare Large-Table-Runtime als `public/scripts/large-table-column-resize.js`
Zielrepos: Zielrepos:
@@ -31,8 +32,10 @@ Beispiel:
- `public/assets/styleguide.upstream.css` aktualisiert - `public/assets/styleguide.upstream.css` aktualisiert
- `public/assets/styleguide.upstream.meta.json` aktualisiert (Version, Commit, Zeitstempel) - `public/assets/styleguide.upstream.meta.json` aktualisiert (Version, Commit, Zeitstempel)
- `docs/styleguide` gespiegelt (mit `--delete`, ohne `.git`, `.codex`, `AGENTS.md`, `scripts/`) - `docs/styleguide` gespiegelt (mit `--delete`, ohne `.git`, `.codex`, `AGENTS.md` und interne `scripts/`)
- `public/scripts/large-table-column-resize.js` aus der Styleguide-Source-of-Truth kopiert
- `public/assets/styles.css` aktualisiert - `public/assets/styles.css` aktualisiert
- `public/scripts/large-table-column-resize.js` aktualisiert; lokale Portal-Kopien sind nicht zulässig
- Optional: automatischer Commit + Push im Portalrepo - Optional: automatischer Commit + Push im Portalrepo
## Standardprozess je Release ## Standardprozess je Release
@@ -42,3 +45,18 @@ Beispiel:
3. Styleguide commit + push 3. Styleguide commit + push
4. Sync-Skript ausfuehren 4. Sync-Skript ausfuehren
5. Beide Portalrepos Smoke-Testen 5. Beide Portalrepos Smoke-Testen
## Large-Table-Runtime
Die Runtime liegt ausschließlich im Styleguide unter `scripts/large-table-column-resize.js`.
Der Sync kopiert nur diese explizit freigegebene Runtime nach `public/scripts/`; andere
Styleguide-Scripts wie Prüf- und Sync-Shellscripts werden nicht in `docs/styleguide/scripts/`
gespiegelt. Dadurch bleibt der Styleguide die Source of Truth und ein erneuter Sync
überschreibt die Portaldatei kontrolliert.
Für den Smoke-Test in beiden Portalen ist zu prüfen:
- `public/scripts/large-table-column-resize.js` ist vorhanden und unter `/scripts/large-table-column-resize.js` ladbar.
- Die Large-Table-Seite lädt die Runtime ohne lokale Inline- oder Duplikatimplementierung.
- Nach einer Spaltenbreitenänderung wird der Eintrag unter `sg:large-table:column-widths:<key>` gespeichert.
- Ein erneuter Sync ersetzt die Datei aus der Styleguide-Quelle.
@@ -4,11 +4,13 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
STYLEGUIDE_REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" STYLEGUIDE_REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
SOURCE_CSS="$STYLEGUIDE_REPO_ROOT/styleguide.css" SOURCE_CSS="$STYLEGUIDE_REPO_ROOT/styleguide.css"
SOURCE_LARGE_TABLE_RUNTIME="$STYLEGUIDE_REPO_ROOT/scripts/large-table-column-resize.js"
VERSION_FILE="$STYLEGUIDE_REPO_ROOT/VERSION" VERSION_FILE="$STYLEGUIDE_REPO_ROOT/VERSION"
PORTAL_CSS_REL="public/assets/styleguide.upstream.css" PORTAL_CSS_REL="public/assets/styleguide.upstream.css"
PORTAL_BUILT_CSS_REL="public/assets/styles.css" PORTAL_BUILT_CSS_REL="public/assets/styles.css"
PORTAL_META_REL="public/assets/styleguide.upstream.meta.json" PORTAL_META_REL="public/assets/styleguide.upstream.meta.json"
PORTAL_RUNTIME_REL="public/scripts/large-table-column-resize.js"
PORTAL_STYLEGUIDE_DOCS_REL="docs/styleguide" PORTAL_STYLEGUIDE_DOCS_REL="docs/styleguide"
PORTAL_BUILD_SCRIPT_REL="scripts/styleguide/build_styles.sh" PORTAL_BUILD_SCRIPT_REL="scripts/styleguide/build_styles.sh"
COMMIT_IN_PORTAL="false" COMMIT_IN_PORTAL="false"
@@ -52,6 +54,11 @@ if [[ ! -f "$VERSION_FILE" ]]; then
exit 1 exit 1
fi fi
if [[ ! -f "$SOURCE_LARGE_TABLE_RUNTIME" ]]; then
echo "Large Table runtime not found: $SOURCE_LARGE_TABLE_RUNTIME" >&2
exit 1
fi
flatten_css() { flatten_css() {
local source_file="$1" local source_file="$1"
local source_root="$2" local source_root="$2"
@@ -110,6 +117,7 @@ sync_portal() {
local portal_css_path="$portal_repo_path/$PORTAL_CSS_REL" local portal_css_path="$portal_repo_path/$PORTAL_CSS_REL"
local portal_built_css_path="$portal_repo_path/$PORTAL_BUILT_CSS_REL" local portal_built_css_path="$portal_repo_path/$PORTAL_BUILT_CSS_REL"
local portal_meta_path="$portal_repo_path/$PORTAL_META_REL" local portal_meta_path="$portal_repo_path/$PORTAL_META_REL"
local portal_runtime_path="$portal_repo_path/$PORTAL_RUNTIME_REL"
local portal_styleguide_docs_path="$portal_repo_path/$PORTAL_STYLEGUIDE_DOCS_REL" local portal_styleguide_docs_path="$portal_repo_path/$PORTAL_STYLEGUIDE_DOCS_REL"
local portal_build_script_path="$portal_repo_path/$PORTAL_BUILD_SCRIPT_REL" local portal_build_script_path="$portal_repo_path/$PORTAL_BUILD_SCRIPT_REL"
local tmp_portal_css local tmp_portal_css
@@ -120,18 +128,21 @@ sync_portal() {
fi fi
mkdir -p "$(dirname "$portal_css_path")" mkdir -p "$(dirname "$portal_css_path")"
mkdir -p "$(dirname "$portal_runtime_path")"
mkdir -p "$portal_styleguide_docs_path" mkdir -p "$portal_styleguide_docs_path"
tmp_portal_css="$(mktemp)" tmp_portal_css="$(mktemp)"
build_portal_css "$portal_key" "$TMP_UPSTREAM_CSS" "$tmp_portal_css" build_portal_css "$portal_key" "$TMP_UPSTREAM_CSS" "$tmp_portal_css"
cp "$tmp_portal_css" "$portal_css_path" cp "$tmp_portal_css" "$portal_css_path"
rm -f "$tmp_portal_css" rm -f "$tmp_portal_css"
cp "$SOURCE_LARGE_TABLE_RUNTIME" "$portal_runtime_path"
rsync -a --delete \ rsync -a --delete \
--exclude ".git/" \ --exclude ".git/" \
--exclude ".codex/" \ --exclude ".codex/" \
--exclude ".DS_Store" \ --exclude ".DS_Store" \
--exclude "AGENTS.md" \ --exclude "AGENTS.md" \
--exclude "scripts/" \
"$STYLEGUIDE_REPO_ROOT/" \ "$STYLEGUIDE_REPO_ROOT/" \
"$portal_styleguide_docs_path/" "$portal_styleguide_docs_path/"
@@ -167,6 +178,7 @@ META
"$PORTAL_CSS_REL" \ "$PORTAL_CSS_REL" \
"$PORTAL_BUILT_CSS_REL" \ "$PORTAL_BUILT_CSS_REL" \
"$PORTAL_META_REL" \ "$PORTAL_META_REL" \
"$PORTAL_RUNTIME_REL" \
"$PORTAL_STYLEGUIDE_DOCS_REL" "$PORTAL_STYLEGUIDE_DOCS_REL"
if ! git -C "$portal_repo_path" diff --cached --quiet; then if ! git -C "$portal_repo_path" diff --cached --quiet; then
git -C "$portal_repo_path" commit -m "Sync styleguide $STYLEGUIDE_VERSION" git -C "$portal_repo_path" commit -m "Sync styleguide $STYLEGUIDE_VERSION"
@@ -181,6 +193,7 @@ META
echo "Synced $SOURCE_CSS -> $portal_css_path" echo "Synced $SOURCE_CSS -> $portal_css_path"
echo "Built portal stylesheet: $portal_built_css_path" echo "Built portal stylesheet: $portal_built_css_path"
echo "Synced Large Table runtime: $portal_runtime_path"
echo "Metadata written: $portal_meta_path" echo "Metadata written: $portal_meta_path"
echo "Mirrored styleguide docs: $portal_styleguide_docs_path" echo "Mirrored styleguide docs: $portal_styleguide_docs_path"
} }