@timber-js/app 0.2.0-alpha.96 → 0.2.0-alpha.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/_chunks/{metadata-routes-DS3eKNmf.js → metadata-routes-BU684ls2.js} +1 -1
  2. package/dist/_chunks/{metadata-routes-DS3eKNmf.js.map → metadata-routes-BU684ls2.js.map} +1 -1
  3. package/dist/_chunks/segment-classify-BjfuctV2.js +137 -0
  4. package/dist/_chunks/segment-classify-BjfuctV2.js.map +1 -0
  5. package/dist/_chunks/{interception-BsLCA9gk.js → walkers-VOXgavMF.js} +66 -92
  6. package/dist/_chunks/walkers-VOXgavMF.js.map +1 -0
  7. package/dist/adapters/nitro.d.ts.map +1 -1
  8. package/dist/adapters/nitro.js +55 -5
  9. package/dist/adapters/nitro.js.map +1 -1
  10. package/dist/client/index.js +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +189 -62
  13. package/dist/index.js.map +1 -1
  14. package/dist/plugins/build-report.d.ts +6 -4
  15. package/dist/plugins/build-report.d.ts.map +1 -1
  16. package/dist/plugins/dev-404-page.d.ts +8 -18
  17. package/dist/plugins/dev-404-page.d.ts.map +1 -1
  18. package/dist/routing/index.d.ts +5 -3
  19. package/dist/routing/index.d.ts.map +1 -1
  20. package/dist/routing/index.js +3 -3
  21. package/dist/routing/link-codegen.d.ts.map +1 -1
  22. package/dist/routing/scanner.d.ts +1 -10
  23. package/dist/routing/scanner.d.ts.map +1 -1
  24. package/dist/routing/segment-classify.d.ts +37 -8
  25. package/dist/routing/segment-classify.d.ts.map +1 -1
  26. package/dist/routing/types.d.ts +63 -23
  27. package/dist/routing/types.d.ts.map +1 -1
  28. package/dist/routing/walkers.d.ts +51 -0
  29. package/dist/routing/walkers.d.ts.map +1 -0
  30. package/dist/server/action-handler.d.ts.map +1 -1
  31. package/dist/server/dev-holding-server.d.ts +4 -2
  32. package/dist/server/dev-holding-server.d.ts.map +1 -1
  33. package/dist/server/html-injector-core.d.ts +212 -0
  34. package/dist/server/html-injector-core.d.ts.map +1 -0
  35. package/dist/server/html-injectors.d.ts +59 -59
  36. package/dist/server/html-injectors.d.ts.map +1 -1
  37. package/dist/server/internal.js +710 -563
  38. package/dist/server/internal.js.map +1 -1
  39. package/dist/server/node-stream-transforms.d.ts +46 -49
  40. package/dist/server/node-stream-transforms.d.ts.map +1 -1
  41. package/dist/server/pipeline-helpers.d.ts +88 -0
  42. package/dist/server/pipeline-helpers.d.ts.map +1 -0
  43. package/dist/server/pipeline-phases.d.ts +97 -0
  44. package/dist/server/pipeline-phases.d.ts.map +1 -0
  45. package/dist/server/pipeline.d.ts +53 -32
  46. package/dist/server/pipeline.d.ts.map +1 -1
  47. package/dist/server/port-resolution.d.ts +117 -0
  48. package/dist/server/port-resolution.d.ts.map +1 -0
  49. package/dist/server/route-matcher.d.ts +20 -47
  50. package/dist/server/route-matcher.d.ts.map +1 -1
  51. package/dist/server/rsc-entry/index.d.ts.map +1 -1
  52. package/dist/server/rsc-entry/wrap-action-dispatch.d.ts +74 -0
  53. package/dist/server/rsc-entry/wrap-action-dispatch.d.ts.map +1 -0
  54. package/dist/server/status-code-resolver.d.ts +16 -11
  55. package/dist/server/status-code-resolver.d.ts.map +1 -1
  56. package/dist/server/tree-builder.d.ts.map +1 -1
  57. package/dist/utils/directive-parser.d.ts +0 -45
  58. package/dist/utils/directive-parser.d.ts.map +1 -1
  59. package/package.json +7 -6
  60. package/src/adapters/nitro.ts +55 -5
  61. package/src/cli.ts +0 -0
  62. package/src/index.ts +84 -31
  63. package/src/plugins/build-report.ts +13 -22
  64. package/src/plugins/dev-404-page.ts +15 -41
  65. package/src/plugins/routing.ts +14 -12
  66. package/src/routing/codegen.ts +1 -1
  67. package/src/routing/convention-lint.ts +4 -4
  68. package/src/routing/index.ts +5 -3
  69. package/src/routing/interception.ts +1 -1
  70. package/src/routing/link-codegen.ts +25 -13
  71. package/src/routing/scanner.ts +17 -93
  72. package/src/routing/segment-classify.ts +107 -8
  73. package/src/routing/status-file-lint.ts +3 -3
  74. package/src/routing/types.ts +63 -23
  75. package/src/routing/walkers.ts +90 -0
  76. package/src/server/action-handler.ts +6 -0
  77. package/src/server/deny-renderer.ts +5 -5
  78. package/src/server/dev-holding-server.ts +4 -2
  79. package/src/server/fallback-error.ts +1 -1
  80. package/src/server/html-injector-core.ts +403 -0
  81. package/src/server/html-injectors.ts +158 -297
  82. package/src/server/node-stream-transforms.ts +108 -248
  83. package/src/server/pipeline-helpers.ts +180 -0
  84. package/src/server/pipeline-phases.ts +591 -0
  85. package/src/server/pipeline.ts +76 -539
  86. package/src/server/port-resolution.ts +215 -0
  87. package/src/server/route-element-builder.ts +1 -1
  88. package/src/server/route-matcher.ts +28 -60
  89. package/src/server/rsc-entry/api-handler.ts +2 -2
  90. package/src/server/rsc-entry/error-renderer.ts +1 -1
  91. package/src/server/rsc-entry/index.ts +52 -98
  92. package/src/server/rsc-entry/wrap-action-dispatch.ts +156 -0
  93. package/src/server/sitemap-generator.ts +1 -1
  94. package/src/server/slot-resolver.ts +1 -1
  95. package/src/server/status-code-resolver.ts +112 -128
  96. package/src/server/tree-builder.ts +6 -4
  97. package/src/utils/directive-parser.ts +0 -392
  98. package/LICENSE +0 -8
  99. package/dist/_chunks/interception-BsLCA9gk.js.map +0 -1
  100. package/dist/_chunks/segment-classify-BDNn6EzD.js +0 -65
  101. package/dist/_chunks/segment-classify-BDNn6EzD.js.map +0 -1
  102. package/dist/server/manifest-status-resolver.d.ts +0 -58
  103. package/dist/server/manifest-status-resolver.d.ts.map +0 -1
  104. package/src/server/manifest-status-resolver.ts +0 -215
