@mauroandre/velojs 0.0.52 → 0.0.54

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.
@@ -28,6 +28,25 @@ export interface CreateTestAppOptions {
28
28
  getSessionCookie?: (input: {
29
29
  user: any;
30
30
  }) => Promise<Cookies> | Cookies;
31
+ /**
32
+ * Serve the app over real TCP on this port, in addition to the in-memory
33
+ * API. Needed when an actor outside this process must reach the app over
34
+ * HTTP (a callback from a worker, a remote webhook sender) — the in-memory
35
+ * methods (`app.get`, `app.action`, …) never leave the process.
36
+ *
37
+ * `0` picks a free port; the real one is on `app.port`/`app.url`. The
38
+ * listener serves the same app instance as the in-memory API, so a request
39
+ * over TCP and a `app.subscribe()` on the same stream see the same registry.
40
+ *
41
+ * Ports always come from this option — never from `process.env.PORT`/`HOST`.
42
+ */
43
+ port?: number;
44
+ /**
45
+ * Interface to bind when `port` is set, mirroring `StartServerOptions`
46
+ * (e.g. `"127.0.0.1"`). Omitted, Node's default applies — all interfaces,
47
+ * which makes the test listener reachable from the local network.
48
+ */
49
+ hostname?: string;
31
50
  }
32
51
  export interface RequestOptions {
33
52
  /** Cookies serialized into the `Cookie` header. */
@@ -116,6 +135,17 @@ export interface MockContextOptions {
116
135
  export interface TestApp {
117
136
  /** Underlying Hono app. */
118
137
  readonly hono: Hono;
138
+ /**
139
+ * Real port this app listens on when `port` was passed to `createTestApp`
140
+ * (the OS-assigned port when it was `0`). `undefined` in the default
141
+ * in-memory-only mode.
142
+ */
143
+ readonly port: number | undefined;
144
+ /**
145
+ * Base URL of the TCP listener (`http://localhost:<port>` for wildcard or
146
+ * omitted hostnames). `undefined` in the default in-memory-only mode.
147
+ */
148
+ readonly url: string | undefined;
119
149
  get(path: string, opts?: RequestOptions): Promise<TestResponse>;
120
150
  post(path: string, opts?: BodyRequestOptions): Promise<TestResponse>;
121
151
  put(path: string, opts?: BodyRequestOptions): Promise<TestResponse>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mauroandre/velojs",
3
- "version": "0.0.52",
3
+ "version": "0.0.54",
4
4
  "type": "module",
5
5
  "description": "Fullstack web framework built on Hono + Preact with Vite-powered AST transforms",
6
6
  "keywords": [
@@ -106,9 +106,11 @@
106
106
  "@types/babel__generator": "^7.27.0",
107
107
  "@types/babel__traverse": "^7.28.0",
108
108
  "@types/node": "^25.5.2",
109
+ "@types/ws": "^8.18.1",
109
110
  "jsdom": "^29.0.2",
110
111
  "typescript": "^6.0.2",
111
112
  "vitest": "^3.2.1",
113
+ "ws": "^8.21.3",
112
114
  "yaml": "^2.9.0"
113
115
  }
114
116
  }