@riebeckite/honox 0.0.45 → 0.0.48

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 (45) hide show
  1. package/dist/index.js +2204 -1778
  2. package/dist/runtime.js +30 -0
  3. package/dist/server.js +80 -49
  4. package/dist/src/client_module.d.ts +1 -3
  5. package/dist/src/client_module_part1.d.ts +5 -0
  6. package/dist/src/client_module_part2.d.ts +2 -0
  7. package/dist/src/content_route.d.ts +3 -88
  8. package/dist/src/content_route_part1.d.ts +37 -0
  9. package/dist/src/content_route_part2.d.ts +8 -0
  10. package/dist/src/runtime_modules.d.ts +1 -0
  11. package/dist/src/spa_diagnostics.d.ts +4 -0
  12. package/dist/src/ssg/output_cache.d.ts +5 -37
  13. package/dist/src/ssg/output_cache_decision.d.ts +9 -0
  14. package/dist/src/ssg/output_cache_entries.d.ts +5 -0
  15. package/dist/src/ssg/output_cache_fastpath.d.ts +12 -0
  16. package/dist/src/ssg/output_cache_load.d.ts +8 -0
  17. package/dist/src/ssg/output_cache_paths.d.ts +13 -0
  18. package/dist/src/ssg/output_cache_replace.d.ts +6 -0
  19. package/dist/src/ssg/output_cache_save.d.ts +2 -0
  20. package/dist/src/ssg/output_cache_types.d.ts +33 -0
  21. package/dist/src/ssg/output_cache_validate.d.ts +8 -0
  22. package/dist/src/ssg/standalone.d.ts +1 -0
  23. package/dist/src/ssg_plugin.d.ts +3 -12
  24. package/dist/src/ssg_plugin_cleanup.d.ts +3 -0
  25. package/dist/src/ssg_plugin_close.d.ts +2 -0
  26. package/dist/src/ssg_plugin_generate_finalize.d.ts +3 -0
  27. package/dist/src/ssg_plugin_generate_prepare.d.ts +52 -0
  28. package/dist/src/ssg_plugin_generate_run.d.ts +3 -0
  29. package/dist/src/ssg_plugin_helpers.d.ts +21 -0
  30. package/dist/src/ssg_plugin_setup.d.ts +20 -0
  31. package/dist/src/ssg_plugin_state.d.ts +52 -0
  32. package/dist/src/ui/primitives.d.ts +4 -126
  33. package/dist/src/ui/primitives.js +110 -88
  34. package/dist/src/ui/primitives_article.d.ts +9 -0
  35. package/dist/src/ui/primitives_head.d.ts +8 -0
  36. package/dist/src/ui/primitives_page.d.ts +3 -0
  37. package/dist/src/ui/primitives_theme.d.ts +7 -0
  38. package/dist/src/ui/primitives_types.d.ts +82 -0
  39. package/dist/src/virtual_modules.d.ts +4 -0
  40. package/dist/src/vite_plugin.d.ts +4 -9
  41. package/dist/src/vite_plugin_helpers.d.ts +12 -0
  42. package/dist/src/vite_runner.d.ts +3 -36
  43. package/dist/src/vite_runner_helpers.d.ts +40 -0
  44. package/package.json +11 -11
  45. package/style.css +6 -1
@@ -1,9 +1,3 @@
1
- // src/ui/primitives.tsx
2
- import { escapeScriptJson, uniqueStrings } from "@riebeckite/core";
3
- import { ColorModeScript } from "@riebeckite/plugin-color-mode";
4
- import { raw } from "hono/html";
5
- import { Link, Script } from "honox/server";
6
-
7
1
  // src/ui/context.ts
