@teyik0/furin 0.9.0-alpha.0 → 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.
- package/README.md +1 -1
- package/dist/adapter/runtime-build.d.ts +7 -3
- package/dist/adapter/vercel.js +31 -6
- package/dist/build/client.d.ts +1 -1
- package/dist/build/entry-template.d.ts +3 -12
- package/dist/build/entry-template.ts +3 -15
- package/dist/build/hydrate.d.ts +6 -1
- package/dist/build/index.d.ts +1 -1
- package/dist/build/index.js +565 -401
- package/dist/build/route-metadata.d.ts +2 -2
- package/dist/build/route-types.d.ts +1 -1
- package/dist/build/types.d.ts +10 -4
- package/dist/cli/dev-worker.ts +10 -4
- package/dist/cli/index.js +624 -445
- package/dist/client/chunks/{client-xy6g38kx.js → client-a7spxfnn.js} +24 -5
- package/dist/client/chunks/{client-rjhxgt64.js → client-d9v49jwz.js} +1 -1
- package/dist/client/chunks/{client-k29262a4.js → client-rdxyrw11.js} +1 -1
- package/dist/client/define-route.d.ts +14 -0
- package/dist/client/internal/runtime-types.d.ts +8 -0
- package/dist/client/link.js +20 -17
- package/dist/client/router/link-utils.d.ts +3 -2
- package/dist/client/router/search/index.js +2 -2
- package/dist/client/router/types.d.ts +9 -3
- package/dist/client.js +22 -6
- package/dist/config.d.ts +4 -0
- package/dist/config.js +4 -1
- package/dist/define-route.d.ts +53 -12
- package/dist/furin.d.ts +13 -3
- package/dist/furin.js +815 -661
- package/dist/plugin/route-config.d.ts +3 -3
- package/dist/plugin/route-manifest.d.ts +46 -0
- package/dist/plugin/route-tree.d.ts +13 -29
- package/dist/routes.d.ts +2 -2
- package/dist/server/dev/runtime.d.ts +2 -1
- package/dist/server/internal.d.ts +6 -0
- package/dist/server/internal.js +97 -114
- package/dist/server/registrations.d.ts +4 -2
- package/dist/server/render/index.d.ts +0 -1
- package/dist/server/render/index.ts +0 -1
- package/dist/server/render/shell.d.ts +1 -13
- package/dist/server/render/shell.ts +1 -90
- package/dist/server/router/defined-route.d.ts +4 -0
- package/dist/server/router/discovery.d.ts +14 -4
- package/dist/server/router/hmr.d.ts +12 -12
- package/dist/server/router/patterns.d.ts +4 -12
- package/dist/server/router/types.d.ts +16 -1
- package/dist/server/static-export.js +128 -158
- package/dist/server/sync/drizzle/index.d.ts +8 -10
- package/dist/shared/not-found.d.ts +1 -1
- package/dist/shared/route-specificity.d.ts +10 -1
- package/package.json +8 -11
- package/src/adapter/package.ts +11 -37
- package/src/adapter/runtime-build.ts +5 -4
- package/src/adapter/static.ts +1 -1
- package/src/adapter/vercel.ts +2 -1
- package/src/build/client.ts +3 -3
- package/src/build/discover-pages-process.ts +1 -1
- package/src/build/elysia-aot.ts +2 -2
- package/src/build/entry-template.ts +3 -15
- package/src/build/hydrate.ts +12 -6
- package/src/build/index.ts +19 -9
- package/src/build/route-metadata.ts +15 -8
- package/src/build/route-types.ts +18 -43
- package/src/build/types.ts +12 -5
- package/src/cli/config.ts +6 -0
- package/src/cli/dev-worker.ts +10 -4
- package/src/cli/dev.ts +41 -26
- package/src/cli/index.ts +30 -14
- package/src/client/define-route.ts +29 -4
- package/src/client/internal/runtime-types.ts +8 -0
- package/src/client/link.tsx +21 -22
- package/src/client/router/context.ts +8 -7
- package/src/client/router/link-utils.ts +16 -8
- package/src/client/router/provider.tsx +5 -0
- package/src/client/router/types.ts +40 -14
- package/src/config.ts +5 -0
- package/src/define-route.ts +85 -16
- package/src/furin.ts +31 -7
- package/src/plugin/dev-routes.ts +8 -17
- package/src/plugin/route-config.ts +77 -62
- package/src/plugin/route-manifest.ts +437 -0
- package/src/plugin/route-modules.ts +6 -1
- package/src/plugin/route-registry.ts +7 -21
- package/src/plugin/route-tree.ts +71 -181
- package/src/routes.ts +2 -2
- package/src/server/dev/runtime.ts +16 -22
- package/src/server/internal.ts +4 -1
- package/src/server/registrations.ts +5 -2
- package/src/server/render/index.ts +0 -1
- package/src/server/render/shell.ts +1 -90
- package/src/server/render/static-params.ts +2 -10
- package/src/server/router/defined-route.ts +8 -0
- package/src/server/router/discovery.ts +237 -196
- package/src/server/router/hmr.ts +45 -63
- package/src/server/router/patterns.ts +41 -117
- package/src/server/router/types.ts +17 -1
- package/src/server/sync/drizzle/index.ts +18 -19
- package/src/shared/not-found.ts +1 -1
- package/src/shared/route-specificity.ts +34 -2
- package/src/shared/utils/index.ts +1 -1
package/dist/furin.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type AnyElysia, Elysia } from "elysia";
|
|
2
2
|
import type { RequestLogger } from "evlog";
|
|
3
|
+
import type { RouteStyle } from "./plugin/route-manifest.ts";
|
|
3
4
|
import type { PageCacheAdapter } from "./server/cache/page-cache.ts";
|
|
4
5
|
import { type CachePurger } from "./server/cache/purger.ts";
|
|
5
6
|
import { type FurinLoggerOptions } from "./server/logging/ingest-plugin.ts";
|
|
@@ -56,6 +57,7 @@ export interface FurinOptions {
|
|
|
56
57
|
* process-local cache.
|
|
57
58
|
*/
|
|
58
59
|
pageCache?: PageCacheAdapter;
|
|
60
|
+
/** Defaults to `src/app` in the `nextjs` style and `src/routes` in the `tanstack` style. */
|
|
59
61
|
pagesDir?: string;
|
|
60
62
|
/**
|
|
61
63
|
* Full physical mount path of this app, e.g. `"/admin"`. All pages,
|
|
@@ -68,6 +70,13 @@ export interface FurinOptions {
|
|
|
68
70
|
* two prefixes, throws.
|
|
69
71
|
*/
|
|
70
72
|
prefix?: string;
|
|
73
|
+
/**
|
|
74
|
+
* File-routing convention of `pagesDir`: `"nextjs"` (App Router: `layout.tsx`,
|
|
75
|
+
* `page.tsx`, `[id]`, `error.tsx`) or `"tanstack"` (TanStack Start:
|
|
76
|
+
* `__root.tsx`, `route.tsx`, `$id`, flat `a.$b.tsx`). Both key
|
|
77
|
+
* `defineRoute(id)` with TanStack Start ids.
|
|
78
|
+
*/
|
|
79
|
+
style: RouteStyle;
|
|
71
80
|
/**
|
|
72
81
|
* Configures Furin's sync event stream with the required adapter. The
|
|
73
82
|
* optional `path` defaults to `/_furin/sync`. Omit this option or pass
|
|
@@ -87,14 +96,15 @@ export interface FurinOptions {
|
|
|
87
96
|
*
|
|
88
97
|
* ```ts
|
|
89
98
|
* new Elysia()
|
|
90
|
-
* .use(await furin({
|
|
91
|
-
* .use(await furin({ pagesDir: "./src/admin", prefix: "/admin" }))
|
|
99
|
+
* .use(await furin({ style: "tanstack" }))
|
|
100
|
+
* .use(await furin({ pagesDir: "./src/admin", prefix: "/admin", style: "nextjs" }))
|
|
92
101
|
* .listen(3000)
|
|
93
102
|
* ```
|
|
94
103
|
*/
|
|
95
|
-
export declare function furin(options
|
|
104
|
+
export declare function furin(options: FurinOptions): Promise<<ParentApp extends AnyElysia>(parentApp: ParentApp) => FurinApplication<ParentApp>>;
|
|
96
105
|
export { FurinErrorBoundary, FurinNotFoundBoundary } from "./client/boundaries.tsx";
|
|
97
106
|
export { HeadContent, Scripts } from "./client/document.tsx";
|
|
107
|
+
export type { RouteStyle } from "./plugin/route-manifest.ts";
|
|
98
108
|
export type { Register } from "./routes.ts";
|
|
99
109
|
export type { InvalidationInput, InvalidationRule } from "./server/auto-invalidate/index.ts";
|
|
100
110
|
export { furinInvalidate, revalidateTag } from "./server/auto-invalidate/index.ts";
|