@kiyasov/platform-hono 1.4.7 → 1.5.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiyasov/platform-hono",
3
- "version": "1.4.7",
3
+ "version": "1.5.1",
4
4
  "description": "Nest adapter for Hono",
5
5
  "author": "Islam Kiiasov",
6
6
  "repository": {
@@ -28,38 +28,38 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
- "@apollo/server": "^4.11.3",
32
- "@hono/node-server": "^1.13.8",
33
- "@nestjs/apollo": "^13.0.2",
34
- "@nestjs/graphql": "^13.0.2",
35
- "hono": "^4.7.1"
31
+ "@apollo/server": "^4.12.0",
32
+ "@hono/node-server": "^1.14.1",
33
+ "@nestjs/apollo": "^13.1.0",
34
+ "@nestjs/graphql": "^13.1.0",
35
+ "hono": "^4.7.9"
36
36
  },
37
37
  "devDependencies": {
38
- "@eslint/js": "^9.20.0",
39
- "@nestjs/cli": "^11.0.2",
40
- "@nestjs/common": "^11.0.9",
41
- "@nestjs/core": "^11.0.9",
42
- "@swc/cli": "^0.6.0",
43
- "@swc/core": "^1.10.16",
44
- "@types/autocannon": "^7.12.6",
45
- "@types/bun": "^1.2.2",
38
+ "@eslint/js": "^9.26.0",
39
+ "@nestjs/cli": "^11.0.7",
40
+ "@nestjs/common": "^11.1.1",
41
+ "@nestjs/core": "^11.1.1",
42
+ "@swc/cli": "^0.7.7",
43
+ "@swc/core": "^1.11.24",
44
+ "@types/autocannon": "^7.12.7",
45
+ "@types/bun": "^1.2.13",
46
46
  "@types/busboy": "^1.5.4",
47
47
  "autocannon": "^8.0.0",
48
- "bun": "^1.2.2",
49
- "eslint": "^9.20.1",
50
- "eslint-config-prettier": "^10.0.1",
51
- "eslint-plugin-perfectionist": "^4.9.0",
52
- "eslint-plugin-prettier": "^5.2.3",
53
- "globals": "^15.15.0",
54
- "graphql": "^16.10.0",
48
+ "bun": "^1.2.13",
49
+ "eslint": "^9.26.0",
50
+ "eslint-config-prettier": "^10.1.5",
51
+ "eslint-plugin-perfectionist": "^4.13.0",
52
+ "eslint-plugin-prettier": "^5.4.0",
53
+ "globals": "^16.1.0",
54
+ "graphql": "^16.11.0",
55
55
  "graphql-subscriptions": "^3.0.0",
56
- "prettier": "^3.5.1",
56
+ "prettier": "^3.5.3",
57
57
  "reflect-metadata": "^0.2.2",
58
58
  "rimraf": "^6.0.1",
59
- "rxjs": "^7.8.1",
59
+ "rxjs": "^7.8.2",
60
60
  "tsc": "^2.0.4",
61
- "typescript": "^5.7.3",
62
- "typescript-eslint": "^8.24.0"
61
+ "typescript": "^5.8.3",
62
+ "typescript-eslint": "^8.32.1"
63
63
  },
64
64
  "scripts": {
65
65
  "build:esm": "bun ./node_modules/typescript/bin/tsc --p tsconfig.esm.json",
@@ -71,5 +71,9 @@
71
71
  "benchmark:bun": "bun dev:bun & ( sleep 5 && autocannon -c 200 -d 5 -p 10 http://localhost:3000 )",
72
72
  "benchmark:bun:file": "bun run dev:bun & ( sleep 5 && bun run ./benchmarks/benchmark.mjs)",
73
73
  "benchmark:node:file": "bun run dev & ( sleep 5 && node ./benchmarks/benchmark.mjs)"
74
- }
74
+ },
75
+ "trustedDependencies": [
76
+ "@nestjs/core",
77
+ "@swc/core"
78
+ ]
75
79
  }
@@ -246,7 +246,7 @@ export class HonoAdapter extends AbstractHttpAdapter<
246
246
  return ctx.finalized;
247
247
  }
248
248
 
249
- public async getHeader?(ctx: Ctx, name: string) {
249
+ public async getHeader(ctx: Ctx, name: string) {
250
250
  if (typeof ctx === 'function') {
251
251
  ctx = await ctx();
252
252
  }
@@ -262,7 +262,7 @@ export class HonoAdapter extends AbstractHttpAdapter<
262
262
  ctx.res.headers.set(name, value);
263
263
  }
264
264
 
265
- public async appendHeader?(ctx: Ctx, name: string, value: string) {
265
+ public async appendHeader(ctx: Ctx, name: string, value: string) {
266
266
  if (typeof ctx === 'function') {
267
267
  ctx = await ctx();
268
268
  }
@@ -343,9 +343,11 @@ export class HonoAdapter extends AbstractHttpAdapter<
343
343
  contentType?.startsWith('application/x-www-form-urlencoded')
344
344
  ) {
345
345
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
346
- (ctx.req as any).body = await ctx.req.parseBody({
347
- all: true,
348
- });
346
+ (ctx.req as any).body = await ctx.req
347
+ .parseBody({
348
+ all: true,
349
+ })
350
+ .catch(() => {});
349
351
  } else if (
350
352
  contentType?.startsWith('application/json') ||
351
353
  contentType?.startsWith('text/plain')
@@ -355,7 +357,7 @@ export class HonoAdapter extends AbstractHttpAdapter<
355
357
  (ctx.req as any).rawBody = Buffer.from(await ctx.req.text());
356
358
  }
357
359
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
358
- (ctx.req as any).body = await ctx.req.json();
360
+ (ctx.req as any).body = await ctx.req.json().catch(() => {});
359
361
  }
360
362
 
361
363
  await next();