Skip to content
@drupflare/spool v1.0.0 GitHub
    Preparing search index...

    Function routesFromPages

    • Turns a framework's registrations into routes. declarations maps 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 the defineRoute declaration for its pattern.

      It checks both directions. A declaration whose pattern the framework did not register throws bad-route and 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 in uncovered, so print it. A declaration that reads a dataset (family or query.dataset) must set scope or auth itself: the helper never takes the default public for 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.

      Parameters

      Returns { routes: Route[]; uncovered: UncoveredPage[] }