Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

fix: prefer local repo build over stale cached frontend in serve command (#43)

Selene29b874618b61ee
diff --git a/packages/cli/src/repowise/cli/commands/serve_cmd.py b/packages/cli/src/repowise/cli/commands/serve_cmd.py
index 662491025..f303b42e0 100644
--- a/packages/cli/src/repowise/cli/commands/serve_cmd.py
+++ b/packages/cli/src/repowise/cli/commands/serve_cmd.py
@@ -260,20 +260,10 @@ def _start_frontend(node: str, backend_port: int, frontend_port: int) -> subproc
"PORT": str(frontend_port),
}
- # Option 1: Cached download
- cached_server = _WEB_CACHE_DIR / "server.js"
- if cached_server.exists():
- return subprocess.Popen(
- [node, str(cached_server)],
- cwd=str(_WEB_CACHE_DIR),
- env=env,
- )
-
- # Option 2: Local repo build
+ # Option 1: Local repo build (preferred — uses latest source)
local_web = _find_local_web()
if local_web:
standalone_dir = local_web / ".next" / "standalone"
- # Next.js standalone in monorepos nests server under the package path
server_js = standalone_dir / "packages" / "web" / "server.js"
if server_js.exists():
# Copy static files into standalone (Next.js requirement)
@@ -292,6 +282,15 @@ def _start_frontend(node: str, backend_port: int, frontend_port: int) -> subproc
env=env,
)
+ # Option 2: Cached download (fallback for pip-installed users)
+ cached_server = _WEB_CACHE_DIR / "server.js"
+ if cached_server.exists():
+ return subprocess.Popen(
+ [node, str(cached_server)],
+ cwd=str(_WEB_CACHE_DIR),
+ env=env,
+ )
+
return None