mirror of
https://github.com/MrPatben8/konduktor.git
synced 2026-11-27 10:22:51 +01:00
Fixed library options not appearing in windows
This commit is contained in:
1 parent
d10b11f8eb
commit
cd1914216f
5 files changed
+66
-2
No files matched your search
@@ -33,6 +33,18 @@ npm install
|
||||
cd ..
|
||||
```
|
||||
|
||||
## Develop (no build)
|
||||
|
||||
```powershell
|
||||
.\dev.ps1 # backend on :8000 + Vite on :5173, both reloading; Ctrl-C stops both
|
||||
```
|
||||
|
||||
Then open <http://localhost:5173> in a browser. This is `dev.sh` for Windows.
|
||||
It runs the Python source, not the frozen sidecar, so it cannot show
|
||||
desktop-shell behaviour (startup screen, quit prompt, WebView2). For that, use
|
||||
`npx tauri dev` in `frontend` — but note it still spawns the FROZEN sidecar from
|
||||
`src-tauri\binaries\`, so backend changes need `build_sidecar.ps1` first.
|
||||
|
||||
## Build
|
||||
|
||||
```powershell
|
||||
|
||||
@@ -1098,6 +1098,7 @@ Two independent apps that talk over HTTP:
|
||||
|
||||
```bash
|
||||
./dev.sh # start both servers (see README for one-time setup)
|
||||
.\dev.ps1 # the same on Windows (BUILDING-WINDOWS.md)
|
||||
|
||||
# Backend
|
||||
cd backend && source .venv/bin/activate
|
||||
|
||||
@@ -16,7 +16,12 @@ Set-Location $Root
|
||||
$Py = Join-Path $Root ".venv\Scripts\python.exe"
|
||||
if (-not (Test-Path $Py)) { $Py = "python" }
|
||||
|
||||
& $Py -m PyInstaller --noconfirm --clean konduktor-sidecar.spec
|
||||
# PyInstaller logs to stderr. Windows PowerShell 5.1 (unlike pwsh 7) turns a
|
||||
# native command's stderr into an error record, which "Stop" makes fatal on the
|
||||
# first INFO line — so relax it for this call and judge by the exit code.
|
||||
$ErrorActionPreference = "Continue"
|
||||
& $Py -m PyInstaller --noconfirm --clean konduktor-sidecar.spec 2>&1 | ForEach-Object { "$_" }
|
||||
$ErrorActionPreference = "Stop"
|
||||
if ($LASTEXITCODE -ne 0) { throw "PyInstaller failed ($LASTEXITCODE)" }
|
||||
Write-Host "Built: $Root\dist\konduktor-sidecar\"
|
||||
|
||||
|
||||
@@ -120,8 +120,12 @@ app.add_middleware(
|
||||
"http://localhost:5173",
|
||||
"http://127.0.0.1:5173",
|
||||
# Packaged desktop app: the webview's origin when Tauri loads the built
|
||||
# frontend (macOS uses tauri://, Windows/Linux use https://tauri.localhost).
|
||||
# frontend. macOS uses tauri://; Windows/Linux default to
|
||||
# https://tauri.localhost, but lib.rs forces the http scheme
|
||||
# (use_https_scheme(false)) so the sidecar is not mixed content —
|
||||
# without the http origin here, the Windows app reaches no API at all.
|
||||
"tauri://localhost",
|
||||
"http://tauri.localhost",
|
||||
"https://tauri.localhost",
|
||||
],
|
||||
allow_methods=["*"],
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
# Start both Konduktor servers (backend + frontend) together - the Windows
|
||||
# counterpart of dev.sh. Ctrl-C stops both. First run? See one-time setup in
|
||||
# BUILDING-WINDOWS.md (the backend venv and `npm install`).
|
||||
#
|
||||
# .\dev.ps1
|
||||
# (if scripts are blocked: powershell -ExecutionPolicy Bypass -File .\dev.ps1)
|
||||
$ErrorActionPreference = "Stop"
|
||||
$Root = $PSScriptRoot
|
||||
|
||||
$Py = Join-Path $Root "backend\.venv\Scripts\python.exe"
|
||||
if (-not (Test-Path $Py)) { throw "No backend venv at backend\.venv - see BUILDING-WINDOWS.md for setup." }
|
||||
# Vite through node, not `npm run dev`: npm is a .cmd batch file, and Ctrl-C in a
|
||||
# shared console makes cmd ask "Terminate batch job (Y/N)?" instead of exiting.
|
||||
$Vite = Join-Path $Root "frontend\node_modules\vite\bin\vite.js"
|
||||
if (-not (Test-Path $Vite)) { throw "No frontend\node_modules - run ``npm install`` in frontend first." }
|
||||
|
||||
# Backend (FastAPI on :8000)
|
||||
$Backend = Start-Process -FilePath $Py -NoNewWindow -PassThru `
|
||||
-ArgumentList "-m", "uvicorn", "konduktor.main:app", "--reload", "--port", "8000", "--app-dir", "`"$Root\backend`""
|
||||
|
||||
# Frontend (Vite on :5173, proxies /api -> :8000)
|
||||
$Frontend = Start-Process -FilePath "node" -NoNewWindow -PassThru `
|
||||
-WorkingDirectory (Join-Path $Root "frontend") -ArgumentList "`"$Vite`""
|
||||
|
||||
Write-Host ""
|
||||
Write-Host " Konduktor is starting..."
|
||||
Write-Host " -> App: http://localhost:5173"
|
||||
Write-Host " -> API docs: http://localhost:8000/docs"
|
||||
Write-Host " (Ctrl-C to stop both)"
|
||||
Write-Host ""
|
||||
|
||||
try {
|
||||
# If either one dies, stop the other rather than leave half a dev setup.
|
||||
while (-not $Backend.HasExited -and -not $Frontend.HasExited) { Start-Sleep -Milliseconds 500 }
|
||||
}
|
||||
finally {
|
||||
# Kill the whole tree: uvicorn --reload runs the server in a child process,
|
||||
# which would otherwise keep :8000 bound after the reloader has gone.
|
||||
foreach ($p in $Backend, $Frontend) {
|
||||
if ($p -and -not $p.HasExited) { & taskkill /PID $p.Id /T /F 2>&1 | Out-Null }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user