boltdocs 3.2.1 → 3.3.0

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 (155) hide show
  1. package/bin/boltdocs.js +20 -1
  2. package/bin/preloader.mjs +28 -0
  3. package/dist/{adapters-ByYY44Zy.mjs → adapters-BmB4TKCc.mjs} +1 -1
  4. package/dist/{adapters-DvmtpdSF.cjs → adapters-Cp1Maurn.cjs} +1 -1
  5. package/dist/audit-CLXjMzwQ.mjs +11 -0
  6. package/dist/audit-COgjnQ5n.cjs +11 -0
  7. package/dist/build-BS2hefiL.cjs +6 -0
  8. package/dist/build-C5mNh9D-.mjs +6 -0
  9. package/dist/cache-CJE9nWLE.cjs +6 -0
  10. package/dist/cache-OY4HzIXl.mjs +6 -0
  11. package/dist/callout-oI_LCbxS.d.ts +71 -0
  12. package/dist/callout-plqx9Dw-.d.cts +71 -0
  13. package/dist/client/index.cjs +1265 -569
  14. package/dist/client/index.d.cts +3 -542
  15. package/dist/client/index.d.ts +3 -542
  16. package/dist/client/index.js +1167 -521
  17. package/dist/client/mdx.cjs +1 -1
  18. package/dist/client/mdx.d.cts +24 -2
  19. package/dist/client/mdx.d.ts +24 -2
  20. package/dist/client/mdx.js +1 -1
  21. package/dist/client/primitives.cjs +14 -4
  22. package/dist/client/primitives.d.cts +281 -38
  23. package/dist/client/primitives.d.ts +281 -38
  24. package/dist/client/primitives.js +5 -5
  25. package/dist/client/router.cjs +49 -0
  26. package/dist/client/router.d.cts +3 -0
  27. package/dist/client/router.d.ts +3 -0
  28. package/dist/client/router.js +8 -0
  29. package/dist/client/theme/reset.css +40 -4
  30. package/dist/{config-BpzaPsJj.d.cts → config-BoRlz0Ca.d.mts} +157 -14
  31. package/dist/{config-xtS0ZkMm.d.mts → config-CTsX_tGM.d.cts} +157 -14
  32. package/dist/config-Ceib-AOH.cjs +7 -0
  33. package/dist/config-DGLQsy7y.mjs +7 -0
  34. package/dist/{package-BcISI5-P.cjs → config-files-BYHDOrKn.mjs} +1 -1
  35. package/dist/config-files-D9cdBMl2.cjs +6 -0
  36. package/dist/config-jJh8WYJI.cjs +6 -0
  37. package/dist/csp-C4LmN1ko.cjs +6 -0
  38. package/dist/csp-D6JEOqKh.mjs +6 -0
  39. package/dist/dev-Ch3hEe5Y.cjs +6 -0
  40. package/dist/dev-QPNxysrd.mjs +6 -0
  41. package/dist/{docs-layout-BdtZ9z6s.js → docs-layout-CbZ7LDRe.js} +504 -249
  42. package/dist/{docs-layout-CFWI15Id.cjs → docs-layout-vzfXed1Q.cjs} +516 -254
  43. package/dist/{doctor-BBtmNJE0.cjs → doctor-B1_YL0Wt.cjs} +1 -1
  44. package/dist/doctor-C7whl4ED.cjs +6 -0
  45. package/dist/doctor-DmQnml2k.mjs +6 -0
  46. package/dist/{generator-COepVWGi.cjs → generator-BlW45ST7.cjs} +5 -3
  47. package/dist/{generator-CcOBN5vI.mjs → generator-BwknNejd.mjs} +5 -3
  48. package/dist/{handler-XX7cLTqe.cjs → handler-CDEoKARD.cjs} +2 -2
  49. package/dist/{handler-DzQae4eA.mjs → handler-D7UyZlPm.mjs} +2 -2
  50. package/dist/{image-Bz87fCla.js → image-B-NDSDuY.js} +129 -11
  51. package/dist/{image-C4TlpMHn.cjs → image-Hnaa2bJd.cjs} +175 -9
  52. package/dist/index-C56bL-A-.d.cts +1344 -0
  53. package/dist/{sidebar-COTaMHR-.d.ts → index-CPUUKzxD.d.cts} +344 -327
  54. package/dist/{sidebar-CrEdJuHX.d.cts → index-Ci4kfOHF.d.ts} +344 -327
  55. package/dist/index-Cu9H6CRa.d.ts +1344 -0
  56. package/dist/link-CgdI6O2o.js +872 -0
  57. package/dist/{link-D1Gjkb-2.cjs → link-vZjmD-es.cjs} +406 -223
  58. package/dist/{mdx-BuO6a1f7.js → mdx-BRT71V5Q.js} +211 -168
  59. package/dist/{mdx-CD-tSjRG.cjs → mdx-D0Absdq5.cjs} +225 -169
  60. package/dist/native-BNCY7PRF.cjs +6 -0
  61. package/dist/native-Di9Fnfrv.mjs +6 -0
  62. package/dist/native-Kre2T5eS.cjs +6 -0
  63. package/dist/node/cache.cjs +1 -1
  64. package/dist/node/cache.d.cts +19 -3
  65. package/dist/node/cache.d.mts +19 -3
  66. package/dist/node/cache.mjs +1 -1
  67. package/dist/node/cli-entry.cjs +1 -9
  68. package/dist/node/cli-entry.mjs +1 -9
  69. package/dist/node/index.cjs +1 -1
  70. package/dist/node/index.d.cts +245 -17
  71. package/dist/node/index.d.mts +246 -18
  72. package/dist/node/index.mjs +1 -1
  73. package/dist/node/mdx/shiki-adapter.cjs +1 -1
  74. package/dist/node/mdx/shiki-adapter.d.cts +24 -3
  75. package/dist/node/mdx/shiki-adapter.d.mts +24 -2
  76. package/dist/node/mdx/shiki-adapter.mjs +1 -1
  77. package/dist/node-Du5UL5wo.mjs +23 -0
  78. package/dist/node-DunuGqyp.cjs +23 -0
  79. package/dist/{package-CCYEAYeA.mjs → package-DA848keM.mjs} +1 -1
  80. package/dist/package-wplzySjz.cjs +6 -0
  81. package/dist/pages-external-BBw8ObVK.mjs +6 -0
  82. package/dist/pages-external-DPiPFxxP.cjs +6 -0
  83. package/dist/parser-BqTOsEUa.cjs +6 -0
  84. package/dist/parser-CGMY2lJ7.mjs +6 -0
  85. package/dist/plugin-BcTzvHAJ.mjs +69 -0
  86. package/dist/plugin-TulVMt1z.cjs +69 -0
  87. package/dist/plugin-context-C-l90hFt.cjs +15 -0
  88. package/dist/plugin-context-wqHNSZum.mjs +15 -0
  89. package/dist/plugin-lifecycle-B1BzSHdn.cjs +6 -0
  90. package/dist/resolve-B7vWOd8R.cjs +6 -0
  91. package/dist/resolve-C2kKnk_5.mjs +6 -0
  92. package/dist/resolve-It1Iug83.cjs +6 -0
  93. package/dist/resolve-YdTrt_FG.mjs +6 -0
  94. package/dist/router-C3kygdRK.cjs +1285 -0
  95. package/dist/router-CZBxMRAH.js +987 -0
  96. package/dist/routes-BL4y79tb.mjs +6 -0
  97. package/dist/routes-C2nPecwu.cjs +6 -0
  98. package/dist/routes-U9L8psZ9.cjs +6 -0
  99. package/dist/{search-dialog-DHqwjJuG.cjs → search-dialog-BCOHQGSt.cjs} +1 -1
  100. package/dist/search-dialog-Bp_P1MPP.js +481 -0
  101. package/dist/{search-dialog-DFnlx8LO.js → search-dialog-BqkzDTq2.js} +107 -57
  102. package/dist/{search-dialog-BRFno7HD.cjs → search-dialog-CIeIUhAn.cjs} +218 -43
  103. package/dist/{search-dialog-D6TvjcuV.js → search-dialog-DtmxmfEu.js} +1 -1
  104. package/dist/{search-dialog-B1NERUNx.cjs → search-dialog-x_qHU8ty.cjs} +107 -58
  105. package/dist/server/index.cjs +1 -1
  106. package/dist/server/index.d.mts +1 -1
  107. package/dist/server/index.mjs +1 -1
  108. package/dist/update-check-BKqmYfwT.cjs +11 -0
  109. package/dist/update-check-QnrVR3q1.mjs +11 -0
  110. package/dist/utils-8lzafE49.mjs +7 -0
  111. package/dist/utils-ej6_SjIZ.cjs +7 -0
  112. package/dist/virtual-modules-Ca5tHk1X.cjs +30 -0
  113. package/dist/virtual-modules-Dlgt1fP0.mjs +30 -0
  114. package/package.json +18 -16
  115. package/src/shared/mdx-path.ts +12 -0
  116. package/src/shared/structured-data.ts +145 -0
  117. package/src/shared/types.ts +220 -16
  118. package/dist/banner-BMop1KLF.d.ts +0 -100
  119. package/dist/banner-CVD0GugR.d.cts +0 -100
  120. package/dist/cache-CO4Dy2uQ.cjs +0 -6
  121. package/dist/cache-Dk53iOo6.mjs +0 -6
  122. package/dist/config-CCXp3aXO.mjs +0 -7
  123. package/dist/config-CMd4XoFq.cjs +0 -6
  124. package/dist/config-DlGoEM9D.cjs +0 -7
  125. package/dist/csp-CRp_3U7a.cjs +0 -6
  126. package/dist/csp-oTC2ygvF.mjs +0 -6
  127. package/dist/doctor-Bv16QSrI.cjs +0 -7
  128. package/dist/doctor-DOAbSaiL.mjs +0 -7
  129. package/dist/headers-Ddwek8K7.mjs +0 -6
  130. package/dist/headers-dg4SDrjY.cjs +0 -6
  131. package/dist/link-2PzgTnaP.js +0 -673
  132. package/dist/meta-loader-C4Hu9RN9.mjs +0 -6
  133. package/dist/meta-loader-Dq1zcFnh.cjs +0 -6
  134. package/dist/node-BXtqM1uH.mjs +0 -6
  135. package/dist/node-BlVk4EVg.cjs +0 -104
  136. package/dist/node-DOf4zhWc.mjs +0 -104
  137. package/dist/node-aD1eisrR.cjs +0 -6
  138. package/dist/pages-external-BYa4JSda.mjs +0 -6
  139. package/dist/pages-external-XkYIs-d5.cjs +0 -6
  140. package/dist/parser-DCiEWkSk.cjs +0 -8
  141. package/dist/parser-qk9FIHJ7.mjs +0 -8
  142. package/dist/plugin-C95kvu6h.mjs +0 -73
  143. package/dist/plugin-DM3u2bVj.cjs +0 -73
  144. package/dist/routes-BW6zsk7Z.mjs +0 -6
  145. package/dist/routes-BgoIB5wb.cjs +0 -6
  146. package/dist/routes-CORVxc02.cjs +0 -6
  147. package/dist/search-dialog-BmxHiKwt.js +0 -312
  148. package/dist/shiki-adapter-CoQ6jyJ4.cjs +0 -6
  149. package/dist/shiki-adapter-D-aKw7PP.mjs +0 -6
  150. package/dist/utils-Crm9oPcV.mjs +0 -7
  151. package/dist/utils-D6Xtj0FZ.cjs +0 -7
  152. /package/dist/{errors-0zGHRLue.mjs → errors-N-b6Sn2G.mjs} +0 -0
  153. /package/dist/{index-1KsTDq4o.d.mts → index-lFoyzCXy.d.mts} +0 -0
  154. /package/dist/{types-generator-BXhv7Ill.cjs → types-generator-DDSA93P3.cjs} +0 -0
  155. /package/dist/{types-generator-bDPvUztF.mjs → types-generator-DG1GX1EZ.mjs} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "boltdocs",
