boltdocs 2.5.5 → 2.6.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 (166) hide show
  1. package/bin/boltdocs.js +2 -2
  2. package/dist/client/index.cjs +6 -0
  3. package/dist/client/index.d.cts +1560 -0
  4. package/dist/client/index.d.ts +1219 -922
  5. package/dist/client/index.js +6 -1
  6. package/dist/client/theme/neutral.css +428 -0
  7. package/dist/node/cli-entry.cjs +8 -0
  8. package/dist/node/cli-entry.d.cts +2 -0
  9. package/dist/node/cli-entry.d.mts +2 -1
  10. package/dist/node/cli-entry.mjs +7 -5
  11. package/dist/node/index.cjs +6 -0
  12. package/dist/node/index.d.cts +519 -0
  13. package/dist/node/index.d.mts +374 -422
  14. package/dist/node/index.mjs +6 -1
  15. package/dist/node-BgvNl2Ay.mjs +89 -0
  16. package/dist/node-vkbb0MK7.cjs +89 -0
  17. package/dist/package-CR0HF9x3.mjs +6 -0
  18. package/dist/package-Dgmsc_l5.cjs +6 -0
  19. package/dist/search-dialog-3lvKsbVG.js +6 -0
  20. package/dist/search-dialog-DMK5OpgH.cjs +6 -0
  21. package/dist/use-search-C9bxCqfF.js +6 -0
  22. package/dist/use-search-DcfZSunO.cjs +6 -0
  23. package/package.json +26 -25
  24. package/src/client/app/config-context.tsx +38 -5
  25. package/src/client/app/doc-page.tsx +34 -0
  26. package/src/client/app/mdx-component.tsx +2 -3
  27. package/src/client/app/mdx-components-context.tsx +27 -2
  28. package/src/client/app/routes-context.tsx +34 -0
  29. package/src/client/app/scroll-handler.tsx +7 -4
  30. package/src/client/app/theme-context.tsx +71 -67
  31. package/src/client/components/default-layout.tsx +34 -33
  32. package/src/client/components/docs-layout.tsx +1 -2
  33. package/src/client/components/icons-dev.tsx +36 -5
  34. package/src/client/components/mdx/admonition.tsx +11 -27
  35. package/src/client/components/mdx/badge.tsx +1 -1
  36. package/src/client/components/mdx/button.tsx +3 -3
  37. package/src/client/components/mdx/card.tsx +1 -1
  38. package/src/client/components/mdx/code-block.tsx +90 -80
  39. package/src/client/components/mdx/component-preview.tsx +1 -5
  40. package/src/client/components/mdx/component-props.tsx +1 -1
  41. package/src/client/components/mdx/field.tsx +4 -5
  42. package/src/client/components/mdx/file-tree.tsx +6 -3
  43. package/src/client/components/mdx/hooks/use-code-block.ts +2 -2
  44. package/src/client/components/mdx/image.tsx +1 -1
  45. package/src/client/components/mdx/link.tsx +2 -2
  46. package/src/client/components/mdx/list.tsx +1 -1
  47. package/src/client/components/mdx/table.tsx +1 -1
  48. package/src/client/components/mdx/tabs.tsx +1 -1
  49. package/src/client/components/primitives/breadcrumbs.tsx +1 -7
  50. package/src/client/components/primitives/button-group.tsx +1 -1
  51. package/src/client/components/primitives/button.tsx +1 -1
  52. package/src/client/components/primitives/code-block.tsx +113 -0
  53. package/src/client/components/primitives/link.tsx +23 -41
  54. package/src/client/components/primitives/menu.tsx +5 -6
  55. package/src/client/components/primitives/navbar.tsx +6 -18
  56. package/src/client/components/primitives/navigation-menu.tsx +4 -4
  57. package/src/client/components/primitives/on-this-page.tsx +6 -10
  58. package/src/client/components/primitives/page-nav.tsx +4 -9
  59. package/src/client/components/primitives/popover.tsx +1 -1
  60. package/src/client/components/primitives/search-dialog.tsx +3 -6
  61. package/src/client/components/primitives/sidebar.tsx +80 -22
  62. package/src/client/components/primitives/skeleton.tsx +1 -1
  63. package/src/client/components/primitives/tabs.tsx +4 -11
  64. package/src/client/components/primitives/tooltip.tsx +3 -3
  65. package/src/client/components/ui-base/breadcrumbs.tsx +4 -6
  66. package/src/client/components/ui-base/copy-markdown.tsx +2 -7
  67. package/src/client/components/ui-base/github-stars.tsx +2 -2
  68. package/src/client/components/ui-base/head.tsx +58 -51
  69. package/src/client/components/ui-base/loading.tsx +2 -2
  70. package/src/client/components/ui-base/navbar.tsx +12 -14
  71. package/src/client/components/ui-base/not-found.tsx +1 -1
  72. package/src/client/components/ui-base/on-this-page.tsx +6 -6
  73. package/src/client/components/ui-base/page-nav.tsx +4 -8
  74. package/src/client/components/ui-base/search-dialog.tsx +10 -8
  75. package/src/client/components/ui-base/sidebar.tsx +76 -23
  76. package/src/client/components/ui-base/tabs.tsx +9 -8
  77. package/src/client/components/ui-base/theme-toggle.tsx +2 -2
  78. package/src/client/hooks/use-i18n.ts +3 -3
  79. package/src/client/hooks/use-localized-to.ts +1 -1
  80. package/src/client/hooks/use-navbar.ts +8 -6
  81. package/src/client/hooks/use-routes.ts +19 -11
  82. package/src/client/hooks/use-search.ts +1 -1
  83. package/src/client/hooks/use-sidebar.ts +48 -2
  84. package/src/client/hooks/use-tabs.ts +6 -2
  85. package/src/client/hooks/use-version.ts +3 -3
  86. package/src/client/index.ts +22 -22
  87. package/src/client/ssg/boltdocs-shell.tsx +127 -0
  88. package/src/client/ssg/create-routes.tsx +179 -0
  89. package/src/client/ssg/index.ts +3 -0
  90. package/src/client/ssg/mdx-page.tsx +37 -0
  91. package/src/client/store/boltdocs-context.tsx +66 -0
  92. package/src/client/theme/neutral.css +90 -50
  93. package/src/client/types.ts +5 -33
  94. package/src/client/utils/react-to-text.ts +34 -0
  95. package/CHANGELOG.md +0 -98
  96. package/dist/cache-3FOEPC2P.mjs +0 -1
  97. package/dist/chunk-5B5NKOW6.mjs +0 -77
  98. package/dist/chunk-J2PTDWZM.mjs +0 -1
  99. package/dist/chunk-TP5KMRD3.mjs +0 -1
  100. package/dist/chunk-Y4RE5KI7.mjs +0 -1
  101. package/dist/client/index.d.mts +0 -1263
  102. package/dist/client/index.mjs +0 -1
  103. package/dist/client/ssr.d.mts +0 -78
  104. package/dist/client/ssr.d.ts +0 -78
  105. package/dist/client/ssr.js +0 -1
  106. package/dist/client/ssr.mjs +0 -1
  107. package/dist/node/cli-entry.d.ts +0 -1
  108. package/dist/node/cli-entry.js +0 -82
  109. package/dist/node/index.d.ts +0 -567
  110. package/dist/node/index.js +0 -77
  111. package/dist/package-QFIAETHR.mjs +0 -1
  112. package/dist/search-dialog-O6VLVSOA.mjs +0 -1
  113. package/src/client/app/index.tsx +0 -345
  114. package/src/client/app/mdx-page.tsx +0 -15
  115. package/src/client/app/preload.tsx +0 -66
  116. package/src/client/app/router.tsx +0 -30
  117. package/src/client/integrations/codesandbox.ts +0 -179
  118. package/src/client/integrations/index.ts +0 -1
  119. package/src/client/ssr.tsx +0 -65
  120. package/src/client/store/use-boltdocs-store.ts +0 -44
  121. package/src/node/cache.ts +0 -408
  122. package/src/node/cli/build.ts +0 -53
  123. package/src/node/cli/dev.ts +0 -22
  124. package/src/node/cli/doctor.ts +0 -243
  125. package/src/node/cli/index.ts +0 -9
  126. package/src/node/cli/ui.ts +0 -54
  127. package/src/node/cli-entry.ts +0 -24
  128. package/src/node/config.ts +0 -382
  129. package/src/node/errors.ts +0 -44
  130. package/src/node/index.ts +0 -84
  131. package/src/node/mdx/cache.ts +0 -12
  132. package/src/node/mdx/highlighter.ts +0 -47
  133. package/src/node/mdx/index.ts +0 -122
  134. package/src/node/mdx/rehype-shiki.ts +0 -62
  135. package/src/node/mdx/remark-code-meta.ts +0 -35
  136. package/src/node/mdx/remark-shiki.ts +0 -61
  137. package/src/node/plugin/entry.ts +0 -87
  138. package/src/node/plugin/html.ts +0 -99
  139. package/src/node/plugin/index.ts +0 -478
  140. package/src/node/plugin/types.ts +0 -9
  141. package/src/node/plugins/index.ts +0 -17
  142. package/src/node/plugins/plugin-errors.ts +0 -62
  143. package/src/node/plugins/plugin-lifecycle.ts +0 -117
  144. package/src/node/plugins/plugin-sandbox.ts +0 -59
  145. package/src/node/plugins/plugin-store.ts +0 -54
  146. package/src/node/plugins/plugin-types.ts +0 -107
  147. package/src/node/plugins/plugin-validator.ts +0 -105
  148. package/src/node/routes/cache.ts +0 -28
  149. package/src/node/routes/index.ts +0 -293
  150. package/src/node/routes/parser.ts +0 -262
  151. package/src/node/routes/sorter.ts +0 -42
  152. package/src/node/routes/types.ts +0 -61
  153. package/src/node/schema/config.ts +0 -195
  154. package/src/node/schema/frontmatter.ts +0 -17
  155. package/src/node/search/index.ts +0 -55
  156. package/src/node/security/constants/index.ts +0 -10
  157. package/src/node/security/csp.ts +0 -31
  158. package/src/node/security/headers.ts +0 -27
  159. package/src/node/ssg/index.ts +0 -205
  160. package/src/node/ssg/meta.ts +0 -33
  161. package/src/node/ssg/options.ts +0 -15
  162. package/src/node/ssg/robots.ts +0 -53
  163. package/src/node/ssg/sitemap.ts +0 -55
  164. package/src/node/utils.ts +0 -349
  165. package/tsconfig.json +0 -26
  166. package/tsup.config.ts +0 -56
