Initial commit: add .gitignore and README

This commit is contained in:
defiQUG
2026-02-09 21:51:52 -08:00
commit 5d47b3a5d9
49 changed files with 5633 additions and 0 deletions

137
dbis/automate-dbis-migration.sh Executable file
View File

@@ -0,0 +1,137 @@
#!/bin/bash
# Load shared libraries
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../lib/init.sh"
# Automated script to help migrate DBIS projects to monorepo
set -e
PROJECT_NAME="${1:-}"
MONOREPO_PATH="${2:-dbis_monorepo}"
TARGET_DIR="${3:-packages}"
if [ -z "$PROJECT_NAME" ]; then
echo "📦 DBIS Project Migration Automation"
echo ""
echo "Usage: $0 <project-name> [monorepo-path] [target-dir]"
echo ""
echo "Example: $0 dbis_core dbis_monorepo packages"
echo ""
echo "This script automates the migration of a DBIS project to the monorepo."
exit 1
fi
SOURCE_PATH="../${PROJECT_NAME}"
TARGET_PATH="${MONOREPO_PATH}/${TARGET_DIR}/${PROJECT_NAME}"
echo "📦 Migrating $PROJECT_NAME to DBIS monorepo..."
# Check if source project exists
if [ ! -d "$SOURCE_PATH" ]; then
echo "❌ Source project not found: $SOURCE_PATH"
exit 1
fi
# Check if monorepo exists
if [ ! -d "$MONOREPO_PATH" ]; then
echo "❌ Monorepo not found: $MONOREPO_PATH"
exit 1
fi
# Create target directory
echo "📁 Creating target directory..."
mkdir -p "$TARGET_PATH"
# Copy project files (excluding node_modules, .git, etc.)
echo "📋 Copying project files..."
rsync -av --exclude='node_modules' \
--exclude='.git' \
--exclude='dist' \
--exclude='build' \
--exclude='.next' \
--exclude='coverage' \
--exclude='.turbo' \
"$SOURCE_PATH/" "$TARGET_PATH/"
# Update package.json
if [ -f "$TARGET_PATH/package.json" ]; then
echo "📝 Updating package.json..."
# Create backup
cp "$TARGET_PATH/package.json" "$TARGET_PATH/package.json.bak"
# Update package name
if command -v jq &> /dev/null; then
jq ".name = \"@dbis/${PROJECT_NAME}\"" "$TARGET_PATH/package.json" > "$TARGET_PATH/package.json.tmp"
mv "$TARGET_PATH/package.json.tmp" "$TARGET_PATH/package.json"
else
echo "⚠️ jq not found, please manually update package.json name to @dbis/${PROJECT_NAME}"
fi
# Update dependencies to use workspace packages
echo "📝 Updating dependencies to use workspace packages..."
# This would need more sophisticated logic, but provides guidance
echo " → Review and update dependencies to use @dbis/* and @workspace/* packages"
fi
# Create migration notes
cat > "$TARGET_PATH/MIGRATION_NOTES.md" << EOF
# Migration Notes for ${PROJECT_NAME}
**Migrated**: $(date)
**Source**: ${SOURCE_PATH}
**Target**: ${TARGET_PATH}
## Changes Made
1. Project copied to monorepo
2. Package name updated to @dbis/${PROJECT_NAME}
3. Dependencies need manual review
## Next Steps
1. Review and update package.json dependencies:
- Replace local packages with @dbis/* packages
- Replace common packages with @workspace/* packages
2. Update imports:
- Update relative imports
- Use @dbis/* and @workspace/* packages
3. Update CI/CD:
- Remove individual CI/CD configs
- Use monorepo CI/CD
4. Test:
- Run \`pnpm install\` in monorepo root
- Run \`pnpm build\` to verify build
- Run \`pnpm test\` to verify tests
5. Update documentation:
- Update README
- Update any project-specific docs
## Verification
- [ ] Package.json updated
- [ ] Dependencies updated
- [ ] Imports updated
- [ ] Build successful
- [ ] Tests passing
- [ ] Documentation updated
EOF
echo "✅ Migration automation complete!"
echo ""
echo "📝 Project copied to: $TARGET_PATH"
echo "📝 Migration notes created: $TARGET_PATH/MIGRATION_NOTES.md"
echo ""
echo "📋 Next steps:"
echo " 1. Review $TARGET_PATH/MIGRATION_NOTES.md"
echo " 2. Update package.json dependencies"
echo " 3. Update imports"
echo " 4. Test build and tests"
echo " 5. Update documentation"

View File

@@ -0,0 +1,66 @@
#!/bin/bash
# Load shared libraries
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../lib/init.sh"
# Script to migrate all DBIS projects to monorepo
set -e
MONOREPO_PATH="${1:-dbis_monorepo}"
echo "📦 Migrating all DBIS projects to monorepo..."
# List of DBIS projects to migrate
DBIS_PROJECTS=(
"dbis_core"
"smom-dbis-138"
"dbis_docs"
"dbis_portal"
"dbis_dc_tools"
)
# Check if monorepo exists
if [ ! -d "$MONOREPO_PATH" ]; then
echo "❌ Monorepo not found: $MONOREPO_PATH"
exit 1
fi
echo "📋 Projects to migrate:"
for project in "${DBIS_PROJECTS[@]}"; do
echo " - $project"
done
echo ""
read -p "Continue with migration? (y/N) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Migration cancelled."
exit 1
fi
# Migrate each project
for project in "${DBIS_PROJECTS[@]}"; do
echo ""
echo "📦 Migrating $project..."
if [ -d "../$project" ]; then
./scripts/automate-dbis-migration.sh "$project" "$MONOREPO_PATH" packages
else
echo "⚠️ Project not found: ../$project (skipping)"
fi
done
echo ""
echo "✅ All DBIS projects migration complete!"
echo ""
echo "📝 Next steps:"
echo " 1. Review all MIGRATION_NOTES.md files"
echo " 2. Update dependencies in all projects"
echo " 3. Update imports in all projects"
echo " 4. Run 'pnpm install' in monorepo root"
echo " 5. Run 'pnpm build' to verify builds"
echo " 6. Run 'pnpm test' to verify tests"
echo " 7. Update documentation"

64
dbis/migrate-dbis-project.sh Executable file
View File

@@ -0,0 +1,64 @@
#!/bin/bash
# Load shared libraries
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../lib/init.sh"
# Script to help migrate a DBIS project to monorepo
set -e
PROJECT_NAME="${1:-}"
MONOREPO_PATH="${2:-dbis_monorepo}"
if [ -z "$PROJECT_NAME" ]; then
echo "📦 DBIS Project Migration Helper"
echo ""
echo "Usage: $0 <project-name> [monorepo-path]"
echo ""
echo "Example: $0 dbis_core"
echo ""
echo "This script helps migrate a DBIS project to the monorepo."
exit 1
fi
echo "📦 Migrating $PROJECT_NAME to DBIS monorepo..."
# Check if project exists
if [ ! -d "../$PROJECT_NAME" ]; then
echo "❌ Project not found: ../$PROJECT_NAME"
exit 1
fi
# Check if monorepo exists
if [ ! -d "../$MONOREPO_PATH" ]; then
echo "⚠️ Monorepo not found: ../$MONOREPO_PATH"
echo " → Create monorepo first or specify correct path"
exit 1
fi
echo "📝 Migration steps for $PROJECT_NAME:"
echo ""
echo "1. Copy project to monorepo:"
echo " cp -r ../$PROJECT_NAME ../$MONOREPO_PATH/packages/$PROJECT_NAME"
echo ""
echo "2. Update package.json:"
echo " - Update name to @dbis/$PROJECT_NAME"
echo " - Update dependencies"
echo " - Add workspace protocol for shared packages"
echo ""
echo "3. Update imports:"
echo " - Replace local imports with shared packages"
echo " - Update relative paths"
echo ""
echo "4. Update CI/CD:"
echo " - Remove individual CI/CD configs"
echo " - Use monorepo CI/CD"
echo ""
echo "5. Test:"
echo " - Run tests"
echo " - Verify build"
echo " - Check integrations"
echo ""
echo "📖 See docs/DBIS_MIGRATION_CHECKLIST.md for detailed checklist"

56
dbis/test-dbis-migration.sh Executable file
View File

@@ -0,0 +1,56 @@
#!/bin/bash
# Load shared libraries
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../lib/init.sh"
# Test DBIS monorepo migration
set -e
MONOREPO_PATH="${1:-dbis_monorepo}"
echo "🧪 Testing DBIS monorepo migration..."
if [ ! -d "$MONOREPO_PATH" ]; then
echo "❌ Monorepo not found: $MONOREPO_PATH"
exit 1
fi
cd "$MONOREPO_PATH"
# Check prerequisites
command -v pnpm >/dev/null 2>&1 || { echo "❌ pnpm not found"; exit 1; }
command -v node >/dev/null 2>&1 || { echo "❌ node not found"; exit 1; }
echo "✅ Prerequisites check passed"
# Install dependencies
echo "📦 Installing dependencies..."
pnpm install --frozen-lockfile
# Build packages
echo "🔨 Building packages..."
pnpm build
# Run type check
echo "🔍 Running type check..."
pnpm type-check
# Run lint
echo "🧹 Running linter..."
pnpm lint
# Run tests (if any)
echo "🧪 Running tests..."
pnpm test || echo "⚠️ No tests found (this is OK for initial setup)"
echo ""
echo "✅ DBIS monorepo migration test complete!"
echo ""
echo "📝 Next steps:"
echo " 1. Migrate projects to monorepo"
echo " 2. Update imports to use shared packages"
echo " 3. Test each migrated project"
echo " 4. Update CI/CD configurations"