feat(router): discover app/authz declarations

Scan app/authz/<name>.{ts,js} the same way app/schemas is scanned,
exposing Router.authz: ComponentRef[]. Also update the two other
literal Router construction sites (prod runtime, dev-server test
fixture) that now need the new required field.

scanDir gains an optional extraExtensions parameter (default []) so
the authz scan can accept .js files without widening the extension
allow-list used by route scanning (app/pages, app/api, app/realtime),
which would otherwise leak .js into generated route URLs via
fileToRoute.
This commit is contained in:
2026-08-04 19:52:37 +05:30
parent 703baa1ead
commit e7743cdbb5
5 changed files with 72 additions and 2 deletions
@@ -13,6 +13,7 @@ function runtime(health: HealthRegistry, trustProxy = false) {
layouts: [],
stores: [],
schemas: [],
authz: [],
matchPage: () => null,
matchApi: () => null,
matchRealtime: () => null,