hono 4.0.6 → 4.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/dist/cjs/helper/ssg/index.js +1 -2
- package/dist/cjs/jsx/dom/render.js +3 -3
- package/dist/cjs/jsx/jsx-runtime.js +1 -1
- package/dist/cjs/utils/stream.js +3 -0
- package/dist/helper/ssg/index.js +1 -2
- package/dist/jsx/dom/render.js +2 -2
- package/dist/jsx/jsx-runtime.js +1 -1
- package/dist/types/helper/ssg/index.d.ts +2 -2
- package/dist/types/jsx/jsx-runtime.d.ts +1 -1
- package/dist/types/types.d.ts +6 -2
- package/dist/utils/stream.js +3 -0
- package/package.json +2 -1
|
@@ -29,7 +29,6 @@ __export(ssg_exports, {
|
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(ssg_exports);
|
|
31
31
|
var import_utils = require("../../client/utils");
|
|
32
|
-
var import_buffer = require("../../utils/buffer");
|
|
33
32
|
var import_mime = require("../../utils/mime");
|
|
34
33
|
var import_utils2 = require("./utils");
|
|
35
34
|
const SSG_CONTEXT = "HONO_SSG_CONTEXT";
|
|
@@ -139,7 +138,7 @@ const saveContentToFiles = async (htmlMap, fsModule, outDir) => {
|
|
|
139
138
|
if (typeof content === "string") {
|
|
140
139
|
await fsModule.writeFile(filePath, content);
|
|
141
140
|
} else if (content instanceof ArrayBuffer) {
|
|
142
|
-
await fsModule.writeFile(filePath,
|
|
141
|
+
await fsModule.writeFile(filePath, new Uint8Array(content));
|
|
143
142
|
}
|
|
144
143
|
files.push(filePath);
|
|
145
144
|
}
|
|
@@ -27,7 +27,7 @@ module.exports = __toCommonJS(render_exports);
|
|
|
27
27
|
var import_constants = require("../constants");
|
|
28
28
|
var import_context = require("../context");
|
|
29
29
|
var import_hooks = require("../hooks");
|
|
30
|
-
var
|
|
30
|
+
var import_context2 = require("./context");
|
|
31
31
|
const eventAliasMap = {
|
|
32
32
|
Change: "Input",
|
|
33
33
|
DoubleClick: "DblClick"
|
|
@@ -297,7 +297,7 @@ const build = (context, node, topLevelErrorHandlerNode, children) => {
|
|
|
297
297
|
child = oldChild;
|
|
298
298
|
}
|
|
299
299
|
} else if (!isNodeString(child) && nameSpaceContext) {
|
|
300
|
-
const ns = (0,
|
|
300
|
+
const ns = (0, import_context.useContext)(nameSpaceContext);
|
|
301
301
|
if (ns) {
|
|
302
302
|
child.n = ns;
|
|
303
303
|
}
|
|
@@ -343,7 +343,7 @@ const buildNode = (node) => {
|
|
|
343
343
|
if (ns) {
|
|
344
344
|
;
|
|
345
345
|
node.n = ns;
|
|
346
|
-
nameSpaceContext || (nameSpaceContext = (0,
|
|
346
|
+
nameSpaceContext || (nameSpaceContext = (0, import_context2.createContext)(""));
|
|
347
347
|
node.children = [
|
|
348
348
|
{
|
|
349
349
|
tag: nameSpaceContext.Provider,
|
|
@@ -29,7 +29,7 @@ module.exports = __toCommonJS(jsx_runtime_exports);
|
|
|
29
29
|
var import_jsx_dev_runtime = require("./jsx-dev-runtime");
|
|
30
30
|
var import_jsx_dev_runtime2 = require("./jsx-dev-runtime");
|
|
31
31
|
var import_html = require("../helper/html");
|
|
32
|
-
const jsxAttr = (name, value) => (0, import_html.raw)(name + '="' + import_html.html`${value}` + '"')
|
|
32
|
+
const jsxAttr = (name, value) => typeof value === "string" ? (0, import_html.raw)(name + '="' + import_html.html`${value}` + '"') : import_html.html`${name}="${value}"`;
|
|
33
33
|
const jsxEscape = (value) => value;
|
|
34
34
|
// Annotate the CommonJS export names for ESM import in node:
|
|
35
35
|
0 && (module.exports = {
|
package/dist/cjs/utils/stream.js
CHANGED
|
@@ -28,6 +28,9 @@ class StreamingApi {
|
|
|
28
28
|
this.writer = writable.getWriter();
|
|
29
29
|
this.encoder = new TextEncoder();
|
|
30
30
|
const reader = _readable.getReader();
|
|
31
|
+
this.abortSubscribers.push(async () => {
|
|
32
|
+
await reader.cancel();
|
|
33
|
+
});
|
|
31
34
|
this.responseReadable = new ReadableStream({
|
|
32
35
|
async pull(controller) {
|
|
33
36
|
const { done, value } = await reader.read();
|
package/dist/helper/ssg/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// src/helper/ssg/index.ts
|
|
2
2
|
import { replaceUrlParam } from "../../client/utils.js";
|
|
3
|
-
import { bufferToString } from "../../utils/buffer.js";
|
|
4
3
|
import { getExtension } from "../../utils/mime.js";
|
|
5
4
|
import { joinPaths, dirname, filterStaticGenerateRoutes } from "./utils.js";
|
|
6
5
|
var SSG_CONTEXT = "HONO_SSG_CONTEXT";
|
|
@@ -110,7 +109,7 @@ var saveContentToFiles = async (htmlMap, fsModule, outDir) => {
|
|
|
110
109
|
if (typeof content === "string") {
|
|
111
110
|
await fsModule.writeFile(filePath, content);
|
|
112
111
|
} else if (content instanceof ArrayBuffer) {
|
|
113
|
-
await fsModule.writeFile(filePath,
|
|
112
|
+
await fsModule.writeFile(filePath, new Uint8Array(content));
|
|
114
113
|
}
|
|
115
114
|
files.push(filePath);
|
|
116
115
|
}
|
package/dist/jsx/dom/render.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/jsx/dom/render.ts
|
|
2
2
|
import { DOM_RENDERER, DOM_ERROR_HANDLER, DOM_STASH } from "../constants.js";
|
|
3
|
-
import { globalContexts as globalJSXContexts } from "../context.js";
|
|
3
|
+
import { globalContexts as globalJSXContexts, useContext } from "../context.js";
|
|
4
4
|
import { STASH_EFFECT } from "../hooks/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createContext } from "./context.js";
|
|
6
6
|
var eventAliasMap = {
|
|
7
7
|
Change: "Input",
|
|
8
8
|
DoubleClick: "DblClick"
|
package/dist/jsx/jsx-runtime.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsxDEV, Fragment } from "./jsx-dev-runtime.js";
|
|
3
3
|
import { jsxDEV as jsxDEV2 } from "./jsx-dev-runtime.js";
|
|
4
4
|
import { raw, html } from "../helper/html/index.js";
|
|
5
|
-
var jsxAttr = (name, value) => raw(name + '="' + html`${value}` + '"')
|
|
5
|
+
var jsxAttr = (name, value) => typeof value === "string" ? raw(name + '="' + html`${value}` + '"') : html`${name}="${value}"`;
|
|
6
6
|
var jsxEscape = (value) => value;
|
|
7
7
|
export {
|
|
8
8
|
Fragment,
|
|
@@ -67,8 +67,8 @@ export declare const saveContentToFiles: (htmlMap: Map<string, {
|
|
|
67
67
|
* `ToSSGInterface` is an experimental feature.
|
|
68
68
|
* The API might be changed.
|
|
69
69
|
*/
|
|
70
|
-
export interface ToSSGInterface
|
|
71
|
-
(app: Hono<
|
|
70
|
+
export interface ToSSGInterface {
|
|
71
|
+
(app: Hono<any, any, any>, fsModule: FileSystemModule, options?: ToSSGOptions): Promise<ToSSGResult>;
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* @experimental
|
|
@@ -2,5 +2,5 @@ export { jsxDEV as jsx, Fragment } from './jsx-dev-runtime';
|
|
|
2
2
|
export { jsxDEV as jsxs } from './jsx-dev-runtime';
|
|
3
3
|
import { html } from '../helper/html';
|
|
4
4
|
export { html as jsxTemplate };
|
|
5
|
-
export declare const jsxAttr: (name: string, value: string) => import("../utils/html").HtmlEscapedString
|
|
5
|
+
export declare const jsxAttr: (name: string, value: string | Promise<string>) => import("../utils/html").HtmlEscapedString | Promise<import("../utils/html").HtmlEscapedString>;
|
|
6
6
|
export declare const jsxEscape: (value: string) => string;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -396,9 +396,13 @@ export type MergeSchemaPath<OrigSchema extends Schema, SubPath extends string> =
|
|
|
396
396
|
input: Input extends {
|
|
397
397
|
param: infer _;
|
|
398
398
|
} ? ExtractParams<SubPath> extends never ? Input : FlattenIfIntersect<Input & {
|
|
399
|
-
param:
|
|
399
|
+
param: {
|
|
400
|
+
[K in keyof ExtractParams<SubPath> as K extends `${infer Prefix}{${infer _}}` ? Prefix : K]: string;
|
|
401
|
+
};
|
|
400
402
|
}> : RemoveBlankRecord<ExtractParams<SubPath>> extends never ? Input : Input & {
|
|
401
|
-
param:
|
|
403
|
+
param: {
|
|
404
|
+
[K in keyof ExtractParams<SubPath> as K extends `${infer Prefix}{${infer _}}` ? Prefix : K]: string;
|
|
405
|
+
};
|
|
402
406
|
};
|
|
403
407
|
output: Output;
|
|
404
408
|
} : never;
|
package/dist/utils/stream.js
CHANGED
|
@@ -6,6 +6,9 @@ var StreamingApi = class {
|
|
|
6
6
|
this.writer = writable.getWriter();
|
|
7
7
|
this.encoder = new TextEncoder();
|
|
8
8
|
const reader = _readable.getReader();
|
|
9
|
+
this.abortSubscribers.push(async () => {
|
|
10
|
+
await reader.cancel();
|
|
11
|
+
});
|
|
9
12
|
this.responseReadable = new ReadableStream({
|
|
10
13
|
async pull(controller) {
|
|
11
14
|
const { done, value } = await reader.read();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hono",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.8",
|
|
4
4
|
"description": "Ultrafast web framework for the Edges",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -520,6 +520,7 @@
|
|
|
520
520
|
"denoify": "^1.6.6",
|
|
521
521
|
"esbuild": "^0.15.12",
|
|
522
522
|
"eslint": "^8.55.0",
|
|
523
|
+
"glob": "7.2.3",
|
|
523
524
|
"jsdom": "^22.1.0",
|
|
524
525
|
"msw": "1.3.2",
|
|
525
526
|
"np": "7.7.0",
|