Files
ui/scripts/rebrand.sh
zeekayandGitHub 806fc0f0df decouple @hanzogui, standardize on 'pkgs/', etc (#228)
* refactor: decouple @hanzo/ui from hanzogui

  Make @hanzo/ui shadcn-only — no hanzogui/Tamagui coupling.

  - remove primitives/bases (gui/admin/svelte/vue) re-exports
  - drop @hanzogui peerDependencies + peerDependenciesMeta entries
  - add check-no-hanzogui guard, wired into build
  - fix latent NodeJS.Timeout types to keep the build green

* refactor: remove duplicate @hanzo/brand from the monorepo

  @hanzo/brand is owned by the standalone hanzoai/brand (the npm-canonical
  source); this monorepo's copy was unused and had drifted.

  - delete pkg/brand
  - add check-no-brand-pkg guard (wired into `check`) so it can't reappear

* refactor(ui): stop importing from the app; use own cn util

  pkg/ui pulled `cn` from @/lib/utils (../../app) — an inverted dependency on
  the consuming app. Point the animation components at pkg/ui's own cn and
  drop the @/app, @/registry, @/lib tsconfig path aliases.

* fix(ui): type errors; stop tracking the root lockfile

  - ModelCard: lucide-react dropped the Github icon → use Code
  - drawer: annotate DrawerTrigger/DrawerClose (radix type portability)
  - untrack root pnpm-lock.yaml; CI → --no-frozen-lockfile

* release: bump @hanzo/ui to 5.7.0

* refactor: rename pkg/ → pkgs/, merge packages/ into it

  standardize on 'pkgs/': move pkg/* and packages/* into pkgs/.
  Update workspace globs, CI, scripts, and config references accordingly.
2026-06-19 15:30:30 -10:00

114 lines
2.9 KiB
Bash
Executable File

#!/bin/bash
# Rebrand Script for White-Labeling the UI Library
# Usage: ./scripts/rebrand.sh <brand-name>
# Example: ./scripts/rebrand.sh luxfi
set -e
BRAND=$1
if [ -z "$BRAND" ]; then
echo "Usage: $0 <brand-name>"
echo "Available brands: luxfi, zoo"
exit 1
fi
echo "🎨 Rebranding for $BRAND..."
# Load brand configuration
case $BRAND in
"luxfi")
ORG_NAME="Lux Finance"
NPM_ORG="@luxfi"
GITHUB_ORG="luxfi"
DOMAIN="ui.lux.finance"
OLD_IMPORTS="@hanzo"
NEW_IMPORTS="@luxfi"
;;
"zoo")
ORG_NAME="Zoo NGO"
NPM_ORG="@zooai"
GITHUB_ORG="zooai"
DOMAIN="ui.zoo.ngo"
OLD_IMPORTS="@hanzo"
NEW_IMPORTS="@zooai"
;;
*)
echo "Unknown brand: $BRAND"
exit 1
;;
esac
echo "📦 Updating package.json files..."
# Update root package.json
if [ -f "package.json" ]; then
sed -i.bak "s/@hanzo/$NEW_IMPORTS/g" package.json
rm package.json.bak
fi
# Update app package.json
if [ -f "app/package.json" ]; then
sed -i.bak "s/@hanzo/$NEW_IMPORTS/g" app/package.json
sed -i.bak "s/\"name\": \"@hanzo\/ui-web\"/\"name\": \"$NPM_ORG\/ui-web\"/g" app/package.json
rm app/package.json.bak
fi
# Update pkgs/ui package.json
if [ -f "pkgs/ui/package.json" ]; then
sed -i.bak "s/@hanzo/$NEW_IMPORTS/g" pkgs/ui/package.json
sed -i.bak "s/\"name\": \"@hanzo\/ui\"/\"name\": \"$NPM_ORG\/ui\"/g" pkgs/ui/package.json
rm pkgs/ui/package.json.bak
fi
echo "🔄 Updating imports in source files..."
# Update all TypeScript/JavaScript imports
find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) \
-not -path "./node_modules/*" \
-not -path "./.next/*" \
-not -path "./out/*" \
-not -path "./.git/*" \
-exec sed -i.bak "s/$OLD_IMPORTS/$NEW_IMPORTS/g" {} \; \
-exec rm {}.bak \;
echo "🌐 Updating domain references..."
# Update next.config.mjs
if [ -f "app/next.config.mjs" ]; then
sed -i.bak "s/ui.hanzo.ai/$DOMAIN/g" app/next.config.mjs
rm app/next.config.mjs.bak
fi
# Update GitHub workflows
if [ -f ".github/workflows/deploy-pages.yml" ]; then
sed -i.bak "s/ui.hanzo.ai/$DOMAIN/g" .github/workflows/deploy-pages.yml
rm .github/workflows/deploy-pages.yml.bak
fi
echo "📝 Updating brand configuration..."
# Copy brand config
cp "brands/${BRAND}.brand.ts" "app/lib/brand.ts"
# Update site config
if [ -f "app/config/site.ts" ]; then
sed -i.bak "s/hanzoai/$GITHUB_ORG/g" app/config/site.ts
sed -i.bak "s/Hanzo/$ORG_NAME/g" app/config/site.ts
rm app/config/site.ts.bak
fi
echo "🎯 Updating GitHub repository settings..."
# Update repository description
gh repo edit --description "😎 $ORG_NAME UI Library for AI+Blockchain powered apps."
echo "✅ Rebranding complete for $BRAND!"
echo ""
echo "Next steps:"
echo "1. Commit the changes: git add -A && git commit -m 'rebrand: Update to $BRAND branding'"
echo "2. Push to repository: git push origin main"
echo "3. Set up GitHub Pages for $DOMAIN"
echo "4. Update NPM_AUTH_TOKEN secret in GitHub"
echo "5. Run deployment: make deploy"