Files
ExecuteR/scripts/Initialize-Repository.ps1
Alphaeus Mote f4c7f3e68e chore: no SvelteKit left behind; Node 22 checked at setup
- The MVP design spec (read by coding agents as guidance) now describes
  the React/MUI console on the Mantis Pro shell: stack, folder layout,
  live-update path, UI conventions, image build (Vite dist/ served by
  server.mjs), CI step and architecture diagram, so later work does not
  drift back to Svelte.
- .editorconfig covers .tsx/.mjs instead of .svelte; Test.ps1 help names
  the WebUI typecheck + lint.
- Initialize-Repository.ps1 refuses Node older than 22 up front (the NATS
  browser client needs it; npm's engines check already enforced it later).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 22:18:56 -04:00

48 lines
1.7 KiB
PowerShell

<#
.SYNOPSIS
One-time developer setup: verifies prerequisites, restores dependencies and
generates local secrets when missing.
#>
[CmdletBinding()]
param()
$ErrorActionPreference = 'Stop'
$repoRoot = Split-Path -Parent $PSScriptRoot
Write-Host '── Checking prerequisites ──'
$dotnet = Get-Command dotnet -ErrorAction SilentlyContinue
if (-not $dotnet) { throw '.NET SDK 10.x is required (https://dotnet.microsoft.com).' }
Write-Host "dotnet $(dotnet --version)"
$node = Get-Command node -ErrorAction SilentlyContinue
if (-not $node) { throw 'Node.js 22 or later is required (https://nodejs.org).' }
# The NATS browser client (@nats-io/*) needs Node 22+; npm enforces it too (engines).
$nodeMajor = [int]((node --version).TrimStart('v').Split('.')[0])
if ($nodeMajor -lt 22) { throw "Node.js 22 or later is required; found $(node --version)." }
Write-Host "node $(node --version)"
Write-Host '── Restoring .NET packages ──'
dotnet restore (Join-Path $repoRoot 'ExecuteR.slnx')
if ($LASTEXITCODE -ne 0) { throw "dotnet restore failed ($LASTEXITCODE)." }
Write-Host '── Installing WebUI packages ──'
Push-Location (Join-Path $repoRoot 'src/WebUI')
try {
npm ci
if ($LASTEXITCODE -ne 0) { throw "npm ci failed ($LASTEXITCODE)." }
}
finally {
Pop-Location
}
if (-not (Test-Path (Join-Path $repoRoot '.env'))) {
Write-Host '── Generating local secrets ──'
& (Join-Path $PSScriptRoot 'New-LocalSecrets.ps1')
}
Write-Host ''
Write-Host 'Repository initialized. Next steps:'
Write-Host ' docker compose up -d # NATS + backend + webui'
Write-Host ' ./scripts/Build.ps1 # build everything'
Write-Host ' ./scripts/Test.ps1 # run tests'