void-fate 1.5.1 → 1.6.0

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 CHANGED
@@ -6,6 +6,8 @@ Void adapter for [fate](https://github.com/nkzw-tech/fate).
6
6
  client wrapper needed to use fate in a Void app without keeping adapter glue in
7
7
  application code.
8
8
 
9
+ Deploy the same app to your own Cloudflare account or the Void platform.
10
+
9
11
  ## New Project
10
12
 
11
13
  For a new Void app, start from the Void template:
@@ -28,6 +30,23 @@ For an existing Void project, add the packages directly:
28
30
  pnpm add @nkzw/fate react-fate void-fate void
29
31
  ```
30
32
 
33
+ ## Cloudflare Deployment
34
+
35
+ From the project root:
36
+
37
+ ```sh
38
+ vp exec void deploy --platform cloudflare
39
+ ```
40
+
41
+ The Void template includes the `VOID_LIVE` Durable Object binding and class migration.
42
+ Void provisions resources, applies checked-in database migrations, and deploys the app
43
+ directly to your Cloudflare account. Commit the resource IDs saved in `wrangler.jsonc`.
44
+
45
+ After changing your database schema or auth configuration, run `vp exec void db generate`
46
+ and review and commit the migrations before deploying. See the
47
+ [Cloudflare integration](https://fate.technology/integrations/cloudflare) for migration
48
+ instructions for existing apps.
49
+
31
50
  ## Vite
32
51
 
33
52
  Use the regular `react-fate` Vite plugin with the Void transport.
@@ -131,7 +150,7 @@ export default function Layout({
131
150
  ## Custom Paths
132
151
 
133
152
  The defaults are intended to work without configuration. If your Void routes use
134
- different paths, pass the same values to the server and client helpers.
153
+ different paths, update the route filenames and pass the matching paths to the client.
135
154
 
136
155
  ```tsx
137
156
  <VoidFateClient livePath="/custom-live" origin={origin} rpcPath="/custom-fate" userId={userId}>
package/lib/react.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from "react";
2
2
  //#region src/react.d.ts
3
- type VoidFateClientProps = {
3
+ export type VoidFateClientProps = {
4
4
  children: ReactNode;
5
5
  fetch?: typeof fetch;
6
6
  headers?: HeadersInit | (() => HeadersInit | Promise<HeadersInit>);
@@ -13,6 +13,5 @@ type VoidFateClientProps = {
13
13
  url?: string | URL;
14
14
  userId?: null | string;
15
15
  };
16
- declare function VoidFateClient({ children, fetch, headers, livePath, liveRetryMs, liveUrl, onLiveError, origin, rpcPath, url, userId }: VoidFateClientProps): import("react").JSX.Element;
17
- //#endregion
18
- export { VoidFateClient, VoidFateClientProps };
16
+ export declare function VoidFateClient({ children, fetch, headers, livePath, liveRetryMs, liveUrl, onLiveError, origin, rpcPath, url, userId }: VoidFateClientProps): import("react").JSX.Element;
17
+ //#endregion
package/lib/server.d.mts CHANGED
@@ -5,7 +5,7 @@ type VoidFatePublishOptions = {
5
5
  eventId?: string;
6
6
  type?: string;
7
7
  };
8
- type VoidFateLiveStream = {
8
+ export type VoidFateLiveStream = {
9
9
  connect(context: unknown, options?: unknown): Promise<Response>;
10
10
  control(context: unknown, options?: unknown): Promise<Response>;
11
11
  withEnv(env: unknown): {
@@ -17,24 +17,23 @@ type FateLiveContext = {
17
17
  pending: Array<Promise<void>>;
18
18
  stream: VoidFateLiveStream;
19
19
  };
20
- type VoidFateLiveOptions = Record<never, never>;
21
- type VoidFateRouteOptions = {
20
+ export type VoidFateLiveOptions = Record<never, never>;
21
+ export type VoidFateRouteOptions = {
22
22
  stream: VoidFateLiveStream;
23
23
  };
24
- type VoidFateLive = Readonly<{
24
+ export type VoidFateLive = Readonly<{
25
25
  live: LiveEventBus;
26
26
  withContext: <T>(context: Omit<FateLiveContext, 'pending'>, callback: () => T) => T;
27
27
  }>;
28
- declare const defaultVoidFateRpcPath = "/fate";
29
- declare const defaultVoidFateLivePath = "/fate-live";
30
- declare function createVoidFateLive(_options?: VoidFateLiveOptions): VoidFateLive;
31
- declare function defineVoidFateRoute<AdapterContext>(server: FateServer<unknown, AdapterContext>, live: VoidFateLive, options: VoidFateRouteOptions): {
28
+ export declare const defaultVoidFateRpcPath = "/fate";
29
+ export declare const defaultVoidFateLivePath = "/fate-live";
30
+ export declare function createVoidFateLive(_options?: VoidFateLiveOptions): VoidFateLive;
31
+ export declare function defineVoidFateRoute<AdapterContext>(server: FateServer<unknown, AdapterContext>, live: VoidFateLive, options: VoidFateRouteOptions): {
32
32
  GET: import("void").TypedHandler<{}, never>;
33
33
  POST: import("void").TypedHandler<{}, never>;
34
34
  };
35
- declare function defineVoidFateLiveRoute(stream: VoidFateLiveStream): {
35
+ export declare function defineVoidFateLiveRoute(stream: VoidFateLiveStream): {
36
36
  GET: import("void").TypedHandler<{}, never>;
37
37
  POST: import("void").TypedHandler<{}, never>;
38
38
  };
39
- //#endregion
40
- export { VoidFateLive, VoidFateLiveOptions, VoidFateLiveStream, VoidFateRouteOptions, createVoidFateLive, defaultVoidFateLivePath, defaultVoidFateRpcPath, defineVoidFateLiveRoute, defineVoidFateRoute };
39
+ //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "void-fate",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "description": "Void adapter for fate.",
5
5
  "homepage": "https://github.com/nkzw-tech/fate",
6
6
  "license": "MIT",
@@ -37,20 +37,20 @@
37
37
  }
38
38
  },
39
39
  "dependencies": {
40
- "@nkzw/fate": "^1.3.3",
41
- "react-fate": "^1.3.3"
40
+ "@nkzw/fate": "1.6.0",
41
+ "react-fate": "1.6.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@types/react": "^19.2.18",
45
- "react": "^19.2.8",
46
- "vite": "npm:@voidzero-dev/vite-plus-core@0.3.0",
47
- "void": "^0.10.13"
44
+ "@types/react": "19.3.0",
45
+ "react": "19.3.0",
46
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.3.3",
47
+ "void": "^0.20.1"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@nkzw/fate": "^1.0.0-rc.0",
51
51
  "react": "^19.2.0",
52
52
  "react-fate": "^1.0.0-rc.0",
53
- "void": "^0.7.13"
53
+ "void": "^0.20.1"
54
54
  },
55
55
  "scripts": {
56
56
  "build": "vp pack --tsconfig tsconfig.json -d lib --target=node24 src/index.ts src/react.tsx src/server.ts"