@@ -1,321 +1,179 @@
1
- import * as vite from 'vite';
2
- import { Plugin, InlineConfig } from 'vite';
3
- import { z } from 'zod';
4
1
 
5
- /**
6
- * Permissions that a plugin can request to access specific Boltdocs capabilities.
7
- */
8
- type PluginPermission = 'fs:read' | 'fs:write' | 'vite:config' | 'mdx:remark' | 'mdx:rehype' | 'components' | 'hooks:build' | 'hooks:dev';
9
- /**
10
- * Shared context injected into every plugin lifecycle hook.
11
- */
12
- interface PluginContext {
13
- /** The full, resolved Boltdocs configuration (Readonly) */
14
- readonly config: BoltdocsConfig;
15
- /** A plugin-specific logger */
16
- readonly logger: PluginLogger;
17
- /** A shared store for dependency injection and state sharing between plugins */
18
- readonly store: PluginStore;
19
- /** Metadata about the current plugin */
20
- readonly meta: PluginMeta;
21
- }
22
- /**
23
- * Simple logger interface for plugins.
24
- */
25
- interface PluginLogger {
26
- info(message: string): void;
27
- warn(message: string): void;
28
- error(message: string | Error): void;
29
- debug(message: string): void;
30
- }
31
- /**
32
- * A shared key-value store that allows plugins to share state and configuration.
33
- */
34
- interface PluginStore {
35
- /** Get a value from the store. Keys are namespaced by plugin internally. */
36
- get<T = unknown>(pluginName: string, key: string): T | undefined;
37
- /** Set a value in the store. */
38
- set(pluginName: string, key: string, value: unknown): void;
39
- /** Check if a key exists in the store. */
40
- has(pluginName: string, key: string): boolean;
41
- }
42
- /**
43
- * Metadata for a plugin, used for identification and compatibility checks.
44
- */
45
- interface PluginMeta {
46
- /** Unique identifier for the plugin */
47
- name: string;
48
- /** Version of the plugin itself (semver) */
49
- version?: string;
50
- /** Minimum required version of Boltdocs (semver range) */
51
- boltdocsVersion?: string;
52
- }
53
- /**
54
- * Lifecycle hooks that a plugin can implement to hook into the build and dev processes.
55
- */
56
- interface PluginLifecycleHooks {
57
- /** Called before the build process starts */
58
- beforeBuild?: (ctx: PluginContext) => Promise<void> | void;
59
- /** Called after the build process finishes successfully */
60
- afterBuild?: (ctx: PluginContext) => Promise<void> | void;
61
- /** Called before the dev server starts */
62
- beforeDev?: (ctx: PluginContext) => Promise<void> | void;
63
- /** Called after the dev server is ready (configureServer) */
64
- afterDev?: (ctx: PluginContext) => Promise<void> | void;
65
- /** Called when the final Boltdocs config is resolved */
66
- configResolved?: (ctx: PluginContext, config: BoltdocsConfig) => void;
67
- /** Called when the build is closing */
68
- buildEnd?: (ctx: PluginContext) => Promise<void> | void;
69
- }
70
- /**
71
- * The extended, secure Boltdocs plugin interface.
72
- */
73
- interface SecureBoltdocsPlugin {
74
- /** A unique name for the plugin (e.g., 'boltdocs-plugin-mermaid') */
75
- name: string;
76
- /** Whether to run this plugin before or after default ones */
77
- enforce?: 'pre' | 'post';
78
- /** Version of the plugin (optional, but recommended for security) */
79
- version?: string;
80
- /** Minimum compatible Boltdocs version (optional, semver range) */
81
- boltdocsVersion?: string;
82
- /** List of permissions this plugin requires to operate */
83
- permissions?: PluginPermission[];
84
- /** Optional remark plugins to add to the MDX pipeline (requires 'mdx:remark' permission) */
85
- remarkPlugins?: unknown[];
86
- /** Optional rehype plugins to add to the MDX pipeline (requires 'mdx:rehype' permission) */
87
- rehypePlugins?: unknown[];
88
- /** Optional Vite plugins to inject into the build process (requires 'vite:config' permission) */
89
- vitePlugins?: Plugin[];
90
- /** Optional custom React components to register in MDX. Map of Name -> Module Path. (requires 'components' permission) */
91
- components?: Record<string, string>;
92
- /** Implementation of lifecycle hooks (requires 'hooks:build' or 'hooks:dev' permissions) */
93
- hooks?: PluginLifecycleHooks;
94
- }
2
+ import * as _$vite from "vite";
3
+ import { InlineConfig, Plugin } from "vite";
4
+ import { z } from "zod";
95
5
 
