@teyik0/furin 0.4.0-alpha.2 → 0.5.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 (129) hide show
  1. package/dist/build/compile-entry.d.ts +2 -1
  2. package/dist/build/compile-entry.ts +17 -13
  3. package/dist/build/elysia-aot.d.ts +9 -0
  4. package/dist/build/entry-template.d.ts +5 -1
  5. package/dist/build/entry-template.ts +27 -6
  6. package/dist/build/index.js +969 -528
  7. package/dist/build/private-server-sourcemaps.d.ts +2 -0
  8. package/dist/build/server-app-entry.d.ts +12 -0
  9. package/dist/build/types.d.ts +2 -0
  10. package/dist/cache.d.ts +1 -0
  11. package/dist/cache.js +185 -0
  12. package/dist/cli/index.js +983 -541
  13. package/dist/client/document.d.ts +2 -0
  14. package/dist/client/internal/runtime-types.d.ts +8 -1
  15. package/dist/client/link.js +232 -11
  16. package/dist/client/sync.d.ts +1 -0
  17. package/dist/client.js +11 -0
  18. package/dist/config.d.ts +28 -22
  19. package/dist/config.js +25 -2
  20. package/dist/define-route.d.ts +273 -1009
  21. package/dist/furin.d.ts +20 -5
  22. package/dist/furin.js +6431 -5457
  23. package/dist/plugin/routes.d.ts +6 -0
  24. package/dist/rsc-client.js +9 -1
  25. package/dist/rsc.js +19 -7
  26. package/dist/server/assets/production.d.ts +3 -0
  27. package/dist/server/auto-invalidate/plugin.d.ts +8 -24
  28. package/dist/server/auto-invalidate/runtime.d.ts +2 -2
  29. package/dist/server/browser-events/shutdown.d.ts +3 -0
  30. package/dist/server/cache/invalidation.d.ts +1 -1
  31. package/dist/server/cache/page-cache-state.d.ts +5 -0
  32. package/dist/server/cache/page-cache.d.ts +53 -0
  33. package/dist/server/cache/redis/index.d.ts +41 -0
  34. package/dist/server/cache/redis/index.js +451 -0
  35. package/dist/server/cache/redis/scripts.d.ts +6 -0
  36. package/dist/server/context-logger.d.ts +2 -2
  37. package/dist/server/dev/plugin.d.ts +1 -0
  38. package/dist/server/dev/runtime.production.d.ts +1 -0
  39. package/dist/server/dev-page-plugin.d.ts +7 -0
  40. package/dist/server/evlog.d.ts +14 -0
  41. package/dist/server/internal.d.ts +6 -0
  42. package/dist/server/internal.js +2539 -0
  43. package/dist/server/production-server.d.ts +13 -0
  44. package/dist/server/production-server.js +2906 -0
  45. package/dist/server/render/not-found.d.ts +1 -1
  46. package/dist/server/render/ssg.d.ts +5 -0
  47. package/dist/server/render/static-params.d.ts +4 -0
  48. package/dist/server/router/defined-route.d.ts +1 -1
  49. package/dist/server/router/hmr.d.ts +6 -0
  50. package/dist/server/router/hmr.production.d.ts +5 -0
  51. package/dist/server/router/plugin.d.ts +5 -1
  52. package/dist/server/router/schemas.d.ts +1 -0
  53. package/dist/server/sync/index.js +798 -117
  54. package/dist/server/sync/plugin.d.ts +31 -158
  55. package/dist/server/sync/stream.d.ts +38 -49
  56. package/dist/shared/elysia-contract.d.ts +8 -14
  57. package/dist/shared/production-build.d.ts +2 -0
  58. package/package.json +19 -8
  59. package/src/adapter/README.md +9 -2
  60. package/src/adapter/bun.ts +146 -41
  61. package/src/adapter/package.ts +6 -2
  62. package/src/adapter/runtime-build.ts +11 -4
  63. package/src/adapter/static.ts +8 -6
  64. package/src/adapter/vercel.ts +64 -31
  65. package/src/build/client.ts +18 -1
  66. package/src/build/compile-entry.ts +17 -13
  67. package/src/build/elysia-aot.ts +102 -0
  68. package/src/build/entry-template.ts +27 -6
  69. package/src/build/hydrate.ts +5 -1
  70. package/src/build/index.ts +5 -5
  71. package/src/build/private-server-sourcemaps.ts +20 -0
  72. package/src/build/production-instrumentation.ts +2 -2
  73. package/src/build/server-app-entry.ts +61 -0
  74. package/src/build/shared.ts +3 -1
  75. package/src/build/ssg-cache.ts +5 -10
  76. package/src/build/types.ts +2 -0
  77. package/src/build/virtual-entry.ts +5 -4
  78. package/src/cache.ts +12 -0
  79. package/src/cli/config.ts +3 -3
  80. package/src/cli/index.ts +6 -2
  81. package/src/client/document.tsx +19 -0
  82. package/src/client/internal/runtime-types.ts +10 -1
  83. package/src/client/sync.ts +1 -0
  84. package/src/config.ts +33 -4
  85. package/src/define-route.ts +266 -128
  86. package/src/furin.ts +168 -154
  87. package/src/plugin/route-config-autofix.ts +11 -2
  88. package/src/plugin/routes.ts +85 -29
  89. package/src/rsc/codec.ts +11 -6
  90. package/src/rsc/render-error.ts +3 -1
  91. package/src/server/assets/production.ts +99 -0
  92. package/src/server/auto-invalidate/plugin.ts +4 -4
  93. package/src/server/auto-invalidate/runtime.ts +74 -42
  94. package/src/server/browser-events/plugin.ts +13 -1
  95. package/src/server/browser-events/shutdown.ts +32 -0
  96. package/src/server/cache/invalidation.ts +61 -20
  97. package/src/server/cache/page-cache-state.ts +22 -0
  98. package/src/server/cache/page-cache.ts +300 -0
  99. package/src/server/cache/redis/index.ts +367 -0
  100. package/src/server/cache/redis/scripts.ts +200 -0
  101. package/src/server/context-logger.ts +5 -5
  102. package/src/server/dev/plugin.ts +10 -1
  103. package/src/server/dev/runtime.production.ts +4 -0
  104. package/src/server/dev-page-plugin.ts +54 -10
  105. package/src/server/evlog.ts +106 -0
  106. package/src/server/internal.ts +7 -0
  107. package/src/server/production-server.ts +135 -0
  108. package/src/server/render/document.tsx +7 -1
  109. package/src/server/render/isr.ts +480 -132
  110. package/src/server/render/loaders.ts +18 -12
  111. package/src/server/render/not-found.ts +4 -4
  112. package/src/server/render/ppr-document.ts +2 -2
  113. package/src/server/render/ppr-route.ts +193 -7
  114. package/src/server/render/ssg.ts +148 -4
  115. package/src/server/render/ssr.ts +6 -7
  116. package/src/server/render/static-params.ts +174 -0
  117. package/src/server/render/template.ts +5 -1
  118. package/src/server/router/defined-route.ts +2 -1
  119. package/src/server/router/discovery.ts +3 -1
  120. package/src/server/router/hmr.production.ts +11 -0
  121. package/src/server/router/hmr.ts +85 -76
  122. package/src/server/router/plugin.ts +118 -50
  123. package/src/server/router/schema-merge.ts +10 -3
  124. package/src/server/router/schemas.ts +174 -61
  125. package/src/server/sync/plugin.ts +14 -10
  126. package/src/server/sync/response.ts +3 -3
  127. package/src/server/sync/stream.ts +43 -2
  128. package/src/shared/elysia-contract.ts +23 -25
  129. package/src/shared/production-build.ts +20 -0
