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

@ -50,6 +50,16 @@ export const LANDING_URL = (
import.meta.env.VITE_LANDING_URL || "https://pcbjam.com"
).replace(/\/+$/, "");
/**
* The companion management app's origin (no trailing slash), e.g.
* "https://app.pcbjam.com". When set (the backed editor deploy), non-editor
* surfaces — home, project overview, mgmt-only paths — redirect there; see
* lib/redirect.ts (standalone-hardening 0006). Unset (dev / demo) keeps every
* route local.
*/
export const APP_URL =
(import.meta.env.VITE_APP_URL || "").replace(/\/+$/, "") || null;
/**
* Where the in-editor waitlist form POSTs. The demo is a fully static deploy with
* no backend, so it cross-posts to the landing site's serverless endpoint (which