diff --git a/scripts/build-all.ps1 b/scripts/build-all.ps1 deleted file mode 100644 index 338dff6..0000000 --- a/scripts/build-all.ps1 +++ /dev/null @@ -1,125 +0,0 @@ -# Build All Script for Stock Bot -# Builds libraries first, then apps with Turbo, then dashboard with Angular CLI - -param( - [switch]$Clean, - [switch]$Verbose -) - -$ErrorActionPreference = "Stop" - -Write-Host "๐Ÿš€ Starting complete build process..." -ForegroundColor Cyan - -# Store original location -$originalLocation = Get-Location - -# Find git root directory -try { - $gitRoot = git rev-parse --show-toplevel 2>$null - if ($LASTEXITCODE -ne 0) { - throw "Not in git repository" - } - # Convert Unix-style path to Windows if needed (for WSL/Git Bash compatibility) - if ($IsWindows -and $gitRoot -match "^/") { - $gitRoot = $gitRoot -replace "/", "\" - } -} catch { - Write-Host "Error: Not in a git repository. Please run this script from within the stock-bot git repository." -ForegroundColor Red - Set-Location $originalLocation - exit 1 -} - -Set-Location $gitRoot - -try { - # Step 1: Clean if requested - if ($Clean) { - Write-Host "๐Ÿงน Cleaning previous builds..." -ForegroundColor Yellow - & powershell ./scripts/clean.ps1 -dist - if ($LASTEXITCODE -ne 0) { - throw "Clean failed" - } - } - - # Step 2: Build libraries first - Write-Host "๐Ÿ“š Building libraries..." -ForegroundColor Green - & powershell ./scripts/build-libs.ps1 - if ($LASTEXITCODE -ne 0) { - throw "Library build failed" - } # Step 3: Build apps with Turbo (excluding dashboard) - Write-Host "๐Ÿ—๏ธ Building applications with Turbo..." -ForegroundColor Green - - # Get list of apps excluding dashboard - $appDirs = Get-ChildItem -Path "apps" -Directory | Where-Object { $_.Name -ne "dashboard" } - - if ($appDirs.Count -gt 0) { - # Build each app individually to avoid filter syntax issues - foreach ($app in $appDirs) { - $appPath = "./apps/$($app.Name)" - Write-Host " Building $($app.Name)..." -ForegroundColor Cyan - - $turboCmd = "turbo run build --filter=$appPath" - - if ($Verbose) { - Write-Host " Running: $turboCmd" -ForegroundColor DarkGray - } - - Invoke-Expression $turboCmd - if ($LASTEXITCODE -ne 0) { - throw "Failed to build app: $($app.Name)" - } - } - - Write-Host "โœ… Apps built successfully: $($appDirs.Name -join ', ')" -ForegroundColor Green - } else { - Write-Host "โ„น๏ธ No non-dashboard apps found to build with Turbo" -ForegroundColor Yellow - } - - # Step 4: Build dashboard with Angular CLI - $dashboardPath = "apps/dashboard" - if (Test-Path $dashboardPath) { - Write-Host "๐ŸŽจ Building Angular dashboard..." -ForegroundColor Green - - Set-Location $dashboardPath - - # Check if ng is available - try { - ng version | Out-Null - } catch { - Write-Host "โŒ Angular CLI not found. Installing..." -ForegroundColor Red - npm install -g @angular/cli - if ($LASTEXITCODE -ne 0) { - throw "Failed to install Angular CLI" - } - } - - # Build dashboard - ng build --configuration production - if ($LASTEXITCODE -ne 0) { - throw "Dashboard build failed" - } - - Write-Host "โœ… Dashboard built successfully" -ForegroundColor Green - Set-Location $originalLocation - } else { - Write-Host "โš ๏ธ Dashboard not found at $dashboardPath" -ForegroundColor Yellow - } - - Write-Host "๐ŸŽ‰ Complete build finished successfully!" -ForegroundColor Green - Write-Host "" - Write-Host "Build Summary:" -ForegroundColor Cyan - Write-Host " โœ… Libraries built" -ForegroundColor Green - if ($appFilters.Count -gt 0) { - Write-Host " โœ… Apps built: $($appDirs.Name -join ', ')" -ForegroundColor Green - } - if (Test-Path "apps/dashboard") { - Write-Host " โœ… Dashboard built" -ForegroundColor Green - } - -} catch { - Write-Host "โŒ Build failed: $($_.Exception.Message)" -ForegroundColor Red - Set-Location $originalLocation - exit 1 -} finally { - Set-Location $originalLocation -} diff --git a/scripts/build-clean.ps1 b/scripts/build-clean.ps1 deleted file mode 100644 index 41d231b..0000000 --- a/scripts/build-clean.ps1 +++ /dev/null @@ -1,64 +0,0 @@ -param( - [switch]$force -) - -Write-Host "=== Clean Build Process ===" -ForegroundColor Green - -# Step 1: Clean everything -Write-Host "Step 1: Cleaning build artifacts..." -ForegroundColor Yellow -& ".\scripts\clean.ps1" -dist -force - -# Step 2: Install dependencies -Write-Host "Step 2: Installing dependencies..." -ForegroundColor Yellow -bun install - -# Step 3: Build libraries in dependency order -Write-Host "Step 3: Building libraries..." -ForegroundColor Yellow - -$libraries = @( - "types", - "config", - "logger", - "utils", - "postgres-client", - "mongodb-client", - "questdb-client", - "cache", - "http", - "event-bus", - "shutdown", - "data-frame", - "vector-engine", - "strategy-engine", - "data-adjustments" -) - -foreach ($lib in $libraries) { - $libPath = "libs\$lib" - if (Test-Path $libPath) { - Write-Host "Building $lib..." -ForegroundColor Blue - Set-Location $libPath - bun run build - if ($LASTEXITCODE -ne 0) { - Write-Host "Failed to build $lib" -ForegroundColor Red - Set-Location "..\..\" - exit 1 - } - Set-Location "..\..\" - Write-Host "โœ“ $lib built successfully" -ForegroundColor Green - } else { - Write-Host "โš  Library $lib not found, skipping..." -ForegroundColor Yellow - } -} - -# Step 4: Build applications -Write-Host "Step 4: Building applications..." -ForegroundColor Yellow -turbo run build --filter='./apps/*' - -if ($LASTEXITCODE -ne 0) { - Write-Host "Failed to build applications" -ForegroundColor Red - exit 1 -} - -Write-Host "=== Clean Build Complete! ===" -ForegroundColor Green -Write-Host "All packages built successfully" -ForegroundColor Blue diff --git a/scripts/build-clean.sh b/scripts/build-clean.sh new file mode 100755 index 0000000..617e27a --- /dev/null +++ b/scripts/build-clean.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# Build Clean Script for Stock Bot +# Clean previous builds then build everything fresh + +set -e + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +CYAN='\033[0;36m' +NC='\033[0m' # No Color + +echo -e "${CYAN}๐Ÿงน Clean Build Process Starting...${NC}" + +# Store original location +ORIGINAL_DIR=$(pwd) + +# Find git root directory +GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null) +if [ $? -ne 0 ]; then + echo -e "${RED}Error: Not in a git repository. Please run this script from within the stock-bot git repository.${NC}" + exit 1 +fi + +cd "$GIT_ROOT" + +cleanup() { + cd "$ORIGINAL_DIR" +} + +# Set up cleanup on exit +trap cleanup EXIT + +# Step 1: Clean everything +echo -e "${YELLOW}๐Ÿ—‘๏ธ Cleaning previous builds...${NC}" +./scripts/clean.sh --dist --cache --tsbuildinfo +if [ $? -ne 0 ]; then + echo -e "${RED}โŒ Clean failed${NC}" + exit 1 +fi + +# Step 2: Build everything fresh +echo -e "${GREEN}๐Ÿ—๏ธ Building everything fresh...${NC}" +./scripts/build-all.sh +if [ $? -ne 0 ]; then + echo -e "${RED}โŒ Build failed${NC}" + exit 1 +fi + +echo -e "${GREEN}โœ… Clean build completed successfully!${NC}" +echo -e "${CYAN}๐Ÿš€ Project is ready for deployment.${NC}" diff --git a/scripts/build-libs.ps1 b/scripts/build-libs.ps1 deleted file mode 100644 index f61cee4..0000000 --- a/scripts/build-libs.ps1 +++ /dev/null @@ -1,58 +0,0 @@ -# Build and install the new libraries - -Write-Host "Building and installing new libraries..." -ForegroundColor Cyan - -# Find git root directory -try { - $gitRoot = git rev-parse --show-toplevel 2>$null - if ($LASTEXITCODE -ne 0) { - throw "Not in git repository" - } - # Convert Unix-style path to Windows if needed (for WSL/Git Bash compatibility) - if ($IsWindows -and $gitRoot -match "^/") { - $gitRoot = $gitRoot -replace "/", "\" - } -} catch { - Write-Host "Error: Not in a git repository. Please run this script from within the stock-bot git repository." -ForegroundColor Red - exit 1 -} - -# Build order is important due to dependencies -$libs = @( - "types", # Base types - no dependencies - "config", # Configuration - depends on types - "logger", # Logging utilities - depends on types - "utils", # Utilities - depends on types and config - # Database clients - "postgres-client", # PostgreSQL client - depends on types, config, logger - # "mongodb-client", # MongoDB client - depends on types, config, logger (temporarily disabled - needs zod->yup conversion) - "questdb-client", # QuestDB client - depends on types, config, logger - - # Service libraries - "cache", # Cache - depends on types and logger - "http", # HTTP client - depends on types, config, logger - "event-bus", # Event bus - depends on types, logger - "shutdown", # Shutdown - depends on types, logger - - # Engine libraries - "data-frame", # Data frame - depends on types, utils - "vector-engine", # Vector engine - depends on types, utils, data-frame - "strategy-engine" # Strategy engine - depends on types, utils, event-bus -) - -# Build each library in order -foreach ($lib in $libs) { - $libPath = Join-Path $gitRoot "libs\$lib" - - Write-Host "Building $lib..." -ForegroundColor Green - Set-Location $libPath - bun run build - - if ($LASTEXITCODE -ne 0) { - Write-Host "Failed to build $lib. Exiting." -ForegroundColor Red - exit 1 - } -} - -Write-Host "All libraries built successfully!" -ForegroundColor Green -Set-Location $gitRoot diff --git a/scripts/clean.ps1 b/scripts/clean.ps1 deleted file mode 100644 index 708ee55..0000000 --- a/scripts/clean.ps1 +++ /dev/null @@ -1,182 +0,0 @@ -param( - [switch]$modules, - [switch]$dist, - [switch]$cache, - [switch]$tsbuildinfo, - [switch]$all, - [switch]$fresh, - [switch]$force -) - -function Remove-DirectoriesByName { - param([string]$Name, [string]$Description) - - Write-Host "Removing $Description..." -ForegroundColor Blue - $directories = Get-ChildItem -Path . -Name $Name -Recurse -Directory -ErrorAction SilentlyContinue - - if ($directories.Count -gt 0) { - Write-Host "Found $($directories.Count) $Description to remove" -ForegroundColor Gray - $directories | ForEach-Object { - Remove-Item $_ -Recurse -Force -ErrorAction SilentlyContinue - Write-Host " Removed: $_" -ForegroundColor Gray - } - } else { - Write-Host "No $Description found" -ForegroundColor Gray - } -} - -function Remove-FilesByPattern { - param([string]$Pattern, [string]$Description) - - Write-Host "Removing $Description..." -ForegroundColor Blue - $files = Get-ChildItem -Path . -Name $Pattern -Recurse -File -ErrorAction SilentlyContinue - - if ($files.Count -gt 0) { - Write-Host "Found $($files.Count) $Description to remove" -ForegroundColor Gray - $files | ForEach-Object { - Remove-Item $_ -Force -ErrorAction SilentlyContinue - Write-Host " Removed: $_" -ForegroundColor Gray - } - } else { - Write-Host "No $Description found" -ForegroundColor Gray - } -} - -Write-Host "Starting cleanup..." -ForegroundColor Yellow - -if ($all -or $fresh) { - if (-not $force) { - Write-Host "WARNING: This will remove ALL build artifacts, caches, dependencies, and temporary files!" -ForegroundColor Red - Write-Host "This includes: node_modules, dist, all caches, logs, databases, and lock files" -ForegroundColor Yellow - $confirmation = Read-Host "Are you sure you want to continue? (y/N)" - if ($confirmation -ne 'y' -and $confirmation -ne 'Y') { - Write-Host "Operation cancelled." -ForegroundColor Yellow - exit 0 - } - } - - Write-Host "=== NUCLEAR CLEAN: Removing EVERYTHING ===" -ForegroundColor Red - - # Dependencies and packages - Remove-DirectoriesByName "node_modules" "node_modules directories" - - # Build outputs - Remove-DirectoriesByName "dist" "dist directories" - Remove-DirectoriesByName "build" "build directories" - Remove-DirectoriesByName "lib" "lib directories" - Remove-DirectoriesByName "out" "out directories" - Remove-DirectoriesByName ".out" "build output directories" - - # Cache directories - Remove-DirectoriesByName ".turbo" "Turborepo cache directories" - Remove-DirectoriesByName ".next" "Next.js cache directories" - Remove-DirectoriesByName ".parcel-cache" "Parcel cache directories" - Remove-DirectoriesByName ".angular" "Angular CLI cache directories" - Remove-DirectoriesByName ".nuxt" "Nuxt.js cache directories" - Remove-DirectoriesByName ".vite" "Vite cache directories" - Remove-DirectoriesByName ".webpack" "Webpack cache directories" - Remove-DirectoriesByName ".rollup.cache" "Rollup cache directories" - - # Test and coverage - Remove-DirectoriesByName "coverage" "test coverage directories" - Remove-DirectoriesByName ".nyc_output" "NYC coverage directories" - Remove-DirectoriesByName ".jest" "Jest cache directories" - Remove-DirectoriesByName ".vitest" "Vitest cache directories" - - # Storybook - Remove-DirectoriesByName ".storybook-out" "Storybook build directories" - Remove-DirectoriesByName "storybook-static" "Storybook static directories" - - # Temporary and log directories - Remove-DirectoriesByName "tmp" "temporary directories" - Remove-DirectoriesByName "temp" "temp directories" - Remove-DirectoriesByName ".tmp" "hidden temp directories" - Remove-DirectoriesByName "logs" "log directories" - Remove-DirectoriesByName ".logs" "hidden log directories" - - # Project specific (from .gitignore) - Remove-DirectoriesByName ".data" "data directories" - Remove-DirectoriesByName ".backtest-results" "backtest result directories" - Remove-DirectoriesByName ".old" "old backup directories" - Remove-DirectoriesByName ".mongo" "MongoDB data directories" - Remove-DirectoriesByName ".chat" "chat directories" - - Write-Host "Removing lock files..." -ForegroundColor Blue - Remove-Item -Path "bun.lockb" -Force -ErrorAction SilentlyContinue - Remove-Item -Path "package-lock.json" -Force -ErrorAction SilentlyContinue - Remove-Item -Path "yarn.lock" -Force -ErrorAction SilentlyContinue - Remove-Item -Path "pnpm-lock.yaml" -Force -ErrorAction SilentlyContinue - Get-ChildItem -Path . -Name "bun.lockb" -Recurse -File | Remove-Item -Force -ErrorAction SilentlyContinue - Get-ChildItem -Path . -Name "package-lock.json" -Recurse -File | Remove-Item -Force -ErrorAction SilentlyContinue - Get-ChildItem -Path . -Name "yarn.lock" -Recurse -File | Remove-Item -Force -ErrorAction SilentlyContinue - Get-ChildItem -Path . -Name "pnpm-lock.yaml" -Recurse -File | Remove-Item -Force -ErrorAction SilentlyContinue - - # TypeScript and build files - Remove-FilesByPattern "*.tsbuildinfo" "TypeScript build info files" - Remove-FilesByPattern ".eslintcache" "ESLint cache files" - Remove-FilesByPattern ".stylelintcache" "Stylelint cache files" - Remove-FilesByPattern ".prettiercache" "Prettier cache files" - Remove-FilesByPattern "*.d.ts" "TypeScript build info files" - - # Database files - Remove-FilesByPattern "*.db" "database files" - Remove-FilesByPattern "*.sqlite" "SQLite database files" - Remove-FilesByPattern "*.sqlite3" "SQLite3 database files" - - # Log files - Remove-FilesByPattern "*.log" "log files" - Remove-FilesByPattern "npm-debug.log*" "npm debug logs" - Remove-FilesByPattern "yarn-debug.log*" "yarn debug logs" - Remove-FilesByPattern "yarn-error.log*" "yarn error logs" - Remove-FilesByPattern "lerna-debug.log*" "lerna debug logs" - - # OS generated files - Remove-FilesByPattern ".DS_Store" "macOS .DS_Store files" - Remove-FilesByPattern "Thumbs.db" "Windows thumbnail files" - Remove-FilesByPattern "ehthumbs.db" "Windows thumbnail cache files" - Remove-FilesByPattern "Desktop.ini" "Windows desktop files" - - Write-Host "=== NUCLEAR CLEAN COMPLETE ===" -ForegroundColor Red - Write-Host "Cleanup complete - no need for turbo clean" -ForegroundColor Blue -} -elseif ($modules) { - Remove-DirectoriesByName "node_modules" "node_modules directories" - - Write-Host "Removing lock files..." -ForegroundColor Blue - Remove-Item -Path "bun.lockb" -Force -ErrorAction SilentlyContinue - Get-ChildItem -Path . -Name "bun.lockb" -Recurse -File | Remove-Item -Force -ErrorAction SilentlyContinue -} -elseif ($dist) { - Remove-DirectoriesByName "dist" "dist directories" - Remove-DirectoriesByName ".turbo" "Turborepo cache directories" - Remove-DirectoriesByName ".next" "Next.js cache directories" - Remove-DirectoriesByName ".parcel-cache" "Parcel cache directories" - Remove-DirectoriesByName ".angular" "Angular CLI cache directories" - - Remove-FilesByPattern "*.tsbuildinfo" "TypeScript build info files" - Remove-FilesByPattern ".eslintcache" "ESLint cache files" -} -elseif ($cache) { - Remove-DirectoriesByName ".turbo" "Turborepo cache directories" - Remove-DirectoriesByName ".next" "Next.js cache directories" - Remove-DirectoriesByName ".parcel-cache" "Parcel cache directories" - Remove-DirectoriesByName ".angular" "Angular CLI cache directories" - Remove-DirectoriesByName "coverage" "test coverage directories" - Remove-DirectoriesByName ".nyc_output" "NYC coverage directories" - Remove-FilesByPattern ".eslintcache" "ESLint cache files" -} -elseif ($tsbuildinfo) { - Remove-FilesByPattern "*.tsbuildinfo" "TypeScript build info files" -} -else { - Write-Host "Running turbo clean..." -ForegroundColor Blue - # Only run turbo clean for the default case - turbo run clean -} - -if ($fresh) { - Write-Host "Installing dependencies..." -ForegroundColor Green - bun install -} - -Write-Host "Cleanup complete!" -ForegroundColor Green \ No newline at end of file diff --git a/scripts/docker.ps1 b/scripts/docker.ps1 deleted file mode 100644 index 51915a9..0000000 --- a/scripts/docker.ps1 +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/env pwsh - -# Trading Bot Docker Management Script - -param( - [Parameter(Mandatory=$true)] - [ValidateSet("start", "stop", "restart", "status", "logs", "reset", "admin", "monitoring", "help")] - [string]$Action, - - [Parameter(Mandatory=$false)] - [string]$Service = "", - - [Parameter(Mandatory=$false)] - [switch]$Dev = $false -) - -$ComposeFiles = if ($Dev) { - "-f docker-compose.yml -f docker-compose.dev.yml" -} else { - "-f docker-compose.yml" -} - -switch ($Action) { - "start" { - Write-Host "๐Ÿš€ Starting Trading Bot infrastructure..." -ForegroundColor Green - if ($Service) { - Invoke-Expression "docker-compose $ComposeFiles up -d $Service" - } else { - Invoke-Expression "docker-compose $ComposeFiles up -d dragonfly postgres questdb" - } - Write-Host "โœ… Infrastructure started!" -ForegroundColor Green - Write-Host "" - Write-Host "๐Ÿ”— Access Points:" -ForegroundColor Cyan - Write-Host " Dragonfly: localhost:6379" - Write-Host " PostgreSQL: localhost:5432" - Write-Host " QuestDB Console: http://localhost:9000" - Write-Host "" - Write-Host "๐Ÿ’ก Use './scripts/docker.ps1 admin' to start admin interfaces" - } - - "stop" { - Write-Host "๐Ÿ›‘ Stopping Trading Bot infrastructure..." -ForegroundColor Yellow - if ($Service) { - Invoke-Expression "docker-compose $ComposeFiles stop $Service" - } else { - Invoke-Expression "docker-compose $ComposeFiles down" - } - Write-Host "โœ… Infrastructure stopped!" -ForegroundColor Green - } - - "restart" { - Write-Host "๐Ÿ”„ Restarting Trading Bot infrastructure..." -ForegroundColor Yellow - if ($Service) { - Invoke-Expression "docker-compose $ComposeFiles restart $Service" - } else { - Invoke-Expression "docker-compose $ComposeFiles restart" - } - Write-Host "โœ… Infrastructure restarted!" -ForegroundColor Green - } - - "status" { - Write-Host "๐Ÿ“Š Trading Bot Infrastructure Status:" -ForegroundColor Cyan - Invoke-Expression "docker-compose $ComposeFiles ps" - Write-Host "" - Write-Host "๐Ÿ” Health Checks:" -ForegroundColor Cyan - docker ps --filter "name=trading-bot" --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" - } - - "logs" { - if ($Service) { - Write-Host "๐Ÿ“‹ Logs for ${Service}:" -ForegroundColor Cyan - Invoke-Expression "docker-compose $ComposeFiles logs -f $Service" - } else { - Write-Host "๐Ÿ“‹ All service logs:" -ForegroundColor Cyan - Invoke-Expression "docker-compose $ComposeFiles logs -f" - } - } - - "reset" { - Write-Host "โš ๏ธ Resetting Trading Bot infrastructure (will delete all data)..." -ForegroundColor Red - $confirm = Read-Host "Are you sure? Type 'yes' to confirm" - if ($confirm -eq "yes") { - Invoke-Expression "docker-compose $ComposeFiles down -v" - Write-Host "๐Ÿ—‘๏ธ Volumes removed" - Invoke-Expression "docker-compose $ComposeFiles up -d dragonfly postgres questdb" - Write-Host "โœ… Infrastructure reset complete!" -ForegroundColor Green - } else { - Write-Host "โŒ Reset cancelled" -ForegroundColor Yellow - } - } - - "admin" { - Write-Host "๐Ÿ”ง Starting admin interfaces..." -ForegroundColor Green - Invoke-Expression "docker-compose $ComposeFiles up -d redis-insight pgadmin" - Write-Host "โœ… Admin interfaces started!" -ForegroundColor Green - Write-Host "" - Write-Host "๐Ÿ”— Admin Access:" -ForegroundColor Cyan - Write-Host " Redis Insight: http://localhost:8001" - Write-Host " PgAdmin: http://localhost:8080" - Write-Host " Email: admin@tradingbot.local" - Write-Host " Password: admin123" - } "monitoring" { - Write-Host "๐Ÿ“Š Starting monitoring stack..." -ForegroundColor Green - Invoke-Expression "docker-compose $ComposeFiles up -d prometheus grafana loki" - Write-Host "โœ… Monitoring started!" -ForegroundColor Green - Write-Host "" - Write-Host "๐Ÿ”— Monitoring Access:" -ForegroundColor Cyan - Write-Host " Prometheus: http://localhost:9090" - Write-Host " Grafana: http://localhost:3000" - Write-Host " Username: admin" - Write-Host " Password: admin" - Write-Host " Loki: http://localhost:3100" - } - - "help" { - Write-Host "" - Write-Host "๐Ÿค– Trading Bot Docker Management" -ForegroundColor Green - Write-Host "" - Write-Host "Usage: ./scripts/docker.ps1 [options]" -ForegroundColor Cyan - Write-Host "" - Write-Host "Actions:" -ForegroundColor Yellow - Write-Host " start Start infrastructure services" - Write-Host " stop Stop infrastructure services" - Write-Host " restart Restart infrastructure services" - Write-Host " status Show service status" - Write-Host " logs Show service logs" - Write-Host " reset Reset all data (destructive)" - Write-Host " admin Start admin interfaces" - Write-Host " monitoring Start monitoring stack" - Write-Host " help Show this help" - Write-Host "" - Write-Host "Options:" -ForegroundColor Yellow - Write-Host " -Service Specify a specific service" - Write-Host " -Dev Use development configuration" - Write-Host "" - Write-Host "Examples:" -ForegroundColor Cyan - Write-Host " ./scripts/docker.ps1 start" - Write-Host " ./scripts/docker.ps1 start -Dev" - Write-Host " ./scripts/docker.ps1 logs -Service dragonfly" - Write-Host " ./scripts/docker.ps1 admin" - } -} diff --git a/scripts/verify-build.ps1 b/scripts/verify-build.ps1 deleted file mode 100644 index a2b6a23..0000000 --- a/scripts/verify-build.ps1 +++ /dev/null @@ -1,94 +0,0 @@ -param( - [switch]$verbose -) - -Write-Host "=== Verifying Build Health ===" -ForegroundColor Green - -$errors = @() -$warnings = @() - -# Check for common build issues -Write-Host "Checking for common build issues..." -ForegroundColor Yellow - -# Check for mismatched .d.ts files in source directories -Write-Host "Checking for .d.ts files in source directories..." -ForegroundColor Blue -$sourceDtsFiles = Get-ChildItem -Path ".\libs\*\src\**\*.d.ts" -Recurse -ErrorAction SilentlyContinue -if ($sourceDtsFiles.Count -gt 0) { - $warnings += "Found .d.ts files in source directories:" - foreach ($file in $sourceDtsFiles) { - $warnings += " - $($file.FullName)" - } -} - -# Check for missing dist directories after build -Write-Host "Checking for missing dist directories..." -ForegroundColor Blue -$libraries = @("types", "config", "logger", "utils", "cache", "http") -foreach ($lib in $libraries) { - $distPath = "libs\$lib\dist" - if (-not (Test-Path $distPath)) { - $errors += "Missing dist directory for $lib" - } else { - $indexFile = "$distPath\index.js" - if (-not (Test-Path $indexFile)) { - $errors += "Missing index.js in $lib dist directory" - } - } -} - -# Check for stale tsbuildinfo files -Write-Host "Checking for stale tsbuildinfo files..." -ForegroundColor Blue -$tsbuildFiles = Get-ChildItem -Path ".\**\*.tsbuildinfo" -Recurse -ErrorAction SilentlyContinue -if ($tsbuildFiles.Count -gt 0) { - $warnings += "Found stale .tsbuildinfo files:" - foreach ($file in $tsbuildFiles) { - $warnings += " - $($file.FullName)" - } -} - -# Check package.json dependencies -Write-Host "Checking package.json files..." -ForegroundColor Blue -$packageFiles = Get-ChildItem -Path ".\**\package.json" -Recurse -ErrorAction SilentlyContinue -foreach ($packageFile in $packageFiles) { - try { - $packageContent = Get-Content $packageFile.FullName | ConvertFrom-Json - if (-not $packageContent.name) { - $errors += "Package.json missing name: $($packageFile.FullName)" - } - if (-not $packageContent.version) { - $warnings += "Package.json missing version: $($packageFile.FullName)" - } - } catch { - $errors += "Invalid package.json: $($packageFile.FullName)" - } -} - -# Report results -Write-Host "`n=== Build Health Report ===" -ForegroundColor Green - -if ($errors.Count -gt 0) { - Write-Host "โŒ ERRORS FOUND:" -ForegroundColor Red - foreach ($error in $errors) { - Write-Host " $error" -ForegroundColor Red - } -} - -if ($warnings.Count -gt 0) { - Write-Host "โš  WARNINGS:" -ForegroundColor Yellow - foreach ($warning in $warnings) { - Write-Host " $warning" -ForegroundColor Yellow - } -} - -if ($errors.Count -eq 0 -and $warnings.Count -eq 0) { - Write-Host "โœ… No issues found - build environment is healthy!" -ForegroundColor Green -} elseif ($errors.Count -eq 0) { - Write-Host "โœ… No critical errors found (only warnings)" -ForegroundColor Green -} else { - Write-Host "โŒ Critical errors found - build may fail" -ForegroundColor Red - exit 1 -} - -Write-Host "`nRecommended commands:" -ForegroundColor Cyan -Write-Host " Clean build: bun run reset" -ForegroundColor Gray -Write-Host " Quick build: bun run build" -ForegroundColor Gray -Write-Host " Clean only: bun run clean:dist" -ForegroundColor Gray