Files
shadcn/scripts/sync-templates.sh
zeekay 05fc512820 feat: sync upstream shadcn/ui — [email protected], v4 app, font system, chart improvements
Upstream sync from shadcn-ui/ui (1686 commits since last merge base).

Key changes:
- packages/shadcn upgraded to 4.1.0 (CLI font transformers, scaffold from github, chart colors)
- apps/v4 replaces apps/www as the primary docs/registry app
- Font system: 25+ heading font registries, font markers utility, @supports override
- Chart improvements: recharts v3 compat, radial chart fixes
- templates/ updated with monorepo variants (astro, vite, react-router, start)
- skills/shadcn AI skill definitions added
- deprecated/ removed (auth, auth-firebase, cli, www)

Preserved Hanzo-only paths: app/, pkg/, demo/, docs/, template/next/
2026-03-24 19:04:31 -07:00

40 lines
1021 B
Bash
Executable File

#!/bin/bash
set -e # bail on errors
GLOB=$1
IS_CI="${CI:-false}"
BASE=$(pwd)
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
for folder in $GLOB; do
[ -d "$folder" ] || continue
cd $BASE
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "chore: update template"
git push origin main
fi
NAME=${folder##*/}
CLONE_DIR="__${NAME}__clone__"
# sync to read-only clones
# clone, delete files in the clone, and copy (new) files over
# this handles file deletions, additions, and changes seamlessly
# note: redirect output to dev/null to avoid any possibility of leaking token
git clone --quiet --depth 1 [email protected]:shadcn/${NAME}.git $CLONE_DIR > /dev/null
cd $CLONE_DIR
find . | grep -v ".git" | grep -v "^\.*$" | xargs rm -rf # delete all files (to handle deletions in monorepo)
cp -r $BASE/$folder/. .
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "$COMMIT_MESSAGE"
git push origin main
fi
cd $BASE
rm -rf $CLONE_DIR
done