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.
Files changed (58) hide show
  1. package/README.md +1 -1
  2. package/dist/client/client.d.ts +19 -18
  3. package/dist/client/client.js +56 -77
  4. package/dist/client/index.d.ts +2 -2
  5. package/dist/client/index.js +2 -3
  6. package/dist/client/runtime.d.ts +4 -3
  7. package/dist/client/runtime.js +110 -141
  8. package/dist/client/utils/filter.d.ts +3 -2
  9. package/dist/client/utils/filter.js +5 -6
  10. package/dist/constants.d.ts +3 -2
  11. package/dist/constants.js +4 -7
  12. package/dist/factory/factory.d.ts +8 -7
  13. package/dist/factory/factory.js +6 -5
  14. package/dist/factory/index.d.ts +2 -4
  15. package/dist/factory/index.js +3 -5
  16. package/dist/index.d.ts +1 -2
  17. package/dist/index.js +1 -0
  18. package/dist/server/base.d.ts +2 -4
  19. package/dist/server/base.js +2 -3
  20. package/dist/server/components/has-islands.d.ts +7 -4
  21. package/dist/server/components/has-islands.js +9 -9
  22. package/dist/server/components/index.d.ts +4 -6
  23. package/dist/server/components/index.js +2 -5
  24. package/dist/server/components/link.d.ts +8 -7
  25. package/dist/server/components/link.js +34 -39
  26. package/dist/server/components/script.d.ts +9 -8
  27. package/dist/server/components/script.js +33 -37
  28. package/dist/server/context-storage.d.ts +5 -4
  29. package/dist/server/context-storage.js +5 -3
  30. package/dist/server/index.d.ts +7 -11
  31. package/dist/server/index.js +6 -4
  32. package/dist/server/server.d.ts +27 -30
  33. package/dist/server/server.js +227 -275
  34. package/dist/server/utils/file.d.ts +3 -2
  35. package/dist/server/utils/file.js +38 -66
  36. package/dist/server/utils/path.d.ts +3 -2
  37. package/dist/server/utils/path.js +5 -4
  38. package/dist/server/with-defaults.d.ts +8 -8
  39. package/dist/server/with-defaults.js +26 -40
  40. package/dist/types.d.ts +4 -3
  41. package/dist/types.js +1 -0
  42. package/dist/vite/client.d.ts +7 -6
  43. package/dist/vite/client.js +24 -30
  44. package/dist/vite/components/honox-island.d.ts +15 -9
  45. package/dist/vite/components/honox-island.js +39 -50
  46. package/dist/vite/components/index.d.ts +2 -2
  47. package/dist/vite/components/index.js +2 -3
  48. package/dist/vite/index.d.ts +20 -20
  49. package/dist/vite/index.js +37 -52
  50. package/dist/vite/inject-importing-islands.d.ts +6 -5
  51. package/dist/vite/inject-importing-islands.js +78 -89
  52. package/dist/vite/island-components.d.ts +10 -9
  53. package/dist/vite/island-components.js +124 -205
  54. package/dist/vite/restart-on-add-unlink.d.ts +4 -3
  55. package/dist/vite/restart-on-add-unlink.js +16 -15
  56. package/dist/vite/utils/path.d.ts +3 -2
  57. package/dist/vite/utils/path.js +25 -9
  58. 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 without following semantic versioning._
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
 
@@ -1,22 +1,23 @@
1
- import { Hydrate, CreateElement, CreateChildren, TriggerHydration } from '../types.js';
1
+ import { CreateChildren, CreateElement, Hydrate, TriggerHydration } from "../types.js";
2
2
 
