Sync Large Table runtime to consuming portals
This commit is contained in:
1 parent
5134b61237
commit
09966cea10
2 files changed
+32
-1
No files matched your search
@@ -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`
|
||||
- die vollstaendige Styleguide-Dokumentation gespiegelt nach `docs/styleguide`
|
||||
- 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:
|
||||
|
||||
@@ -31,8 +32,10 @@ Beispiel:
|
||||
|
||||
- `public/assets/styleguide.upstream.css` aktualisiert
|
||||
- `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/scripts/large-table-column-resize.js` aktualisiert; lokale Portal-Kopien sind nicht zulässig
|
||||
- Optional: automatischer Commit + Push im Portalrepo
|
||||
|
||||
## Standardprozess je Release
|
||||
@@ -42,3 +45,18 @@ Beispiel:
|
||||
3. Styleguide commit + push
|
||||
4. Sync-Skript ausfuehren
|
||||
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)"
|
||||
STYLEGUIDE_REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
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"
|
||||
|
||||
PORTAL_CSS_REL="public/assets/styleguide.upstream.css"
|
||||
PORTAL_BUILT_CSS_REL="public/assets/styles.css"
|
||||
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_BUILD_SCRIPT_REL="scripts/styleguide/build_styles.sh"
|
||||
COMMIT_IN_PORTAL="false"
|
||||
@@ -52,6 +54,11 @@ if [[ ! -f "$VERSION_FILE" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -f "$SOURCE_LARGE_TABLE_RUNTIME" ]]; then
|
||||
echo "Large Table runtime not found: $SOURCE_LARGE_TABLE_RUNTIME" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
flatten_css() {
|
||||
local source_file="$1"
|
||||
local source_root="$2"
|
||||
@@ -110,6 +117,7 @@ sync_portal() {
|
||||
local portal_css_path="$portal_repo_path/$PORTAL_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_runtime_path="$portal_repo_path/$PORTAL_RUNTIME_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 tmp_portal_css
|
||||
@@ -120,18 +128,21 @@ sync_portal() {
|
||||
fi
|
||||
|
||||
mkdir -p "$(dirname "$portal_css_path")"
|
||||
mkdir -p "$(dirname "$portal_runtime_path")"
|
||||
mkdir -p "$portal_styleguide_docs_path"
|
||||
|
||||
tmp_portal_css="$(mktemp)"
|
||||
build_portal_css "$portal_key" "$TMP_UPSTREAM_CSS" "$tmp_portal_css"
|
||||
cp "$tmp_portal_css" "$portal_css_path"
|
||||
rm -f "$tmp_portal_css"
|
||||
cp "$SOURCE_LARGE_TABLE_RUNTIME" "$portal_runtime_path"
|
||||
|
||||
rsync -a --delete \
|
||||
--exclude ".git/" \
|
||||
--exclude ".codex/" \
|
||||
--exclude ".DS_Store" \
|
||||
--exclude "AGENTS.md" \
|
||||
--exclude "scripts/" \
|
||||
"$STYLEGUIDE_REPO_ROOT/" \
|
||||
"$portal_styleguide_docs_path/"
|
||||
|
||||
@@ -167,6 +178,7 @@ META
|
||||
"$PORTAL_CSS_REL" \
|
||||
"$PORTAL_BUILT_CSS_REL" \
|
||||
"$PORTAL_META_REL" \
|
||||
"$PORTAL_RUNTIME_REL" \
|
||||
"$PORTAL_STYLEGUIDE_DOCS_REL"
|
||||
if ! git -C "$portal_repo_path" diff --cached --quiet; then
|
||||
git -C "$portal_repo_path" commit -m "Sync styleguide $STYLEGUIDE_VERSION"
|
||||
@@ -181,6 +193,7 @@ META
|
||||
|
||||
echo "Synced $SOURCE_CSS -> $portal_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 "Mirrored styleguide docs: $portal_styleguide_docs_path"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user