58 lines
2.2 KiB
PowerShell
58 lines
2.2 KiB
PowerShell
# 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
|