`/studio/releases` answered a plain-text 404 from nginx. The route existed, the chunk was built, and the SPA could reach the screen by client-side navigation — but a hard load or a reload never got that far, because the web server had never been told the path exists. The public half of the serving contract derives its patterns from the route registry. The Studio half was a hand-maintained array, and it failed the way hand-maintained arrays fail: the comment above `^/studio/assets$` records that exact bug being fixed once already, and adding a route repeated it immediately. Both halves now come from the same source, so a Studio route that exists is served without anyone having to remember. Deriving them yields one pattern per route rather than the old alternation that folded the four document sub-screens together. Same matched set, and it no longer needs a human to keep the grouping honest.
19 lines
922 B
TypeScript
19 lines
922 B
TypeScript
import { TECH_LOG_ROUTE_REGISTRY } from "../src/features/tech-log/contracts/tech-log-route-contract.ts";
|
|
import { writeTechLogServingArtifact } from "./lib/tech-log-serving-artifact.ts";
|
|
import { createTechLogServingContract } from "./lib/tech-log-serving-contract.ts";
|
|
|
|
// The router owns which public paths exist. Reading them from the catalog
|
|
// instead — as this did — pinned the served set to whatever the bundled fixture
|
|
// contained on the day of the build.
|
|
const publicRoutePaths = Object.values(TECH_LOG_ROUTE_REGISTRY)
|
|
.filter((route) => route.layoutGroup === "PUBLIC")
|
|
.map((route) => route.path);
|
|
|
|
const studioRoutePaths = Object.values(TECH_LOG_ROUTE_REGISTRY)
|
|
.filter((route) => route.layoutGroup === "STUDIO")
|
|
.map((route) => route.path);
|
|
|
|
const contract = createTechLogServingContract({ publicRoutePaths, studioRoutePaths });
|
|
|
|
await writeTechLogServingArtifact({ distRoot: "dist", contract });
|