Files
scriptc/tests/fixtures/npm/node_modules/@hono/node-server/package.json
T
Malte UblandClaude Opus 5.5 9bf76af974 Build @hono/node-server 2.x into scriptc
@hono/node-server replaces the global Request and Response with
lightweight objects and reparents prototypes, tricks that only pay off
under V8 and that native compilation cannot follow. scriptc now compiles
the package from a built-in implementation (shims/hono-node-server/v2.ts)
over node:http and the native Request/Response/Headers: serve,
createAdaptorServer, getRequestListener and RequestError.

Responses are written the way the package writes them, byte for byte on
the wire: the general path (header record in Headers order, Set-Cookie
gathered, default content type, content length for bodies that finish
within the first reads, streamed bodies, error responses) and the
package's cached-response path for a Response that is still exactly its
constructor arguments. The runtime tracks that lightweight state on each
constructed Response (header form, raw plain-record headers, body length;
cleared by body and metadata reads, turned into Headers form by a headers
read) and exposes it to the shim through scriptcResponseLight.

The declaration entry of a shimmed package may now be a .d.mts/.d.cts
file. The npm case hono-node-server drives buffered, streamed, cookie,
header-form, HEAD, error-handler and URL cases against the real package
under Node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:32:49 -07:00

128 lines
3.1 KiB
JSON

{
"name": "@hono/node-server",
"version": "2.1.5",
"description": "Node.js Adapter for Hono",
"main": "dist/index.mjs",
"type": "module",
"types": "dist/index.d.mts",
"files": [
"dist"
],
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./serve-static": {
"import": {
"types": "./dist/serve-static.d.mts",
"default": "./dist/serve-static.mjs"
},
"require": {
"types": "./dist/serve-static.d.cts",
"default": "./dist/serve-static.cjs"
}
},
"./utils/*": {
"import": {
"types": "./dist/utils/*.d.mts",
"default": "./dist/utils/*.mjs"
},
"require": {
"types": "./dist/utils/*.d.cts",
"default": "./dist/utils/*.cjs"
}
},
"./conninfo": {
"import": {
"types": "./dist/conninfo.d.mts",
"default": "./dist/conninfo.mjs"
},
"require": {
"types": "./dist/conninfo.d.cts",
"default": "./dist/conninfo.cjs"
}
},
"./early-hints": {
"import": {
"types": "./dist/early-hints.d.mts",
"default": "./dist/early-hints.mjs"
},
"require": {
"types": "./dist/early-hints.d.cts",
"default": "./dist/early-hints.cjs"
}
}
},
"typesVersions": {
"*": {
".": [
"./dist/index.d.mts"
],
"serve-static": [
"./dist/serve-static.d.mts"
],
"utils/*": [
"./dist/utils/*.d.mts"
],
"conninfo": [
"./dist/conninfo.d.mts"
],
"early-hints": [
"./dist/early-hints.d.mts"
]
}
},
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/honojs/node-server.git"
},
"homepage": "https://github.com/honojs/node-server",
"author": "Yusuke Wada <yusuke@kamawada.com> (https://github.com/yusukebe)",
"publishConfig": {
"registry": "https://registry.npmjs.org",
"access": "public",
"provenance": true
},
"engines": {
"node": ">=20"
},
"devDependencies": {
"@hono/eslint-config": "^1.0.1",
"@types/node": "^20.10.0",
"@types/ws": "^8.18.1",
"@whatwg-node/fetch": "^0.9.14",
"eslint": "^9.10.0",
"hono": "^4.13.9",
"np": "^11.2.1",
"prettier": "^3.2.4",
"publint": "^0.3.18",
"tsdown": "^0.20.3",
"typescript": "^5.3.2",
"vitest": "^4.0.18",
"ws": "^8.19.0"
},
"peerDependencies": {
"hono": "^4 || ^5.0.0-0"
},
"scripts": {
"test": "vitest",
"build": "tsdown --external hono",
"watch": "tsdown --watch",
"postbuild": "publint",
"prerelease": "pnpm run build && pnpm run test --run",
"release": "np --no-publish",
"typecheck": "tsc --noEmit",
"lint": "eslint src test",
"lint:fix": "eslint src test --fix",
"format": "prettier --check \"src/**/*.{js,ts}\" \"test/**/*.{js,ts}\"",
"format:fix": "prettier --write \"src/**/*.{js,ts}\" \"test/**/*.{js,ts}\""
}
}