@@ -42,13 +42,15 @@ interface RouteInfo {
42
42
  /**
43
43
  * Walk the route tree and collect all leaf routes (pages + API endpoints).
44
44
  *
45
- * Parallel slots (`@artists`, `@shows`, etc.) are intentionally skipped —
46
- * they render alongside the parent page at the same URL and are not
47
- * separately URL-addressable. Their JS is captured in shared/layout chunks.
45
+ * Wraps the shared `collectLeafRoutes` walker (TIM-848). Parallel slots
46
+ * (`@artists`, `@shows`, etc.) are intentionally skipped they render
47
+ * alongside the parent page at the same URL and are not separately
48
+ * URL-addressable. Their JS is captured in shared/layout chunks.
48
49
  *
49
50
  * After collection, entries are deduplicated by URL path so that overlapping
50
51
  * route groups (e.g. `(browse)` and `(marketing)` both producing `/`) only
51
- * appear once. The entry with the largest route-specific size wins.
52
+ * appear once. The entry with the longest segment chain (most specific
53
+ * match) wins.
52
54
  */
53
55
  export declare function collectRoutes(tree: RouteTree): RouteInfo[];
54
56
  /** Produce formatted report lines for the Vite logger. */
@@ -1 +1 @@
1
- {"version":3,"file":"build-report.d.ts","sourceRoot":"","sources":["../../src/plugins/build-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAU,MAAM,MAAM,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIhD,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAE1D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAC;CACvB;AAUD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,WAAW,EAAE,EACvB,UAAU,GAAE,QAAQ,GAAG,QAAmB,GACzC,SAAS,CAYX;AAID,OAAO,EAAE,UAAU,EAAE,CAAC;AAQtB,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,WAAW,EAAE,CAAC;IACx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6EAA6E;AAC7E,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAYjG;AAOD,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GACtC,MAAM,GAAG,IAAI,CAOf;AAwED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAwE5D"}
@@ -12,33 +12,23 @@
12
12
  *
13
13
  * Design doc: 21-dev-server.md, 07-routing.md
14
14
  */
15
+ import type { SegmentNode } from '../routing/types.js';
15
16
  interface RouteInfo {
16
17
  /** URL path pattern (e.g., "/dashboard/[id]") */
17
18
  path: string;
18
19
  /** Whether this is a page route or API route handler */
19
20
  type: 'page' | 'route';
20
21
  }
21
- /** Minimal segment node shape — matches ManifestSegmentNode. */
22
- interface SegmentNode {
23
- segmentName: string;
24
- segmentType: string;
25
- urlPath: string;
26
- page?: {
27
- filePath: string;
28
- };
29
- route?: {
30
- filePath: string;
31
- };
32
- children: SegmentNode[];
33
- slots: Record<string, SegmentNode> | Map<string, SegmentNode>;
34
- }
35
22
  /**
36
- * Collect all routable paths from the manifest tree.
23
+ * Collect all routable paths from a route tree (build-time scanner output
24
+ * or runtime route manifest).
37
25
  *
38
- * Walks the segment tree and collects paths for segments that have
39
- * a page or route handler.
26
+ * Wraps the shared `collectLeafRoutes` walker (TIM-848). Includes parallel
27
+ * slots so the dev 404 page can list slot pages too — they aren't
28
+ * separately addressable, but they're still useful to know about when
29
+ * debugging a missing route.
40
30
  */
41
- export declare function collectRoutes(root: SegmentNode): RouteInfo[];
31
+ export declare function collectRoutes<TFile>(root: SegmentNode<TFile>): RouteInfo[];
42
32
  /**
43
33
  * Find routes similar to the requested path.
44
34
  *
@@ -1 +1 @@
1
- {"version":3,"file":"dev-404-page.d.ts","sourceRoot":"","sources":["../../src/plugins/dev-404-page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,UAAU,SAAS;IACjB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,gEAAgE;AAChE,UAAU,WAAW;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5B,KAAK,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CAC/D;AAID;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,EAAE,CAI5D;AA4DD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAezF;AAcD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAiFrF"}
1
+ {"version":3,"file":"dev-404-page.d.ts","sourceRoot":"","sources":["../../src/plugins/dev-404-page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAKvD,UAAU,SAAS;IACjB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAID;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,GAAG,SAAS,EAAE,CAQ1E;AAmCD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAezF;AAcD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAiFrF"}
@@ -1,10 +1,12 @@
1
- export { scanRoutes, classifySegment } from './scanner.js';
1
+ export { scanRoutes } from './scanner.js';
2
2
  export { generateRouteMap } from './codegen.js';
3
3
  export type { CodegenOptions } from './codegen.js';
4
4
  export type { RouteTree, SegmentNode, SegmentType, RouteFile, ScannerConfig, InterceptionMarker, } from './types.js';
5
5
  export { DEFAULT_PAGE_EXTENSIONS, INTERCEPTION_MARKERS } from './types.js';
6
6
  export { collectInterceptionRewrites } from './interception.js';
7
7
  export type { InterceptionRewrite } from './interception.js';
8
- export { classifyUrlSegment } from './segment-classify.js';
9
- export type { UrlSegment } from './segment-classify.js';
8
+ export { classifyUrlSegment, classifySegment } from './segment-classify.js';
9
+ export type { UrlSegment, SegmentClassification } from './segment-classify.js';
10
+ export { collectLeafRoutes } from './walkers.js';
11
+ export type { LeafRoute, CollectLeafRoutesOptions } from './walkers.js';
10
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,YAAY,EACV,SAAS,EACT,WAAW,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,YAAY,EACV,SAAS,EACT,WAAW,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC5E,YAAY,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,YAAY,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC"}
@@ -1,3 +1,3 @@
1
- import { t as classifyUrlSegment } from "../_chunks/segment-classify-BDNn6EzD.js";
2
- import { a as DEFAULT_PAGE_EXTENSIONS, i as scanRoutes, n as generateRouteMap, o as INTERCEPTION_MARKERS, r as classifySegment, t as collectInterceptionRewrites } from "../_chunks/interception-BsLCA9gk.js";
3
- export { DEFAULT_PAGE_EXTENSIONS, INTERCEPTION_MARKERS, classifySegment, classifyUrlSegment, collectInterceptionRewrites, generateRouteMap, scanRoutes };
1
+ import { i as INTERCEPTION_MARKERS, n as classifyUrlSegment, r as DEFAULT_PAGE_EXTENSIONS, t as classifySegment } from "../_chunks/segment-classify-BjfuctV2.js";
2
+ import { i as scanRoutes, n as collectInterceptionRewrites, r as generateRouteMap, t as collectLeafRoutes } from "../_chunks/walkers-VOXgavMF.js";
3
+ export { DEFAULT_PAGE_EXTENSIONS, INTERCEPTION_MARKERS, classifySegment, classifyUrlSegment, collectInterceptionRewrites, collectLeafRoutes, generateRouteMap, scanRoutes };
@@ -1 +1 @@
1
- {"version":3,"file":"link-codegen.d.ts","sourceRoot":"","sources":["../../src/routing/link-codegen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGjE,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,8PAC4N,CAAC;AAE9P;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAkBrE;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAWtF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,IAAI,MAAM,EAAE,CAyDtD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAmG5F"}
1
+ {"version":3,"file":"link-codegen.d.ts","sourceRoot":"","sources":["../../src/routing/link-codegen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGjE,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,8PAC4N,CAAC;AAE9P;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAkBrE;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAWtF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,IAAI,MAAM,EAAE,CAqEtD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAmG5F"}
@@ -7,7 +7,7 @@
7
7
  * timber.js file conventions. Does NOT handle request matching — this
8
8
  * is discovery only.
9
9
  */
10
- import type { RouteTree, SegmentType, ScannerConfig, InterceptionMarker } from './types.js';
10
+ import type { RouteTree, ScannerConfig } from './types.js';
11
11
  /**
12
12
  * Scan the app/ directory and build the route tree.
13
13
  *
@@ -16,13 +16,4 @@ import type { RouteTree, SegmentType, ScannerConfig, InterceptionMarker } from '
16
16
  * @returns The complete route tree
17
17
  */
18
18
  export declare function scanRoutes(appDir: string, config?: ScannerConfig): RouteTree;
19
- /**
20
- * Classify a directory name into its segment type.
21
- */
22
- export declare function classifySegment(dirName: string): {
23
- type: SegmentType;
24
- paramName?: string;
25
- interceptionMarker?: InterceptionMarker;
26
- interceptedSegmentName?: string;
27
- };
28
19
  //# sourceMappingURL=scanner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../src/routing/scanner.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EACV,SAAS,EAET,WAAW,EAEX,aAAa,EACb,kBAAkB,EACnB,MAAM,YAAY,CAAC;AA8CpB;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,aAAkB,GAAG,SAAS,CAoChF;AAyBD;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG;IAChD,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAoCA"}
1
+ {"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../src/routing/scanner.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EACV,SAAS,EAIT,aAAa,EAEd,MAAM,YAAY,CAAC;AA8CpB;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,aAAkB,GAAG,SAAS,CAoChF"}
@@ -1,21 +1,27 @@
1
1
  /**
2
- * Shared URL segment classifier.
2
+ * Shared segment classifier — both URL tokens and filesystem directory names.
3
3
  *
4
- * Single-pass character parser that classifies a route segment token
5
- * (e.g. "dashboard", "[id]", "[...slug]", "[[...path]]") into a typed
6
- * discriminated union. Used by both server-side routing and client-side
7
- * Link interpolation.
4
+ * `classifyUrlSegment(token)` is a pure single-pass character parser that
5
+ * classifies a route segment token (e.g. "dashboard", "[id]", "[...slug]",
6
+ * "[[...path]]") into a typed discriminated union. NO regex, NO Node.js-only
7
+ * APIs — safe to import from browser code (used by `Link` interpolation).
8
8
  *
9
- * NO regex. NO Node.js-only APIs. Safe to import from browser code.
9
+ * `classifySegment(dirName)` is the build-time directory-name classifier
10
+ * used by the scanner. It recognizes timber-only conventions (private
11
+ * `_*`, parallel `@*`, route groups `(name)`, intercepting routes
12
+ * `(.)`/`(..)`/`(...)`/`(..)(..)`) and delegates bracket syntax to
13
+ * `classifyUrlSegment`. It is the **single source of truth** for what
14
+ * counts as a routing segment — there is no separate copy in the
15
+ * scanner. (TIM-848.)
10
16
  *
11
- * Malformed input (unclosed brackets, empty names, etc.) falls through
12
- * to { kind: 'static' } — the safe default.
17
+ * Malformed input falls through to `{ kind: 'static' }` — the safe default.
13
18
  *
14
19
  * If you change the bracket syntax, update ONLY this file. Every
15
20
  * consumer imports from here.
16
21
  *
17
22
  * See design/07-routing.md §"Route Segments"
18
23
  */
24
+ import type { InterceptionMarker, SegmentType } from './types.js';
19
25
  export type UrlSegment = {
20
26
  kind: 'static';
21
27
  value: string;
@@ -43,4 +49,27 @@ export type UrlSegment = {
43
49
  * Any structural violation → static (safe default).
44
50
  */
45
51
  export declare function classifyUrlSegment(token: string): UrlSegment;
52
+ /** Result of classifying a filesystem directory name. */
53
+ export interface SegmentClassification {
54
+ type: SegmentType;
55
+ paramName?: string;
56
+ interceptionMarker?: InterceptionMarker;
57
+ interceptedSegmentName?: string;
58
+ }
59
+ /**
60
+ * Classify a directory name into its segment type.
61
+ *
62
+ * Recognizes all timber file-system conventions in priority order:
63
+ * 1. Private folders: `_name` (excluded from routing)
64
+ * 2. Parallel route slots: `@name`
65
+ * 3. Intercepting routes: `(.)name`, `(..)name`, `(...)name`, `(..)(..)name`
66
+ * 4. Route groups: `(name)`
67
+ * 5. Bracket syntax: `[id]`, `[...slug]`, `[[...path]]` (delegated to
68
+ * `classifyUrlSegment`)
69
+ * 6. Static: anything else
70
+ *
71
+ * If you change the bracket syntax, update only `classifyUrlSegment`.
72
+ * If you change the directory-prefix conventions, update this function.
73
+ */
74
+ export declare function classifySegment(dirName: string): SegmentClassification;
46
75
  //# sourceMappingURL=segment-classify.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"segment-classify.d.ts","sourceRoot":"","sources":["../../src/routing/segment-classify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM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wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAkCtE"}
@@ -3,6 +3,23 @@
3
3
  *
4
4
  * The route tree is built by scanning the app/ directory and recognizing
5
5
  * file conventions (page.*, layout.*, middleware.ts, access.ts, route.ts, etc.).
6
+ *
7
+ * **Single shape, two specializations** (TIM-848):
8
+ *
9
+ * `SegmentNode<TFile>` is the one canonical in-memory shape for the
10
+ * timber route tree. The same interface is used at build time (with
11
+ * `TFile = RouteFile`) and at request time (with `TFile = ManifestFile`,
12
+ * see `server/route-matcher.ts`). Walkers parameterized over `TFile`
13
+ * work on either, eliminating the previous duplication between
14
+ * `SegmentNode` (Map-based) and `ManifestSegmentNode` (object-based).
15
+ *
16
+ * Keyed groups (`slots`, `statusFiles`, `jsonStatusFiles`,
17
+ * `legacyStatusFiles`, `metadataRoutes`) are plain `Record<string, …>`
18
+ * objects rather than `Map`s so that the build-time tree can be
19
+ * serialized into the virtual route manifest with no shape transform.
20
+ *
21
+ * See design/07-routing.md §"Route Tree Shape" and design/18-build-system.md
22
+ * §"Route Manifest Shape".
6
23
  */
7
24
  /** Segment type classification */
8
25
  export type SegmentType = 'static' | 'dynamic' | 'catch-all' | 'optional-catch-all' | 'group' | 'slot' | 'intercepting' | 'private';
@@ -15,15 +32,31 @@ export type SegmentType = 'static' | 'dynamic' | 'catch-all' | 'optional-catch-a
15
32
  export type InterceptionMarker = '(.)' | '(..)' | '(...)' | '(..)(..)';
16
33
  /** All recognized interception markers, ordered longest-first for parsing. */
17
34
  export declare const INTERCEPTION_MARKERS: InterceptionMarker[];
18
- /** A single file discovered in a route segment */
35
+ /**
36
+ * A single file discovered in a route segment at build time.
37
+ *
38
+ * The runtime equivalent (`ManifestFile`, defined in
39
+ * `server/route-matcher.ts`) replaces `extension` with a lazy `load`
40
+ * function. Walkers that only need `filePath` are parameterized over
41
+ * `TFile` and accept either.
42
+ */
19
43
  export interface RouteFile {
20
44
  /** Absolute path to the file */
21
45
  filePath: string;
22
46
  /** File extension without leading dot (e.g. "tsx", "ts", "mdx") */
23
47
  extension: string;
24
48
  }
25
- /** A node in the segment tree */
26
- export interface SegmentNode {
49
+ /**
50
+ * A node in the segment tree.
51
+ *
52
+ * Generic over `TFile` so the same interface describes both the
53
+ * build-time tree (`SegmentNode<RouteFile>`, the default) and the
54
+ * runtime manifest tree (`SegmentNode<ManifestFile>`, aliased as
55
+ * `ManifestSegmentNode`). All keyed groups use `Record` (not `Map`)
56
+ * so the build-time tree serializes to the virtual route manifest
57
+ * with no shape transform.
58
+ */
59
+ export interface SegmentNode<TFile = RouteFile> {
27
60
  /** The raw directory name (e.g. "dashboard", "[id]", "(auth)", "@sidebar") */
28
61
  segmentName: string;
29
62
  /** Classified segment type */
@@ -39,39 +72,46 @@ export interface SegmentNode {
39
72
  * E.g., for "(.)photo" this is "photo".
40
73
  */
41
74
  interceptedSegmentName?: string;
42
- page?: RouteFile;
43
- layout?: RouteFile;
44
- middleware?: RouteFile;
45
- access?: RouteFile;
46
- route?: RouteFile;
75
+ page?: TFile;
76
+ layout?: TFile;
77
+ middleware?: TFile;
78
+ access?: TFile;
79
+ route?: TFile;
47
80
  /**
48
81
  * params.ts — isomorphic convention file exporting segmentParams and/or searchParams.
49
82
  * Discovered by the scanner like middleware.ts and access.ts.
50
83
  * See design/07-routing.md §"params.ts Convention File"
51
84
  */
52
- params?: RouteFile;
53
- error?: RouteFile;
54
- default?: RouteFile;
85
+ params?: TFile;
86
+ error?: TFile;
87
+ default?: TFile;
55
88
  /** Status-code files: 4xx.tsx, 5xx.tsx, {status}.tsx (component format) */
56
- statusFiles?: Map<string, RouteFile>;
89
+ statusFiles?: Record<string, TFile>;
57
90
  /** JSON status-code files: 4xx.json, 5xx.json, {status}.json */
58
- jsonStatusFiles?: Map<string, RouteFile>;
91
+ jsonStatusFiles?: Record<string, TFile>;
59
92
  /** denied.tsx — slot-only denial rendering */
60
- denied?: RouteFile;
93
+ denied?: TFile;
61
94
  /** Legacy compat: not-found.tsx (maps to 404), forbidden.tsx (403), unauthorized.tsx (401) */
62
- legacyStatusFiles?: Map<string, RouteFile>;
95
+ legacyStatusFiles?: Record<string, TFile>;
63
96
  /** Metadata route files (sitemap.ts, robots.ts, icon.tsx, etc.) keyed by base name */
64
- metadataRoutes?: Map<string, RouteFile>;
65
- children: SegmentNode[];
97
+ metadataRoutes?: Record<string, TFile>;
98
+ children: SegmentNode<TFile>[];
66
99
  /** Parallel route slots (keyed by slot name without @) */
67
- slots: Map<string, SegmentNode>;
100
+ slots: Record<string, SegmentNode<TFile>>;
68
101
  }
69
- /** The full route tree output from the scanner */
70
- export interface RouteTree {
102
+ /**
103
+ * The full route tree output from the scanner (or the root of the
104
+ * runtime route manifest, when `TFile = ManifestFile`).
105
+ *
106
+ * Generic so the same wrapper carries app-root metadata for both
107
+ * shapes. The runtime manifest extends this with `viteRoot` (see
108
+ * `ManifestRoot` in `server/route-matcher.ts`).
109
+ */
110
+ export interface RouteTree<TFile = RouteFile> {
71
111
  /** The root segment node (representing app/) */
72
- root: SegmentNode;
112
+ root: SegmentNode<TFile>;
73
113
  /** All discovered proxy.ts files (should be at most one, in app/) */
74
- proxy?: RouteFile;
114
+ proxy?: TFile;
75
115
  /**
76
116
  * Global error page: app/global-error.{tsx,ts,jsx,js}
77
117
  *
@@ -81,7 +121,7 @@ export interface RouteTree {
81
121
  *
82
122
  * See design/10-error-handling.md §"Tier 2 — Global Error Page"
83
123
  */
84
- globalError?: RouteFile;
124
+ globalError?: TFile;
85
125
  }
86
126
  /** Configuration passed to the scanner */
87
127
  export interface ScannerConfig {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/routing/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,kCAAkC;AAClC,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,SAAS,GACT,WAAW,GACX,oBAAoB,GACpB,OAAO,GACP,MAAM,GACN,cAAc,GACd,SAAS,CAAC;AAEd;;;;;GAKG;AAC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AK,CAAC;IACd;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB;AAED,0CAA0C;AAC1C,MAAM,WAAW,aAAa;IAC5B,4FAA4F;IAC5F,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,8BAA8B;AAC9B,eAAO,MAAM,uBAAuB,UAA6B,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Shared route-tree walkers (TIM-848).
3
+ *
4
+ * Tiny helpers that walk a `SegmentNode<TFile>` tree generically. Both the
5
+ * build-time tree (`SegmentNode<RouteFile>`) and the runtime manifest
6
+ * tree (`SegmentNode<ManifestFile>`) flow through these helpers because
7
+ * the walker only reads the structural fields shared by both shapes
8
+ * (`children`, `slots`, `page`, `route`, `urlPath`).
9
+ *
10
+ * Before this module, three near-identical `collectRoutes` functions
11
+ * lived in `plugins/dev-404-page.ts`, `plugins/build-report.ts`, and
12
+ * `routing/codegen.ts`. The codegen one is special-purpose (it
13
+ * accumulates `ParamEntry[]` and resolves codec chains) and stays
14
+ * local; the other two now share `collectLeafRoutes` from this file.
15
+ */
16
+ import type { SegmentNode } from './types.js';
17
+ /** A leaf route discovered while walking the segment tree. */
18
+ export interface LeafRoute<TFile> {
19
+ /** URL path of the leaf (root is "/"). */
20
+ urlPath: string;
21
+ /** Segment chain from root to this leaf, inclusive. */
22
+ segments: SegmentNode<TFile>[];
23
+ /** The page file at this leaf, if any. */
24
+ page?: TFile;
25
+ /** The route handler file at this leaf, if any. */
26
+ route?: TFile;
27
+ }
28
+ /** Options for `collectLeafRoutes`. */
29
+ export interface CollectLeafRoutesOptions {
30
+ /**
31
+ * If true, recurse into parallel slots and emit slot leaves alongside
32
+ * the main route tree. Defaults to `false` because slots render
33
+ * alongside their parent at the same URL and are not separately
34
+ * URL-addressable. The build report excludes slots; route-listing
35
+ * UIs that want to show "all leaves with a page handler" can opt in.
36
+ */
37
+ includeSlots?: boolean;
38
+ }
39
+ /**
40
+ * Walk a segment tree and collect every leaf with a `page` or `route`
41
+ * handler. Generic over `TFile` so it works on both the build-time
42
+ * scanner output and the runtime manifest tree.
43
+ *
44
+ * - Pages and route handlers at the same URL produce two distinct
45
+ * entries (the build report deduplicates by URL afterward).
46
+ * - Parallel slots are skipped unless `includeSlots: true` (slots
47
+ * share their parent's URL and are not addressable on their own).
48
+ * - Result is sorted by `urlPath` for deterministic output.
49
+ */
50
+ export declare function collectLeafRoutes<TFile>(root: SegmentNode<TFile>, options?: CollectLeafRoutesOptions): LeafRoute<TFile>[];
51
+ //# sourceMappingURL=walkers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walkers.d.ts","sourceRoot":"","sources":["../../src/routing/walkers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,8DAA8D;AAC9D,MAAM,WAAW,SAAS,CAAC,KAAK;IAC9B,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,QAAQ,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;IAC/B,0CAA0C;IAC1C,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,mDAAmD;IACnD,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,uCAAuC;AACvC,MAAM,WAAW,wBAAwB;IACvC;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EACrC,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,EACxB,OAAO,GAAE,wBAA6B,GACrC,SAAS,CAAC,KAAK,CAAC,EAAE,CAMpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"action-handler.d.ts","sourceRoot":"","sources":["../../src/server/action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AASH,OAAO,EAAgB,KAAK,UAAU,EAA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B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAMrD,4CAA4C;AAC5C,MAAM,WAAW,oBAAoB;IACnC,0BAA0B;IAC1B,IAAI,EAAE,UAAU,CAAC;IACjB,kEAAkE;IAClE,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,gDAAgD;IAChD,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B;;;;OAIG;IACH,eAAe,CAAC,EAAE,qBAAqB,CAAC;CACzC;AAQD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAarD;AAuBD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,aAAa,CAAC;IACxB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,QAAQ,GAAG,YAAY,GAAG,IAAI,CAAC,CAyEzC"}
@@ -36,9 +36,11 @@ export interface HoldingServer {
36
36
  *
37
37
  * Usage (inside Vite plugin):
38
38
  * ```ts
39
- * // In config() hook — earliest point where port is known
39
+ * // In config() hook — earliest point where port is known.
40
+ * // Use bindWithBump() to honor the default-3000 + auto-bump policy
41
+ * // (see ../server/port-resolution.ts and TIM-842).
40
42
  * const holding = createHoldingServer();
41
- * holding.listen(config.server?.port ?? 5173);
43
+ * await bindWithBump((p) => holding.listen(p), { startPort: 3000, autoBump: true });
42
44
  *
43
45
  * // In last plugin's configureServer() — wrap listen for seamless handoff
44
46
  * const originalListen = server.listen.bind(server);
@@ -1 +1 @@
1
- {"version":3,"file":"dev-holding-server.d.ts","sourceRoot":"","sources":["../../src/server/dev-holding-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEtC,kEAAkE;IAClE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AA8ED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAmDnD"}
1
+ {"version":3,"file":"dev-holding-server.d.ts","sourceRoot":"","sources":["../../src/server/dev-holding-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEtC,kEAAkE;IAClE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AA8ED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAmDnD"}