hono 4.8.9 → 4.8.11
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/dist/adapter/service-worker/handler.js +1 -1
- package/dist/cjs/adapter/service-worker/handler.js +1 -1
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/utils/cookie.js +1 -1
- package/dist/types/adapter/service-worker/types.d.ts +1 -1
- package/dist/types/context.d.ts +4 -4
- package/dist/types/helper/adapter/index.d.ts +1 -1
- package/dist/types/package.json +1 -1
- package/dist/types/request.d.ts +0 -5
- package/dist/types/utils/cookie.d.ts +1 -1
- package/dist/utils/cookie.js +1 -1
- package/package.json +8 -6
|
@@ -27,7 +27,7 @@ const handle = (app, opts = {
|
|
|
27
27
|
return (evt) => {
|
|
28
28
|
evt.respondWith(
|
|
29
29
|
(async () => {
|
|
30
|
-
const res = await app.fetch(evt.request);
|
|
30
|
+
const res = await app.fetch(evt.request, evt);
|
|
31
31
|
if (opts.fetch && res.status === 404) {
|
|
32
32
|
return await opts.fetch(evt.request);
|
|
33
33
|
}
|
package/dist/cjs/package.json
CHANGED
package/dist/cjs/utils/cookie.js
CHANGED
|
@@ -144,7 +144,7 @@ const _serialize = (name, value, opt = {}) => {
|
|
|
144
144
|
cookie += `; SameSite=${opt.sameSite.charAt(0).toUpperCase() + opt.sameSite.slice(1)}`;
|
|
145
145
|
}
|
|
146
146
|
if (opt.priority) {
|
|
147
|
-
cookie += `; Priority=${opt.priority}`;
|
|
147
|
+
cookie += `; Priority=${opt.priority.charAt(0).toUpperCase() + opt.priority.slice(1)}`;
|
|
148
148
|
}
|
|
149
149
|
if (opt.partitioned) {
|
|
150
150
|
if (!opt.secure) {
|
|
@@ -3,7 +3,7 @@ interface ExtendableEvent extends Event {
|
|
|
3
3
|
}
|
|
4
4
|
export interface FetchEvent extends ExtendableEvent {
|
|
5
5
|
readonly clientId: string;
|
|
6
|
-
readonly handled: Promise<
|
|
6
|
+
readonly handled: Promise<void>;
|
|
7
7
|
readonly preloadResponse: Promise<any>;
|
|
8
8
|
readonly request: Request;
|
|
9
9
|
readonly resultingClientId: string;
|
package/dist/types/context.d.ts
CHANGED
|
@@ -92,10 +92,10 @@ interface NewResponse {
|
|
|
92
92
|
* Interface for responding with a body.
|
|
93
93
|
*/
|
|
94
94
|
interface BodyRespond {
|
|
95
|
-
<U extends ContentfulStatusCode>(data:
|
|
96
|
-
<U extends
|
|
97
|
-
<U extends
|
|
98
|
-
<U extends StatusCode>(data:
|
|
95
|
+
<T extends Data, U extends ContentfulStatusCode>(data: T, status?: U, headers?: HeaderRecord): Response & TypedResponse<T, U, "body">;
|
|
96
|
+
<T extends Data, U extends ContentfulStatusCode>(data: T, init?: ResponseOrInit<U>): Response & TypedResponse<T, U, "body">;
|
|
97
|
+
<T extends null, U extends StatusCode>(data: T, status?: U, headers?: HeaderRecord): Response & TypedResponse<null, U, "body">;
|
|
98
|
+
<T extends null, U extends StatusCode>(data: T, init?: ResponseOrInit<U>): Response & TypedResponse<null, U, "body">;
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
101
|
* Interface for responding with text.
|
|
@@ -6,7 +6,7 @@ import type { Context } from '../../context';
|
|
|
6
6
|
export type Runtime = "node" | "deno" | "bun" | "workerd" | "fastly" | "edge-light" | "other";
|
|
7
7
|
export declare const env: <T extends Record<string, unknown>, C extends Context = Context<{
|
|
8
8
|
Bindings: T;
|
|
9
|
-
}>>(c: T extends Record<string, unknown> ? Context : C, runtime?: Runtime) => T & C["env"];
|
|
9
|
+
}, any, {}>>(c: T extends Record<string, unknown> ? Context : C, runtime?: Runtime) => T & C["env"];
|
|
10
10
|
export declare const knownUserAgents: Partial<Record<Runtime, string>>;
|
|
11
11
|
export declare const getRuntimeKey: () => Runtime;
|
|
12
12
|
export declare const checkUserAgentEquals: (platform: string) => boolean;
|
package/dist/types/package.json
CHANGED
package/dist/types/request.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { GET_MATCH_RESULT } from './request/constants';
|
|
2
1
|
import type { Result } from './router';
|
|
3
2
|
import type { Input, InputToDataByTarget, ParamKeyToRecord, ParamKeys, RemoveQuestion, RouterRoute, ValidationTargets } from './types';
|
|
4
3
|
import type { BodyData, ParseBodyOptions } from './utils/body';
|
|
@@ -15,10 +14,6 @@ type BodyCache = Partial<Body & {
|
|
|
15
14
|
parsedBody: BodyData;
|
|
16
15
|
}>;
|
|
17
16
|
export declare class HonoRequest<P extends string = "/", I extends Input["out"] = {}> {
|
|
18
|
-
[GET_MATCH_RESULT]: Result<[
|
|
19
|
-
unknown,
|
|
20
|
-
RouterRoute
|
|
21
|
-
]>;
|
|
22
17
|
/**
|
|
23
18
|
* `.raw` can get the raw Request object.
|
|
24
19
|
*
|
|
@@ -28,7 +28,7 @@ export type CookieOptions = {
|
|
|
28
28
|
secure?: boolean;
|
|
29
29
|
sameSite?: "Strict" | "Lax" | "None" | "strict" | "lax" | "none";
|
|
30
30
|
partitioned?: boolean;
|
|
31
|
-
priority?: "Low" | "Medium" | "High";
|
|
31
|
+
priority?: "Low" | "Medium" | "High" | "low" | "medium" | "high";
|
|
32
32
|
prefix?: CookiePrefixOptions;
|
|
33
33
|
} & PartitionedCookieConstraint;
|
|
34
34
|
export type CookiePrefixOptions = "host" | "secure";
|
package/dist/utils/cookie.js
CHANGED
|
@@ -119,7 +119,7 @@ var _serialize = (name, value, opt = {}) => {
|
|
|
119
119
|
cookie += `; SameSite=${opt.sameSite.charAt(0).toUpperCase() + opt.sameSite.slice(1)}`;
|
|
120
120
|
}
|
|
121
121
|
if (opt.priority) {
|
|
122
|
-
cookie += `; Priority=${opt.priority}`;
|
|
122
|
+
cookie += `; Priority=${opt.priority.charAt(0).toUpperCase() + opt.priority.slice(1)}`;
|
|
123
123
|
}
|
|
124
124
|
if (opt.partitioned) {
|
|
125
125
|
if (!opt.secure) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hono",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.11",
|
|
4
4
|
"description": "Web framework built on Web Standards",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -20,10 +20,11 @@
|
|
|
20
20
|
"test:lambda": "vitest --run --config ./runtime-tests/lambda/vitest.config.ts",
|
|
21
21
|
"test:lambda-edge": "vitest --run --config ./runtime-tests/lambda-edge/vitest.config.ts",
|
|
22
22
|
"test:all": "bun run test && bun test:deno && bun test:bun && bun test:fastly && bun test:node && bun test:workerd && bun test:lambda && bun test:lambda-edge",
|
|
23
|
-
"lint": "eslint src runtime-tests build perf-measures",
|
|
24
|
-
"lint:fix": "eslint src runtime-tests build perf-measures --fix",
|
|
25
|
-
"format": "prettier --check --cache \"src/**/*.{js,ts,tsx}\" \"runtime-tests/**/*.{js,ts,tsx}\" \"build/**/*.{js,ts,tsx}\" \"perf-measures/**/*.{js,ts,tsx}\"",
|
|
26
|
-
"format:fix": "prettier --write --cache --cache-strategy metadata \"src/**/*.{js,ts,tsx}\" \"runtime-tests/**/*.{js,ts,tsx}\" \"build/**/*.{js,ts,tsx}\" \"perf-measures/**/*.{js,ts,tsx}\"",
|
|
23
|
+
"lint": "eslint src runtime-tests build perf-measures benchmarks",
|
|
24
|
+
"lint:fix": "eslint src runtime-tests build perf-measures benchmarks --fix",
|
|
25
|
+
"format": "prettier --check --cache \"src/**/*.{js,ts,tsx}\" \"runtime-tests/**/*.{js,ts,tsx}\" \"build/**/*.{js,ts,tsx}\" \"perf-measures/**/*.{js,ts,tsx}\" \"benchmarks/**/*.{js,ts,tsx}\"",
|
|
26
|
+
"format:fix": "prettier --write --cache --cache-strategy metadata \"src/**/*.{js,ts,tsx}\" \"runtime-tests/**/*.{js,ts,tsx}\" \"build/**/*.{js,ts,tsx}\" \"perf-measures/**/*.{js,ts,tsx}\" \"benchmarks/**/*.{js,ts,tsx}\"",
|
|
27
|
+
"editorconfig-checker": "editorconfig-checker",
|
|
27
28
|
"copy:package.cjs.json": "cp ./package.cjs.json ./dist/cjs/package.json && cp ./package.cjs.json ./dist/types/package.json",
|
|
28
29
|
"build": "bun run --shell bun remove-dist && bun ./build/build.ts && bun run copy:package.cjs.json",
|
|
29
30
|
"postbuild": "publint",
|
|
@@ -655,7 +656,7 @@
|
|
|
655
656
|
"nodejs"
|
|
656
657
|
],
|
|
657
658
|
"devDependencies": {
|
|
658
|
-
"@hono/eslint-config": "^
|
|
659
|
+
"@hono/eslint-config": "^2.0.3",
|
|
659
660
|
"@hono/node-server": "^1.13.5",
|
|
660
661
|
"@types/glob": "^8.1.0",
|
|
661
662
|
"@types/jsdom": "^21.1.7",
|
|
@@ -665,6 +666,7 @@
|
|
|
665
666
|
"@vitest/coverage-v8": "^3.0.5",
|
|
666
667
|
"arg": "^5.0.2",
|
|
667
668
|
"bun-types": "^1.1.39",
|
|
669
|
+
"editorconfig-checker": "^6.1.0",
|
|
668
670
|
"esbuild": "^0.15.18",
|
|
669
671
|
"eslint": "^9.10.0",
|
|
670
672
|
"glob": "^11.0.0",
|