honox 0.1.53 → 0.1.55
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 +1 -1
- package/dist/client/client.d.ts +19 -18
- package/dist/client/client.js +56 -77
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +2 -3
- package/dist/client/runtime.d.ts +4 -3
- package/dist/client/runtime.js +110 -141
- package/dist/client/utils/filter.d.ts +3 -2
- package/dist/client/utils/filter.js +5 -6
- package/dist/constants.d.ts +3 -2
- package/dist/constants.js +4 -7
- package/dist/factory/factory.d.ts +8 -7
- package/dist/factory/factory.js +6 -5
- package/dist/factory/index.d.ts +2 -4
- package/dist/factory/index.js +3 -5
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -0
- package/dist/server/base.d.ts +2 -4
- package/dist/server/base.js +2 -3
- package/dist/server/components/has-islands.d.ts +7 -4
- package/dist/server/components/has-islands.js +9 -9
- package/dist/server/components/index.d.ts +4 -6
- package/dist/server/components/index.js +2 -5
- package/dist/server/components/link.d.ts +8 -7
- package/dist/server/components/link.js +34 -39
- package/dist/server/components/script.d.ts +9 -8
- package/dist/server/components/script.js +33 -37
- package/dist/server/context-storage.d.ts +5 -4
- package/dist/server/context-storage.js +5 -3
- package/dist/server/index.d.ts +7 -11
- package/dist/server/index.js +6 -4
- package/dist/server/server.d.ts +27 -30
- package/dist/server/server.js +227 -275
- package/dist/server/utils/file.d.ts +3 -2
- package/dist/server/utils/file.js +38 -66
- package/dist/server/utils/path.d.ts +3 -2
- package/dist/server/utils/path.js +5 -4
- package/dist/server/with-defaults.d.ts +8 -8
- package/dist/server/with-defaults.js +26 -40
- package/dist/types.d.ts +4 -3
- package/dist/types.js +1 -0
- package/dist/vite/client.d.ts +7 -6
- package/dist/vite/client.js +24 -30
- package/dist/vite/components/honox-island.d.ts +15 -9
- package/dist/vite/components/honox-island.js +39 -50
- package/dist/vite/components/index.d.ts +2 -2
- package/dist/vite/components/index.js +2 -3
- package/dist/vite/index.d.ts +20 -20
- package/dist/vite/index.js +37 -52
- package/dist/vite/inject-importing-islands.d.ts +6 -5
- package/dist/vite/inject-importing-islands.js +78 -89
- package/dist/vite/island-components.d.ts +10 -9
- package/dist/vite/island-components.js +124 -205
- package/dist/vite/restart-on-add-unlink.d.ts +4 -3
- package/dist/vite/restart-on-add-unlink.js +16 -15
- package/dist/vite/utils/path.d.ts +3 -2
- package/dist/vite/utils/path.js +25 -9
- package/package.json +35 -50
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**HonoX** is a simple and fast meta-framework for creating full-stack websites or Web APIs - (formerly _[Sonik](https://github.com/sonikjs/sonik)_). It stands on the shoulders of giants; built on [Hono](https://hono.dev/), [Vite](https://vitejs.dev/), and UI libraries.
|
|
4
4
|
|
|
5
|
-
**Note**: _HonoX is currently in the "alpha stage". Breaking changes are introduced
|
|
5
|
+
**Note**: _HonoX is currently in the "alpha stage". Breaking changes are introduced within the same major version, following [semantic versioning for zerover](https://semver.org/#spec-item-4)._
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
package/dist/client/client.d.ts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CreateChildren, CreateElement, Hydrate, TriggerHydration } from "../types.js";
|
|
2
2
|
|
|
3
|
+
//#region src/client/client.d.ts
|
|
3
4
|
type ClientOptions = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
hydrate?: Hydrate;
|
|
6
|
+
createElement?: CreateElement;
|
|
7
|
+
/**
|
|
8
|
+
* Create "children" attribute of a component from a list of child nodes
|
|
9
|
+
*/
|
|
10
|
+
createChildren?: CreateChildren;
|
|
11
|
+
/**
|
|
12
|
+
* Trigger hydration on your own
|
|
13
|
+
*/
|
|
14
|
+
triggerHydration?: TriggerHydration;
|
|
15
|
+
ISLAND_FILES?: Record<string, () => Promise<unknown>>;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated
|
|
18
|
+
*/
|
|
19
|
+
island_root?: string;
|
|
19
20
|
};
|
|
20
21
|
declare const createClient: (options?: ClientOptions) => Promise<void>;
|
|
21
|
-
|
|
22
|
-
export {
|
|
22
|
+
//#endregion
|
|
23
|
+
export { ClientOptions, createClient };
|
package/dist/client/client.js
CHANGED
|
@@ -1,80 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
COMPONENT_EXPORT,
|
|
4
|
-
COMPONENT_NAME,
|
|
5
|
-
DATA_HONO_TEMPLATE,
|
|
6
|
-
DATA_SERIALIZED_PROPS
|
|
7
|
-
} from "../constants.js";
|
|
1
|
+
import { COMPONENT_EXPORT, COMPONENT_NAME, DATA_HONO_TEMPLATE, DATA_SERIALIZED_PROPS } from "../constants.js";
|
|
8
2
|
import { filterByPattern } from "./utils/filter.js";
|
|
3
|
+
import { createElement, render } from "hono/jsx/dom";
|
|
4
|
+
|
|
5
|
+
//#region src/client/client.ts
|
|
9
6
|
const createClient = async (options) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
maybeTemplate = maybeTemplate.previousSibling;
|
|
60
|
-
}
|
|
61
|
-
const newElem = await createElement(Component, props);
|
|
62
|
-
await hydrate(newElem, element);
|
|
63
|
-
});
|
|
64
|
-
await Promise.all(elementPromises);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
await Promise.all(filePromises);
|
|
68
|
-
};
|
|
69
|
-
const triggerHydration = options?.triggerHydration ?? (async (hydrateComponent2) => {
|
|
70
|
-
if (document.querySelector('template[id^="H:"], template[id^="E:"]')) {
|
|
71
|
-
const { hydrateComponentHonoSuspense } = await import("./runtime");
|
|
72
|
-
await hydrateComponentHonoSuspense(hydrateComponent2);
|
|
73
|
-
}
|
|
74
|
-
await hydrateComponent2(document);
|
|
75
|
-
});
|
|
76
|
-
await triggerHydration?.(hydrateComponent);
|
|
77
|
-
};
|
|
78
|
-
export {
|
|
79
|
-
createClient
|
|
7
|
+
const FILES = options?.ISLAND_FILES ?? filterByPattern({
|
|
8
|
+
...import.meta.glob("/app/islands/**/*.tsx"),
|
|
9
|
+
...import.meta.glob("/app/**/*.island.tsx"),
|
|
10
|
+
...import.meta.glob("/app/**/$*.tsx")
|
|
11
|
+
}, [
|
|
12
|
+
/\/[a-zA-Z0-9-]+\.tsx$/,
|
|
13
|
+
/\/_[a-zA-Z0-9-]+\.island\.tsx$/,
|
|
14
|
+
/\/\$[a-zA-Z0-9-]+\.tsx$/
|
|
15
|
+
]);
|
|
16
|
+
const hydrateComponent = async (document) => {
|
|
17
|
+
const filePromises = Object.keys(FILES).map(async (filePath) => {
|
|
18
|
+
const componentName = filePath;
|
|
19
|
+
const elements = document.querySelectorAll(`[${COMPONENT_NAME}="${componentName}"]:not([data-hono-hydrated])`);
|
|
20
|
+
if (elements) {
|
|
21
|
+
const elementPromises = Array.from(elements).map(async (element) => {
|
|
22
|
+
element.setAttribute("data-hono-hydrated", "true");
|
|
23
|
+
const exportName = element.getAttribute(COMPONENT_EXPORT) || "default";
|
|
24
|
+
const fileCallback = FILES[filePath];
|
|
25
|
+
const Component = await (await fileCallback())[exportName];
|
|
26
|
+
const serializedProps = element.attributes.getNamedItem(DATA_SERIALIZED_PROPS)?.value;
|
|
27
|
+
const props = JSON.parse(serializedProps ?? "{}");
|
|
28
|
+
const hydrate = options?.hydrate ?? render;
|
|
29
|
+
const createElement$1 = options?.createElement ?? createElement;
|
|
30
|
+
let maybeTemplate = element.childNodes[element.childNodes.length - 1];
|
|
31
|
+
while (maybeTemplate?.nodeName === "TEMPLATE") {
|
|
32
|
+
const propKey = maybeTemplate.getAttribute(DATA_HONO_TEMPLATE);
|
|
33
|
+
if (propKey == null) break;
|
|
34
|
+
let createChildren = options?.createChildren;
|
|
35
|
+
if (!createChildren) {
|
|
36
|
+
const { buildCreateChildrenFn } = await import("./runtime.js");
|
|
37
|
+
createChildren = buildCreateChildrenFn(createElement$1, async (name) => (await FILES[`${name}`]()).default);
|
|
38
|
+
}
|
|
39
|
+
props[propKey] = await createChildren(maybeTemplate.content.childNodes);
|
|
40
|
+
maybeTemplate = maybeTemplate.previousSibling;
|
|
41
|
+
}
|
|
42
|
+
await hydrate(await createElement$1(Component, props), element);
|
|
43
|
+
});
|
|
44
|
+
await Promise.all(elementPromises);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
await Promise.all(filePromises);
|
|
48
|
+
};
|
|
49
|
+
await (options?.triggerHydration ?? (async (hydrateComponent) => {
|
|
50
|
+
if (document.querySelector("template[id^=\"H:\"], template[id^=\"E:\"]")) {
|
|
51
|
+
const { hydrateComponentHonoSuspense } = await import("./runtime.js");
|
|
52
|
+
await hydrateComponentHonoSuspense(hydrateComponent);
|
|
53
|
+
}
|
|
54
|
+
await hydrateComponent(document);
|
|
55
|
+
}))?.(hydrateComponent);
|
|
80
56
|
};
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
export { createClient };
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { ClientOptions, createClient } from "./client.js";
|
|
2
|
+
export { type ClientOptions, createClient };
|
package/dist/client/index.js
CHANGED
package/dist/client/runtime.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CreateChildren, CreateElement, HydrateComponent } from "../types.js";
|
|
2
2
|
|
|
3
|
+
//#region src/client/runtime.d.ts
|
|
3
4
|
type ImportComponent = (name: string) => Promise<Function | undefined>;
|
|
4
5
|
declare const buildCreateChildrenFn: (createElement: CreateElement, importComponent: ImportComponent) => CreateChildren;
|
|
5
6
|
declare const hydrateComponentHonoSuspense: (hydrateComponent: HydrateComponent) => Promise<void>;
|
|
6
|
-
|
|
7
|
-
export { buildCreateChildrenFn, hydrateComponentHonoSuspense };
|
|
7
|
+
//#endregion
|
|
8
|
+
export { buildCreateChildrenFn, hydrateComponentHonoSuspense };
|
package/dist/client/runtime.js
CHANGED
|
@@ -1,146 +1,115 @@
|
|
|
1
|
-
import { Suspense, use } from "hono/jsx/dom";
|
|
2
1
|
import { COMPONENT_NAME, DATA_HONO_TEMPLATE, DATA_SERIALIZED_PROPS } from "../constants.js";
|
|
2
|
+
import { Suspense, use } from "hono/jsx/dom";
|
|
3
|
+
|
|
4
|
+
//#region src/client/runtime.ts
|
|
3
5
|
const buildCreateChildrenFn = (createElement, importComponent) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
await createElement(Suspense, {
|
|
82
|
-
fallback,
|
|
83
|
-
children: [await createElement(() => use(promise), {})]
|
|
84
|
-
})
|
|
85
|
-
);
|
|
86
|
-
} else {
|
|
87
|
-
let component = void 0;
|
|
88
|
-
const componentName = child.getAttribute(COMPONENT_NAME);
|
|
89
|
-
if (componentName) {
|
|
90
|
-
component = await importComponent(componentName);
|
|
91
|
-
}
|
|
92
|
-
if (component) {
|
|
93
|
-
const props = JSON.parse(child.getAttribute(DATA_SERIALIZED_PROPS) || "{}");
|
|
94
|
-
await setChildrenFromTemplate(props, child);
|
|
95
|
-
children.push(
|
|
96
|
-
await createElement(component, {
|
|
97
|
-
key: ++keyIndex,
|
|
98
|
-
...props
|
|
99
|
-
})
|
|
100
|
-
);
|
|
101
|
-
} else {
|
|
102
|
-
children.push(await createElementFromHTMLElement(child));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return children;
|
|
107
|
-
};
|
|
108
|
-
return createChildren;
|
|
6
|
+
let keyIndex = 0;
|
|
7
|
+
const setChildrenFromTemplate = async (props, element) => {
|
|
8
|
+
const maybeTemplate = element.childNodes[element.childNodes.length - 1];
|
|
9
|
+
if (maybeTemplate?.nodeName === "TEMPLATE" && maybeTemplate?.getAttribute(DATA_HONO_TEMPLATE) !== null) props.children = await createChildren(maybeTemplate.content.childNodes);
|
|
10
|
+
};
|
|
11
|
+
const createElementFromHTMLElement = async (element) => {
|
|
12
|
+
const props = { children: await createChildren(element.childNodes) };
|
|
13
|
+
const attributes = element.attributes;
|
|
14
|
+
for (let i = 0; i < attributes.length; i++) props[attributes[i].name] = attributes[i].value;
|
|
15
|
+
return createElement(element.nodeName, {
|
|
16
|
+
key: ++keyIndex,
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
const createChildren = async (childNodes) => {
|
|
21
|
+
const children = [];
|
|
22
|
+
for (let i = 0; i < childNodes.length; i++) {
|
|
23
|
+
const child = childNodes[i];
|
|
24
|
+
if (child.nodeType === 8) continue;
|
|
25
|
+
else if (child.nodeType === 3) children.push(child.textContent);
|
|
26
|
+
else if (child.nodeName === "TEMPLATE" && child.id.match(/(?:H|E):\d+/)) {
|
|
27
|
+
const placeholderElement = document.createElement("hono-placeholder");
|
|
28
|
+
placeholderElement.style.display = "none";
|
|
29
|
+
let resolve;
|
|
30
|
+
const promise = new Promise((r) => resolve = r);
|
|
31
|
+
child.replaceWith = (node) => {
|
|
32
|
+
createChildren(node.childNodes).then(resolve);
|
|
33
|
+
placeholderElement.remove();
|
|
34
|
+
};
|
|
35
|
+
let fallback = [];
|
|
36
|
+
for (placeholderElement.appendChild(child); i < childNodes.length; i++) {
|
|
37
|
+
const child = childNodes[i];
|
|
38
|
+
if (child.nodeType === 8) {
|
|
39
|
+
placeholderElement.appendChild(child);
|
|
40
|
+
i--;
|
|
41
|
+
break;
|
|
42
|
+
} else if (child.nodeType === 3) fallback.push(child.textContent);
|
|
43
|
+
else fallback.push(await createElementFromHTMLElement(child));
|
|
44
|
+
}
|
|
45
|
+
const fallbackTemplates = document.querySelectorAll(`[data-hono-target="${child.id}"]`);
|
|
46
|
+
if (fallbackTemplates.length > 0) {
|
|
47
|
+
const fallbackTemplate = fallbackTemplates[fallbackTemplates.length - 1];
|
|
48
|
+
fallback = await createChildren(fallbackTemplate.content.childNodes);
|
|
49
|
+
}
|
|
50
|
+
if (fallback.length === 0 && child.id.startsWith("E:")) {
|
|
51
|
+
let resolve;
|
|
52
|
+
const promise = new Promise((r) => resolve = r);
|
|
53
|
+
fallback = await createElement(Suspense, {
|
|
54
|
+
fallback: [],
|
|
55
|
+
children: [await createElement(() => use(promise), {})]
|
|
56
|
+
});
|
|
57
|
+
placeholderElement.insertBefore = ((node) => {
|
|
58
|
+
createChildren(node.childNodes).then(resolve);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
document.body.appendChild(placeholderElement);
|
|
62
|
+
children.push(await createElement(Suspense, {
|
|
63
|
+
fallback,
|
|
64
|
+
children: [await createElement(() => use(promise), {})]
|
|
65
|
+
}));
|
|
66
|
+
} else {
|
|
67
|
+
let component = void 0;
|
|
68
|
+
const componentName = child.getAttribute(COMPONENT_NAME);
|
|
69
|
+
if (componentName) component = await importComponent(componentName);
|
|
70
|
+
if (component) {
|
|
71
|
+
const props = JSON.parse(child.getAttribute(DATA_SERIALIZED_PROPS) || "{}");
|
|
72
|
+
await setChildrenFromTemplate(props, child);
|
|
73
|
+
children.push(await createElement(component, {
|
|
74
|
+
key: ++keyIndex,
|
|
75
|
+
...props
|
|
76
|
+
}));
|
|
77
|
+
} else children.push(await createElementFromHTMLElement(child));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return children;
|
|
81
|
+
};
|
|
82
|
+
return createChildren;
|
|
109
83
|
};
|
|
110
84
|
const hydrateComponentHonoSuspense = async (hydrateComponent) => {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
});
|
|
139
|
-
observerTargets.forEach((target) => {
|
|
140
|
-
observer.observe(target, { childList: true });
|
|
141
|
-
});
|
|
142
|
-
};
|
|
143
|
-
export {
|
|
144
|
-
buildCreateChildrenFn,
|
|
145
|
-
hydrateComponentHonoSuspense
|
|
85
|
+
const templates = /* @__PURE__ */ new Set();
|
|
86
|
+
const observerTargets = /* @__PURE__ */ new Set();
|
|
87
|
+
document.querySelectorAll("template[id^=\"H:\"], template[id^=\"E:\"]").forEach((template) => {
|
|
88
|
+
if (template.parentElement) {
|
|
89
|
+
templates.add(template);
|
|
90
|
+
observerTargets.add(template.parentElement);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
if (observerTargets.size === 0) return;
|
|
94
|
+
const observer = new MutationObserver((mutations) => {
|
|
95
|
+
const targets = /* @__PURE__ */ new Set();
|
|
96
|
+
mutations.forEach((mutation) => {
|
|
97
|
+
if (mutation.target instanceof Element) {
|
|
98
|
+
targets.add(mutation.target);
|
|
99
|
+
mutation.removedNodes.forEach((node) => {
|
|
100
|
+
templates.delete(node);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
targets.forEach((target) => {
|
|
105
|
+
hydrateComponent(target);
|
|
106
|
+
});
|
|
107
|
+
if (templates.size === 0) observer.disconnect();
|
|
108
|
+
});
|
|
109
|
+
observerTargets.forEach((target) => {
|
|
110
|
+
observer.observe(target, { childList: true });
|
|
111
|
+
});
|
|
146
112
|
};
|
|
113
|
+
|
|
114
|
+
//#endregion
|
|
115
|
+
export { buildCreateChildrenFn, hydrateComponentHonoSuspense };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
//#region src/client/utils/filter.ts
|
|
1
2
|
const filterByPattern = (files, patterns) => {
|
|
2
|
-
|
|
3
|
-
Object.entries(files).filter(([path]) => patterns.some((pattern) => pattern.test(path)))
|
|
4
|
-
);
|
|
5
|
-
};
|
|
6
|
-
export {
|
|
7
|
-
filterByPattern
|
|
3
|
+
return Object.fromEntries(Object.entries(files).filter(([path]) => patterns.some((pattern) => pattern.test(path))));
|
|
8
4
|
};
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
export { filterByPattern };
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
//#region src/constants.d.ts
|
|
1
2
|
declare const COMPONENT_NAME = "component-name";
|
|
2
3
|
declare const COMPONENT_EXPORT = "component-export";
|
|
3
4
|
declare const DATA_SERIALIZED_PROPS = "data-serialized-props";
|
|
4
5
|
declare const DATA_HONO_TEMPLATE = "data-hono-template";
|
|
5
6
|
declare const IMPORTING_ISLANDS_ID: "__importing_islands";
|
|
6
|
-
|
|
7
|
-
export { COMPONENT_EXPORT, COMPONENT_NAME, DATA_HONO_TEMPLATE, DATA_SERIALIZED_PROPS, IMPORTING_ISLANDS_ID };
|
|
7
|
+
//#endregion
|
|
8
|
+
export { COMPONENT_EXPORT, COMPONENT_NAME, DATA_HONO_TEMPLATE, DATA_SERIALIZED_PROPS, IMPORTING_ISLANDS_ID };
|
package/dist/constants.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
+
//#region src/constants.ts
|
|
1
2
|
const COMPONENT_NAME = "component-name";
|
|
2
3
|
const COMPONENT_EXPORT = "component-export";
|
|
3
4
|
const DATA_SERIALIZED_PROPS = "data-serialized-props";
|
|
4
5
|
const DATA_HONO_TEMPLATE = "data-hono-template";
|
|
5
6
|
const IMPORTING_ISLANDS_ID = "__importing_islands";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
DATA_HONO_TEMPLATE,
|
|
10
|
-
DATA_SERIALIZED_PROPS,
|
|
11
|
-
IMPORTING_ISLANDS_ID
|
|
12
|
-
};
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { COMPONENT_EXPORT, COMPONENT_NAME, DATA_HONO_TEMPLATE, DATA_SERIALIZED_PROPS, IMPORTING_ISLANDS_ID };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
1
|
+
import { Env, Hono } from "hono";
|
|
2
|
+
import * as hono_factory0 from "hono/factory";
|
|
3
|
+
import * as hono_types0 from "hono/types";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
declare const
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
//#region src/factory/factory.d.ts
|
|
6
|
+
declare const createRoute: hono_factory0.CreateHandlersInterface<Env, string>;
|
|
7
|
+
declare const createHono: () => Hono<Env, hono_types0.BlankSchema, "/">;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { createHono, createRoute };
|
package/dist/factory/factory.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
2
|
import { createFactory } from "hono/factory";
|
|
3
|
+
|
|
4
|
+
//#region src/factory/factory.ts
|
|
3
5
|
const factory = createFactory();
|
|
4
6
|
const createRoute = factory.createHandlers;
|
|
5
7
|
const createHono = () => {
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
createHono,
|
|
10
|
-
createRoute
|
|
8
|
+
return new Hono();
|
|
11
9
|
};
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { createHono, createRoute };
|
package/dist/factory/index.d.ts
CHANGED
package/dist/factory/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { }
|
|
1
|
+
export { };
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/server/base.d.ts
CHANGED
package/dist/server/base.js
CHANGED