6
+ //#region src/shared/types.d.ts
96
7
  /**
97
8
  * Represents a single social link in the configuration.
98
9
  */
99
10
  interface BoltdocsSocialLink {
100
- /** Identifier for the icon (e.g., 'github') */
101
- icon: 'discord' | 'x' | 'github' | 'bluesky' | string;
102
- /** The URL the social link points to */
103
- link: string;
11
+ icon: 'discord' | 'x' | 'github' | 'bluesky' | string;
12
+ link: string;
104
13
  }
105
14
  /**
106
15
  * Configuration for the site footer.
107
16
  */
108
17
  interface BoltdocsFooterConfig {
109
- /** Text to display in the footer (HTML is supported) */
110
- text?: string;
18
+ text?: string;
111
19
  }
112
20
  /**
113
- * Theme-specific configuration options governing the appearance and navigation of the site.
21
+ * Theme-specific configuration options.
114
22
  */
115
23
  interface BoltdocsThemeConfig {
116
- /** The global title of the documentation site (can be translated) */
117
- title?: string | Record<string, string>;
118
- /** The global description of the site (can be translated) */
119
- description?: string | Record<string, string>;
120
- /** URL path to the site logo or an object for light/dark versions */
121
- logo?: string | {
122
- dark: string;
123
- light: string;
124
- alt?: string;
125
- width?: number;
126
- height?: number;
127
- };
128
- /** Items to display in the top navigation bar */
129
- navbar?: Array<{
130
- /** Text to display (can be a string or a map of translations) */
131
- label: string | Record<string, string>;
132
- /** URL path or external link */
133
- href: string;
134
- }>;
135
- /** Items to display in the sidebar, organized optionally by group URLs */
136
- sidebar?: Record<string, Array<{
137
- text: string;
138
- link: string;
139
- }>>;
140
- /** Social links to display in the navigation bar */
141
- socialLinks?: BoltdocsSocialLink[];
142
- /** Site footer configuration */
143
- footer?: BoltdocsFooterConfig;
144
- /** Whether to show breadcrumbs navigation (default: true) */
145
- breadcrumbs?: boolean;
146
- /** URL template for 'Edit this page'. Use :path as a placeholder. */
147
- editLink?: string;
148
- /** URL for the 'Community help' link. */
149
- communityHelp?: string;
150
- /** The current version of the project (e.g., 'v2.8.9'). Displayed in the Navbar. */
151
- version?: string;
152
- /** The GitHub repository in the format 'owner/repo' to fetch and display star count. */
153
- githubRepo?: string;
154
- /**
155
- * URL path to the site favicon.
156
- * If not specified, the logo will be used if available.
157
- */
158
- favicon?: string;
159
- /**
160
- * The Open Graph image URL to display when the site is shared on social media.
161
- */
162
- ogImage?: string;
163
- /** Whether to show the 'Powered by LiteDocs' badge in the sidebar (default: true) */
164
- poweredBy?: boolean;
165
- /**
166
- * Top-level tabs for organizing documentation groups.
167
- * Tab discovery uses the (tab-id) directory syntax.
168
- */
169
- tabs?: Array<{
170
- id: string;
171
- /** Text to display (can be a string or a map of translations) */
172
- text: string | Record<string, string>;
173
- icon?: string;
174
- }>;
175
- /**
176
- * The syntax highlighting theme for code blocks.
177
- * Supports any Shiki theme name (e.g., 'github-dark', 'one-dark-pro', 'aurora-x').
178
- * Can also be an object for multiple themes (e.g., { light: 'github-light', dark: 'github-dark' }).
179
- * Default: { light: 'github-light', dark: 'one-dark-pro' }
180
- */
181
- codeTheme?: string | {
182
- light: string;
183
- dark: string;
184
- };
185
- /**
186
- * Configuration for the 'Copy Markdown' button.
187
- * Can be a boolean or an object with text and icon.
188
- * Default: true
189
- */
190
- copyMarkdown?: boolean | {
191
- text?: string;
192
- icon?: string;
193
- };
24
+ title?: string | Record<string, string>;
25
+ description?: string | Record<string, string>;
26
+ logo?: string | {
27
+ dark: string;
28
+ light: string;
29
+ alt?: string;
30
+ width?: number;
31
+ height?: number;
32
+ };
33
+ navbar?: Array<{
34
+ label: string | Record<string, string>;
35
+ href: string;
36
+ }>;
37
+ sidebar?: Record<string, Array<{
38
+ text: string;
39
+ link: string;
40
+ }>>;
41
+ sidebarGroups?: Record<string, {
42
+ title?: string;
43
+ icon?: string;
44
+ }>;
45
+ socialLinks?: BoltdocsSocialLink[];
46
+ footer?: BoltdocsFooterConfig;
47
+ breadcrumbs?: boolean;
48
+ editLink?: string;
49
+ communityHelp?: string;
50
+ version?: string;
51
+ githubRepo?: string;
52
+ favicon?: string;
53
+ poweredBy?: boolean;
54
+ tabs?: Array<{
55
+ id: string;
56
+ text: string | Record<string, string>;
57
+ icon?: string;
58
+ }>;
59
+ codeTheme?: ShikiTheme | {
60
+ light: ShikiTheme;
61
+ dark: ShikiTheme;
62
+ };
63
+ copyMarkdown?: boolean | {
64
+ text?: string;
65
+ icon?: string;
66
+ };
194
67
  }
