@hono/node-server 2.0.6 → 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
@@ -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.6",
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 --no-publish",
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"
@@ -103,7 +92,7 @@
103
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
+ }