Initial commit: add .gitignore and README
This commit is contained in:
52
migration/migrate-to-shared-packages.sh
Executable file
52
migration/migrate-to-shared-packages.sh
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Load shared libraries
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/../lib/init.sh"
|
||||
|
||||
# Script to help migrate projects to shared packages
|
||||
|
||||
set -e
|
||||
|
||||
echo "📦 Shared Packages Migration Helper"
|
||||
echo ""
|
||||
|
||||
# Check if pnpm is installed
|
||||
if ! command -v pnpm &> /dev/null; then
|
||||
echo "⚠️ pnpm not found. Install with: npm install -g pnpm"
|
||||
fi
|
||||
|
||||
# Check if we're in a project directory
|
||||
if [ ! -f "package.json" ]; then
|
||||
echo "⚠️ No package.json found in current directory"
|
||||
echo " → Navigate to a project directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "📋 Available shared packages:"
|
||||
echo " 1. @workspace/shared-types"
|
||||
echo " 2. @workspace/shared-auth"
|
||||
echo " 3. @workspace/shared-utils"
|
||||
echo " 4. @workspace/shared-config"
|
||||
echo " 5. @workspace/api-client"
|
||||
echo " 6. @workspace/validation"
|
||||
echo " 7. @workspace/blockchain"
|
||||
echo ""
|
||||
|
||||
# Check for workspace-shared
|
||||
if [ -d "../../workspace-shared" ]; then
|
||||
echo "✅ Shared packages found"
|
||||
else
|
||||
echo "⚠️ Shared packages not found"
|
||||
echo " → Check path to workspace-shared/"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "💡 Migration steps:"
|
||||
echo " 1. Install package: pnpm add @workspace/shared-types@workspace:*"
|
||||
echo " 2. Update imports in your code"
|
||||
echo " 3. Remove duplicate code"
|
||||
echo " 4. Test thoroughly"
|
||||
echo ""
|
||||
echo "📖 See docs/SHARED_PACKAGES_MIGRATION_GUIDE.md for detailed instructions"
|
||||
|
||||
Reference in New Issue
Block a user