ziex 0.1.0-dev.1466 → 0.1.0-dev.1568
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 +3 -9
- package/app.d.ts +37 -22
- package/build.zig.zon +1 -1
- package/index.d.ts +1 -1
- package/index.js +239 -218
- package/package.json +2 -2
- package/platforms/aws-lambda/index.d.ts +1 -1
- package/platforms/cloudflare/app.d.ts +31 -1
- package/platforms/cloudflare/index.d.ts +5 -4
- package/platforms/cloudflare/index.js +1722 -1645
- package/platforms/cloudflare/kv.d.ts +4 -2
- package/platforms/cloudflare/stateful.d.ts +26 -0
- package/platforms/cloudflare/worker.d.ts +1 -2
- package/platforms/vercel/index.d.ts +1 -1
- package/runtime/index.d.ts +20 -10
- package/runtime/kv/indexdb.d.ts +11 -3
- package/runtime/kv/localstorage.d.ts +11 -3
- package/runtime/kv/memory.d.ts +13 -6
- package/runtime/kv.d.ts +16 -18
- package/runtime/kv.js +178 -241
- package/runtime/wasi.d.ts +2 -7
- package/wasm/dom_cmd.d.ts +0 -9
- package/wasm/index.js +224 -188
- package/wasm/init.dev.js +224 -188
- package/wasm/init.js +3 -3
- package/platforms/cloudflare/do.d.ts +0 -50
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ziex",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.1568",
|
|
4
4
|
"types": "index.d.ts",
|
|
5
5
|
"description": "Ziex is a framework for building web applications with Zig.",
|
|
6
6
|
"main": "index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"license": "MIT",
|
|
41
41
|
"scripts": {},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@ziex/cli": "0.1.0-dev.
|
|
43
|
+
"@ziex/cli": "0.1.0-dev.1568"
|
|
44
44
|
},
|
|
45
45
|
"module": "index.js"
|
|
46
46
|
}
|
|
@@ -1,2 +1,32 @@
|
|
|
1
|
+
import { Ziex, type StickyKey } from "../../app";
|
|
1
2
|
export { Ziex, resolveModule } from "../../app";
|
|
2
|
-
export type { WasmInput } from "../../app";
|
|
3
|
+
export type { WasmInput, ZiexOptions, StickyKey } from "../../app";
|
|
4
|
+
export type StatefulOptions<Env> = {
|
|
5
|
+
/** Env binding for sticky long-lived fetch (must match wrangler `durable_objects.bindings`). */
|
|
6
|
+
binding: StickyKey<Env>;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Sticky long-lived fetch class for Cloudflare (WebSocket upgrades + pub/sub).
|
|
10
|
+
*
|
|
11
|
+
* Reuses the app's module/kv/db/imports and registers the env binding for upgrade forwarding.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { Ziex } from "ziex";
|
|
16
|
+
* import { stateful } from "ziex/cloudflare";
|
|
17
|
+
*
|
|
18
|
+
* const app = new Ziex<Env>({ module, kv: "KV", db: "DB" });
|
|
19
|
+
* export const ChatRoom = stateful(app, { binding: "CHAT_ROOM" });
|
|
20
|
+
* export default app;
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function stateful<Env>(app: Ziex<Env>, options: StatefulOptions<Env>): {
|
|
24
|
+
new (state: any, env: any): {
|
|
25
|
+
readonly state: any;
|
|
26
|
+
readonly env: any;
|
|
27
|
+
readonly connections: Map<WebSocket, import("./worker").WsState & {
|
|
28
|
+
topics: Set<string>;
|
|
29
|
+
}>;
|
|
30
|
+
fetch(request: Request): Promise<Response>;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
export { createKVImports, createBrowserKVBindings, hasJspi, } from "../../runtime/kv";
|
|
2
|
+
export type { KVNamespace, SyncKVNamespace, BrowserKVOptions, } from "../../runtime/kv";
|
|
3
|
+
export { get, put, del, list } from "../../runtime/kv/memory";
|
|
4
|
+
export { Ziex, resolveModule, stateful } from "./app";
|
|
5
|
+
export type { WasmInput, ZiexOptions, StickyKey, StatefulOptions } from "./app";
|