Skip to content

feat(scripts): add frontend and status npm shortcuts - #161

Open
tryingET wants to merge 1 commit into
agnt-gg:mainfrom
tryingET:feat/npm-frontend-status-shortcuts
Open

tryingET wants to merge 1 commit into
agnt-gg:mainfrom
tryingET:feat/npm-frontend-status-shortcuts

Conversation

@tryingET

@tryingET tryingET commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

What problem does this solve?

Closes #121. Implements the slim PR requested in #121 (comment) and the more specific scope on #122: build:frontend, dev:frontend, and app:status only.

How does it solve it?

  • Two root npm aliases delegate to the existing frontend scripts, forwarding arguments and child exit codes. Existing desktop build and backend dev remain unchanged.
  • app:status reads existing system/status and health endpoints, checks state and matching PID, supports JSON and a bounded deadline, and returns nonzero on draining or invalid/unavailable health.
  • Status is cross-platform Node code: no /proc, credentials, dotenv, socket, restart endpoint, Electron changes, or alternate authorization mechanism. It reports a backend snapshot, not checkout ownership or frontend readiness.
  • Adds documentation and 15 tests to the existing gating backend Vitest suite. Carries forward applicable feat(just): add operator interface and dual-path restart #127 cases: exact delegation once, quoted argv, no wrapper dotenv loading, failure propagation and preservation of existing commands. Justfile-specific compound CI/package/rebuild-restart recipes are deliberately not introduced.

Fresh branch from upstream main 1b1fcc79, not stacked on #122 or #127. No Justfile, Just dependency/CI, restart command, generated assets, lockfile drift or unrelated fixes.

How did you verify it?

Linux, Node 26.9.0. Dependency directories reused from an installed checkout; source and generated build output isolated in a new worktree. Initial unadjusted baseline exposed Node 26 native webstorage interference and a hidden TMPDIR ancestor rejected by portable-bundle tests. Reran before implementation with NODE_OPTIONS=--no-experimental-webstorage and a plain TMPDIR. No tests or source changed to accommodate these environment differences.

Pristine upstream backend: 428 files passed; 6358 passed, 1 skipped
New tests before implementation: 13 failed, 2 passed
  build:frontend/dev:frontend: expected forwarding script, received undefined
  status/help: npm command exited 1 because app:status was absent
New tests after implementation: 15 passed, 0 skipped
Final backend: 429 files passed; 6373 passed, 1 skipped
Frontend baseline AND final: 281 files passed; 4615 assertions passed
  Both runs also report 2 unhandled PopupTutorial teardown errors:
  ReferenceError: window is not defined, useCleanup.js:41
  Frontend suite exit is nonzero; not claimed green.
npm run build:frontend: production build successful (14.60s)
npm run dev:frontend -- --help: reaches Vite 5.4.21
npm --silent run app:status -- --json: running/healthy, matching PID
node scripts/normalize-eol.mjs --check: 0 rewrites
Git whitespace check: pass

Tests execute real npm against disposable recorders and real local HTTP fixtures. They cover GET-only/no credentials, draining, malformed status, PID mismatch, unhealthy response, HTTP errors, redirects, invalid JSON, oversized responses, timeout, rejected options and help. A read-only smoke also queried a running backend successfully; no live restart, renderer reload or deployment performed. Browser suite and native Windows execution were not run locally.

Checklist

  • This does not modify auth, sessions, or credential handling
  • This is not a fix for a security vulnerability
  • npm test passes
  • npm --prefix frontend test passes (same two existing teardown errors as pristine main)
  • New behaviour has tests, and I watched them fail before the fix
  • Docs updated if the surface changed
  • Commit subjects are 72 characters or fewer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add explicit npm commands for local app lifecycle

1 participant