what-server 0.12.1 → 0.12.2

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.
Files changed (2) hide show
  1. package/node.d.ts +12 -1
  2. package/package.json +4 -4
package/node.d.ts CHANGED
@@ -16,7 +16,18 @@ export function toNodeListener(
16
16
  export function whatMiddleware(options?: RequestHandlerOptions): (req: any, res: any, next?: () => void) => Promise<void>;
17
17
 
18
18
  /** A ready-to-listen node:http server. Starts `scheduler` and stops it on SIGTERM/SIGINT. */
19
- export function createServer(options?: RequestHandlerOptions & { scheduler?: { start(): void; stop(): void } }): import('node:http').Server;
19
+ // Structural, not `import('node:http').Server`. Referencing a Node builtin here
20
+ // would make @types/node a hard requirement for every consumer of what-server,
21
+ // including the browser and edge ones that never touch this entry point. The
22
+ // runtime value IS an http.Server; this types what callers actually do with it.
23
+ export interface NodeHttpServer {
24
+ listen(...args: any[]): NodeHttpServer;
25
+ close(callback?: (err?: Error) => void): NodeHttpServer;
26
+ address(): string | { address: string; family: string; port: number } | null;
27
+ on(event: string, listener: (...args: any[]) => void): NodeHttpServer;
28
+ }
29
+
30
+ export function createServer(options?: RequestHandlerOptions & { scheduler?: { start(): void; stop(): void } }): NodeHttpServer;
20
31
 
21
32
  /** Vercel Functions entry: a Web-Fetch handler. */
22
33
  export function createVercelHandler(options?: RequestHandlerOptions): (request: Request) => Promise<Response>;
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "what-server",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
4
4
  "description": "What Framework - SSR, islands architecture, static generation",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "types": "index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
- "types": "./index.d.ts",
11
10
  "node": {
12
11
  "types": "./node.d.ts",
13
12
  "production": "./dist/node.min.js",
14
13
  "import": "./src/node.js",
15
14
  "default": "./src/node.js"
16
15
  },
16
+ "types": "./index.d.ts",
17
17
  "production": "./dist/index.min.js",
18
18
  "import": "./src/index.js",
19
19
  "default": "./src/index.js"
@@ -51,8 +51,8 @@
51
51
  "author": "ZVN DEV (https://zvndev.com)",
52
52
  "license": "MIT",
53
53
  "peerDependencies": {
54
- "what-core": "^0.12.1",
55
- "what-router": "^0.12.1"
54
+ "what-core": "^0.12.2",
55
+ "what-router": "^0.12.2"
56
56
  },
57
57
  "peerDependenciesMeta": {
58
58
  "what-router": {