From 28de4ef594c5d0efabd761619536a9b3052a97f1 Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Sun, 2 Nov 2025 01:15:43 -0600 Subject: [PATCH] Web Interface Now Rebuilds Every Production Launch --- Borealis.ps1 | 49 +++++++++++++------------------------------ Data/Engine/config.py | 1 - 2 files changed, 15 insertions(+), 35 deletions(-) diff --git a/Borealis.ps1 b/Borealis.ps1 index 127901f6..f025c621 100644 --- a/Borealis.ps1 +++ b/Borealis.ps1 @@ -240,23 +240,15 @@ function Ensure-EngineWebInterface { throw "Engine web interface source missing at '$engineStageSource'." } - $enginePackage = Join-Path $engineDestination 'package.json' - $engineSrcDir = Join-Path $engineDestination 'src' - if ((Test-Path $enginePackage) -and (Test-Path $engineSrcDir)) { - return + if (Test-Path $engineDestination) { + Remove-Item $engineDestination -Recurse -Force -ErrorAction SilentlyContinue } - if (-not (Test-Path $engineDestination)) { - 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 + New-Item -Path $engineDestination -ItemType Directory -Force | Out-Null 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'." } } @@ -1415,11 +1407,9 @@ switch ($choice) { $dataSource = "Data" $engineSource = "$dataSource\Engine" $engineDataDestination = "$venvFolder\Data\Engine" - $webUIFallbackSource = "$dataSource\Engine\web-interface" $webUIDestination = "$venvFolder\web-interface" $venvPython = Join-Path $venvFolder 'Scripts\python.exe' $engineSourceAbsolute = Join-Path $scriptDir $engineSource - $webUIFallbackAbsolute = Join-Path $scriptDir $webUIFallbackSource Run-Step "Create Borealis Engine Virtual Python Environment" { $venvActivate = Join-Path $venvFolder 'Scripts\Activate' @@ -1490,27 +1480,18 @@ switch ($choice) { Run-Step "Copy Borealis Engine WebUI Files into: $webUIDestination" { Ensure-EngineWebInterface -ProjectRoot $scriptDir $engineWebUISource = Join-Path $scriptDir 'Engine\web-interface' - if (Test-Path $engineWebUISource) { - $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 - } 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 + if (-not (Test-Path $engineWebUISource)) { + throw "Engine web interface staging directory not found at '$engineWebUISource'." } + + $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" { diff --git a/Data/Engine/config.py b/Data/Engine/config.py index ea121ca7..6d95607d 100644 --- a/Data/Engine/config.py +++ b/Data/Engine/config.py @@ -95,7 +95,6 @@ def _resolve_static_folder() -> str: ENGINE_DIR.parent / "Engine" / "web-interface", ENGINE_DIR.parent / "web-interface", ENGINE_DIR / "web-interface", - PROJECT_ROOT / "Data" / "Server" / "web-interface", ] resolved_roots: List[Path] = []