@teyik0/furin 0.9.0-alpha.1 → 0.9.0-alpha.2

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 (85) hide show
  1. package/dist/adapter/runtime-build.d.ts +7 -3
  2. package/dist/adapter/vercel.js +31 -6
  3. package/dist/build/client.d.ts +1 -1
  4. package/dist/build/entry-template.d.ts +3 -12
  5. package/dist/build/entry-template.ts +3 -15
  6. package/dist/build/hydrate.d.ts +6 -1
  7. package/dist/build/index.d.ts +1 -1
  8. package/dist/build/index.js +565 -401
  9. package/dist/build/route-metadata.d.ts +2 -2
  10. package/dist/build/route-types.d.ts +1 -1
  11. package/dist/build/types.d.ts +10 -4
  12. package/dist/cli/index.js +594 -422
  13. package/dist/client/chunks/{client-xy6g38kx.js → client-a7spxfnn.js} +24 -5
  14. package/dist/client/chunks/{client-rjhxgt64.js → client-d9v49jwz.js} +1 -1
  15. package/dist/client/chunks/{client-k29262a4.js → client-rdxyrw11.js} +1 -1
  16. package/dist/client/define-route.d.ts +14 -0
  17. package/dist/client/internal/runtime-types.d.ts +8 -0
  18. package/dist/client/link.js +3 -3
  19. package/dist/client/router/link-utils.d.ts +3 -2
  20. package/dist/client/router/search/index.js +2 -2
  21. package/dist/client/router/types.d.ts +9 -3
  22. package/dist/client.js +22 -6
  23. package/dist/config.d.ts +4 -0
  24. package/dist/config.js +4 -1
  25. package/dist/define-route.d.ts +53 -12
  26. package/dist/furin.d.ts +13 -3
  27. package/dist/furin.js +766 -614
  28. package/dist/plugin/route-config.d.ts +3 -3
  29. package/dist/plugin/route-manifest.d.ts +46 -0
  30. package/dist/plugin/route-tree.d.ts +13 -29
  31. package/dist/routes.d.ts +2 -2
  32. package/dist/server/dev/runtime.d.ts +2 -1
  33. package/dist/server/internal.d.ts +6 -0
  34. package/dist/server/internal.js +57 -76
  35. package/dist/server/registrations.d.ts +4 -2
  36. package/dist/server/router/defined-route.d.ts +4 -0
  37. package/dist/server/router/discovery.d.ts +14 -4
  38. package/dist/server/router/hmr.d.ts +12 -12
  39. package/dist/server/router/patterns.d.ts +4 -12
  40. package/dist/server/router/types.d.ts +16 -1
  41. package/dist/server/static-export.js +88 -120
  42. package/dist/server/sync/drizzle/index.d.ts +8 -10
  43. package/dist/shared/route-specificity.d.ts +10 -1
  44. package/package.json +3 -6
  45. package/src/adapter/package.ts +11 -37
  46. package/src/adapter/runtime-build.ts +5 -4
  47. package/src/adapter/static.ts +1 -1
  48. package/src/adapter/vercel.ts +2 -1
  49. package/src/build/client.ts +3 -3
  50. package/src/build/discover-pages-process.ts +1 -1
  51. package/src/build/elysia-aot.ts +2 -2
  52. package/src/build/entry-template.ts +3 -15
  53. package/src/build/hydrate.ts +12 -6
  54. package/src/build/index.ts +19 -9
  55. package/src/build/route-metadata.ts +15 -8
  56. package/src/build/route-types.ts +18 -43
  57. package/src/build/types.ts +12 -5
  58. package/src/cli/config.ts +6 -0
  59. package/src/cli/index.ts +30 -14
  60. package/src/client/define-route.ts +29 -4
  61. package/src/client/internal/runtime-types.ts +8 -0
  62. package/src/client/router/link-utils.ts +16 -8
  63. package/src/client/router/types.ts +40 -14
  64. package/src/config.ts +5 -0
  65. package/src/define-route.ts +85 -16
  66. package/src/furin.ts +31 -7
  67. package/src/plugin/dev-routes.ts +8 -17
  68. package/src/plugin/route-config.ts +77 -62
  69. package/src/plugin/route-manifest.ts +437 -0
  70. package/src/plugin/route-modules.ts +6 -1
  71. package/src/plugin/route-registry.ts +7 -21
  72. package/src/plugin/route-tree.ts +71 -181
  73. package/src/routes.ts +2 -2
  74. package/src/server/dev/runtime.ts +16 -22
  75. package/src/server/internal.ts +4 -1
  76. package/src/server/registrations.ts +5 -2
  77. package/src/server/render/static-params.ts +2 -10
  78. package/src/server/router/defined-route.ts +8 -0
  79. package/src/server/router/discovery.ts +237 -196
  80. package/src/server/router/hmr.ts +45 -63
  81. package/src/server/router/patterns.ts +41 -117
  82. package/src/server/router/types.ts +17 -1
  83. package/src/server/sync/drizzle/index.ts +18 -19
  84. package/src/shared/route-specificity.ts +34 -2
  85. package/src/shared/utils/index.ts +1 -1
