boltdocs 3.0.2 → 3.1.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 (113) hide show
  1. package/README.md +2 -18
  2. package/dist/{adapters-C5AWWGfb.cjs → adapters-uGz-UKQa.cjs} +1 -1
  3. package/dist/{banner-DNSkgUsO.d.cts → banner-DdSgCs4G.d.cts} +1 -1
  4. package/dist/{banner-CfdalYLL.d.ts → banner-DjujkctF.d.ts} +1 -1
  5. package/dist/cache-B0C2i0yP.mjs +6 -0
  6. package/dist/cache-CfRTUzWC.cjs +6 -0
  7. package/dist/chunk-hT5z_Zn9-DsJawvsz.mjs +6 -0
  8. package/dist/chunk-hT5z_Zn9-SKz6VFXu.cjs +6 -0
  9. package/dist/client/index.cjs +227 -113
  10. package/dist/client/index.d.cts +57 -12
  11. package/dist/client/index.d.ts +57 -12
  12. package/dist/client/index.js +227 -114
  13. package/dist/client/mdx.cjs +1 -1
  14. package/dist/client/mdx.js +1 -1
  15. package/dist/client/primitives.cjs +4 -4
  16. package/dist/client/primitives.d.cts +1 -1
  17. package/dist/client/primitives.d.ts +1 -1
  18. package/dist/client/primitives.js +4 -4
  19. package/dist/client/theme/neutral.css +1 -3
  20. package/dist/{config-JGkMJoJQ.cjs → config-BxsogK5A.cjs} +1 -1
  21. package/dist/config-DAgpZyh6.mjs +7 -0
  22. package/dist/config-DrRQYDCI.cjs +7 -0
  23. package/dist/{docs-layout-3TpAt6MB.cjs → docs-layout-D1buSdua.cjs} +1 -1
  24. package/dist/{docs-layout-6FQ8__ok.js → docs-layout-DyLDBwS6.js} +1 -1
  25. package/dist/{doctor-DQxLM202.cjs → doctor-BadGEhXv.cjs} +1 -1
  26. package/dist/{doctor-BR1B2Mkz.cjs → doctor-DPDcRKM1.cjs} +1 -1
  27. package/dist/{doctor-3MheVMwd.mjs → doctor-vDsUDgqp.mjs} +1 -1
  28. package/dist/escape-string-regexp-AG8q1e25-9Un9V90q.mjs +6 -0
  29. package/dist/escape-string-regexp-AG8q1e25-bJ9Ixe7c.cjs +6 -0
  30. package/dist/esm-shims-DSep1HcR.mjs +6 -0
  31. package/dist/{icons-dev-kJyGWNeg.js → icons-dev-CHZOwhQA.js} +8 -3
  32. package/dist/{icons-dev-BryEFkJu.cjs → icons-dev-YtDoLUsb.cjs} +8 -3
  33. package/dist/{image-C9md50h2.js → image-5WsgWYTh.js} +2 -2
  34. package/dist/{image-CR6UlaI5.cjs → image-Hb105Gu6.cjs} +2 -2
  35. package/dist/lib-BR0SoanK-CLswltLI.cjs +6 -0
  36. package/dist/lib-BR0SoanK-DcYeDrE6.mjs +6 -0
  37. package/dist/lib-DPoCz1YB-CLYXwKST.cjs +6 -0
  38. package/dist/lib-DPoCz1YB-CyGOqgSO.mjs +6 -0
  39. package/dist/{mdx-DhyMkc35.js → mdx-Bv-pS6-O.js} +6 -2
  40. package/dist/{mdx-DJBg5DuL.cjs → mdx-CDUcJmye.cjs} +6 -2
  41. package/dist/micromark-util-character-5KqJafVT-C6gnc770.cjs +6 -0
  42. package/dist/micromark-util-character-5KqJafVT-DkPKsbgn.mjs +6 -0
  43. package/dist/node/cache.cjs +6 -0
  44. package/dist/node/cache.d.cts +83 -0
  45. package/dist/node/cache.d.mts +83 -0
  46. package/dist/node/cache.mjs +6 -0
  47. package/dist/node/cli-entry.cjs +3 -3
  48. package/dist/node/cli-entry.mjs +3 -3
  49. package/dist/node/index.cjs +1 -1
  50. package/dist/node/index.d.cts +10 -467
  51. package/dist/node/index.d.mts +12 -468
  52. package/dist/node/index.mjs +1 -1
  53. package/dist/node/mdx/shiki-adapter.cjs +6 -0
  54. package/dist/node/mdx/shiki-adapter.d.cts +3 -0
  55. package/dist/node/mdx/shiki-adapter.d.mts +3 -0
  56. package/dist/node/mdx/shiki-adapter.mjs +6 -0
  57. package/dist/node-BDBv8CT6.mjs +104 -0
  58. package/dist/node-DFV_FV0y.mjs +6 -0
  59. package/dist/node-DqsP7kXz.cjs +6 -0
  60. package/dist/node-yFmAavND.cjs +104 -0
  61. package/dist/{package-_dCCKVvG.mjs → package-CoHWTf0N.mjs} +1 -1
  62. package/dist/{package-CEDhVAfO.cjs → package-_-Oa8-qN.cjs} +1 -1
  63. package/dist/{parser-D0QHIQsi.mjs → parser-BZJgAa9E.mjs} +1 -1
  64. package/dist/{parser-CNIPHx4s.cjs → parser-DlanzESE.cjs} +1 -1
  65. package/dist/plugin-BVuwx5D9.cjs +73 -0
  66. package/dist/plugin-BoxD91Yh.mjs +73 -0
  67. package/dist/rehype-slug--ZOxZ-_K-BNeYC4aT.cjs +6 -0
  68. package/dist/rehype-slug--ZOxZ-_K-CjIQEJCs.mjs +6 -0
  69. package/dist/remark-frontmatter-wFYRLcCt-CutW0gA3.mjs +8 -0
  70. package/dist/remark-frontmatter-wFYRLcCt-ENB5qG3y.cjs +8 -0
  71. package/dist/remark-gfm-B8TMkQbX-CjUJo8Rd.cjs +21 -0
  72. package/dist/remark-gfm-B8TMkQbX-Ctu0VV1_.mjs +21 -0
  73. package/dist/rollup-DMqoG11U-CKcJ37u_.mjs +59 -0
  74. package/dist/rollup-DMqoG11U-DKdxvZIj.cjs +59 -0
  75. package/dist/routes-BN2XbGcT.mjs +6 -0
  76. package/dist/routes-Cnq8xTCv.cjs +6 -0
  77. package/dist/{routes-BajCwrvX.cjs → routes-D_S9kjkS.cjs} +1 -1
  78. package/dist/{search-dialog-CW1f6dn6.cjs → search-dialog-BIuxGQsg.cjs} +1 -1
  79. package/dist/{search-dialog-Cx7aGW3U.cjs → search-dialog-BbtxA1uT.cjs} +2 -2
  80. package/dist/{search-dialog-D4rplZMv.cjs → search-dialog-BpNULmrl.cjs} +1 -1
  81. package/dist/{search-dialog-DDopgbKM.js → search-dialog-DC7oXU-5.js} +2 -2
  82. package/dist/{search-dialog-DaeSPvEo.js → search-dialog-PJrFRU5G.js} +1 -1
  83. package/dist/{search-dialog-BNdRV60O.js → search-dialog-gp9lrJXm.js} +1 -1
  84. package/dist/server/index.cjs +1 -1
  85. package/dist/server/index.d.mts +1 -1
  86. package/dist/shiki-adapter-CK3llqw2.mjs +6 -0
  87. package/dist/shiki-adapter-fS94vy-z.d.mts +534 -0
  88. package/dist/shiki-adapter-l2kEP5rn.d.cts +534 -0
  89. package/dist/{sidebar-BAKgJ-Er.d.ts → sidebar-DH2iPKXM.d.cts} +187 -10
  90. package/dist/{sidebar-7gIifpBX.d.cts → sidebar-DknLUI1R.d.ts} +187 -10
  91. package/package.json +16 -5
  92. package/src/shared/types.ts +177 -10
  93. package/dist/cache-DETwlACe.cjs +0 -6
  94. package/dist/cache-SF59enb3.mjs +0 -6
  95. package/dist/config-B5uVv5q4.cjs +0 -7
  96. package/dist/config-D3_zDkHh.mjs +0 -7
  97. package/dist/node-B9JSyEIU.mjs +0 -105
  98. package/dist/node-Cedquois.cjs +0 -105
  99. package/dist/plugin-WYNORxp1.cjs +0 -68
  100. package/dist/plugin-YWNVRpws.mjs +0 -68
  101. package/dist/routes-CyrnmVuG.mjs +0 -6
  102. package/dist/routes-D6Tuu7Fs.cjs +0 -6
  103. package/dist/shiki-adapter-CXEGRnjr.mjs +0 -6
  104. package/dist/shiki-adapter-Mr8_oT_9.cjs +0 -6
  105. /package/dist/{csp-CBysWlAf.cjs → csp-BX06rvdg.cjs} +0 -0
  106. /package/dist/{csp-gaZ51xzq.mjs → csp-z2D0FuRW.mjs} +0 -0
  107. /package/dist/{generator-DtUU3Cfk.cjs → generator-BN75lJOv.cjs} +0 -0
  108. /package/dist/{handler-Dzf4dSnV.cjs → handler-1LRMYeI4.cjs} +0 -0
  109. /package/dist/{headers-CXyf0auY.mjs → headers-CL0pMcwm.mjs} +0 -0
  110. /package/dist/{headers-BXKxiPUv.cjs → headers-YpD10rDb.cjs} +0 -0
  111. /package/dist/{index-CdJv4ocW.d.mts → index-DJYJzs-Z.d.mts} +0 -0
  112. /package/dist/{meta-loader-C4Hu9RN9.mjs → meta-loader-Bq-MjTXB.mjs} +0 -0
  113. /package/dist/{meta-loader-C9MKjAs0.cjs → meta-loader-CTB62-Mo.cjs} +0 -0