@@ -6,180 +6,53 @@ export type SyncRouteOption = false | InvalidationInput | {
6
6
  };
7
7
  /** @deprecated Use SyncRouteOption. */
8
8
  export type SyncInput = Exclude<SyncRouteOption, false>;
9
- export declare function furinSync(options: SyncRuntimeOptions): Elysia<"", {
10
- decorator: {};
11
- store: {};
12
- derive: {};
13
- resolve: {};
14
- }, {
9
+ export declare function furinSync(options: SyncRuntimeOptions): Elysia<"", "local", import("elysia").DefaultSingleton, {
15
10
  typebox: {};
16
- error: {};
11
+ error: [];
17
12
  }, {
18
13
  schema: {};
19
- standaloneSchema: {};
14
+ schemas: {};
20
15
  macro: Partial<{
21
16
  readonly sync: SyncRouteOption;
22
17
  }>;
23
18
  macroFn: {
24
19
  readonly sync: (input: SyncRouteOption) => {
25
- readonly transform: ({ request }: {
26
- body: unknown;
27
- query: Record<string, string>;
28
- params: {};
29
- headers: Record<string, string | undefined>;
30
- cookie: Record<string, import("elysia").Cookie<unknown>>;
31
- server: import("elysia/universal/server").Server | null;
20
+ transform({ request }: {
21
+ server: import("elysia").Server | null;
32
22
  redirect: import("elysia").redirect;
33
23
  set: {
34
24
  headers: import("elysia").HTTPHeaders;
35
25
  status?: number | keyof import("elysia").StatusMap;
36
- redirect?: string;
37
- cookie?: Record<string, import("elysia/cookies").ElysiaCookie>;
26
+ cookie?: Record<string, import("elysia").BaseCookie>;
27
+ redirect?: never;
38
28
  };
39
- path: string;
40
- route: string;
29
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = import("elysia").StatusResponse<Code>>(code: Code, response?: T) => import("elysia").ElysiaStatus<Code, T, import("elysia").NumericStatus<Code>>;
30
+ problem: typeof import("elysia").problem;
31
+ defer: (fn: import("elysia/types").AfterResponseHandler<import("elysia/types").IntersectIfObjectSchema<import("elysia/types").UnwrapMacroSchema<{
32
+ body: undefined;
33
+ headers: undefined;
34
+ query: undefined;
35
+ params: undefined;
36
+ cookie: undefined;
37
+ response: undefined;
38
+ }, {}>, import("elysia/types").MergeScopedSchemas<{}, {}, {}>>, import("elysia").DefaultSingleton & {
39
+ derive: Partial<{}>;
40
+ } & {
41
+ derive: Partial<{}>;
42
+ }>) => import("elysia/types").MaybePromise<void>;
43
+ readonly path: string;
44
+ route?: string;
45
+ rid?: string;
41
46
  request: Request;
42
47
  store: {};
43
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
44
- readonly 100: "Continue";
45
- readonly 101: "Switching Protocols";
46
- readonly 102: "Processing";
47
- readonly 103: "Early Hints";
48
- readonly 200: "OK";
49
- readonly 201: "Created";
50
- readonly 202: "Accepted";
51
- readonly 203: "Non-Authoritative Information";
52
- readonly 204: "No Content";
53
- readonly 205: "Reset Content";
54
- readonly 206: "Partial Content";
55
- readonly 207: "Multi-Status";
56
- readonly 208: "Already Reported";
57
- readonly 300: "Multiple Choices";
58
- readonly 301: "Moved Permanently";
59
- readonly 302: "Found";
60
- readonly 303: "See Other";
61
- readonly 304: "Not Modified";
62
- readonly 307: "Temporary Redirect";
63
- readonly 308: "Permanent Redirect";
64
- readonly 400: "Bad Request";
65
- readonly 401: "Unauthorized";
66
- readonly 402: "Payment Required";
67
- readonly 403: "Forbidden";
68
- readonly 404: "Not Found";
69
- readonly 405: "Method Not Allowed";
70
- readonly 406: "Not Acceptable";
71
- readonly 407: "Proxy Authentication Required";
72
- readonly 408: "Request Timeout";
73
- readonly 409: "Conflict";
74
- readonly 410: "Gone";
75
- readonly 411: "Length Required";
76
- readonly 412: "Precondition Failed";
77
- readonly 413: "Payload Too Large";
78
- readonly 414: "URI Too Long";
79
- readonly 415: "Unsupported Media Type";
80
- readonly 416: "Range Not Satisfiable";
81
- readonly 417: "Expectation Failed";
82
- readonly 418: "I'm a teapot";
83
- readonly 420: "Enhance Your Calm";
84
- readonly 421: "Misdirected Request";
85
- readonly 422: "Unprocessable Content";
86
- readonly 423: "Locked";
87
- readonly 424: "Failed Dependency";
88
- readonly 425: "Too Early";
89
- readonly 426: "Upgrade Required";
90
- readonly 428: "Precondition Required";
91
- readonly 429: "Too Many Requests";
92
- readonly 431: "Request Header Fields Too Large";
93
- readonly 451: "Unavailable For Legal Reasons";
94
- readonly 500: "Internal Server Error";
95
- readonly 501: "Not Implemented";
96
- readonly 502: "Bad Gateway";
97
- readonly 503: "Service Unavailable";
98
- readonly 504: "Gateway Timeout";
99
- readonly 505: "HTTP Version Not Supported";
100
- readonly 506: "Variant Also Negotiates";
101
- readonly 507: "Insufficient Storage";
102
- readonly 508: "Loop Detected";
103
- readonly 510: "Not Extended";
104
- readonly 511: "Network Authentication Required";
105
- }[Code] : Code>(code: Code, response?: T) => import("elysia").ElysiaCustomStatusResponse<Code, T, Code extends "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | "Partial Content" | "Multi-Status" | "Already Reported" | "Multiple Choices" | "Moved Permanently" | "Found" | "See Other" | "Not Modified" | "Temporary Redirect" | "Permanent Redirect" | "Bad Request" | "Unauthorized" | "Payment Required" | "Forbidden" | "Not Found" | "Method Not Allowed" | "Not Acceptable" | "Proxy Authentication Required" | "Request Timeout" | "Conflict" | "Gone" | "Length Required" | "Precondition Failed" | "Payload Too Large" | "URI Too Long" | "Unsupported Media Type" | "Range Not Satisfiable" | "Expectation Failed" | "I'm a teapot" | "Enhance Your Calm" | "Misdirected Request" | "Unprocessable Content" | "Locked" | "Failed Dependency" | "Too Early" | "Upgrade Required" | "Precondition Required" | "Too Many Requests" | "Request Header Fields Too Large" | "Unavailable For Legal Reasons" | "Internal Server Error" | "Not Implemented" | "Bad Gateway" | "Service Unavailable" | "Gateway Timeout" | "HTTP Version Not Supported" | "Variant Also Negotiates" | "Insufficient Storage" | "Loop Detected" | "Not Extended" | "Network Authentication Required" ? {
106
- readonly Continue: 100;
107
- readonly 'Switching Protocols': 101;
108
- readonly Processing: 102;
109
- readonly 'Early Hints': 103;
110
- readonly OK: 200;
111
- readonly Created: 201;
112
- readonly Accepted: 202;
113
- readonly 'Non-Authoritative Information': 203;
114
- readonly 'No Content': 204;
115
- readonly 'Reset Content': 205;
116
- readonly 'Partial Content': 206;
117
- readonly 'Multi-Status': 207;
118
- readonly 'Already Reported': 208;
119
- readonly 'Multiple Choices': 300;
120
- readonly 'Moved Permanently': 301;
121
- readonly Found: 302;
122
- readonly 'See Other': 303;
123
- readonly 'Not Modified': 304;
124
- readonly 'Temporary Redirect': 307;
125
- readonly 'Permanent Redirect': 308;
126
- readonly 'Bad Request': 400;
127
- readonly Unauthorized: 401;
128
- readonly 'Payment Required': 402;
129
- readonly Forbidden: 403;
130
- readonly 'Not Found': 404;
131
- readonly 'Method Not Allowed': 405;
132
- readonly 'Not Acceptable': 406;
133
- readonly 'Proxy Authentication Required': 407;
134
- readonly 'Request Timeout': 408;
135
- readonly Conflict: 409;
136
- readonly Gone: 410;
137
- readonly 'Length Required': 411;
138
- readonly 'Precondition Failed': 412;
139
- readonly 'Payload Too Large': 413;
140
- readonly 'URI Too Long': 414;
141
- readonly 'Unsupported Media Type': 415;
142
- readonly 'Range Not Satisfiable': 416;
143
- readonly 'Expectation Failed': 417;
144
- readonly "I'm a teapot": 418;
145
- readonly 'Enhance Your Calm': 420;
146
- readonly 'Misdirected Request': 421;
147
- readonly 'Unprocessable Content': 422;
148
- readonly Locked: 423;
149
- readonly 'Failed Dependency': 424;
150
- readonly 'Too Early': 425;
151
- readonly 'Upgrade Required': 426;
152
- readonly 'Precondition Required': 428;
153
- readonly 'Too Many Requests': 429;
154
- readonly 'Request Header Fields Too Large': 431;
155
- readonly 'Unavailable For Legal Reasons': 451;
156
- readonly 'Internal Server Error': 500;
157
- readonly 'Not Implemented': 501;
158
- readonly 'Bad Gateway': 502;
159
- readonly 'Service Unavailable': 503;
160
- readonly 'Gateway Timeout': 504;
161
- readonly 'HTTP Version Not Supported': 505;
162
- readonly 'Variant Also Negotiates': 506;
163
- readonly 'Insufficient Storage': 507;
164
- readonly 'Loop Detected': 508;
165
- readonly 'Not Extended': 510;
166
- readonly 'Network Authentication Required': 511;
167
- }[Code] : Code>;
168
- }) => void;
48
+ body: unknown;
49
+ query: Record<string, string | undefined>;
50
+ params: Record<string, string>;
51
+ headers: Record<string, string | undefined>;
52
+ cookie: Record<string, import("elysia").Cookie<unknown>>;
53
+ }): void;
169
54
  };
170
55
  };
