standalone-hardening 0006: redirect non-editor routes to the mgmt app

VITE_APP_URL (build-editor --app-base, set to app.pcbjam.com in release CI)
turns on a redirect gate in App: home, project overview and mgmt-only paths
bounce to the mgmt app preserving path+search; tool boots, file deep-links,
lib editors and the @local pseudo-scope stay local. Unset (dev/demo) keeps
today's behavior. Policy is a pure helper (lib/redirect.ts) + vitest table.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A42xfPFNdfsUt9eowkC9eM
This commit is contained in:
Gergő Törcsvári 2026-07-16 14:24:31 +02:00
commit abb0923f70
No known key found for this signature in database
GPG key ID: 8E75F2CDE64E5322
8 changed files with 140 additions and 2 deletions

View file

@ -34,6 +34,12 @@ VITE_WASM_ROOT=/wasm
# Marketing / landing page the version badge links to (default https://pcbjam.com).
# VITE_LANDING_URL=https://pcbjam.com
# Companion management app origin. When set (the backed editor.pcbjam.com
# deploy), non-editor routes — home, project overview, mgmt-only paths —
# redirect there, preserving path + search (standalone-hardening 0006).
# Leave UNSET for dev and the demo: every route renders locally.
# VITE_APP_URL=https://app.pcbjam.com
# Where the in-editor waitlist form POSTs (default https://www.pcbjam.com/api/waitlist).
# The demo is static with no backend, so it cross-posts to the landing site's
# serverless endpoint, which must send CORS for this origin (see