Function routesFromPages
-
routesFromPages(
pages: readonly PageLike[],
declarations: Readonly<Record<string, RouteDeclaration>>,
): { routes: Route[]; uncovered: UncoveredPage[] }Parameters
- pages: readonly PageLike[]
- declarations: Readonly<Record<string, RouteDeclaration>>
Returns { routes: Route[]; uncovered: UncoveredPage[] }
Turns a framework's registrations into routes.
declarationsmaps a spool pattern to what only the operator knows: the template or renderer, the family's dataset, the scope,freshness,depends. The helper adds no default of its own, so each declaration is thedefineRoutedeclaration for its pattern.It checks both directions. A declaration whose pattern the framework did not register throws
bad-routeand names the pattern, which catches a typo and a page that was renamed or deleted. A registered pattern with no declaration gets no route (the network answers it) and comes back inuncovered, so print it. A declaration that reads a dataset (familyorquery.dataset) must setscopeorauthitself: the helper never takes the defaultpublicfor a dataset it did not see. A registration whose path did not convert has no pattern and cannot be declared. A pattern the framework lists twice gets one route. Routes come back in registration order, and the first one that matches a path answers it.