3
+ //#region src/client/client.d.ts
3
4
  type ClientOptions = {
4
- hydrate?: Hydrate;
5
- createElement?: CreateElement;
6
- /**
7
- * Create "children" attribute of a component from a list of child nodes
8
- */
9
- createChildren?: CreateChildren;
10
- /**
11
- * Trigger hydration on your own
12
- */
13
- triggerHydration?: TriggerHydration;
14
- ISLAND_FILES?: Record<string, () => Promise<unknown>>;
15
- /**
16
- * @deprecated
17
- */
18
- island_root?: string;
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 { type ClientOptions, createClient };
22
+ //#endregion
23
+ export { ClientOptions, createClient };
@@ -1,80 +1,59 @@
1
- import { render, createElement as createElementHono } from "hono/jsx/dom";
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
- const FILES = options?.ISLAND_FILES ?? filterByPattern(
11
- {
12
- ...import.meta.glob("/app/islands/**/*.tsx"),
13
- ...import.meta.glob("/app/**/*.island.tsx"),
14
- ...import.meta.glob("/app/**/$*.tsx")
15
- },
16
- [
17
- /\/[a-zA-Z0-9-]+\.tsx$/,
18
- // /app/islands/**/*.tsx
19
- /\/_[a-zA-Z0-9-]+\.island\.tsx$/,
20
- // /app/**/_*.island.tsx
21
- /\/\$[a-zA-Z0-9-]+\.tsx$/
22
- // /app/**/$*.tsx
23
- ]
24
- );
25
- const hydrateComponent = async (document2) => {
26
- const filePromises = Object.keys(FILES).map(async (filePath) => {
27
- const componentName = filePath;
28
- const elements = document2.querySelectorAll(
29
- `[${COMPONENT_NAME}="${componentName}"]:not([data-hono-hydrated])`
30
- );
31
- if (elements) {
32
- const elementPromises = Array.from(elements).map(async (element) => {
33
- element.setAttribute("data-hono-hydrated", "true");
34
- const exportName = element.getAttribute(COMPONENT_EXPORT) || "default";
35
- const fileCallback = FILES[filePath];
36
- const file = await fileCallback();
37
- const Component = await file[exportName];
38
- const serializedProps = element.attributes.getNamedItem(DATA_SERIALIZED_PROPS)?.value;
39
- const props = JSON.parse(serializedProps ?? "{}");
40
- const hydrate = options?.hydrate ?? render;
41
- const createElement = options?.createElement ?? createElementHono;
42
- let maybeTemplate = element.childNodes[element.childNodes.length - 1];
43
- while (maybeTemplate?.nodeName === "TEMPLATE") {
44
- const propKey = maybeTemplate.getAttribute(DATA_HONO_TEMPLATE);
45
- if (propKey == null) {
46
- break;
47
- }
48
- let createChildren = options?.createChildren;
49
- if (!createChildren) {
50
- const { buildCreateChildrenFn } = await import("./runtime");
51
- createChildren = buildCreateChildrenFn(
52
- createElement,
53
- async (name) => (await FILES[`${name}`]()).default
54
- );
55
- }
56
- props[propKey] = await createChildren(
57
- maybeTemplate.content.childNodes
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 };
@@ -1,2 +1,2 @@
1
- export { ClientOptions, createClient } from './client.js';
2
- import '../types.js';
1
+ import { ClientOptions, createClient } from "./client.js";
2
+ export { type ClientOptions, createClient };
@@ -1,4 +1,3 @@
1
1
  import { createClient } from "./client.js";
2
- export {
3
- createClient
4
- };
2
+
3
+ export { createClient };
@@ -1,7 +1,8 @@
1
- import { CreateElement, CreateChildren, HydrateComponent } from '../types.js';
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 };
@@ -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
- let keyIndex = 0;
5
- const setChildrenFromTemplate = async (props, element) => {
6
- const maybeTemplate = element.childNodes[element.childNodes.length - 1];
7
- if (maybeTemplate?.nodeName === "TEMPLATE" && maybeTemplate?.getAttribute(DATA_HONO_TEMPLATE) !== null) {
8
- props.children = await createChildren(
9
- maybeTemplate.content.childNodes
10
- );
11
- }
12
- };
13
- const createElementFromHTMLElement = async (element) => {
14
- const props = {
15
- children: await createChildren(element.childNodes)
16
- };
17
- const attributes = element.attributes;
18
- for (let i = 0; i < attributes.length; i++) {
19
- props[attributes[i].name] = attributes[i].value;
20
- }
21
- return createElement(element.nodeName, {
22
- key: ++keyIndex,
23
- ...props
24
- });
25
- };
26
- const createChildren = async (childNodes) => {
27
- const children = [];
28
- for (let i = 0; i < childNodes.length; i++) {
29
- const child = childNodes[i];
30
- if (child.nodeType === 8) {
31
- continue;
32
- } else if (child.nodeType === 3) {
33
- children.push(child.textContent);
34
- } else if (child.nodeName === "TEMPLATE" && child.id.match(/(?:H|E):\d+/)) {
35
- const placeholderElement = document.createElement("hono-placeholder");
36
- placeholderElement.style.display = "none";
37
- let resolve;
38
- const promise = new Promise((r) => resolve = r);
39
- child.replaceWith = (node) => {
40
- createChildren(node.childNodes).then(resolve);
41
- placeholderElement.remove();
42
- };
43
- let fallback = [];
44
- for (
45
- // equivalent to i++
46
- placeholderElement.appendChild(child);
47
- i < childNodes.length;
48
- i++
49
- ) {
50
- const child2 = childNodes[i];
51
- if (child2.nodeType === 8) {
52
- placeholderElement.appendChild(child2);
53
- i--;
54
- break;
55
- } else if (child2.nodeType === 3) {
56
- fallback.push(child2.textContent);
57
- } else {
58
- fallback.push(await createElementFromHTMLElement(child2));
59
- }
60
- }
61
- const fallbackTemplates = document.querySelectorAll(
62
- `[data-hono-target="${child.id}"]`
63
- );
64
- if (fallbackTemplates.length > 0) {
65
- const fallbackTemplate = fallbackTemplates[fallbackTemplates.length - 1];
66
- fallback = await createChildren(fallbackTemplate.content.childNodes);
67
- }
68
- if (fallback.length === 0 && child.id.startsWith("E:")) {
69
- let resolve2;
70
- const promise2 = new Promise((r) => resolve2 = r);
71
- fallback = await createElement(Suspense, {
72
- fallback: [],
73
- children: [await createElement(() => use(promise2), {})]
74
- });
75
- placeholderElement.insertBefore = (node) => {
76
- createChildren(node.childNodes).then(resolve2);
77
- };
78
- }
79
- document.body.appendChild(placeholderElement);
80
- children.push(
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
- const templates = /* @__PURE__ */ new Set();
112
- const observerTargets = /* @__PURE__ */ new Set();
113
- document.querySelectorAll('template[id^="H:"], template[id^="E:"]').forEach((template) => {
114
- if (template.parentElement) {
115
- templates.add(template);
116
- observerTargets.add(template.parentElement);
117
- }
118
- });
119
- if (observerTargets.size === 0) {
120
- return;
121
- }
122
- const observer = new MutationObserver((mutations) => {
123
- const targets = /* @__PURE__ */ new Set();
124
- mutations.forEach((mutation) => {
125
- if (mutation.target instanceof Element) {
126
- targets.add(mutation.target);
127
- mutation.removedNodes.forEach((node) => {
128
- templates.delete(node);
129
- });
130
- }
131
- });
132
- targets.forEach((target) => {
133
- hydrateComponent(target);
134
- });
135
- if (templates.size === 0) {
136
- observer.disconnect();
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,3 +1,4 @@
1
+ //#region src/client/utils/filter.d.ts
1
2
  declare const filterByPattern: <T>(files: Record<string, T>, patterns: RegExp[]) => Record<string, T>;
2
-
3
- export { filterByPattern };
3
+ //#endregion
4
+ export { filterByPattern };
@@ -1,8 +1,7 @@
1
+ //#region src/client/utils/filter.ts
1
2
  const filterByPattern = (files, patterns) => {
2
- return Object.fromEntries(
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 };
@@ -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
- export {
7
- COMPONENT_EXPORT,
8
- COMPONENT_NAME,
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 * as hono_types from 'hono/types';
2
- import * as hono_factory from 'hono/factory';
3
- import { Env, Hono } from 'hono';
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
- declare const createRoute: hono_factory.CreateHandlersInterface<Env, string>;
6
- declare const createHono: () => Hono<Env, hono_types.BlankSchema, "/">;
7
-
8
- export { createHono, createRoute };
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 };
@@ -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
- return new Hono();
7
- };
8
- export {
9
- createHono,
10
- createRoute
8
+ return new Hono();
11
9
  };
10
+
11
+ //#endregion
12
+ export { createHono, createRoute };
@@ -1,4 +1,2 @@
1
- export { createHono, createRoute } from './factory.js';
2
- import 'hono/types';
3
- import 'hono/factory';
4
- import 'hono';
1
+ import { createHono, createRoute } from "./factory.js";
2
+ export { createHono, createRoute };
@@ -1,5 +1,3 @@
1
- import { createRoute, createHono } from "./factory.js";
2
- export {
3
- createHono,
4
- createRoute
5
- };
1
+ import { createHono, createRoute } from "./factory.js";
2
+
3
+ export { createHono, createRoute };
package/dist/index.d.ts CHANGED
@@ -1,2 +1 @@
1
-
2
- export { }
1
+ export { };
package/dist/index.js CHANGED
@@ -0,0 +1 @@
1
+ export { };
@@ -1,4 +1,2 @@
1
- export { createApp } from './server.js';
2
- import 'hono';
3
- import 'hono/types';
4
- import '../constants.js';
1
+ import { createApp } from "./server.js";
2
+ export { createApp };
@@ -1,4 +1,3 @@
1
1
  import { createApp } from "./server.js";
2
- export {
3
- createApp
4
- };
2
+
3
+ export { createApp };
@@ -1,5 +1,8 @@
1
- declare const HasIslands: ({ children }: {
2
- children: any;
1
+ //#region src/server/components/has-islands.d.ts
2
+ declare const HasIslands: ({
3
+ children
4
+ }: {
5
+ children: any;
3
6
  }) => any;
4
-
5
- export { HasIslands };
7
+ //#endregion
8
+ export { HasIslands };