68
+ /**
69
+ * List of supported syntax highlighting themes.
70
+ */
71
+ type ShikiTheme = 'github-dark' | 'github-light' | 'tokyo-night' | 'dracula' | 'nord' | 'one-dark-pro' | 'one-light';
195
72
  /**
196
73
  * Configuration for the robots.txt file.
197
74
  */
198
75
  type BoltdocsRobotsConfig = string | {
199
- /** User-agent rules */
200
- rules?: Array<{
201
- userAgent: string;
202
- /** Paths allowed to be crawled */
203
- allow?: string | string[];
204
- /** Paths disallowed to be crawled */
205
- disallow?: string | string[];
206
- }>;
207
- /** Sitemaps to include in the robots.txt */
208
- sitemaps?: string[];
76
+ rules?: Array<{
77
+ userAgent: string;
78
+ allow?: string | string[];
79
+ disallow?: string | string[];
80
+ }>;
81
+ sitemaps?: string[];
209
82
  };
210
83
  /**
211
84
  * Configuration for a specific locale.
212
85
  */
213
86
  interface BoltdocsLocaleConfig {
214
- /** The display name of the locale */
215
- label?: string;
216
- /** The text direction (ltr or rtl) */
217
- direction?: 'ltr' | 'rtl';
218
- /** The HTML lang attribute value (e.g., 'en-US') */
219
- htmlLang?: string;
220
- /** The calendar system to use (e.g., 'gregory') */
221
- calendar?: string;
87
+ label?: string;
88
+ direction?: 'ltr' | 'rtl';
89
+ htmlLang?: string;
90
+ calendar?: string;
222
91
  }
223
92
  /**
224
93
  * Configuration for internationalization (i18n).
225
94
  */
226
95
  interface BoltdocsI18nConfig {
227
- /** The default locale (e.g., 'en') */
228
- defaultLocale: string;
229
- /** Available locales and their basic display names (e.g., { en: 'English', es: 'Español' }) */
230
- locales: Record<string, string>;
231
- /** Detailed configuration for each locale */
232
- localeConfigs?: Record<string, BoltdocsLocaleConfig>;
96
+ defaultLocale: string;
97
+ locales: Record<string, string>;
98
+ localeConfigs?: Record<string, BoltdocsLocaleConfig>;
233
99
  }
234
100
  /**
235
101
  * Configuration for a specific documentation version.
236
102
  */
237
103
  interface BoltdocsVersionConfig {
238
- /** The display name of the version (e.g., 'v2.0') */
239
- label: string;
240
- /** The URL path prefix for the version (e.g., '2.0') */
241
- path: string;
104
+ label: string;
105
+ path: string;
242
106
  }
243
107
  /**
244
108
  * Configuration for documentation versioning.
245
109
  */
246
110
  interface BoltdocsVersionsConfig {
247
- /** The default version path (e.g., 'v2') */
248
- defaultVersion: string;
249
- /**
250
- * Optional prefix for all version paths (e.g., 'v').
251
- * If set to 'v', version '1.1' will be available at '/docs/v1.1'.
252
- */
253
- prefix?: string;
254
- /** Available versions configurations */
255
- versions: BoltdocsVersionConfig[];
111
+ defaultVersion: string;
112
+ prefix?: string;
113
+ versions: BoltdocsVersionConfig[];
256
114
  }
257
115
  /**
258
- * Defines a Boltdocs plugin that can extend the build process and client-side functionality.
116
+ * Defines a Boltdocs plugin.
259
117
  */
260
118
  interface BoltdocsPlugin {
261
- /** A unique name for the plugin */
262
- name: string;
263
- /** Whether to run this plugin before or after default ones (optional) */
264
- enforce?: 'pre' | 'post';
265
- /** Version of the plugin (optional) */
266
- version?: string;
267
- /** Minimum compatible Boltdocs version (optional, semver range) */
268
- boltdocsVersion?: string;
269
- /** List of permissions this plugin requires to operate */
270
- permissions?: PluginPermission[];
271
- /** Optional remark plugins to add to the MDX pipeline */
272
- remarkPlugins?: unknown[];
273
- /** Optional rehype plugins to add to the MDX pipeline */
274
- rehypePlugins?: unknown[];
275
- /** Optional Vite plugins to inject into the build process */
276
- vitePlugins?: Plugin[];
277
- /** Optional custom React components to register in MDX. Map of Name -> Module Path. */
278
- components?: Record<string, string>;
279
- /** Implementation of lifecycle hooks */
280
- hooks?: PluginLifecycleHooks;
119
+ name: string;
120
+ enforce?: 'pre' | 'post';
121
+ version?: string;
122
+ boltdocsVersion?: string;
123
+ permissions?: string[];
124
+ remarkPlugins?: unknown[];
125
+ rehypePlugins?: unknown[];
126
+ vitePlugins?: Plugin[];
127
+ components?: Record<string, string>;
128
+ hooks?: Record<string, any>;
281
129
  }
282
130
  /**
283
131
  * Configuration for security-related settings.
284
132
  */
285
133
  interface BoltdocsSecurityConfig {
286
- /** Map of standard security headers to override or supplement defaults */
287
- headers?: Record<string, string>;
288
- /** Whether to enable Content Security Policy (CSP) generation (default: false) */
289
- enableCSP?: boolean;
290
- /** Additional custom headers to inject into responses */
291
- customHeaders?: Record<string, string>;
134
+ headers?: Record<string, string>;
135
+ enableCSP?: boolean;
136
+ customHeaders?: Record<string, string>;
137
+ }
138
+ /**
139
+ * Configuration for SEO.
140
+ */
141
+ interface BoltdocsSeoConfig {
142
+ metatags?: Record<string, string>;
143
+ indexing?: 'all' | 'public';
144
+ thumbnails?: {
145
+ background?: string;
146
+ };
292
147
  }
