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

@@ -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"
}