Builds the markers, data block and stand-in host for the CMS host injection

The pages carry the CMS markers (data block, list regions, JSON-LD price,
inline price); PackagesProvider reads the host's data block after hydration
and asks the API only when there is none; the site address comes from the
block. A stand-in for the host (config/hostInjector.ts, --cms-data in the
preview server) and browser tests check the behaviour with different data.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-15 16:21:08 +01:00
co-authored by Claude Sonnet 5.5
parent 16027f5688
commit bf21b6f690
26 changed files with 1207 additions and 70 deletions
+5 -1
View File
@@ -1,5 +1,6 @@
import type { AddressInfo } from 'node:net';
import { resolve } from 'node:path';
import type { InjectOptions } from '../../config/hostInjector.ts';
import { startPreviewServer } from '../../config/previewServer.ts';
// De gebouwde site: `pnpm build` schrijft hem, de tests bouwen niets. Relatief
@@ -12,7 +13,10 @@ export const clientDir = resolve('dist/client');
// auditRoute zet de opt-in route /__audit/404 aan, zoals Lighthouse hem start.
// De contact-API wordt standaard nagebootst (CI heeft geen CMS-host); een
// test die iets anders nodig heeft vervangt het met page.route.
export async function startServer(options: { auditRoute?: boolean } = {}) {
// inject laat de server doen alsof de CMS-host de markers vult (hostInjector)
export async function startServer(
options: { auditRoute?: boolean; inject?: () => InjectOptions | null } = {},
) {
const server = await startPreviewServer(clientDir, 0, {
contactStub: true,
...options,