293
148
  /**
294
149
  * The root configuration object for Boltdocs.
295
150
  */
296
151
  interface BoltdocsConfig {
297
- /** The base URL of the site, used for generating the sitemap */
298
- siteUrl?: string;
299
- /** The root directory containing markdown documentation files (default: 'docs') */
300
- docsDir?: string;
301
- /** Path to a custom HomePage component */
302
- homePage?: string;
303
- /** Configuration pertaining to the UI and appearance */
304
- theme?: BoltdocsThemeConfig;
305
- /** Configuration for internationalization */
306
- i18n?: BoltdocsI18nConfig;
307
- /** Configuration for documentation versioning */
308
- versions?: BoltdocsVersionsConfig;
309
- /** Custom plugins for extending functionality */
310
- plugins?: BoltdocsPlugin[];
311
- /** Configuration for the robots.txt file */
312
- robots?: BoltdocsRobotsConfig;
313
- /** Security-related settings and headers */
314
- security?: BoltdocsSecurityConfig;
315
- /** Low-level Vite configuration overrides */
316
- vite?: vite.InlineConfig;
152
+ siteUrl?: string;
153
+ docsDir?: string;
154
+ base?: string;
155
+ homePage?: string;
156
+ theme?: BoltdocsThemeConfig;
157
+ i18n?: BoltdocsI18nConfig;
158
+ versions?: BoltdocsVersionsConfig;
159
+ plugins?: BoltdocsPlugin[];
160
+ robots?: BoltdocsRobotsConfig;
161
+ security?: BoltdocsSecurityConfig;
162
+ seo?: BoltdocsSeoConfig;
163
+ vite?: any;
317
164
  }
165
+ //#endregion
166
+ //#region src/shared/config-utils.d.ts
167
+ /**
168
+ * Type-safe helper for defining Boltdocs configuration.
169
+ * This is an identity function that provides IntelliSense in both
170
+ * Node.js (config files) and client-side code (MDX examples).
171
+ *
172
+ * @param config - The Boltdocs configuration object
173
+ */
318
174
  declare function defineConfig(config: BoltdocsConfig): BoltdocsConfig;
175
+ //#endregion
176
+ //#region src/node/config.d.ts
319
177
  /**
320
178
  * Loads user's configuration file (e.g., `boltdocs.config.js` or `boltdocs.config.ts`) if it exists,
321
179
  * merges it with the default configuration, and returns the final `BoltdocsConfig`.
@@ -325,170 +183,260 @@ declare function defineConfig(config: BoltdocsConfig): BoltdocsConfig;
325
183
  * @returns The merged configuration object
326
184
  */
327
185
  declare function resolveConfig(docsDir: string, root?: string): Promise<BoltdocsConfig>;
328
-
186
+ //#endregion
187
+ //#region src/node/plugin/types.d.ts
329
188
  /**
330
189
  * Configuration options specifically for the Boltdocs Vite plugin.
331
190
  */
332
191
  interface BoltdocsPluginOptions {
333
- /** The root directory containing markdown files (default: 'docs') */
334
- docsDir?: string;
335
- /** Path to a custom home page component (relative to project root) to render at '/' */
336
- homePage?: string;
192
+ /** The root directory containing markdown files (default: 'docs') */
193
+ docsDir?: string;
194
+ /** Path to a custom home page component (relative to project root) to render at '/' */
195
+ homePage?: string;
337
196
  }
338
-
197
+ //#endregion
198
+ //#region src/node/plugin/entry.d.ts
339
199
  /**
340
- * Options for the Static Site Generation process.
341
- */
342
- interface SSGOptions {
343
- /** The root directory containing markdown documentation files */
344
- docsDir: string;
345
- /** The name of the documentation directory (e.g. 'docs') */
346
- docsDirName: string;
347
- /** The output directory where Vite placed the compiled `index.html` and assets */
348
- outDir: string;
349
- /** Pre-resolved config (avoids re-resolving during the SSG phase) */
350
- config?: BoltdocsConfig;
351
- }
352
-
353
- /**
354
- * Generates static HTML files and a \`sitemap.xml\` for all documentation routes.
355
- * Called automatically in the \`closeBundle\` hook of the Vite plugin during a production build.
200
+ * Generates the raw source code for the virtual entry file (`\0virtual:boltdocs-entry`).
201
+ * This code initializes the client-side React application.
356
202
  *
357
- * @param options - Configuration for paths and site metadata
203
+ * @param options - Plugin options containing potential custom overrides (like `homePage` or `customCss`)
204
+ * @param config - The resolved Boltdocs configuration containing custom plugins and components
205
+ * @returns A string of JavaScript code to be evaluated by the browser
358
206
  */
359
- declare function generateStaticPages(options: SSGOptions): Promise<void>;
360
-
207
+ declare function generateEntryCode(options: BoltdocsPluginOptions, config?: BoltdocsConfig): string;
208
+ //#endregion
209
+ //#region src/node/routes/types.d.ts
361
210
  /**
362
211
  * Metadata representing a single documentation route.
363
212
  * This information is used to build the client-side router and the sidebar navigation.
364
213
  */
