File size: 1,317 Bytes
5a81b95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Build Shared Packages Script
# Dette script bygger shared packages i den rigtige rækkefølge

Write-Host "=== Building Widget TDC Shared Packages ===" -ForegroundColor Cyan

# Byg domain-types først
Write-Host "`nStep 1: Building @widget-tdc/domain-types..." -ForegroundColor Yellow
Set-Location -Path "packages\shared\domain-types"
if (-not (Test-Path "node_modules")) {
    Write-Host "Installing dependencies..." -ForegroundColor Gray
    npm install
}
Write-Host "Building..." -ForegroundColor Gray
npm run build

if ($LASTEXITCODE -ne 0) {
    Write-Host "Error building domain-types!" -ForegroundColor Red
    Set-Location -Path "..\..\..\"
    exit 1
}

# Byg mcp-types derefter
Write-Host "`nStep 2: Building @widget-tdc/mcp-types..." -ForegroundColor Yellow
Set-Location -Path "..\mcp-types"
if (-not (Test-Path "node_modules")) {
    Write-Host "Installing dependencies..." -ForegroundColor Gray
    npm install
}
Write-Host "Building..." -ForegroundColor Gray
npm run build

if ($LASTEXITCODE -ne 0) {
    Write-Host "Error building mcp-types!" -ForegroundColor Red
    Set-Location -Path "..\..\..\"
    exit 1
}

# Gå tilbage til root
Set-Location -Path "..\..\..\"

Write-Host "`n=== Build Complete! ===" -ForegroundColor Green
Write-Host "Both packages built successfully." -ForegroundColor Green