feat(housekeeping): validate preview route runtime

This commit is contained in:
Simo committed 2026-08-31 18:45:45 +02:00
1 parent d868c990bf
commit 543607a80e
17 files changed
+466 -6

No files matched your search

@@ -80,6 +80,20 @@ export function createHousekeepingRegistry(
validateNonEmpty(route.labelKey, "route label key");
validateCapability(route.capability);
}
if (manifest.routes.length === 0) {
if (manifest.landingRouteId !== null) {
throw new Error(
`landing route without routes: ${manifest.landingRouteId}`,
);
}
} else if (manifest.landingRouteId === null) {
throw new Error(`missing landing route: ${manifest.id}`);
} else if (
!manifest.routes.some((route) => route.id === manifest.landingRouteId)
) {
throw new Error(`invalid landing route: ${manifest.landingRouteId}`);
}
}
return { domains: Object.freeze([...manifests]) };