365
214
  interface RouteMeta {
366
- /** The final URL path for the route (e.g., '/docs/guide/start') */
367
- path: string;
368
- /** The absolute filesystem path to the source markdown/mdx file */
369
- componentPath: string;
370
- /** The title of the page, usually extracted from frontmatter or the filename */
371
- title: string;
372
- /** The relative path from the docs directory, used for edit links */
373
- filePath: string;
374
- /** Optional description of the page (for SEO/meta tags) */
375
- description?: string;
376
- /** Optional explicit position for ordering in the sidebar */
377
- sidebarPosition?: number;
378
- /** The group (directory) this route belongs to */
379
- group?: string;
380
- /** The display title for the route's group */
381
- groupTitle?: string;
382
- /** Optional explicit position for ordering the group itself */
383
- groupPosition?: number;
384
- /** Optional icon for the route's group */
385
- groupIcon?: string;
386
- /** Extracted markdown headings for search indexing */
387
- headings?: {
388
- level: number;
389
- text: string;
390
- id: string;
391
- }[];
392
- /** The locale this route belongs to, if i18n is configured */
393
- locale?: string;
394
- /** The version this route belongs to, if versioning is configured */
395
- version?: string;
396
- /** Optional badge to display next to the sidebar item (e.g., 'New', 'Experimental') */
397
- badge?: string | {
398
- text: string;
399
- expires?: string;
400
- };
401
- /** Optional icon to display (Lucide icon name or raw SVG) */
402
- icon?: string;
403
- /** The tab this route belongs to, if tabs are configured */
404
- tab?: string;
405
- /** The extracted plain-text content of the page for search indexing */
406
- _content?: string;
407
- /** The raw markdown content of the page */
408
- _rawContent?: string;
215
+ /** The final URL path for the route (e.g., '/docs/guide/start') */
216
+ path: string;
217
+ /** The absolute filesystem path to the source markdown/mdx file */
218
+ componentPath: string;
219
+ /** The title of the page, usually extracted from frontmatter or the filename */
220
+ title: string;
221
+ /** The relative path from the docs directory, used for edit links */
222
+ filePath: string;
223
+ /** Optional description of the page (for SEO/meta tags) */
224
+ description?: string;
225
+ /** Optional explicit position for ordering in the sidebar */
226
+ sidebarPosition?: number;
227
+ /** The group (directory) this route belongs to */
228
+ group?: string;
229
+ /** The display title for the route's group */
230
+ groupTitle?: string;
231
+ /** Optional explicit position for ordering the group itself */
232
+ groupPosition?: number;
233
+ /** Optional icon for the route's group */
234
+ groupIcon?: string;
235
+ /** The sub-route group this route belongs to (from folders starting with _) */
236
+ subRouteGroup?: string;
237
+ /** Extracted markdown headings for search indexing */
238
+ headings?: {
239
+ level: number;
240
+ text: string;
241
+ id: string;
242
+ }[];
243
+ /** The locale this route belongs to, if i18n is configured */
244
+ locale?: string;
245
+ /** The version this route belongs to, if versioning is configured */
246
+ version?: string;
247
+ /** Optional badge to display next to the sidebar item (e.g., 'New', 'Experimental') */
248
+ badge?: string | {
249
+ text: string;
250
+ expires?: string;
251
+ };
252
+ /** Optional icon to display (Lucide icon name or raw SVG) */
253
+ icon?: string;
254
+ /** The tab this route belongs to, if tabs are configured */
255
+ tab?: string;
256
+ /** The extracted plain-text content of the page for search indexing */
257
+ _content?: string;
258
+ /** The raw markdown content of the page */
259
+ _rawContent?: string;
260
+ /** Extracted SEO and Open Graph metadata from frontmatter */
261
+ seo?: Record<string, any>;
409
262
  }
410
-
263
+ //#endregion
264
+ //#region src/node/plugins/plugin-types.d.ts
265
+ /**
266
+ * Permissions that a plugin can request to access specific Boltdocs capabilities.
267
+ */
268
+ type PluginPermission = 'fs:read' | 'fs:write' | 'vite:config' | 'mdx:remark' | 'mdx:rehype' | 'components' | 'hooks:build' | 'hooks:dev';
269
+ /**
270
+ * Shared context injected into every plugin lifecycle hook.
271
+ */
272
+ interface PluginContext {
273
+ /** The full, resolved Boltdocs configuration (Readonly) */
274
+ readonly config: BoltdocsConfig;
275
+ /** A plugin-specific logger */
276
+ readonly logger: PluginLogger;
277
+ /** A shared store for dependency injection and state sharing between plugins */
278
+ readonly store: PluginStore;
279
+ /** Metadata about the current plugin */
280
+ readonly meta: PluginMeta;
281
+ }
282
+ /**
283
+ * Simple logger interface for plugins.
284
+ */
285
+ interface PluginLogger {
286
+ info(message: string): void;
287
+ warn(message: string): void;
288
+ error(message: string | Error): void;
289
+ debug(message: string): void;
290
+ }
291
+ /**
292
+ * A shared key-value store that allows plugins to share state and configuration.
293
+ */
294
+ interface PluginStore {
295
+ /** Get a value from the store. Keys are namespaced by plugin internally. */
296
+ get<T = unknown>(pluginName: string, key: string): T | undefined;
297
+ /** Set a value in the store. */
298
+ set(pluginName: string, key: string, value: unknown): void;
299
+ /** Check if a key exists in the store. */
300
+ has(pluginName: string, key: string): boolean;
301
+ }
302
+ /**
303
+ * Metadata for a plugin, used for identification and compatibility checks.
304
+ */
305
+ interface PluginMeta {
306
+ /** Unique identifier for the plugin */
307
+ name: string;
308
+ /** Version of the plugin itself (semver) */
309
+ version?: string;
310
+ /** Minimum required version of Boltdocs (semver range) */
311
+ boltdocsVersion?: string;
312
+ }
313
+ /**
314
+ * Lifecycle hooks that a plugin can implement to hook into the build and dev processes.
315
+ */
316
+ interface PluginLifecycleHooks {
317
+ /** Called before the build process starts */
318
+ beforeBuild?: (ctx: PluginContext) => Promise<void> | void;
319
+ /** Called after the build process finishes successfully */
320
+ afterBuild?: (ctx: PluginContext) => Promise<void> | void;
321
+ /** Called before the dev server starts */
322
+ beforeDev?: (ctx: PluginContext) => Promise<void> | void;
323
+ /** Called after the dev server is ready (configureServer) */
324
+ afterDev?: (ctx: PluginContext) => Promise<void> | void;
325
+ /** Called when the final Boltdocs config is resolved */
326
+ configResolved?: (ctx: PluginContext, config: BoltdocsConfig) => void;
327
+ /** Called when the build is closing */
328
+ buildEnd?: (ctx: PluginContext) => Promise<void> | void;
329
+ }
330
+ /**
331
+ * The extended, secure Boltdocs plugin interface.
332
+ */
333
+ interface SecureBoltdocsPlugin {
334
+ /** A unique name for the plugin (e.g., 'boltdocs-plugin-mermaid') */
335
+ name: string;
336
+ /** Whether to run this plugin before or after default ones */
337
+ enforce?: 'pre' | 'post';
338
+ /** Version of the plugin (optional, but recommended for security) */
339
+ version?: string;
340
+ /** Minimum compatible Boltdocs version (optional, semver range) */
341
+ boltdocsVersion?: string;
342
+ /** List of permissions this plugin requires to operate */
343
+ permissions?: PluginPermission[];
344
+ /** Optional remark plugins to add to the MDX pipeline (requires 'mdx:remark' permission) */
345
+ remarkPlugins?: unknown[];
346
+ /** Optional rehype plugins to add to the MDX pipeline (requires 'mdx:rehype' permission) */
347
+ rehypePlugins?: unknown[];
348
+ /** Optional Vite plugins to inject into the build process (requires 'vite:config' permission) */
349
+ vitePlugins?: Plugin[];
350
+ /** Optional custom React components to register in MDX. Map of Name -> Module Path. (requires 'components' permission) */
351
+ components?: Record<string, string>;
352
+ /** Implementation of lifecycle hooks (requires 'hooks:build' or 'hooks:dev' permissions) */
353
+ hooks?: PluginLifecycleHooks;
354
+ }
355
+ //#endregion
356
+ //#region src/node/plugins/plugin-errors.d.ts
411
357
  /**
412
358
  * Base class for all plugin-related errors in Boltdocs.
413
359
  */