3
- "version": "3.2.1",
3
+ "version": "3.3.0",
4
4
  "description": "A lightweight documentation generator for React projects.",
5
5
  "main": "dist/node/index.mjs",
6
6
  "module": "dist/node/index.mjs",
@@ -42,6 +42,11 @@
42
42
  "import": "./dist/client/index.js",
43
43
  "require": "./dist/client/index.cjs"
44
44
  },
45
+ "./client/router": {
46
+ "types": "./dist/client/router.d.ts",
47
+ "import": "./dist/client/router.js",
48
+ "require": "./dist/client/router.cjs"
49
+ },
45
50
  "./primitives": {
46
51
  "types": "./dist/client/primitives.d.ts",
47
52
  "import": "./dist/client/primitives.js",
@@ -74,8 +79,7 @@
74
79
  "author": "Jesus Alcala",
75
80
  "license": "MIT",
76
81
  "dependencies": {
77
- "@bdocs/dui": "^0.3.0",
78
- "@mdx-js/rollup": "3.1.1",
82
+ "@bdocs/dui": "^0.6.0",
79
83
  "@shikijs/engine-oniguruma": "3.23.0",
80
84
  "@shikijs/langs": "3.23.0",
81
85
  "@shikijs/themes": "3.23.0",
@@ -88,28 +92,26 @@
88
92
  "flexsearch": "0.8.212",
89
93
  "github-slugger": "2.0.0",
90
94
  "isomorphic-dompurify": "3.7.1",
95
+ "jiti": "^2.7.0",
91
96
  "lru-cache": "^11.3.6",
92
97
  "picomatch": "^4.0.4",
93
- "semver": "^7.7.4",
94
98
  "react-helmet-async": "^2.0.1",
95
- "react-router-dom": "^7.0.0",
96
- "rehype-slug": "6.0.0",
97
- "remark-frontmatter": "5.0.0",
98
- "remark-gfm": "4.0.1",
99
99
  "scroll-into-view-if-needed": "3.1.0",
100
+ "semver": "^7.7.4",
100
101
  "shiki": "3.23.0",
101
102
  "tailwind-merge": "3.5.0",
102
- "vite": "7.0.0 || 8.0.0",
103
+ "vite": "8.1.5",
103
104
  "zod": "4.3.6",
104
- "@bdocs/parser": "1.1.0",
105
- "@bdocs/plugin-image-optimizer": "0.2.1",
106
- "@bdocs/ssg": "0.3.0",
107
- "@bdocs/unist-utils": "0.2.0"
105
+ "@bdocs/parser": "1.2.0",
106
+ "@bdocs/plugin-image-optimizer": "0.2.2",
107
+ "@bdocs/unist-utils": "0.2.0",
108
+ "@bdocs/ssg": "0.4.0",
109
+ "@bdocs/processor-satteri": "0.3.0"
108
110
  },
109
111
  "peerDependencies": {
110
112
  "react": "19.0.0",
111
- "react-dom": "19.0.0",
112
- "react-aria-components": "^1.16.0"
113
+ "react-aria-components": "^1.16.0",
114
+ "react-dom": "19.0.0"
113
115
  },
114
116
  "devDependencies": {
115
117
  "@netlify/functions": "^5.3.0",
@@ -128,7 +130,7 @@
128
130
  "tsdown": "0.21.7",
129
131
  "typescript": "5.9.3",
130
132
  "vitest": "^3.0.0",
131
- "@bdocs/processor-satteri": "0.2.0"
133
+ "tsdown-config": "1.0.0"
132
134
  },
133
135
  "scripts": {
134
136
  "build": "tsdown --config-loader unrun",
@@ -0,0 +1,12 @@
1
+ export function normalizeMdxPath(value: string): string {
2
+ return value.replace(/\\/g, '/').replace(/^\/+/, '')
3
+ }
4
+
5
+ export function matchesMdxUpdatePath(
6
+ routeFilePath: string,
7
+ updateRelativePath: string,
8
+ ): boolean {
9
+ return (
10
+ normalizeMdxPath(routeFilePath) === normalizeMdxPath(updateRelativePath)
11
+ )
12
+ }
@@ -0,0 +1,145 @@
1
+ import type { JsonLdObject, StructuredData } from './types'
2
+
3
+ export interface WebSiteStructuredDataOptions {
4
+ name: string
5
+ url: string
6
+ description?: string
7
+ searchUrl?: string
8
+ }
9
+
10
+ export interface ArticleStructuredDataOptions {
11
+ headline: string
12
+ url: string
13
+ description?: string
14
+ datePublished?: string | Date
15
+ dateModified?: string | Date
16
+ image?: string
17
+ author?: string | { name: string; url?: string }
18
+ }
19
+
20
+ export interface BreadcrumbStructuredDataItem {
21
+ name: string
22
+ url: string
23
+ }
24
+
25
+ export interface StructuredDataFactoryOptions {
26
+ /** A WebSite graph for the global site identity. */
27
+ website?: WebSiteStructuredDataOptions
28
+ /** An Article graph for the current page or release post. */
29
+ article?: ArticleStructuredDataOptions
30
+ /** A BreadcrumbList graph for the current page hierarchy. */
31
+ breadcrumbs?: BreadcrumbStructuredDataItem[]
32
+ /** Additional graph nodes for schema types not covered by the presets. */
33
+ additional?: JsonLdObject | JsonLdObject[]
34
+ }
35
+
36
+ /** Preserve literal JSON-LD types in config files and frontmatter helpers. */
37
+ export function defineStructuredData<T extends StructuredData>(data: T): T {
38
+ return data
39
+ }
40
+
41
+ /**
42
+ * Creates one JSON-LD value from the common website/article/breadcrumb presets.
43
+ * Single-node input returns an object; multiple nodes return a graph array.
44
+ */
45
+ export function createStructuredData(
46
+ options: StructuredDataFactoryOptions,
47
+ ): StructuredData {
48
+ const nodes: JsonLdObject[] = []
49
+
50
+ if (options.website) {
51
+ nodes.push(createWebSiteStructuredData(options.website))
52
+ }
53
+ if (options.article) {
54
+ nodes.push(createArticleStructuredData(options.article))
55
+ }
56
+ if (options.breadcrumbs?.length) {
57
+ nodes.push(createBreadcrumbStructuredData(options.breadcrumbs))
58
+ }
59
+ if (options.additional) {
60
+ nodes.push(
61
+ ...(Array.isArray(options.additional)
62
+ ? options.additional
63
+ : [options.additional]),
64
+ )
65
+ }
66
+
67
+ if (nodes.length === 0) {
68
+ throw new Error(
69
+ 'createStructuredData() requires at least one of website, article, breadcrumbs, or additional',
70
+ )
71
+ }
72
+
73
+ return nodes.length === 1 ? nodes[0] : nodes
74
+ }
75
+
76
+ export function createWebSiteStructuredData(
77
+ options: WebSiteStructuredDataOptions,
78
+ ): JsonLdObject {
79
+ const data: JsonLdObject = {
80
+ '@context': 'https://schema.org',
81
+ '@type': 'WebSite',
82
+ name: options.name,
83
+ url: options.url,
84
+ }
85
+
86
+ if (options.description) data.description = options.description
87
+ if (options.searchUrl) {
88
+ data.potentialAction = {
89
+ '@type': 'SearchAction',
90
+ target: `${options.searchUrl}{search_term_string}`,
91
+ 'query-input': 'required name=search_term_string',
92
+ }
93
+ }
94
+
95
+ return data
96
+ }
97
+
98
+ function toIsoDate(value: string | Date, field: string): string {
99
+ const date = new Date(value)
100
+ if (Number.isNaN(date.getTime())) {
101
+ throw new TypeError(`Invalid ${field} value: ${String(value)}`)
102
+ }
103
+ return date.toISOString()
104
+ }
105
+
106
+ export function createArticleStructuredData(
107
+ options: ArticleStructuredDataOptions,
108
+ ): JsonLdObject {
109
+ const data: JsonLdObject = {
110
+ '@context': 'https://schema.org',
111
+ '@type': 'Article',
112
+ headline: options.headline,
113
+ url: options.url,
114
+ }
115
+
116
+ if (options.description) data.description = options.description
117
+ if (options.datePublished)
118
+ data.datePublished = toIsoDate(options.datePublished, 'datePublished')
119
+ if (options.dateModified)
120
+ data.dateModified = toIsoDate(options.dateModified, 'dateModified')
121
+ if (options.image) data.image = options.image
122
+ if (options.author) {
123
+ data.author =
124
+ typeof options.author === 'string'
125
+ ? { '@type': 'Person', name: options.author }
126
+ : { '@type': 'Person', ...options.author }
127
+ }
128
+
129
+ return data
130
+ }
131
+
132
+ export function createBreadcrumbStructuredData(
133
+ items: BreadcrumbStructuredDataItem[],
134
+ ): JsonLdObject {
135
+ return {
136
+ '@context': 'https://schema.org',
137
+ '@type': 'BreadcrumbList',
138
+ itemListElement: items.map((item, index) => ({
139
+ '@type': 'ListItem',
140
+ position: index + 1,
141
+ name: item.name,
142
+ item: item.url,
143
+ })),
144
+ }
145
+ }
@@ -1,4 +1,4 @@
1
- import type { Plugin as VitePlugin } from 'vite'
1
+ import type { AliasOptions, Plugin as VitePlugin, UserConfig } from 'vite'
2
2
  import type { ComponentType } from 'react'
3
3
 
4
4
  /**
@@ -59,7 +59,7 @@ export interface RouteMeta {
59
59
  /** The raw markdown content of the page */
60
60
  _rawContent?: string
61
61
  /** Extracted SEO and Open Graph metadata from frontmatter */
62
- seo?: Record<string, any>
62
+ seo?: Record<string, unknown>
63
63
  /** The publication date */
64
64
  date?: string | Date
65
65
  /** The last updated timestamp or date */
@@ -73,7 +73,7 @@ export interface RouteMeta {
73
73
  /** Whether the page is hidden from the sidebar */
74
74
  sidebarHidden?: boolean
75
75
  /** Raw extensible frontmatter data for custom components and formatters */
76
- frontmatter?: Record<string, any>
76
+ frontmatter?: Record<string, unknown>
77
77
  /** Optional recursive child routes for deep sidebar hierarchies */
78
78
  subRoutes?: RouteMeta[]
79
79
  /** Clean URL segments stripped of locale/version prefixes */
@@ -580,15 +580,153 @@ export type PluginServerMiddleware = (
580
580
  next: (err?: unknown) => void,
581
581
  ) => void | Promise<void>
582
582
 
583
+ /**
584
+ * Public API surface of the core plugin lifecycle manager.
585
+ *
586
+ * This is exposed as an interface so that plugin authors and internal
587
+ * subsystems can receive a reference to the lifecycle manager without
588
+ * pulling in the concrete class (which has private members and is not
589
+ * stable across source/dist boundaries during development).
590
+ */
591
+ export interface IPluginLifecycleManager {
592
+ runHook(
593
+ hookName: keyof PluginLifecycleHooks,
594
+ ...args: unknown[]
595
+ ): Promise<void>
596
+ runChain<TParams extends Record<string, unknown>>(
597
+ hookName: keyof PluginLifecycleHooks,
598
+ initialParams: TParams,
599
+ ): Promise<TParams>
600
+ runMiddlewareChain<TParams extends Record<string, unknown>>(
601
+ hookName: 'transformSource' | 'transformMdx' | 'transformHtml',
602
+ initialParams: TParams,
603
+ ): Promise<TParams>
604
+ hasHook(
605
+ hookName:
606
+ | keyof PluginLifecycleHooks
607
+ | 'transformSource'
608
+ | 'transformMdx'
609
+ | 'transformHtml',
610
+ ): boolean
611
+ }
612
+
613
+ /**
614
+ * Standardized Search Document contract passed to search plugins.
615
+ */
616
+ export interface SearchDocument {
617
+ id: string
618
+ path: string
619
+ title: string
620
+ content: string
621
+ headings: Array<{ level: number; text: string; id: string }>
622
+ frontmatter: Record<string, unknown>
623
+ locale?: string
624
+ version?: string
625
+ }
626
+
627
+ /**
628
+ * Agnostic UI slots for component injection.
629
+ */
630
+ export type BoltdocsUiSlot =
631
+ | 'search:dialog'
632
+ | 'header:left'
633
+ | 'header:right'
634
+ | 'sidebar:top'
635
+ | 'sidebar:bottom'
636
+ | 'page:before'
637
+ | 'page:after'
638
+ | (string & {})
639
+
640
+ export interface PluginHeadEntry {
641
+ tag: 'script' | 'link' | 'meta' | 'style'
642
+ attrs?: Record<string, string | boolean>
643
+ content?: string
644
+ }
645
+
646
+ /**
647
+ * Client-side configuration and UI slot injections for plugins.
648
+ */
649
+ export interface PluginClientConfig {
650
+ /** Dynamic UI slot registrations (mapped to component file paths) */
651
+ slots?: Record<string, string>
652
+ /** Top-level React provider component file paths */
653
+ providers?: string[]
654
+ /** MDX component overrides & additions */
655
+ mdxComponents?: Record<string, string>
656
+ /** Head elements to inject into rendered HTML */
657
+ head?: PluginHeadEntry[]
658
+ }
659
+
583
660
  /**
584
661
  * Plugin lifecycle hooks with full type safety.
585
662
  */
586
663
  export interface PluginLifecycleHooks {
664
+ /** Build hooks (Astro-style) */
665
+ 'build:before'?: (ctx: PluginContext) => Promise<void> | void
666
+ 'build:after'?: (ctx: PluginContext) => Promise<void> | void
667
+ 'build:end'?: (ctx: PluginContext) => Promise<void> | void
668
+ 'build:generate'?: (
669
+ ctx: PluginContext,
670
+ params: { routes: RouteMeta[]; outDir: string; siteUrl?: string },
671
+ ) => void | Promise<void>
672
+
673
+ /** Dev hooks (Astro-style) */
674
+ 'dev:before'?: (ctx: PluginContext) => Promise<void> | void
675
+ 'dev:after'?: (ctx: PluginContext) => Promise<void> | void
676
+
677
+ /** Transform hooks (Astro-style) */
678
+ 'transform:source'?: (
679
+ ctx: PluginContext,
680
+ params: TransformSourceParams,
681
+ ) =>
682
+ | TransformResult<{ code: string }>
683
+ | Promise<TransformResult<{ code: string }>>
684
+ 'transform:mdx'?: (
685
+ ctx: PluginContext,
686
+ params: TransformSourceParams,
687
+ ) =>
688
+ | TransformResult<{ code: string }>
689
+ | Promise<TransformResult<{ code: string }>>
690
+ 'transform:html'?: (
691
+ ctx: PluginContext,
692
+ params: TransformHtmlParams,
693
+ ) =>
694
+ | TransformResult<{ html: string }>
695
+ | Promise<TransformResult<{ html: string }>>
696
+
697
+ /** Dynamic frontmatter transformation hook */
698
+ 'frontmatter:transform'?: (
699
+ ctx: PluginContext,
700
+ params: {
701
+ frontmatter: Record<string, unknown>
702
+ filePath: string
703
+ rawContent: string
704
+ },
705
+ ) => Record<string, unknown> | Promise<Record<string, unknown>> | undefined
706
+
707
+ /** Fired after routes are crawled, normalized, and resolved */
708
+ 'routes:resolved'?: (
709
+ ctx: PluginContext,
710
+ params: { routes: RouteMeta[] },
711
+ ) => RouteMeta[] | Promise<RouteMeta[]> | undefined
712
+
713
+ /** Agnostic search index hook: core passes SearchDocument[], plugin returns index payload */
714
+ 'search:index'?: (
715
+ ctx: PluginContext,
716
+ params: { documents: SearchDocument[]; routes: RouteMeta[] },
717
+ ) => unknown | Promise<unknown>
718
+
719
+ 'server:configure'?: (
720
+ ctx: PluginContext,
721
+ params: { server: unknown; middleware: PluginServerAPI },
722
+ ) => void | Promise<void>
723
+
724
+ /** Legacy alias hooks for backwards compatibility */
587
725
  beforeBuild?: (ctx: PluginContext) => Promise<void> | void
588
726
  afterBuild?: (ctx: PluginContext) => Promise<void> | void
727
+ buildEnd?: (ctx: PluginContext) => Promise<void> | void
589
728
  beforeDev?: (ctx: PluginContext) => Promise<void> | void
590
729
  afterDev?: (ctx: PluginContext) => Promise<void> | void
591
- buildEnd?: (ctx: PluginContext) => Promise<void> | void
592
730
  transformSource?: (
593
731
  ctx: PluginContext,
594
732
  params: TransformSourceParams,
@@ -614,15 +752,22 @@ export interface PluginLifecycleHooks {
614
752
  * When `processor` is set to 'satteri', the Sätteri Rust-based compiler is used.
615
753
  */
616
754
  export interface BoltdocsMdxConfig {
617
- processor?: 'unified' | 'satteri'
755
+ processor?: 'satteri'
618
756
  }
619
757
 
620
758
  /**
621
759
  * Defines a Boltdocs plugin.
622
760
  *
623
- * Use the `createPlugin()` helper from the node API for full type safety and
624
- * access to lifecycle hooks.
761
+ * Use the `definePlugin()` or `createPlugin()` helper from the node API for full
762
+ * type safety and access to lifecycle hooks.
625
763
  */
764
+ export interface PluginCssConfig {
765
+ cssFiles?: string[]
766
+ headStyles?: string[]
767
+ postcssPlugins?: unknown[]
768
+ preprocessorOptions?: Record<string, unknown>
769
+ }
770
+
626
771
  export interface BoltdocsPlugin {
627
772
  name: string
628
773
  enforce?: 'pre' | 'post'
@@ -632,11 +777,10 @@ export interface BoltdocsPlugin {
632
777
  rehypePlugins?: unknown[]
633
778
  vitePlugins?: VitePlugin[]
634
779
  components?: Record<string, string>
635
- /** Optional runtime metadata exposed to client via useConfig().plugins[].metadata */
780
+ client?: PluginClientConfig
636
781
  metadata?: Record<string, unknown>
637
- /** Declarative transform middleware entries. */
782
+ css?: PluginCssConfig
638
783
  middleware?: PluginTransformMiddleware[]
639
- /** Lifecycle hooks with full type safety */
640
784
  hooks?: PluginLifecycleHooks
641
785
  }
642
786
 
@@ -666,6 +810,13 @@ export interface BoltdocsVerificationConfig {
666
810
  /**
667
811
  * Configuration for SEO.
668
812
  */
813
+ export type JsonLdPrimitive = string | number | boolean | null
814
+ export type JsonLdValue = JsonLdPrimitive | JsonLdObject | JsonLdValue[]
815
+ export interface JsonLdObject {
816
+ [key: string]: JsonLdValue | undefined
817
+ }
818
+ export type StructuredData = JsonLdObject | JsonLdObject[]
819
+
669
820
  export interface BoltdocsSeoConfig {
670
821
  metatags?: Record<string, string>
671
822
  indexing?: 'all' | 'public'
@@ -673,6 +824,37 @@ export interface BoltdocsSeoConfig {
673
824
  background?: string
674
825
  }
675
826
  verification?: BoltdocsVerificationConfig
827
+ /** Global JSON-LD graph emitted in every page head. */
828
+ structuredData?: StructuredData
829
+ }
830
+
831
+ export interface BoltdocsViewTransitionsConfig {
832
+ /** Native document transitions are enabled when true. */
833
+ enabled?: boolean
834
+ /** Optional transition types passed to `document.startViewTransition`. */
835
+ types?: string[]
836
+ }
837
+
838
+ export interface BoltdocsExperimentalConfig {
839
+ /** Enables the native View Transition API integration. */
840
+ viewTransitions?: boolean | BoltdocsViewTransitionsConfig
841
+ /** Enables static file-routing under `docs/pages-external/`. */
842
+ fileRouting?: boolean
843
+ }
844
+
845
+ export type ExperimentalViewTransitions =
846
+ | boolean
847
+ | BoltdocsViewTransitionsConfig
848
+
849
+ export interface ExternalFileRoute {
850
+ path: string
851
+ filePath: string
852
+ kind: 'component' | 'mdx'
853
+ /**
854
+ * Locale the file provides, derived from a `pages-external/{locale}/`
855
+ * directory. Absent for default-locale files.
856
+ */
857
+ locale?: string
676
858
  }
677
859
 
678
860
  /**
@@ -770,6 +952,14 @@ export interface BoltdocsIntegrationsConfig {
770
952
  }
771
953
  }
772
954
 
955
+ /**
956
+ * Configuration for static site generation.
957
+ */
958
+ export interface BoltdocsSsgConfig {
959
+ /** Critical CSS strategy; `none` disables critical CSS processing. */
960
+ criticalCss?: 'zig-critters' | 'beasties' | 'none'
961
+ }
962
+
773
963
  /**
774
964
  * Configuration for drafts visibility control.
775
965
  */
@@ -791,6 +981,7 @@ export interface BoltdocsConfig {
791
981
  i18n?: BoltdocsI18nConfig
792
982
  versions?: BoltdocsVersionsConfig
793
983
  mdx?: BoltdocsMdxConfig
984
+ ssg?: BoltdocsSsgConfig
794
985
  plugins?: BoltdocsPlugin[]
795
986
  collections?: BoltdocsCollectionsConfig
796
987
  robots?: BoltdocsRobotsConfig
@@ -799,8 +990,10 @@ export interface BoltdocsConfig {
799
990
  integrations?: BoltdocsIntegrationsConfig
800
991
  drafts?: BoltdocsDraftsConfig
801
992
  featureFlags?: Record<string, boolean | string>
993
+ experimental?: BoltdocsExperimentalConfig
802
994
  directoryMeta?: Record<string, unknown>
803
- vite?: unknown
995
+ aliases?: AliasOptions
996
+ vite?: UserConfig
804
997
  }
805
998
 
806
999
  /**
@@ -824,9 +1017,20 @@ export type BoltdocsTypes = Boltdocs.Types
824
1017
 
825
1018
  export type BoltdocsRoutePath = keyof Boltdocs.RoutePaths
826
1019
 
827
- export type BoltdocsRoutePathWithFallback = BoltdocsRoutePath extends never
828
- ? string
829
- : BoltdocsRoutePath
1020
+ export type ExternalRouteReference =
1021
+ | `/${string}`
1022
+ | `#${string}`
1023
+ | `?${string}`
1024
+ | `site:/${string}`
1025
+ | `site:${string}`
1026
+ | `http://${string}`
1027
+ | `https://${string}`
1028
+ | `//${string}`
1029
+
1030
+ export type BoltdocsRoutePathWithFallback =
1031
+ | BoltdocsRoutePath
1032
+ | ExternalRouteReference
1033
+ | string
830
1034
 
831
1035
  export type BoltdocsLocale = Boltdocs.Types extends { Locale: infer L }
832
1036
  ? L
@@ -849,6 +1053,6 @@ export type BoltdocsMdxComponents = Boltdocs.Types extends {
849
1053
  MdxComponents: infer M
850
1054
  }
851
1055
  ? TransformMdxComponents<UnpackMdxComponents<M>>
852
- : Omit<Record<string, ComponentType<any>>, 'Frontmatter'> & {
853
- Frontmatter: Record<string, ComponentType<any>>
1056
+ : Omit<Record<string, ComponentType<unknown>>, 'Frontmatter'> & {
1057
+ Frontmatter: Record<string, ComponentType<unknown>>
854
1058
  }
@@ -1,100 +0,0 @@
1
-
2
- import { T as BoltdocsConfig, a as SidebarItem, d as SidebarMobile, f as SidebarRoot, i as SidebarHeader, l as SidebarLink, n as SidebarContent, p as SidebarSubGroup, r as SidebarGroup, s as SidebarItems, v as ComponentRoute, x as OnThisPageProps } from "./sidebar-COTaMHR-.js";
3
- import { ReactNode } from "react";
4
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
5
-
6
- //#region src/client/components/ui-base/navbar.d.ts
7
- declare function Navbar(): _$react_jsx_runtime0.JSX.Element;
8
- //#endregion
9
- //#region src/client/components/ui-base/sidebar.d.ts
10
- interface SidebarProps {
11
- routes: ComponentRoute[];
12
- config: BoltdocsConfig;
13
- }
14
- declare function SidebarMain({
15
- routes,
16
- config
17
- }: SidebarProps): _$react_jsx_runtime0.JSX.Element;
18
- declare const Sidebar: typeof SidebarMain & {
19
- Root: typeof SidebarRoot;
20
- Mobile: typeof SidebarMobile;
21
- Header: typeof SidebarHeader;
22
- Content: typeof SidebarContent;
23
- Group: typeof SidebarGroup;
24
- Link: typeof SidebarLink;
25
- SubGroup: typeof SidebarSubGroup;
26
- Item: typeof SidebarItem;
27
- Items: typeof SidebarItems;
28
- };
29
- //#endregion
30
- //#region src/client/components/ui-base/on-this-page.d.ts
31
- declare function OnThisPage({
32
- headings,
33
- editLink,
34
- communityHelp,
35
- filePath
36
- }: OnThisPageProps): _$react_jsx_runtime0.JSX.Element;
37
- //#endregion
38
- //#region src/client/components/ui-base/breadcrumbs.d.ts
39
- declare function Breadcrumbs(): _$react_jsx_runtime0.JSX.Element | null;
40
- //#endregion
41
- //#region src/client/components/ui-base/page-nav.d.ts
42
- /**
43
- * Component to display the previous and next page navigation buttons.
44
- * Enhanced with subtle entrance animations, modern card layout, and hover highlights.
45
- */
46
- declare function PageNav(): _$react_jsx_runtime0.JSX.Element | null;
47
- //#endregion
48
- //#region src/client/components/ui-base/error-boundary.d.ts
49
- interface ErrorBoundaryProps {
50
- children?: ReactNode;
51
- fallback?: ReactNode;
52
- }
53
- declare function ErrorBoundary({
54
- children,
55
- fallback
56
- }: ErrorBoundaryProps): _$react_jsx_runtime0.JSX.Element;
57
- //#endregion
58
- //#region src/client/components/ui-base/copy-markdown.d.ts
59
- interface CopyMarkdownProps {
60
- content?: string;
61
- mdxRaw?: string;
62
- route?: ComponentRoute;
63
- }
64
- declare function CopyMarkdown({
65
- content,
66
- mdxRaw
67
- }: CopyMarkdownProps): _$react_jsx_runtime0.JSX.Element | null;
68
- //#endregion
69
- //#region src/client/components/ui-base/search-dialog.d.ts
70
- declare function SearchDialog({
71
- routes
72
- }: {
73
- routes: ComponentRoute[];
74
- }): _$react_jsx_runtime0.JSX.Element;
75
- //#endregion
76
- //#region src/client/components/ui-base/not-found.d.ts
77
- declare function NotFound(): _$react_jsx_runtime0.JSX.Element;
78
- //#endregion
79
- //#region src/client/components/ui-base/banner.d.ts
80
- interface BannerProps extends React.HTMLAttributes<HTMLDivElement> {
81
- /**
82
- * If true, shows a close button to dismiss the banner.
83
- */
84
- dismissible?: boolean;
85
- /**
86
- * Unique identifier for the banner. If provided and dismissible is true,
87
- * the dismissed state will be saved in localStorage so it doesn't reappear
88
- * on subsequent visits.
89
- */
90
- id?: string;
91
- }
92
- declare function Banner({
93
- children,
94
- className,
95
- dismissible,
96
- id,
97
- ...props
98
- }: BannerProps): _$react_jsx_runtime0.JSX.Element | null;
99
- //#endregion
100
- export { ErrorBoundary as a, OnThisPage as c, CopyMarkdown as i, Sidebar as l, NotFound as n, PageNav as o, SearchDialog as r, Breadcrumbs as s, Banner as t, Navbar as u };