mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-12-15 17:35:48 -07:00
Web Interface Now Rebuilds Every Production Launch
This commit is contained in:
49
Borealis.ps1
49
Borealis.ps1
@@ -240,23 +240,15 @@ function Ensure-EngineWebInterface {
|
|||||||
throw "Engine web interface source missing at '$engineStageSource'."
|
throw "Engine web interface source missing at '$engineStageSource'."
|
||||||
}
|
}
|
||||||
|
|
||||||
$enginePackage = Join-Path $engineDestination 'package.json'
|
if (Test-Path $engineDestination) {
|
||||||
$engineSrcDir = Join-Path $engineDestination 'src'
|
Remove-Item $engineDestination -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
if ((Test-Path $enginePackage) -and (Test-Path $engineSrcDir)) {
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-not (Test-Path $engineDestination)) {
|
New-Item -Path $engineDestination -ItemType Directory -Force | Out-Null
|
||||||
New-Item -Path $engineDestination -ItemType Directory -Force | Out-Null
|
|
||||||
}
|
|
||||||
|
|
||||||
$preserve = @('.gitignore','README.md')
|
|
||||||
Get-ChildItem -Path $engineDestination -Force | Where-Object { $preserve -notcontains $_.Name } |
|
|
||||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
|
|
||||||
|
|
||||||
Copy-Item (Join-Path $engineStageSource '*') $engineDestination -Recurse -Force
|
Copy-Item (Join-Path $engineStageSource '*') $engineDestination -Recurse -Force
|
||||||
|
|
||||||
if (-not (Test-Path $enginePackage)) {
|
if (-not (Test-Path (Join-Path $engineDestination 'package.json'))) {
|
||||||
throw "Failed to stage Engine web interface into '$engineDestination' from '$engineStageSource'."
|
throw "Failed to stage Engine web interface into '$engineDestination' from '$engineStageSource'."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1415,11 +1407,9 @@ switch ($choice) {
|
|||||||
$dataSource = "Data"
|
$dataSource = "Data"
|
||||||
$engineSource = "$dataSource\Engine"
|
$engineSource = "$dataSource\Engine"
|
||||||
$engineDataDestination = "$venvFolder\Data\Engine"
|
$engineDataDestination = "$venvFolder\Data\Engine"
|
||||||
$webUIFallbackSource = "$dataSource\Engine\web-interface"
|
|
||||||
$webUIDestination = "$venvFolder\web-interface"
|
$webUIDestination = "$venvFolder\web-interface"
|
||||||
$venvPython = Join-Path $venvFolder 'Scripts\python.exe'
|
$venvPython = Join-Path $venvFolder 'Scripts\python.exe'
|
||||||
$engineSourceAbsolute = Join-Path $scriptDir $engineSource
|
$engineSourceAbsolute = Join-Path $scriptDir $engineSource
|
||||||
$webUIFallbackAbsolute = Join-Path $scriptDir $webUIFallbackSource
|
|
||||||
|
|
||||||
Run-Step "Create Borealis Engine Virtual Python Environment" {
|
Run-Step "Create Borealis Engine Virtual Python Environment" {
|
||||||
$venvActivate = Join-Path $venvFolder 'Scripts\Activate'
|
$venvActivate = Join-Path $venvFolder 'Scripts\Activate'
|
||||||
@@ -1490,27 +1480,18 @@ switch ($choice) {
|
|||||||
Run-Step "Copy Borealis Engine WebUI Files into: $webUIDestination" {
|
Run-Step "Copy Borealis Engine WebUI Files into: $webUIDestination" {
|
||||||
Ensure-EngineWebInterface -ProjectRoot $scriptDir
|
Ensure-EngineWebInterface -ProjectRoot $scriptDir
|
||||||
$engineWebUISource = Join-Path $scriptDir 'Engine\web-interface'
|
$engineWebUISource = Join-Path $scriptDir 'Engine\web-interface'
|
||||||
if (Test-Path $engineWebUISource) {
|
if (-not (Test-Path $engineWebUISource)) {
|
||||||
$webUIDestinationAbsolute = Join-Path $scriptDir $webUIDestination
|
throw "Engine web interface staging directory not found at '$engineWebUISource'."
|
||||||
if (Test-Path $webUIDestinationAbsolute) {
|
|
||||||
Remove-Item (Join-Path $webUIDestinationAbsolute '*') -Recurse -Force -ErrorAction SilentlyContinue
|
|
||||||
} else {
|
|
||||||
New-Item -Path $webUIDestinationAbsolute -ItemType Directory -Force | Out-Null
|
|
||||||
}
|
|
||||||
Copy-Item (Join-Path $engineWebUISource '*') $webUIDestinationAbsolute -Recurse -Force
|
|
||||||
} elseif (-not (Test-Path (Join-Path $scriptDir $webUIDestination)) -or -not (Get-ChildItem -Path (Join-Path $scriptDir $webUIDestination) -ErrorAction SilentlyContinue | Select-Object -First 1)) {
|
|
||||||
if (Test-Path $webUIFallbackAbsolute) {
|
|
||||||
$webUIDestinationAbsolute = Join-Path $scriptDir $webUIDestination
|
|
||||||
if (-not (Test-Path $webUIDestinationAbsolute)) {
|
|
||||||
New-Item -Path $webUIDestinationAbsolute -ItemType Directory -Force | Out-Null
|
|
||||||
}
|
|
||||||
Copy-Item (Join-Path $webUIFallbackAbsolute '*') $webUIDestinationAbsolute -Recurse -Force
|
|
||||||
} else {
|
|
||||||
Write-Host "Fallback WebUI source not found at '$webUIFallbackAbsolute'." -ForegroundColor Yellow
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Write-Host "Existing Engine web interface detected; skipping fallback copy." -ForegroundColor DarkYellow
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$webUIDestinationAbsolute = Join-Path $scriptDir $webUIDestination
|
||||||
|
if (Test-Path $webUIDestinationAbsolute) {
|
||||||
|
Remove-Item (Join-Path $webUIDestinationAbsolute '*') -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
} else {
|
||||||
|
New-Item -Path $webUIDestinationAbsolute -ItemType Directory -Force | Out-Null
|
||||||
|
}
|
||||||
|
|
||||||
|
Copy-Item (Join-Path $engineWebUISource '*') $webUIDestinationAbsolute -Recurse -Force
|
||||||
}
|
}
|
||||||
|
|
||||||
Run-Step "Vite Web Frontend: Install NPM Packages" {
|
Run-Step "Vite Web Frontend: Install NPM Packages" {
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ def _resolve_static_folder() -> str:
|
|||||||
ENGINE_DIR.parent / "Engine" / "web-interface",
|
ENGINE_DIR.parent / "Engine" / "web-interface",
|
||||||
ENGINE_DIR.parent / "web-interface",
|
ENGINE_DIR.parent / "web-interface",
|
||||||
ENGINE_DIR / "web-interface",
|
ENGINE_DIR / "web-interface",
|
||||||
PROJECT_ROOT / "Data" / "Server" / "web-interface",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
resolved_roots: List[Path] = []
|
resolved_roots: List[Path] = []
|
||||||
|
|||||||
Reference in New Issue
Block a user