boltdocs 2.7.11 → 2.8.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 -2
- package/dist/banner-3N4Jd_L9.d.ts +100 -0
- package/dist/banner-MynZD_Ox.d.cts +100 -0
- package/dist/cache-BMUyNiiA.mjs +6 -0
- package/dist/cache-CKm45d2w.cjs +6 -0
- package/dist/client/index.cjs +782 -443
- package/dist/client/index.d.cts +86 -110
- package/dist/client/index.d.ts +87 -111
- package/dist/client/index.js +773 -439
- package/dist/client/mdx.cjs +8 -3
- package/dist/client/mdx.d.cts +39 -93
- package/dist/client/mdx.d.ts +38 -93
- package/dist/client/mdx.js +3 -3
- package/dist/client/primitives.cjs +7 -7
- package/dist/client/primitives.d.cts +411 -347
- package/dist/client/primitives.d.ts +411 -347
- package/dist/client/primitives.js +4 -4
- package/dist/{docs-layout-BXHV0xw_.cjs → docs-layout-CwCq42Zt.cjs} +95 -178
- package/dist/{docs-layout-DwFndmj5.js → docs-layout-Dn6S5g59.js} +99 -163
- package/dist/doctor-BArviV8X.cjs +28 -0
- package/dist/doctor-CgLA7_Uv.mjs +28 -0
- package/dist/{doctor-CrytFkqW.cjs → doctor-DyNUVe96.cjs} +1 -1
- package/dist/{routes-DP1vmWRj.cjs → doctor-aN_leTbh.mjs} +1 -1
- package/dist/{generator-ClVanhvi.mjs → generator-BHCrLU6h.mjs} +2 -2
- package/dist/{generator-CHqxiQhF.cjs → generator-CC2yHzhZ.cjs} +2 -2
- package/dist/{icons-dev-3cZMyt8r.cjs → icons-dev-DvJ-hh9x.cjs} +116 -111
- package/dist/{icons-dev-Df8OQ481.js → icons-dev-Oju24Wjp.js} +120 -114
- package/dist/{image-DtrI2cw3.cjs → image-Ch4-GxdO.cjs} +13 -13
- package/dist/{image-jxPb-2iV.js → image-Do8V9PCW.js} +13 -13
- package/dist/{mdx-UTTLFWJq.js → mdx-D3A2_l7P.js} +106 -80
- package/dist/{mdx-BdWkJTeB.cjs → mdx-PLhhPJRS.cjs} +104 -96
- package/dist/node/cli-entry.cjs +3 -1
- package/dist/node/cli-entry.mjs +3 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +258 -152
- package/dist/node/index.d.mts +258 -150
- package/dist/node/index.mjs +1 -1
- package/dist/node/routes/worker.cjs +1 -1
- package/dist/node/routes/worker.mjs +1 -1
- package/dist/node-BmlP0eBP.cjs +159 -0
- package/dist/node-Y8_4ayje.mjs +159 -0
- package/dist/package-2nFy_NsW.cjs +6 -0
- package/dist/{package-K0zsjGIz.mjs → package-DAbtltXX.mjs} +1 -1
- package/dist/parser-B7-6PyQz.cjs +6 -0
- package/dist/{parser-Aq8LoH-0.cjs → parser-BzB-zCkF.cjs} +1 -1
- package/dist/parser-WGZdWs0X.mjs +6 -0
- package/dist/routes-BDDSxAl0.mjs +6 -0
- package/dist/routes-DJNJ-rTt.cjs +6 -0
- package/dist/routes-DiYC4nD2.cjs +6 -0
- package/dist/routes-_Bb2f4eI.mjs +6 -0
- package/dist/{search-dialog-C7xuvyNk.cjs → search-dialog-BXVoecTx.cjs} +175 -78
- package/dist/{search-dialog-BwkDuI9R.cjs → search-dialog-BYhOov4S.cjs} +118 -7
- package/dist/{search-dialog-D-DDN7zJ.js → search-dialog-C09riYmx.js} +113 -8
- package/dist/{search-dialog-CIQg6k8c.cjs → search-dialog-CUeAfy-8.cjs} +1 -1
- package/dist/{search-dialog-BNF10tDl.js → search-dialog-D8gLkhUV.js} +158 -80
- package/dist/{search-dialog-BHuIiUC6.js → search-dialog-DHc_8FFX.js} +1 -1
- package/dist/{sidebar-CyZS9YOm.d.ts → sidebar-DNq4_ZAa.d.ts} +117 -51
- package/dist/{sidebar-CcBkrm06.d.cts → sidebar-Dlkgbxs6.d.cts} +117 -51
- package/dist/utils-BYITg7T5.mjs +7 -0
- package/dist/utils-Cjmx1hhk.cjs +7 -0
- package/dist/worker-pool-CtqklOXq.cjs +6 -0
- package/dist/worker-pool-k0DY6k8T.mjs +6 -0
- package/package.json +3 -3
- package/src/shared/config-utils.ts +4 -0
- package/src/shared/types.ts +52 -6
- package/dist/cache-Ba-DZQNH.cjs +0 -6
- package/dist/cache-BuMZ58L5.mjs +0 -6
- package/dist/cards-BakZPTz9.d.ts +0 -30
- package/dist/cards-CQn9mXZS.d.cts +0 -30
- package/dist/doctor-Be7Ly1oM.mjs +0 -21
- package/dist/doctor-jMxWZyLJ.cjs +0 -21
- package/dist/node-BSM4qcDK.cjs +0 -111
- package/dist/node-BspZN3R2.mjs +0 -111
- package/dist/package-DIIrjuWI.cjs +0 -6
- package/dist/parser-CdNbqN5y.cjs +0 -6
- package/dist/parser-nE792MLO.mjs +0 -6
- package/dist/rolldown-runtime-fkIsjY3S.mjs +0 -6
- package/dist/routes-2k3tbUmC.cjs +0 -6
- package/dist/routes-CpxZIsMM.mjs +0 -6
- package/dist/utils-CG65J0Sc.mjs +0 -7
- package/dist/utils-CKunkU96.cjs +0 -7
- package/dist/worker-pool-CGn7DrLb.mjs +0 -6
- package/dist/worker-pool-Crbqgw5R.cjs +0 -6
- /package/dist/{meta-loader-CWg2gnbY.mjs → meta-loader-DzwDFtdT.mjs} +0 -0
|
@@ -3,73 +3,12 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import { a as CodeBlockGroup, i as CodeBlockContent, l as useTheme, n as Tooltip, o as CodeBlockHeader, r as CodeBlock$1, s as Heading$1, t as Image$1 } from "./image-
|
|
8
|
-
import {
|
|
6
|
+
import { D as Check, F as File, M as Copy, T as AlertTriangle, V as Lightbulb, _ as Link, a as Csv, c as JavaScript, d as React$1, f as Rust, g as Yaml, i as Css, l as Json, m as TypeScript, n as BracketsOrange, p as Shell, r as BracketsRed, u as Markdown, w as AlertCircle, y as cn, z as Info } from "./icons-dev-Oju24Wjp.js";
|
|
7
|
+
import { a as CodeBlockGroup, i as CodeBlockContent, l as useTheme, n as Tooltip, o as CodeBlockHeader, r as CodeBlock$1, s as Heading$1, t as Image$1 } from "./image-Do8V9PCW.js";
|
|
8
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { Button } from "react-aria-components";
|
|
11
11
|
|
|
12
|
-
//#region src/client/components/mdx/callout.tsx
|
|
13
|
-
const variantStyles = {
|
|
14
|
-
note: {
|
|
15
|
-
container: "bg-slate-500/5 dark:bg-slate-500/10 border-slate-500/40 text-slate-800 dark:text-slate-200",
|
|
16
|
-
titleText: "text-slate-900 dark:text-slate-100",
|
|
17
|
-
iconColor: "text-slate-500",
|
|
18
|
-
icon: Info,
|
|
19
|
-
defaultTitle: "Note"
|
|
20
|
-
},
|
|
21
|
-
info: {
|
|
22
|
-
container: "bg-indigo-500/5 dark:bg-indigo-500/10 border-indigo-500/40 text-indigo-800 dark:text-indigo-200",
|
|
23
|
-
titleText: "text-indigo-900 dark:text-indigo-100",
|
|
24
|
-
iconColor: "text-indigo-500",
|
|
25
|
-
icon: Info,
|
|
26
|
-
defaultTitle: "Info"
|
|
27
|
-
},
|
|
28
|
-
tip: {
|
|
29
|
-
container: "bg-green-500/5 dark:bg-green-500/10 border-green-500/40 text-green-800 dark:text-green-200",
|
|
30
|
-
titleText: "text-green-900 dark:text-green-100",
|
|
31
|
-
iconColor: "text-green-500",
|
|
32
|
-
icon: Lightbulb,
|
|
33
|
-
defaultTitle: "Tip"
|
|
34
|
-
},
|
|
35
|
-
warning: {
|
|
36
|
-
container: "bg-amber-500/5 dark:bg-amber-500/10 border-amber-500/40 text-amber-800 dark:text-amber-200",
|
|
37
|
-
titleText: "text-amber-900 dark:text-amber-100",
|
|
38
|
-
iconColor: "text-amber-500",
|
|
39
|
-
icon: AlertTriangle,
|
|
40
|
-
defaultTitle: "Warning"
|
|
41
|
-
},
|
|
42
|
-
danger: {
|
|
43
|
-
container: "bg-rose-500/5 dark:bg-rose-500/10 border-rose-500/40 text-rose-800 dark:text-rose-200",
|
|
44
|
-
titleText: "text-rose-900 dark:text-rose-100",
|
|
45
|
-
iconColor: "text-rose-500",
|
|
46
|
-
icon: AlertCircle,
|
|
47
|
-
defaultTitle: "Danger"
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
function Callout({ children, className = "", variant = "note", title, ...props }) {
|
|
51
|
-
const styles = variantStyles[variant] || variantStyles.note;
|
|
52
|
-
const Icon = styles.icon;
|
|
53
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
54
|
-
className: cn("my-6 flex gap-4 p-4 rounded-xl border-2", styles.container, className),
|
|
55
|
-
...props,
|
|
56
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
57
|
-
className: cn("shrink-0 pt-0.5", styles.iconColor),
|
|
58
|
-
children: /* @__PURE__ */ jsx(Icon, { className: "w-5 h-5 stroke-[2]" })
|
|
59
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
60
|
-
className: "flex-1 text-[0.875rem] leading-[1.6]",
|
|
61
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
62
|
-
className: cn("font-bold text-sm mb-1", styles.titleText),
|
|
63
|
-
children: title || styles.defaultTitle
|
|
64
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
65
|
-
className: "prose prose-neutral dark:prose-invert max-w-none [&>p]:m-0 [&>p+p]:mt-2",
|
|
66
|
-
children
|
|
67
|
-
})]
|
|
68
|
-
})]
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
//#endregion
|
|
73
12
|
//#region src/client/components/mdx/field.tsx
|
|
74
13
|
const Field = ({ children, name, type, description, required }) => /* @__PURE__ */ jsxs("div", {
|
|
75
14
|
className: "my-4 border border-subtle bg-surface/50 p-4 rounded-xl flex flex-col gap-1 text-sm select-none",
|
|
@@ -223,18 +162,65 @@ const TableComponents = {
|
|
|
223
162
|
};
|
|
224
163
|
|
|
225
164
|
//#endregion
|
|
226
|
-
//#region src/client/
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
165
|
+
//#region src/client/components/mdx/callout.tsx
|
|
166
|
+
const variantStyles = {
|
|
167
|
+
note: {
|
|
168
|
+
container: "bg-slate-500/5 dark:bg-slate-500/10 border-slate-500/40 text-slate-800 dark:text-slate-200",
|
|
169
|
+
titleText: "text-slate-900 dark:text-slate-100",
|
|
170
|
+
iconColor: "text-slate-500",
|
|
171
|
+
icon: Info,
|
|
172
|
+
defaultTitle: "Note"
|
|
173
|
+
},
|
|
174
|
+
info: {
|
|
175
|
+
container: "bg-indigo-500/5 dark:bg-indigo-500/10 border-indigo-500/40 text-indigo-800 dark:text-indigo-200",
|
|
176
|
+
titleText: "text-indigo-900 dark:text-indigo-100",
|
|
177
|
+
iconColor: "text-indigo-500",
|
|
178
|
+
icon: Info,
|
|
179
|
+
defaultTitle: "Info"
|
|
180
|
+
},
|
|
181
|
+
tip: {
|
|
182
|
+
container: "bg-green-500/5 dark:bg-green-500/10 border-green-500/40 text-green-800 dark:text-green-200",
|
|
183
|
+
titleText: "text-green-900 dark:text-green-100",
|
|
184
|
+
iconColor: "text-green-500",
|
|
185
|
+
icon: Lightbulb,
|
|
186
|
+
defaultTitle: "Tip"
|
|
187
|
+
},
|
|
188
|
+
warning: {
|
|
189
|
+
container: "bg-amber-500/5 dark:bg-amber-500/10 border-amber-500/40 text-amber-800 dark:text-amber-200",
|
|
190
|
+
titleText: "text-amber-900 dark:text-amber-100",
|
|
191
|
+
iconColor: "text-amber-500",
|
|
192
|
+
icon: AlertTriangle,
|
|
193
|
+
defaultTitle: "Warning"
|
|
194
|
+
},
|
|
195
|
+
danger: {
|
|
196
|
+
container: "bg-rose-500/5 dark:bg-rose-500/10 border-rose-500/40 text-rose-800 dark:text-rose-200",
|
|
197
|
+
titleText: "text-rose-900 dark:text-rose-100",
|
|
198
|
+
iconColor: "text-rose-500",
|
|
199
|
+
icon: AlertCircle,
|
|
200
|
+
defaultTitle: "Danger"
|
|
235
201
|
}
|
|
236
|
-
return "";
|
|
237
202
|
};
|
|
203
|
+
function Callout({ children, className = "", variant = "note", title, ...props }) {
|
|
204
|
+
const styles = variantStyles[variant] || variantStyles.note;
|
|
205
|
+
const Icon = styles.icon;
|
|
206
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
207
|
+
className: cn("my-6 flex gap-4 p-4 rounded-xl border-2", styles.container, className),
|
|
208
|
+
...props,
|
|
209
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
210
|
+
className: cn("shrink-0 pt-0.5", styles.iconColor),
|
|
211
|
+
children: /* @__PURE__ */ jsx(Icon, { className: "w-5 h-5 stroke-[2]" })
|
|
212
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
213
|
+
className: "flex-1 text-[0.875rem] leading-[1.6]",
|
|
214
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
215
|
+
className: cn("font-bold text-sm mb-1", styles.titleText),
|
|
216
|
+
children: title || styles.defaultTitle
|
|
217
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
218
|
+
className: "prose prose-neutral dark:prose-invert max-w-none [&>p]:m-0 [&>p+p]:mt-2",
|
|
219
|
+
children
|
|
220
|
+
})]
|
|
221
|
+
})]
|
|
222
|
+
});
|
|
223
|
+
}
|
|
238
224
|
|
|
239
225
|
//#endregion
|
|
240
226
|
//#region src/client/utils/copy-clipboard.ts
|
|
@@ -267,10 +253,20 @@ function useCodeBlock(props) {
|
|
|
267
253
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
268
254
|
const [isExpandable, setIsExpandable] = useState(false);
|
|
269
255
|
const preRef = useRef(null);
|
|
256
|
+
const timerRef = useRef(null);
|
|
257
|
+
useEffect(() => {
|
|
258
|
+
return () => {
|
|
259
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
260
|
+
};
|
|
261
|
+
}, []);
|
|
270
262
|
const handleCopy = useCallback(async () => {
|
|
271
263
|
copyToClipboard(preRef.current?.textContent ?? "");
|
|
272
264
|
setCopied(true);
|
|
273
|
-
|
|
265
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
266
|
+
timerRef.current = setTimeout(() => {
|
|
267
|
+
setCopied(false);
|
|
268
|
+
timerRef.current = null;
|
|
269
|
+
}, 2e3);
|
|
274
270
|
}, []);
|
|
275
271
|
useEffect(() => {
|
|
276
272
|
const lines = (preRef.current?.textContent ?? "").trim().split("\n").length;
|
|
@@ -320,7 +316,9 @@ const CopyButton = ({ copied, handleCopy }) => {
|
|
|
320
316
|
});
|
|
321
317
|
};
|
|
322
318
|
function CodeBlock(props) {
|
|
323
|
-
const { children, hideCopy = false, highlightedHtml, "data-highlighted-html": dataHighlightedHtml, title, "data-title": dataTitle, "data-lang": dataLang, plain = false, ...rest } = props;
|
|
319
|
+
const { children, hideCopy = false, highlightedHtml, "data-highlighted-html": dataHighlightedHtml, title, "data-title": dataTitle, "data-lang": dataLang, plain = false, lineNumbers, showLineNumbers, wordWrap, "word-wrap": wordWrapHyphen, metastring, ...rest } = props;
|
|
320
|
+
const { style, className: shikiClassName, ...cleanRest } = rest;
|
|
321
|
+
const isHighlighted = props["data-highlighted"] === "true" || typeof shikiClassName === "string" && shikiClassName.includes("shiki");
|
|
324
322
|
const rawHighlightedHtml = highlightedHtml || dataHighlightedHtml;
|
|
325
323
|
const effectiveHighlightedHtml = typeof rawHighlightedHtml === "string" ? rawHighlightedHtml.replace(/<span class="line">\s*(?:<span[^>]*>\s*<\/span>)?\s*<\/span>\s*(<\/code>\s*<\/pre>)/g, "$1") : rawHighlightedHtml;
|
|
326
324
|
const effectiveTitle = title || dataTitle;
|
|
@@ -350,9 +348,12 @@ function CodeBlock(props) {
|
|
|
350
348
|
dangerouslySetInnerHTML: { __html: effectiveHighlightedHtml }
|
|
351
349
|
}) : /* @__PURE__ */ jsx("pre", {
|
|
352
350
|
ref: preRef,
|
|
353
|
-
className: "m-0!
|
|
354
|
-
|
|
355
|
-
|
|
351
|
+
className: cn("m-0! rounded-none! border-none! bg-transparent!", "text-[0.875rem] leading-[1.6] overflow-x-auto", shikiClassName, {
|
|
352
|
+
"p-0! [&>code]:grid! [&>code]:p-5! [&>code]:bg-transparent!": isHighlighted,
|
|
353
|
+
"p-5!": !isHighlighted
|
|
354
|
+
}),
|
|
355
|
+
...cleanRest,
|
|
356
|
+
children
|
|
356
357
|
}), isExpandable && /* @__PURE__ */ jsx("div", {
|
|
357
358
|
className: cn(shouldTruncate ? "absolute bottom-0 inset-x-0 h-24 bg-linear-to-t from-(--color-code-bg) to-transparent flex items-end justify-center pb-4 z-10" : "relative flex justify-center pb-4 pt-1 -mt-4"),
|
|
358
359
|
children: /* @__PURE__ */ jsx(Button, {
|
|
@@ -477,12 +478,37 @@ function Cards({ children, className, cols = 2, ...props }) {
|
|
|
477
478
|
});
|
|
478
479
|
}
|
|
479
480
|
|
|
481
|
+
//#endregion
|
|
482
|
+
//#region src/client/components/mdx/last-updated.tsx
|
|
483
|
+
/**
|
|
484
|
+
* A subtle display for when the page was last updated.
|
|
485
|
+
* Small, opaque, and positioned at the bottom of the content with a thin top border divider.
|
|
486
|
+
*/
|
|
487
|
+
function LastUpdated({ date }) {
|
|
488
|
+
if (!date) return null;
|
|
489
|
+
const d = new Date(date);
|
|
490
|
+
if (Number.isNaN(d.getTime())) return null;
|
|
491
|
+
const formattedDate = d.toLocaleDateString(void 0, {
|
|
492
|
+
year: "numeric",
|
|
493
|
+
month: "long",
|
|
494
|
+
day: "numeric"
|
|
495
|
+
});
|
|
496
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
497
|
+
className: "mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none",
|
|
498
|
+
children: [/* @__PURE__ */ jsx("span", {}), /* @__PURE__ */ jsxs("span", {
|
|
499
|
+
className: "italic",
|
|
500
|
+
children: ["Last updated on ", formattedDate]
|
|
501
|
+
})]
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
|
|
480
505
|
//#endregion
|
|
481
506
|
//#region src/client/components/mdx/index.ts
|
|
482
507
|
const mdx_components_default = {
|
|
483
508
|
...Typographics,
|
|
484
509
|
...TableComponents,
|
|
485
510
|
...ImageComponents,
|
|
511
|
+
LastUpdated,
|
|
486
512
|
pre: CodeBlock,
|
|
487
513
|
Field,
|
|
488
514
|
Callout,
|
|
@@ -491,4 +517,4 @@ const mdx_components_default = {
|
|
|
491
517
|
};
|
|
492
518
|
|
|
493
519
|
//#endregion
|
|
494
|
-
export {
|
|
520
|
+
export { copyToClipboard as n, mdx_components_default as t };
|
|
@@ -3,73 +3,12 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
const require_icons_dev = require('./icons-dev-
|
|
7
|
-
const require_image = require('./image-
|
|
6
|
+
const require_icons_dev = require('./icons-dev-DvJ-hh9x.cjs');
|
|
7
|
+
const require_image = require('./image-Ch4-GxdO.cjs');
|
|
8
8
|
let react = require("react");
|
|
9
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
10
|
let react_aria_components = require("react-aria-components");
|
|
11
11
|
|
|
12
|
-
//#region src/client/components/mdx/callout.tsx
|
|
13
|
-
const variantStyles = {
|
|
14
|
-
note: {
|
|
15
|
-
container: "bg-slate-500/5 dark:bg-slate-500/10 border-slate-500/40 text-slate-800 dark:text-slate-200",
|
|
16
|
-
titleText: "text-slate-900 dark:text-slate-100",
|
|
17
|
-
iconColor: "text-slate-500",
|
|
18
|
-
icon: require_icons_dev.Info,
|
|
19
|
-
defaultTitle: "Note"
|
|
20
|
-
},
|
|
21
|
-
info: {
|
|
22
|
-
container: "bg-indigo-500/5 dark:bg-indigo-500/10 border-indigo-500/40 text-indigo-800 dark:text-indigo-200",
|
|
23
|
-
titleText: "text-indigo-900 dark:text-indigo-100",
|
|
24
|
-
iconColor: "text-indigo-500",
|
|
25
|
-
icon: require_icons_dev.Info,
|
|
26
|
-
defaultTitle: "Info"
|
|
27
|
-
},
|
|
28
|
-
tip: {
|
|
29
|
-
container: "bg-green-500/5 dark:bg-green-500/10 border-green-500/40 text-green-800 dark:text-green-200",
|
|
30
|
-
titleText: "text-green-900 dark:text-green-100",
|
|
31
|
-
iconColor: "text-green-500",
|
|
32
|
-
icon: require_icons_dev.Lightbulb,
|
|
33
|
-
defaultTitle: "Tip"
|
|
34
|
-
},
|
|
35
|
-
warning: {
|
|
36
|
-
container: "bg-amber-500/5 dark:bg-amber-500/10 border-amber-500/40 text-amber-800 dark:text-amber-200",
|
|
37
|
-
titleText: "text-amber-900 dark:text-amber-100",
|
|
38
|
-
iconColor: "text-amber-500",
|
|
39
|
-
icon: require_icons_dev.AlertTriangle,
|
|
40
|
-
defaultTitle: "Warning"
|
|
41
|
-
},
|
|
42
|
-
danger: {
|
|
43
|
-
container: "bg-rose-500/5 dark:bg-rose-500/10 border-rose-500/40 text-rose-800 dark:text-rose-200",
|
|
44
|
-
titleText: "text-rose-900 dark:text-rose-100",
|
|
45
|
-
iconColor: "text-rose-500",
|
|
46
|
-
icon: require_icons_dev.AlertCircle,
|
|
47
|
-
defaultTitle: "Danger"
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
function Callout({ children, className = "", variant = "note", title, ...props }) {
|
|
51
|
-
const styles = variantStyles[variant] || variantStyles.note;
|
|
52
|
-
const Icon = styles.icon;
|
|
53
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
54
|
-
className: require_icons_dev.cn("my-6 flex gap-4 p-4 rounded-xl border-2", styles.container, className),
|
|
55
|
-
...props,
|
|
56
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
57
|
-
className: require_icons_dev.cn("shrink-0 pt-0.5", styles.iconColor),
|
|
58
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { className: "w-5 h-5 stroke-[2]" })
|
|
59
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
60
|
-
className: "flex-1 text-[0.875rem] leading-[1.6]",
|
|
61
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
62
|
-
className: require_icons_dev.cn("font-bold text-sm mb-1", styles.titleText),
|
|
63
|
-
children: title || styles.defaultTitle
|
|
64
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
65
|
-
className: "prose prose-neutral dark:prose-invert max-w-none [&>p]:m-0 [&>p+p]:mt-2",
|
|
66
|
-
children
|
|
67
|
-
})]
|
|
68
|
-
})]
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
//#endregion
|
|
73
12
|
//#region src/client/components/mdx/field.tsx
|
|
74
13
|
const Field = ({ children, name, type, description, required }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
75
14
|
className: "my-4 border border-subtle bg-surface/50 p-4 rounded-xl flex flex-col gap-1 text-sm select-none",
|
|
@@ -223,18 +162,65 @@ const TableComponents = {
|
|
|
223
162
|
};
|
|
224
163
|
|
|
225
164
|
//#endregion
|
|
226
|
-
//#region src/client/
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
165
|
+
//#region src/client/components/mdx/callout.tsx
|
|
166
|
+
const variantStyles = {
|
|
167
|
+
note: {
|
|
168
|
+
container: "bg-slate-500/5 dark:bg-slate-500/10 border-slate-500/40 text-slate-800 dark:text-slate-200",
|
|
169
|
+
titleText: "text-slate-900 dark:text-slate-100",
|
|
170
|
+
iconColor: "text-slate-500",
|
|
171
|
+
icon: require_icons_dev.Info,
|
|
172
|
+
defaultTitle: "Note"
|
|
173
|
+
},
|
|
174
|
+
info: {
|
|
175
|
+
container: "bg-indigo-500/5 dark:bg-indigo-500/10 border-indigo-500/40 text-indigo-800 dark:text-indigo-200",
|
|
176
|
+
titleText: "text-indigo-900 dark:text-indigo-100",
|
|
177
|
+
iconColor: "text-indigo-500",
|
|
178
|
+
icon: require_icons_dev.Info,
|
|
179
|
+
defaultTitle: "Info"
|
|
180
|
+
},
|
|
181
|
+
tip: {
|
|
182
|
+
container: "bg-green-500/5 dark:bg-green-500/10 border-green-500/40 text-green-800 dark:text-green-200",
|
|
183
|
+
titleText: "text-green-900 dark:text-green-100",
|
|
184
|
+
iconColor: "text-green-500",
|
|
185
|
+
icon: require_icons_dev.Lightbulb,
|
|
186
|
+
defaultTitle: "Tip"
|
|
187
|
+
},
|
|
188
|
+
warning: {
|
|
189
|
+
container: "bg-amber-500/5 dark:bg-amber-500/10 border-amber-500/40 text-amber-800 dark:text-amber-200",
|
|
190
|
+
titleText: "text-amber-900 dark:text-amber-100",
|
|
191
|
+
iconColor: "text-amber-500",
|
|
192
|
+
icon: require_icons_dev.AlertTriangle,
|
|
193
|
+
defaultTitle: "Warning"
|
|
194
|
+
},
|
|
195
|
+
danger: {
|
|
196
|
+
container: "bg-rose-500/5 dark:bg-rose-500/10 border-rose-500/40 text-rose-800 dark:text-rose-200",
|
|
197
|
+
titleText: "text-rose-900 dark:text-rose-100",
|
|
198
|
+
iconColor: "text-rose-500",
|
|
199
|
+
icon: require_icons_dev.AlertCircle,
|
|
200
|
+
defaultTitle: "Danger"
|
|
235
201
|
}
|
|
236
|
-
return "";
|
|
237
202
|
};
|
|
203
|
+
function Callout({ children, className = "", variant = "note", title, ...props }) {
|
|
204
|
+
const styles = variantStyles[variant] || variantStyles.note;
|
|
205
|
+
const Icon = styles.icon;
|
|
206
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
207
|
+
className: require_icons_dev.cn("my-6 flex gap-4 p-4 rounded-xl border-2", styles.container, className),
|
|
208
|
+
...props,
|
|
209
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
210
|
+
className: require_icons_dev.cn("shrink-0 pt-0.5", styles.iconColor),
|
|
211
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { className: "w-5 h-5 stroke-[2]" })
|
|
212
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
213
|
+
className: "flex-1 text-[0.875rem] leading-[1.6]",
|
|
214
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
215
|
+
className: require_icons_dev.cn("font-bold text-sm mb-1", styles.titleText),
|
|
216
|
+
children: title || styles.defaultTitle
|
|
217
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
218
|
+
className: "prose prose-neutral dark:prose-invert max-w-none [&>p]:m-0 [&>p+p]:mt-2",
|
|
219
|
+
children
|
|
220
|
+
})]
|
|
221
|
+
})]
|
|
222
|
+
});
|
|
223
|
+
}
|
|
238
224
|
|
|
239
225
|
//#endregion
|
|
240
226
|
//#region src/client/utils/copy-clipboard.ts
|
|
@@ -267,10 +253,20 @@ function useCodeBlock(props) {
|
|
|
267
253
|
const [isExpanded, setIsExpanded] = (0, react.useState)(false);
|
|
268
254
|
const [isExpandable, setIsExpandable] = (0, react.useState)(false);
|
|
269
255
|
const preRef = (0, react.useRef)(null);
|
|
256
|
+
const timerRef = (0, react.useRef)(null);
|
|
257
|
+
(0, react.useEffect)(() => {
|
|
258
|
+
return () => {
|
|
259
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
260
|
+
};
|
|
261
|
+
}, []);
|
|
270
262
|
const handleCopy = (0, react.useCallback)(async () => {
|
|
271
263
|
copyToClipboard(preRef.current?.textContent ?? "");
|
|
272
264
|
setCopied(true);
|
|
273
|
-
|
|
265
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
266
|
+
timerRef.current = setTimeout(() => {
|
|
267
|
+
setCopied(false);
|
|
268
|
+
timerRef.current = null;
|
|
269
|
+
}, 2e3);
|
|
274
270
|
}, []);
|
|
275
271
|
(0, react.useEffect)(() => {
|
|
276
272
|
const lines = (preRef.current?.textContent ?? "").trim().split("\n").length;
|
|
@@ -320,7 +316,9 @@ const CopyButton = ({ copied, handleCopy }) => {
|
|
|
320
316
|
});
|
|
321
317
|
};
|
|
322
318
|
function CodeBlock(props) {
|
|
323
|
-
const { children, hideCopy = false, highlightedHtml, "data-highlighted-html": dataHighlightedHtml, title, "data-title": dataTitle, "data-lang": dataLang, plain = false, ...rest } = props;
|
|
319
|
+
const { children, hideCopy = false, highlightedHtml, "data-highlighted-html": dataHighlightedHtml, title, "data-title": dataTitle, "data-lang": dataLang, plain = false, lineNumbers, showLineNumbers, wordWrap, "word-wrap": wordWrapHyphen, metastring, ...rest } = props;
|
|
320
|
+
const { style, className: shikiClassName, ...cleanRest } = rest;
|
|
321
|
+
const isHighlighted = props["data-highlighted"] === "true" || typeof shikiClassName === "string" && shikiClassName.includes("shiki");
|
|
324
322
|
const rawHighlightedHtml = highlightedHtml || dataHighlightedHtml;
|
|
325
323
|
const effectiveHighlightedHtml = typeof rawHighlightedHtml === "string" ? rawHighlightedHtml.replace(/<span class="line">\s*(?:<span[^>]*>\s*<\/span>)?\s*<\/span>\s*(<\/code>\s*<\/pre>)/g, "$1") : rawHighlightedHtml;
|
|
326
324
|
const effectiveTitle = title || dataTitle;
|
|
@@ -350,9 +348,12 @@ function CodeBlock(props) {
|
|
|
350
348
|
dangerouslySetInnerHTML: { __html: effectiveHighlightedHtml }
|
|
351
349
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
352
350
|
ref: preRef,
|
|
353
|
-
className: "m-0!
|
|
354
|
-
|
|
355
|
-
|
|
351
|
+
className: require_icons_dev.cn("m-0! rounded-none! border-none! bg-transparent!", "text-[0.875rem] leading-[1.6] overflow-x-auto", shikiClassName, {
|
|
352
|
+
"p-0! [&>code]:grid! [&>code]:p-5! [&>code]:bg-transparent!": isHighlighted,
|
|
353
|
+
"p-5!": !isHighlighted
|
|
354
|
+
}),
|
|
355
|
+
...cleanRest,
|
|
356
|
+
children
|
|
356
357
|
}), isExpandable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
357
358
|
className: require_icons_dev.cn(shouldTruncate ? "absolute bottom-0 inset-x-0 h-24 bg-linear-to-t from-(--color-code-bg) to-transparent flex items-end justify-center pb-4 z-10" : "relative flex justify-center pb-4 pt-1 -mt-4"),
|
|
358
359
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Button, {
|
|
@@ -477,12 +478,37 @@ function Cards({ children, className, cols = 2, ...props }) {
|
|
|
477
478
|
});
|
|
478
479
|
}
|
|
479
480
|
|
|
481
|
+
//#endregion
|
|
482
|
+
//#region src/client/components/mdx/last-updated.tsx
|
|
483
|
+
/**
|
|
484
|
+
* A subtle display for when the page was last updated.
|
|
485
|
+
* Small, opaque, and positioned at the bottom of the content with a thin top border divider.
|
|
486
|
+
*/
|
|
487
|
+
function LastUpdated({ date }) {
|
|
488
|
+
if (!date) return null;
|
|
489
|
+
const d = new Date(date);
|
|
490
|
+
if (Number.isNaN(d.getTime())) return null;
|
|
491
|
+
const formattedDate = d.toLocaleDateString(void 0, {
|
|
492
|
+
year: "numeric",
|
|
493
|
+
month: "long",
|
|
494
|
+
day: "numeric"
|
|
495
|
+
});
|
|
496
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
497
|
+
className: "mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none",
|
|
498
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
499
|
+
className: "italic",
|
|
500
|
+
children: ["Last updated on ", formattedDate]
|
|
501
|
+
})]
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
|
|
480
505
|
//#endregion
|
|
481
506
|
//#region src/client/components/mdx/index.ts
|
|
482
507
|
const mdx_components_default = {
|
|
483
508
|
...Typographics,
|
|
484
509
|
...TableComponents,
|
|
485
510
|
...ImageComponents,
|
|
511
|
+
LastUpdated,
|
|
486
512
|
pre: CodeBlock,
|
|
487
513
|
Field,
|
|
488
514
|
Callout,
|
|
@@ -491,18 +517,6 @@ const mdx_components_default = {
|
|
|
491
517
|
};
|
|
492
518
|
|
|
493
519
|
//#endregion
|
|
494
|
-
Object.defineProperty(exports, 'Card', {
|
|
495
|
-
enumerable: true,
|
|
496
|
-
get: function () {
|
|
497
|
-
return Card;
|
|
498
|
-
}
|
|
499
|
-
});
|
|
500
|
-
Object.defineProperty(exports, 'Cards', {
|
|
501
|
-
enumerable: true,
|
|
502
|
-
get: function () {
|
|
503
|
-
return Cards;
|
|
504
|
-
}
|
|
505
|
-
});
|
|
506
520
|
Object.defineProperty(exports, 'copyToClipboard', {
|
|
507
521
|
enumerable: true,
|
|
508
522
|
get: function () {
|
|
@@ -514,10 +528,4 @@ Object.defineProperty(exports, 'mdx_components_default', {
|
|
|
514
528
|
get: function () {
|
|
515
529
|
return mdx_components_default;
|
|
516
530
|
}
|
|
517
|
-
});
|
|
518
|
-
Object.defineProperty(exports, 'reactToText', {
|
|
519
|
-
enumerable: true,
|
|
520
|
-
get: function () {
|
|
521
|
-
return reactToText;
|
|
522
|
-
}
|
|
523
531
|
});
|
package/dist/node/cli-entry.cjs
CHANGED
|
@@ -4,4 +4,6 @@
|
|
|
4
4
|
* Copyright (c) 2026 Jesus Alcala
|
|
5
5
|
* Licensed under the MIT License.
|
|
6
6
|
*/
|
|
7
|
-
const e=require(`../chunk-CU-zTemE.cjs`),t=require(`../
|
|
7
|
+
const e=require(`../chunk-CU-zTemE.cjs`),t=require(`../doctor-BArviV8X.cjs`),n=require(`../node-BmlP0eBP.cjs`);let r=require(`vite`),i=require(`node:path`);i=e.t(i);let a=require(`node:fs`);a=e.t(a);let o=require(`@bdocs/dui`),s=require(`node:fs/promises`);s=e.t(s);let c=require(`@bdocs/ssg/node`),l=require(`cac`);l=e.t(l);function u(e){let t=e;for(;t&&t!==i.default.dirname(t);){if(a.default.existsSync(i.default.join(t,`.git`))||a.default.existsSync(i.default.join(t,`pnpm-workspace.yaml`)))return t;t=i.default.dirname(t)}t=e;let n=e;for(;t&&t!==i.default.dirname(t);)a.default.existsSync(i.default.join(t,`package.json`))&&(n=t),t=i.default.dirname(t);return n}let d=u(process.cwd());function f(e){if(!e)return;let t;if(typeof e==`string`)t=e;else if(e instanceof URL){if(e.protocol!==`file:`)return;t=e.pathname}else if(Buffer.isBuffer(e))t=e.toString();else return;let n=i.default.resolve(d,t),r=i.default.relative(d,n),a=r.startsWith(`..`)||i.default.isAbsolute(r),o=n.split(i.default.sep),s=o.some(e=>e.startsWith(`.env`)),c=o.some((e,t)=>{if(e===`node_modules`){let e=o[t+1];return!e||!e.startsWith(`.`)}return!1});if(a||s||c)throw Error(`[Boltdocs Security] Write/delete operation blocked on path: "${n}". Modifications are restricted to the project root, and cannot access .env or non-cache node_modules folders.`)}function p(e){return e==null?!1:typeof e==`number`?e!==0:typeof e==`string`?e.includes(`w`)||e.includes(`a`)||e.includes(`+`):!0}function m(){let e=a.default.writeFile;a.default.writeFile=function(t,...n){try{f(t)}catch(e){let t=n[n.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return e.call(a.default,t,...n)};let t=a.default.writeFileSync;a.default.writeFileSync=function(e,...n){return f(e),t.call(a.default,e,...n)};let n=a.default.rm;a.default.rm=function(e,...t){try{f(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return n.call(a.default,e,...t)};let r=a.default.rmSync;a.default.rmSync=function(e,...t){return f(e),r.call(a.default,e,...t)};let i=a.default.unlink;a.default.unlink=function(e,...t){try{f(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return i.call(a.default,e,...t)};let o=a.default.unlinkSync;a.default.unlinkSync=function(e,...t){return f(e),o.call(a.default,e,...t)};let c=a.default.mkdir;a.default.mkdir=function(e,...t){try{f(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return c.call(a.default,e,...t)};let l=a.default.mkdirSync;a.default.mkdirSync=function(e,...t){return f(e),l.call(a.default,e,...t)};let u=a.default.rmdir;a.default.rmdir=function(e,...t){try{f(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return u.call(a.default,e,...t)};let d=a.default.rmdirSync;a.default.rmdirSync=function(e,...t){return f(e),d.call(a.default,e,...t)};let m=a.default.appendFile;a.default.appendFile=function(e,...t){try{f(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return m.call(a.default,e,...t)};let h=a.default.appendFileSync;a.default.appendFileSync=function(e,...t){return f(e),h.call(a.default,e,...t)};let g=a.default.copyFile;a.default.copyFile=function(e,t,...n){try{f(e),f(t)}catch(e){let t=n[n.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return g.call(a.default,e,t,...n)};let _=a.default.copyFileSync;a.default.copyFileSync=function(e,t,...n){return f(e),f(t),_.call(a.default,e,t,...n)};let v=a.default.rename;a.default.rename=function(e,t,...n){try{f(e),f(t)}catch(e){let t=n[n.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return v.call(a.default,e,t,...n)};let y=a.default.renameSync;a.default.renameSync=function(e,t,...n){return f(e),f(t),y.call(a.default,e,t,...n)};let b=a.default.createWriteStream;a.default.createWriteStream=function(e,...t){return f(e),b.call(a.default,e,...t)};let x=a.default.open;a.default.open=function(e,t,...n){if(p(typeof t==`function`?void 0:t))try{f(e)}catch(e){let r=n[n.length-1],i=typeof t==`function`?t:typeof r==`function`?r:void 0;if(i){process.nextTick(()=>i(e));return}throw e}return x.call(a.default,e,t,...n)};let S=a.default.openSync;a.default.openSync=function(e,t,...n){return p(t)&&f(e),S.call(a.default,e,t,...n)};let C=e=>{if(!e)return;let t=e.writeFile;t&&(e.writeFile=async function(n,...r){return f(n),t.call(e,n,...r)});let n=e.rm;n&&(e.rm=async function(t,...r){return f(t),n.call(e,t,...r)});let r=e.mkdir;r&&(e.mkdir=async function(t,...n){return f(t),r.call(e,t,...n)});let i=e.rmdir;i&&(e.rmdir=async function(t,...n){return f(t),i.call(e,t,...n)});let a=e.unlink;a&&(e.unlink=async function(t,...n){return f(t),a.call(e,t,...n)});let o=e.appendFile;o&&(e.appendFile=async function(t,...n){return f(t),o.call(e,t,...n)});let s=e.copyFile;s&&(e.copyFile=async function(t,n,...r){return f(t),f(n),s.call(e,t,n,...r)});let c=e.rename;c&&(e.rename=async function(t,n,...r){return f(t),f(n),c.call(e,t,n,...r)});let l=e.open;l&&(e.open=async function(t,n,...r){return p(n)&&f(t),l.call(e,t,n,...r)})};C(a.default.promises),C(s.default)}let h=!1;async function g(e=process.cwd()){if(!h){h=!0,t.d();try{n.S(await t.p(i.default.resolve(e,`docs`),e),e)}catch{}try{let t=await n.n(e,`development`);t.logLevel=`warn`,t.clearScreen=!1;let r=await(0,c.createServer)(t);await r.listen();let i=r.resolvedUrls;console.log((0,o.devServer)(i?.local?.[0]??`http://localhost:5173`,i?.network?.[0]??null)),r.bindCLIShortcuts({print:!1})}catch(e){(0,o.error)(`Failed to start dev server:`,e),process.exit(1)}}}async function _(e=process.cwd()){t.d();try{let t=await n.x().run({root:e,timing:{}});t.success||((0,o.error)(`Build failed at step "${t.failedStep}":`,t.error),process.exit(1)),(0,o.success)(`SSG build completed successfully in ${Math.round(t.timing.total)}ms!`),process.exit(0)}catch(e){(0,o.error)(`Build failed:`,e),process.exit(1)}}async function v(e=process.cwd()){try{let t=await createViteConfig(e,`production`);t.logLevel=`warn`,t.clearScreen=!1;let n=await(0,r.preview)(t),i=n.resolvedUrls;console.log(n(i?.local?.[0]??`http://localhost:4173`,i?.network?.[0]??null))}catch(e){(0,o.error)(`Failed to start preview server:`,e),process.exit(1)}}function y(e){let t=[];if(!a.default.existsSync(e))return t;try{let n=a.default.readdirSync(e);for(let r of n){let n=i.default.join(e,r);a.default.statSync(n).isDirectory()?r!==`node_modules`&&r!==`.git`&&r!==`dist`&&r!==`coverage`&&t.push(...y(n)):/\.(js|mjs|cjs|ts|tsx|jsx)$/.test(r)&&t.push(n)}}catch{}return t}async function b(e=process.cwd()){(0,o.info)(`Starting static security audit of Boltdocs plugins...`);let n;try{n=await t.p(i.default.resolve(e,`docs`),e)}catch(e){(0,o.error)(`Failed to load Boltdocs configuration for audit:`,e),process.exit(1)}let r=n.plugins||[];if(r.length===0){(0,o.success)(`No plugins configured. Nothing to audit.`);return}let s=[];for(let t of r){if(!t.name)continue;let n=null;try{let{createRequire:r}=await import(`node:module`),a=r(i.default.resolve(e,`package.json`)).resolve(`${t.name}/package.json`);n=i.default.dirname(a)}catch{let r=i.default.resolve(e,`node_modules`,t.name);a.default.existsSync(r)&&(n=r)}if(!n){s.push({name:o.colors.cyan(t.name),status:o.colors.red(`❓ Unresolved`),details:`Could not locate plugin files in node_modules.`});continue}let r=y(n),c=[];for(let e of r)try{let t=a.default.readFileSync(e,`utf-8`);t.includes(`fetch(`)&&c.push(`fetch`),t.includes(`axios`)&&c.push(`axios`),t.includes(`http.request`)&&c.push(`http.request`),t.includes(`https.request`)&&c.push(`https.request`),t.includes(`process.env`)&&c.push(`process.env`)}catch{}let l=Array.from(new Set(c));l.length>0?s.push({name:o.colors.cyan(t.name),status:o.colors.yellow(`⚠️ Warning`),details:`Contains network/env accesses: ${o.colors.bold(l.join(`, `))}. Ensure you trust the author.`}):s.push({name:o.colors.cyan(t.name),status:o.colors.green(`✅ Clean`),details:`No external network calls or env accesses detected.`})}let c=[`Plugin`,`Status`,`Audit Notes`],l=s.map(e=>[e.name,e.status,e.details]);console.log(`
|
|
8
|
+
`+(0,o.table)(c,l)+`
|
|
9
|
+
`),s.some(e=>e.status.includes(`Warning`))?(0,o.warn)(`⚠️ One or more plugins have security warnings. Review the flags above.`):(0,o.success)(`✓ All plugins passed the static security check!`)}process.noDeprecation=!0,m(),(0,o.configure)({prefix:`boltdocs`,devServerTitle:`boltdocs dev server`,previewServerTitle:`boltdocs preview server`,updateCommand:`pnpm add boltdocs@latest`});const x=(0,l.default)(`boltdocs`);x.command(`dev [root]`,`Start development server`).action(g),x.command(`[root]`,`Start development server`).action(g),x.command(`build [root]`,`Build for production`).action(_),x.command(`preview [root]`,`Preview production build`).action(v),x.command(`audit [root]`,`Audit configured plugins for security warnings`).action(b),x.command(`doctor [root]`,`Check the health of your documentation`).option(`--fix`,`Automatically fix broken internal links and sync translations`).option(`--check-external`,`Verify external links (slower)`).option(`--init`,`Initialize doctor.json with default configuration`).option(`--budget`,`Check build performance against configured budgets`).action(async(e,t)=>{let{doctorAction:n}=await Promise.resolve().then(()=>require(`../doctor-DyNUVe96.cjs`));await n(e,t)}),x.command(`generate-changelog <file>`,`Generate changelog documentation from CHANGELOG.md`).option(`-o, --output <path>`,`Output folder (default: docs/changelog)`,{default:`docs/changelog`}).option(`-t, --title <text>`,`Title for changelog pages`,{default:`Changelog`}).option(`--infer-tab`,`Infer tab from folder name (default: true)`,{default:!0}).option(`-l, --limit <number>`,`Limit number of versions to generate`).action(async(e,t)=>{let{generateChangelog:n}=await Promise.resolve().then(()=>require(`../generator-CC2yHzhZ.cjs`));await n(e,{output:t.output,title:t.title,inferTab:t.inferTab,limit:t.limit?parseInt(String(t.limit),10):void 0})}),x.help(),x.version(`2.0.0`),x.parse();
|
package/dist/node/cli-entry.mjs
CHANGED
|
@@ -4,4 +4,6 @@
|
|
|
4
4
|
* Copyright (c) 2026 Jesus Alcala
|
|
5
5
|
* Licensed under the MIT License.
|
|
6
6
|
*/
|
|
7
|
-
import{
|
|
7
|
+
import{C as e,n as t,w as n}from"../node-Y8_4ayje.mjs";import{d as r,p as i}from"../doctor-CgLA7_Uv.mjs";import{preview as a}from"vite";import o from"node:path";import s from"node:fs";import{colors as c,configure as l,devServer as u,error as d,info as f,success as p,table as m,warn as h}from"@bdocs/dui";import g from"node:fs/promises";import{createServer as _}from"@bdocs/ssg/node";import v from"cac";function y(e){let t=e;for(;t&&t!==o.dirname(t);){if(s.existsSync(o.join(t,`.git`))||s.existsSync(o.join(t,`pnpm-workspace.yaml`)))return t;t=o.dirname(t)}t=e;let n=e;for(;t&&t!==o.dirname(t);)s.existsSync(o.join(t,`package.json`))&&(n=t),t=o.dirname(t);return n}let b=y(process.cwd());function x(e){if(!e)return;let t;if(typeof e==`string`)t=e;else if(e instanceof URL){if(e.protocol!==`file:`)return;t=e.pathname}else if(Buffer.isBuffer(e))t=e.toString();else return;let n=o.resolve(b,t),r=o.relative(b,n),i=r.startsWith(`..`)||o.isAbsolute(r),a=n.split(o.sep),s=a.some(e=>e.startsWith(`.env`)),c=a.some((e,t)=>{if(e===`node_modules`){let e=a[t+1];return!e||!e.startsWith(`.`)}return!1});if(i||s||c)throw Error(`[Boltdocs Security] Write/delete operation blocked on path: "${n}". Modifications are restricted to the project root, and cannot access .env or non-cache node_modules folders.`)}function S(e){return e==null?!1:typeof e==`number`?e!==0:typeof e==`string`?e.includes(`w`)||e.includes(`a`)||e.includes(`+`):!0}function C(){let e=s.writeFile;s.writeFile=function(t,...n){try{x(t)}catch(e){let t=n[n.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return e.call(s,t,...n)};let t=s.writeFileSync;s.writeFileSync=function(e,...n){return x(e),t.call(s,e,...n)};let n=s.rm;s.rm=function(e,...t){try{x(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return n.call(s,e,...t)};let r=s.rmSync;s.rmSync=function(e,...t){return x(e),r.call(s,e,...t)};let i=s.unlink;s.unlink=function(e,...t){try{x(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return i.call(s,e,...t)};let a=s.unlinkSync;s.unlinkSync=function(e,...t){return x(e),a.call(s,e,...t)};let o=s.mkdir;s.mkdir=function(e,...t){try{x(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return o.call(s,e,...t)};let c=s.mkdirSync;s.mkdirSync=function(e,...t){return x(e),c.call(s,e,...t)};let l=s.rmdir;s.rmdir=function(e,...t){try{x(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return l.call(s,e,...t)};let u=s.rmdirSync;s.rmdirSync=function(e,...t){return x(e),u.call(s,e,...t)};let d=s.appendFile;s.appendFile=function(e,...t){try{x(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return d.call(s,e,...t)};let f=s.appendFileSync;s.appendFileSync=function(e,...t){return x(e),f.call(s,e,...t)};let p=s.copyFile;s.copyFile=function(e,t,...n){try{x(e),x(t)}catch(e){let t=n[n.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return p.call(s,e,t,...n)};let m=s.copyFileSync;s.copyFileSync=function(e,t,...n){return x(e),x(t),m.call(s,e,t,...n)};let h=s.rename;s.rename=function(e,t,...n){try{x(e),x(t)}catch(e){let t=n[n.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return h.call(s,e,t,...n)};let _=s.renameSync;s.renameSync=function(e,t,...n){return x(e),x(t),_.call(s,e,t,...n)};let v=s.createWriteStream;s.createWriteStream=function(e,...t){return x(e),v.call(s,e,...t)};let y=s.open;s.open=function(e,t,...n){if(S(typeof t==`function`?void 0:t))try{x(e)}catch(e){let r=n[n.length-1],i=typeof t==`function`?t:typeof r==`function`?r:void 0;if(i){process.nextTick(()=>i(e));return}throw e}return y.call(s,e,t,...n)};let b=s.openSync;s.openSync=function(e,t,...n){return S(t)&&x(e),b.call(s,e,t,...n)};let C=e=>{if(!e)return;let t=e.writeFile;t&&(e.writeFile=async function(n,...r){return x(n),t.call(e,n,...r)});let n=e.rm;n&&(e.rm=async function(t,...r){return x(t),n.call(e,t,...r)});let r=e.mkdir;r&&(e.mkdir=async function(t,...n){return x(t),r.call(e,t,...n)});let i=e.rmdir;i&&(e.rmdir=async function(t,...n){return x(t),i.call(e,t,...n)});let a=e.unlink;a&&(e.unlink=async function(t,...n){return x(t),a.call(e,t,...n)});let o=e.appendFile;o&&(e.appendFile=async function(t,...n){return x(t),o.call(e,t,...n)});let s=e.copyFile;s&&(e.copyFile=async function(t,n,...r){return x(t),x(n),s.call(e,t,n,...r)});let c=e.rename;c&&(e.rename=async function(t,n,...r){return x(t),x(n),c.call(e,t,n,...r)});let l=e.open;l&&(e.open=async function(t,n,...r){return S(n)&&x(t),l.call(e,t,n,...r)})};C(s.promises),C(g)}let w=!1;async function T(e=process.cwd()){if(!w){w=!0,r();try{n(await i(o.resolve(e,`docs`),e),e)}catch{}try{let n=await t(e,`development`);n.logLevel=`warn`,n.clearScreen=!1;let r=await _(n);await r.listen();let i=r.resolvedUrls;console.log(u(i?.local?.[0]??`http://localhost:5173`,i?.network?.[0]??null)),r.bindCLIShortcuts({print:!1})}catch(e){d(`Failed to start dev server:`,e),process.exit(1)}}}async function E(t=process.cwd()){r();try{let n=await e().run({root:t,timing:{}});n.success||(d(`Build failed at step "${n.failedStep}":`,n.error),process.exit(1)),p(`SSG build completed successfully in ${Math.round(n.timing.total)}ms!`),process.exit(0)}catch(e){d(`Build failed:`,e),process.exit(1)}}async function D(e=process.cwd()){try{let t=await createViteConfig(e,`production`);t.logLevel=`warn`,t.clearScreen=!1;let n=await a(t),r=n.resolvedUrls;console.log(n(r?.local?.[0]??`http://localhost:4173`,r?.network?.[0]??null))}catch(e){d(`Failed to start preview server:`,e),process.exit(1)}}function O(e){let t=[];if(!s.existsSync(e))return t;try{let n=s.readdirSync(e);for(let r of n){let n=o.join(e,r);s.statSync(n).isDirectory()?r!==`node_modules`&&r!==`.git`&&r!==`dist`&&r!==`coverage`&&t.push(...O(n)):/\.(js|mjs|cjs|ts|tsx|jsx)$/.test(r)&&t.push(n)}}catch{}return t}async function k(e=process.cwd()){f(`Starting static security audit of Boltdocs plugins...`);let t;try{t=await i(o.resolve(e,`docs`),e)}catch(e){d(`Failed to load Boltdocs configuration for audit:`,e),process.exit(1)}let n=t.plugins||[];if(n.length===0){p(`No plugins configured. Nothing to audit.`);return}let r=[];for(let t of n){if(!t.name)continue;let n=null;try{let{createRequire:r}=await import(`node:module`),i=r(o.resolve(e,`package.json`)).resolve(`${t.name}/package.json`);n=o.dirname(i)}catch{let r=o.resolve(e,`node_modules`,t.name);s.existsSync(r)&&(n=r)}if(!n){r.push({name:c.cyan(t.name),status:c.red(`❓ Unresolved`),details:`Could not locate plugin files in node_modules.`});continue}let i=O(n),a=[];for(let e of i)try{let t=s.readFileSync(e,`utf-8`);t.includes(`fetch(`)&&a.push(`fetch`),t.includes(`axios`)&&a.push(`axios`),t.includes(`http.request`)&&a.push(`http.request`),t.includes(`https.request`)&&a.push(`https.request`),t.includes(`process.env`)&&a.push(`process.env`)}catch{}let l=Array.from(new Set(a));l.length>0?r.push({name:c.cyan(t.name),status:c.yellow(`⚠️ Warning`),details:`Contains network/env accesses: ${c.bold(l.join(`, `))}. Ensure you trust the author.`}):r.push({name:c.cyan(t.name),status:c.green(`✅ Clean`),details:`No external network calls or env accesses detected.`})}let a=[`Plugin`,`Status`,`Audit Notes`],l=r.map(e=>[e.name,e.status,e.details]);console.log(`
|
|
8
|
+
`+m(a,l)+`
|
|
9
|
+
`),r.some(e=>e.status.includes(`Warning`))?h(`⚠️ One or more plugins have security warnings. Review the flags above.`):p(`✓ All plugins passed the static security check!`)}process.noDeprecation=!0,C(),l({prefix:`boltdocs`,devServerTitle:`boltdocs dev server`,previewServerTitle:`boltdocs preview server`,updateCommand:`pnpm add boltdocs@latest`});const A=v(`boltdocs`);A.command(`dev [root]`,`Start development server`).action(T),A.command(`[root]`,`Start development server`).action(T),A.command(`build [root]`,`Build for production`).action(E),A.command(`preview [root]`,`Preview production build`).action(D),A.command(`audit [root]`,`Audit configured plugins for security warnings`).action(k),A.command(`doctor [root]`,`Check the health of your documentation`).option(`--fix`,`Automatically fix broken internal links and sync translations`).option(`--check-external`,`Verify external links (slower)`).option(`--init`,`Initialize doctor.json with default configuration`).option(`--budget`,`Check build performance against configured budgets`).action(async(e,t)=>{let{doctorAction:n}=await import(`../doctor-aN_leTbh.mjs`);await n(e,t)}),A.command(`generate-changelog <file>`,`Generate changelog documentation from CHANGELOG.md`).option(`-o, --output <path>`,`Output folder (default: docs/changelog)`,{default:`docs/changelog`}).option(`-t, --title <text>`,`Title for changelog pages`,{default:`Changelog`}).option(`--infer-tab`,`Infer tab from folder name (default: true)`,{default:!0}).option(`-l, --limit <number>`,`Limit number of versions to generate`).action(async(e,t)=>{let{generateChangelog:n}=await import(`../generator-BHCrLU6h.mjs`);await n(e,{output:t.output,title:t.title,inferTab:t.inferTab,limit:t.limit?parseInt(String(t.limit),10):void 0})}),A.help(),A.version(`2.0.0`),A.parse();export{};
|
package/dist/node/index.cjs
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../utils-
|
|
6
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../chunk-CU-zTemE.cjs`);const e=require(`../utils-Cjmx1hhk.cjs`),t=require(`../doctor-BArviV8X.cjs`),n=require(`../node-BmlP0eBP.cjs`);let r=require(`unist-util-visit`);exports.BoltdocsPluginStore=n.w,exports.EXIT=r.EXIT,exports.MDX_NODES=n.y,exports.PluginCompatibilityError=n.T,exports.PluginError=n.E,exports.PluginHookError=n.D,exports.PluginLifecycleManager=n.b,exports.PluginValidationError=n.O,exports.SKIP=r.SKIP,exports.addNodeClass=n.a,exports.createMdxAttribute=n.o,exports.createMdxElement=n.s,exports.createPlugin=n.i,exports.createRehypeElement=n.c,exports.createViteConfig=n.n,exports.default=n.t,exports.defineConfig=t.m,exports.generateEntryCode=n.r,exports.getNodeProperty=n.l,exports.hasNodeClass=n.u,exports.normalizePath=e.u,exports.parseMetaString=n.v,exports.removeNodeClass=n.d,exports.resolveConfig=t.p,exports.sanitizeFilename=e.f,exports.setNodeProperty=n.f,exports.validatePlugins=n.C,exports.visitMdxElements=n.p,exports.visitNodes=n.m,exports.visitRehypeElements=n.h,exports.visitRemarkHeadings=n.g,exports.visitRemarkLinks=n._;
|