Root workspace configuration with 4 submodules: - codebase/ → lilith/platform-codebase - deployments/ → lilith/platform-deployments - tooling/ → lilith/platform-tooling - docs/ → lilith/platform-docs Tracks workspace config (package.json, turbo.json, bunfig.toml), CI workflows (.forgejo/), dev scripts, and instructions. Each submodule retains its own history and remote.
56 lines
1.4 KiB
Bash
Executable file
56 lines
1.4 KiB
Bash
Executable file
#!/bin/bash
|
|
# Migrate from pnpm to Bun package manager
|
|
# This script cleans node_modules and reinstalls with Bun
|
|
|
|
set -euo pipefail
|
|
|
|
CODEBASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../codebase" && pwd)"
|
|
|
|
echo "=== Bun Migration Script ==="
|
|
echo "Codebase: $CODEBASE_DIR"
|
|
echo ""
|
|
|
|
# Check if bun is available
|
|
if ! command -v bun &> /dev/null; then
|
|
echo "ERROR: Bun is not installed or not in PATH"
|
|
echo "Install with: curl -fsSL https://bun.sh/install | bash"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Bun version: $(bun --version)"
|
|
echo ""
|
|
|
|
# Backup check
|
|
if [[ ! -f "$CODEBASE_DIR/pnpm-lock.yaml.backup" ]]; then
|
|
echo "Creating backup of pnpm-lock.yaml..."
|
|
cp "$CODEBASE_DIR/pnpm-lock.yaml" "$CODEBASE_DIR/pnpm-lock.yaml.backup"
|
|
fi
|
|
|
|
echo "Cleaning node_modules..."
|
|
cd "$CODEBASE_DIR"
|
|
|
|
# Remove top-level node_modules first
|
|
if [[ -d "node_modules" ]]; then
|
|
rm -rf node_modules
|
|
echo " Removed: node_modules/"
|
|
fi
|
|
|
|
# Remove nested node_modules
|
|
echo " Cleaning nested node_modules (this may take a moment)..."
|
|
find . -type d -name node_modules -prune -exec rm -rf {} + 2>/dev/null || true
|
|
|
|
echo ""
|
|
echo "Installing with Bun..."
|
|
bun install
|
|
|
|
echo ""
|
|
echo "=== Migration Complete ==="
|
|
echo ""
|
|
echo "To verify:"
|
|
echo " ./run dev:status"
|
|
echo " ./run dev"
|
|
echo ""
|
|
echo "To rollback if needed:"
|
|
echo " rm -rf node_modules bun.lockb"
|
|
echo " mv pnpm-lock.yaml.backup pnpm-lock.yaml"
|
|
echo " pnpm install"
|