@ziex/cli 0.1.0-dev.866 → 0.1.0-dev.928

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/bin/ziex DELETED
@@ -1,61 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // Stub that delegates to the native zx binary.
4
- // The postinstall script copies it to bin/zx, but if that hasn't run
5
- // (e.g. bunx), we resolve the platform package's binary directly.
6
-
7
- import { execFileSync } from "child_process";
8
- import { existsSync } from "fs";
9
- import { createRequire } from "module";
10
- import { dirname, join } from "path";
11
- import { fileURLToPath } from "url";
12
-
13
- const __dirname = dirname(fileURLToPath(import.meta.url));
14
- const require = createRequire(import.meta.url);
15
- const isWindows = process.platform === "win32";
16
- const ext = isWindows ? ".exe" : "";
17
-
18
- function findBinary() {
19
- // 1. Check if postinstall already placed the binary
20
- const localBin = join(__dirname, `zx${ext}`);
21
- if (existsSync(localBin)) return localBin;
22
-
23
- // 2. Resolve from the platform-specific optional dependency
24
- const platformPkgs = {
25
- "darwin-arm64": "@ziex/cli-darwin-arm64",
26
- "darwin-x64": "@ziex/cli-darwin-x64",
27
- "linux-x64": "@ziex/cli-linux-x64",
28
- "linux-arm64": "@ziex/cli-linux-arm64",
29
- "win32-x64": "@ziex/cli-win32-x64",
30
- "win32-arm64": "@ziex/cli-win32-arm64",
31
- };
32
-
33
- const pkg = platformPkgs[`${process.platform}-${process.arch}`];
34
- if (pkg) {
35
- try {
36
- const pkgDir = dirname(require.resolve(`${pkg}/package.json`));
37
- const bin = join(pkgDir, "bin", `zx${ext}`);
38
- if (existsSync(bin)) return bin;
39
- } catch {}
40
- }
41
-
42
- return null;
43
- }
44
-
45
- const bin = findBinary();
46
- if (!bin) {
47
- console.error(
48
- "Error: ziex native binary not found. The postinstall script may not have run.",
49
- );
50
- console.error("Try reinstalling: npm install -g ziex");
51
- process.exit(1);
52
- }
53
-
54
- try {
55
- execFileSync(bin, process.argv.slice(2), { stdio: "inherit" });
56
- } catch (e) {
57
- if (e.status !== undefined) {
58
- process.exit(e.status);
59
- }
60
- throw e;
61
- }
package/build.zig DELETED
@@ -1,5 +0,0 @@
1
- const std = @import("std");
2
-
3
- pub fn build(b: *std.Build) void {
4
- _ = b; // stub
5
- }
package/build.zig.zon DELETED
@@ -1,7 +0,0 @@
1
- .{
2
- .name = .ziex_js,
3
- .fingerprint = 0x3428b4e119b455bf,
4
- .version = "0.1.0-dev.804",
5
- .minimum_zig_version = "0.15.2",
6
- .paths = .{""},
7
- }
@@ -1,2 +0,0 @@
1
- export { Ziex, resolveModule } from "../app";
2
- export type { WasmInput } from "../app";
@@ -1,48 +0,0 @@
1
- import type { WsState } from "../runtime";
2
- import type { KVNamespace } from "../kv";
3
- type ConnState = WsState & {
4
- topics: Set<string>;
5
- };
6
- /**
7
- * Create a Durable Object class that handles WebSocket connections for a ZX app.
8
- *
9
- * Each DO instance corresponds to one "room" (keyed by pathname). All clients
10
- * connecting to the same route share a DO instance, enabling pub/sub via
11
- * `ctx.socket.subscribe()` / `ctx.socket.publish()`.
12
- *
13
- * @example
14
- * ```ts
15
- * // worker.ts
16
- * import { Ziex } from "ziex";
17
- * import { createWebSocketDO } from "ziex/cloudflare";
18
- * import module from "./app.wasm";
19
- *
20
- * export const ZxWS = createWebSocketDO(module);
21
- *
22
- * export default new Ziex({
23
- * module,
24
- * websocket: (env) => env.ZxWS,
25
- * });
26
- * ```
27
- */
28
- export declare function createWebSocketDO(module: WebAssembly.Module, options?: {
29
- /**
30
- * KV namespace bindings for the DO. Pass a factory that receives the DO's
31
- * `env` so bindings are resolved at runtime:
32
- *
33
- * ```ts
34
- * createWebSocketDO(module, { kv: (env) => ({ default: env.KV }) })
35
- * ```
36
- */
37
- kv?: (env: any) => Record<string, KVNamespace>;
38
- imports?: (mem: () => WebAssembly.Memory) => Record<string, Record<string, unknown>>;
39
- }): {
40
- new (state: any, env: any): {
41
- readonly doState: any;
42
- readonly env: any;
43
- /** All active connections in this room, keyed by their server-side WebSocket. */
44
- readonly connections: Map<WebSocket, ConnState>;
45
- fetch(request: Request): Promise<Response>;
46
- };
47
- };
48
- export {};
@@ -1,4 +0,0 @@
1
- export * as worker from "../runtime";
2
- export * as kv from "../kv";
3
- export { Ziex } from "../app";
4
- export { createWebSocketDO } from "./do";