@cossackframework/node-adapter 0.8.1 → 0.8.3

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
@@ -1,16 +1,20 @@
1
1
  # Cossack Framework Node Adapter
2
2
 
3
- This package provides a Node.js adapter for the Cossack Framework, allowing you to run your Cossack applications in a Node.js environment. It includes utilities for handling HTTP requests and responses, WebSocket upgrades, static file serving, and runtime polyfills that keep application code identical across Cloudflare Workers and Node.js.
3
+ This package runs Cossack applications on Node.js. It handles HTTP requests,
4
+ WebSocket upgrades, and static files. It also provides runtime polyfills so
5
+ application code can work on Cloudflare Workers and Node.js.
4
6
 
5
7
  ## Installation
6
- Refer to our [Installation Guide](https://cossack.dev/docs/installation) for detailed instructions on how to set up the Cossack Framework and its packages.
8
+ See the [Installation Guide](https://cossack.dev/docs/installation) to set up
9
+ Cossack and its packages.
7
10
 
8
11
  ## Exports
9
12
 
10
- - `CossackNodeAdapter` — handles WebSocket upgrades and component bootstrapping on a Node `http.Server`.
11
- - `serveStatic` — Node `fs`-based Hono middleware for serving static assets.
12
- - `NodeWebSocketRuntime` — the WebSocket runtime used by the adapter.
13
- - `createNodeEmailSender` — Node.js polyfill for Cloudflare's `send_email` binding (`env.EMAIL`).
13
+ - `CossackNodeAdapter` : handles WebSocket upgrades and component bootstrapping on a Node `http.Server`.
14
+ - `nodeRuntimeAdapter` : pass to `createApp()` so SSR emits Node process-local WebSocket targets.
15
+ - `serveStatic` : Node `fs`-based Hono middleware for serving static assets.
16
+ - `NodeWebSocketRuntime` : the WebSocket runtime used by the adapter.
17
+ - `createNodeEmailSender` : Node.js polyfill for Cloudflare's `send_email` binding (`env.EMAIL`).
14
18
 
15
19
  ## Unified `env.EMAIL` (Cloudflare email binding polyfill)
16
20
 
@@ -30,11 +34,19 @@ Build the sender from SMTP env vars and inject it into `env`, then pass `env` bo
30
34
  ```ts
31
35
  import { serve } from '@hono/node-server';
32
36
  import { createApp } from '@cossackframework/framework/router';
33
- import { CossackNodeAdapter, createNodeEmailSender } from '@cossackframework/node-adapter';
37
+ import {
38
+ CossackNodeAdapter,
39
+ createNodeEmailSender,
40
+ nodeRuntimeAdapter,
41
+ } from '@cossackframework/node-adapter';
34
42
  import { App } from './App';
35
43
  import { template } from './root';
36
44
 
37
- const app = createApp({ AppComponent: App, htmlTemplate: template });
45
+ const app = createApp({
46
+ AppComponent: App,
47
+ htmlTemplate: template,
48
+ runtimeAdapter: nodeRuntimeAdapter,
49
+ });
38
50
 
39
51
  const env = {
40
52
  EMAIL: createNodeEmailSender({
@@ -55,6 +67,8 @@ const server = serve(
55
67
  // WebSocket: pass the same env so `@Server` methods over WS see `this.env.EMAIL`.
56
68
  new CossackNodeAdapter({
57
69
  server,
70
+ // Keys match the routePath metadata emitted by Cossack, for example
71
+ // new Map([['/account/:id', AccountPage]]).
58
72
  componentRegistry,
59
73
  env,
60
74
  });
@@ -63,13 +77,13 @@ new CossackNodeAdapter({
63
77
  ### Environment variables
64
78
  Configure via `.dev.vars` (Cloudflare dev) or your shell/`.env` (Node):
65
79
 
66
- | Variable | Description | Default |
80
+ | Variable | Description | Default |
67
81
  | -------------- | -------------------------------------------- | ------------------ |
68
- | `SMTP_HOST` | SMTP server host (e.g. `smtp.gmail.com`) | — |
69
- | `SMTP_PORT` | SMTP server port | `587` |
70
- | `SMTP_SECURE` | Use TLS (`"true"` for port 465) | `port === 465` |
71
- | `SMTP_USER` | SMTP username | — |
72
- | `SMTP_PASS` | SMTP password | — |
73
- | `MAIL_FROM` | Default `from` address when omitted | `no-reply@example.com` |
82
+ | `SMTP_HOST` | SMTP server host (e.g. `smtp.gmail.com`) | : |
83
+ | `SMTP_PORT` | SMTP server port | `587` |
84
+ | `SMTP_SECURE` | Use TLS (`"true"` for port 465) | `port === 465` |
85
+ | `SMTP_USER` | SMTP username | : |
86
+ | `SMTP_PASS` | SMTP password | : |
87
+ | `MAIL_FROM` | Default `from` address when omitted | `no-reply@example.com` |
74
88
 
75
89
  Now `await this.env.EMAIL.send(...)` works identically in `@Server` methods on both Cloudflare Workers and Node.js.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  import type { IncomingMessage, Server } from 'http';
2
2
  import type { Cossack } from '@cossackframework/core';
3
3
  export * from './runtime';
4
+ /** Pass to `createApp({ runtimeAdapter })` so SSR emits process-runtime targets. */
5
+ export declare const nodeRuntimeAdapter: {
6
+ readonly name: 'node';
7
+ };
4
8
  export { serveStatic, type StaticServeOptions } from './static-serve';
5
9
  export { createNodeEmailSender, type NodeEmailOptions, type NodeEmailSender, type EmailMessageInput, type EmailSendResult, type EmailAddress, } from './email';
6
10
  export interface CossackNodeAdapterOptions {
@@ -30,6 +34,10 @@ export interface CossackNodeAdapterOptions {
30
34
  * `this.env.EMAIL.send(...)` call works on both runtimes.
31
35
  */
32
36
  env?: Record<string, unknown>;
37
+ /** Maximum number of process-local component instances. Defaults to 512. */
38
+ maxInstances?: number;
39
+ /** Evict disconnected instances after this idle period. Defaults to 15 minutes. */
40
+ idleTimeoutMs?: number;
33
41
  }
34
42
  export declare class CossackNodeAdapter {
35
43
  private wss;
@@ -39,6 +47,9 @@ export declare class CossackNodeAdapter {
39
47
  private authenticate?;
40
48
  private defaultUser;
41
49
  private env?;
50
+ private maxInstances;
51
+ private idleTimeoutMs;
42
52
  constructor(options: CossackNodeAdapterOptions);
43
53
  private handleUpgrade;
54
+ private pruneInstances;
44
55
  }
package/dist/index.js CHANGED
@@ -1,114 +1,87 @@
1
1
  import { WebSocket as e, WebSocketServer as t } from "ws";
2
- import { createInstance as n, isOriginAllowed as r } from "@cossackframework/core";
3
- import { URL as i } from "url";
4
- import * as a from "fs";
5
- import * as o from "path";
6
- import s from "nodemailer";
2
+ import { InMemoryWebSocketRuntime as n, createInstance as r, isOriginAllowed as i } from "@cossackframework/core";
3
+ import { URL as a } from "url";
4
+ import * as o from "fs";
5
+ import * as s from "path";
6
+ import c from "nodemailer";
7
7
  //#region src/runtime.ts
8
- var c = class {
9
- component;
10
- clients = /* @__PURE__ */ new Set();
11
- constructor(e) {
12
- this.component = e, this.component._runtime = this;
8
+ var l = class extends n {
9
+ constructor(t) {
10
+ super(t, {
11
+ isOpen: (t) => t.readyState === e.OPEN,
12
+ onError: (e) => console.error("[Cossack] Ignoring malformed WebSocket message:", e)
13
+ });
13
14
  }
14
15
  addClient(e, t) {
15
- this.clients.add(e), e.user = t, e.on("close", () => {
16
- this.clients.delete(e);
16
+ super.addClient(e, t), e.on("close", () => {
17
+ this.removeClient(e);
17
18
  }), e.on("message", (t) => {
18
19
  this.onClientMessage(e, t.toString()).catch((e) => {
19
20
  console.error("[Cossack] Error handling Node WebSocket message:", e);
20
21
  });
21
22
  });
22
23
  }
23
- async onClientMessage(e, t) {
24
- let n = e, r;
25
- try {
26
- r = JSON.parse(t);
27
- } catch (e) {
28
- console.error("[Cossack] Ignoring malformed WebSocket message:", e);
29
- return;
30
- }
31
- if (!r || typeof r != "object" || r.type !== "action" || typeof r.action != "string" || !Array.isArray(r.payload)) return;
32
- let i = n.user;
33
- await this.component.executeAction(r.action, r.payload, i, e);
34
- }
35
- broadcastState(t) {
36
- let n = JSON.stringify({
37
- type: "state-update",
38
- state: t
39
- });
40
- for (let t of this.clients) t.readyState === e.OPEN && t.send(n);
41
- }
42
- broadcastEvent(t, n) {
43
- let r = JSON.stringify({
44
- type: "event",
45
- eventName: t,
46
- payload: n
47
- });
48
- for (let t of this.clients) t.readyState === e.OPEN && t.send(r);
49
- }
50
- sendClientAction(t, n, r) {
51
- let i = t, a = JSON.stringify({
52
- type: "client-action",
53
- action: n,
54
- payload: r
55
- });
56
- i.readyState === e.OPEN && i.send(a);
57
- }
58
- async persistState() {}
59
24
  };
60
25
  //#endregion
61
26
  //#region src/static-serve.ts
62
- function l(e) {
27
+ function u(e) {
63
28
  let t = e, n = t.indexOf("?");
64
29
  n !== -1 && (t = t.substring(0, n));
65
30
  let r = t.indexOf("#");
66
31
  return r !== -1 && (t = t.substring(0, r)), t.startsWith("/") || (t = "/" + t), t !== "/" && t.endsWith("/") && (t = t.slice(0, -1)), t;
67
32
  }
68
- function u(e) {
69
- let { root: t, prefix: n = "/", index: r = !0 } = e, i = o.resolve(t), s = i + o.sep, c = (e) => {
70
- let t = o.resolve(e);
71
- return t === i || t.startsWith(s);
33
+ function d(e) {
34
+ let { root: t, prefix: n = "/", index: r = !0, cacheControl: i } = e, a = s.resolve(t), c = a + s.sep, l = (e) => {
35
+ let t = s.resolve(e);
36
+ return t === a || t.startsWith(c);
72
37
  };
73
- return async (e, i) => {
74
- if (e.req.method !== "GET" && e.req.method !== "HEAD") return i();
75
- let s = l(e.req.path);
76
- if (!s.startsWith(n)) return i();
77
- let u = s.substring(n.length);
78
- u === "" && (u = "/");
79
- let f;
80
- if (u === "/") f = o.join(t, "index.html");
81
- else if (f = o.join(t, u), r && !a.existsSync(f)) {
82
- let e = o.join(f, "index.html");
83
- a.existsSync(e) && (f = e);
38
+ return async (e, c) => {
39
+ if (e.req.method !== "GET" && e.req.method !== "HEAD") return c();
40
+ let d = u(e.req.path);
41
+ if (!d.startsWith(n)) return c();
42
+ let p = d.substring(n.length);
43
+ p === "" && (p = "/");
44
+ let m;
45
+ if (p === "/") {
46
+ if (!r) return c();
47
+ m = s.join(t, "index.html");
48
+ } else if (m = s.join(t, p), r && !o.existsSync(m)) {
49
+ let e = s.join(m, "index.html");
50
+ o.existsSync(e) && (m = e);
84
51
  }
85
- if (!c(f)) return i();
52
+ if (!l(m)) return c();
86
53
  try {
87
- let e = await a.promises.stat(f);
88
- if (e.isDirectory()) if (r) {
89
- let t = o.join(f, "index.html");
54
+ let t = await o.promises.stat(m);
55
+ if (t.isDirectory()) if (r) {
56
+ let e = s.join(m, "index.html");
90
57
  try {
91
- await a.promises.access(t), f = t, e = await a.promises.stat(f);
58
+ await o.promises.access(e), m = e, t = await o.promises.stat(m);
92
59
  } catch {
93
- return i();
60
+ return c();
94
61
  }
95
- } else return i();
96
- let t = await a.promises.readFile(f), n = d(f);
97
- return new Response(new Uint8Array(t), {
62
+ } else return c();
63
+ let [n, l] = await Promise.all([o.promises.realpath(a), o.promises.realpath(m)]), u = s.relative(n, l);
64
+ if (u === ".." || u.startsWith(`..${s.sep}`) || s.isAbsolute(u) || !t.isFile()) return c();
65
+ let p = e.req.method === "HEAD" ? null : await o.promises.readFile(l), h = f(m), g = new Headers({ "Content-Type": h }), _ = typeof i == "function" ? i(m, d) : i;
66
+ return _ && g.set("Cache-Control", _), new Response(p === null ? null : new Uint8Array(p), {
98
67
  status: 200,
99
- headers: { "Content-Type": n }
68
+ headers: g
100
69
  });
101
70
  } catch {
102
- return i();
71
+ return c();
103
72
  }
104
73
  };
105
74
  }
106
- function d(e) {
75
+ function f(e) {
107
76
  return {
108
77
  ".html": "text/html",
109
78
  ".css": "text/css",
110
79
  ".js": "application/javascript",
80
+ ".mjs": "application/javascript",
81
+ ".cjs": "application/javascript",
111
82
  ".json": "application/json",
83
+ ".map": "application/json",
84
+ ".webmanifest": "application/manifest+json",
112
85
  ".xml": "application/xml",
113
86
  ".txt": "text/plain",
114
87
  ".png": "image/png",
@@ -123,12 +96,12 @@ function d(e) {
123
96
  ".eot": "application/vnd.ms-fontobject",
124
97
  ".pdf": "application/pdf",
125
98
  ".zip": "application/zip"
126
- }[o.extname(e).toLowerCase()] || "application/octet-stream";
99
+ }[s.extname(e).toLowerCase()] || "application/octet-stream";
127
100
  }
128
101
  //#endregion
129
102
  //#region src/email.ts
130
- function f(e) {
131
- let t = s.createTransport({
103
+ function p(e) {
104
+ let t = c.createTransport({
132
105
  host: e.host,
133
106
  port: e.port,
134
107
  secure: e.secure ?? e.port === 465,
@@ -154,7 +127,19 @@ function f(e) {
154
127
  }
155
128
  //#endregion
156
129
  //#region src/index.ts
157
- var p = class {
130
+ var m = { name: "node" };
131
+ function h(e) {
132
+ if (e === null) return {};
133
+ let t = JSON.parse(e);
134
+ if (!t || typeof t != "object" || Array.isArray(t)) throw TypeError("WebSocket route params must be a JSON object");
135
+ let n = {};
136
+ for (let [e, r] of Object.entries(t)) {
137
+ if (typeof r != "string") throw TypeError("WebSocket route params must contain strings");
138
+ n[e] = r;
139
+ }
140
+ return n;
141
+ }
142
+ var g = class {
158
143
  wss;
159
144
  instances = /* @__PURE__ */ new Map();
160
145
  componentRegistry;
@@ -162,69 +147,111 @@ var p = class {
162
147
  authenticate;
163
148
  defaultUser;
164
149
  env;
150
+ maxInstances;
151
+ idleTimeoutMs;
165
152
  constructor(e) {
166
- this.wss = new t({ noServer: !0 }), this.componentRegistry = e.componentRegistry, this.allowedOrigins = e.allowedOrigins, this.authenticate = e.authenticate, this.defaultUser = e.defaultUser ?? { id: "anonymous" }, this.env = e.env, e.server.on("upgrade", (t, n, r) => {
167
- new i(t.url || "", `http://${t.headers.host}`).pathname.startsWith(e.path || "/ws") && this.handleUpgrade(t, n, r);
153
+ this.wss = new t({ noServer: !0 }), this.componentRegistry = e.componentRegistry, this.allowedOrigins = e.allowedOrigins, this.authenticate = e.authenticate, this.defaultUser = e.defaultUser ?? { id: "anonymous" }, this.env = e.env, this.maxInstances = e.maxInstances ?? 512, this.idleTimeoutMs = e.idleTimeoutMs ?? 15 * 6e4, e.server.on("upgrade", (t, n, r) => {
154
+ new a(t.url || "", `http://${t.headers.host}`).pathname.startsWith(e.path || "/ws") && this.handleUpgrade(t, n, r);
168
155
  });
169
156
  }
170
- handleUpgrade(e, t, a) {
171
- let o = new i(e.url || "", `http://${e.headers.host}`).toString(), s = e.headers.origin;
172
- if (!r(s, o, this.allowedOrigins)) {
157
+ handleUpgrade(e, t, n) {
158
+ let o = new a(e.url || "", `http://${e.headers.host}`).toString(), s = e.headers.origin;
159
+ if (!i(s, o, this.allowedOrigins)) {
173
160
  t.destroy();
174
161
  return;
175
162
  }
176
- this.wss.handleUpgrade(e, t, a, async (t) => {
177
- let r = new i(e.url || "", `http://${e.headers.host}`), a = r.pathname.split("/"), o = a.pop(), s = a.pop(), l = r.searchParams, u = l.get("componentId");
163
+ this.wss.handleUpgrade(e, t, n, async (t) => {
164
+ let n = new a(e.url || "", `http://${e.headers.host}`), i = n.pathname.split("/"), o = i.pop(), s = i.pop(), c = n.searchParams, u = c.get("routePath") || c.get("componentPath") || c.get("componentId");
178
165
  if (!o || !u) {
179
- t.close(1008, "Missing target or componentId");
166
+ t.close(1008, "Missing target or routePath");
180
167
  return;
181
168
  }
182
- let d = this.instances.get(o);
183
- if (!d) {
184
- let e = this.componentRegistry.get(u);
185
- if (!e) {
186
- t.close(1008, "Component not found");
187
- return;
188
- }
189
- let r = n(e), i = l.get("pathname") || "/", a = { req: {
190
- path: i,
191
- param: (e) => {
192
- if (e) return l.get(e);
193
- let t = {};
194
- return l.forEach((e, n) => {
195
- t[n] = e;
196
- }), t;
197
- },
169
+ let d;
170
+ try {
171
+ d = h(c.get("params"));
172
+ } catch {
173
+ t.close(1008, "Invalid route params");
174
+ return;
175
+ }
176
+ let f = this.componentRegistry.get(u);
177
+ if (!f) {
178
+ t.close(1008, "Component not found");
179
+ return;
180
+ }
181
+ let p;
182
+ try {
183
+ p = this.authenticate ? await this.authenticate(e) : this.defaultUser;
184
+ } catch (e) {
185
+ console.error("[Cossack] Authentication failed, rejecting upgrade:", e), t.close(1008, "Authentication failed");
186
+ return;
187
+ }
188
+ let m = c.get("pathname") || "/", g = {
189
+ get: (e) => e === "user" ? p : void 0,
190
+ req: {
191
+ path: m,
192
+ param: (e) => e ? d[e] : { ...d },
198
193
  query: (e) => {
199
- if (e) return l.get(e);
194
+ if (e) return c.get(e);
200
195
  let t = {};
201
- return l.forEach((e, n) => {
196
+ return c.forEach((e, n) => {
202
197
  t[n] = e;
203
198
  }), t;
204
199
  }
205
- } };
206
- await r.bootstrap({
207
- context: a,
208
- env: this.env,
209
- page: i,
210
- providerName: s
211
- }), d = new c(r), this.instances.set(o, d);
212
- }
213
- let f;
200
+ }
201
+ }, _ = Reflect.getMetadata("page:options", f), v;
214
202
  try {
215
- f = this.authenticate ? await this.authenticate(e) : this.defaultUser;
203
+ v = _?.scope ? await _.scope(g) : `user:${p?.id || "anonymous"}`;
216
204
  } catch (e) {
217
- console.error("[Cossack] Authentication failed, rejecting upgrade:", e), t.close(1008, "Authentication failed");
205
+ console.error("[Cossack] Failed to resolve Node WebSocket scope:", e), t.close(1008, "Invalid WebSocket scope");
206
+ return;
207
+ }
208
+ if (o !== v) {
209
+ t.close(1008, "Invalid WebSocket scope");
218
210
  return;
219
211
  }
220
- d.addClient(t, f);
221
- let p = d.component.getInitialState();
212
+ let y = `${u}:${s ?? "page"}:${o}`;
213
+ this.pruneInstances(!0);
214
+ let b = this.instances.get(y), x = b?.runtime;
215
+ if (!x) {
216
+ if (this.instances.size >= this.maxInstances) {
217
+ t.close(1013, "Runtime instance limit reached");
218
+ return;
219
+ }
220
+ let e = r(f);
221
+ await e.bootstrap({
222
+ context: g,
223
+ user: p,
224
+ env: this.env,
225
+ runtime: {
226
+ platform: "web",
227
+ adapter: "node"
228
+ },
229
+ page: m,
230
+ providerName: s
231
+ }), x = new l(e), b = {
232
+ runtime: x,
233
+ lastActive: Date.now()
234
+ }, this.instances.set(y, b);
235
+ }
236
+ b.lastActive = Date.now(), x.addClient(t, p);
237
+ let S = x.component.getInitialState();
222
238
  t.send(JSON.stringify({
223
239
  type: "state-update",
224
- state: p
240
+ state: S
225
241
  }));
226
242
  });
227
243
  }
244
+ pruneInstances(e = !1) {
245
+ let t = Date.now();
246
+ for (let [e, n] of this.instances) n.runtime.clientCount === 0 && t - n.lastActive >= this.idleTimeoutMs && this.instances.delete(e);
247
+ let n = Math.max(0, this.maxInstances - +!!e);
248
+ if (this.instances.size <= n) return;
249
+ let r = [...this.instances.entries()].filter(([, e]) => e.runtime.clientCount === 0).sort((e, t) => e[1].lastActive - t[1].lastActive);
250
+ for (let [e] of r) {
251
+ if (this.instances.size <= n) break;
252
+ this.instances.delete(e);
253
+ }
254
+ }
228
255
  };
229
256
  //#endregion
230
- export { p as CossackNodeAdapter, c as NodeWebSocketRuntime, f as createNodeEmailSender, u as serveStatic };
257
+ export { g as CossackNodeAdapter, l as NodeWebSocketRuntime, p as createNodeEmailSender, m as nodeRuntimeAdapter, d as serveStatic };
package/dist/runtime.d.ts CHANGED
@@ -1,13 +1,6 @@
1
1
  import { WebSocket } from 'ws';
2
- import type { Cossack, CossackServerRuntime } from '@cossackframework/core';
3
- export declare class NodeWebSocketRuntime implements CossackServerRuntime {
4
- private component;
5
- private clients;
2
+ import { InMemoryWebSocketRuntime, type Cossack } from '@cossackframework/core';
3
+ export declare class NodeWebSocketRuntime extends InMemoryWebSocketRuntime<WebSocket> {
6
4
  constructor(component: Cossack);
7
- addClient(ws: WebSocket, user?: any): void;
8
- onClientMessage(client: unknown, message: string): Promise<void>;
9
- broadcastState(partialState: Record<string, any>): void;
10
- broadcastEvent(eventName: string, payload: any[]): void;
11
- sendClientAction(client: unknown, action: string, payload: any[]): void;
12
- persistState(): Promise<void>;
5
+ addClient(ws: WebSocket, user?: unknown): void;
13
6
  }
@@ -9,6 +9,8 @@ export interface StaticServeOptions {
9
9
  prefix?: string;
10
10
  /** Whether to try index.html for directory requests (default: true) */
11
11
  index?: boolean;
12
+ /** Cache-Control value, or a resolver based on the matched file and URL. */
13
+ cacheControl?: string | ((filePath: string, urlPath: string) => string | undefined);
12
14
  }
13
15
  /**
14
16
  * Create a middleware that serves static files from a directory.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cossackframework/node-adapter",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "type": "module",
5
5
  "description": "Node.js runtime adapter for the Cossack Framework",
6
6
  "license": "MIT",
@@ -25,20 +25,20 @@
25
25
  "access": "public"
26
26
  },
27
27
  "dependencies": {
28
- "nodemailer": "^9.0.3",
28
+ "nodemailer": "^10.0.6",
29
29
  "ws": ">=8.21.0",
30
- "@cossackframework/core": "0.8.1"
30
+ "@cossackframework/core": "0.8.3"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/nodemailer": "^8.0.1",
34
34
  "@types/ws": "^8.18.0",
35
- "hono": "^4.12.31",
35
+ "hono": "^4.13.7",
36
36
  "typescript": "^7.0.2",
37
37
  "vite": "^8.1.4",
38
- "vitest": "^4.1.10"
38
+ "vitest": "^4.1.11"
39
39
  },
40
40
  "peerDependencies": {
41
- "hono": "^4.12.0"
41
+ "hono": "^4.13.7"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "vite build && tsc -p tsconfig.declarations.json",