@@ -1,315 +1,9 @@
1
1
 
2
+ import { flushCache } from "./cache.cjs";
2
3
  import { i as handleVercelFeedback, n as handleWebFeedback, r as handleNetlifyFeedback, t as handleAwsFeedback } from "../index-aWC0KjDF.cjs";
4
+ import { a as resolveConfig, c as BoltdocsPlugin, d as PluginLifecycleHooks, f as PluginLogger, h as RouteMeta, i as parseMetaString, l as BoltdocsThemeConfig, m as PluginStore, o as defineConfig, p as PluginMeta, s as BoltdocsConfig, u as PluginContext } from "../shiki-adapter-l2kEP5rn.cjs";
3
5
  import { InlineConfig, Plugin } from "vite";
4
6
  import { EXIT, SKIP } from "unist-util-visit";
5
- //#region src/shared/types.d.ts
6
- /**
7
- * Represents a single social link in the configuration.
8
- */
9
- interface BoltdocsSocialLink {
10
- icon: 'discord' | 'x' | 'github' | 'bluesky' | string;
11
- link: string;
12
- }
13
- /**
14
- * Configuration for the site footer.
15
- */
16
- interface BoltdocsFooterConfig {
17
- text?: string;
18
- }
19
- /**
20
- * Theme-specific configuration options.
21
- */
22
- interface BoltdocsThemeConfig {
23
- title?: string | Record<string, string>;
24
- description?: string | Record<string, string>;
25
- logo?: string | {
26
- dark: string;
27
- light: string;
28
- alt?: string;
29
- width?: number;
30
- height?: number;
31
- };
32
- navbar?: Array<{
33
- label: string | Record<string, string>;
34
- href: BoltdocsRoutePathWithFallback;
35
- items?: Array<{
36
- label: string | Record<string, string>;
37
- href: BoltdocsRoutePathWithFallback;
38
- }>;
39
- }>;
40
- sidebar?: Record<string, Array<{
41
- text: string;
42
- link: BoltdocsRoutePathWithFallback;
43
- }>>;
44
- sidebarGroups?: Record<string, {
45
- title?: string | Record<string, string>;
46
- icon?: string;
47
- }>;
48
- socialLinks?: BoltdocsSocialLink[];
49
- footer?: BoltdocsFooterConfig;
50
- editLink?: string;
51
- communityHelp?: string;
52
- version?: string;
53
- githubRepo?: string;
54
- favicon?: string;
55
- tabs?: Array<{
56
- id: string;
57
- text: string | Record<string, string>;
58
- icon?: string;
59
- }>;
60
- codeTheme?: ShikiTheme | {
61
- light: ShikiTheme;
62
- dark: ShikiTheme;
63
- };
64
- }
65
- /**
66
- * List of supported syntax highlighting themes.
67
- */
68
- type ShikiTheme = 'github-dark' | 'github-light' | 'tokyo-night' | 'dracula' | 'nord' | 'one-dark-pro' | 'one-light';
69
- /**
70
- * Configuration for the robots.txt file.
71
- */
72
- type BoltdocsRobotsConfig = string | {
73
- rules?: Array<{
74
- userAgent: string;
75
- allow?: string | string[];
76
- disallow?: string | string[];
77
- }>;
78
- sitemaps?: string[];
79
- };
80
- /**
81
- * Configuration for a specific locale.
82
- */
83
- interface BoltdocsLocaleConfig {
84
- label?: string;
85
- direction?: 'ltr' | 'rtl';
86
- htmlLang?: string;
87
- calendar?: string;
88
- }
89
- /**
90
- * Configuration for internationalization (i18n).
91
- */
92
- interface BoltdocsI18nConfig {
93
- defaultLocale: string;
94
- locales: string[] | Record<string, string>;
95
- localeConfigs?: Record<string, BoltdocsLocaleConfig>;
96
- }
97
- /**
98
- * Configuration for a specific documentation version.
99
- */
100
- interface BoltdocsVersionConfig {
101
- label: string;
102
- path: string;
103
- }
104
- /**
105
- * Configuration for documentation versioning.
106
- */
107
- interface BoltdocsVersionsConfig {
108
- defaultVersion: string;
109
- prefix?: string;
110
- versions: BoltdocsVersionConfig[];
111
- }
112
- /**
113
- * Shared badge value type used in frontmatter, RouteMeta, and ComponentRoute.
114
- */
115
- type BadgeValue = string | {
116
- text: string;
117
- expires?: string;
118
- };
119
- /**
120
- * Defines a Boltdocs plugin.
121
- *
122
- * Use the `createPlugin()` helper from the node API for full type safety and
123
- * access to lifecycle hooks.
124
- */
125
- interface BoltdocsPlugin {
126
- name: string;
127
- enforce?: 'pre' | 'post';
128
- version?: string;
129
- boltdocsVersion?: string;
130
- remarkPlugins?: unknown[];
131
- rehypePlugins?: unknown[];
132
- vitePlugins?: Plugin[];
133
- components?: Record<string, string>;
134
- /** Lifecycle hooks — use the `PluginLifecycleHooks` type from the node API. */
135
- hooks?: Record<string, (ctx: unknown) => Promise<void> | void>;
136
- }
137
- /**
138
- * Configuration for the collections (blog) feature.
139
- */
140
- interface BoltdocsCollectionsConfig {
141
- /** Number of posts per page in collection listing pages. Defaults to 10. */
142
- postsPerPage?: number;
143
- /** The name of the default collection used by BlogList when none is specified. */
144
- defaultCollection?: string;
145
- /** Date format string for rendering post dates (e.g., 'MMMM dd, yyyy'). */
146
- dateFormat?: string;
147
- /** Field to sort posts by. Defaults to 'date'. */
148
- sortBy?: 'date' | 'title' | 'sidebarPosition';
149
- }
150
- interface BoltdocsSecurityConfig {
151
- headers?: Record<string, string>;
152
- enableCSP?: boolean;
153
- customHeaders?: Record<string, string>;
154
- }
155
- interface BoltdocsVerificationConfig {
156
- google?: string;
157
- bing?: string;
158
- yandex?: string;
159
- pinterest?: string;
160
- facebook?: string;
161
- }
162
- /**
163
- * Configuration for SEO.
164
- */
165
- interface BoltdocsSeoConfig {
166
- metatags?: Record<string, string>;
167
- indexing?: 'all' | 'public';
168
- thumbnails?: {
169
- background?: string;
170
- };
171
- verification?: BoltdocsVerificationConfig;
172
- }
173
- /**
174
- * Configuration for Google Analytics 4 (GA4).
175
- */
176
- interface BoltdocsGA4Config {
177
- measurementId: string;
178
- debug?: boolean;
179
- anonymizeIp?: boolean;
180
- sendPageView?: boolean;
181
- cookieFlags?: string;
182
- autoTrack?: {
183
- pageViews?: boolean;
184
- downloads?: boolean;
185
- externalLinks?: boolean;
186
- search?: boolean;
187
- };
188
- }
189
- /**
190
- * Configuration for Google Tag Manager (GTM).
191
- */
192
- interface BoltdocsGTMConfig {
193
- tagId: string;
194
- dataLayerName?: string;
195
- preview?: string;
196
- }
197
- /**
198
- * Configuration for Algolia DocSearch.
199
- */
200
- interface BoltdocsAlgoliaConfig {
201
- appId: string;
202
- apiKey: string;
203
- indexName: string;
204
- }
205
- /**
206
- * Configuration for Giscus comments.
207
- */
208
- interface BoltdocsGiscusConfig {
209
- repo: string;
210
- repoId: string;
211
- category?: string;
212
- categoryId?: string;
213
- mapping?: 'pathname' | 'url' | 'title' | 'og:title' | 'specific' | 'number';
214
- strict?: '0' | '1' | boolean;
215
- reactionsEnabled?: '0' | '1' | boolean;
216
- emitMetadata?: '0' | '1' | boolean;
217
- inputPosition?: 'top' | 'bottom';
218
- theme?: string;
219
- darkTheme?: string;
220
- lang?: string;
221
- loading?: 'lazy' | 'eager';
222
- }
223
- /**
224
- * Configuration for custom feedback system using GitHub Discussions API.
225
- */
226
- interface BoltdocsCustomFeedbackConfig {
227
- enabled: boolean;
228
- owner: string;
229
- repo: string;
230
- categorySlug?: string;
231
- endpoint?: string;
232
- }
233
- interface BoltdocsVercelConfig {
234
- analytics?: boolean;
235
- speedInsights?: boolean;
236
- }
237
- interface BoltdocsIntegrationsConfig {
238
- analytics?: {
239
- ga4?: BoltdocsGA4Config;
240
- vercel?: BoltdocsVercelConfig;
241
- gtm?: BoltdocsGTMConfig;
242
- };
243
- search?: {
244
- algolia?: BoltdocsAlgoliaConfig;
245
- };
246
- feedback?: {
247
- giscus?: BoltdocsGiscusConfig;
248
- custom?: BoltdocsCustomFeedbackConfig;
249
- };
250
- }
251
- /**
252
- * The root configuration object for Boltdocs.
253
- */
254
- interface BoltdocsConfig {
255
- siteUrl?: string;
256
- docsDir?: string;
257
- base?: string;
258
- theme?: BoltdocsThemeConfig;
259
- i18n?: BoltdocsI18nConfig;
260
- versions?: BoltdocsVersionsConfig;
261
- plugins?: BoltdocsPlugin[];
262
- collections?: BoltdocsCollectionsConfig;
263
- robots?: BoltdocsRobotsConfig;
264
- security?: BoltdocsSecurityConfig;
265
- seo?: BoltdocsSeoConfig;
266
- integrations?: BoltdocsIntegrationsConfig;
267
- directoryMeta?: Record<string, unknown>;
268
- vite?: unknown;
269
- }
270
- /**
271
- * Global namespace for Boltdocs types that can be augmented by generated code.
272
- * This allows for strictly typed locales and versions based on the project configuration.
273
- */
274
- declare global {
275
- namespace Boltdocs {
276
- interface Types {}
277
- /**
278
- * Marker interface augmented by generated code to provide strict route path typing.
279
- * When no types have been generated (e.g., before first dev server start),
280
- * keyof is never, and BoltdocsRoutePath falls back to string.
281
- */
282
- interface RoutePaths {}
283
- }
284
- }
285
- type BoltdocsRoutePath = keyof Boltdocs.RoutePaths;
286
- type BoltdocsRoutePathWithFallback = BoltdocsRoutePath extends never ? string : BoltdocsRoutePath;
287
- //#endregion
288
- //#region src/shared/config-utils.d.ts
289
- /**
290
- * Type-safe helper for defining Boltdocs configuration.
291
- * This is an identity function that provides IntelliSense in both
292
- * Node.js (config files) and client-side code (MDX examples).
293
- *
294
- * @remarks
295
- * Intended for use in `boltdocs.config.ts` (Node.js context). This function
296
- * is **not** available as a client-side import from `boltdocs/client`.
297
- *
298
- * @param config - The Boltdocs configuration object
299
- */
300
- declare function defineConfig(config: BoltdocsConfig): BoltdocsConfig;
301
- //#endregion
302
- //#region src/node/config.d.ts
303
- /**
304
- * Loads user's configuration file (e.g., `boltdocs.config.js` or `boltdocs.config.ts`) if it exists,
305
- * merges it with the default configuration, and returns the final `BoltdocsConfig`.
306
- *
307
- * @param docsDir - The directory containing the documentation files
308
- * @param root - The project root directory (defaults to process.cwd())
309
- * @returns The merged configuration object
310
- */
311
- declare function resolveConfig(docsDir: string, root?: string): Promise<BoltdocsConfig>;
312
- //#endregion
313
7
  //#region src/node/plugin/types.d.ts