414
360
  declare class PluginError extends Error {
415
- readonly pluginName: string;
416
- constructor(pluginName: string, message: string);
361
+ readonly pluginName: string;
362
+ constructor(pluginName: string, message: string);
417
363
  }
418
364
  /**
419
365
  * Specifically for schema or structure validation failures.
420
366
  */
421
367
  declare class PluginValidationError extends PluginError {
422
- constructor(pluginName: string, message: string);
368
+ constructor(pluginName: string, message: string);
423
369
  }
424
370
  /**
425
371
  * Specifically for version mismatch or compatibility issues.
426
372
  */
427
373
  declare class PluginCompatibilityError extends PluginError {
428
- constructor(pluginName: string, message: string);
374
+ constructor(pluginName: string, message: string);
429
375
  }
430
376
  /**
431
377
  * Specifically for attempts to use capabilities without proper permissions.
432
378
  */
433
379
  declare class PluginPermissionError extends PluginError {
434
- constructor(pluginName: string, permission: string);
380
+ constructor(pluginName: string, permission: string);
435
381
  }
436
382
  /**
437
383
  * Specifically for errors that occur during the execution of a lifecycle hook.
438
384
  */
439
385
  declare class PluginHookError extends PluginError {
440
- readonly hookName: string;
441
- constructor(pluginName: string, hookName: string, originalError: Error);
386
+ readonly hookName: string;
387
+ constructor(pluginName: string, hookName: string, originalError: Error);
442
388
  }
443
-
389
+ //#endregion
390
+ //#region src/node/plugins/plugin-store.d.ts
444
391
  /**
445
392
  * Implementation of the shared plugin store.
446
393
  * Uses a namespaced approach to prevent key collisions between plugins.
447
394
  */
448
395
  declare class BoltdocsPluginStore implements PluginStore {
449
- private data;
450
- /**
451
- * Internal helper to create a namespaced key.
452
- */
453
- private getNamespaceKey;
454
- /**
455
- * Retrieves a value from the store. Returns a deep clone to prevent mutations (side-effects).
456
- */
457
- get<T = unknown>(pluginName: string, key: string): T | undefined;
458
- /**
459
- * Stores a value in the store. Key is automatically namespaced.
460
- */
461
- set(pluginName: string, key: string, value: unknown): void;
462
- /**
463
- * Checks for the existence of a key in the store.
464
- */
465
- has(pluginName: string, key: string): boolean;
396
+ private data;
397
+ /**
398
+ * Internal helper to create a namespaced key.
399
+ */
400
+ private getNamespaceKey;
401
+ /**
402
+ * Retrieves a value from the store. Returns a deep clone to prevent mutations (side-effects).
403
+ */
404
+ get<T = unknown>(pluginName: string, key: string): T | undefined;
405
+ /**
406
+ * Stores a value in the store. Key is automatically namespaced.
407
+ */
408
+ set(pluginName: string, key: string, value: unknown): void;
409
+ /**
410
+ * Checks for the existence of a key in the store.
411
+ */
412
+ has(pluginName: string, key: string): boolean;
466
413
  }
467
-
414
+ //#endregion
415
+ //#region src/node/plugins/plugin-validator.d.ts
468
416
  /**
469
417
  * Enhanced Zod schema for secure plugins.
470
418
  */
471
419
  declare const SecurePluginSchema: z.ZodObject<{
472
- name: z.ZodString;
473
- enforce: z.ZodOptional<z.ZodEnum<{
474
- pre: "pre";
475
- post: "post";
476
- }>>;
477
- remarkPlugins: z.ZodOptional<z.ZodArray<z.ZodAny>>;
478
- rehypePlugins: z.ZodOptional<z.ZodArray<z.ZodAny>>;
479
- vitePlugins: z.ZodOptional<z.ZodArray<z.ZodAny>>;
480
- components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
481
- version: z.ZodOptional<z.ZodString>;
482
- boltdocsVersion: z.ZodOptional<z.ZodString>;
483
- permissions: z.ZodOptional<z.ZodArray<z.ZodString>>;
484
- hooks: z.ZodOptional<z.ZodObject<{
485
- beforeBuild: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
486
- afterBuild: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
487
- beforeDev: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
488
- afterDev: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
489
- configResolved: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
490
- buildEnd: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
491
- }, z.core.$strip>>;
420
+ name: z.ZodString;
421
+ enforce: z.ZodOptional<z.ZodEnum<{
422
+ pre: "pre";
423
+ post: "post";
424
+ }>>;
425
+ remarkPlugins: z.ZodOptional<z.ZodArray<z.ZodAny>>;
426
+ rehypePlugins: z.ZodOptional<z.ZodArray<z.ZodAny>>;
427
+ vitePlugins: z.ZodOptional<z.ZodArray<z.ZodAny>>;
428
+ components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
429
+ version: z.ZodOptional<z.ZodString>;
430
+ boltdocsVersion: z.ZodOptional<z.ZodString>;
431
+ permissions: z.ZodOptional<z.ZodArray<z.ZodString>>;
432
+ hooks: z.ZodOptional<z.ZodObject<{
433
+ beforeBuild: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
434
+ afterBuild: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
435
+ beforeDev: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
436
+ afterDev: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
437
+ configResolved: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
438
+ buildEnd: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
439
+ }, z.core.$strip>>;
492
440
  }, z.core.$strip>;
493
441
  /**
494
442
  * Validates a list of plugins for correctness, security, and compatibility.
@@ -498,70 +446,74 @@ declare function validatePlugins(plugins: any[], boltdocsVersion: string): Secur
498
446
  * Helper to check if a specific permission is granted to a plugin.
499
447
  */