@@ -12,13 +12,13 @@ interface RouteBuildInfo {
12
12
  searchDefaults: SearchParamsInput | undefined;
13
13
  }
14
14
  /** Discovery results contain data only; application closures stay in the child. */
15
- export interface BuildRoute extends Pick<ResolvedRoute, "mode" | "path" | "pattern" | "requestKeys" | "requestKeysByLoader" | "tags"> {
15
+ export interface BuildRoute extends Pick<ResolvedRoute, "layouts" | "mode" | "path" | "pattern" | "requestKeys" | "requestKeysByLoader" | "tags"> {
16
16
  build: RouteBuildInfo;
17
17
  routeChain: {
18
18
  layout: boolean;
19
19
  sourcePath?: string;
20
20
  }[];
21
- segmentBoundaries: Pick<SegmentBoundary, "depth" | "path" | "errorPath" | "notFoundPath">[];
21
+ segmentBoundaries: Pick<SegmentBoundary, "depth" | "path" | "errorPath" | "fromRoute" | "notFoundPath">[];
22
22
  }
23
23
  export type BuildRouteInput = BuildRoute | ResolvedRoute;
24
24
  export type BuildRoot = Pick<RootLayout, "path" | "errorPath" | "notFoundPath"> & {
@@ -1,4 +1,4 @@
1
- import { type RouteInstanceSpec } from "../plugin/route-tree.ts";
1
+ import { type RouteInstanceSpec } from "../plugin/route-manifest.ts";
2
2
  import type { ResolvedRoute } from "../server/router/types.ts";
3
3
  /**
4
4
  * @internal Exported for framework build and focused contract tests. `routes`
@@ -1,5 +1,6 @@
1
1
  import type { AdapterTargetManifest } from "../adapter/types.ts";
2
2
  import type { FurinTarget, StaticExportConfig } from "../config";
3
+ import type { RouteStyle } from "../plugin/route-manifest.ts";
3
4
  import type { RouteRegistrySnapshot } from "../plugin/route-registry.ts";
4
5
  import type { ResolvedRoute } from "../server/router/types.ts";
5
6
  import type { ClientBoundary } from "../rsc/build/discover.ts";
@@ -26,7 +27,11 @@ export interface BuildClientOptions {
26
27
  /** Package barrels Bun should parse on demand instead of loading in full. */
27
28
  optimizeImports?: string[];
28
29
  outDir: string;
29
- pagesDir?: string;
30
+ /** The app whose route registry the client bundle embeds. */
31
+ pages?: {
32
+ pagesDir: string;
33
+ style: RouteStyle;
34
+ };
30
35
  plugins?: Bun.BunPlugin[];
31
36
  /** Record route chunks in the preload manifest. Defaults to true. */
32
37
  preloadRouteChunks?: boolean;
@@ -72,6 +77,7 @@ interface BuildAppSpec {
72
77
  pagesDir: string;
73
78
  /** Mount prefix (`""` or absent = root). */
74
79
  prefix?: string;
80
+ style: RouteStyle;
75
81
  }
76
82
  export interface BuildManifest {
77
83
  /** Every mounted app built into this artifact (multi-instance). */
@@ -79,6 +85,7 @@ export interface BuildManifest {
79
85
  pagesDir: string;
80
86
  prefix: string;
81
87
  routes: BuildRouteManifestEntry[];
88
+ style: RouteStyle;
82
89
  }>;
83
90
  generatedAt: string;
84
91
  pagesDir: string;
@@ -100,8 +107,8 @@ export interface BuildAppOptions {
100
107
  output?: "app" | "server";
101
108
  };
102
109
  /**
103
- * Explicit multi-app build (furin.config.ts `apps`). Overrides `pagesDir`
104
- * and the mounts found by evaluating the server entry.
110
+ * Explicit multi-app build (furin.config.ts `apps`). Overrides the mounts
111
+ * found by evaluating the server entry.
105
112
  */
106
113
  apps?: BuildAppSpec[];
107
114
  /** Inject the evlog client logger into the hydrate entry. Defaults to false. */
@@ -109,7 +116,6 @@ export interface BuildAppOptions {
109
116
  compile?: "server" | "embed";
110
117
  /** Package barrels Bun should parse on demand in production client bundles. */
111
118
  optimizeImports?: string[];
112
- pagesDir?: string;
113
119
  plugins?: Bun.BunPlugin[];
114
120
  /** Module preloading (furin.config.ts `preload`). */
115
121
  preload?: {