prod-wag-backend-automate-s.../WebServices/management-frontend/setup-shadcn.sh

47 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
# Exit on error
set -e
echo "🚀 Setting up shadcn/ui components and dependencies..."
# Install required dependencies for shadcn
echo "📦 Installing required dependencies..."
npm install tailwindcss-animate class-variance-authority clsx tailwind-merge --legacy-peer-deps
# Initialize shadcn/ui (components.json already exists, so we'll skip this step)
echo "✅ components.json already exists"
# Set npm config to use legacy-peer-deps for all npm operations
echo "🔧 Setting npm to use legacy-peer-deps..."
npm config set legacy-peer-deps true
# Install base components
echo "🧩 Installing base shadcn/ui components..."
npx shadcn@latest add button --yes
npx shadcn@latest add form --yes
npx shadcn@latest add input --yes
npx shadcn@latest add label --yes
npx shadcn@latest add select --yes
npx shadcn@latest add checkbox --yes
npx shadcn@latest add card --yes
npx shadcn@latest add dialog --yes
npx shadcn@latest add popover --yes
npx shadcn@latest add sonner --yes
npx shadcn@latest add table --yes
npx shadcn@latest add pagination --yes
npx shadcn@latest add calendar --yes
npx shadcn@latest add date-picker --yes
# Update any dependencies with legacy peer deps
echo "🔄 Updating dependencies..."
npm install --legacy-peer-deps
npm install next-crypto@^1.0.8 --legacy-peer-deps
npm install flatpickr@^4.6.13 --legacy-peer-deps
npm install date-fns@^4.1.0 --legacy-peer-deps
npm install react-day-picker@^8.10.1 --legacy-peer-deps
npm install lucide/react --legacy-peer-deps
echo "✨ Setup complete! You can now use shadcn/ui components in your project."
echo "📚 Documentation: https://ui.shadcn.com/docs"