171
56
  parser: {};
172
57
  response: {};
173
- }, {}, {
174
- derive: {};
175
- resolve: {};
176
- schema: {};
177
- standaloneSchema: {};
178
- response: {};
179
- }, {
180
- derive: {};
181
- resolve: {};
182
- schema: {};
183
- standaloneSchema: {};
184
- response: {};
185
- }>;
58
+ }, {}, import("elysia").DefaultEphemeral, import("elysia").DefaultEphemeral>;
@@ -1,58 +1,47 @@
1
- import { Elysia } from "elysia";
2
1
  import type { FurinSyncOptions } from "./config.ts";
3
2
  export type { ChangePage as SyncChangePage, SyncChange } from "./adapter.ts";
4
3
  export declare function subscribeSyncCursor(options: FurinSyncOptions, listener: (cursor: string) => void): Promise<{
5
4
  unsubscribe: () => void;
6
5
  }>;
7
- export declare function createSyncChangesPlugin(options: FurinSyncOptions): Elysia<"", {
8
- decorator: {};
9
- store: {};
10
- derive: {};
11
- resolve: {};
12
- }, {
6
+ export declare function createSyncChangesPlugin(options: FurinSyncOptions): import("elysia/types").AddRoute<"", "local", import("elysia").DefaultSingleton, {
13
7
  typebox: {};
14
- error: {};
15
- }, {
16
- schema: {};
17
- standaloneSchema: {};
18
- macro: {};
19
- macroFn: {};
20
- parser: {};
21
- response: {};
22
- }, {
23
- [x: string]: {
24
- changes: {
25
- get: {
26
- body: unknown;
27
- params: {};
28
- query: unknown;
29
- headers: unknown;
30
- response: {
31
- 200: Response | {
32
- cursor: string;
33
- hasMore: boolean;
34
- reset: boolean;
35
- changes: {
36
- cursor: string;
37
- invalidations: string[];
38
- }[];
39
- };
40
- };
41
- };
42
- };
8
+ error: [];
9
+ }, import("elysia").DefaultMetadata, {}, import("elysia").DefaultEphemeral, import("elysia").DefaultEphemeral, "get", `${string}/changes`, import("elysia/types").IntersectIfObjectSchema<import("elysia").UnwrapRoute<{}, {}, `/${string}/changes`>, import("elysia/types").MergeScopedSchemas<{}, {}, {}>>, {}, ({ request, set }: {
10
+ server: import("elysia").Server | null;
11
+ redirect: import("elysia").redirect;
12
+ set: {
13
+ headers: import("elysia").HTTPHeaders;
14
+ status?: number | keyof import("elysia").StatusMap;
15
+ cookie?: Record<string, import("elysia").BaseCookie>;
16
+ redirect?: never;
43
17
  };
44
- }, {
45
- derive: {};
46
- resolve: {};
47
- schema: {};
48
- standaloneSchema: {};
49
- response: {};
50
- }, {
51
- derive: {};
52
- resolve: {};
53
- schema: {};
54
- standaloneSchema: {};
55
- response: {};
56
- }>;
18
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = import("elysia").StatusResponse<Code>>(code: Code, response?: T) => import("elysia").ElysiaStatus<Code, T, import("elysia").NumericStatus<Code>>;
19
+ problem: typeof import("elysia").problem;
20
+ defer: (fn: import("elysia/types").AfterResponseHandler<NoInfer<import("elysia/types").IntersectIfObjectSchema<import("elysia").UnwrapRoute<{}, {}, `/${string}/changes`>, import("elysia/types").MergeScopedSchemas<{}, {}, {}>>>, NoInfer<import("elysia").DefaultSingleton & {
21
+ derive: {};
22
+ }>>) => import("elysia/types").MaybePromise<void>;
23
+ readonly path: string;
24
+ route?: string;
25
+ rid?: string;
26
+ request: Request;
27
+ store: {};
28
+ body: unknown;
29
+ query: Record<string, string | undefined>;
30
+ params: {};
31
+ headers: Record<string, string | undefined>;
32
+ cookie: Record<string, import("elysia").Cookie<unknown>>;
33
+ }) => Promise<Response | {
34
+ cursor: string;
35
+ hasMore: boolean;
36
+ reset: boolean;
37
+ changes: {
38
+ cursor: string;
39
+ invalidations: string[];
40
+ }[];
41
+ }>>;
57
42
  /** @internal — closes process-local stream state between tests. */
58
43
  export declare function __resetSyncState(): void;
44
+ /** Release process-local Sync subscriptions after Bun has drained HTTP traffic. */
45
+ export declare function closeSyncCursorStates(): Promise<void>;
46
+ /** Wait for released connections without closing subscriptions owned by other servers. */
47
+ export declare function waitForSyncCursorUnsubscriptions(): Promise<void>;
@@ -1,27 +1,21 @@
1
- import { parseQueryFromURL as elysiaParseQueryFromURL, parseQueryStandardSchema as elysiaParseQueryStandardSchema } from "elysia/parse-query";
2
- import { TypeCompiler as ElysiaTypeCompiler } from "elysia/type-system";
3
- import type { AnySchema, UnwrapSchema } from "elysia/types";
4
- export declare const parseQueryFromURL: typeof elysiaParseQueryFromURL;
5
- export declare const parseQueryStandardSchema: typeof elysiaParseQueryStandardSchema;
6
- export declare const TypeCompiler: typeof ElysiaTypeCompiler;
1
+ import { type AnySchema, type UnwrapSchema } from "elysia";
7
2
  interface SchemaObject {
8
3
  [key: string]: unknown;
9
4
  }
5
+ interface TypeBoxObjectSchema extends SchemaObject {
6
+ properties: SchemaObject;
7
+ }
10
8
  /**
11
9
  * Central compatibility boundary for Elysia types used by Furin's public DX.
12
10
  * Contract tests must fail before changes to these projections reach callers.
13
11
  */
14
12
  export type FurinSchema = AnySchema;
15
13
  interface FurinSchemaValidator {
16
- Check: (value: unknown) => unknown;
14
+ Check: (value: unknown) => boolean;
17
15
  Errors: (value: unknown) => Iterable<unknown>;
18
- parse: (value: unknown) => unknown;
19
- }
20
- interface FurinSchemaValidatorOptions {
21
- coerce?: boolean;
22
- dynamic?: boolean;
16
+ parse: (value: unknown, type: "params" | "query") => Promise<unknown>;
23
17
  }
24
- export declare function getSchemaValidator(schema: FurinSchema, options: FurinSchemaValidatorOptions): FurinSchemaValidator | undefined;
18
+ export declare function getSchemaValidator(schema: FurinSchema): FurinSchemaValidator | undefined;
25
19
  export type FurinUnwrap<Schema extends FurinSchema | undefined> = UnwrapSchema<Schema>;
26
20
  export type ElysiaRoutes<App extends {
27
21
  "~Routes": unknown;
@@ -37,5 +31,5 @@ export type ElysiaRouteParams<Leaf> = Leaf extends {
37
31
  export type ElysiaRouteQuery<Leaf> = Leaf extends {
38
32
  query: infer Query;
39
33
  } ? Query : never;
40
- export declare function isTypeBoxObjectSchema(schema: unknown): schema is SchemaObject;
34
+ export declare function isTypeBoxObjectSchema(schema: unknown): schema is TypeBoxObjectSchema;
41
35
  export {};
@@ -0,0 +1,2 @@
1
+ export declare function withProductionBuild<T>(build: () => Promise<T>): Promise<T>;
2
+ export declare function isProductionBuild(): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teyik0/furin",
3
- "version": "0.4.0-alpha.2",
3
+ "version": "0.5.0-alpha.2",
4
4
  "description": "React meta-framework powered by Elysia and Bun with file-based routing, SSR, SSG, and ISR.",
5
5
  "keywords": [
6
6
  "react",
@@ -41,6 +41,11 @@
41
41
  "bun": "./src/cache.ts",
42
42
  "import": "./dist/cache.js"
43
43
  },
44
+ "./cache/redis": {
45
+ "types": "./dist/server/cache/redis/index.d.ts",
46
+ "bun": "./src/server/cache/redis/index.ts",
47
+ "import": "./dist/server/cache/redis/index.js"
48
+ },
44
49
  "./routes": {
45
50
  "types": "./dist/routes.d.ts",
46
51
  "bun": "./src/routes.ts",
@@ -108,6 +113,11 @@
108
113
  "bun": "./src/server/internal.ts",
109
114
  "import": "./dist/server/internal.js"
110
115
  },
116
+ "./production-server": {
117
+ "types": "./dist/server/production-server.d.ts",
118
+ "bun": "./src/server/production-server.ts",
119
+ "import": "./dist/server/production-server.js"
120
+ },
111
121
  "./server-only": {
112
122
  "types": "./dist/server-only.d.ts",
113
123
  "bun": "./src/server-only.ts",
@@ -137,18 +147,18 @@
137
147
  "benchmark:rsc": "bun scripts/benchmark-rsc-transport.ts",
138
148
  "build": "bun run build.ts",
139
149
  "fix": "ultracite fix",
140
- "test": "bun test --parallel --isolate --max-concurrency 8 --bail",
141
- "test:dev": "bun test --changed --parallel --isolate --max-concurrency 8 --bail",
150
+ "test": "bun test --parallel=2 --isolate --max-concurrency 4 --bail --timeout 15000",
151
+ "test:dev": "bun test --changed --parallel --isolate --max-concurrency 4 --bail --timeout 15000",
142
152
  "test:hmr:soak": "FURIN_WEBVIEW_TESTS=1 FURIN_HMR_SOAK_TESTS=1 bun test tests/browser/hmr-conformance.webview.test.ts -t 'tracks memory' --timeout 3600000",
143
153
  "test:webview": "FURIN_WEBVIEW_TESTS=1 bun test tests/browser/hmr-conformance.webview.test.ts --timeout 60000",
144
154
  "tscheck": "tsc --noEmit"
145
155
  },
146
156
  "dependencies": {
147
- "@elysiajs/static": "^1.4.10",
157
+ "@elysia/static": "2.0.0-beta.2",
148
158
  "@jridgewell/trace-mapping": "^0.3.31",
149
- "@sinclair/typebox": "0.34.52",
150
159
  "@vercel/functions": "^3.9.7",
151
160
  "@yuku-toolchain/types": "0.9.5",
161
+ "exact-mirror": "1.2.6",
152
162
  "magic-string": "^1.2.3",
153
163
  "react-server-dom-webpack": "19.2.8",
154
164
  "seroval": "^1.6.7",
@@ -161,10 +171,11 @@
161
171
  "expect-type": "^1.4.0"
162
172
  },
163
173
  "peerDependencies": {
164
- "elysia": "^1.4.30",
165
- "evlog": "^2.28.1",
174
+ "elysia": "2.0.0-beta.19",
175
+ "evlog": "^2.29.0",
166
176
  "react": "19.2.8",
167
- "react-dom": "19.2.8"
177
+ "react-dom": "19.2.8",
178
+ "typebox": "1.3.34"
168
179
  },
169
180
  "engines": {
170
181
  "bun": ">=1.4.0"
@@ -8,7 +8,10 @@ Goal is having 3 modes:
8
8
 
9
9
  All should be portable.
10
10
 
11
- ## Cloudflare adapter
11
+ Server bundles and executables run Elysia 2's build-time AOT plugin against a
12
+ real generated application entry. The listener lives in a separate boot entry,
13
+ so AOT capture never opens a port. `strip` remains disabled while the Kiana beta
14
+ WebSocket capability imports helpers omitted by its automatic WS stub.
12
15
 
13
16
  ## Vercel adapter
14
17
 
@@ -27,6 +30,10 @@ The Vercel target emits Build Output API v3 directly to `.vercel/output`:
27
30
  The generated handler connects Furin cache invalidation to Vercel cache tags
28
31
  and keeps background ISR work alive with `waitUntil`.
29
32
 
33
+ The Function bundle uses the same Elysia AOT capture path with the Bun target.
34
+ No custom Elysia runtime adapter is needed: Vercel invokes the application's
35
+ Web-standard `handle(Request)` API inside its Bun runtime.
36
+
30
37
  Vercel Prerender Function invocations bypass Furin's process-local SSG/ISR
31
38
  cache. The CDN owns freshness and each regeneration returns newly rendered
32
39
  HTML; the in-memory cache remains exclusive to development and Bun targets.
@@ -35,7 +42,7 @@ The generated handler also installs Vercel Runtime Cache as the provider behind
35
42
  `@teyik0/furin/cache`. Application code keeps one portable cache API while
36
43
  development and Bun targets fall back to the in-memory provider.
37
44
 
38
- Application `@elysiajs/static` mounts are rejected during Vercel builds: their
45
+ Application `@elysia/static` mounts are rejected during Vercel builds: their
39
46
  runtime filesystem mappings are not deployable CDN mappings. Place static files
40
47
  under `public/` instead. PPR pages produce a cached public HTML shell, postponed
41
48
  React state and public loader snapshot atomically. Vercel's native `chain`