@hono/node-server 2.0.5 → 2.0.8

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
@@ -41,16 +41,11 @@ It works on Node.js versions greater than 20.x.
41
41
 
42
42
  ## Installation
43
43
 
44
- You can install it from the npm registry with `npm` command:
44
+ You can install it from the npm registry:
45
45
 
46
46
  ```sh
47
47
  npm install @hono/node-server
48
- ```
49
-
50
- Or use `yarn`:
51
-
52
- ```sh
53
- yarn add @hono/node-server
48
+ pnpm add @hono/node-server
54
49
  ```
55
50
 
56
51
  ## Usage
package/dist/index.cjs CHANGED
@@ -404,7 +404,8 @@ var Response$1 = class Response$1 {
404
404
  const liveHeaders = cache && cache[2] instanceof Headers ? cache[2] : void 0;
405
405
  delete this[cacheKey];
406
406
  return this[responseCache] ||= new GlobalResponse(this.#body, liveHeaders ? {
407
- ...this.#init,
407
+ status: this.#init?.status,
408
+ statusText: this.#init?.statusText,
408
409
  headers: liveHeaders
409
410
  } : this.#init);
410
411
  }
package/dist/index.mjs CHANGED
@@ -403,7 +403,8 @@ var Response$1 = class Response$1 {
403
403
  const liveHeaders = cache && cache[2] instanceof Headers ? cache[2] : void 0;
404
404
  delete this[cacheKey];
405
405
  return this[responseCache] ||= new GlobalResponse(this.#body, liveHeaders ? {
406
- ...this.#init,
406
+ status: this.#init?.status,
407
+ statusText: this.#init?.statusText,
407
408
  headers: liveHeaders
408
409
  } : this.#init);
409
410
  }
@@ -61,7 +61,7 @@ const serveStatic = (options = { root: "" }) => {
61
61
  }
62
62
  const mimeType = (0, hono_utils_mime.getMimeType)(path);
63
63
  c.header("Content-Type", mimeType || "application/octet-stream");
64
- if (options.precompressed && (!mimeType || COMPRESSIBLE_CONTENT_TYPE_REGEX.test(mimeType))) {
64
+ if (options.precompressed && (!mimeType || mimeType === "application/octet-stream" || COMPRESSIBLE_CONTENT_TYPE_REGEX.test(mimeType))) {
65
65
  const acceptEncodingSet = new Set(c.req.header("Accept-Encoding")?.split(",").map((encoding) => encoding.trim()));
66
66
  for (const encoding of ENCODINGS_ORDERED_KEYS) {
67
67
  if (!acceptEncodingSet.has(encoding)) continue;
@@ -60,7 +60,7 @@ const serveStatic = (options = { root: "" }) => {
60
60
  }
61
61
  const mimeType = getMimeType(path);
62
62
  c.header("Content-Type", mimeType || "application/octet-stream");
63
- if (options.precompressed && (!mimeType || COMPRESSIBLE_CONTENT_TYPE_REGEX.test(mimeType))) {
63
+ if (options.precompressed && (!mimeType || mimeType === "application/octet-stream" || COMPRESSIBLE_CONTENT_TYPE_REGEX.test(mimeType))) {
64
64
  const acceptEncodingSet = new Set(c.req.header("Accept-Encoding")?.split(",").map((encoding) => encoding.trim()));
65
65
  for (const encoding of ENCODINGS_ORDERED_KEYS) {
66
66
  if (!acceptEncodingSet.has(encoding)) continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hono/node-server",
3
- "version": "2.0.5",
3
+ "version": "2.0.8",
4
4
  "description": "Node.js Adapter for Hono",
5
5
  "main": "dist/index.mjs",
6
6
  "type": "module",
@@ -66,18 +66,6 @@
66
66
  ]
67
67
  }
68
68
  },
69
- "scripts": {
70
- "test": "vitest",
71
- "build": "tsdown --external hono",
72
- "watch": "tsdown --watch",
73
- "postbuild": "publint",
74
- "prerelease": "bun run build && bun run test --run",
75
- "release": "np",
76
- "lint": "eslint src test",
77
- "lint:fix": "eslint src test --fix",
78
- "format": "prettier --check \"src/**/*.{js,ts}\" \"test/**/*.{js,ts}\"",
79
- "format:fix": "prettier --write \"src/**/*.{js,ts}\" \"test/**/*.{js,ts}\""
80
- },
81
69
  "license": "MIT",
82
70
  "repository": {
83
71
  "type": "git",
@@ -87,7 +75,8 @@
87
75
  "author": "Yusuke Wada <yusuke@kamawada.com> (https://github.com/yusukebe)",
88
76
  "publishConfig": {
89
77
  "registry": "https://registry.npmjs.org",
90
- "access": "public"
78
+ "access": "public",
79
+ "provenance": true
91
80
  },
92
81
  "engines": {
93
82
  "node": ">=20"
@@ -100,10 +89,10 @@
100
89
  "@whatwg-node/fetch": "^0.9.14",
101
90
  "eslint": "^9.10.0",
102
91
  "hono": "^4.12.8",
103
- "np": "^7.7.0",
92
+ "np": "^11.2.1",
104
93
  "prettier": "^3.2.4",
105
94
  "publint": "^0.3.18",
106
- "supertest": "^6.3.3",
95
+ "supertest": "^7.2.2",
107
96
  "tsdown": "^0.20.3",
108
97
  "typescript": "^5.3.2",
109
98
  "vitest": "^4.0.18",
@@ -112,5 +101,16 @@
112
101
  "peerDependencies": {
113
102
  "hono": "^4"
114
103
  },
115
- "packageManager": "bun@1.2.20"
116
- }
104
+ "scripts": {
105
+ "test": "vitest",
106
+ "build": "tsdown --external hono",
107
+ "watch": "tsdown --watch",
108
+ "postbuild": "publint",
109
+ "prerelease": "pnpm run build && pnpm run test --run",
110
+ "release": "np --no-publish",
111
+ "lint": "eslint src test",
112
+ "lint:fix": "eslint src test --fix",
113
+ "format": "prettier --check \"src/**/*.{js,ts}\" \"test/**/*.{js,ts}\"",
114
+ "format:fix": "prettier --write \"src/**/*.{js,ts}\" \"test/**/*.{js,ts}\""
115
+ }
116
+ }