-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
76 lines (64 loc) · 2.19 KB
/
Copy pathbuild.ps1
File metadata and controls
76 lines (64 loc) · 2.19 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env pwsh
# Build script for secure-input library
# Ensures packages are built in the correct order
Write-Host "`n🏗️ Building Secure Input Library" -ForegroundColor Cyan
Write-Host "================================`n" -ForegroundColor Cyan
# Step 1: Build WASM package
Write-Host "1️⃣ Building WASM package..." -ForegroundColor Yellow
Set-Location packages\wasm
if (!(Test-Path "pkg")) {
New-Item -ItemType Directory -Path "pkg" -Force | Out-Null
}
try {
wasm-pack build --target web --out-dir pkg --release
if ($LASTEXITCODE -ne 0) {
Write-Host "❌ WASM build failed" -ForegroundColor Red
Set-Location ..\..
exit 1
}
Write-Host "✅ WASM package built successfully`n" -ForegroundColor Green
} catch {
Write-Host "❌ Error: $_" -ForegroundColor Red
Set-Location ..\..
exit 1
}
Set-Location ..\..
# Step 2: Build core package
Write-Host "2️⃣ Building core package..." -ForegroundColor Yellow
Set-Location packages\core
try {
pnpm build
if ($LASTEXITCODE -ne 0) {
Write-Host "❌ Core build failed" -ForegroundColor Red
Set-Location ..\..
exit 1
}
Write-Host "✅ Core package built successfully`n" -ForegroundColor Green
} catch {
Write-Host "❌ Error: $_" -ForegroundColor Red
Set-Location ..\..
exit 1
}
Set-Location ..\..
# Step 3: Build React package
Write-Host "3️⃣ Building React package..." -ForegroundColor Yellow
Set-Location packages\react
try {
pnpm build
if ($LASTEXITCODE -ne 0) {
Write-Host "❌ React build failed" -ForegroundColor Red
Set-Location ..\..
exit 1
}
Write-Host "✅ React package built successfully`n" -ForegroundColor Green
} catch {
Write-Host "❌ Error: $_" -ForegroundColor Red
Set-Location ..\..
exit 1
}
Set-Location ..\..
Write-Host "`n🎉 All packages built successfully!" -ForegroundColor Green
Write-Host "`nNext steps:" -ForegroundColor Cyan
Write-Host " • Run a demo: cd packages\examples\react-demo && pnpm dev" -ForegroundColor White
Write-Host " • Run tests: pnpm test" -ForegroundColor White
Write-Host " • Publish: pnpm changeset && pnpm release`n" -ForegroundColor White