500
448
  declare function hasPermission(plugin: SecureBoltdocsPlugin, permission: PluginPermission): boolean;
501
-
449
+ //#endregion
450
+ //#region src/node/plugins/plugin-sandbox.d.ts
502
451
  /**
503
452
  * The Sandbox provides a protective layer that ensures plugins only use
504
453
  * the capabilities they have explicitly requested permissions for.
505
454
  */
506
455
  declare class PluginSandbox {
507
- /**
508
- * Validates if a plugin has the required permission for a capability.
509
- * Throws a PluginPermissionError if not granted.
510
- */
511
- static checkPermission(plugin: SecureBoltdocsPlugin, permission: PluginPermission): void;
512
- /**
513
- * Filters a plugin's capabilities based on its declared permissions.
514
- * This is used when aggregating plugins (remark, rehype, vite, components).
515
- */
516
- static getSanitizedCapabilities(plugin: SecureBoltdocsPlugin): {
517
- remarkPlugins: unknown[] | undefined;
518
- rehypePlugins: unknown[] | undefined;
519
- vitePlugins: vite.Plugin<any>[] | undefined;
520
- components: Record<string, string> | undefined;
521
- };
522
- /**
523
- * Wraps a hook execution with permission checks and error isolation.
524
- */
525
- static executeWithIsolation<T>(plugin: SecureBoltdocsPlugin, requiredPermission: PluginPermission, hookName: string, action: () => Promise<T> | T): Promise<T | undefined>;
456
+ /**
457
+ * Validates if a plugin has the required permission for a capability.
458
+ * Throws a PluginPermissionError if not granted.
459
+ */
460
+ static checkPermission(plugin: SecureBoltdocsPlugin, permission: PluginPermission): void;
461
+ /**
462
+ * Filters a plugin's capabilities based on its declared permissions.
463
+ * This is used when aggregating plugins (remark, rehype, vite, components).
464
+ */
465
+ static getSanitizedCapabilities(plugin: SecureBoltdocsPlugin): {
466
+ remarkPlugins: unknown[] | undefined;
467
+ rehypePlugins: unknown[] | undefined;
468
+ vitePlugins: _$vite.Plugin<any>[] | undefined;
469
+ components: Record<string, string> | undefined;
470
+ };
471
+ /**
472
+ * Wraps a hook execution with permission checks and error isolation.
473
+ */
474
+ static executeWithIsolation<T>(plugin: SecureBoltdocsPlugin, requiredPermission: PluginPermission, hookName: string, action: () => Promise<T> | T): Promise<T | undefined>;
526
475
  }
527
-
476
+ //#endregion
477
+ //#region src/node/plugins/plugin-lifecycle.d.ts
528
478
  /**
529
479
  * Manages the lifecycle of all loaded plugins, ensuring hooks are executed
530
480
  * in the correct order with proper error isolation and context.
531
481
  */
532
482
  declare class PluginLifecycleManager {
533
- private plugins;
534
- private config;
535
- private store;
536
- constructor(plugins: SecureBoltdocsPlugin[], config: BoltdocsConfig);
537
- /**
538
- * Runs a specific hook for all plugins that implement it.
539
- */
540
- runHook(hookName: keyof PluginLifecycleHooks, ...args: any[]): Promise<void>;
541
- /**
542
- * Sorts plugins based on their 'enforce' property (pre -> normal -> post).
543
- */
544
- private getSortedPlugins;
545
- /**
546
- * Creates a specialized context for a plugin.
547
- */
548
- private createContext;
549
- /**
550
- * Creates a namespaced logger for a plugin.
551
- */
552
- private createLogger;
483
+ private plugins;
484
+ private config;
485
+ private store;
486
+ constructor(plugins: SecureBoltdocsPlugin[], config: BoltdocsConfig);
487
+ /**
488
+ * Runs a specific hook for all plugins that implement it.
489
+ */
490
+ runHook(hookName: keyof PluginLifecycleHooks, ...args: any[]): Promise<void>;
491
+ /**
492
+ * Sorts plugins based on their 'enforce' property (pre -> normal -> post).
493
+ */
494
+ private getSortedPlugins;
495
+ /**
496
+ * Creates a specialized context for a plugin.
497
+ */
498
+ private createContext;
499
+ /**
500
+ * Creates a namespaced logger for a plugin.
501
+ */
502
+ private createLogger;
553
503
  }
554
-
504
+ //#endregion
505
+ //#region src/node/plugins/index.d.ts
555
506
  /**
556
507
  * Utility to create a Boltdocs plugin with full type safety.
557
508
  */
558
509
  declare function createPlugin(plugin: SecureBoltdocsPlugin): SecureBoltdocsPlugin;
559
-
510
+ //#endregion
511
+ //#region src/node/index.d.ts
560
512
  declare function boltdocs(options?: BoltdocsPluginOptions): Promise<Plugin[]>;
561
513
  /**
562
514
  * Generates the complete Vite configuration for a Boltdocs project.
563
515
  * This is used by the Boltdocs CLI to run Vite without a user-defined vite.config.ts.
564
516
  */
565
517
  declare function createViteConfig(root: string, mode?: 'development' | 'production'): Promise<InlineConfig>;
566
-
567
- export { type BoltdocsConfig, type BoltdocsPlugin, type BoltdocsPluginOptions, BoltdocsPluginStore, type BoltdocsThemeConfig, PluginCompatibilityError, type PluginContext, PluginError, PluginHookError, type PluginLifecycleHooks, PluginLifecycleManager, type PluginLogger, type PluginMeta, type PluginPermission, PluginPermissionError, PluginSandbox, type PluginStore, PluginValidationError, type RouteMeta, type SSGOptions, type SecureBoltdocsPlugin, SecurePluginSchema, createPlugin, createViteConfig, boltdocs as default, defineConfig, generateStaticPages, hasPermission, resolveConfig, validatePlugins };
518
+ //#endregion
519
+ export { type BoltdocsConfig, type BoltdocsPlugin, type BoltdocsPluginOptions, BoltdocsPluginStore, type BoltdocsThemeConfig, PluginCompatibilityError, PluginContext, PluginError, PluginHookError, PluginLifecycleHooks, PluginLifecycleManager, PluginLogger, PluginMeta, PluginPermission, PluginPermissionError, PluginSandbox, PluginStore, PluginValidationError, type RouteMeta, SecureBoltdocsPlugin, SecurePluginSchema, createPlugin, createViteConfig, boltdocs as default, defineConfig, generateEntryCode, hasPermission, resolveConfig, validatePlugins };