@tschk/moonshine-deploy-node 0.4.4 → 0.4.49

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
@@ -21,3 +21,10 @@ static rendering, and explicit SPA clients; hydration and streaming are unfinish
21
21
 
22
22
  See [docs/DEPLOYMENT.md](../../docs/DEPLOYMENT.md) and
23
23
  [docs/MANIFEST.md](../../docs/MANIFEST.md).
24
+
25
+ The Node adapter targets Node's HTTP server. Its regression suite also checks
26
+ normal body completion and partial-upload cancellation in Bun. Bun 1.3.10's
27
+ `node:http` emulation clears abort callbacks after body EOF, so disconnect cancellation
28
+ following a completed upload is unsupported in that combination. Use the native
29
+ Bun adapter for Bun deployments; completed-upload disconnects are checked in
30
+ actual Node. See the [pinned Bun implementation](https://github.com/oven-sh/bun/blob/bun-v1.3.10/src/js/node/_http_incoming.ts).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tschk/moonshine-deploy-node",
3
- "version": "0.4.4",
3
+ "version": "0.4.49",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -15,20 +15,20 @@
15
15
  "test": "bun test"
16
16
  },
17
17
  "dependencies": {
18
- "@tschk/moonshine-framework": "^0.4.4",
19
- "@tschk/moonshine-server": "^0.4.4"
18
+ "@tschk/moonshine-framework": "^0.4.48",
19
+ "@tschk/moonshine-server": "^0.4.48"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/bun": "1.3.14",
23
23
  "@types/node": "^22.0.0",
24
24
  "typescript": "7.0.2",
25
- "@tschk/moonshine-adapter-conformance": "^0.4.4"
25
+ "@tschk/moonshine-adapter-conformance": "^0.4.48"
26
26
  },
27
27
  "files": [
28
28
  "src"
29
29
  ],
30
30
  "peerDependencies": {
31
- "@tschk/moonshine-react": "^0.4.4"
31
+ "@tschk/moonshine-react": "^0.4.48"
32
32
  },
33
33
  "peerDependenciesMeta": {
34
34
  "@tschk/moonshine-react": {
package/src/index.ts CHANGED
@@ -108,7 +108,12 @@ export function createNodeHandler(
108
108
  closed = true;
109
109
  controller.abort();
110
110
  };
111
- req.once("close", onClose);
111
+ // IncomingMessage also closes after a normal body read; only an
112
+ // incomplete message means the request was interrupted.
113
+ const onRequestClose = () => {
114
+ if (!req.complete) onClose();
115
+ };
116
+ req.once("close", onRequestClose);
112
117
  res.once("close", onClose);
113
118
 
114
119
  const headers = new Headers();
@@ -146,7 +151,7 @@ export function createNodeHandler(
146
151
  res.end(String(error));
147
152
  return;
148
153
  } finally {
149
- req.off("close", onClose);
154
+ req.off("close", onRequestClose);
150
155
  res.off("close", onClose);
151
156
  }
152
157
 
@@ -199,7 +204,7 @@ export const nodeAdapter: DeploymentAdapter = {
199
204
  ? 'import { modules, renderer } from "./dist/server.js";'
200
205
  : 'import { modules } from "./dist/server.js";\nimport { reactRenderer as renderer } from "@tschk/moonshine-react";';
201
206
  const entry = `import { createServer } from "node:http";
202
- import { createRequestHandler } from "@tschk/moonshine-server";
207
+ import { createRequestHandler } from "@tschk/moonshine-server${manifest.dataRequests ? "/data-http" : ""}";
203
208
  import { createNodeHandler } from "@tschk/moonshine-deploy-node";
204
209
  import { dirname, resolve } from "node:path";
205
210
  import { fileURLToPath } from "node:url";