boltdocs 3.0.1 → 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.
- package/README.md +2 -18
- package/dist/{adapters-C5AWWGfb.cjs → adapters-uGz-UKQa.cjs} +1 -1
- package/dist/{banner-DNSkgUsO.d.cts → banner-DdSgCs4G.d.cts} +1 -1
- package/dist/{banner-CfdalYLL.d.ts → banner-DjujkctF.d.ts} +1 -1
- package/dist/cache-B0C2i0yP.mjs +6 -0
- package/dist/cache-CfRTUzWC.cjs +6 -0
- package/dist/chunk-hT5z_Zn9-DsJawvsz.mjs +6 -0
- package/dist/chunk-hT5z_Zn9-SKz6VFXu.cjs +6 -0
- package/dist/client/index.cjs +227 -101
- package/dist/client/index.d.cts +57 -16
- package/dist/client/index.d.ts +57 -16
- package/dist/client/index.js +227 -102
- package/dist/client/mdx.cjs +1 -1
- package/dist/client/mdx.js +1 -1
- package/dist/client/primitives.cjs +4 -4
- package/dist/client/primitives.d.cts +1 -1
- package/dist/client/primitives.d.ts +1 -1
- package/dist/client/primitives.js +4 -4
- package/dist/client/theme/neutral.css +1 -3
- package/dist/{config-JGkMJoJQ.cjs → config-BxsogK5A.cjs} +1 -1
- package/dist/config-DAgpZyh6.mjs +7 -0
- package/dist/config-DrRQYDCI.cjs +7 -0
- package/dist/{docs-layout-3TpAt6MB.cjs → docs-layout-D1buSdua.cjs} +1 -1
- package/dist/{docs-layout-6FQ8__ok.js → docs-layout-DyLDBwS6.js} +1 -1
- package/dist/{doctor-DQxLM202.cjs → doctor-BadGEhXv.cjs} +1 -1
- package/dist/{doctor-BR1B2Mkz.cjs → doctor-DPDcRKM1.cjs} +1 -1
- package/dist/{doctor-3MheVMwd.mjs → doctor-vDsUDgqp.mjs} +1 -1
- package/dist/escape-string-regexp-AG8q1e25-9Un9V90q.mjs +6 -0
- package/dist/escape-string-regexp-AG8q1e25-bJ9Ixe7c.cjs +6 -0
- package/dist/esm-shims-DSep1HcR.mjs +6 -0
- package/dist/{icons-dev-kJyGWNeg.js → icons-dev-CHZOwhQA.js} +8 -3
- package/dist/{icons-dev-BryEFkJu.cjs → icons-dev-YtDoLUsb.cjs} +8 -3
- package/dist/{image-C9md50h2.js → image-5WsgWYTh.js} +2 -2
- package/dist/{image-CR6UlaI5.cjs → image-Hb105Gu6.cjs} +2 -2
- package/dist/lib-BR0SoanK-CLswltLI.cjs +6 -0
- package/dist/lib-BR0SoanK-DcYeDrE6.mjs +6 -0
- package/dist/lib-DPoCz1YB-CLYXwKST.cjs +6 -0
- package/dist/lib-DPoCz1YB-CyGOqgSO.mjs +6 -0
- package/dist/{mdx-DhyMkc35.js → mdx-Bv-pS6-O.js} +6 -2
- package/dist/{mdx-DJBg5DuL.cjs → mdx-CDUcJmye.cjs} +6 -2
- package/dist/micromark-util-character-5KqJafVT-C6gnc770.cjs +6 -0
- package/dist/micromark-util-character-5KqJafVT-DkPKsbgn.mjs +6 -0
- package/dist/node/cache.cjs +6 -0
- package/dist/node/cache.d.cts +83 -0
- package/dist/node/cache.d.mts +83 -0
- package/dist/node/cache.mjs +6 -0
- package/dist/node/cli-entry.cjs +3 -3
- package/dist/node/cli-entry.mjs +3 -3
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +10 -467
- package/dist/node/index.d.mts +12 -468
- package/dist/node/index.mjs +1 -1
- package/dist/node/mdx/shiki-adapter.cjs +6 -0
- package/dist/node/mdx/shiki-adapter.d.cts +3 -0
- package/dist/node/mdx/shiki-adapter.d.mts +3 -0
- package/dist/node/mdx/shiki-adapter.mjs +6 -0
- package/dist/node-BDBv8CT6.mjs +104 -0
- package/dist/node-DFV_FV0y.mjs +6 -0
- package/dist/node-DqsP7kXz.cjs +6 -0
- package/dist/node-yFmAavND.cjs +104 -0
- package/dist/{package-BovY3RQH.mjs → package-CoHWTf0N.mjs} +1 -1
- package/dist/{package-DnyxhwD-.cjs → package-_-Oa8-qN.cjs} +1 -1
- package/dist/{parser-D0QHIQsi.mjs → parser-BZJgAa9E.mjs} +1 -1
- package/dist/{parser-CNIPHx4s.cjs → parser-DlanzESE.cjs} +1 -1
- package/dist/plugin-BVuwx5D9.cjs +73 -0
- package/dist/plugin-BoxD91Yh.mjs +73 -0
- package/dist/rehype-slug--ZOxZ-_K-BNeYC4aT.cjs +6 -0
- package/dist/rehype-slug--ZOxZ-_K-CjIQEJCs.mjs +6 -0
- package/dist/remark-frontmatter-wFYRLcCt-CutW0gA3.mjs +8 -0
- package/dist/remark-frontmatter-wFYRLcCt-ENB5qG3y.cjs +8 -0
- package/dist/remark-gfm-B8TMkQbX-CjUJo8Rd.cjs +21 -0
- package/dist/remark-gfm-B8TMkQbX-Ctu0VV1_.mjs +21 -0
- package/dist/rollup-DMqoG11U-CKcJ37u_.mjs +59 -0
- package/dist/rollup-DMqoG11U-DKdxvZIj.cjs +59 -0
- package/dist/routes-BN2XbGcT.mjs +6 -0
- package/dist/routes-Cnq8xTCv.cjs +6 -0
- package/dist/{routes-BajCwrvX.cjs → routes-D_S9kjkS.cjs} +1 -1
- package/dist/{search-dialog-cHJoKjts.cjs → search-dialog-BIuxGQsg.cjs} +1 -1
- package/dist/{search-dialog-CwNh8lIN.cjs → search-dialog-BbtxA1uT.cjs} +12 -10
- package/dist/{search-dialog-D4rplZMv.cjs → search-dialog-BpNULmrl.cjs} +1 -1
- package/dist/{search-dialog-DoGobmuG.js → search-dialog-DC7oXU-5.js} +12 -10
- package/dist/{search-dialog-DaeSPvEo.js → search-dialog-PJrFRU5G.js} +1 -1
- package/dist/{search-dialog-CQneRo8T.js → search-dialog-gp9lrJXm.js} +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.mts +1 -1
- package/dist/shiki-adapter-CK3llqw2.mjs +6 -0
- package/dist/shiki-adapter-fS94vy-z.d.mts +534 -0
- package/dist/shiki-adapter-l2kEP5rn.d.cts +534 -0
- package/dist/{sidebar-BAKgJ-Er.d.ts → sidebar-DH2iPKXM.d.cts} +187 -10
- package/dist/{sidebar-7gIifpBX.d.cts → sidebar-DknLUI1R.d.ts} +187 -10
- package/package.json +15 -4
- package/src/shared/types.ts +177 -10
- package/dist/cache-DETwlACe.cjs +0 -6
- package/dist/cache-SF59enb3.mjs +0 -6
- package/dist/config-B5uVv5q4.cjs +0 -7
- package/dist/config-D3_zDkHh.mjs +0 -7
- package/dist/node-Ct4PB0S_.mjs +0 -105
- package/dist/node-joF9IMNr.cjs +0 -105
- package/dist/plugin-DeOYQvry.cjs +0 -68
- package/dist/plugin-IBKz7CRF.mjs +0 -68
- package/dist/routes-CyrnmVuG.mjs +0 -6
- package/dist/routes-D6Tuu7Fs.cjs +0 -6
- package/dist/shiki-adapter-CXEGRnjr.mjs +0 -6
- package/dist/shiki-adapter-Mr8_oT_9.cjs +0 -6
- /package/dist/{csp-CBysWlAf.cjs → csp-BX06rvdg.cjs} +0 -0
- /package/dist/{csp-gaZ51xzq.mjs → csp-z2D0FuRW.mjs} +0 -0
- /package/dist/{generator-DtUU3Cfk.cjs → generator-BN75lJOv.cjs} +0 -0
- /package/dist/{handler-Dzf4dSnV.cjs → handler-1LRMYeI4.cjs} +0 -0
- /package/dist/{headers-CXyf0auY.mjs → headers-CL0pMcwm.mjs} +0 -0
- /package/dist/{headers-BXKxiPUv.cjs → headers-YpD10rDb.cjs} +0 -0
- /package/dist/{index-CdJv4ocW.d.mts → index-DJYJzs-Z.d.mts} +0 -0
- /package/dist/{meta-loader-C4Hu9RN9.mjs → meta-loader-Bq-MjTXB.mjs} +0 -0
- /package/dist/{meta-loader-C9MKjAs0.cjs → meta-loader-CTB62-Mo.cjs} +0 -0
package/src/shared/types.ts
CHANGED
|
@@ -2,18 +2,90 @@ import type { Plugin as VitePlugin } from 'vite'
|
|
|
2
2
|
import type { ComponentType } from 'react'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Metadata representing a single documentation route.
|
|
6
|
+
* This information is used to build the client-side router and the sidebar navigation.
|
|
6
7
|
*/
|
|
7
|
-
export interface
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
export interface RouteMeta {
|
|
9
|
+
/** The final URL path for the route (e.g., '/docs/guide/start') */
|
|
10
|
+
path: string
|
|
11
|
+
/** The absolute filesystem path to the source markdown/mdx file */
|
|
12
|
+
componentPath: string
|
|
13
|
+
/** The title of the page, usually extracted from frontmatter or the filename */
|
|
14
|
+
title: string
|
|
15
|
+
/** The relative path from the docs directory, used for edit links */
|
|
16
|
+
filePath: string
|
|
17
|
+
/** Optional description of the page (for SEO/meta tags) */
|
|
18
|
+
description?: string
|
|
19
|
+
/** Optional explicit position for ordering in the sidebar */
|
|
20
|
+
sidebarPosition?: number
|
|
21
|
+
/** The group (directory) this route belongs to */
|
|
22
|
+
group?: string
|
|
23
|
+
/** The display title for the route's group */
|
|
24
|
+
groupTitle?: string
|
|
25
|
+
/** Optional explicit position for ordering the group itself */
|
|
26
|
+
groupPosition?: number
|
|
27
|
+
/** Optional icon for the route's group */
|
|
28
|
+
groupIcon?: string
|
|
29
|
+
/** The sub-route group this route belongs to (from folders starting with _) */
|
|
30
|
+
subRouteGroup?: string
|
|
31
|
+
/** Extracted markdown headings for search indexing */
|
|
32
|
+
headings?: { level: number; text: string; id: string }[]
|
|
33
|
+
/** The locale this route belongs to, if i18n is configured */
|
|
34
|
+
locale?: string
|
|
35
|
+
/** The version this route belongs to, if versioning is configured */
|
|
36
|
+
version?: string
|
|
37
|
+
/** Optional badge to display next to the sidebar item (e.g., 'New', 'Experimental') */
|
|
38
|
+
badge?: BadgeValue
|
|
39
|
+
/** Optional icon to display (Lucide icon name or raw SVG) */
|
|
40
|
+
icon?: string
|
|
41
|
+
/** The tab this route belongs to, if tabs are configured */
|
|
42
|
+
tab?: string
|
|
43
|
+
/** The collection this route belongs to (from [name] directories like [blog]) */
|
|
44
|
+
collection?: string
|
|
45
|
+
/** Tags for blog posts or other taxonomy */
|
|
46
|
+
tags?: string[]
|
|
47
|
+
/** Author identifier for blog posts */
|
|
48
|
+
author?: string
|
|
49
|
+
/** Draft flag — excluded from production builds */
|
|
50
|
+
draft?: boolean
|
|
51
|
+
/** Feature flags required for this page to be visible */
|
|
52
|
+
featureFlags?: string[]
|
|
53
|
+
/** Short excerpt/summary for list displays */
|
|
54
|
+
excerpt?: string
|
|
55
|
+
/** Cover image for blog posts */
|
|
56
|
+
coverImage?: string
|
|
57
|
+
/** The extracted plain-text content of the page for search indexing */
|
|
58
|
+
_content?: string
|
|
59
|
+
/** The raw markdown content of the page */
|
|
60
|
+
_rawContent?: string
|
|
61
|
+
/** Extracted SEO and Open Graph metadata from frontmatter */
|
|
62
|
+
seo?: Record<string, any>
|
|
63
|
+
/** The publication date */
|
|
64
|
+
date?: string | Date
|
|
65
|
+
/** The last updated timestamp or date */
|
|
66
|
+
lastUpdated?: string | number | Date
|
|
67
|
+
/** Optional category for the page */
|
|
68
|
+
category?: string
|
|
69
|
+
/** Optional explicit order (alternative to sidebarPosition) */
|
|
70
|
+
order?: number
|
|
71
|
+
/** Optional explicit label for the sidebar */
|
|
72
|
+
sidebarLabel?: string
|
|
73
|
+
/** Whether the page is hidden from the sidebar */
|
|
74
|
+
sidebarHidden?: boolean
|
|
75
|
+
/** Raw extensible frontmatter data for custom components and formatters */
|
|
76
|
+
frontmatter?: Record<string, any>
|
|
77
|
+
/** Optional recursive child routes for deep sidebar hierarchies */
|
|
78
|
+
subRoutes?: RouteMeta[]
|
|
79
|
+
/** Clean URL segments stripped of locale/version prefixes */
|
|
80
|
+
slugParts?: string[]
|
|
10
81
|
}
|
|
11
82
|
|
|
12
83
|
/**
|
|
13
|
-
*
|
|
84
|
+
* Represents a single social link in the configuration.
|
|
14
85
|
*/
|
|
15
|
-
export interface
|
|
16
|
-
|
|
86
|
+
export interface BoltdocsSocialLink {
|
|
87
|
+
icon: 'discord' | 'x' | 'github' | 'bluesky' | string
|
|
88
|
+
link: string
|
|
17
89
|
}
|
|
18
90
|
|
|
19
91
|
/**
|
|
@@ -48,7 +120,6 @@ export interface BoltdocsThemeConfig {
|
|
|
48
120
|
{ title?: string | Record<string, string>; icon?: string }
|
|
49
121
|
>
|
|
50
122
|
socialLinks?: BoltdocsSocialLink[]
|
|
51
|
-
footer?: BoltdocsFooterConfig
|
|
52
123
|
editLink?: string
|
|
53
124
|
communityHelp?: string
|
|
54
125
|
version?: string
|
|
@@ -129,6 +200,79 @@ export interface BoltdocsVersionsConfig {
|
|
|
129
200
|
*/
|
|
130
201
|
export type BadgeValue = string | { text: string; expires?: string }
|
|
131
202
|
|
|
203
|
+
/**
|
|
204
|
+
* Context provided to plugin lifecycle hooks.
|
|
205
|
+
*/
|
|
206
|
+
export interface PluginContext {
|
|
207
|
+
readonly config: BoltdocsConfig
|
|
208
|
+
readonly logger: PluginLogger
|
|
209
|
+
readonly store: PluginStore
|
|
210
|
+
readonly meta: PluginMeta
|
|
211
|
+
readonly docsDir: string
|
|
212
|
+
readonly rootDir: string
|
|
213
|
+
readonly outDir: string
|
|
214
|
+
readonly routes: RouteMeta[]
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Logger interface for plugin logging.
|
|
219
|
+
*/
|
|
220
|
+
export interface PluginLogger {
|
|
221
|
+
info(message: string): void
|
|
222
|
+
warn(message: string): void
|
|
223
|
+
error(message: string | Error): void
|
|
224
|
+
debug(message: string): void
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Key-value store interface for plugins.
|
|
229
|
+
*/
|
|
230
|
+
export interface PluginStore {
|
|
231
|
+
get<T = unknown>(pluginName: string, key: string): T | undefined
|
|
232
|
+
set(pluginName: string, key: string, value: unknown): void
|
|
233
|
+
has(pluginName: string, key: string): boolean
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Plugin metadata provided in the context.
|
|
238
|
+
*/
|
|
239
|
+
export interface PluginMeta {
|
|
240
|
+
name: string
|
|
241
|
+
version?: string
|
|
242
|
+
boltdocsVersion?: string
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Plugin lifecycle hooks with full type safety.
|
|
247
|
+
*/
|
|
248
|
+
export interface PluginLifecycleHooks {
|
|
249
|
+
beforeBuild?: (ctx: PluginContext) => Promise<void> | void
|
|
250
|
+
afterBuild?: (ctx: PluginContext) => Promise<void> | void
|
|
251
|
+
beforeDev?: (ctx: PluginContext) => Promise<void> | void
|
|
252
|
+
afterDev?: (ctx: PluginContext) => Promise<void> | void
|
|
253
|
+
buildEnd?: (ctx: PluginContext) => Promise<void> | void
|
|
254
|
+
transformSource?: (
|
|
255
|
+
ctx: PluginContext,
|
|
256
|
+
params: { code: string; filePath: string },
|
|
257
|
+
) => Promise<{ code: string }> | { code: string }
|
|
258
|
+
transformMdx?: (
|
|
259
|
+
ctx: PluginContext,
|
|
260
|
+
params: { code: string; filePath: string },
|
|
261
|
+
) => Promise<{ code: string }> | { code: string }
|
|
262
|
+
transformHtml?: (
|
|
263
|
+
ctx: PluginContext,
|
|
264
|
+
params: { html: string; path: string },
|
|
265
|
+
) => Promise<{ html: string }> | { html: string }
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* MDX processor configuration.
|
|
270
|
+
* When `processor` is set to 'satteri', the Sätteri Rust-based compiler is used.
|
|
271
|
+
*/
|
|
272
|
+
export interface BoltdocsMdxConfig {
|
|
273
|
+
processor?: 'unified' | 'satteri'
|
|
274
|
+
}
|
|
275
|
+
|
|
132
276
|
/**
|
|
133
277
|
* Defines a Boltdocs plugin.
|
|
134
278
|
*
|
|
@@ -144,8 +288,8 @@ export interface BoltdocsPlugin {
|
|
|
144
288
|
rehypePlugins?: unknown[]
|
|
145
289
|
vitePlugins?: VitePlugin[]
|
|
146
290
|
components?: Record<string, string>
|
|
147
|
-
/** Lifecycle hooks
|
|
148
|
-
hooks?:
|
|
291
|
+
/** Lifecycle hooks with full type safety */
|
|
292
|
+
hooks?: PluginLifecycleHooks
|
|
149
293
|
}
|
|
150
294
|
|
|
151
295
|
/**
|
|
@@ -258,11 +402,21 @@ export interface BoltdocsVercelConfig {
|
|
|
258
402
|
speedInsights?: boolean
|
|
259
403
|
}
|
|
260
404
|
|
|
405
|
+
export interface BoltdocsPostHogConfig {
|
|
406
|
+
apiKey: string
|
|
407
|
+
host?: string
|
|
408
|
+
capturePageview?: boolean
|
|
409
|
+
capturePageleave?: boolean
|
|
410
|
+
sessionRecording?: boolean
|
|
411
|
+
autocapture?: boolean
|
|
412
|
+
}
|
|
413
|
+
|
|
261
414
|
export interface BoltdocsIntegrationsConfig {
|
|
262
415
|
analytics?: {
|
|
263
416
|
ga4?: BoltdocsGA4Config
|
|
264
417
|
vercel?: BoltdocsVercelConfig
|
|
265
418
|
gtm?: BoltdocsGTMConfig
|
|
419
|
+
posthog?: BoltdocsPostHogConfig
|
|
266
420
|
}
|
|
267
421
|
search?: {
|
|
268
422
|
algolia?: BoltdocsAlgoliaConfig
|
|
@@ -273,6 +427,16 @@ export interface BoltdocsIntegrationsConfig {
|
|
|
273
427
|
}
|
|
274
428
|
}
|
|
275
429
|
|
|
430
|
+
/**
|
|
431
|
+
* Configuration for drafts visibility control.
|
|
432
|
+
*/
|
|
433
|
+
export interface BoltdocsDraftsConfig {
|
|
434
|
+
/** If true, drafts are visible in all environments. Default: false */
|
|
435
|
+
visible?: boolean
|
|
436
|
+
/** Environments where drafts are visible (e.g. ['development', 'staging']). Default: [] */
|
|
437
|
+
environments?: string[]
|
|
438
|
+
}
|
|
439
|
+
|
|
276
440
|
/**
|
|
277
441
|
* The root configuration object for Boltdocs.
|
|
278
442
|
*/
|
|
@@ -283,12 +447,15 @@ export interface BoltdocsConfig {
|
|
|
283
447
|
theme?: BoltdocsThemeConfig
|
|
284
448
|
i18n?: BoltdocsI18nConfig
|
|
285
449
|
versions?: BoltdocsVersionsConfig
|
|
450
|
+
mdx?: BoltdocsMdxConfig
|
|
286
451
|
plugins?: BoltdocsPlugin[]
|
|
287
452
|
collections?: BoltdocsCollectionsConfig
|
|
288
453
|
robots?: BoltdocsRobotsConfig
|
|
289
454
|
security?: BoltdocsSecurityConfig
|
|
290
455
|
seo?: BoltdocsSeoConfig
|
|
291
456
|
integrations?: BoltdocsIntegrationsConfig
|
|
457
|
+
drafts?: BoltdocsDraftsConfig
|
|
458
|
+
featureFlags?: Record<string, boolean | string>
|
|
292
459
|
directoryMeta?: Record<string, unknown>
|
|
293
460
|
vite?: unknown
|
|
294
461
|
}
|
package/dist/cache-DETwlACe.cjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
-
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
const e=require(`./chunk-Ds5LZdWN.cjs`),t=require(`./utils-Bz1tG9Dg.cjs`);let n=require(`node:path`);n=e.n(n);let r=require(`node:fs`);r=e.n(r);let i=require(`node:fs/promises`);i=e.n(i);let a=require(`node:crypto`);a=e.n(a);let o=require(`node:zlib`);o=e.n(o);let s=require(`node:util`),c=require(`lru-cache`);const l=i.default.writeFile,u=i.default.readFile,d=i.default.mkdir,f=i.default.rename,p=(0,s.promisify)(o.default.gzip),m=(0,s.promisify)(o.default.gunzip),h=new class{activeTasks=new Set;add(e){let t=Promise.resolve().then(e).catch(()=>{}).finally(()=>{this.activeTasks.delete(t)});this.activeTasks.add(t)}async flush(){await Promise.all(Array.from(this.activeTasks))}get pending(){return this.activeTasks.size}};var g=class{entries=new Map;cachePath=null;compress;constructor(e={}){let r=t.o();if(this.compress=e.compress===void 0?r.compress:e.compress,e.name){let t=e.root||process.cwd(),i=this.compress?`json.gz`:`json`;this.cachePath=n.default.resolve(t,r.dir,`${e.name}.${i}`)}}async load(){if(!t.o().noCache&&this.cachePath)try{let e=await u(this.cachePath);this.cachePath.endsWith(`.gz`)&&(e=await m(e));let t=JSON.parse(e.toString(`utf-8`));this.entries=new Map(Object.entries(t))}catch(e){if(e.code===`ENOENT`)return}}save(){if(t.o().noCache||!this.cachePath)return;let e=Object.fromEntries(this.entries),r=JSON.stringify(e),i=this.cachePath,o=this.compress;h.add(async()=>{try{await d(n.default.dirname(i),{recursive:!0});let e=Buffer.from(r);o&&(e=await p(e));let t=`${i}.${a.default.randomBytes(4).toString(`hex`)}.tmp`;await l(t,e),await f(t,i)}catch{}})}get(e){let n=this.entries.get(e);return!n||t.s(e)!==n.mtime?null:n.data}getStale(e){let t=this.entries.get(e);return t?t.data:null}set(e,n){this.entries.set(e,{data:n,mtime:t.s(e)})}isValid(e){let n=this.entries.get(e);return n?t.s(e)===n.mtime:!1}invalidate(e){this.entries.delete(e)}invalidateAll(){this.entries.clear()}pruneStale(e){for(let t of this.entries.keys())e.has(t)||this.entries.delete(t)}get size(){return this.entries.size}async flush(){await h.flush()}},_=class{index=new Map;memoryCache;baseDir;shardsDir;indexPath;saveTimeout=null;constructor(e,r=process.cwd()){let i=t.o();this.baseDir=n.default.resolve(r,i.dir,`transform-${e}`),this.shardsDir=n.default.resolve(this.baseDir,`shards`),this.indexPath=n.default.resolve(this.baseDir,`index.json`),this.memoryCache=new c.LRUCache({max:i.lruLimit,ttl:i.lruTTL,updateAgeOnGet:!0})}async load(){if(!t.o().noCache)try{let e=await u(this.indexPath,`utf-8`);this.index=new Map(Object.entries(JSON.parse(e)))}catch(e){if(e.code===`ENOENT`)return}}save(){if(t.o().noCache)return;let e=JSON.stringify(Object.fromEntries(this.index)),r=this.indexPath;h.add(async()=>{try{await d(n.default.dirname(r),{recursive:!0}),await l(r,e)}catch{}})}async getMany(e){let t=new Map,r=[];for(let n of e){let e=this.memoryCache.get(n);e?t.set(n,e):this.index.has(n)&&r.push(n)}if(r.length>0){let e=await Promise.all(r.map(async e=>{let t=this.index.get(e),r=n.default.resolve(this.shardsDir,`${t}.gz`);try{let t=(await m(await u(r))).toString(`utf-8`);return this.memoryCache.set(e,t),{key:e,val:t}}catch{return null}}));for(let n of e)n&&t.set(n.key,n.val)}return t}async getAsync(e){let t=this.memoryCache.get(e);if(t)return t;let r=this.index.get(e);if(!r)return null;let i=n.default.resolve(this.shardsDir,`${r}.gz`);try{let t=(await m(await u(i))).toString(`utf-8`);return this.memoryCache.set(e,t),t}catch(e){return e.code,null}}set(e,t){let r=a.default.createHash(`md5`).update(t).digest(`hex`);this.index.set(e,r),this.memoryCache.set(e,t);let o=n.default.resolve(this.shardsDir,`${r}.gz`);h.add(async()=>{try{try{await i.default.access(o);return}catch{}await d(this.shardsDir,{recursive:!0});let e=await p(Buffer.from(t)),n=`${o}.${a.default.randomBytes(4).toString(`hex`)}.tmp`;await l(n,e),await f(n,o)}catch{}}),this.saveTimeout&&clearTimeout(this.saveTimeout),this.saveTimeout=setTimeout(()=>{this.save()},500),typeof this.saveTimeout.unref==`function`&&this.saveTimeout.unref()}get size(){return this.index.size}async flush(){await h.flush()}};async function v(){await h.flush()}const y=new Map,b=()=>{let e=t.o();return n.default.resolve(process.cwd(),e.dir,`parser`)},x=`v2.5`;var S=class{static async get(e){if(t.o().noCache)return null;try{let t=await r.default.promises.stat(e),i=y.get(e);if(i&&i.mtime===t.mtimeMs)return i.data;let o=b(),s=a.default.createHash(`md5`).update(e).digest(`hex`),c=n.default.join(o,`${s}.json`);try{let n=await r.default.promises.readFile(c,`utf-8`),i=JSON.parse(n);return i._mtime!==t.mtimeMs||i._v!==x?null:(y.set(e,{data:i.data,mtime:i._mtime}),i.data)}catch{return null}}catch{return null}}static async set(e,i){if(!t.o().noCache)try{let t=await r.default.promises.stat(e);y.set(e,{data:i,mtime:t.mtimeMs});let o=b(),s=a.default.createHash(`md5`).update(e).digest(`hex`),c=n.default.join(o,`${s}.json`),l={_v:x,_mtime:t.mtimeMs,data:i};h.add(async()=>{try{await r.default.promises.mkdir(o,{recursive:!0}),await r.default.promises.writeFile(c,JSON.stringify(l))}catch{}})}catch{}}static invalidate(e){y.delete(e)}static clear(){y.clear();let e=b();if(r.default.existsSync(e))try{r.default.rmSync(e,{recursive:!0,force:!0})}catch{}}};Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return S}});
|
package/dist/cache-SF59enb3.mjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
-
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
import{o as e,s as t}from"./utils-B3xYMrpK.mjs";import n from"node:path";import r from"node:fs";import i from"node:fs/promises";import a from"node:crypto";import o from"node:zlib";import{promisify as s}from"node:util";import{LRUCache as c}from"lru-cache";const l=i.writeFile,u=i.readFile,d=i.mkdir,f=i.rename,p=s(o.gzip),m=s(o.gunzip),h=new class{activeTasks=new Set;add(e){let t=Promise.resolve().then(e).catch(()=>{}).finally(()=>{this.activeTasks.delete(t)});this.activeTasks.add(t)}async flush(){await Promise.all(Array.from(this.activeTasks))}get pending(){return this.activeTasks.size}};var g=class{entries=new Map;cachePath=null;compress;constructor(t={}){let r=e();if(this.compress=t.compress===void 0?r.compress:t.compress,t.name){let e=t.root||process.cwd(),i=this.compress?`json.gz`:`json`;this.cachePath=n.resolve(e,r.dir,`${t.name}.${i}`)}}async load(){if(!e().noCache&&this.cachePath)try{let e=await u(this.cachePath);this.cachePath.endsWith(`.gz`)&&(e=await m(e));let t=JSON.parse(e.toString(`utf-8`));this.entries=new Map(Object.entries(t))}catch(e){if(e.code===`ENOENT`)return}}save(){if(e().noCache||!this.cachePath)return;let t=Object.fromEntries(this.entries),r=JSON.stringify(t),i=this.cachePath,o=this.compress;h.add(async()=>{try{await d(n.dirname(i),{recursive:!0});let e=Buffer.from(r);o&&(e=await p(e));let t=`${i}.${a.randomBytes(4).toString(`hex`)}.tmp`;await l(t,e),await f(t,i)}catch{}})}get(e){let n=this.entries.get(e);return!n||t(e)!==n.mtime?null:n.data}getStale(e){let t=this.entries.get(e);return t?t.data:null}set(e,n){this.entries.set(e,{data:n,mtime:t(e)})}isValid(e){let n=this.entries.get(e);return n?t(e)===n.mtime:!1}invalidate(e){this.entries.delete(e)}invalidateAll(){this.entries.clear()}pruneStale(e){for(let t of this.entries.keys())e.has(t)||this.entries.delete(t)}get size(){return this.entries.size}async flush(){await h.flush()}},_=class{index=new Map;memoryCache;baseDir;shardsDir;indexPath;saveTimeout=null;constructor(t,r=process.cwd()){let i=e();this.baseDir=n.resolve(r,i.dir,`transform-${t}`),this.shardsDir=n.resolve(this.baseDir,`shards`),this.indexPath=n.resolve(this.baseDir,`index.json`),this.memoryCache=new c({max:i.lruLimit,ttl:i.lruTTL,updateAgeOnGet:!0})}async load(){if(!e().noCache)try{let e=await u(this.indexPath,`utf-8`);this.index=new Map(Object.entries(JSON.parse(e)))}catch(e){if(e.code===`ENOENT`)return}}save(){if(e().noCache)return;let t=JSON.stringify(Object.fromEntries(this.index)),r=this.indexPath;h.add(async()=>{try{await d(n.dirname(r),{recursive:!0}),await l(r,t)}catch{}})}async getMany(e){let t=new Map,r=[];for(let n of e){let e=this.memoryCache.get(n);e?t.set(n,e):this.index.has(n)&&r.push(n)}if(r.length>0){let e=await Promise.all(r.map(async e=>{let t=this.index.get(e),r=n.resolve(this.shardsDir,`${t}.gz`);try{let t=(await m(await u(r))).toString(`utf-8`);return this.memoryCache.set(e,t),{key:e,val:t}}catch{return null}}));for(let n of e)n&&t.set(n.key,n.val)}return t}async getAsync(e){let t=this.memoryCache.get(e);if(t)return t;let r=this.index.get(e);if(!r)return null;let i=n.resolve(this.shardsDir,`${r}.gz`);try{let t=(await m(await u(i))).toString(`utf-8`);return this.memoryCache.set(e,t),t}catch(e){return e.code,null}}set(e,t){let r=a.createHash(`md5`).update(t).digest(`hex`);this.index.set(e,r),this.memoryCache.set(e,t);let o=n.resolve(this.shardsDir,`${r}.gz`);h.add(async()=>{try{try{await i.access(o);return}catch{}await d(this.shardsDir,{recursive:!0});let e=await p(Buffer.from(t)),n=`${o}.${a.randomBytes(4).toString(`hex`)}.tmp`;await l(n,e),await f(n,o)}catch{}}),this.saveTimeout&&clearTimeout(this.saveTimeout),this.saveTimeout=setTimeout(()=>{this.save()},500),typeof this.saveTimeout.unref==`function`&&this.saveTimeout.unref()}get size(){return this.index.size}async flush(){await h.flush()}};async function v(){await h.flush()}const y=new Map,b=()=>{let t=e();return n.resolve(process.cwd(),t.dir,`parser`)},x=`v2.5`;var S=class{static async get(t){if(e().noCache)return null;try{let e=await r.promises.stat(t),i=y.get(t);if(i&&i.mtime===e.mtimeMs)return i.data;let o=b(),s=a.createHash(`md5`).update(t).digest(`hex`),c=n.join(o,`${s}.json`);try{let n=await r.promises.readFile(c,`utf-8`),i=JSON.parse(n);return i._mtime!==e.mtimeMs||i._v!==x?null:(y.set(t,{data:i.data,mtime:i._mtime}),i.data)}catch{return null}}catch{return null}}static async set(t,i){if(!e().noCache)try{let e=await r.promises.stat(t);y.set(t,{data:i,mtime:e.mtimeMs});let o=b(),s=a.createHash(`md5`).update(t).digest(`hex`),c=n.join(o,`${s}.json`),l={_v:x,_mtime:e.mtimeMs,data:i};h.add(async()=>{try{await r.promises.mkdir(o,{recursive:!0}),await r.promises.writeFile(c,JSON.stringify(l))}catch{}})}catch{}}static invalidate(e){y.delete(e)}static clear(){y.clear();let e=b();if(r.existsSync(e))try{r.rmSync(e,{recursive:!0,force:!0})}catch{}}};export{v as i,g as n,_ as r,S as t};
|
package/dist/config-B5uVv5q4.cjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
-
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
const e=require(`./chunk-Ds5LZdWN.cjs`),t=require(`./errors-Dx6JHoKE.cjs`),n=require(`./types-generator-CYcHkDzZ.cjs`);let r=require(`node:path`);r=e.n(r);let i=require(`node:fs`);i=e.n(i);let a=require(`zod`),o=require(`@bdocs/dui`);function s(e){return e}const c=a.z.object({icon:a.z.string().max(50),link:a.z.string().url()});a.z.object({text:a.z.string().max(2e3).optional()});const l=a.z.object({name:a.z.string(),enforce:a.z.enum([`pre`,`post`]).optional(),version:a.z.string().optional(),boltdocsVersion:a.z.string().optional(),remarkPlugins:a.z.array(a.z.unknown()).optional(),rehypePlugins:a.z.array(a.z.unknown()).optional(),vitePlugins:a.z.array(a.z.unknown()).optional(),components:a.z.record(a.z.string(),a.z.string()).optional(),hooks:a.z.record(a.z.string(),a.z.unknown()).optional()}),u=a.z.object({title:a.z.union([a.z.string(),a.z.record(a.z.string(),a.z.string())]).optional(),description:a.z.union([a.z.string(),a.z.record(a.z.string(),a.z.string())]).optional(),logo:a.z.union([a.z.string(),a.z.object({dark:a.z.string(),light:a.z.string(),alt:a.z.string().optional(),width:a.z.number().optional(),height:a.z.number().optional()})]).optional(),navbar:a.z.array(a.z.object({label:a.z.union([a.z.string(),a.z.record(a.z.string(),a.z.string())]),href:a.z.string(),items:a.z.array(a.z.object({label:a.z.union([a.z.string(),a.z.record(a.z.string(),a.z.string())]),href:a.z.string()})).optional()})).optional(),sidebar:a.z.record(a.z.string(),a.z.array(a.z.object({text:a.z.string(),link:a.z.string()}))).optional(),sidebarGroups:a.z.record(a.z.string(),a.z.object({title:a.z.union([a.z.string(),a.z.record(a.z.string(),a.z.string())]).optional(),icon:a.z.string().optional()})).optional(),socialLinks:a.z.array(c).optional(),editLink:a.z.string().refine(e=>!e||e.includes(`:path`),{message:`editLink must contain ':path' placeholder if specified`}).optional(),communityHelp:a.z.string().url().optional(),version:a.z.string().max(50).optional(),githubRepo:a.z.string().max(100).optional(),favicon:a.z.string().optional(),tabs:a.z.array(a.z.object({id:a.z.string(),text:a.z.union([a.z.string(),a.z.record(a.z.string(),a.z.string())]),icon:a.z.string().optional()})).optional(),codeTheme:a.z.union([a.z.string(),a.z.object({light:a.z.string(),dark:a.z.string()})]).optional()}),d=a.z.union([a.z.string(),a.z.object({rules:a.z.array(a.z.object({userAgent:a.z.string(),allow:a.z.union([a.z.string(),a.z.array(a.z.string())]).optional(),disallow:a.z.union([a.z.string(),a.z.array(a.z.string())]).optional()})).optional(),sitemaps:a.z.array(a.z.string().url()).optional()})]),f=a.z.object({defaultLocale:a.z.string(),locales:a.z.union([a.z.record(a.z.string(),a.z.string()),a.z.array(a.z.string())]).transform(e=>Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e),localeConfigs:a.z.record(a.z.string(),a.z.object({label:a.z.string().optional(),direction:a.z.enum([`ltr`,`rtl`]).optional(),htmlLang:a.z.string().optional(),calendar:a.z.string().optional()})).optional()}),p=a.z.object({defaultVersion:a.z.string(),prefix:a.z.string().optional(),versions:a.z.array(a.z.object({label:a.z.string(),path:a.z.string()}))}),m=a.z.object({headers:a.z.record(a.z.string(),a.z.string()).optional(),enableCSP:a.z.boolean().optional(),customHeaders:a.z.record(a.z.string(),a.z.string()).optional()}),h=a.z.object({google:a.z.string().optional(),bing:a.z.string().optional(),yandex:a.z.string().optional(),pinterest:a.z.string().optional(),facebook:a.z.string().optional()}),g=a.z.object({metatags:a.z.record(a.z.string(),a.z.string()).optional(),indexing:a.z.enum([`all`,`public`]).optional(),thumbnails:a.z.object({background:a.z.string().optional()}).optional(),verification:h.optional()}),_=a.z.object({measurementId:a.z.string().min(1,`Measurement ID is required for GA4`),debug:a.z.boolean().optional(),anonymizeIp:a.z.boolean().optional(),sendPageView:a.z.boolean().optional(),cookieFlags:a.z.string().optional(),autoTrack:a.z.object({pageViews:a.z.boolean().optional(),downloads:a.z.boolean().optional(),externalLinks:a.z.boolean().optional(),search:a.z.boolean().optional()}).optional()}),v=a.z.object({tagId:a.z.string().min(1,`Tag ID is required for GTM`),dataLayerName:a.z.string().optional(),preview:a.z.string().optional()}),y=a.z.object({appId:a.z.string().min(1,`Algolia App ID is required`),apiKey:a.z.string().min(1,`Algolia API Key is required`),indexName:a.z.string().min(1,`Algolia Index Name is required`)}),b=a.z.object({repo:a.z.string().min(1,`Giscus repository is required`),repoId:a.z.string().min(1,`Giscus repository ID is required`),category:a.z.string().optional(),categoryId:a.z.string().optional(),mapping:a.z.enum([`pathname`,`url`,`title`,`og:title`,`specific`,`number`]).optional(),strict:a.z.union([a.z.enum([`0`,`1`]),a.z.boolean()]).optional(),reactionsEnabled:a.z.union([a.z.enum([`0`,`1`]),a.z.boolean()]).optional(),emitMetadata:a.z.union([a.z.enum([`0`,`1`]),a.z.boolean()]).optional(),inputPosition:a.z.enum([`top`,`bottom`]).optional(),theme:a.z.string().optional(),darkTheme:a.z.string().optional(),lang:a.z.string().optional(),loading:a.z.enum([`lazy`,`eager`]).optional()}),x=a.z.object({enabled:a.z.boolean(),owner:a.z.string().min(1,`GitHub owner is required`),repo:a.z.string().min(1,`GitHub repository name is required`),categorySlug:a.z.string().optional(),endpoint:a.z.string().optional()}),S=a.z.object({analytics:a.z.boolean().optional(),speedInsights:a.z.boolean().optional()}),C=a.z.object({ga4:_.optional(),gtm:v.optional(),vercel:S.optional()}),w=a.z.object({algolia:y.optional()}),T=a.z.object({giscus:b.optional(),custom:x.optional()}),E=a.z.object({analytics:C.optional(),search:w.optional(),feedback:T.optional()}),D=a.z.object({siteUrl:a.z.string().url().optional(),docsDir:a.z.string().optional(),base:a.z.string().optional(),theme:u.optional(),i18n:f.optional(),versions:p.optional(),plugins:a.z.array(l).optional(),robots:d.optional(),security:m.optional(),seo:g.optional(),integrations:E.optional(),vite:a.z.record(a.z.string(),a.z.unknown()).optional()}),O=[`boltdocs.config.js`,`boltdocs.config.mjs`,`boltdocs.config.ts`];async function k(e,n=process.cwd()){let a=n,s={docsDir:r.default.resolve(e),theme:{title:`Boltdocs`,description:`A Vite documentation framework`,navbar:[{label:`Home`,href:`/`},{label:`Documentation`,href:`/docs`}],codeTheme:{light:`github-light`,dark:`github-dark`}}},c={};for(let e of O){let t=r.default.resolve(a,e);if(i.default.existsSync(t))try{let{loadConfigFromFile:e}=await import(`vite`),n=await e({command:`serve`,mode:`development`},t,a);if(n){c=n.config;break}}catch(t){(0,o.warn)(`Failed to load config from ${e}:`,t)}}let l={title:c.title,description:c.description,logo:c.logo,favicon:c.favicon,navbar:c.navbar,sidebar:c.sidebar,sidebarGroups:c.theme?.sidebarGroups,socialLinks:c.socialLinks,githubRepo:c.githubRepo,tabs:c.tabs,codeTheme:c.codeTheme,communityHelp:c.communityHelp,version:c.version,editLink:c.editLink,...c.theme||{}},u=Object.fromEntries(Object.entries(l).filter(([e,t])=>t!==void 0));u.navbar&&=u.navbar.map(e=>({label:e.label||e.text||``,href:e.href||e.link||e.to||``,items:e.items}));let d={docsDir:r.default.resolve(e),theme:{...s.theme,...u},i18n:c.i18n?{...c.i18n,locales:Array.isArray(c.i18n.locales)?Object.fromEntries(c.i18n.locales.map(e=>[e,e])):c.i18n.locales}:void 0,versions:c.versions,siteUrl:c.siteUrl,base:c.base,seo:c.seo,plugins:c.plugins||[],robots:c.robots,security:c.security,integrations:c.integrations,vite:c.vite},f=D.safeParse(d);if(!f.success)throw new t.r(`Invalid Boltdocs configuration:\n${f.error.issues.map(e=>` - ${e.path.join(`.`)}: ${e.message}`).join(`
|
|
7
|
-
`)}`);return f.data}async function A(e,t=process.cwd()){let r=await k(e,t);return n.t(r,e,t),r}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return O}});
|
package/dist/config-D3_zDkHh.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
-
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
import{t as e}from"./rolldown-runtime-fkIsjY3S.mjs";import{r as t}from"./errors-C0Hx15Ag.mjs";import{t as n}from"./types-generator-DVOnRVKU.mjs";import r from"node:path";import i from"node:fs";import{z as a}from"zod";import{warn as o}from"@bdocs/dui";function s(e){return e}const c=a.object({icon:a.string().max(50),link:a.string().url()});a.object({text:a.string().max(2e3).optional()});const l=a.object({name:a.string(),enforce:a.enum([`pre`,`post`]).optional(),version:a.string().optional(),boltdocsVersion:a.string().optional(),remarkPlugins:a.array(a.unknown()).optional(),rehypePlugins:a.array(a.unknown()).optional(),vitePlugins:a.array(a.unknown()).optional(),components:a.record(a.string(),a.string()).optional(),hooks:a.record(a.string(),a.unknown()).optional()}),u=a.object({title:a.union([a.string(),a.record(a.string(),a.string())]).optional(),description:a.union([a.string(),a.record(a.string(),a.string())]).optional(),logo:a.union([a.string(),a.object({dark:a.string(),light:a.string(),alt:a.string().optional(),width:a.number().optional(),height:a.number().optional()})]).optional(),navbar:a.array(a.object({label:a.union([a.string(),a.record(a.string(),a.string())]),href:a.string(),items:a.array(a.object({label:a.union([a.string(),a.record(a.string(),a.string())]),href:a.string()})).optional()})).optional(),sidebar:a.record(a.string(),a.array(a.object({text:a.string(),link:a.string()}))).optional(),sidebarGroups:a.record(a.string(),a.object({title:a.union([a.string(),a.record(a.string(),a.string())]).optional(),icon:a.string().optional()})).optional(),socialLinks:a.array(c).optional(),editLink:a.string().refine(e=>!e||e.includes(`:path`),{message:`editLink must contain ':path' placeholder if specified`}).optional(),communityHelp:a.string().url().optional(),version:a.string().max(50).optional(),githubRepo:a.string().max(100).optional(),favicon:a.string().optional(),tabs:a.array(a.object({id:a.string(),text:a.union([a.string(),a.record(a.string(),a.string())]),icon:a.string().optional()})).optional(),codeTheme:a.union([a.string(),a.object({light:a.string(),dark:a.string()})]).optional()}),d=a.union([a.string(),a.object({rules:a.array(a.object({userAgent:a.string(),allow:a.union([a.string(),a.array(a.string())]).optional(),disallow:a.union([a.string(),a.array(a.string())]).optional()})).optional(),sitemaps:a.array(a.string().url()).optional()})]),f=a.object({defaultLocale:a.string(),locales:a.union([a.record(a.string(),a.string()),a.array(a.string())]).transform(e=>Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e),localeConfigs:a.record(a.string(),a.object({label:a.string().optional(),direction:a.enum([`ltr`,`rtl`]).optional(),htmlLang:a.string().optional(),calendar:a.string().optional()})).optional()}),p=a.object({defaultVersion:a.string(),prefix:a.string().optional(),versions:a.array(a.object({label:a.string(),path:a.string()}))}),m=a.object({headers:a.record(a.string(),a.string()).optional(),enableCSP:a.boolean().optional(),customHeaders:a.record(a.string(),a.string()).optional()}),h=a.object({google:a.string().optional(),bing:a.string().optional(),yandex:a.string().optional(),pinterest:a.string().optional(),facebook:a.string().optional()}),g=a.object({metatags:a.record(a.string(),a.string()).optional(),indexing:a.enum([`all`,`public`]).optional(),thumbnails:a.object({background:a.string().optional()}).optional(),verification:h.optional()}),_=a.object({measurementId:a.string().min(1,`Measurement ID is required for GA4`),debug:a.boolean().optional(),anonymizeIp:a.boolean().optional(),sendPageView:a.boolean().optional(),cookieFlags:a.string().optional(),autoTrack:a.object({pageViews:a.boolean().optional(),downloads:a.boolean().optional(),externalLinks:a.boolean().optional(),search:a.boolean().optional()}).optional()}),v=a.object({tagId:a.string().min(1,`Tag ID is required for GTM`),dataLayerName:a.string().optional(),preview:a.string().optional()}),y=a.object({appId:a.string().min(1,`Algolia App ID is required`),apiKey:a.string().min(1,`Algolia API Key is required`),indexName:a.string().min(1,`Algolia Index Name is required`)}),b=a.object({repo:a.string().min(1,`Giscus repository is required`),repoId:a.string().min(1,`Giscus repository ID is required`),category:a.string().optional(),categoryId:a.string().optional(),mapping:a.enum([`pathname`,`url`,`title`,`og:title`,`specific`,`number`]).optional(),strict:a.union([a.enum([`0`,`1`]),a.boolean()]).optional(),reactionsEnabled:a.union([a.enum([`0`,`1`]),a.boolean()]).optional(),emitMetadata:a.union([a.enum([`0`,`1`]),a.boolean()]).optional(),inputPosition:a.enum([`top`,`bottom`]).optional(),theme:a.string().optional(),darkTheme:a.string().optional(),lang:a.string().optional(),loading:a.enum([`lazy`,`eager`]).optional()}),x=a.object({enabled:a.boolean(),owner:a.string().min(1,`GitHub owner is required`),repo:a.string().min(1,`GitHub repository name is required`),categorySlug:a.string().optional(),endpoint:a.string().optional()}),S=a.object({analytics:a.boolean().optional(),speedInsights:a.boolean().optional()}),C=a.object({ga4:_.optional(),gtm:v.optional(),vercel:S.optional()}),w=a.object({algolia:y.optional()}),T=a.object({giscus:b.optional(),custom:x.optional()}),E=a.object({analytics:C.optional(),search:w.optional(),feedback:T.optional()}),D=a.object({siteUrl:a.string().url().optional(),docsDir:a.string().optional(),base:a.string().optional(),theme:u.optional(),i18n:f.optional(),versions:p.optional(),plugins:a.array(l).optional(),robots:d.optional(),security:m.optional(),seo:g.optional(),integrations:E.optional(),vite:a.record(a.string(),a.unknown()).optional()});var O=e({CONFIG_FILES:()=>k,defineConfig:()=>s,resolveConfig:()=>A,resolveConfigAndGenerateTypes:()=>j});const k=[`boltdocs.config.js`,`boltdocs.config.mjs`,`boltdocs.config.ts`];async function A(e,n=process.cwd()){let a=n,s={docsDir:r.resolve(e),theme:{title:`Boltdocs`,description:`A Vite documentation framework`,navbar:[{label:`Home`,href:`/`},{label:`Documentation`,href:`/docs`}],codeTheme:{light:`github-light`,dark:`github-dark`}}},c={};for(let e of k){let t=r.resolve(a,e);if(i.existsSync(t))try{let{loadConfigFromFile:e}=await import(`vite`),n=await e({command:`serve`,mode:`development`},t,a);if(n){c=n.config;break}}catch(t){o(`Failed to load config from ${e}:`,t)}}let l={title:c.title,description:c.description,logo:c.logo,favicon:c.favicon,navbar:c.navbar,sidebar:c.sidebar,sidebarGroups:c.theme?.sidebarGroups,socialLinks:c.socialLinks,githubRepo:c.githubRepo,tabs:c.tabs,codeTheme:c.codeTheme,communityHelp:c.communityHelp,version:c.version,editLink:c.editLink,...c.theme||{}},u=Object.fromEntries(Object.entries(l).filter(([e,t])=>t!==void 0));u.navbar&&=u.navbar.map(e=>({label:e.label||e.text||``,href:e.href||e.link||e.to||``,items:e.items}));let d={docsDir:r.resolve(e),theme:{...s.theme,...u},i18n:c.i18n?{...c.i18n,locales:Array.isArray(c.i18n.locales)?Object.fromEntries(c.i18n.locales.map(e=>[e,e])):c.i18n.locales}:void 0,versions:c.versions,siteUrl:c.siteUrl,base:c.base,seo:c.seo,plugins:c.plugins||[],robots:c.robots,security:c.security,integrations:c.integrations,vite:c.vite},f=D.safeParse(d);if(!f.success)throw new t(`Invalid Boltdocs configuration:\n${f.error.issues.map(e=>` - ${e.path.join(`.`)}: ${e.message}`).join(`
|
|
7
|
-
`)}`);return f.data}async function j(e,t=process.cwd()){let r=await A(e,t);return n(r,e,t),r}export{s as a,l as i,O as n,A as r,k as t};
|
package/dist/node-Ct4PB0S_.mjs
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
-
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
import{r as e,u as t}from"./utils-B3xYMrpK.mjs";import{t as n}from"./routes-CyrnmVuG.mjs";import{t as r}from"./pages-external-BYa4JSda.mjs";import{i,r as a}from"./config-D3_zDkHh.mjs";import{r as o,t as s}from"./types-generator-DVOnRVKU.mjs";import{o as c}from"./shiki-adapter-CXEGRnjr.mjs";import{createRequire as l}from"node:module";import u from"node:path";import d from"node:fs";import{z as f}from"zod";import*as p from"@bdocs/dui";import{colors as m,warn as h}from"@bdocs/dui";import g from"semver";import{build as _}from"@bdocs/ssg/node";import{EXIT as v,SKIP as y,visit as b}from"unist-util-visit";function x(e,n){let r=u.resolve(process.cwd(),`index.css`),i=d.existsSync(r)?`import './index.css';`:``,a=n?.plugins?.flatMap(e=>Object.entries(e.components||{}))||[],o=a.map(([e,n])=>`import * as _comp_${e} from '${t(n)}';
|
|
7
|
-
const ${e} = _comp_${e}.default || _comp_${e}['${e}'] || _comp_${e};`).join(`
|
|
8
|
-
`),s=a.map(([e])=>e).join(`, `),c=u.basename(e.docsDir||`docs`),l=u.resolve(process.cwd(),e.docsDir||`docs`),f=[`tsx`,`ts`,`jsx`,`js`].map(e=>u.resolve(l,`pages-external/index.${e}`)).find(e=>d.existsSync(e)),p=f?`import * as _external_module from '${t(f)}';`:``,m=f?`externalPages: _external_module.pages, externalLayout: _external_module.layout,`:``,h=process.env.VITE_SSG===`true`,g=h?`{ eager: true }`:`{}`,_=h?``:`
|
|
9
|
-
if (typeof window !== 'undefined') {
|
|
10
|
-
const prefetchAll = () => {
|
|
11
|
-
const getters = Object.values(mdxModules)
|
|
12
|
-
if (getters.length === 0) return
|
|
13
|
-
let i = 0
|
|
14
|
-
const nextBatch = () => {
|
|
15
|
-
if (i >= getters.length) return
|
|
16
|
-
const batch = getters.slice(i, i + 6)
|
|
17
|
-
i += batch.length
|
|
18
|
-
Promise.allSettled(batch.map(fn => fn())).then(() => {
|
|
19
|
-
setTimeout(nextBatch, 0)
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
;(typeof requestIdleCallback === 'function' ? requestIdleCallback : function(cb) { setTimeout(cb, 500) })(nextBatch)
|
|
23
|
-
}
|
|
24
|
-
prefetchAll()
|
|
25
|
-
}
|
|
26
|
-
`;return`
|
|
27
|
-
import { ViteReactSSG, createRoutes } from 'boltdocs/client'
|
|
28
|
-
import _routes from 'virtual:boltdocs-routes.ts'
|
|
29
|
-
import _collections from 'virtual:boltdocs-collections.ts'
|
|
30
|
-
import _config from 'virtual:boltdocs-config.ts'
|
|
31
|
-
import _user_mdx_components from 'virtual:boltdocs-mdx-components.tsx'
|
|
32
|
-
${i}
|
|
33
|
-
${o}
|
|
34
|
-
${p}
|
|
35
|
-
|
|
36
|
-
const mdxModules = import.meta.glob('/${c}/**/*.{md,mdx}', ${g});
|
|
37
|
-
|
|
38
|
-
const _collLayoutMods = import.meta.glob('${`/${c}/**/layout.tsx`}', { eager: true });
|
|
39
|
-
const _collListMods = import.meta.glob('${`/${c}/**/list.tsx`}', { eager: true });
|
|
40
|
-
const _collPostMods = import.meta.glob('${`/${c}/**/post.tsx`}', { eager: true });
|
|
41
|
-
|
|
42
|
-
const _collectionLayouts = {};
|
|
43
|
-
for (const [p, mod] of Object.entries(_collLayoutMods)) {
|
|
44
|
-
const dir = p.split('/').slice(-2, -1)[0];
|
|
45
|
-
if (dir.startsWith('[') && dir.endsWith(']')) {
|
|
46
|
-
_collectionLayouts[dir.slice(1, -1)] = mod.default || mod;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const _collectionLists = {};
|
|
51
|
-
for (const [p, mod] of Object.entries(_collListMods)) {
|
|
52
|
-
const dir = p.split('/').slice(-2, -1)[0];
|
|
53
|
-
if (dir.startsWith('[') && dir.endsWith(']')) {
|
|
54
|
-
_collectionLists[dir.slice(1, -1)] = mod.default || mod;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const _collectionPosts = {};
|
|
59
|
-
for (const [p, mod] of Object.entries(_collPostMods)) {
|
|
60
|
-
const dir = p.split('/').slice(-2, -1)[0];
|
|
61
|
-
if (dir.startsWith('[') && dir.endsWith(']')) {
|
|
62
|
-
_collectionPosts[dir.slice(1, -1)] = mod.default || mod;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export const createRoot = ViteReactSSG(
|
|
67
|
-
{
|
|
68
|
-
routes: createRoutes({
|
|
69
|
-
routesData: _routes,
|
|
70
|
-
collectionsData: _collections,
|
|
71
|
-
collectionLayouts: _collectionLayouts,
|
|
72
|
-
collectionLists: _collectionLists,
|
|
73
|
-
collectionPosts: _collectionPosts,
|
|
74
|
-
config: _config,
|
|
75
|
-
mdxModules,
|
|
76
|
-
${m}
|
|
77
|
-
components: { ${s}${s?`, `:``} ...(_user_mdx_components || {}) },
|
|
78
|
-
}),
|
|
79
|
-
},
|
|
80
|
-
({ isClient }) => {
|
|
81
|
-
// Boltdocs initialization hook
|
|
82
|
-
if (isClient) {
|
|
83
|
-
// Client-side initialization
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
);
|
|
87
|
-
${_}
|
|
88
|
-
`}var S=class extends Error{name=this.constructor.name;constructor(e,t,n){super(`[plugin:${e}] ${t}`,n),this.pluginName=e}},C=class extends S{constructor(e,t){super(e,`Validation failed: ${t}`)}},w=class extends S{constructor(e,t){super(e,`Compatibility error: ${t}`)}},T=class extends S{constructor(e,t,n){super(e,`Error in hook '${t}': ${n.message}`,{cause:n}),this.hookName=t}},E=class{data=new Map;getNamespaceKey(e,t){return`${e}:${t}`}get(e,t){let n=this.getNamespaceKey(e,t),r=this.data.get(n);if(r!==void 0)return typeof r==`object`&&r?JSON.parse(JSON.stringify(r)):r}set(e,t,n){let r=this.getNamespaceKey(e,t),i=typeof n==`object`&&n?JSON.parse(JSON.stringify(n)):n;this.data.set(r,i)}has(e,t){let n=this.getNamespaceKey(e,t);return this.data.has(n)}};const D=i.extend({version:f.string().optional(),boltdocsVersion:f.string().optional(),hooks:f.object({beforeBuild:f.function().optional(),afterBuild:f.function().optional(),beforeDev:f.function().optional(),afterDev:f.function().optional(),buildEnd:f.function().optional(),transformSource:f.function().optional(),transformMdx:f.function().optional(),transformHtml:f.function().optional()}).optional()});function O(e,t){let n=[],r=new Set;for(let i of e){let e=D.safeParse(i);if(!e.success)throw new C(i.name||`unknown`,e.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `));let a=e.data;if(r.has(a.name))throw new C(a.name,`Duplicate plugin name detected`);if(r.add(a.name),a.boltdocsVersion&&!g.satisfies(t,a.boltdocsVersion))throw new w(a.name,`Plugin expects Boltdocs version ${a.boltdocsVersion}, but current is ${t}`);if(a.components)for(let[e,t]of Object.entries(a.components)){if(t.includes(`..`))throw new C(a.name,`Component '${e}' has an invalid path: traversal sequences are not allowed.`);if(u.isAbsolute(t))throw new C(a.name,`Component '${e}' has an invalid path: absolute paths are not allowed.`)}n.push(a)}return n}function k(e,t=process.cwd()){let n=e.plugins||[];for(let e of n)if(e.name)try{let n=null;try{n=l(u.resolve(t,`package.json`)).resolve(`${e.name}/package.json`)}catch{let r=u.resolve(t,`node_modules`,e.name,`package.json`);d.existsSync(r)&&(n=r)}if(n&&d.existsSync(n)){let t=JSON.parse(d.readFileSync(n,`utf-8`)).scripts||{};(t.preinstall||t.postinstall||t.install)&&h(`💡 ${m.yellow(m.bold(`Nota de seguridad:`))} El plugin ${m.cyan(e.name)} ejecuta scripts nativos al instalarse. Corre ${m.bold(`boltdocs audit`)} para un análisis detallado.`)}}catch{}}var A=class{name=`ConfigResolve`;async execute(e){e.config=await a(`docs`,e.root),k(e.config,e.root),e.viteConfig=await $(e.root,`production`)}};function j(e){return e.map(e=>({path:e.path,filePath:e.filePath,title:e.title,description:e.description||``,sidebarPosition:e.sidebarPosition,badge:e.badge,icon:e.icon,headings:e.headings||[],_content:e._content||``,_rawContent:e._rawContent||``,locale:e.locale,version:e.version,tab:e.tab,collection:e.collection,tags:e.tags,author:e.author,draft:e.draft,excerpt:e.excerpt,coverImage:e.coverImage,group:e.group,groupTitle:e.groupTitle,groupPosition:e.groupPosition,groupIcon:e.groupIcon,subRouteGroup:e.subRouteGroup,seo:e.seo,date:e.date,lastUpdated:e.lastUpdated,category:e.category,order:e.order,sidebarLabel:e.sidebarLabel,sidebarHidden:e.sidebarHidden,frontmatter:e.frontmatter,slugParts:e.slugParts}))}var M=class{name=`RouteGenerate`;async execute(e){if(!e.config)throw Error(`Config not resolved. Run ConfigResolve first.`);let t=u.resolve(e.root,`docs`),r=e.viteConfig?.base||e.config.base||`/docs`;e.routes=[...await n(t,e.config,r)],e.ssgRoutes=j(e.routes)}};const ee=f.object({title:f.string().optional(),description:f.string().optional(),canonical:f.string().url().optional(),robots:f.string().optional(),noindex:f.boolean().optional(),"og:title":f.string().optional(),"og:description":f.string().optional(),"og:image":f.string().optional(),"og:type":f.string().optional(),"og:url":f.string().url().optional()});var N=class{name=`SEOValidate`;async execute(e){if(!e.routes||!e.config)throw Error(`Routes or Config not initialized.`);let t=e.config.siteUrl;e.routes=e.routes.map(n=>{let r=n.seo||{},i=r.canonical||(t?`${t.replace(/\/$/,``)}${n.path}`:void 0),a=r[`og:url`]||i||void 0,o=e.config.seo?.thumbnails?.background,s=r[`og:image`]||n.coverImage||o;s&&t&&!/^https?:\/\/|^\/\//.test(s)&&(s=`${t.endsWith(`/`)?t.slice(0,-1):t}${s.startsWith(`/`)?s:`/${s}`}`);let c={...r};i&&(c.canonical=i),a&&(c[`og:url`]=a),s&&(c[`og:image`]=s),!c[`og:title`]&&n.title&&(c[`og:title`]=n.title),!c[`og:description`]&&n.description&&(c[`og:description`]=n.description);let l=ee.safeParse(c);return l.success||h(`[SEOValidate] Validation issues on route "${n.path}":`,l.error.message),n.title||h(`[SEOValidate] Route "${n.path}" is missing a title.`),{...n,seo:c}}),e.ssgRoutes=j(e.routes)}},P=class{name=`TypeGenerate`;async execute(e){if(!e.config||!e.routes)throw Error(`Config or Routes not initialized.`);let t=u.resolve(e.root,`docs`),n=e.routes.map(e=>e.path),i=(e.config.base||`/docs`).replace(/\/$/,``);n.includes(i)||n.push(i);let a=r(t,e.config);for(let e of a)n.includes(e)||n.push(e);s(e.config,t,e.root,n),o(n)}},F=class{name=`SSGBuild`;async execute(e){if(!e.routes||!e.viteConfig)throw Error(`Routes or ViteConfig not initialized.`);let t={};for(let n of e.routes)if(n.path&&n.componentPath){t[n.path]=n.componentPath;let e=n.path.replace(/\/$/,``);t[e]=n.componentPath}await _({entry:`boltdocs/entry`,routeToSourceFileMap:t,cacheDir:u.resolve(e.root,`.boltdocs/build`)},e.viteConfig),e.outDir=e.viteConfig.build?.outDir||`dist`}};function I(t,n){let r=(n.siteUrl||``).replace(/\/$/,``);if(!r)return``;let i=n.seo?.indexing!==`all`&&n.seo?.indexing!==`public`;return`<?xml version="1.0" encoding="UTF-8"?>
|
|
89
|
-
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
90
|
-
${t.filter(e=>e.seo?.noindex||typeof e.seo?.robots==`string`&&e.seo.robots.includes(`noindex`)?!1:(i&&e.seo?.index,!0)).map(t=>` <url>
|
|
91
|
-
<loc>${e(`${r}${t.path.startsWith(`/`)?t.path:`/${t.path}`}`)}</loc>
|
|
92
|
-
<changefreq>weekly</changefreq>
|
|
93
|
-
<priority>0.7</priority>
|
|
94
|
-
</url>`).join(`
|
|
95
|
-
`)}
|
|
96
|
-
</urlset>`}function L(e){let t=e.siteUrl||``,n=t?`${t.replace(/\/$/,``)}/sitemap.xml`:``;if(e.seo?.indexing!==`all`&&e.seo?.indexing!==`public`&&e.seo?.indexing)return[`User-agent: *`,`Disallow: /`].filter(Boolean).join(`
|
|
97
|
-
`);if(typeof e.robots==`string`)return e.robots;if(e.robots&&typeof e.robots==`object`){let t=e.robots.rules||[],r=e.robots.sitemaps||[],i=t.map(e=>{let t=`User-agent: ${e.userAgent}\n`;return e.allow&&(Array.isArray(e.allow)?t+=e.allow.map(e=>`Allow: ${e}`).join(`
|
|
98
|
-
`)+`
|
|
99
|
-
`:t+=`Allow: ${e.allow}\n`),e.disallow&&(Array.isArray(e.disallow)?t+=e.disallow.map(e=>`Disallow: ${e}`).join(`
|
|
100
|
-
`)+`
|
|
101
|
-
`:t+=`Disallow: ${e.disallow}\n`),t.trim()}).join(`
|
|
102
|
-
|
|
103
|
-
`),a=[...n?[n]:[],...r].map(e=>`Sitemap: ${e}`).join(`
|
|
104
|
-
`);return`${i}${a?`\n\n${a}`:``}`}return[`User-agent: *`,`Allow: /`,``,n?`Sitemap: ${n}`:``].filter(Boolean).join(`
|
|
105
|
-
`)}var R=class{name=`SEOWrite`;async execute(e){if(!e.ssgRoutes||!e.config||!e.outDir)throw Error(`SSG Routes, Config, or OutDir not initialized.`);let t=I(e.ssgRoutes,e.config),n=u.resolve(e.root,e.outDir);t&&d.writeFileSync(u.join(n,`sitemap.xml`),t,`utf-8`);let r=L(e.config);d.writeFileSync(u.join(n,`robots.txt`),r,`utf-8`)}};function z(){return new B().addStep(new A).addStep(new M).addStep(new N).addStep(new P).addStep(new F).addStep(new R)}var B=class{steps=[];addStep(e){return this.steps.push(e),this}async run(e){let t=[],n=performance.now(),r={...e,timing:{}};for(let e of this.steps){let i=performance.now();try{await e.execute(r);let n=performance.now()-i;t.push({name:e.name,duration:n,success:!0}),r.timing[e.name]=n}catch(a){let o=performance.now()-i;t.push({name:e.name,duration:o,success:!1,error:a instanceof Error?a:Error(String(a))});for(let e of t.filter(e=>e.success).reverse()){let t=this.steps.find(t=>t.name===e.name);if(t?.rollback)try{await t.rollback(r)}catch(t){console.error(`[pipeline] rollback failed for step "${e.name}":`,t)}}let s=performance.now()-n;return{success:!1,failedStep:e.name,error:a instanceof Error?a:Error(String(a)),timing:{total:s,steps:r.timing},stepResults:t}}}return{success:!0,timing:{total:performance.now()-n,steps:r.timing},stepResults:t}}},V=class{plugins;config;store;docsDir;rootDir;constructor(e,t,n,r){this.plugins=e,this.config=t,this.store=new E,this.docsDir=n||process.cwd(),this.rootDir=r||process.cwd()}async runHook(e,...t){let n=this.getSortedPlugins(),r=new B;for(let i of n)i.hooks?.[e]&&r.addStep(this.createStep(i,e,t));await r.run({})}async runChain(e,t){let n=this.getSortedPlugins(),r=t;for(let t of n){if(!t.hooks?.[e])continue;let n=this.createContext(t);try{let i=t.hooks[e],a=await i(n,r);a!==void 0&&(r=a)}catch(r){let i=new T(t.name,e,r instanceof Error?r:Error(String(r)));n.logger.error(i)}}return r}getSortedPlugins(){let e=this.plugins.filter(e=>e.enforce===`pre`),t=this.plugins.filter(e=>!e.enforce),n=this.plugins.filter(e=>e.enforce===`post`);return[...e,...t,...n]}createStep(e,t,n){return{name:`${e.name}:${String(t)}`,execute:async()=>{let r=this.createContext(e);try{let i=e.hooks[t];await i(r,...n)}catch(n){let i=new T(e.name,t,n instanceof Error?n:Error(String(n)));r.logger.error(i)}},rollback:async()=>{let t=e.hooks?.buildEnd;if(t){let n=this.createContext(e);try{await t(n)}catch{}}}}}createContext(e){return{config:Object.freeze({...this.config}),docsDir:this.docsDir,rootDir:this.rootDir,meta:{name:e.name,version:e.version,boltdocsVersion:e.boltdocsVersion},store:{get:(e,t)=>this.store.get(e,t),set:(e,t,n)=>this.store.set(e,t,n),has:(e,t)=>this.store.has(e,t)},logger:this.createLogger(e.name)}}createLogger(e){let t=`[plugin:${e}]`;return{info:e=>p.info(`${t} ${e}`),warn:e=>p.warn(`${t} ${e}`),error:e=>{p.error(`${t} ${e instanceof Error?e.message:e}`)},debug:e=>p.debug(`${t} ${e}`)}}};function H(e,t,n){e&&b(e,typeof t==`function`?t:e=>Array.isArray(t)?t.includes(e.type):e.type===t,(e,t,r)=>{if(t!==void 0&&r!==void 0)return n(e,t,r)})}function U(e,t,n){H(e,c.ELEMENT,(e,r,i)=>{if(e.tagName===t)return n(e,r,i)})}function W(e,t,n){let r=Array.isArray(t)?t:[t],i=[c.JSX_FLOW_ELEMENT,c.JSX_TEXT_ELEMENT];H(e,e=>i.includes(e.type),(e,t,i)=>{if(e.name&&r.includes(e.name))return n(e,t,i)})}function G(e,t,n){e&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties[t]=n)}function K(e,t){return e?.data?.hProperties?.[t]}function q(e,t){return typeof t==`object`&&t?{type:c.JSX_ATTRIBUTE,name:e,value:t}:{type:c.JSX_ATTRIBUTE,name:e,value:String(t)}}function J(e,t={},n=[]){return{type:c.ELEMENT,tagName:e,properties:t,children:n}}function Y(e,t={},n=[],r=!0){let i=Object.entries(t).map(([e,t])=>q(e,t));return{type:r?c.JSX_FLOW_ELEMENT:c.JSX_TEXT_ELEMENT,name:e,attributes:i,children:n}}function X(e,t){e&&b(e,c.HEADING,(e,n,r)=>{if(n!==void 0&&r!==void 0)return t(e,n,r)})}function Z(e,t){e&&b(e,c.LINK,(e,n,r)=>{if(n!==void 0&&r!==void 0)return t(e,n,r)})}function Q(e,t){if(!e)return;e.properties=e.properties||{};let n=e.properties.className;Array.isArray(n)?n.includes(t)||n.push(t):typeof n==`string`?n!==t&&(e.properties.className=[n,t]):e.properties.className=[t]}function te(e,t){if(!e||!e.properties||!e.properties.className)return;let n=e.properties.className;Array.isArray(n)?e.properties.className=n.filter(e=>e!==t):typeof n==`string`&&n===t&&delete e.properties.className}function ne(e,t){if(!e||!e.properties||!e.properties.className)return!1;let n=e.properties.className;return Array.isArray(n)?n.includes(t):typeof n==`string`?n===t:!1}function re(e){return e}async function ie(e){let{resolveConfig:t}=await import(`./config-D3_zDkHh.mjs`).then(e=>e.n),{generateRoutes:n,getExternalRoutePaths:r}=await import(`./routes-CyrnmVuG.mjs`).then(e=>e.i),{generateProjectTypes:i,writeLinkTree:a}=await import(`./types-generator-DVOnRVKU.mjs`).then(e=>e.n),{boltdocsPlugin:o}=await import(`./plugin-IBKz7CRF.mjs`),s=e?.docsDir||`docs`,c=await t(s),l=(await n(s,c)).map(e=>e.path),u=(c.base||`/docs`).replace(/\/$/,``);l.includes(u)||l.push(u);let d=r(s,c);for(let e of d)l.includes(e)||l.push(e);return i(c,s,void 0,l),a(l),o({...e},c)}async function $(e,t=`development`,n){let[r,i,{boltdocsPlugin:a,getExternalAbsolutePaths:o},{SECURITY_HEADERS:s},{getCSPHeader:c},{resolveConfig:l},{generateRoutes:d,getExternalRoutePaths:f},{generateProjectTypes:p,writeLinkTree:m},{normalizePath:h}]=await Promise.all([import(`@vitejs/plugin-react`),import(`@tailwindcss/vite`),import(`./plugin-IBKz7CRF.mjs`),import(`./headers-CXyf0auY.mjs`).then(e=>e.n),import(`./csp-gaZ51xzq.mjs`).then(e=>e.t),import(`./config-D3_zDkHh.mjs`).then(e=>e.n),import(`./routes-CyrnmVuG.mjs`).then(e=>e.i),import(`./types-generator-DVOnRVKU.mjs`).then(e=>e.n),import(`vite`).then(e=>({normalizePath:e.normalizePath}))]),g=r.default,_=i.default,v=n||await l(`docs`,e),y=(await d(`docs`,v)).map(e=>e.path),b=(v.base||`/docs`).replace(/\/$/,``);y.includes(b)||y.push(b);let x=f(`docs`,v);for(let e of x)y.includes(e)||y.push(e);p(v,`docs`,e,y),m(y);let S=t===`production`,C=S?{...s}:{};return v.security?.enableCSP&&(C[`Content-Security-Policy`]=c(v)),{root:e,mode:t,oxc:{jsx:{development:!S,runtime:`automatic`,importSource:`react`}},optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-helmet-async`,`react-router-dom`,`react-fast-compare`,`invariant`,`use-sync-external-store/shim`]},build:{},plugins:[g(),_(),...a({docsDir:`docs`,root:e},v)],resolve:{alias:[{find:`boltdocs/entry`,replacement:h(u.resolve(e,`boltdocs-entry.tsx`))},{find:`boltdocs/client`,replacement:h(u.resolve(e,`boltdocs-client.mjs`))},{find:`use-sync-external-store/shim/index.js`,replacement:`react`},{find:`use-sync-external-store/shim`,replacement:`react`},{find:`use-sync-external-store`,replacement:`react`},{find:`@`,replacement:h(u.resolve(e,`../packages/core/src`))}],dedupe:[`react`,`react-dom`]},ssr:{external:[`react`,`react-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`,...o()],optimizeDeps:{include:[`react`,`react-dom`,`react-fast-compare`,`invariant`,...v.vite?.ssr?.optimizeDeps?.include||[]]},noExternal:[`boltdocs`,/@bdocs\/(?!ssg).*/,`react-aria-components`,`@react-aria/collections`,`@react-aria/utils`,`react-router-dom`]},server:{watch:{ignored:[`**/.boltdocs/**`,...Array.isArray(v.vite?.server?.watch?.ignored)?v.vite.server.watch.ignored:v.vite?.server?.watch?.ignored?[v.vite.server.watch.ignored]:[]]},headers:{...C,...v.vite?.server?.headers},...v.vite?.server},preview:{headers:{...C,...v.vite?.preview?.headers},...v.vite?.preview},...v.vite}}export{O as C,T as D,S as E,C as O,k as S,w as T,X as _,y as a,z as b,Y as c,ne as d,te as f,U as g,H as h,v as i,x as k,J as l,W as m,$ as n,Q as o,G as p,re as r,q as s,ie as t,K as u,Z as v,E as w,j as x,V as y};
|
package/dist/node-joF9IMNr.cjs
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
-
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
const e=require(`./chunk-Ds5LZdWN.cjs`),t=require(`./utils-Bz1tG9Dg.cjs`),n=require(`./routes-D6Tuu7Fs.cjs`),r=require(`./pages-external-CX2uyW95.cjs`),i=require(`./config-B5uVv5q4.cjs`),a=require(`./types-generator-CYcHkDzZ.cjs`),o=require(`./shiki-adapter-CGTmrR6S.cjs`);let s=require(`node:path`);s=e.n(s);let c=require(`node:fs`);c=e.n(c);let l=require(`zod`),u=require(`@bdocs/dui`);u=e.n(u);let d=require(`semver`);d=e.n(d);let f=require(`node:module`),p=require(`@bdocs/ssg/node`),m=require(`unist-util-visit`);function h(e,n){let r=s.default.resolve(process.cwd(),`index.css`),i=c.default.existsSync(r)?`import './index.css';`:``,a=n?.plugins?.flatMap(e=>Object.entries(e.components||{}))||[],o=a.map(([e,n])=>`import * as _comp_${e} from '${t.u(n)}';
|
|
7
|
-
const ${e} = _comp_${e}.default || _comp_${e}['${e}'] || _comp_${e};`).join(`
|
|
8
|
-
`),l=a.map(([e])=>e).join(`, `),u=s.default.basename(e.docsDir||`docs`),d=s.default.resolve(process.cwd(),e.docsDir||`docs`),f=[`tsx`,`ts`,`jsx`,`js`].map(e=>s.default.resolve(d,`pages-external/index.${e}`)).find(e=>c.default.existsSync(e)),p=f?`import * as _external_module from '${t.u(f)}';`:``,m=f?`externalPages: _external_module.pages, externalLayout: _external_module.layout,`:``,h=process.env.VITE_SSG===`true`,g=h?`{ eager: true }`:`{}`,_=h?``:`
|
|
9
|
-
if (typeof window !== 'undefined') {
|
|
10
|
-
const prefetchAll = () => {
|
|
11
|
-
const getters = Object.values(mdxModules)
|
|
12
|
-
if (getters.length === 0) return
|
|
13
|
-
let i = 0
|
|
14
|
-
const nextBatch = () => {
|
|
15
|
-
if (i >= getters.length) return
|
|
16
|
-
const batch = getters.slice(i, i + 6)
|
|
17
|
-
i += batch.length
|
|
18
|
-
Promise.allSettled(batch.map(fn => fn())).then(() => {
|
|
19
|
-
setTimeout(nextBatch, 0)
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
;(typeof requestIdleCallback === 'function' ? requestIdleCallback : function(cb) { setTimeout(cb, 500) })(nextBatch)
|
|
23
|
-
}
|
|
24
|
-
prefetchAll()
|
|
25
|
-
}
|
|
26
|
-
`;return`
|
|
27
|
-
import { ViteReactSSG, createRoutes } from 'boltdocs/client'
|
|
28
|
-
import _routes from 'virtual:boltdocs-routes.ts'
|
|
29
|
-
import _collections from 'virtual:boltdocs-collections.ts'
|
|
30
|
-
import _config from 'virtual:boltdocs-config.ts'
|
|
31
|
-
import _user_mdx_components from 'virtual:boltdocs-mdx-components.tsx'
|
|
32
|
-
${i}
|
|
33
|
-
${o}
|
|
34
|
-
${p}
|
|
35
|
-
|
|
36
|
-
const mdxModules = import.meta.glob('/${u}/**/*.{md,mdx}', ${g});
|
|
37
|
-
|
|
38
|
-
const _collLayoutMods = import.meta.glob('${`/${u}/**/layout.tsx`}', { eager: true });
|
|
39
|
-
const _collListMods = import.meta.glob('${`/${u}/**/list.tsx`}', { eager: true });
|
|
40
|
-
const _collPostMods = import.meta.glob('${`/${u}/**/post.tsx`}', { eager: true });
|
|
41
|
-
|
|
42
|
-
const _collectionLayouts = {};
|
|
43
|
-
for (const [p, mod] of Object.entries(_collLayoutMods)) {
|
|
44
|
-
const dir = p.split('/').slice(-2, -1)[0];
|
|
45
|
-
if (dir.startsWith('[') && dir.endsWith(']')) {
|
|
46
|
-
_collectionLayouts[dir.slice(1, -1)] = mod.default || mod;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const _collectionLists = {};
|
|
51
|
-
for (const [p, mod] of Object.entries(_collListMods)) {
|
|
52
|
-
const dir = p.split('/').slice(-2, -1)[0];
|
|
53
|
-
if (dir.startsWith('[') && dir.endsWith(']')) {
|
|
54
|
-
_collectionLists[dir.slice(1, -1)] = mod.default || mod;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const _collectionPosts = {};
|
|
59
|
-
for (const [p, mod] of Object.entries(_collPostMods)) {
|
|
60
|
-
const dir = p.split('/').slice(-2, -1)[0];
|
|
61
|
-
if (dir.startsWith('[') && dir.endsWith(']')) {
|
|
62
|
-
_collectionPosts[dir.slice(1, -1)] = mod.default || mod;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export const createRoot = ViteReactSSG(
|
|
67
|
-
{
|
|
68
|
-
routes: createRoutes({
|
|
69
|
-
routesData: _routes,
|
|
70
|
-
collectionsData: _collections,
|
|
71
|
-
collectionLayouts: _collectionLayouts,
|
|
72
|
-
collectionLists: _collectionLists,
|
|
73
|
-
collectionPosts: _collectionPosts,
|
|
74
|
-
config: _config,
|
|
75
|
-
mdxModules,
|
|
76
|
-
${m}
|
|
77
|
-
components: { ${l}${l?`, `:``} ...(_user_mdx_components || {}) },
|
|
78
|
-
}),
|
|
79
|
-
},
|
|
80
|
-
({ isClient }) => {
|
|
81
|
-
// Boltdocs initialization hook
|
|
82
|
-
if (isClient) {
|
|
83
|
-
// Client-side initialization
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
);
|
|
87
|
-
${_}
|
|
88
|
-
`}var g=class extends Error{name=this.constructor.name;constructor(e,t,n){super(`[plugin:${e}] ${t}`,n),this.pluginName=e}},_=class extends g{constructor(e,t){super(e,`Validation failed: ${t}`)}},v=class extends g{constructor(e,t){super(e,`Compatibility error: ${t}`)}},y=class extends g{constructor(e,t,n){super(e,`Error in hook '${t}': ${n.message}`,{cause:n}),this.hookName=t}},b=class{data=new Map;getNamespaceKey(e,t){return`${e}:${t}`}get(e,t){let n=this.getNamespaceKey(e,t),r=this.data.get(n);if(r!==void 0)return typeof r==`object`&&r?JSON.parse(JSON.stringify(r)):r}set(e,t,n){let r=this.getNamespaceKey(e,t),i=typeof n==`object`&&n?JSON.parse(JSON.stringify(n)):n;this.data.set(r,i)}has(e,t){let n=this.getNamespaceKey(e,t);return this.data.has(n)}};const x=i.i.extend({version:l.z.string().optional(),boltdocsVersion:l.z.string().optional(),hooks:l.z.object({beforeBuild:l.z.function().optional(),afterBuild:l.z.function().optional(),beforeDev:l.z.function().optional(),afterDev:l.z.function().optional(),buildEnd:l.z.function().optional(),transformSource:l.z.function().optional(),transformMdx:l.z.function().optional(),transformHtml:l.z.function().optional()}).optional()});function S(e,t){let n=[],r=new Set;for(let i of e){let e=x.safeParse(i);if(!e.success)throw new _(i.name||`unknown`,e.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `));let a=e.data;if(r.has(a.name))throw new _(a.name,`Duplicate plugin name detected`);if(r.add(a.name),a.boltdocsVersion&&!d.default.satisfies(t,a.boltdocsVersion))throw new v(a.name,`Plugin expects Boltdocs version ${a.boltdocsVersion}, but current is ${t}`);if(a.components)for(let[e,t]of Object.entries(a.components)){if(t.includes(`..`))throw new _(a.name,`Component '${e}' has an invalid path: traversal sequences are not allowed.`);if(s.default.isAbsolute(t))throw new _(a.name,`Component '${e}' has an invalid path: absolute paths are not allowed.`)}n.push(a)}return n}function C(e,t=process.cwd()){let n=e.plugins||[];for(let e of n)if(e.name)try{let n=null;try{n=(0,f.createRequire)(s.default.resolve(t,`package.json`)).resolve(`${e.name}/package.json`)}catch{let r=s.default.resolve(t,`node_modules`,e.name,`package.json`);c.default.existsSync(r)&&(n=r)}if(n&&c.default.existsSync(n)){let t=JSON.parse(c.default.readFileSync(n,`utf-8`)).scripts||{};(t.preinstall||t.postinstall||t.install)&&(0,u.warn)(`💡 ${u.colors.yellow(u.colors.bold(`Nota de seguridad:`))} El plugin ${u.colors.cyan(e.name)} ejecuta scripts nativos al instalarse. Corre ${u.colors.bold(`boltdocs audit`)} para un análisis detallado.`)}}catch{}}var w=class{name=`ConfigResolve`;async execute(e){e.config=await i.n(`docs`,e.root),C(e.config,e.root),e.viteConfig=await Q(e.root,`production`)}};function T(e){return e.map(e=>({path:e.path,filePath:e.filePath,title:e.title,description:e.description||``,sidebarPosition:e.sidebarPosition,badge:e.badge,icon:e.icon,headings:e.headings||[],_content:e._content||``,_rawContent:e._rawContent||``,locale:e.locale,version:e.version,tab:e.tab,collection:e.collection,tags:e.tags,author:e.author,draft:e.draft,excerpt:e.excerpt,coverImage:e.coverImage,group:e.group,groupTitle:e.groupTitle,groupPosition:e.groupPosition,groupIcon:e.groupIcon,subRouteGroup:e.subRouteGroup,seo:e.seo,date:e.date,lastUpdated:e.lastUpdated,category:e.category,order:e.order,sidebarLabel:e.sidebarLabel,sidebarHidden:e.sidebarHidden,frontmatter:e.frontmatter,slugParts:e.slugParts}))}var E=class{name=`RouteGenerate`;async execute(e){if(!e.config)throw Error(`Config not resolved. Run ConfigResolve first.`);let t=s.default.resolve(e.root,`docs`),r=e.viteConfig?.base||e.config.base||`/docs`;e.routes=[...await n.t(t,e.config,r)],e.ssgRoutes=T(e.routes)}};const D=l.z.object({title:l.z.string().optional(),description:l.z.string().optional(),canonical:l.z.string().url().optional(),robots:l.z.string().optional(),noindex:l.z.boolean().optional(),"og:title":l.z.string().optional(),"og:description":l.z.string().optional(),"og:image":l.z.string().optional(),"og:type":l.z.string().optional(),"og:url":l.z.string().url().optional()});var O=class{name=`SEOValidate`;async execute(e){if(!e.routes||!e.config)throw Error(`Routes or Config not initialized.`);let t=e.config.siteUrl;e.routes=e.routes.map(n=>{let r=n.seo||{},i=r.canonical||(t?`${t.replace(/\/$/,``)}${n.path}`:void 0),a=r[`og:url`]||i||void 0,o=e.config.seo?.thumbnails?.background,s=r[`og:image`]||n.coverImage||o;s&&t&&!/^https?:\/\/|^\/\//.test(s)&&(s=`${t.endsWith(`/`)?t.slice(0,-1):t}${s.startsWith(`/`)?s:`/${s}`}`);let c={...r};i&&(c.canonical=i),a&&(c[`og:url`]=a),s&&(c[`og:image`]=s),!c[`og:title`]&&n.title&&(c[`og:title`]=n.title),!c[`og:description`]&&n.description&&(c[`og:description`]=n.description);let l=D.safeParse(c);return l.success||(0,u.warn)(`[SEOValidate] Validation issues on route "${n.path}":`,l.error.message),n.title||(0,u.warn)(`[SEOValidate] Route "${n.path}" is missing a title.`),{...n,seo:c}}),e.ssgRoutes=T(e.routes)}},k=class{name=`TypeGenerate`;async execute(e){if(!e.config||!e.routes)throw Error(`Config or Routes not initialized.`);let t=s.default.resolve(e.root,`docs`),n=e.routes.map(e=>e.path),i=(e.config.base||`/docs`).replace(/\/$/,``);n.includes(i)||n.push(i);let o=r.t(t,e.config);for(let e of o)n.includes(e)||n.push(e);a.t(e.config,t,e.root,n),a.r(n)}},A=class{name=`SSGBuild`;async execute(e){if(!e.routes||!e.viteConfig)throw Error(`Routes or ViteConfig not initialized.`);let t={};for(let n of e.routes)if(n.path&&n.componentPath){t[n.path]=n.componentPath;let e=n.path.replace(/\/$/,``);t[e]=n.componentPath}await(0,p.build)({entry:`boltdocs/entry`,routeToSourceFileMap:t,cacheDir:s.default.resolve(e.root,`.boltdocs/build`)},e.viteConfig),e.outDir=e.viteConfig.build?.outDir||`dist`}};function j(e,n){let r=(n.siteUrl||``).replace(/\/$/,``);if(!r)return``;let i=n.seo?.indexing!==`all`&&n.seo?.indexing!==`public`;return`<?xml version="1.0" encoding="UTF-8"?>
|
|
89
|
-
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
90
|
-
${e.filter(e=>e.seo?.noindex||typeof e.seo?.robots==`string`&&e.seo.robots.includes(`noindex`)?!1:(i&&e.seo?.index,!0)).map(e=>` <url>
|
|
91
|
-
<loc>${t.r(`${r}${e.path.startsWith(`/`)?e.path:`/${e.path}`}`)}</loc>
|
|
92
|
-
<changefreq>weekly</changefreq>
|
|
93
|
-
<priority>0.7</priority>
|
|
94
|
-
</url>`).join(`
|
|
95
|
-
`)}
|
|
96
|
-
</urlset>`}function M(e){let t=e.siteUrl||``,n=t?`${t.replace(/\/$/,``)}/sitemap.xml`:``;if(e.seo?.indexing!==`all`&&e.seo?.indexing!==`public`&&e.seo?.indexing)return[`User-agent: *`,`Disallow: /`].filter(Boolean).join(`
|
|
97
|
-
`);if(typeof e.robots==`string`)return e.robots;if(e.robots&&typeof e.robots==`object`){let t=e.robots.rules||[],r=e.robots.sitemaps||[],i=t.map(e=>{let t=`User-agent: ${e.userAgent}\n`;return e.allow&&(Array.isArray(e.allow)?t+=e.allow.map(e=>`Allow: ${e}`).join(`
|
|
98
|
-
`)+`
|
|
99
|
-
`:t+=`Allow: ${e.allow}\n`),e.disallow&&(Array.isArray(e.disallow)?t+=e.disallow.map(e=>`Disallow: ${e}`).join(`
|
|
100
|
-
`)+`
|
|
101
|
-
`:t+=`Disallow: ${e.disallow}\n`),t.trim()}).join(`
|
|
102
|
-
|
|
103
|
-
`),a=[...n?[n]:[],...r].map(e=>`Sitemap: ${e}`).join(`
|
|
104
|
-
`);return`${i}${a?`\n\n${a}`:``}`}return[`User-agent: *`,`Allow: /`,``,n?`Sitemap: ${n}`:``].filter(Boolean).join(`
|
|
105
|
-
`)}var N=class{name=`SEOWrite`;async execute(e){if(!e.ssgRoutes||!e.config||!e.outDir)throw Error(`SSG Routes, Config, or OutDir not initialized.`);let t=j(e.ssgRoutes,e.config),n=s.default.resolve(e.root,e.outDir);t&&c.default.writeFileSync(s.default.join(n,`sitemap.xml`),t,`utf-8`);let r=M(e.config);c.default.writeFileSync(s.default.join(n,`robots.txt`),r,`utf-8`)}};function P(){return new F().addStep(new w).addStep(new E).addStep(new O).addStep(new k).addStep(new A).addStep(new N)}var F=class{steps=[];addStep(e){return this.steps.push(e),this}async run(e){let t=[],n=performance.now(),r={...e,timing:{}};for(let e of this.steps){let i=performance.now();try{await e.execute(r);let n=performance.now()-i;t.push({name:e.name,duration:n,success:!0}),r.timing[e.name]=n}catch(a){let o=performance.now()-i;t.push({name:e.name,duration:o,success:!1,error:a instanceof Error?a:Error(String(a))});for(let e of t.filter(e=>e.success).reverse()){let t=this.steps.find(t=>t.name===e.name);if(t?.rollback)try{await t.rollback(r)}catch(t){console.error(`[pipeline] rollback failed for step "${e.name}":`,t)}}let s=performance.now()-n;return{success:!1,failedStep:e.name,error:a instanceof Error?a:Error(String(a)),timing:{total:s,steps:r.timing},stepResults:t}}}return{success:!0,timing:{total:performance.now()-n,steps:r.timing},stepResults:t}}},I=class{plugins;config;store;docsDir;rootDir;constructor(e,t,n,r){this.plugins=e,this.config=t,this.store=new b,this.docsDir=n||process.cwd(),this.rootDir=r||process.cwd()}async runHook(e,...t){let n=this.getSortedPlugins(),r=new F;for(let i of n)i.hooks?.[e]&&r.addStep(this.createStep(i,e,t));await r.run({})}async runChain(e,t){let n=this.getSortedPlugins(),r=t;for(let t of n){if(!t.hooks?.[e])continue;let n=this.createContext(t);try{let i=t.hooks[e],a=await i(n,r);a!==void 0&&(r=a)}catch(r){let i=new y(t.name,e,r instanceof Error?r:Error(String(r)));n.logger.error(i)}}return r}getSortedPlugins(){let e=this.plugins.filter(e=>e.enforce===`pre`),t=this.plugins.filter(e=>!e.enforce),n=this.plugins.filter(e=>e.enforce===`post`);return[...e,...t,...n]}createStep(e,t,n){return{name:`${e.name}:${String(t)}`,execute:async()=>{let r=this.createContext(e);try{let i=e.hooks[t];await i(r,...n)}catch(n){let i=new y(e.name,t,n instanceof Error?n:Error(String(n)));r.logger.error(i)}},rollback:async()=>{let t=e.hooks?.buildEnd;if(t){let n=this.createContext(e);try{await t(n)}catch{}}}}}createContext(e){return{config:Object.freeze({...this.config}),docsDir:this.docsDir,rootDir:this.rootDir,meta:{name:e.name,version:e.version,boltdocsVersion:e.boltdocsVersion},store:{get:(e,t)=>this.store.get(e,t),set:(e,t,n)=>this.store.set(e,t,n),has:(e,t)=>this.store.has(e,t)},logger:this.createLogger(e.name)}}createLogger(e){let t=`[plugin:${e}]`;return{info:e=>u.info(`${t} ${e}`),warn:e=>u.warn(`${t} ${e}`),error:e=>{u.error(`${t} ${e instanceof Error?e.message:e}`)},debug:e=>u.debug(`${t} ${e}`)}}};function L(e,t,n){e&&(0,m.visit)(e,typeof t==`function`?t:e=>Array.isArray(t)?t.includes(e.type):e.type===t,(e,t,r)=>{if(t!==void 0&&r!==void 0)return n(e,t,r)})}function R(e,t,n){L(e,o.o.ELEMENT,(e,r,i)=>{if(e.tagName===t)return n(e,r,i)})}function z(e,t,n){let r=Array.isArray(t)?t:[t],i=[o.o.JSX_FLOW_ELEMENT,o.o.JSX_TEXT_ELEMENT];L(e,e=>i.includes(e.type),(e,t,i)=>{if(e.name&&r.includes(e.name))return n(e,t,i)})}function B(e,t,n){e&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties[t]=n)}function V(e,t){return e?.data?.hProperties?.[t]}function H(e,t){return typeof t==`object`&&t?{type:o.o.JSX_ATTRIBUTE,name:e,value:t}:{type:o.o.JSX_ATTRIBUTE,name:e,value:String(t)}}function U(e,t={},n=[]){return{type:o.o.ELEMENT,tagName:e,properties:t,children:n}}function W(e,t={},n=[],r=!0){let i=Object.entries(t).map(([e,t])=>H(e,t));return{type:r?o.o.JSX_FLOW_ELEMENT:o.o.JSX_TEXT_ELEMENT,name:e,attributes:i,children:n}}function G(e,t){e&&(0,m.visit)(e,o.o.HEADING,(e,n,r)=>{if(n!==void 0&&r!==void 0)return t(e,n,r)})}function K(e,t){e&&(0,m.visit)(e,o.o.LINK,(e,n,r)=>{if(n!==void 0&&r!==void 0)return t(e,n,r)})}function q(e,t){if(!e)return;e.properties=e.properties||{};let n=e.properties.className;Array.isArray(n)?n.includes(t)||n.push(t):typeof n==`string`?n!==t&&(e.properties.className=[n,t]):e.properties.className=[t]}function J(e,t){if(!e||!e.properties||!e.properties.className)return;let n=e.properties.className;Array.isArray(n)?e.properties.className=n.filter(e=>e!==t):typeof n==`string`&&n===t&&delete e.properties.className}function Y(e,t){if(!e||!e.properties||!e.properties.className)return!1;let n=e.properties.className;return Array.isArray(n)?n.includes(t):typeof n==`string`?n===t:!1}function X(e){return e}async function Z(e){let{resolveConfig:t}=await Promise.resolve().then(()=>require(`./config-JGkMJoJQ.cjs`)),{generateRoutes:n,getExternalRoutePaths:r}=await Promise.resolve().then(()=>require(`./routes-BajCwrvX.cjs`)),{generateProjectTypes:i,writeLinkTree:a}=await Promise.resolve().then(()=>require(`./types-generator-CYcHkDzZ.cjs`)).then(e=>e.n),{boltdocsPlugin:o}=await Promise.resolve().then(()=>require(`./plugin-DeOYQvry.cjs`)),s=e?.docsDir||`docs`,c=await t(s),l=(await n(s,c)).map(e=>e.path),u=(c.base||`/docs`).replace(/\/$/,``);l.includes(u)||l.push(u);let d=r(s,c);for(let e of d)l.includes(e)||l.push(e);return i(c,s,void 0,l),a(l),o({...e},c)}async function Q(e,t=`development`,n){let[r,i,{boltdocsPlugin:a,getExternalAbsolutePaths:o},{SECURITY_HEADERS:c},{getCSPHeader:l},{resolveConfig:u},{generateRoutes:d,getExternalRoutePaths:f},{generateProjectTypes:p,writeLinkTree:m},{normalizePath:h}]=await Promise.all([import(`@vitejs/plugin-react`),import(`@tailwindcss/vite`),Promise.resolve().then(()=>require(`./plugin-DeOYQvry.cjs`)),Promise.resolve().then(()=>require(`./headers-BXKxiPUv.cjs`)).then(e=>e.n),Promise.resolve().then(()=>require(`./csp-CBysWlAf.cjs`)).then(e=>e.t),Promise.resolve().then(()=>require(`./config-JGkMJoJQ.cjs`)),Promise.resolve().then(()=>require(`./routes-BajCwrvX.cjs`)),Promise.resolve().then(()=>require(`./types-generator-CYcHkDzZ.cjs`)).then(e=>e.n),import(`vite`).then(e=>({normalizePath:e.normalizePath}))]),g=r.default,_=i.default,v=n||await u(`docs`,e),y=(await d(`docs`,v)).map(e=>e.path),b=(v.base||`/docs`).replace(/\/$/,``);y.includes(b)||y.push(b);let x=f(`docs`,v);for(let e of x)y.includes(e)||y.push(e);p(v,`docs`,e,y),m(y);let S=t===`production`,C=S?{...c}:{};return v.security?.enableCSP&&(C[`Content-Security-Policy`]=l(v)),{root:e,mode:t,oxc:{jsx:{development:!S,runtime:`automatic`,importSource:`react`}},optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-helmet-async`,`react-router-dom`,`react-fast-compare`,`invariant`,`use-sync-external-store/shim`]},build:{},plugins:[g(),_(),...a({docsDir:`docs`,root:e},v)],resolve:{alias:[{find:`boltdocs/entry`,replacement:h(s.default.resolve(e,`boltdocs-entry.tsx`))},{find:`boltdocs/client`,replacement:h(s.default.resolve(e,`boltdocs-client.mjs`))},{find:`use-sync-external-store/shim/index.js`,replacement:`react`},{find:`use-sync-external-store/shim`,replacement:`react`},{find:`use-sync-external-store`,replacement:`react`},{find:`@`,replacement:h(s.default.resolve(e,`../packages/core/src`))}],dedupe:[`react`,`react-dom`]},ssr:{external:[`react`,`react-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`,...o()],optimizeDeps:{include:[`react`,`react-dom`,`react-fast-compare`,`invariant`,...v.vite?.ssr?.optimizeDeps?.include||[]]},noExternal:[`boltdocs`,/@bdocs\/(?!ssg).*/,`react-aria-components`,`@react-aria/collections`,`@react-aria/utils`,`react-router-dom`]},server:{watch:{ignored:[`**/.boltdocs/**`,...Array.isArray(v.vite?.server?.watch?.ignored)?v.vite.server.watch.ignored:v.vite?.server?.watch?.ignored?[v.vite.server.watch.ignored]:[]]},headers:{...C,...v.vite?.server?.headers},...v.vite?.server},preview:{headers:{...C,...v.vite?.preview?.headers},...v.vite?.preview},...v.vite}}Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return T}});
|