diff --git a/studio/setup.ps1 b/studio/setup.ps1 index e9a211eb45..f797313964 100644 --- a/studio/setup.ps1 +++ b/studio/setup.ps1 @@ -757,14 +757,20 @@ if ($IsPipInstall) { Write-Host "[OK] Running from pip install - frontend already bundled, skipping build" -ForegroundColor Green } elseif (Test-Path $DistDir) { $DistTime = (Get-Item $DistDir).LastWriteTime - # Check src/ and public/ recursively - $NewerFile = Get-ChildItem -Path $FrontendDir -Include "src","public" -Directory -ErrorAction SilentlyContinue | - ForEach-Object { Get-ChildItem -Path $_.FullName -Recurse -File -ErrorAction SilentlyContinue } | - Where-Object { $_.LastWriteTime -gt $DistTime } | Select-Object -First 1 - # Also check top-level config files (package.json, vite.config.ts, etc.) + $NewerFile = $null + # Check src/ and public/ recursively (probe paths directly, not via -Include) + foreach ($subDir in @("src", "public")) { + $subPath = Join-Path $FrontendDir $subDir + if (Test-Path $subPath) { + $NewerFile = Get-ChildItem -Path $subPath -Recurse -File -ErrorAction SilentlyContinue | + Where-Object { $_.LastWriteTime -gt $DistTime } | Select-Object -First 1 + if ($NewerFile) { break } + } + } + # Also check ALL top-level files (package.json, index.html, bun.lock, configs, etc.) if (-not $NewerFile) { $NewerFile = Get-ChildItem -Path $FrontendDir -File -ErrorAction SilentlyContinue | - Where-Object { $_.Name -match '\.(json|ts|js|mjs)$' -and $_.LastWriteTime -gt $DistTime } | + Where-Object { $_.LastWriteTime -gt $DistTime } | Select-Object -First 1 } if (-not $NewerFile) { diff --git a/studio/setup.sh b/studio/setup.sh index 2c93d57f78..c0694df1aa 100755 --- a/studio/setup.sh +++ b/studio/setup.sh @@ -47,8 +47,9 @@ fi # and upgrades/pulls (source newer than dist/ triggers rebuild). _NEED_FRONTEND_BUILD=true if [ -d "$SCRIPT_DIR/frontend/dist" ]; then - _changed=$(find "$SCRIPT_DIR/frontend" -maxdepth 1 -name "*.json" -o -name "*.ts" -o -name "*.js" -o -name "*.mjs" | \ - xargs -r find -newer "$SCRIPT_DIR/frontend/dist" 2>/dev/null | head -1) + # Check top-level config files (package.json, vite.config.ts, index.html, bun.lock, etc.) + _changed=$(find "$SCRIPT_DIR/frontend" -maxdepth 1 -type f -newer "$SCRIPT_DIR/frontend/dist" 2>/dev/null | head -1) + # Check src/ and public/ recursively if [ -z "$_changed" ]; then _changed=$(find "$SCRIPT_DIR/frontend/src" "$SCRIPT_DIR/frontend/public" \ -type f -newer "$SCRIPT_DIR/frontend/dist" 2>/dev/null | head -1) @@ -162,8 +163,8 @@ echo "✅ Frontend built to frontend/dist" fi # end frontend build check -# ── oxc-validator runtime (always install, independent of frontend build) ── -if [ -d "$SCRIPT_DIR/backend/core/data_recipe/oxc-validator" ]; then +# ── oxc-validator runtime (needs npm -- skip if not available) ── +if [ -d "$SCRIPT_DIR/backend/core/data_recipe/oxc-validator" ] && command -v npm &>/dev/null; then cd "$SCRIPT_DIR/backend/core/data_recipe/oxc-validator" run_quiet "npm install (oxc validator runtime)" npm install cd "$SCRIPT_DIR"