314
8
  /**
315
9
  * Configuration options specifically for the Boltdocs Vite plugin.
@@ -317,6 +11,8 @@ declare function resolveConfig(docsDir: string, root?: string): Promise<Boltdocs
317
11
  interface BoltdocsPluginOptions {
318
12
  /** The root directory containing markdown files (default: 'docs') */
319
13
  docsDir?: string;
14
+ /** Enable turbo mode (Sätteri MDX compiler) */
15
+ turbo?: boolean;
320
16
  }
321
17
  //#endregion
322
18
  //#region src/node/plugin/entry.d.ts
@@ -330,88 +26,6 @@ interface BoltdocsPluginOptions {
330
26
  */
331
27
  declare function generateEntryCode(options: BoltdocsPluginOptions, config?: BoltdocsConfig): string;
332
28
  //#endregion
333
- //#region src/node/routes/types.d.ts
334
- /**
335
- * Metadata representing a single documentation route.
336
- * This information is used to build the client-side router and the sidebar navigation.
337
- */
338
- interface RouteMeta {
339
- /** The final URL path for the route (e.g., '/docs/guide/start') */
340
- path: string;
341
- /** The absolute filesystem path to the source markdown/mdx file */
342
- componentPath: string;
343
- /** The title of the page, usually extracted from frontmatter or the filename */
344
- title: string;
345
- /** The relative path from the docs directory, used for edit links */
346
- filePath: string;
347
- /** Optional description of the page (for SEO/meta tags) */
348
- description?: string;
349
- /** Optional explicit position for ordering in the sidebar */
350
- sidebarPosition?: number;
351
- /** The group (directory) this route belongs to */
352
- group?: string;
353
- /** The display title for the route's group */
354
- groupTitle?: string;
355
- /** Optional explicit position for ordering the group itself */
356
- groupPosition?: number;
357
- /** Optional icon for the route's group */
358
- groupIcon?: string;
359
- /** The sub-route group this route belongs to (from folders starting with _) */
360
- subRouteGroup?: string;
361
- /** Extracted markdown headings for search indexing */
362
- headings?: {
363
- level: number;
364
- text: string;
365
- id: string;
366
- }[];
367
- /** The locale this route belongs to, if i18n is configured */
368
- locale?: string;
369
- /** The version this route belongs to, if versioning is configured */
370
- version?: string;
371
- /** Optional badge to display next to the sidebar item (e.g., 'New', 'Experimental') */
372
- badge?: BadgeValue;
373
- /** Optional icon to display (Lucide icon name or raw SVG) */
374
- icon?: string;
375
- /** The tab this route belongs to, if tabs are configured */
376
- tab?: string;
377
- /** The collection this route belongs to (from [name] directories like [blog]) */
378
- collection?: string;
379
- /** Tags for blog posts or other taxonomy */
380
- tags?: string[];
381
- /** Author identifier for blog posts */
382
- author?: string;
383
- /** Draft flag — excluded from production builds */
384
- draft?: boolean;
385
- /** Short excerpt/summary for list displays */
386
- excerpt?: string;
387
- /** Cover image for blog posts */
388
- coverImage?: string;
389
- /** The extracted plain-text content of the page for search indexing */
390
- _content?: string;
391
- /** The raw markdown content of the page */
392
- _rawContent?: string;
393
- /** Extracted SEO and Open Graph metadata from frontmatter */
394
- seo?: Record<string, any>;
395
- /** The publication date */
396
- date?: string | Date;
397
- /** The last updated timestamp or date */
398
- lastUpdated?: string | number | Date;
399
- /** Optional category for the page */
400
- category?: string;
401
- /** Optional explicit order (alternative to sidebarPosition) */
402
- order?: number;
403
- /** Optional explicit label for the sidebar */
404
- sidebarLabel?: string;
405
- /** Whether the page is hidden from the sidebar */
406
- sidebarHidden?: boolean;
407
- /** Raw extensible frontmatter data for custom components and formatters */
408
- frontmatter?: Record<string, any>;
409
- /** Optional recursive child routes for deep sidebar hierarchies */
410
- subRoutes?: RouteMeta[];
411
- /** Clean URL segments stripped of locale/version prefixes */
412
- slugParts?: string[];
413
- }
414
- //#endregion
415
29
  //#region src/node/routes/index.d.ts
416
30
  /**
417
31
  * Invalidates the global route metadata and clears local state.
@@ -428,64 +42,9 @@ declare function invalidateRouteCache(): void;
428
42
  * @param basePath - The base URL path for the routes (default: '/docs')
429
43
  * @returns A promise resolving to an array of RouteMeta objects
430
44
  */
431
- declare function generateRoutes(docsDir: string, config?: BoltdocsConfig, basePath?: string, forceScan?: boolean): Promise<RouteMeta[]>;
45
+ declare function generateRoutes(docsDir: string, config?: BoltdocsConfig, basePath?: string, forceScan?: boolean, turbo?: boolean): Promise<RouteMeta[]>;
432
46
  //#endregion
433
47
  //#region src/node/plugins/plugin-types.d.ts
434
- interface PluginContext {
435
- readonly config: BoltdocsConfig;
436
- readonly logger: PluginLogger;
437
- readonly store: PluginStore;
438
- readonly meta: PluginMeta;
439
- readonly docsDir: string;
440
- readonly rootDir: string;
441
- }
442
- interface PluginLogger {
443
- info(message: string): void;
444
- warn(message: string): void;
445
- error(message: string | Error): void;
446
- debug(message: string): void;
447
- }
448
- interface PluginStore {
449
- get<T = unknown>(pluginName: string, key: string): T | undefined;
450
- set(pluginName: string, key: string, value: unknown): void;
451
- has(pluginName: string, key: string): boolean;
452
- }
453
- interface PluginMeta {
454
- name: string;
455
- version?: string;
456
- boltdocsVersion?: string;
457
- }
458
- interface PluginLifecycleHooks {
459
- beforeBuild?: (ctx: PluginContext) => Promise<void> | void;
460
- afterBuild?: (ctx: PluginContext) => Promise<void> | void;
461
- beforeDev?: (ctx: PluginContext) => Promise<void> | void;
462
- afterDev?: (ctx: PluginContext) => Promise<void> | void;
463
- buildEnd?: (ctx: PluginContext) => Promise<void> | void;
464
- transformSource?: (ctx: PluginContext, params: {
465
- code: string;
466
- filePath: string;
467
- }) => Promise<{
468
- code: string;
469
- }> | {
470
- code: string;
471
- };
472
- transformMdx?: (ctx: PluginContext, params: {
473
- code: string;
474
- filePath: string;
475
- }) => Promise<{
476
- code: string;
477
- }> | {
478
- code: string;
479
- };
480
- transformHtml?: (ctx: PluginContext, params: {
481
- html: string;
482
- path: string;
483
- }) => Promise<{
484
- html: string;
485
- }> | {
486
- html: string;
487
- };
488
- }
489
48
  interface SecureBoltdocsPlugin {
490
49
  name: string;
491
50
  enforce?: 'pre' | 'post';
@@ -550,7 +109,9 @@ declare class PluginLifecycleManager {
550
109
  private store;
551
110
  private docsDir;
552
111
  private rootDir;
553
- constructor(plugins: SecureBoltdocsPlugin[], config: BoltdocsConfig, docsDir?: string, rootDir?: string);
112
+ private routes;
113
+ private outDir;
114
+ constructor(plugins: SecureBoltdocsPlugin[], config: BoltdocsConfig, docsDir?: string, rootDir?: string, routes?: RouteMeta[], outDir?: string);
554
115
  runHook(hookName: keyof PluginLifecycleHooks, ...args: unknown[]): Promise<void>;
555
116
  runChain<TParams>(hookName: keyof PluginLifecycleHooks, initialParams: TParams): Promise<TParams>;
556
117
  private getSortedPlugins;
@@ -681,18 +242,6 @@ interface ElementNode {
681
242
  children?: any[];
682
243
  }
683
244
  //#endregion
684
- //#region src/node/mdx/shiki-adapter.d.ts
685
- interface ParsedMeta {
686
- title?: string;
687
- lineNumbers?: boolean;
688
- wordWrap?: boolean;
689
- [key: string]: any;
690
- }
691
- /**
692
- * Parses a meta string into a structured ParsedMeta object.
693
- */
694
- declare function parseMetaString(metaStr: string): ParsedMeta;
695
- //#endregion
696
245
  //#region src/node/plugins/plugin-utils.d.ts
697
246
  interface NodeWithHProperties extends Node {
698
247
  data?: {
@@ -774,18 +323,12 @@ declare function normalizePath(p: string): string;
774
323
  */
775
324
  declare function sanitizeFilename(name: string): string;
776
325
  //#endregion
777
- //#region src/node/cache.d.ts
778
- /**
779
- * Flushes all pending background cache operations.
780
- */
781
- declare function flushCache(): Promise<void>;
782
- //#endregion
783
326
  //#region src/node/index.d.ts
784
327
  declare function boltdocs(options?: BoltdocsPluginOptions): Promise<Plugin[]>;
785
328
  /**
786
329
  * Generates the complete Vite configuration for a Boltdocs project.
787
330
  * This is used by the Boltdocs CLI to run Vite without a user-defined vite.config.ts.
788
331
  */
789
- declare function createViteConfig(root: string, mode?: 'development' | 'production', preResolvedConfig?: BoltdocsConfig): Promise<InlineConfig>;
332
+ declare function createViteConfig(root: string, mode?: 'development' | 'production', preResolvedConfig?: BoltdocsConfig, turbo?: boolean): Promise<InlineConfig>;
790
333
  //#endregion
791
- export { type BoltdocsConfig, type BoltdocsPlugin, type BoltdocsPluginOptions, BoltdocsPluginStore, type BoltdocsThemeConfig, EXIT, MDX_NODES, NodeWithHProperties, PluginCompatibilityError, PluginContext, PluginError, PluginHookError, PluginLifecycleHooks, PluginLifecycleManager, PluginLogger, PluginMeta, PluginStore, PluginValidationError, type RouteMeta, SKIP, SecureBoltdocsPlugin, addNodeClass, createMdxAttribute, createMdxElement, createPlugin, createRehypeElement, createViteConfig, boltdocs as default, defineConfig, flushCache, generateEntryCode, generateRoutes, getNodeProperty, handleAwsFeedback, handleFeedback, handleNetlifyFeedback, handleVercelFeedback, handleWebFeedback, hasNodeClass, invalidateRouteCache, normalizePath, parseMetaString, removeNodeClass, resolveConfig, sanitizeFilename, setNodeProperty, validatePlugins, visitMdxElements, visitNodes, visitRehypeElements, visitRemarkHeadings, visitRemarkLinks };
334
+ export { type BoltdocsConfig, type BoltdocsPlugin, type BoltdocsPluginOptions, BoltdocsPluginStore, type BoltdocsThemeConfig, EXIT, MDX_NODES, NodeWithHProperties, PluginCompatibilityError, type PluginContext, PluginError, PluginHookError, type PluginLifecycleHooks, PluginLifecycleManager, type PluginLogger, type PluginMeta, type PluginStore, PluginValidationError, type RouteMeta, SKIP, SecureBoltdocsPlugin, addNodeClass, createMdxAttribute, createMdxElement, createPlugin, createRehypeElement, createViteConfig, boltdocs as default, defineConfig, flushCache, generateEntryCode, generateRoutes, getNodeProperty, handleAwsFeedback, handleFeedback, handleNetlifyFeedback, handleVercelFeedback, handleWebFeedback, hasNodeClass, invalidateRouteCache, normalizePath, parseMetaString, removeNodeClass, resolveConfig, sanitizeFilename, setNodeProperty, validatePlugins, visitMdxElements, visitNodes, visitRehypeElements, visitRemarkHeadings, visitRemarkLinks };