updating build

This commit is contained in:
Bojan Kucera 2025-06-07 14:46:39 -04:00
parent a8ee4022bf
commit 8be4bfe6f2
8 changed files with 122 additions and 34 deletions

View file

@ -4,7 +4,6 @@
"outDir": "./dist",
"rootDir": "./src",
"declaration": true,
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
},

View file

@ -4,12 +4,16 @@
"outDir": "./dist",
"rootDir": "./src",
"declaration": true,
"moduleResolution": "node",
"module": "CommonJS",
"target": "ES2020"
"declarationMap": true,
"sourceMap": false
},
"include": [
"src/**/*"
],
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"]
"exclude": [
"dist",
"node_modules",
"**/*.test.ts",
"**/*.spec.ts"
]
}

View file

@ -3,13 +3,17 @@
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src",
"declaration": true
"declaration": true,
"declarationMap": true,
"sourceMap": false
},
"include": [
"src/**/*"
],
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"],
"references": [
{ "path": "../config" }
"exclude": [
"dist",
"node_modules",
"**/*.test.ts",
"**/*.spec.ts"
]
}

View file

@ -3,6 +3,7 @@
"private": true,
"version": "1.0.0",
"description": "Advanced trading bot with microservice architecture",
"type": "module",
"scripts": {
"dev": "turbo run dev",
"build": "turbo run build",
@ -16,9 +17,12 @@
"test:libs": "turbo run test --filter='./libs/*'",
"test:apps": "turbo run test --filter=./apps/*/*",
"lint": "turbo run lint",
"clean": "turbo run clean",
"start": "turbo run start",
"clean:dist": "rimraf **/dist",
"clean": "turbo run clean",
"clean:dist": "powershell ./scripts/clean.ps1 -dist",
"clean:modules": "powershell ./scripts/clean.ps1 -modules",
"clean:all": "powershell ./scripts/clean.ps1 -all",
"clean:fresh": "powershell ./scripts/clean.ps1 -fresh",
"backtest": "turbo run backtest",
"docker:start": "powershell ./scripts/docker.ps1 start",
"docker:stop": "powershell ./scripts/docker.ps1 stop",

View file

@ -5,13 +5,25 @@ Write-Host "Building and installing new libraries..." -ForegroundColor Cyan
# Build order is important due to dependencies
$libs = @(
"types", # Base types - no dependencies
"logger", # Logging utilities - depends on types
"config", # Configuration - depends on types
"utils", # Utilities - depends on types and config "cache", # Cache - depends on types and logger
"http", # HTTP client - depends on types, config, logger
"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
"questdb-client" # QuestDB client - depends on types, config, logger
"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

59
scripts/clean.ps1 Normal file
View file

@ -0,0 +1,59 @@
param(
[switch]$modules,
[switch]$dist,
[switch]$all,
[switch]$fresh
)
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
}
}
Write-Host "Starting cleanup..." -ForegroundColor Yellow
if ($all -or $fresh) {
Remove-DirectoriesByName "node_modules" "node_modules directories"
Remove-DirectoriesByName "dist" "dist 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
# Remove turbo clean since PowerShell already cleaned everything
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"
}
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

View file

@ -3,8 +3,6 @@
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src",
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["bun-types"]
},
"include": ["src/**/*"],

View file

@ -3,9 +3,9 @@
"compilerOptions": {
// JavaScript output target version
"target": "ES2022",
// Module configuration for different project types
// Module configuration for different project types
"module": "ESNext",
"moduleResolution": "node",
"moduleResolution": "bundler",
"composite": true,
// Type checking
@ -14,6 +14,7 @@
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
"declarationMap": true,
// Module interoperability
"esModuleInterop": true,
@ -33,25 +34,32 @@
"paths": {
"@stock-bot/*": ["libs/*/src"]
}
},
"exclude": [
"node_modules",
"dist"
], "references": [
{ "path": "./libs/config" },
{ "path": "./libs/http" },
{ "path": "./libs/logger" },
{ "path": "./libs/mongodb-client" },
{ "path": "./libs/postgres-client" },
{ "path": "./libs/questdb-client" },
],
"references": [
// Core libraries first
{ "path": "./libs/types" },
{ "path": "./libs/cache" },
{ "path": "./libs/config" },
{ "path": "./libs/logger" },
{ "path": "./libs/utils" },
{ "path": "./libs/event-bus" },
{ "path": "./libs/data-frame" },
{ "path": "./libs/strategy-engine" },
{ "path": "./libs/vector-engine" },
]
}
// Database clients
{ "path": "./libs/postgres-client" },
{ "path": "./libs/mongodb-client" },
{ "path": "./libs/questdb-client" },
// Service libraries
{ "path": "./libs/cache" },
{ "path": "./libs/http" },
{ "path": "./libs/event-bus" },
{ "path": "./libs/shutdown" },
// Engine libraries
{ "path": "./libs/data-frame" },
{ "path": "./libs/vector-engine" },
{ "path": "./libs/strategy-engine" }
]
}