8
2
  import {
9
3
  ArticleProvider,
@@ -12,16 +6,43 @@ import {
12
6
  useSiteContext
13
7
  } from "@riebeckite/ui";
14
8
 
15
- // src/ui/primitives.tsx
16
- import { Fragment, jsx, jsxs } from "hono/jsx/jsx-runtime";
17
- import { createElement } from "hono/jsx";
9
+ // src/ui/primitives_theme.tsx
10
+ import { uniqueStrings } from "@riebeckite/core";
11
+ import { jsx } from "hono/jsx/jsx-runtime";
12
+ function themeRootAttributes(theme) {
13
+ return {
14
+ ...theme.settings.attributes,
15
+ "data-rb-theme": theme.name,
16
+ "data-rb-mode": theme.colorMode === "system" ? void 0 : theme.colorMode,
17
+ "data-rb-layout": theme.layout
18
+ };
19
+ }
20
+ function ThemeRoot(props) {
21
+ const site = useSiteContext();
22
+ const theme = props.theme ?? site?.config.theme;
23
+ const lang = props.lang ?? site?.language ?? site?.config.site.locale;
24
+ if (!theme) return /* @__PURE__ */ jsx("html", { lang, children: props.children });
25
+ return /* @__PURE__ */ jsx("html", { lang, ...themeRootAttributes(theme), children: props.children });
26
+ }
27
+ function getThemeStyle(theme) {
28
+ return theme.settings.style;
29
+ }
30
+ function getThemeStylesheets(stylesheets) {
31
+ return uniqueStrings([...stylesheets]);
32
+ }
33
+ function joinClassNames(...classNames) {
34
+ return classNames.filter(Boolean).join(" ");
35
+ }
36
+
37
+ // src/ui/primitives_article.tsx
38
+ import { jsx as jsx2 } from "hono/jsx/jsx-runtime";
18
39
  function Article(props) {
19
- const article = /* @__PURE__ */ jsx("article", { class: joinClassNames("rb-article", props.class, props.className), children: props.children });
40
+ const article = /* @__PURE__ */ jsx2("article", { class: joinClassNames("rb-article", props.class, props.className), children: props.children });
20
41
  if (!props.post) return article;
21
- return /* @__PURE__ */ jsx(ArticleProvider, { entry: props.entry, post: props.post, children: article });
42
+ return /* @__PURE__ */ jsx2(ArticleProvider, { entry: props.entry, post: props.post, body: props.body, children: article });
22
43
  }
23
44
  function ArticleLayout(props) {
24
- return /* @__PURE__ */ jsx(
45
+ return /* @__PURE__ */ jsx2(
25
46
  "div",
26
47
  {
27
48
  class: joinClassNames("rb-article-layout", props.class, props.className),
@@ -36,7 +57,7 @@ function ArticleHeader(props) {
36
57
  props.className
37
58
  );
38
59
  if (props.dangerouslySetInnerHTML !== void 0) {
39
- return /* @__PURE__ */ jsx(
60
+ return /* @__PURE__ */ jsx2(
40
61
  "header",
41
62
  {
42
63
  class: className,
@@ -44,10 +65,10 @@ function ArticleHeader(props) {
44
65
  }
45
66
  );
46
67
  }
47
- return /* @__PURE__ */ jsx("header", { class: className, children: props.children });
68
+ return /* @__PURE__ */ jsx2("header", { class: className, children: props.children });
48
69
  }
49
70
  function ArticleMeta(props) {
50
- return /* @__PURE__ */ jsx(
71
+ return /* @__PURE__ */ jsx2(
51
72
  "aside",
52
73
  {
53
74
  class: joinClassNames("rb-article-meta", props.class, props.className),
@@ -62,16 +83,26 @@ function ArticleContent(props) {
62
83
  props.class,
63
84
  props.className
64
85
  );
65
- return /* @__PURE__ */ jsx("div", { class: className, children: props.children });
66
- }
67
- function HtmlFragment(props) {
68
- return raw(props.html);
86
+ return /* @__PURE__ */ jsx2("div", { class: className, children: props.children });
69
87
  }
70
88
  function ArticleBody(props) {
71
89
  const article = useArticleContext();
90
+ if (article?.body !== void 0) {
91
+ return /* @__PURE__ */ jsx2(
92
+ "div",
93
+ {
94
+ class: joinClassNames(
95
+ "rb-article-content",
96
+ props.class,
97
+ props.className
98
+ ),
99
+ children: article.body
100
+ }
101
+ );
102
+ }
72
103
  const html = props.html ?? article?.post.html;
73
104
  if (html === void 0) return null;
74
- return /* @__PURE__ */ jsx(
105
+ return /* @__PURE__ */ jsx2(
75
106
  "div",
76
107
  {
77
108
  class: joinClassNames("rb-article-content", props.class, props.className),
@@ -79,17 +110,8 @@ function ArticleBody(props) {
79
110
  }
80
111
  );
81
112
  }
82
- function PageBody(props) {
83
- return /* @__PURE__ */ jsx(
84
- "div",
85
- {
86
- class: joinClassNames("rb-page-body", props.class, props.className),
87
- dangerouslySetInnerHTML: { __html: props.html }
88
- }
89
- );
90
- }
91
113
  function ArticleFooter(props) {
92
- return /* @__PURE__ */ jsx(
114
+ return /* @__PURE__ */ jsx2(
93
115
  "footer",
94
116
  {
95
117
  class: joinClassNames("rb-article-footer", props.class, props.className),
@@ -98,7 +120,7 @@ function ArticleFooter(props) {
98
120
  );
99
121
  }
100
122
  function Sidebar(props) {
101
- return /* @__PURE__ */ jsx(
123
+ return /* @__PURE__ */ jsx2(
102
124
  "aside",
103
125
  {
104
126
  class: joinClassNames("rb-sidebar", props.class, props.className),
@@ -107,23 +129,15 @@ function Sidebar(props) {
107
129
  }
108
130
  );
109
131
  }
110
- function themeRootAttributes(theme) {
111
- return {
112
- ...theme.settings.attributes,
113
- "data-rb-theme": theme.name,
114
- "data-rb-mode": theme.colorMode === "system" ? void 0 : theme.colorMode,
115
- "data-rb-layout": theme.layout
116
- };
117
- }
118
- function ThemeRoot(props) {
119
- const site = useSiteContext();
120
- const theme = props.theme ?? site?.config.theme;
121
- const lang = props.lang ?? site?.language ?? site?.config.site.locale;
122
- if (!theme) return /* @__PURE__ */ jsx("html", { lang, children: props.children });
123
- return /* @__PURE__ */ jsx("html", { lang, ...themeRootAttributes(theme), children: props.children });
124
- }
132
+
133
+ // src/ui/primitives_head.tsx
134
+ import { escapeScriptJson } from "@riebeckite/core";
135
+ import { ColorModeScript } from "@riebeckite/plugin-color-mode";
136
+ import { Link, Script } from "honox/server";
137
+ import { Fragment, jsx as jsx3, jsxs } from "hono/jsx/jsx-runtime";
138
+ import { createElement } from "hono/jsx";
125
139
  function PluginHeadTags(props) {
126
- return /* @__PURE__ */ jsx(Fragment, { children: props.tags?.map(renderPluginHeadTag) });
140
+ return /* @__PURE__ */ jsx3(Fragment, { children: props.tags?.map(renderPluginHeadTag) });
127
141
  }
128
142
  function renderPluginHeadTag(tag, index) {
129
143
  const key = `${tag.tag}-${index}`;
@@ -155,9 +169,9 @@ function RiebeckiteHead(props) {
155
169
  const clientSrc = props.clientSrc === void 0 ? "/app/client.ts" : props.clientSrc;
156
170
  const colorModeScript = props.colorModeScript ?? true;
157
171
  return /* @__PURE__ */ jsxs(Fragment, { children: [
158
- /* @__PURE__ */ jsx("meta", { charset: "utf-8" }),
159
- /* @__PURE__ */ jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1.0" }),
160
- props.seo ? /* @__PURE__ */ jsx(
172
+ /* @__PURE__ */ jsx3("meta", { charset: "utf-8" }),
173
+ /* @__PURE__ */ jsx3("meta", { name: "viewport", content: "width=device-width, initial-scale=1.0" }),
174
+ props.seo ? /* @__PURE__ */ jsx3(
161
175
  SeoHead,
162
176
  {
163
177
  seo: props.seo,
@@ -166,14 +180,14 @@ function RiebeckiteHead(props) {
166
180
  ogLocale: ogLocale(site?.config.site.locale),
167
181
  twitterSite: site?.config.site.twitterSite
168
182
  }
169
- ) : /* @__PURE__ */ jsx("title", { children: props.title ?? site?.config.site.title }),
170
- faviconHref ? /* @__PURE__ */ jsx("link", { rel: "icon", href: faviconHref }) : null,
171
- colorModeScript ? /* @__PURE__ */ jsx(ColorModeScript, {}) : null,
172
- stylesheets.map((href) => /* @__PURE__ */ jsx(Link, { href, rel: "stylesheet", prod: props.prod }, href)),
173
- props.themeStyle ? /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: props.themeStyle } }) : null,
174
- props.themeStylesheets?.map((href) => /* @__PURE__ */ jsx(Link, { href, rel: "stylesheet", prod: props.prod }, href)),
175
- /* @__PURE__ */ jsx(PluginHeadTags, { tags: props.headTags ?? site?.headTags }),
176
- clientSrc ? /* @__PURE__ */ jsx(Script, { src: clientSrc, async: true, prod: props.prod }) : null,
183
+ ) : /* @__PURE__ */ jsx3("title", { children: props.title ?? site?.config.site.title }),
184
+ faviconHref ? /* @__PURE__ */ jsx3("link", { rel: "icon", href: faviconHref }) : null,
185
+ colorModeScript ? /* @__PURE__ */ jsx3(ColorModeScript, {}) : null,
186
+ stylesheets.map((href) => /* @__PURE__ */ jsx3(Link, { href, rel: "stylesheet", prod: props.prod }, href)),
187
+ props.themeStyle ? /* @__PURE__ */ jsx3("style", { dangerouslySetInnerHTML: { __html: props.themeStyle } }) : null,
188
+ props.themeStylesheets?.map((href) => /* @__PURE__ */ jsx3(Link, { href, rel: "stylesheet", prod: props.prod }, href)),
189
+ /* @__PURE__ */ jsx3(PluginHeadTags, { tags: props.headTags ?? site?.headTags }),
190
+ clientSrc ? /* @__PURE__ */ jsx3(Script, { src: clientSrc, async: true, prod: props.prod }) : null,
177
191
  props.children
178
192
  ] });
179
193
  }
@@ -187,7 +201,7 @@ function SeoHead(props) {
187
201
  const { seo } = props;
188
202
  const twitterCard = seo.imageUrl ? "summary_large_image" : "summary";
189
203
  return /* @__PURE__ */ jsxs(Fragment, { children: [
190
- /* @__PURE__ */ jsx(
204
+ /* @__PURE__ */ jsx3(
191
205
  "meta",
192
206
  {
193
207
  name: "description",
@@ -195,7 +209,7 @@ function SeoHead(props) {
195
209
  "data-riebeckite-head": "page"
196
210
  }
197
211
  ),
198
- props.author ? /* @__PURE__ */ jsx(
212
+ props.author ? /* @__PURE__ */ jsx3(
199
213
  "meta",
200
214
  {
201
215
  name: "author",
@@ -203,7 +217,7 @@ function SeoHead(props) {
203
217
  "data-riebeckite-head": "page"
204
218
  }
205
219
  ) : null,
206
- seo.noindex ? /* @__PURE__ */ jsx(
220
+ seo.noindex ? /* @__PURE__ */ jsx3(
207
221
  "meta",
208
222
  {
209
223
  name: "robots",
@@ -211,8 +225,8 @@ function SeoHead(props) {
211
225
  "data-riebeckite-head": "page"
212
226
  }
213
227
  ) : null,
214
- /* @__PURE__ */ jsx("title", { children: seo.title }),
215
- seo.canonicalUrl ? /* @__PURE__ */ jsx(
228
+ /* @__PURE__ */ jsx3("title", { children: seo.title }),
229
+ seo.canonicalUrl ? /* @__PURE__ */ jsx3(
216
230
  "link",
217
231
  {
218
232
  rel: "canonical",
@@ -220,7 +234,7 @@ function SeoHead(props) {
220
234
  "data-riebeckite-head": "page"
221
235
  }
222
236
  ) : null,
223
- /* @__PURE__ */ jsx(
237
+ /* @__PURE__ */ jsx3(
224
238
  "meta",
225
239
  {
226
240
  property: "og:title",
@@ -228,7 +242,7 @@ function SeoHead(props) {
228
242
  "data-riebeckite-head": "page"
229
243
  }
230
244
  ),
231
- /* @__PURE__ */ jsx(
245
+ /* @__PURE__ */ jsx3(
232
246
  "meta",
233
247
  {
234
248
  property: "og:description",
@@ -236,8 +250,8 @@ function SeoHead(props) {
236
250
  "data-riebeckite-head": "page"
237
251
  }
238
252
  ),
239
- /* @__PURE__ */ jsx("meta", { property: "og:type", content: seo.type, "data-riebeckite-head": "page" }),
240
- seo.canonicalUrl ? /* @__PURE__ */ jsx(
253
+ /* @__PURE__ */ jsx3("meta", { property: "og:type", content: seo.type, "data-riebeckite-head": "page" }),
254
+ seo.canonicalUrl ? /* @__PURE__ */ jsx3(
241
255
  "meta",
242
256
  {
243
257
  property: "og:url",
@@ -245,7 +259,7 @@ function SeoHead(props) {
245
259
  "data-riebeckite-head": "page"
246
260
  }
247
261
  ) : null,
248
- /* @__PURE__ */ jsx(
262
+ /* @__PURE__ */ jsx3(
249
263
  "meta",
250
264
  {
251
265
  property: "og:site_name",
@@ -253,7 +267,7 @@ function SeoHead(props) {
253
267
  "data-riebeckite-head": "page"
254
268
  }
255
269
  ),
256
- props.ogLocale ? /* @__PURE__ */ jsx(
270
+ props.ogLocale ? /* @__PURE__ */ jsx3(
257
271
  "meta",
258
272
  {
259
273
  property: "og:locale",
@@ -261,7 +275,7 @@ function SeoHead(props) {
261
275
  "data-riebeckite-head": "page"
262
276
  }
263
277
  ) : null,
264
- props.ogAlternates?.map((locale) => /* @__PURE__ */ jsx(
278
+ props.ogAlternates?.map((locale) => /* @__PURE__ */ jsx3(
265
279
  "meta",
266
280
  {
267
281
  property: "og:locale:alternate",
@@ -270,7 +284,7 @@ function SeoHead(props) {
270
284
  },
271
285
  locale
272
286
  )),
273
- seo.imageUrl ? /* @__PURE__ */ jsx(
287
+ seo.imageUrl ? /* @__PURE__ */ jsx3(
274
288
  "meta",
275
289
  {
276
290
  property: "og:image",
@@ -278,7 +292,7 @@ function SeoHead(props) {
278
292
  "data-riebeckite-head": "page"
279
293
  }
280
294
  ) : null,
281
- seo.publishedTime ? /* @__PURE__ */ jsx(
295
+ seo.publishedTime ? /* @__PURE__ */ jsx3(
282
296
  "meta",
283
297
  {
284
298
  property: "article:published_time",
@@ -286,7 +300,7 @@ function SeoHead(props) {
286
300
  "data-riebeckite-head": "page"
287
301
  }
288
302
  ) : null,
289
- seo.modifiedTime ? /* @__PURE__ */ jsx(
303
+ seo.modifiedTime ? /* @__PURE__ */ jsx3(
290
304
  "meta",
291
305
  {
292
306
  property: "article:modified_time",
@@ -294,7 +308,7 @@ function SeoHead(props) {
294
308
  "data-riebeckite-head": "page"
295
309
  }
296
310
  ) : null,
297
- seo.tags.map((tag) => /* @__PURE__ */ jsx(
311
+ seo.tags.map((tag) => /* @__PURE__ */ jsx3(
298
312
  "meta",
299
313
  {
300
314
  property: "article:tag",
@@ -303,7 +317,7 @@ function SeoHead(props) {
303
317
  },
304
318
  tag
305
319
  )),
306
- /* @__PURE__ */ jsx(
320
+ /* @__PURE__ */ jsx3(
307
321
  "meta",
308
322
  {
309
323
  name: "twitter:card",
@@ -311,7 +325,7 @@ function SeoHead(props) {
311
325
  "data-riebeckite-head": "page"
312
326
  }
313
327
  ),
314
- /* @__PURE__ */ jsx(
328
+ /* @__PURE__ */ jsx3(
315
329
  "meta",
316
330
  {
317
331
  name: "twitter:title",
@@ -319,7 +333,7 @@ function SeoHead(props) {
319
333
  "data-riebeckite-head": "page"
320
334
  }
321
335
  ),
322
- /* @__PURE__ */ jsx(
336
+ /* @__PURE__ */ jsx3(
323
337
  "meta",
324
338
  {
325
339
  name: "twitter:description",
@@ -327,7 +341,7 @@ function SeoHead(props) {
327
341
  "data-riebeckite-head": "page"
328
342
  }
329
343
  ),
330
- props.twitterSite ? /* @__PURE__ */ jsx(
344
+ props.twitterSite ? /* @__PURE__ */ jsx3(
331
345
  "meta",
332
346
  {
333
347
  name: "twitter:site",
@@ -335,7 +349,7 @@ function SeoHead(props) {
335
349
  "data-riebeckite-head": "page"
336
350
  }
337
351
  ) : null,
338
- seo.imageUrl ? /* @__PURE__ */ jsx(
352
+ seo.imageUrl ? /* @__PURE__ */ jsx3(
339
353
  "meta",
340
354
  {
341
355
  name: "twitter:image",
@@ -343,7 +357,7 @@ function SeoHead(props) {
343
357
  "data-riebeckite-head": "page"
344
358
  }
345
359
  ) : null,
346
- props.feedLinks?.map((feed) => /* @__PURE__ */ jsx(
360
+ props.feedLinks?.map((feed) => /* @__PURE__ */ jsx3(
347
361
  "link",
348
362
  {
349
363
  rel: "alternate",
@@ -353,7 +367,7 @@ function SeoHead(props) {
353
367
  },
354
368
  feed.href
355
369
  )),
356
- seo.jsonLd ? /* @__PURE__ */ jsx(
370
+ seo.jsonLd ? /* @__PURE__ */ jsx3(
357
371
  "script",
358
372
  {
359
373
  type: "application/ld+json",
@@ -365,14 +379,22 @@ function SeoHead(props) {
365
379
  ) : null
366
380
  ] });
367
381
  }
368
- function getThemeStyle(theme) {
369
- return theme.settings.style;
370
- }
371
- function getThemeStylesheets(stylesheets) {
372
- return uniqueStrings([...stylesheets]);
382
+
383
+ // src/ui/primitives_page.tsx
384
+ import { raw } from "hono/html";
385
+ import { jsx as jsx4 } from "hono/jsx/jsx-runtime";
386
+ function HtmlFragment(props) {
387
+ return raw(props.html);
373
388
  }
374
- function joinClassNames(...classNames) {
375
- return classNames.filter(Boolean).join(" ");
389
+ function PageBody(props) {
390
+ return /* @__PURE__ */ jsx4(
391
+ "div",
392
+ {
393
+ class: joinClassNames("rb-page-body", props.class, props.className),
394
+ "data-rb-page-layout": props.layout ?? "wide",
395
+ dangerouslySetInnerHTML: { __html: props.html }
396
+ }
397
+ );
376
398
  }
377
399
  export {
378
400
  Article,
@@ -0,0 +1,9 @@
1
+ import type { ArticleBodyProps, ArticleContentProps, ArticleFooterProps, ArticleHeaderProps, ArticleLayoutProps, ArticleMetaProps, ArticleProps, SidebarProps } from "./primitives_types.js";
2
+ export declare function Article(props: ArticleProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
3
+ export declare function ArticleLayout(props: ArticleLayoutProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
4
+ export declare function ArticleHeader(props: ArticleHeaderProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
5
+ export declare function ArticleMeta(props: ArticleMetaProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
6
+ export declare function ArticleContent(props: ArticleContentProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
7
+ export declare function ArticleBody(props: ArticleBodyProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
8
+ export declare function ArticleFooter(props: ArticleFooterProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
9
+ export declare function Sidebar(props: SidebarProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { type PluginHeadTag } from "@riebeckite/core";
2
+ import type { PluginHeadTagsProps, RiebeckiteHeadProps, SeoHeadProps } from "./primitives_types.js";
3
+ export declare function PluginHeadTags(props: PluginHeadTagsProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
4
+ export declare function renderPluginHeadTag(tag: PluginHeadTag, index: number): import("hono/jsx/jsx-dev-runtime").JSX.Element;
5
+ export declare function isDataScript(tag: PluginHeadTag): boolean;
6
+ export declare function RiebeckiteHead(props: RiebeckiteHeadProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
7
+ export declare function ogLocale(locale: string | undefined): string | undefined;
8
+ export declare function SeoHead(props: SeoHeadProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import type { HtmlFragmentProps, PageBodyProps } from "./primitives_types.js";
2
+ export declare function HtmlFragment(props: HtmlFragmentProps): import("hono/utils/html").HtmlEscapedString;
3
+ export declare function PageBody(props: PageBodyProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type ResolvedRiebeckiteConfig } from "@riebeckite/core";
2
+ import type { ThemeRootProps } from "./primitives_types.js";
3
+ export declare function themeRootAttributes(theme: ResolvedRiebeckiteConfig["theme"]): Record<string, string | undefined>;
4
+ export declare function ThemeRoot(props: ThemeRootProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
5
+ export declare function getThemeStyle(theme: ResolvedRiebeckiteConfig["theme"]): string;
6
+ export declare function getThemeStylesheets(stylesheets: readonly string[]): string[];
7
+ export declare function joinClassNames(...classNames: Array<string | undefined>): string;
@@ -0,0 +1,82 @@
1
+ import type { PluginHeadTag, PluginPageLayout, PostContent, PublicContentEntry, ResolvedRiebeckiteConfig, SeoMetadata } from "@riebeckite/core";
2
+ import type { Child } from "hono/jsx";
3
+ export type PrimitiveChildren = unknown;
4
+ export type PrimitiveProps = {
5
+ children?: PrimitiveChildren;
6
+ class?: string;
7
+ className?: string;
8
+ };
9
+ export type PrimitiveClassProps = {
10
+ class?: string;
11
+ className?: string;
12
+ };
13
+ export type ArticleProps = PrimitiveProps & {
14
+ post?: PostContent;
15
+ entry?: PublicContentEntry;
16
+ body?: Child;
17
+ };
18
+ export type ArticleLayoutProps = PrimitiveProps;
19
+ export type ArticleHeaderProps = (PrimitiveClassProps & {
20
+ dangerouslySetInnerHTML: {
21
+ __html: string;
22
+ };
23
+ children?: never;
24
+ }) | (PrimitiveClassProps & {
25
+ dangerouslySetInnerHTML?: never;
26
+ children?: PrimitiveChildren;
27
+ });
28
+ export type ArticleContentProps = PrimitiveClassProps & {
29
+ children?: PrimitiveChildren;
30
+ };
31
+ export type ArticleMetaProps = PrimitiveProps & {
32
+ label?: string;
33
+ };
34
+ export type SidebarProps = PrimitiveProps & {
35
+ label?: string;
36
+ };
37
+ export type ArticleFooterProps = PrimitiveProps;
38
+ export type ArticleBodyProps = PrimitiveClassProps & {
39
+ html?: string;
40
+ };
41
+ export type HtmlFragmentSource = "markdown" | "plugin-page";
42
+ export type HtmlFragmentProps = {
43
+ html: string;
44
+ source: HtmlFragmentSource;
45
+ };
46
+ export type PageBodyProps = PrimitiveClassProps & {
47
+ html: string;
48
+ layout?: PluginPageLayout;
49
+ };
50
+ export type ThemeRootProps = {
51
+ theme?: ResolvedRiebeckiteConfig["theme"];
52
+ lang?: string;
53
+ children?: PrimitiveChildren;
54
+ };
55
+ export type PluginHeadTagsProps = {
56
+ tags?: readonly PluginHeadTag[];
57
+ };
58
+ export type RiebeckiteHeadProps = {
59
+ title?: string;
60
+ seo?: SeoMetadata;
61
+ headTags?: readonly PluginHeadTag[];
62
+ faviconHref?: string | null;
63
+ colorModeScript?: boolean;
64
+ stylesheets?: readonly string[];
65
+ themeStyle?: string;
66
+ themeStylesheets?: readonly string[];
67
+ clientSrc?: string | null;
68
+ prod?: boolean;
69
+ children?: PrimitiveChildren;
70
+ };
71
+ export type SeoHeadProps = {
72
+ seo: SeoMetadata;
73
+ siteTitle: string;
74
+ author?: string;
75
+ ogLocale?: string;
76
+ ogAlternates?: readonly string[];
77
+ twitterSite?: string;
78
+ feedLinks?: readonly {
79
+ href: string;
80
+ type: string;
81
+ }[];
82
+ };
@@ -0,0 +1,4 @@
1
+ declare module "virtual:riebeckite/content-renderers" {
2
+ import type { Child } from "hono/jsx";
3
+ function renderContent(sourcePath: string): Child | undefined;
4
+ }
@@ -1,19 +1,12 @@
1
- import type { Plugin } from "vite";
1
+ import { type Plugin } from "vite";
2
2
  import type { RiebeckiteSsgOptions } from "./ssg_plugin.js";
3
+ import { type RiebeckiteIntegrationOptions } from "./vite_plugin_helpers.js";
3
4
  import { type ResolvedHonoxApplication } from "./vite_runner.js";
4
- export type RiebeckiteIntegrationOptions = {
5
- configRoot?: string;
6
- workspaceRoot?: string;
7
- appRoot?: string;
8
- configFile?: string;
9
- bridgeToken?: string;
10
- };
11
5
  /**
12
6
  * SSR externals Riebeckite's own runtime requires the application to leave
13
7
  * external. These are internal to the integration: sites should not have to
14
8
  * restate the Vite `environments.ssr.resolve.external` list.
15
9
  */
16
- export declare const defaultSsrExternals: readonly ["hono", "hono/html", "hono/jsx", "hono/jsx/jsx-runtime", "extend", "debug", "node:fs/promises", "node:path", "parse-numeric-range", "slugify", "vfile-matter", "yaml"];
17
10
  export type RiebeckiteViteOptions = RiebeckiteIntegrationOptions & {
18
11
  /** Extra SSR externals appended after Riebeckite's defaults. */
19
12
  ssrExternals?: readonly string[];
@@ -31,3 +24,5 @@ export declare function riebeckite(options?: RiebeckiteIntegrationOptions, onApp
31
24
  * available for callers that need the lower-level pieces.
32
25
  */
33
26
  export declare function riebeckiteVite(options?: RiebeckiteViteOptions): Plugin[];
27
+ export type { RiebeckiteIntegrationOptions } from "./vite_plugin_helpers.js";
28
+ export { defaultSsrExternals } from "./vite_plugin_helpers.js";
@@ -0,0 +1,12 @@
1
+ export type RiebeckiteIntegrationOptions = {
2
+ configRoot?: string;
3
+ workspaceRoot?: string;
4
+ appRoot?: string;
5
+ configFile?: string;
6
+ bridgeToken?: string;
7
+ };
8
+ export declare const defaultSsrExternals: readonly ["hono", "hono/html", "hono/jsx", "hono/jsx/jsx-runtime", "extend", "debug", "node:fs/promises", "node:path", "parse-numeric-range", "slugify", "vfile-matter", "yaml"];
9
+ export declare function isBareImport(source: string): boolean;
10
+ export declare function isInDirectory(filePath: string, directory: string): boolean;
11
+ export declare function callPluginHook(hook: unknown, context: unknown, ...arguments_: unknown[]): Promise<unknown>;
12
+ export declare function callPluginHookSynchronously(hook: unknown, context: unknown): unknown;
@@ -1,40 +1,7 @@
1
- import type { ResolvedRiebeckiteConfig, Tracer } from "@riebeckite/core";
2
- import { type RiebeckiteConfigLoaderOptions } from "./config_loader.js";
3
- type HonoxApplicationOptions = {
4
- root: string;
5
- tracer?: Tracer;
6
- server?: {
7
- host?: string;
8
- open?: boolean;
9
- port?: number;
10
- };
11
- onServerReady?: (urls: readonly string[]) => void | Promise<void>;
12
- onRestart?: () => void | Promise<void>;
13
- restartOnChange?: readonly string[];
14
- reuseClientBuild?: boolean;
15
- bridgeToken?: string;
16
- outputDirectory?: string;
17
- };
18
- export type ResolvedHonoxApplication = {
19
- config: ResolvedRiebeckiteConfig;
20
- configRoot: string;
21
- configFile: string;
22
- appRoot: string;
23
- contentRoot: string;
24
- };
25
- export type ResolveHonoxApplicationOptions = RiebeckiteConfigLoaderOptions & {
26
- appRoot?: string;
27
- startDirectory?: string;
28
- };
1
+ import { type HonoxApplicationOptions, type ResolvedHonoxApplication, type ResolveHonoxApplicationOptions } from "./vite_runner_helpers.js";
29
2
  export declare function resolveHonoxApplicationRoot(configRoot: string, startDirectory?: string): Promise<string>;
30
- export declare class HonoxApplicationRootError extends Error {
31
- constructor(message: string);
32
- }
33
3
  export declare function resolveHonoxApplication(options: ResolveHonoxApplicationOptions): Promise<ResolvedHonoxApplication>;
34
4
  export declare function startHonoxDevServer(options: HonoxApplicationOptions): Promise<void>;
35
5
  export declare function buildHonoxApplication(options: HonoxApplicationOptions): Promise<void>;
36
- export declare function canReuseClientBuild(input: {
37
- readonly root: string;
38
- readonly outputDirectory: string;
39
- }): Promise<boolean>;
40
- export {};
6
+ export type { ResolvedHonoxApplication, ResolveHonoxApplicationOptions, } from "./vite_runner_helpers.js";
7
+ export { canReuseClientBuild, HonoxApplicationRootError, } from "./vite_runner_helpers.js";
@@ -0,0 +1,40 @@
1
+ import type { ResolvedRiebeckiteConfig, Tracer } from "@riebeckite/core";
2
+ import type { RiebeckiteConfigLoaderOptions } from "./config_loader.js";
3
+ export type HonoxApplicationOptions = {
4
+ root: string;
5
+ tracer?: Tracer;
6
+ server?: {
7
+ host?: string;
8
+ open?: boolean;
9
+ port?: number;
10
+ };
11
+ onServerReady?: (urls: readonly string[]) => void | Promise<void>;
12
+ onRestart?: () => void | Promise<void>;
13
+ restartOnChange?: readonly string[];
14
+ reuseClientBuild?: boolean;
15
+ bridgeToken?: string;
16
+ outputDirectory?: string;
17
+ };
18
+ export type ResolvedHonoxApplication = {
19
+ config: ResolvedRiebeckiteConfig;
20
+ configRoot: string;
21
+ configFile: string;
22
+ appRoot: string;
23
+ contentRoot: string;
24
+ };
25
+ export type ResolveHonoxApplicationOptions = RiebeckiteConfigLoaderOptions & {
26
+ appRoot?: string;
27
+ startDirectory?: string;
28
+ };
29
+ export declare const viteConfigFileNames: readonly ["vite.config.ts", "vite.config.js", "vite.config.mjs"];
30
+ export declare const ignoredApplicationRootDirectoryNames: Set<string>;
31
+ export declare class HonoxApplicationRootError extends Error {
32
+ constructor(message: string);
33
+ }
34
+ export declare function findWorkspaceRoot(configRoot: string): Promise<string | undefined>;
35
+ export declare function canReuseClientBuild(input: {
36
+ readonly root: string;
37
+ readonly outputDirectory: string;
38
+ }): Promise<boolean>;
39
+ export declare function reportSsgTimings(tracer: Tracer, metricsFile: string): Promise<void>;
40
+ export declare function withWorkingDirectory<T>(root: string, task: () => Promise<T>): Promise<T>;