Files
zeekay 94741a8363 refactor(rebrand): sweep the remaining langflow — env vars, identifiers, stragglers
Completes the rebrand per direction: LANGFLOW_/LANGFLOW -> FLOW_/FLOW (env vars,
headers), langflow_ -> flow_ (settings fields, local vars), camelCase identifiers
(LangflowClient/Logo/HTTPError, builtWithLangflow, getLangflowDesktop) -> Flow*,
and all remaining bare tokens. Fixed the identifier-space hazard (Langflow ->
'Hanzo Flow' is prose-only; in code it collapses to Flow so no identifier gains a
space). compileall of flow + lfx is clean.

Repo-wide langflow now = 4, all the protected MIT attribution to langflow-ai/
langflow in README (legally required; deliberately preserved).

Breaking (per no-backwards-compat / forward-perfection): the LANGFLOW_* env-var
prefix is now FLOW_* — deployments must update their env. CI's uv + frontend
build is the runtime gate.
2026-07-16 10:18:53 -07:00

104 lines
3.3 KiB
PowerShell

#!/usr/bin/env pwsh
Write-Host "Starting Hanzo Flow build and run process..." -ForegroundColor Green
# Check if .env file exists and set env file parameter
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
$projectRoot = Resolve-Path (Join-Path $scriptDir "..\..")
$envPath = Join-Path $projectRoot ".env"
$useEnvFile = $false
if (Test-Path $envPath) {
Write-Host "Found .env file at: $envPath" -ForegroundColor Cyan
$useEnvFile = $true
} else {
Write-Host ".env file not found at: $envPath" -ForegroundColor Yellow
Write-Host "Hanzo Flow will use default configuration" -ForegroundColor Yellow
}
# Step 1: Install frontend dependencies
Write-Host "`nStep 1: Installing frontend dependencies..." -ForegroundColor Yellow
try {
Set-Location "..\..\src\frontend"
Write-Host "Running npm install..."
npm install
if ($LASTEXITCODE -ne 0) {
throw "npm install failed"
}
} catch {
Write-Host "Error in frontend dependency installation: $_" -ForegroundColor Red
Read-Host "Press Enter to exit"
exit 1
}
# Step 2: Build frontend
Write-Host "`nStep 2: Building frontend..." -ForegroundColor Yellow
try {
Write-Host "Running npm run build..."
npm run build
if ($LASTEXITCODE -ne 0) {
throw "npm run build failed"
}
} catch {
Write-Host "Error in frontend build: $_" -ForegroundColor Red
Read-Host "Press Enter to exit"
exit 1
}
# Step 3: Copy build files
Write-Host "`nStep 3: Copying build files to backend..." -ForegroundColor Yellow
try {
Set-Location "..\.."
# Determine build directory
$buildDir = if (Test-Path "src\frontend\build") {
"src\frontend\build"
} elseif (Test-Path "src\frontend\dist") {
"src\frontend\dist"
} else {
throw "Neither build nor dist directory found in src\frontend"
}
$targetDir = "src\backend\base\flow\frontend"
Write-Host "Copying from $buildDir to $targetDir"
# Create target directory if it doesn't exist
if (-not (Test-Path $targetDir)) {
New-Item -Path $targetDir -ItemType Directory -Force | Out-Null
}
# Remove existing files in target directory (FORCES CLEAN REPLACEMENT)
Write-Host "Removing existing files from target directory..." -ForegroundColor Cyan
if (Test-Path "$targetDir\*") {
Remove-Item "$targetDir\*" -Recurse -Force
}
# Copy all files from build directory
Copy-Item "$buildDir\*" -Destination $targetDir -Recurse -Force
Write-Host "Build files copied successfully!" -ForegroundColor Green
} catch {
Write-Host "Error copying files: $_" -ForegroundColor Red
Read-Host "Press Enter to exit"
exit 1
}
# Step 4: Run Hanzo Flow
Write-Host "`nStep 4: Running Hanzo Flow..." -ForegroundColor Yellow
Write-Host "`nAttention: Wait until uvicorn is running before opening the browser" -ForegroundColor Red
try {
# Change to project root directory for uv
Set-Location $projectRoot
if ($useEnvFile) {
Write-Host "Using env file: .env" -ForegroundColor Cyan
& uv run --env-file ".env" flow run
} else {
& uv run flow run
}
} catch {
Write-Host "Error running flow: $_" -ForegroundColor Red
Read-Host "Press Enter to exit"
exit 1
}
Write-Host "`nHanzo Flow build and run process completed!" -ForegroundColor Green
Read-Host "Press Enter to exit"