stock-bot/scripts/build-clean.ps1
2025-06-09 22:55:51 -04:00

64 lines
1.7 KiB
PowerShell

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