boltdocs 3.3.5 → 3.4.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/dist/{adapters-BKzKe2mO.mjs → adapters-BXiBWAKs.mjs} +1 -1
- package/dist/{adapters-DwDTQoCG.cjs → adapters-Czl3WtQt.cjs} +1 -1
- package/dist/{build-B672n0hL.cjs → build-CNkXRdk8.cjs} +1 -1
- package/dist/{build-BVoMHMhw.mjs → build-CqUBsXVC.mjs} +1 -1
- package/dist/client/index.cjs +245 -56
- package/dist/client/index.d.cts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +246 -60
- package/dist/client/mdx.cjs +1 -1
- package/dist/client/mdx.js +1 -1
- package/dist/client/primitives.cjs +5 -5
- package/dist/client/primitives.d.cts +92 -42
- package/dist/client/primitives.d.ts +101 -51
- package/dist/client/primitives.js +4 -4
- package/dist/client/router.cjs +1 -1
- package/dist/client/router.d.cts +1 -1
- package/dist/client/router.d.ts +1 -1
- package/dist/client/router.js +1 -1
- package/dist/client/theme/reset.css +41 -0
- package/dist/config-B3SEoVjG.cjs +7 -0
- package/dist/{config-PLvresCv.cjs → config-Bfakeadu.cjs} +1 -1
- package/dist/config-CTcfF-0c.mjs +7 -0
- package/dist/dev-D1DmOSjn.mjs +6 -0
- package/dist/dev-DH6cSge8.cjs +6 -0
- package/dist/{docs-layout-CbZ7LDRe.js → docs-layout-CmntYM6p.js} +46 -147
- package/dist/{docs-layout-vzfXed1Q.cjs → docs-layout-DIgxJ5c7.cjs} +23 -130
- package/dist/{doctor-DMECtdK6.cjs → doctor-BLxm2alc.cjs} +1 -1
- package/dist/{doctor-FuFY1jBz.cjs → doctor-Dd-JMTRo.cjs} +1 -1
- package/dist/{doctor-i8Qmd8DJ.mjs → doctor-DogHujrP.mjs} +1 -1
- package/dist/{image-Hnaa2bJd.cjs → image-Bke2ojW1.cjs} +3 -3
- package/dist/{image-B-NDSDuY.js → image-CaY2w0ua.js} +2 -1
- package/dist/index--xbYbT8N.d.ts +343 -0
- package/dist/{index-Bg-JtZeK.d.cts → index-B_o5y34l.d.cts} +112 -13
- package/dist/{index-B3o307nd.d.ts → index-Bx0CUd7Q.d.ts} +112 -13
- package/dist/index-RK7W_Fxy.d.cts +343 -0
- package/dist/{link-CgdI6O2o.js → link-CSe_oD8Y.js} +137 -139
- package/dist/{link-vZjmD-es.cjs → link-Xb69Oy2F.cjs} +144 -169
- package/dist/{mdx-D0Absdq5.cjs → mdx-BCOrMd-P.cjs} +68 -16
- package/dist/{mdx-BRT71V5Q.js → mdx-BijiEbkp.js} +62 -15
- package/dist/{native-nLA4Jr0T.cjs → native-BbtRkce5.cjs} +1 -1
- package/dist/node/cli-entry.cjs +1 -1
- package/dist/node/cli-entry.mjs +1 -1
- package/dist/node/highlight.d.cts +2 -2
- package/dist/node/highlight.d.mts +2 -2
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +19 -37
- package/dist/node/index.d.mts +20 -38
- package/dist/node/index.mjs +1 -1
- package/dist/node/mdx/shiki-adapter.cjs +1 -1
- package/dist/node/mdx/shiki-adapter.d.cts +7 -2
- package/dist/node/mdx/shiki-adapter.d.mts +7 -2
- package/dist/node/mdx/shiki-adapter.mjs +1 -1
- package/dist/node-BgiLCa0I.cjs +39 -0
- package/dist/node-Da3tYBHo.mjs +39 -0
- package/dist/{package-CNqjEYE1.cjs → package-D1gVs5gQ.cjs} +1 -1
- package/dist/{package-sdcKhDhe.mjs → package-YgQJn3Yh.mjs} +1 -1
- package/dist/pages-external-B_r6gvqP.cjs +6 -0
- package/dist/pages-external-jmK7AHaO.mjs +6 -0
- package/dist/{parser-CD8Oo8qh.mjs → parser-CvNZc5s3.mjs} +1 -1
- package/dist/{parser-vPaKvzLp.cjs → parser-DJLWTiO-.cjs} +1 -1
- package/dist/plugin-DW9K2fW5.mjs +69 -0
- package/dist/plugin-NwGKyTJX.cjs +69 -0
- package/dist/{plugin-context-DuSg-Hax.mjs → plugin-context-COh-cbsW.mjs} +1 -1
- package/dist/{plugin-context-CscLcXjH.cjs → plugin-context-FIHaWn6r.cjs} +2 -2
- package/dist/{plugin-lifecycle-BywrEoWK.cjs → plugin-lifecycle-D9fTRaWY.cjs} +1 -1
- package/dist/{registry-BbB6NqSv.d.cts → registry-BFmzj1yg.d.mts} +1 -1
- package/dist/{registry-sJqDv0kE.d.mts → registry-BoswPzYV.d.cts} +1 -1
- package/dist/{resolve-C5rT6B21.mjs → resolve-5puUe7eS.mjs} +1 -1
- package/dist/{resolve-BelytNYR.cjs → resolve-CF4ZLfqx.cjs} +1 -1
- package/dist/route-paths-B6ocUfNY.cjs +6 -0
- package/dist/route-paths-DyDji4bX.mjs +6 -0
- package/dist/{router-CZBxMRAH.js → router-B5e8k4qK.js} +175 -10
- package/dist/{router-C3kygdRK.cjs → router-DKC0Lu0n.cjs} +204 -9
- package/dist/{routes-C3_w9fLX.cjs → routes-D55M8UrH.cjs} +1 -1
- package/dist/routes-DdE6Lfcl.cjs +6 -0
- package/dist/routes-_I_8PQYF.mjs +6 -0
- package/dist/{search-dialog-x_qHU8ty.cjs → search-dialog-BOQRHKTb.cjs} +197 -24
- package/dist/{search-dialog-BqkzDTq2.js → search-dialog-BXil4_7P.js} +190 -29
- package/dist/search-dialog-CwlBd-Mu.cjs +747 -0
- package/dist/{search-dialog-B9mdxsUC.js → search-dialog-D3Obh3eA.js} +1 -1
- package/dist/search-dialog-DeplpVEB.js +717 -0
- package/dist/{search-dialog-DCtm2dyR.cjs → search-dialog-cHXR5zhL.cjs} +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.mts +1 -1
- package/dist/server/index.mjs +1 -1
- package/dist/ssg-static-options-Br1_u9qp.mjs +6 -0
- package/dist/ssg-static-options-CVvGKM8i.cjs +6 -0
- package/dist/types-58Ac3UGI.d.cts +114 -0
- package/dist/types-BwnGf-1E.d.mts +114 -0
- package/dist/virtual-modules-C4-qxFlL.cjs +40 -0
- package/dist/virtual-modules-DiWUKJGP.mjs +40 -0
- package/package.json +8 -5
- package/src/shared/types.ts +133 -987
- package/dist/config-CrsQJHQz.cjs +0 -7
- package/dist/config-DC0nMMk7.mjs +0 -7
- package/dist/dev-B49V6O6p.mjs +0 -6
- package/dist/dev-DbuhNcF5.cjs +0 -6
- package/dist/index-CgWkOCCn.d.cts +0 -1193
- package/dist/index-CuNSD3E2.d.ts +0 -1193
- package/dist/node-BljvHMpS.cjs +0 -23
- package/dist/node-CWxGw4H4.mjs +0 -23
- package/dist/pages-external-BBw8ObVK.mjs +0 -6
- package/dist/pages-external-DPiPFxxP.cjs +0 -6
- package/dist/plugin-BPcm1cU0.mjs +0 -69
- package/dist/plugin-WUhxnpko.cjs +0 -69
- package/dist/routes-C0kb4ue6.cjs +0 -6
- package/dist/routes-C4wrLWwu.mjs +0 -6
- package/dist/search-dialog-Bp_ouN1c.cjs +0 -550
- package/dist/search-dialog-an2BNMj6.js +0 -526
- package/dist/types-Db6zToZH.d.mts +0 -975
- package/dist/types-o7iZ2BAR.d.cts +0 -975
- package/dist/virtual-modules-B2X4Ht2r.mjs +0 -39
- package/dist/virtual-modules-DPsdHKcu.cjs +0 -39
- /package/dist/{audit-CMc_ydRr.mjs → audit-CYAkXXvP.mjs} +0 -0
- /package/dist/{audit-CHkGiV3c.cjs → audit-DxCZZTuX.cjs} +0 -0
- /package/dist/{csp-BiGAG8aF.cjs → csp-B-gc2Iha.cjs} +0 -0
- /package/dist/{csp-D0BOH8ae.mjs → csp-f8DOcI_7.mjs} +0 -0
- /package/dist/{generator-BCrZL53x.cjs → generator-CBAPKY6r.cjs} +0 -0
- /package/dist/{generator-CFukoGa0.mjs → generator-MRpn-yp6.mjs} +0 -0
- /package/dist/{handler-Lex5DbvG.mjs → handler-DBZqoWt2.mjs} +0 -0
- /package/dist/{handler-Ch-Q9NAB.cjs → handler-ryZR9Q41.cjs} +0 -0
- /package/dist/{index-HAwIo4nZ.d.mts → index-CPr34I2C.d.mts} +0 -0
- /package/dist/{native-BYKMke79.mjs → native-DZ6WMwjG.mjs} +0 -0
- /package/dist/{native-BOet8hpE.cjs → native-DeKxny_T.cjs} +0 -0
- /package/dist/{update-check-BXD1atVv.mjs → update-check-BXx8te9F.mjs} +0 -0
- /package/dist/{update-check-DFQZyoSU.cjs → update-check-CiIeC7CX.cjs} +0 -0
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { A as Lightbulb, O as Info, d as AlertCircle, f as AlertTriangle, i as cn, m as Check, t as Link, y as Copy } from "./link-CSe_oD8Y.js";
|
|
7
|
+
import { V as useConfig } from "./router-B5e8k4qK.js";
|
|
8
|
+
import { _ as useTheme, a as CodeBlockContent, c as CodeBlockHeader, h as Heading$1, i as CodeBlockActions, l as CodeBlockPre, n as Tooltip, o as CodeBlockExpand, r as CodeBlock$1, s as CodeBlockGroup, t as Image$1, u as Callout$1 } from "./image-CaY2w0ua.js";
|
|
8
9
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
9
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
11
|
import { Button } from "react-aria-components";
|
|
@@ -280,6 +281,18 @@ function useCopyButton() {
|
|
|
280
281
|
//#endregion
|
|
281
282
|
//#region src/client/components/mdx/use-expandable.ts
|
|
282
283
|
/**
|
|
284
|
+
* Counts the rendered lines of a pre-rendered Shiki block.
|
|
285
|
+
*
|
|
286
|
+
* `data-highlighted-html` holds the same markup the server writes, so the count
|
|
287
|
+
* is available before the DOM exists. Returns 0 when there is no HTML, which
|
|
288
|
+
* leaves the caller on the DOM-measured path.
|
|
289
|
+
*/
|
|
290
|
+
function countHighlightedLines(highlightedHtml) {
|
|
291
|
+
if (!highlightedHtml) return 0;
|
|
292
|
+
const spans = highlightedHtml.split("<span class=\"line\"").length - 1;
|
|
293
|
+
return spans > 0 ? spans : highlightedHtml.split("\n").length;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
283
296
|
* Expand / collapse behavior for long code blocks. Measures the rendered code
|
|
284
297
|
* through `preRef` and exposes whether the block is expandable, whether it
|
|
285
298
|
* should be visually truncated, and a toggle handler.
|
|
@@ -287,7 +300,7 @@ function useCopyButton() {
|
|
|
287
300
|
function useExpandable(options = {}) {
|
|
288
301
|
const { children, highlightedHtml, maxLines = 6 } = options;
|
|
289
302
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
290
|
-
const [isExpandable, setIsExpandable] = useState(
|
|
303
|
+
const [isExpandable, setIsExpandable] = useState(countHighlightedLines(highlightedHtml) > maxLines);
|
|
291
304
|
const preRef = useRef(null);
|
|
292
305
|
const shouldTruncate = isExpandable && !isExpanded;
|
|
293
306
|
const toggle = () => setIsExpanded((prev) => !prev);
|
|
@@ -576,6 +589,46 @@ function Cards({ children, className, cols = 2, ...props }) {
|
|
|
576
589
|
});
|
|
577
590
|
}
|
|
578
591
|
|
|
592
|
+
//#endregion
|
|
593
|
+
//#region src/client/utils/date.ts
|
|
594
|
+
/**
|
|
595
|
+
* Deterministic date formatting for server-rendered output.
|
|
596
|
+
*
|
|
597
|
+
* `toLocaleDateString` with no locale resolves against the *runtime* default,
|
|
598
|
+
* which is not the same in Node and in a browser: the server rendered
|
|
599
|
+
* "26 de septiembre de 2026" from an `es` system locale while the client
|
|
600
|
+
* produced "September 26, 2026". That is a text mismatch during hydration and
|
|
601
|
+
* React throws away the server HTML and re-renders the whole page.
|
|
602
|
+
*
|
|
603
|
+
* The time zone has to be pinned for the same reason. A frontmatter date such
|
|
604
|
+
* as `2026-09-27` parses as UTC midnight, so any zone behind UTC renders the
|
|
605
|
+
* previous day and any zone ahead renders the correct one, which is a second,
|
|
606
|
+
* environment-dependent mismatch.
|
|
607
|
+
*
|
|
608
|
+
* Both are therefore explicit here. Callers that genuinely want a different
|
|
609
|
+
* locale can pass one, and it is still deterministic because it is fixed in
|
|
610
|
+
* the markup rather than inferred.
|
|
611
|
+
*/
|
|
612
|
+
const DEFAULT_LOCALE = "en-US";
|
|
613
|
+
const DEFAULT_TIME_ZONE = "UTC";
|
|
614
|
+
/**
|
|
615
|
+
* Formats a date as a stable, locale- and zone-pinned string.
|
|
616
|
+
*
|
|
617
|
+
* Returns an empty string for values that are not real dates so callers can
|
|
618
|
+
* render nothing rather than "Invalid Date".
|
|
619
|
+
*/
|
|
620
|
+
function formatDeterministicDate(date, options = {}) {
|
|
621
|
+
if (date === void 0 || date === null || date === "") return "";
|
|
622
|
+
const parsed = date instanceof Date ? date : new Date(date);
|
|
623
|
+
if (Number.isNaN(parsed.getTime())) return "";
|
|
624
|
+
return parsed.toLocaleDateString(options.locale ?? DEFAULT_LOCALE, {
|
|
625
|
+
year: "numeric",
|
|
626
|
+
month: options.month ?? "long",
|
|
627
|
+
day: options.day ?? "numeric",
|
|
628
|
+
timeZone: options.timeZone ?? DEFAULT_TIME_ZONE
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
|
|
579
632
|
//#endregion
|
|
580
633
|
//#region src/client/components/mdx/last-updated.tsx
|
|
581
634
|
/**
|
|
@@ -586,11 +639,7 @@ function LastUpdated({ date, className }) {
|
|
|
586
639
|
if (!date) return null;
|
|
587
640
|
const d = new Date(date);
|
|
588
641
|
if (Number.isNaN(d.getTime())) return null;
|
|
589
|
-
const formattedDate = d
|
|
590
|
-
year: "numeric",
|
|
591
|
-
month: "long",
|
|
592
|
-
day: "numeric"
|
|
593
|
-
});
|
|
642
|
+
const formattedDate = formatDeterministicDate(d);
|
|
594
643
|
return /* @__PURE__ */ jsxs("div", {
|
|
595
644
|
className: cn("mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none", className),
|
|
596
645
|
children: [/* @__PURE__ */ jsx("span", {}), /* @__PURE__ */ jsxs("span", {
|
|
@@ -702,13 +751,11 @@ function normalizeBadge(badge) {
|
|
|
702
751
|
}
|
|
703
752
|
function formatDate(date, locale) {
|
|
704
753
|
if (date === void 0 || date === null || date === "") return null;
|
|
705
|
-
const
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
year: "numeric",
|
|
709
|
-
month: "short",
|
|
710
|
-
day: "numeric"
|
|
754
|
+
const formatted = formatDeterministicDate(date, {
|
|
755
|
+
locale,
|
|
756
|
+
month: "short"
|
|
711
757
|
});
|
|
758
|
+
return formatted === "" ? null : formatted;
|
|
712
759
|
}
|
|
713
760
|
const VARIANT_DEFAULT_ICON = {
|
|
714
761
|
success: Check,
|
|
@@ -793,4 +840,4 @@ const mdx_components_default = {
|
|
|
793
840
|
};
|
|
794
841
|
|
|
795
842
|
//#endregion
|
|
796
|
-
export {
|
|
843
|
+
export { useExpandable as a, useCodeBlockFeedback as i, Timeline as n, useCopyButton as o, formatDeterministicDate as r, copyToClipboard as s, mdx_components_default as t };
|
package/dist/node/cli-entry.cjs
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* Copyright (c) 2026 Jesus Alcala
|
|
5
5
|
* Licensed under the MIT License.
|
|
6
6
|
*/
|
|
7
|
-
const e=require(`../chunk-D1Md3oWO.cjs`);let t=require(`node:path`);t=e.r(t);let n=require(`node:fs`);n=e.r(n);let r=require(`node:fs/promises`);r=e.r(r);let i=require(`node:module`),a=require(`cac`);a=e.r(a);function o(e){let r=e;for(;r&&r!==t.default.dirname(r);){if(n.default.existsSync(t.default.join(r,`.git`))||n.default.existsSync(t.default.join(r,`pnpm-workspace.yaml`)))return r;r=t.default.dirname(r)}r=e;let i=e;for(;r&&r!==t.default.dirname(r);)n.default.existsSync(t.default.join(r,`package.json`))&&(i=r),r=t.default.dirname(r);return i}let s=o(process.cwd());function c(e){if(!e)return;let n;if(typeof e==`string`)n=e;else if(e instanceof URL){if(e.protocol!==`file:`)return;n=e.pathname}else if(Buffer.isBuffer(e))n=e.toString();else return;let r=t.default.resolve(s,n),i=t.default.relative(s,r),a=i.startsWith(`..`)||t.default.isAbsolute(i),o=r.split(t.default.sep),c=o.some(e=>e.startsWith(`.env`)),l=o.some((e,t)=>{if(e===`node_modules`){let e=o[t+1];return!e||!e.startsWith(`.`)}return!1});if(a||c||l)throw Error(`[Boltdocs Security] Write/delete operation blocked on path: "${r}". Modifications are restricted to the project root, and cannot access .env or non-cache node_modules folders.`)}function l(e){return e==null?!1:typeof e==`number`?e!==0:typeof e==`string`?e.includes(`w`)||e.includes(`a`)||e.includes(`+`):!0}function u(){let e=n.default.writeFile;n.default.writeFile=((t,...r)=>{try{c(t)}catch(e){let t=r[r.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return e.call(n.default,t,...r)});let t=n.default.writeFileSync;n.default.writeFileSync=(e,...r)=>(c(e),t.call(n.default,e,...r));let i=n.default.rm;n.default.rm=((e,...t)=>{try{c(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return i.call(n.default,e,...t)});let a=n.default.rmSync;n.default.rmSync=(e,...t)=>(c(e),a.call(n.default,e,...t));let o=n.default.unlink;n.default.unlink=((e,...t)=>{try{c(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return o.call(n.default,e,...t)});let s=n.default.unlinkSync;n.default.unlinkSync=(e,...t)=>(c(e),s.call(n.default,e,...t));let u=n.default.mkdir;n.default.mkdir=((e,...t)=>{try{c(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return u.call(n.default,e,...t)});let d=n.default.mkdirSync;n.default.mkdirSync=(e,...t)=>(c(e),d.call(n.default,e,...t));let f=n.default.rmdir;n.default.rmdir=((e,...t)=>{try{c(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return f.call(n.default,e,...t)});let p=n.default.rmdirSync;n.default.rmdirSync=(e,...t)=>(c(e),p.call(n.default,e,...t));let m=n.default.appendFile;n.default.appendFile=((e,...t)=>{try{c(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return m.call(n.default,e,...t)});let h=n.default.appendFileSync;n.default.appendFileSync=(e,...t)=>(c(e),h.call(n.default,e,...t));let g=n.default.copyFile;n.default.copyFile=((e,t,...r)=>{try{c(e),c(t)}catch(e){let t=r[r.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return g.call(n.default,e,t,...r)});let _=n.default.copyFileSync;n.default.copyFileSync=(e,t,...r)=>(c(e),c(t),_.call(n.default,e,t,...r));let v=n.default.rename;n.default.rename=((e,t,...r)=>{try{c(e),c(t)}catch(e){let t=r[r.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return v.call(n.default,e,t,...r)});let y=n.default.renameSync;n.default.renameSync=(e,t,...r)=>(c(e),c(t),y.call(n.default,e,t,...r));let b=n.default.createWriteStream;n.default.createWriteStream=(e,...t)=>(c(e),b.call(n.default,e,...t));let x=n.default.open;n.default.open=((e,t,...r)=>{if(l(typeof t==`function`?void 0:t))try{c(e)}catch(e){let n=r[r.length-1],i=typeof t==`function`?t:typeof n==`function`?n:void 0;if(i){process.nextTick(()=>i(e));return}throw e}return x.call(n.default,e,t,...r)});let S=n.default.openSync;n.default.openSync=(e,t,...r)=>(l(t)&&c(e),S.call(n.default,e,t,...r));let C=e=>{if(!e)return;let t=e.writeFile;t&&(e.writeFile=async(n,...r)=>(c(n),t.call(e,n,...r)));let n=e.rm;n&&(e.rm=async(t,...r)=>(c(t),n.call(e,t,...r)));let r=e.mkdir;r&&(e.mkdir=async(t,...n)=>(c(t),r.call(e,t,...n)));let i=e.rmdir;i&&(e.rmdir=async(t,...n)=>(c(t),i.call(e,t,...n)));let a=e.unlink;a&&(e.unlink=async(t,...n)=>(c(t),a.call(e,t,...n)));let o=e.appendFile;o&&(e.appendFile=async(t,...n)=>(c(t),o.call(e,t,...n)));let s=e.copyFile;s&&(e.copyFile=async(t,n,...r)=>(c(t),c(n),s.call(e,t,n,...r)));let u=e.rename;u&&(e.rename=async(t,n,...r)=>(c(t),c(n),u.call(e,t,n,...r)));let d=e.open;d&&(e.open=async(t,n,...r)=>(l(n)&&c(t),d.call(e,t,n,...r)))};C(n.default.promises),C(r.default)}const{emitWarning:d}=process;process.emitWarning=(e,...t)=>{let n=e?.code;if(!(e&&typeof e==`object`&&n===`DEP0205`)&&!(typeof e==`string`&&t.includes(`DEP0205`)))return Reflect.apply(d,process,[e,...t])},u();try{Promise.resolve().then(()=>import(`node:module`)).then(
|
|
7
|
+
const e=require(`../chunk-D1Md3oWO.cjs`);let t=require(`node:path`);t=e.r(t);let n=require(`node:fs`);n=e.r(n);let r=require(`node:fs/promises`);r=e.r(r);let i=require(`node:module`),a=require(`cac`);a=e.r(a);function o(e){let r=e;for(;r&&r!==t.default.dirname(r);){if(n.default.existsSync(t.default.join(r,`.git`))||n.default.existsSync(t.default.join(r,`pnpm-workspace.yaml`)))return r;r=t.default.dirname(r)}r=e;let i=e;for(;r&&r!==t.default.dirname(r);)n.default.existsSync(t.default.join(r,`package.json`))&&(i=r),r=t.default.dirname(r);return i}let s=o(process.cwd());function c(e){if(!e)return;let n;if(typeof e==`string`)n=e;else if(e instanceof URL){if(e.protocol!==`file:`)return;n=e.pathname}else if(Buffer.isBuffer(e))n=e.toString();else return;let r=t.default.resolve(s,n),i=t.default.relative(s,r),a=i.startsWith(`..`)||t.default.isAbsolute(i),o=r.split(t.default.sep),c=o.some(e=>e.startsWith(`.env`)),l=o.some((e,t)=>{if(e===`node_modules`){let e=o[t+1];return!e||!e.startsWith(`.`)}return!1});if(a||c||l)throw Error(`[Boltdocs Security] Write/delete operation blocked on path: "${r}". Modifications are restricted to the project root, and cannot access .env or non-cache node_modules folders.`)}function l(e){return e==null?!1:typeof e==`number`?e!==0:typeof e==`string`?e.includes(`w`)||e.includes(`a`)||e.includes(`+`):!0}function u(){let e=n.default.writeFile;n.default.writeFile=((t,...r)=>{try{c(t)}catch(e){let t=r[r.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return e.call(n.default,t,...r)});let t=n.default.writeFileSync;n.default.writeFileSync=(e,...r)=>(c(e),t.call(n.default,e,...r));let i=n.default.rm;n.default.rm=((e,...t)=>{try{c(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return i.call(n.default,e,...t)});let a=n.default.rmSync;n.default.rmSync=(e,...t)=>(c(e),a.call(n.default,e,...t));let o=n.default.unlink;n.default.unlink=((e,...t)=>{try{c(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return o.call(n.default,e,...t)});let s=n.default.unlinkSync;n.default.unlinkSync=(e,...t)=>(c(e),s.call(n.default,e,...t));let u=n.default.mkdir;n.default.mkdir=((e,...t)=>{try{c(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return u.call(n.default,e,...t)});let d=n.default.mkdirSync;n.default.mkdirSync=(e,...t)=>(c(e),d.call(n.default,e,...t));let f=n.default.rmdir;n.default.rmdir=((e,...t)=>{try{c(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return f.call(n.default,e,...t)});let p=n.default.rmdirSync;n.default.rmdirSync=(e,...t)=>(c(e),p.call(n.default,e,...t));let m=n.default.appendFile;n.default.appendFile=((e,...t)=>{try{c(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return m.call(n.default,e,...t)});let h=n.default.appendFileSync;n.default.appendFileSync=(e,...t)=>(c(e),h.call(n.default,e,...t));let g=n.default.copyFile;n.default.copyFile=((e,t,...r)=>{try{c(e),c(t)}catch(e){let t=r[r.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return g.call(n.default,e,t,...r)});let _=n.default.copyFileSync;n.default.copyFileSync=(e,t,...r)=>(c(e),c(t),_.call(n.default,e,t,...r));let v=n.default.rename;n.default.rename=((e,t,...r)=>{try{c(e),c(t)}catch(e){let t=r[r.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return v.call(n.default,e,t,...r)});let y=n.default.renameSync;n.default.renameSync=(e,t,...r)=>(c(e),c(t),y.call(n.default,e,t,...r));let b=n.default.createWriteStream;n.default.createWriteStream=(e,...t)=>(c(e),b.call(n.default,e,...t));let x=n.default.open;n.default.open=((e,t,...r)=>{if(l(typeof t==`function`?void 0:t))try{c(e)}catch(e){let n=r[r.length-1],i=typeof t==`function`?t:typeof n==`function`?n:void 0;if(i){process.nextTick(()=>i(e));return}throw e}return x.call(n.default,e,t,...r)});let S=n.default.openSync;n.default.openSync=(e,t,...r)=>(l(t)&&c(e),S.call(n.default,e,t,...r));let C=e=>{if(!e)return;let t=e.writeFile;t&&(e.writeFile=async(n,...r)=>(c(n),t.call(e,n,...r)));let n=e.rm;n&&(e.rm=async(t,...r)=>(c(t),n.call(e,t,...r)));let r=e.mkdir;r&&(e.mkdir=async(t,...n)=>(c(t),r.call(e,t,...n)));let i=e.rmdir;i&&(e.rmdir=async(t,...n)=>(c(t),i.call(e,t,...n)));let a=e.unlink;a&&(e.unlink=async(t,...n)=>(c(t),a.call(e,t,...n)));let o=e.appendFile;o&&(e.appendFile=async(t,...n)=>(c(t),o.call(e,t,...n)));let s=e.copyFile;s&&(e.copyFile=async(t,n,...r)=>(c(t),c(n),s.call(e,t,n,...r)));let u=e.rename;u&&(e.rename=async(t,n,...r)=>(c(t),c(n),u.call(e,t,n,...r)));let d=e.open;d&&(e.open=async(t,n,...r)=>(l(n)&&c(t),d.call(e,t,n,...r)))};C(n.default.promises),C(r.default)}const{emitWarning:d}=process;process.emitWarning=(e,...t)=>{let n=e?.code;if(!(e&&typeof e==`object`&&n===`DEP0205`)&&!(typeof e==`string`&&t.includes(`DEP0205`)))return Reflect.apply(d,process,[e,...t])},u();try{Promise.resolve().then(()=>import(`node:module`)).then(e=>{let t=e.enableCompileCache;typeof t==`function`&&t()}).catch(()=>{})}catch{}const f=[`theme`,`dev`].join(`:`);let p=!1;async function m(){if(p)return;let{configure:e}=await import(`@bdocs/dui`);e({prefix:`boltdocs`}),p=!0}const h=(0,a.default)(`boltdocs`);h.command(`dev [root]`,`Start development server`).option(`--port <port>`,`Port to listen on`).option(`--host [host]`,`Host to bind to`).option(`--force`,`Force Vite to re-optimize dependencies`).action(async(...e)=>{await m();let{devAction:t}=await Promise.resolve().then(()=>require(`../dev-DH6cSge8.cjs`));return t(...e)}),h.command(`[root]`,`Start development server`).option(`--port <port>`,`Port to listen on`).option(`--host [host]`,`Host to bind to`).option(`--force`,`Force Vite to re-optimize dependencies`).action(async(e=process.cwd(),t)=>{if(e===f)throw Error(`Unknown command: ${f}`);await m();let{devAction:n}=await Promise.resolve().then(()=>require(`../dev-DH6cSge8.cjs`));return n(e,t)}),h.command(`build [root]`,`Build for production`).action(async(...e)=>{await m();let{buildAction:t}=await Promise.resolve().then(()=>require(`../build-CNkXRdk8.cjs`));return t(...e)}),h.command(`preview [root]`,`Preview production build`).option(`--port <port>`,`Port to listen on`).option(`--host [host]`,`Host to bind to`).action(async(...e)=>{await m();let{previewAction:t}=await Promise.resolve().then(()=>require(`../build-CNkXRdk8.cjs`));return t(...e)}),h.command(`audit [root]`,`Audit configured plugins for security warnings`).action(async(...e)=>{let{auditAction:t}=await Promise.resolve().then(()=>require(`../audit-DxCZZTuX.cjs`));return t(...e)}),h.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)=>{await m();let{doctorAction:n}=await Promise.resolve().then(()=>require(`../doctor-Dd-JMTRo.cjs`));await n(e,t)}),h.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`).option(`--type <"major"|"minor"|"patch">`,`Filter by version type (major, minor, or patch)`).action(async(e,t)=>{await m();let{generateChangelog:n}=await Promise.resolve().then(()=>require(`../generator-CBAPKY6r.cjs`));await n(e,{output:t.output,title:t.title,inferTab:t.inferTab,limit:t.limit?parseInt(String(t.limit),10):void 0,type:t.type})});const g=(0,i.createRequire)(require(`url`).pathToFileURL(__filename).href)(`../../package.json`);h.version(g.version),h.parse();
|
package/dist/node/cli-entry.mjs
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* Copyright (c) 2026 Jesus Alcala
|
|
5
5
|
* Licensed under the MIT License.
|
|
6
6
|
*/
|
|
7
|
-
import{createRequire as e}from"node:module";import t from"node:path";import n from"node:fs";import r from"node:fs/promises";import i from"cac";function a(e){let r=e;for(;r&&r!==t.dirname(r);){if(n.existsSync(t.join(r,`.git`))||n.existsSync(t.join(r,`pnpm-workspace.yaml`)))return r;r=t.dirname(r)}r=e;let i=e;for(;r&&r!==t.dirname(r);)n.existsSync(t.join(r,`package.json`))&&(i=r),r=t.dirname(r);return i}let o=a(process.cwd());function s(e){if(!e)return;let n;if(typeof e==`string`)n=e;else if(e instanceof URL){if(e.protocol!==`file:`)return;n=e.pathname}else if(Buffer.isBuffer(e))n=e.toString();else return;let r=t.resolve(o,n),i=t.relative(o,r),a=i.startsWith(`..`)||t.isAbsolute(i),s=r.split(t.sep),c=s.some(e=>e.startsWith(`.env`)),l=s.some((e,t)=>{if(e===`node_modules`){let e=s[t+1];return!e||!e.startsWith(`.`)}return!1});if(a||c||l)throw Error(`[Boltdocs Security] Write/delete operation blocked on path: "${r}". Modifications are restricted to the project root, and cannot access .env or non-cache node_modules folders.`)}function c(e){return e==null?!1:typeof e==`number`?e!==0:typeof e==`string`?e.includes(`w`)||e.includes(`a`)||e.includes(`+`):!0}function l(){let e=n.writeFile;n.writeFile=((t,...r)=>{try{s(t)}catch(e){let t=r[r.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return e.call(n,t,...r)});let t=n.writeFileSync;n.writeFileSync=(e,...r)=>(s(e),t.call(n,e,...r));let i=n.rm;n.rm=((e,...t)=>{try{s(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return i.call(n,e,...t)});let a=n.rmSync;n.rmSync=(e,...t)=>(s(e),a.call(n,e,...t));let o=n.unlink;n.unlink=((e,...t)=>{try{s(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return o.call(n,e,...t)});let l=n.unlinkSync;n.unlinkSync=(e,...t)=>(s(e),l.call(n,e,...t));let u=n.mkdir;n.mkdir=((e,...t)=>{try{s(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return u.call(n,e,...t)});let d=n.mkdirSync;n.mkdirSync=(e,...t)=>(s(e),d.call(n,e,...t));let f=n.rmdir;n.rmdir=((e,...t)=>{try{s(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return f.call(n,e,...t)});let p=n.rmdirSync;n.rmdirSync=(e,...t)=>(s(e),p.call(n,e,...t));let m=n.appendFile;n.appendFile=((e,...t)=>{try{s(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return m.call(n,e,...t)});let h=n.appendFileSync;n.appendFileSync=(e,...t)=>(s(e),h.call(n,e,...t));let g=n.copyFile;n.copyFile=((e,t,...r)=>{try{s(e),s(t)}catch(e){let t=r[r.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return g.call(n,e,t,...r)});let _=n.copyFileSync;n.copyFileSync=(e,t,...r)=>(s(e),s(t),_.call(n,e,t,...r));let v=n.rename;n.rename=((e,t,...r)=>{try{s(e),s(t)}catch(e){let t=r[r.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return v.call(n,e,t,...r)});let y=n.renameSync;n.renameSync=(e,t,...r)=>(s(e),s(t),y.call(n,e,t,...r));let b=n.createWriteStream;n.createWriteStream=(e,...t)=>(s(e),b.call(n,e,...t));let x=n.open;n.open=((e,t,...r)=>{if(c(typeof t==`function`?void 0:t))try{s(e)}catch(e){let n=r[r.length-1],i=typeof t==`function`?t:typeof n==`function`?n:void 0;if(i){process.nextTick(()=>i(e));return}throw e}return x.call(n,e,t,...r)});let S=n.openSync;n.openSync=(e,t,...r)=>(c(t)&&s(e),S.call(n,e,t,...r));let C=e=>{if(!e)return;let t=e.writeFile;t&&(e.writeFile=async(n,...r)=>(s(n),t.call(e,n,...r)));let n=e.rm;n&&(e.rm=async(t,...r)=>(s(t),n.call(e,t,...r)));let r=e.mkdir;r&&(e.mkdir=async(t,...n)=>(s(t),r.call(e,t,...n)));let i=e.rmdir;i&&(e.rmdir=async(t,...n)=>(s(t),i.call(e,t,...n)));let a=e.unlink;a&&(e.unlink=async(t,...n)=>(s(t),a.call(e,t,...n)));let o=e.appendFile;o&&(e.appendFile=async(t,...n)=>(s(t),o.call(e,t,...n)));let l=e.copyFile;l&&(e.copyFile=async(t,n,...r)=>(s(t),s(n),l.call(e,t,n,...r)));let u=e.rename;u&&(e.rename=async(t,n,...r)=>(s(t),s(n),u.call(e,t,n,...r)));let d=e.open;d&&(e.open=async(t,n,...r)=>(c(n)&&s(t),d.call(e,t,n,...r)))};C(n.promises),C(r)}const{emitWarning:u}=process;process.emitWarning=(e,...t)=>{let n=e?.code;if(!(e&&typeof e==`object`&&n===`DEP0205`)&&!(typeof e==`string`&&t.includes(`DEP0205`)))return Reflect.apply(u,process,[e,...t])},l();try{Promise.resolve().then(()=>import(`node:module`)).then(
|
|
7
|
+
import{createRequire as e}from"node:module";import t from"node:path";import n from"node:fs";import r from"node:fs/promises";import i from"cac";function a(e){let r=e;for(;r&&r!==t.dirname(r);){if(n.existsSync(t.join(r,`.git`))||n.existsSync(t.join(r,`pnpm-workspace.yaml`)))return r;r=t.dirname(r)}r=e;let i=e;for(;r&&r!==t.dirname(r);)n.existsSync(t.join(r,`package.json`))&&(i=r),r=t.dirname(r);return i}let o=a(process.cwd());function s(e){if(!e)return;let n;if(typeof e==`string`)n=e;else if(e instanceof URL){if(e.protocol!==`file:`)return;n=e.pathname}else if(Buffer.isBuffer(e))n=e.toString();else return;let r=t.resolve(o,n),i=t.relative(o,r),a=i.startsWith(`..`)||t.isAbsolute(i),s=r.split(t.sep),c=s.some(e=>e.startsWith(`.env`)),l=s.some((e,t)=>{if(e===`node_modules`){let e=s[t+1];return!e||!e.startsWith(`.`)}return!1});if(a||c||l)throw Error(`[Boltdocs Security] Write/delete operation blocked on path: "${r}". Modifications are restricted to the project root, and cannot access .env or non-cache node_modules folders.`)}function c(e){return e==null?!1:typeof e==`number`?e!==0:typeof e==`string`?e.includes(`w`)||e.includes(`a`)||e.includes(`+`):!0}function l(){let e=n.writeFile;n.writeFile=((t,...r)=>{try{s(t)}catch(e){let t=r[r.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return e.call(n,t,...r)});let t=n.writeFileSync;n.writeFileSync=(e,...r)=>(s(e),t.call(n,e,...r));let i=n.rm;n.rm=((e,...t)=>{try{s(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return i.call(n,e,...t)});let a=n.rmSync;n.rmSync=(e,...t)=>(s(e),a.call(n,e,...t));let o=n.unlink;n.unlink=((e,...t)=>{try{s(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return o.call(n,e,...t)});let l=n.unlinkSync;n.unlinkSync=(e,...t)=>(s(e),l.call(n,e,...t));let u=n.mkdir;n.mkdir=((e,...t)=>{try{s(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return u.call(n,e,...t)});let d=n.mkdirSync;n.mkdirSync=(e,...t)=>(s(e),d.call(n,e,...t));let f=n.rmdir;n.rmdir=((e,...t)=>{try{s(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return f.call(n,e,...t)});let p=n.rmdirSync;n.rmdirSync=(e,...t)=>(s(e),p.call(n,e,...t));let m=n.appendFile;n.appendFile=((e,...t)=>{try{s(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return m.call(n,e,...t)});let h=n.appendFileSync;n.appendFileSync=(e,...t)=>(s(e),h.call(n,e,...t));let g=n.copyFile;n.copyFile=((e,t,...r)=>{try{s(e),s(t)}catch(e){let t=r[r.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return g.call(n,e,t,...r)});let _=n.copyFileSync;n.copyFileSync=(e,t,...r)=>(s(e),s(t),_.call(n,e,t,...r));let v=n.rename;n.rename=((e,t,...r)=>{try{s(e),s(t)}catch(e){let t=r[r.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return v.call(n,e,t,...r)});let y=n.renameSync;n.renameSync=(e,t,...r)=>(s(e),s(t),y.call(n,e,t,...r));let b=n.createWriteStream;n.createWriteStream=(e,...t)=>(s(e),b.call(n,e,...t));let x=n.open;n.open=((e,t,...r)=>{if(c(typeof t==`function`?void 0:t))try{s(e)}catch(e){let n=r[r.length-1],i=typeof t==`function`?t:typeof n==`function`?n:void 0;if(i){process.nextTick(()=>i(e));return}throw e}return x.call(n,e,t,...r)});let S=n.openSync;n.openSync=(e,t,...r)=>(c(t)&&s(e),S.call(n,e,t,...r));let C=e=>{if(!e)return;let t=e.writeFile;t&&(e.writeFile=async(n,...r)=>(s(n),t.call(e,n,...r)));let n=e.rm;n&&(e.rm=async(t,...r)=>(s(t),n.call(e,t,...r)));let r=e.mkdir;r&&(e.mkdir=async(t,...n)=>(s(t),r.call(e,t,...n)));let i=e.rmdir;i&&(e.rmdir=async(t,...n)=>(s(t),i.call(e,t,...n)));let a=e.unlink;a&&(e.unlink=async(t,...n)=>(s(t),a.call(e,t,...n)));let o=e.appendFile;o&&(e.appendFile=async(t,...n)=>(s(t),o.call(e,t,...n)));let l=e.copyFile;l&&(e.copyFile=async(t,n,...r)=>(s(t),s(n),l.call(e,t,n,...r)));let u=e.rename;u&&(e.rename=async(t,n,...r)=>(s(t),s(n),u.call(e,t,n,...r)));let d=e.open;d&&(e.open=async(t,n,...r)=>(c(n)&&s(t),d.call(e,t,n,...r)))};C(n.promises),C(r)}const{emitWarning:u}=process;process.emitWarning=(e,...t)=>{let n=e?.code;if(!(e&&typeof e==`object`&&n===`DEP0205`)&&!(typeof e==`string`&&t.includes(`DEP0205`)))return Reflect.apply(u,process,[e,...t])},l();try{Promise.resolve().then(()=>import(`node:module`)).then(e=>{let t=e.enableCompileCache;typeof t==`function`&&t()}).catch(()=>{})}catch{}const d=[`theme`,`dev`].join(`:`);let f=!1;async function p(){if(f)return;let{configure:e}=await import(`@bdocs/dui`);e({prefix:`boltdocs`}),f=!0}const m=i(`boltdocs`);m.command(`dev [root]`,`Start development server`).option(`--port <port>`,`Port to listen on`).option(`--host [host]`,`Host to bind to`).option(`--force`,`Force Vite to re-optimize dependencies`).action(async(...e)=>{await p();let{devAction:t}=await import(`../dev-D1DmOSjn.mjs`);return t(...e)}),m.command(`[root]`,`Start development server`).option(`--port <port>`,`Port to listen on`).option(`--host [host]`,`Host to bind to`).option(`--force`,`Force Vite to re-optimize dependencies`).action(async(e=process.cwd(),t)=>{if(e===d)throw Error(`Unknown command: ${d}`);await p();let{devAction:n}=await import(`../dev-D1DmOSjn.mjs`);return n(e,t)}),m.command(`build [root]`,`Build for production`).action(async(...e)=>{await p();let{buildAction:t}=await import(`../build-CqUBsXVC.mjs`);return t(...e)}),m.command(`preview [root]`,`Preview production build`).option(`--port <port>`,`Port to listen on`).option(`--host [host]`,`Host to bind to`).action(async(...e)=>{await p();let{previewAction:t}=await import(`../build-CqUBsXVC.mjs`);return t(...e)}),m.command(`audit [root]`,`Audit configured plugins for security warnings`).action(async(...e)=>{let{auditAction:t}=await import(`../audit-CYAkXXvP.mjs`);return t(...e)}),m.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)=>{await p();let{doctorAction:n}=await import(`../doctor-DogHujrP.mjs`).then(e=>e.t);await n(e,t)}),m.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`).option(`--type <"major"|"minor"|"patch">`,`Filter by version type (major, minor, or patch)`).action(async(e,t)=>{await p();let{generateChangelog:n}=await import(`../generator-MRpn-yp6.mjs`);await n(e,{output:t.output,title:t.title,inferTab:t.inferTab,limit:t.limit?parseInt(String(t.limit),10):void 0,type:t.type})});const h=e(import.meta.url)(`../../package.json`);m.version(h.version),m.parse();export{};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { a as getHighlighterNames, c as prewarmHighlighter, i as getCodeHighlighterAdapter, l as registerHighlighter, n as DEFAULT_HIGHLIGHTER, o as isHighlighterRegistered, r as HighlighterFactory, s as prewarmCodeHighlighting, t as BUILTIN_HIGHLIGHTERS } from "../registry-
|
|
2
|
+
import { c as CodeHighlighterEngine, l as CodeHighlighterRuntime, o as CodeHighlightConfig, s as CodeHighlighterAdapter, u as CodeTheme } from "../types-58Ac3UGI.cjs";
|
|
3
|
+
import { a as getHighlighterNames, c as prewarmHighlighter, i as getCodeHighlighterAdapter, l as registerHighlighter, n as DEFAULT_HIGHLIGHTER, o as isHighlighterRegistered, r as HighlighterFactory, s as prewarmCodeHighlighting, t as BUILTIN_HIGHLIGHTERS } from "../registry-BoswPzYV.cjs";
|
|
4
4
|
import { normalizeCodeHighlightConfig } from "@bdocs/unist-utils";
|
|
5
5
|
export { BUILTIN_HIGHLIGHTERS, type CodeHighlightConfig, type CodeHighlighterAdapter, type CodeHighlighterEngine, type CodeHighlighterRuntime, type CodeTheme, DEFAULT_HIGHLIGHTER, type HighlighterFactory, getCodeHighlighterAdapter, getHighlighterNames, isHighlighterRegistered, normalizeCodeHighlightConfig, prewarmCodeHighlighting, prewarmHighlighter, registerHighlighter };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { a as getHighlighterNames, c as prewarmHighlighter, i as getCodeHighlighterAdapter, l as registerHighlighter, n as DEFAULT_HIGHLIGHTER, o as isHighlighterRegistered, r as HighlighterFactory, s as prewarmCodeHighlighting, t as BUILTIN_HIGHLIGHTERS } from "../registry-
|
|
2
|
+
import { c as CodeHighlighterEngine, l as CodeHighlighterRuntime, o as CodeHighlightConfig, s as CodeHighlighterAdapter, u as CodeTheme } from "../types-BwnGf-1E.mjs";
|
|
3
|
+
import { a as getHighlighterNames, c as prewarmHighlighter, i as getCodeHighlighterAdapter, l as registerHighlighter, n as DEFAULT_HIGHLIGHTER, o as isHighlighterRegistered, r as HighlighterFactory, s as prewarmCodeHighlighting, t as BUILTIN_HIGHLIGHTERS } from "../registry-BFmzj1yg.mjs";
|
|
4
4
|
import { normalizeCodeHighlightConfig } from "@bdocs/unist-utils";
|
|
5
5
|
export { BUILTIN_HIGHLIGHTERS, type CodeHighlightConfig, type CodeHighlighterAdapter, type CodeHighlighterEngine, type CodeHighlighterRuntime, type CodeTheme, DEFAULT_HIGHLIGHTER, type HighlighterFactory, getCodeHighlighterAdapter, getHighlighterNames, isHighlighterRegistered, normalizeCodeHighlightConfig, prewarmCodeHighlighting, prewarmHighlighter, registerHighlighter };
|
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`}}),require(`../chunk-D1Md3oWO.cjs`);const e=require(`../node-
|
|
6
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../chunk-D1Md3oWO.cjs`);const e=require(`../node-BgiLCa0I.cjs`),t=require(`../utils-ej6_SjIZ.cjs`),n=require(`../plugin-context-FIHaWn6r.cjs`),r=require(`./cache.cjs`),i=require(`../routes-DdE6Lfcl.cjs`),a=require(`../config-B3SEoVjG.cjs`),o=require(`../registry-DLJIooEu.cjs`),s=require(`../handler-ryZR9Q41.cjs`),c=require(`../adapters-Czl3WtQt.cjs`);let l=require(`@bdocs/unist-utils`);exports.BUILTIN_HIGHLIGHTERS=o.t,exports.BoltdocsPluginStore=e.p,exports.DEFAULT_HIGHLIGHTER=o.n,exports.PluginCompatibilityError=e.m,exports.PluginError=e.h,exports.PluginHookError=e.g,exports.PluginLifecycleManager=e.c,exports.PluginValidationError=e._,exports.createArticleStructuredData=e.v,exports.createBreadcrumbStructuredData=e.y,exports.createPlugin=e.o,exports.createStructuredData=e.b,exports.createViteConfig=e.n,exports.createWebSiteStructuredData=e.x,exports.default=e.t,exports.defineConfig=a.r,exports.definePlugin=e.s,exports.defineStructuredData=e.S,exports.flushCache=r.flushCache,exports.generateEntryCode=n.g,exports.generateRoutes=i.t,exports.getCodeHighlighterAdapter=o.r,exports.getHighlighterNames=o.i,exports.handleAwsFeedback=c.t,exports.handleFeedback=s.t,exports.handleNetlifyFeedback=c.r,exports.handleVercelFeedback=c.i,exports.handleWebFeedback=c.n,exports.invalidateRouteCache=i.i,exports.isHighlighterRegistered=o.a,Object.defineProperty(exports,`normalizeCodeHighlightConfig`,{enumerable:!0,get:function(){return l.normalizeCodeHighlightConfig}}),exports.normalizePath=t.u,exports.prewarmCodeHighlighting=o.o,exports.prewarmHighlighter=o.s,exports.registerHighlighter=o.c,exports.registerPluginHighlighter=o.l,exports.resolveConfig=a.t,exports.resolvePluginHook=e.l,exports.sanitizeFilename=t.f,exports.shouldEnableBundledDev=e.i,exports.shouldUseReactPlugin=e.a,exports.validatePlugins=e.f,Object.keys(l).forEach(function(e){e!==`default`&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return l[e]}})});
|
package/dist/node/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { FileCache, flushCache } from "./cache.cjs";
|
|
3
3
|
import { i as handleVercelFeedback, n as handleWebFeedback, r as handleNetlifyFeedback, t as handleAwsFeedback } from "../index-aWC0KjDF.cjs";
|
|
4
|
-
import { C as
|
|
5
|
-
import { a as getHighlighterNames, c as prewarmHighlighter, i as getCodeHighlighterAdapter, l as registerHighlighter, n as DEFAULT_HIGHLIGHTER, o as isHighlighterRegistered, r as HighlighterFactory, s as prewarmCodeHighlighting, t as BUILTIN_HIGHLIGHTERS, u as registerPluginHighlighter } from "../registry-
|
|
4
|
+
import { C as PluginMeta, D as RegisteredVirtualModule, E as PluginTransformMiddleware, O as RouteMeta, S as PluginLogger, T as PluginStore, _ as PluginClientConfig, a as BoltdocsViewTransitionsConfig, b as PluginHmrEvent, c as CodeHighlighterEngine, d as DiagnosticRecord, f as ExternalFileRoute, g as ParsedMetaLike, h as JsonLdValue, i as BoltdocsThemeConfig, k as StructuredData, l as CodeHighlighterRuntime, m as JsonLdObject, n as BoltdocsExperimentalConfig, o as CodeHighlightConfig, p as IPluginLifecycleManager, r as BoltdocsPlugin, s as CodeHighlighterAdapter, t as BoltdocsConfig, u as CodeTheme, v as PluginContext, w as PluginServerMiddleware, x as PluginLifecycleHooks, y as PluginCssConfig } from "../types-58Ac3UGI.cjs";
|
|
5
|
+
import { a as getHighlighterNames, c as prewarmHighlighter, i as getCodeHighlighterAdapter, l as registerHighlighter, n as DEFAULT_HIGHLIGHTER, o as isHighlighterRegistered, r as HighlighterFactory, s as prewarmCodeHighlighting, t as BUILTIN_HIGHLIGHTERS, u as registerPluginHighlighter } from "../registry-BoswPzYV.cjs";
|
|
6
6
|
import { InlineConfig, Plugin } from "vite";
|
|
7
7
|
import { normalizeCodeHighlightConfig } from "@bdocs/unist-utils";
|
|
8
8
|
export * from "@bdocs/unist-utils";
|
|
@@ -236,39 +236,6 @@ declare function createWebSiteStructuredData(options: WebSiteStructuredDataOptio
|
|
|
236
236
|
declare function createArticleStructuredData(options: ArticleStructuredDataOptions): JsonLdObject;
|
|
237
237
|
declare function createBreadcrumbStructuredData(items: BreadcrumbStructuredDataItem[]): JsonLdObject;
|
|
238
238
|
//#endregion
|
|
239
|
-
//#region src/node/plugins/plugin-types.d.ts
|
|
240
|
-
interface PluginCssConfig {
|
|
241
|
-
/** CSS files to inject automatically into entry bundle */
|
|
242
|
-
cssFiles?: string[];
|
|
243
|
-
/** Inline CSS strings to inject into HTML <head> */
|
|
244
|
-
headStyles?: string[];
|
|
245
|
-
/** PostCSS plugins to append to Vite CSS pipeline */
|
|
246
|
-
postcssPlugins?: unknown[];
|
|
247
|
-
/** Vite CSS preprocessor options (e.g. scss, less, stylus) */
|
|
248
|
-
preprocessorOptions?: Record<string, unknown>;
|
|
249
|
-
}
|
|
250
|
-
interface BoltdocsPlugin {
|
|
251
|
-
name: string;
|
|
252
|
-
enforce?: 'pre' | 'post';
|
|
253
|
-
version?: string;
|
|
254
|
-
boltdocsVersion?: string;
|
|
255
|
-
remarkPlugins?: unknown[];
|
|
256
|
-
rehypePlugins?: unknown[];
|
|
257
|
-
vitePlugins?: Plugin[];
|
|
258
|
-
components?: Record<string, string>;
|
|
259
|
-
metadata?: Record<string, unknown>;
|
|
260
|
-
css?: PluginCssConfig;
|
|
261
|
-
middleware?: PluginTransformMiddleware[];
|
|
262
|
-
hooks?: PluginLifecycleHooks;
|
|
263
|
-
/**
|
|
264
|
-
* Provide a custom syntax highlighting engine. The adapter is registered
|
|
265
|
-
* under `plugin.name` in the highlighter registry, making it selectable via
|
|
266
|
-
* `theme.codeHighlighting.engine`. The factory receives the resolved
|
|
267
|
-
* engine-agnostic config (`{ theme, options }`).
|
|
268
|
-
*/
|
|
269
|
-
codeHighlighter?: CodeHighlighterAdapter | ((api: CodeHighlightConfig) => CodeHighlighterAdapter | Promise<CodeHighlighterAdapter>);
|
|
270
|
-
}
|
|
271
|
-
//#endregion
|
|
272
239
|
//#region src/node/plugins/plugin-errors.d.ts
|
|
273
240
|
declare class PluginError extends Error {
|
|
274
241
|
readonly pluginName: string;
|
|
@@ -418,7 +385,7 @@ declare function normalizePath(p: string): string;
|
|
|
418
385
|
*/
|
|
419
386
|
declare function sanitizeFilename(name: string): string;
|
|
420
387
|
declare namespace index_d_exports {
|
|
421
|
-
export { ArticleStructuredDataOptions, BUILTIN_HIGHLIGHTERS, BoltdocsConfig, BoltdocsExperimentalConfig, BoltdocsPlugin, BoltdocsPluginOptions, BoltdocsPluginStore, BoltdocsThemeConfig, BoltdocsViewTransitionsConfig, BreadcrumbStructuredDataItem, CodeHighlightConfig, CodeHighlighterAdapter, CodeHighlighterEngine, CodeHighlighterRuntime, CodeTheme, CreateViteConfigOptions, DEFAULT_HIGHLIGHTER, ExternalFileRoute, HighlighterFactory, IPluginLifecycleManager, JsonLdObject, JsonLdValue, ParsedMetaLike, PluginCompatibilityError, PluginContext, PluginCssConfig, PluginError, PluginFactory, PluginHookError, PluginLifecycleHooks, PluginLifecycleManager, PluginLogger, PluginMeta, PluginStore, PluginValidationError, RouteMeta, StructuredData, StructuredDataFactoryOptions, WebSiteStructuredDataOptions, createArticleStructuredData, createBreadcrumbStructuredData, createPlugin, createStructuredData, createViteConfig, createWebSiteStructuredData, boltdocs as default, defineConfig, definePlugin, defineStructuredData, flushCache, generateEntryCode, generateRoutes, getCodeHighlighterAdapter, getHighlighterNames, handleAwsFeedback, handleFeedback, handleNetlifyFeedback, handleVercelFeedback, handleWebFeedback, invalidateRouteCache, isHighlighterRegistered, normalizeCodeHighlightConfig, normalizePath, prewarmCodeHighlighting, prewarmHighlighter, registerHighlighter, registerPluginHighlighter, resolveConfig, resolvePluginHook, sanitizeFilename, validatePlugins };
|
|
388
|
+
export { ArticleStructuredDataOptions, BUILTIN_HIGHLIGHTERS, BoltdocsConfig, BoltdocsExperimentalConfig, BoltdocsPlugin, BoltdocsPluginOptions, BoltdocsPluginStore, BoltdocsThemeConfig, BoltdocsViewTransitionsConfig, BreadcrumbStructuredDataItem, CodeHighlightConfig, CodeHighlighterAdapter, CodeHighlighterEngine, CodeHighlighterRuntime, CodeTheme, CreateViteConfigOptions, DEFAULT_HIGHLIGHTER, ExternalFileRoute, HighlighterFactory, IPluginLifecycleManager, JsonLdObject, JsonLdValue, ParsedMetaLike, PluginClientConfig, PluginCompatibilityError, PluginContext, PluginCssConfig, PluginError, PluginFactory, PluginHookError, PluginLifecycleHooks, PluginLifecycleManager, PluginLogger, PluginMeta, PluginStore, PluginValidationError, RouteMeta, StructuredData, StructuredDataFactoryOptions, WebSiteStructuredDataOptions, createArticleStructuredData, createBreadcrumbStructuredData, createPlugin, createStructuredData, createViteConfig, createWebSiteStructuredData, boltdocs as default, defineConfig, definePlugin, defineStructuredData, flushCache, generateEntryCode, generateRoutes, getCodeHighlighterAdapter, getHighlighterNames, handleAwsFeedback, handleFeedback, handleNetlifyFeedback, handleVercelFeedback, handleWebFeedback, invalidateRouteCache, isHighlighterRegistered, normalizeCodeHighlightConfig, normalizePath, prewarmCodeHighlighting, prewarmHighlighter, registerHighlighter, registerPluginHighlighter, resolveConfig, resolvePluginHook, sanitizeFilename, shouldEnableBundledDev, shouldUseReactPlugin, validatePlugins };
|
|
422
389
|
}
|
|
423
390
|
interface CreateViteConfigOptions {
|
|
424
391
|
/** Pre-computed routes. When provided, route generation is skipped. */
|
|
@@ -432,6 +399,21 @@ interface CreateViteConfigOptions {
|
|
|
432
399
|
/** Static asset directory relative to the project root (default: docs/public). */
|
|
433
400
|
publicDir?: string | false;
|
|
434
401
|
}
|
|
402
|
+
declare function shouldEnableBundledDev(isProduction: boolean, value?: string | undefined): boolean;
|
|
403
|
+
/**
|
|
404
|
+
* Whether `@vitejs/plugin-react` runs in dev.
|
|
405
|
+
*
|
|
406
|
+
* React Fast Refresh is what makes an edit to `layout.tsx`, an icon set or an
|
|
407
|
+
* external page swap in place instead of reloading the document. Without it
|
|
408
|
+
* there is no refresh runtime in the page, so every such edit falls back to a
|
|
409
|
+
* full reload and loses scroll position and loader state.
|
|
410
|
+
*
|
|
411
|
+
* It used to be skipped for any non-root base, which meant the common
|
|
412
|
+
* `base: '/docs'` documentation site had no Fast Refresh at all. The plugin
|
|
413
|
+
* handles a sub-path base correctly; only the bundled-dev opt-in remains
|
|
414
|
+
* environment-gated.
|
|
415
|
+
*/
|
|
416
|
+
declare function shouldUseReactPlugin(isProduction: boolean, value?: string | undefined): boolean;
|
|
435
417
|
declare function boltdocs(options?: BoltdocsPluginOptions): Promise<Plugin[]>;
|
|
436
418
|
/**
|
|
437
419
|
* Generates the complete Vite configuration for a Boltdocs project.
|
|
@@ -439,4 +421,4 @@ declare function boltdocs(options?: BoltdocsPluginOptions): Promise<Plugin[]>;
|
|
|
439
421
|
*/
|
|
440
422
|
declare function createViteConfig(root: string, mode?: 'development' | 'production', preResolvedConfig?: BoltdocsConfig, options?: CreateViteConfigOptions): Promise<InlineConfig>;
|
|
441
423
|
//#endregion
|
|
442
|
-
export { type ArticleStructuredDataOptions, BUILTIN_HIGHLIGHTERS, type BoltdocsConfig, type BoltdocsExperimentalConfig, type BoltdocsPlugin, type BoltdocsPluginOptions, BoltdocsPluginStore, type BoltdocsThemeConfig, type BoltdocsViewTransitionsConfig, type BreadcrumbStructuredDataItem, type CodeHighlightConfig, type CodeHighlighterAdapter, type CodeHighlighterEngine, type CodeHighlighterRuntime, type CodeTheme, CreateViteConfigOptions, DEFAULT_HIGHLIGHTER, type ExternalFileRoute, HighlighterFactory, type IPluginLifecycleManager, type JsonLdObject, type JsonLdValue, type ParsedMetaLike, PluginCompatibilityError, type PluginContext, PluginCssConfig, PluginError, PluginFactory, PluginHookError, type PluginLifecycleHooks, PluginLifecycleManager, type PluginLogger, type PluginMeta, type PluginStore, PluginValidationError, type RouteMeta, type StructuredData, type StructuredDataFactoryOptions, type WebSiteStructuredDataOptions, createArticleStructuredData, createBreadcrumbStructuredData, createPlugin, createStructuredData, createViteConfig, createWebSiteStructuredData, boltdocs as default, defineConfig, definePlugin, defineStructuredData, flushCache, generateEntryCode, generateRoutes, getCodeHighlighterAdapter, getHighlighterNames, handleAwsFeedback, handleFeedback, handleNetlifyFeedback, handleVercelFeedback, handleWebFeedback, invalidateRouteCache, isHighlighterRegistered, normalizeCodeHighlightConfig, normalizePath, prewarmCodeHighlighting, prewarmHighlighter, registerHighlighter, registerPluginHighlighter, resolveConfig, resolvePluginHook, sanitizeFilename, validatePlugins };
|
|
424
|
+
export { type ArticleStructuredDataOptions, BUILTIN_HIGHLIGHTERS, type BoltdocsConfig, type BoltdocsExperimentalConfig, type BoltdocsPlugin, type BoltdocsPluginOptions, BoltdocsPluginStore, type BoltdocsThemeConfig, type BoltdocsViewTransitionsConfig, type BreadcrumbStructuredDataItem, type CodeHighlightConfig, type CodeHighlighterAdapter, type CodeHighlighterEngine, type CodeHighlighterRuntime, type CodeTheme, CreateViteConfigOptions, DEFAULT_HIGHLIGHTER, type ExternalFileRoute, HighlighterFactory, type IPluginLifecycleManager, type JsonLdObject, type JsonLdValue, type ParsedMetaLike, type PluginClientConfig, PluginCompatibilityError, type PluginContext, type PluginCssConfig, PluginError, PluginFactory, PluginHookError, type PluginLifecycleHooks, PluginLifecycleManager, type PluginLogger, type PluginMeta, type PluginStore, PluginValidationError, type RouteMeta, type StructuredData, type StructuredDataFactoryOptions, type WebSiteStructuredDataOptions, createArticleStructuredData, createBreadcrumbStructuredData, createPlugin, createStructuredData, createViteConfig, createWebSiteStructuredData, boltdocs as default, defineConfig, definePlugin, defineStructuredData, flushCache, generateEntryCode, generateRoutes, getCodeHighlighterAdapter, getHighlighterNames, handleAwsFeedback, handleFeedback, handleNetlifyFeedback, handleVercelFeedback, handleWebFeedback, invalidateRouteCache, isHighlighterRegistered, normalizeCodeHighlightConfig, normalizePath, prewarmCodeHighlighting, prewarmHighlighter, registerHighlighter, registerPluginHighlighter, resolveConfig, resolvePluginHook, sanitizeFilename, shouldEnableBundledDev, shouldUseReactPlugin, validatePlugins };
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { FileCache, flushCache } from "./cache.mjs";
|
|
3
|
-
import { i as handleVercelFeedback, n as handleWebFeedback, r as handleNetlifyFeedback, t as handleAwsFeedback } from "../index-
|
|
4
|
-
import { C as
|
|
5
|
-
import { a as getHighlighterNames, c as prewarmHighlighter, i as getCodeHighlighterAdapter, l as registerHighlighter, n as DEFAULT_HIGHLIGHTER, o as isHighlighterRegistered, r as HighlighterFactory, s as prewarmCodeHighlighting, t as BUILTIN_HIGHLIGHTERS, u as registerPluginHighlighter } from "../registry-
|
|
3
|
+
import { i as handleVercelFeedback, n as handleWebFeedback, r as handleNetlifyFeedback, t as handleAwsFeedback } from "../index-CPr34I2C.mjs";
|
|
4
|
+
import { C as PluginMeta, D as RegisteredVirtualModule, E as PluginTransformMiddleware, O as RouteMeta, S as PluginLogger, T as PluginStore, _ as PluginClientConfig, a as BoltdocsViewTransitionsConfig, b as PluginHmrEvent, c as CodeHighlighterEngine, d as DiagnosticRecord, f as ExternalFileRoute, g as ParsedMetaLike, h as JsonLdValue, i as BoltdocsThemeConfig, k as StructuredData, l as CodeHighlighterRuntime, m as JsonLdObject, n as BoltdocsExperimentalConfig, o as CodeHighlightConfig, p as IPluginLifecycleManager, r as BoltdocsPlugin, s as CodeHighlighterAdapter, t as BoltdocsConfig, u as CodeTheme, v as PluginContext, w as PluginServerMiddleware, x as PluginLifecycleHooks, y as PluginCssConfig } from "../types-BwnGf-1E.mjs";
|
|
5
|
+
import { a as getHighlighterNames, c as prewarmHighlighter, i as getCodeHighlighterAdapter, l as registerHighlighter, n as DEFAULT_HIGHLIGHTER, o as isHighlighterRegistered, r as HighlighterFactory, s as prewarmCodeHighlighting, t as BUILTIN_HIGHLIGHTERS, u as registerPluginHighlighter } from "../registry-BFmzj1yg.mjs";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { normalizeCodeHighlightConfig } from "@bdocs/unist-utils";
|
|
8
8
|
import { InlineConfig, Plugin } from "vite";
|
|
@@ -235,39 +235,6 @@ declare function createWebSiteStructuredData(options: WebSiteStructuredDataOptio
|
|
|
235
235
|
declare function createArticleStructuredData(options: ArticleStructuredDataOptions): JsonLdObject;
|
|
236
236
|
declare function createBreadcrumbStructuredData(items: BreadcrumbStructuredDataItem[]): JsonLdObject;
|
|
237
237
|
//#endregion
|
|
238
|
-
//#region src/node/plugins/plugin-types.d.ts
|
|
239
|
-
interface PluginCssConfig {
|
|
240
|
-
/** CSS files to inject automatically into entry bundle */
|
|
241
|
-
cssFiles?: string[];
|
|
242
|
-
/** Inline CSS strings to inject into HTML <head> */
|
|
243
|
-
headStyles?: string[];
|
|
244
|
-
/** PostCSS plugins to append to Vite CSS pipeline */
|
|
245
|
-
postcssPlugins?: unknown[];
|
|
246
|
-
/** Vite CSS preprocessor options (e.g. scss, less, stylus) */
|
|
247
|
-
preprocessorOptions?: Record<string, unknown>;
|
|
248
|
-
}
|
|
249
|
-
interface BoltdocsPlugin {
|
|
250
|
-
name: string;
|
|
251
|
-
enforce?: 'pre' | 'post';
|
|
252
|
-
version?: string;
|
|
253
|
-
boltdocsVersion?: string;
|
|
254
|
-
remarkPlugins?: unknown[];
|
|
255
|
-
rehypePlugins?: unknown[];
|
|
256
|
-
vitePlugins?: Plugin[];
|
|
257
|
-
components?: Record<string, string>;
|
|
258
|
-
metadata?: Record<string, unknown>;
|
|
259
|
-
css?: PluginCssConfig;
|
|
260
|
-
middleware?: PluginTransformMiddleware[];
|
|
261
|
-
hooks?: PluginLifecycleHooks;
|
|
262
|
-
/**
|
|
263
|
-
* Provide a custom syntax highlighting engine. The adapter is registered
|
|
264
|
-
* under `plugin.name` in the highlighter registry, making it selectable via
|
|
265
|
-
* `theme.codeHighlighting.engine`. The factory receives the resolved
|
|
266
|
-
* engine-agnostic config (`{ theme, options }`).
|
|
267
|
-
*/
|
|
268
|
-
codeHighlighter?: CodeHighlighterAdapter | ((api: CodeHighlightConfig) => CodeHighlighterAdapter | Promise<CodeHighlighterAdapter>);
|
|
269
|
-
}
|
|
270
|
-
//#endregion
|
|
271
238
|
//#region src/node/plugins/plugin-errors.d.ts
|
|
272
239
|
declare class PluginError extends Error {
|
|
273
240
|
readonly pluginName: string;
|
|
@@ -417,7 +384,7 @@ declare function normalizePath(p: string): string;
|
|
|
417
384
|
*/
|
|
418
385
|
declare function sanitizeFilename(name: string): string;
|
|
419
386
|
declare namespace index_d_exports {
|
|
420
|
-
export { ArticleStructuredDataOptions, BUILTIN_HIGHLIGHTERS, BoltdocsConfig, BoltdocsExperimentalConfig, BoltdocsPlugin, BoltdocsPluginOptions, BoltdocsPluginStore, BoltdocsThemeConfig, BoltdocsViewTransitionsConfig, BreadcrumbStructuredDataItem, CodeHighlightConfig, CodeHighlighterAdapter, CodeHighlighterEngine, CodeHighlighterRuntime, CodeTheme, CreateViteConfigOptions, DEFAULT_HIGHLIGHTER, ExternalFileRoute, HighlighterFactory, IPluginLifecycleManager, JsonLdObject, JsonLdValue, ParsedMetaLike, PluginCompatibilityError, PluginContext, PluginCssConfig, PluginError, PluginFactory, PluginHookError, PluginLifecycleHooks, PluginLifecycleManager, PluginLogger, PluginMeta, PluginStore, PluginValidationError, RouteMeta, StructuredData, StructuredDataFactoryOptions, WebSiteStructuredDataOptions, createArticleStructuredData, createBreadcrumbStructuredData, createPlugin, createStructuredData, createViteConfig, createWebSiteStructuredData, boltdocs as default, defineConfig, definePlugin, defineStructuredData, flushCache, generateEntryCode, generateRoutes, getCodeHighlighterAdapter, getHighlighterNames, handleAwsFeedback, handleFeedback, handleNetlifyFeedback, handleVercelFeedback, handleWebFeedback, invalidateRouteCache, isHighlighterRegistered, normalizeCodeHighlightConfig, normalizePath, prewarmCodeHighlighting, prewarmHighlighter, registerHighlighter, registerPluginHighlighter, resolveConfig, resolvePluginHook, sanitizeFilename, validatePlugins };
|
|
387
|
+
export { ArticleStructuredDataOptions, BUILTIN_HIGHLIGHTERS, BoltdocsConfig, BoltdocsExperimentalConfig, BoltdocsPlugin, BoltdocsPluginOptions, BoltdocsPluginStore, BoltdocsThemeConfig, BoltdocsViewTransitionsConfig, BreadcrumbStructuredDataItem, CodeHighlightConfig, CodeHighlighterAdapter, CodeHighlighterEngine, CodeHighlighterRuntime, CodeTheme, CreateViteConfigOptions, DEFAULT_HIGHLIGHTER, ExternalFileRoute, HighlighterFactory, IPluginLifecycleManager, JsonLdObject, JsonLdValue, ParsedMetaLike, PluginClientConfig, PluginCompatibilityError, PluginContext, PluginCssConfig, PluginError, PluginFactory, PluginHookError, PluginLifecycleHooks, PluginLifecycleManager, PluginLogger, PluginMeta, PluginStore, PluginValidationError, RouteMeta, StructuredData, StructuredDataFactoryOptions, WebSiteStructuredDataOptions, createArticleStructuredData, createBreadcrumbStructuredData, createPlugin, createStructuredData, createViteConfig, createWebSiteStructuredData, boltdocs as default, defineConfig, definePlugin, defineStructuredData, flushCache, generateEntryCode, generateRoutes, getCodeHighlighterAdapter, getHighlighterNames, handleAwsFeedback, handleFeedback, handleNetlifyFeedback, handleVercelFeedback, handleWebFeedback, invalidateRouteCache, isHighlighterRegistered, normalizeCodeHighlightConfig, normalizePath, prewarmCodeHighlighting, prewarmHighlighter, registerHighlighter, registerPluginHighlighter, resolveConfig, resolvePluginHook, sanitizeFilename, shouldEnableBundledDev, shouldUseReactPlugin, validatePlugins };
|
|
421
388
|
}
|
|
422
389
|
interface CreateViteConfigOptions {
|
|
423
390
|
/** Pre-computed routes. When provided, route generation is skipped. */
|
|
@@ -431,6 +398,21 @@ interface CreateViteConfigOptions {
|
|
|
431
398
|
/** Static asset directory relative to the project root (default: docs/public). */
|
|
432
399
|
publicDir?: string | false;
|
|
433
400
|
}
|
|
401
|
+
declare function shouldEnableBundledDev(isProduction: boolean, value?: string | undefined): boolean;
|
|
402
|
+
/**
|
|
403
|
+
* Whether `@vitejs/plugin-react` runs in dev.
|
|
404
|
+
*
|
|
405
|
+
* React Fast Refresh is what makes an edit to `layout.tsx`, an icon set or an
|
|
406
|
+
* external page swap in place instead of reloading the document. Without it
|
|
407
|
+
* there is no refresh runtime in the page, so every such edit falls back to a
|
|
408
|
+
* full reload and loses scroll position and loader state.
|
|
409
|
+
*
|
|
410
|
+
* It used to be skipped for any non-root base, which meant the common
|
|
411
|
+
* `base: '/docs'` documentation site had no Fast Refresh at all. The plugin
|
|
412
|
+
* handles a sub-path base correctly; only the bundled-dev opt-in remains
|
|
413
|
+
* environment-gated.
|
|
414
|
+
*/
|
|
415
|
+
declare function shouldUseReactPlugin(isProduction: boolean, value?: string | undefined): boolean;
|
|
434
416
|
declare function boltdocs(options?: BoltdocsPluginOptions): Promise<Plugin[]>;
|
|
435
417
|
/**
|
|
436
418
|
* Generates the complete Vite configuration for a Boltdocs project.
|
|
@@ -438,4 +420,4 @@ declare function boltdocs(options?: BoltdocsPluginOptions): Promise<Plugin[]>;
|
|
|
438
420
|
*/
|
|
439
421
|
declare function createViteConfig(root: string, mode?: 'development' | 'production', preResolvedConfig?: BoltdocsConfig, options?: CreateViteConfigOptions): Promise<InlineConfig>;
|
|
440
422
|
//#endregion
|
|
441
|
-
export { type ArticleStructuredDataOptions, BUILTIN_HIGHLIGHTERS, type BoltdocsConfig, type BoltdocsExperimentalConfig, type BoltdocsPlugin, type BoltdocsPluginOptions, BoltdocsPluginStore, type BoltdocsThemeConfig, type BoltdocsViewTransitionsConfig, type BreadcrumbStructuredDataItem, type CodeHighlightConfig, type CodeHighlighterAdapter, type CodeHighlighterEngine, type CodeHighlighterRuntime, type CodeTheme, CreateViteConfigOptions, DEFAULT_HIGHLIGHTER, type ExternalFileRoute, HighlighterFactory, type IPluginLifecycleManager, type JsonLdObject, type JsonLdValue, type ParsedMetaLike, PluginCompatibilityError, type PluginContext, PluginCssConfig, PluginError, PluginFactory, PluginHookError, type PluginLifecycleHooks, PluginLifecycleManager, type PluginLogger, type PluginMeta, type PluginStore, PluginValidationError, type RouteMeta, type StructuredData, type StructuredDataFactoryOptions, type WebSiteStructuredDataOptions, createArticleStructuredData, createBreadcrumbStructuredData, createPlugin, createStructuredData, createViteConfig, createWebSiteStructuredData, boltdocs as default, defineConfig, definePlugin, defineStructuredData, flushCache, generateEntryCode, generateRoutes, getCodeHighlighterAdapter, getHighlighterNames, handleAwsFeedback, handleFeedback, handleNetlifyFeedback, handleVercelFeedback, handleWebFeedback, invalidateRouteCache, isHighlighterRegistered, normalizeCodeHighlightConfig, normalizePath, prewarmCodeHighlighting, prewarmHighlighter, registerHighlighter, registerPluginHighlighter, resolveConfig, resolvePluginHook, sanitizeFilename, validatePlugins };
|
|
423
|
+
export { type ArticleStructuredDataOptions, BUILTIN_HIGHLIGHTERS, type BoltdocsConfig, type BoltdocsExperimentalConfig, type BoltdocsPlugin, type BoltdocsPluginOptions, BoltdocsPluginStore, type BoltdocsThemeConfig, type BoltdocsViewTransitionsConfig, type BreadcrumbStructuredDataItem, type CodeHighlightConfig, type CodeHighlighterAdapter, type CodeHighlighterEngine, type CodeHighlighterRuntime, type CodeTheme, CreateViteConfigOptions, DEFAULT_HIGHLIGHTER, type ExternalFileRoute, HighlighterFactory, type IPluginLifecycleManager, type JsonLdObject, type JsonLdValue, type ParsedMetaLike, type PluginClientConfig, PluginCompatibilityError, type PluginContext, type PluginCssConfig, PluginError, PluginFactory, PluginHookError, type PluginLifecycleHooks, PluginLifecycleManager, type PluginLogger, type PluginMeta, type PluginStore, PluginValidationError, type RouteMeta, type StructuredData, type StructuredDataFactoryOptions, type WebSiteStructuredDataOptions, createArticleStructuredData, createBreadcrumbStructuredData, createPlugin, createStructuredData, createViteConfig, createWebSiteStructuredData, boltdocs as default, defineConfig, definePlugin, defineStructuredData, flushCache, generateEntryCode, generateRoutes, getCodeHighlighterAdapter, getHighlighterNames, handleAwsFeedback, handleFeedback, handleNetlifyFeedback, handleVercelFeedback, handleWebFeedback, invalidateRouteCache, isHighlighterRegistered, normalizeCodeHighlightConfig, normalizePath, prewarmCodeHighlighting, prewarmHighlighter, registerHighlighter, registerPluginHighlighter, resolveConfig, resolvePluginHook, sanitizeFilename, shouldEnableBundledDev, shouldUseReactPlugin, validatePlugins };
|
package/dist/node/index.mjs
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import{g as e}from"../plugin-context-
|
|
6
|
+
import{g as e}from"../plugin-context-COh-cbsW.mjs";import{C as t,S as n,_ as r,a as i,b as a,c as o,g as s,h as c,i as l,m as u,n as d,o as f,p,r as m,s as h,t as g,u as _,v,x as y,y as b}from"../node-Da3tYBHo.mjs";import{f as x,u as S}from"../utils-8lzafE49.mjs";import{flushCache as C}from"./cache.mjs";import{r as w,t as T}from"../routes-_I_8PQYF.mjs";import{i as E,n as D}from"../config-CTcfF-0c.mjs";import{a as O,c as k,i as A,l as j,n as M,o as N,r as P,s as F,t as I}from"../registry-CHh8A5as.mjs";import{t as L}from"../handler-DBZqoWt2.mjs";import{i as R,n as z,r as B,t as V}from"../adapters-BXiBWAKs.mjs";export*from"@bdocs/unist-utils";export{I as BUILTIN_HIGHLIGHTERS,u as BoltdocsPluginStore,M as DEFAULT_HIGHLIGHTER,c as PluginCompatibilityError,s as PluginError,r as PluginHookError,o as PluginLifecycleManager,v as PluginValidationError,b as createArticleStructuredData,a as createBreadcrumbStructuredData,f as createPlugin,y as createStructuredData,d as createViteConfig,n as createWebSiteStructuredData,g as default,E as defineConfig,h as definePlugin,t as defineStructuredData,C as flushCache,e as generateEntryCode,T as generateRoutes,P as getCodeHighlighterAdapter,A as getHighlighterNames,V as handleAwsFeedback,L as handleFeedback,B as handleNetlifyFeedback,R as handleVercelFeedback,z as handleWebFeedback,w as invalidateRouteCache,O as isHighlighterRegistered,m as normalizeCodeHighlightConfig,S as normalizePath,N as prewarmCodeHighlighting,F as prewarmHighlighter,k as registerHighlighter,j as registerPluginHighlighter,D as resolveConfig,_ as resolvePluginHook,x as sanitizeFilename,l as shouldEnableBundledDev,i as shouldUseReactPlugin,p as validatePlugins};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../chunk-D1Md3oWO.cjs`),t=require(`../../utils-ej6_SjIZ.cjs`);let n=require(`@bdocs/dui`),r=require(`@bdocs/unist-utils`),i=require(`@shikijs/engine-oniguruma`),a=require(`shiki/core`),o=require(`@shikijs/themes/github-light`);o=e.r(o);let s=require(`@shikijs/themes/github-dark`);s=e.r(s);let c=require(`@shikijs/langs/html`);c=e.r(c);let l=require(`@shikijs/langs/js`);l=e.r(l);let u=require(`@shikijs/langs/ts`);u=e.r(u);let d=require(`@shikijs/langs/tsx`);d=e.r(d);let f=require(`@shikijs/langs/css`);f=e.r(f);let p=require(`@shikijs/langs/bash`);p=e.r(p);let m=require(`@shikijs/langs/json`);m=e.r(m);let h=require(`@shikijs/langs/markdown`);h=e.r(h);let g=require(`@shikijs/langs/python`);g=e.r(g);let _=require(`@shikijs/langs/go`);_=e.r(_);const v=[o.default.default||o.default,s.default.default||s.default],y=[c.default,l.default,u.default,d.default,f.default,p.default,m.default,h.default,g.default,_.default],b={scss:()=>import(`@shikijs/langs/scss`),less:()=>import(`@shikijs/langs/less`),jsonc:()=>import(`@shikijs/langs/jsonc`),json5:()=>import(`@shikijs/langs/json5`),ini:()=>import(`@shikijs/langs/ini`),mdx:()=>import(`@shikijs/langs/mdx`),yaml:()=>import(`@shikijs/langs/yaml`),rust:()=>import(`@shikijs/langs/rust`),toml:()=>import(`@shikijs/langs/toml`),csv:()=>import(`@shikijs/langs/csv`),nginx:()=>import(`@shikijs/langs/nginx`),apache:()=>import(`@shikijs/langs/apache`),dockerfile:()=>import(`@shikijs/langs/dockerfile`),docker:()=>import(`@shikijs/langs/docker`),java:()=>import(`@shikijs/langs/java`),php:()=>import(`@shikijs/langs/php`),sql:()=>import(`@shikijs/langs/sql`),graphql:()=>import(`@shikijs/langs/graphql`),http:()=>import(`@shikijs/langs/http`),xml:()=>import(`@shikijs/langs/xml`),vue:()=>import(`@shikijs/langs/vue`),svelte:()=>import(`@shikijs/langs/svelte`),ruby:()=>import(`@shikijs/langs/ruby`),kotlin:()=>import(`@shikijs/langs/kotlin`),swift:()=>import(`@shikijs/langs/swift`),powershell:()=>import(`@shikijs/langs/powershell`),c:()=>import(`@shikijs/langs/c`),cpp:()=>import(`@shikijs/langs/cpp`),elixir:()=>import(`@shikijs/langs/elixir`)},x={javascript:`js`,typescript:`ts`,shell:`bash`,sh:`bash`,zsh:`bash`,console:`bash`,terminal:`bash`,shellsession:`bash`,yml:`yaml`,py:`python`,golang:`go`,rs:`rust`,rb:`ruby`,kt:`kotlin`},S=new Set([`text`,`plaintext`,`txt`,`plain`,`ansi`,`none`]);function C(e){if(!e)return null;let t=e.trim().toLowerCase();return!t||S.has(t)?null:x[t]??t}const w=new Map;async function T(){return(0,i.createOnigurumaEngine)(await import(`shiki/wasm`))}async function E(){let{createJavaScriptRegexEngine:e}=await import(`shiki/engine/javascript`);return e({forgiving:!0})}async function D(e){return e===`javascript`?E():T()}const O=async e=>{let t=e?.regexEngine===`oniguruma`?`oniguruma`:`javascript`,n=w.get(t);if(n)return n;let r=(async()=>{let e=performance.now(),n=await(0,a.createHighlighterCore)({themes:v,langs:y,engine:await D(t)});return process.env.BOLTDOCS_DEBUG===`true`&&console.log(`[boltdocs] shiki-ready in ${Math.round(performance.now()-e)}ms (${t}, ${y.length} langs)`),n})();return w.set(t,r),r},k=new Map;async function A(e,t=`oniguruma`){let n=C(e);if(!n)return!0;let r;try{r=await O({regexEngine:t})}catch{return!1}let i=[];try{i=r.getLoadedLanguages()}catch{i=[]}if(i.includes(n))return!0;let a=k.get(n);if(a)return a;let o=b[n];if(!o)return!1;let s=(async()=>{try{let e=await o(),t=e?.default??e;return await r.loadLanguage(t),!0}catch{return!1}finally{k.delete(n)}})();return k.set(n,s),s}const j={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},M={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},N={LIGHT:`github-light`,DARK:`github-dark`},P={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},F=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,M.LINE_NUMBERS)}}},I=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,M.WORD_WRAP)}}},L=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[j.TITLE]=t)}}),R=()=>({name:`AddLanguageProperty`,pre(e){e.properties[j.LANG]=this.options.lang||P.LANG}});var z=class{name=`shiki`;version=`3.23.0`;theme;regexEngine;constructor(e){let t=(0,r.normalizeCodeHighlightConfig)(e?.theme?.codeHighlighting);this.theme=t?.theme??e?.theme?.codeTheme??{light:N.LIGHT,dark:N.DARK},this.regexEngine=String(t?.options?.regexEngine)===`oniguruma`?`oniguruma`:`javascript
|
|
6
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../chunk-D1Md3oWO.cjs`),t=require(`../../utils-ej6_SjIZ.cjs`);let n=require(`@bdocs/dui`),r=require(`@bdocs/unist-utils`),i=require(`@shikijs/engine-oniguruma`),a=require(`shiki/core`),o=require(`@shikijs/themes/github-light`);o=e.r(o);let s=require(`@shikijs/themes/github-dark`);s=e.r(s);let c=require(`@shikijs/langs/html`);c=e.r(c);let l=require(`@shikijs/langs/js`);l=e.r(l);let u=require(`@shikijs/langs/ts`);u=e.r(u);let d=require(`@shikijs/langs/tsx`);d=e.r(d);let f=require(`@shikijs/langs/css`);f=e.r(f);let p=require(`@shikijs/langs/bash`);p=e.r(p);let m=require(`@shikijs/langs/json`);m=e.r(m);let h=require(`@shikijs/langs/markdown`);h=e.r(h);let g=require(`@shikijs/langs/python`);g=e.r(g);let _=require(`@shikijs/langs/go`);_=e.r(_);const v=[o.default.default||o.default,s.default.default||s.default],y=[c.default,l.default,u.default,d.default,f.default,p.default,m.default,h.default,g.default,_.default],b={scss:()=>import(`@shikijs/langs/scss`),less:()=>import(`@shikijs/langs/less`),jsonc:()=>import(`@shikijs/langs/jsonc`),json5:()=>import(`@shikijs/langs/json5`),ini:()=>import(`@shikijs/langs/ini`),mdx:()=>import(`@shikijs/langs/mdx`),yaml:()=>import(`@shikijs/langs/yaml`),rust:()=>import(`@shikijs/langs/rust`),toml:()=>import(`@shikijs/langs/toml`),csv:()=>import(`@shikijs/langs/csv`),nginx:()=>import(`@shikijs/langs/nginx`),apache:()=>import(`@shikijs/langs/apache`),dockerfile:()=>import(`@shikijs/langs/dockerfile`),docker:()=>import(`@shikijs/langs/docker`),java:()=>import(`@shikijs/langs/java`),php:()=>import(`@shikijs/langs/php`),sql:()=>import(`@shikijs/langs/sql`),graphql:()=>import(`@shikijs/langs/graphql`),http:()=>import(`@shikijs/langs/http`),xml:()=>import(`@shikijs/langs/xml`),vue:()=>import(`@shikijs/langs/vue`),svelte:()=>import(`@shikijs/langs/svelte`),ruby:()=>import(`@shikijs/langs/ruby`),kotlin:()=>import(`@shikijs/langs/kotlin`),swift:()=>import(`@shikijs/langs/swift`),powershell:()=>import(`@shikijs/langs/powershell`),c:()=>import(`@shikijs/langs/c`),cpp:()=>import(`@shikijs/langs/cpp`),elixir:()=>import(`@shikijs/langs/elixir`)},x={javascript:`js`,typescript:`ts`,shell:`bash`,sh:`bash`,zsh:`bash`,console:`bash`,terminal:`bash`,shellsession:`bash`,yml:`yaml`,py:`python`,golang:`go`,rs:`rust`,rb:`ruby`,kt:`kotlin`},S=new Set([`text`,`plaintext`,`txt`,`plain`,`ansi`,`none`]);function C(e){if(!e)return null;let t=e.trim().toLowerCase();return!t||S.has(t)?null:x[t]??t}const w=new Map;async function T(){return(0,i.createOnigurumaEngine)(await import(`shiki/wasm`))}async function E(){let{createJavaScriptRegexEngine:e}=await import(`shiki/engine/javascript`);return e({forgiving:!0})}async function D(e){return e===`javascript`?E():T()}const O=async e=>{let t=e?.regexEngine===`oniguruma`?`oniguruma`:`javascript`,n=w.get(t);if(n)return n;let r=(async()=>{let e=performance.now(),n=await(0,a.createHighlighterCore)({themes:v,langs:y,engine:await D(t)});return process.env.BOLTDOCS_DEBUG===`true`&&console.log(`[boltdocs] shiki-ready in ${Math.round(performance.now()-e)}ms (${t}, ${y.length} langs)`),n})();return w.set(t,r),r},k=new Map;async function A(e,t=`oniguruma`){let n=C(e);if(!n)return!0;let r;try{r=await O({regexEngine:t})}catch{return!1}let i=[];try{i=r.getLoadedLanguages()}catch{i=[]}if(i.includes(n))return!0;let a=k.get(n);if(a)return a;let o=b[n];if(!o)return!1;let s=(async()=>{try{let e=await o(),t=e?.default??e;return await r.loadLanguage(t),!0}catch{return!1}finally{k.delete(n)}})();return k.set(n,s),s}const j={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},M={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},N={LIGHT:`github-light`,DARK:`github-dark`},P={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},F=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,M.LINE_NUMBERS)}}},I=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,M.WORD_WRAP)}}},L=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[j.TITLE]=t)}}),R=()=>({name:`AddLanguageProperty`,pre(e){e.properties[j.LANG]=this.options.lang||P.LANG}});var z=class{name=`shiki`;version=`3.23.0`;theme;regexEngine;colorReplacements=null;constructor(e){let t=(0,r.normalizeCodeHighlightConfig)(e?.theme?.codeHighlighting);this.theme=t?.theme??e?.theme?.codeTheme??{light:N.LIGHT,dark:N.DARK},this.regexEngine=String(t?.options?.regexEngine)===`oniguruma`?`oniguruma`:`javascript`;let n=t?.options?.colorReplacements;if(n&&typeof n==`object`&&!Array.isArray(n)){let e=e=>{let t=e.trim();return/^#[0-9a-fA-F]{3,8}$/.test(t)?t.toLowerCase():t};this.colorReplacements=Object.fromEntries(Object.entries(n).map(([t,n])=>[e(t),e(String(n))]))}}getTheme(){return this.theme}async getHighlighter(){return await O({regexEngine:this.regexEngine})}async initialize(){let e=await this.getHighlighter();return{codeToHast:(t,n)=>e.codeToHast(t,n),codeToHtml:async(t,n)=>e.codeToHtml(t,n)}}async ensureLanguage(e){return A(e,this.regexEngine)}getOptions(e,t){let n={},i=``;if(typeof t==`string`)i=t,n=(0,r.parseMetaString)(t);else if(t&&typeof t==`object`){let e=t;n={...e},i=String(e.__raw??``)}let a={__raw:i};for(let[e,t]of Object.entries(n))e!==`__raw`&&Object.defineProperty(a,e,{value:t,enumerable:!1,configurable:!0,writable:!0});return{lang:e||P.LANG,meta:a,transformers:[F(),I(),L(),R()],...this.colorReplacements?{colorReplacements:this.colorReplacements}:{},...typeof this.theme==`string`?{theme:this.theme}:{themes:{light:this.theme.light,dark:this.theme.dark}}}}async render(e,r,i){try{let t=this.getOptions(r,i);return await(await this.initialize()).codeToHtml(e,t)}catch(r){return(0,n.error)(`[ShikiAdapter] Failed to render code:`,r),`<pre class="${M.FALLBACK}"><code>${t.n(e)}</code></pre>`}}prewarm(e){O({regexEngine:this.regexEngine}).catch(()=>{})}};let B=null,V;function H(e){let t=(0,r.normalizeCodeHighlightConfig)(e?.theme?.codeHighlighting),n=t?.theme??e?.theme?.codeTheme,i=JSON.stringify({theme:n,regexEngine:t?.options?.regexEngine??`oniguruma`,colorReplacements:t?.options?.colorReplacements??null});return(B===null||V!==i)&&(B=new z(e),V=i),B}function U(e){H(e).prewarm()}exports.ShikiAdapter=z,exports.ensureLanguage=A,exports.getShikiAdapter=H,Object.defineProperty(exports,`parseMetaString`,{enumerable:!0,get:function(){return r.parseMetaString}}),exports.prewarmShiki=U;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { l as CodeHighlighterRuntime, o as CodeHighlightConfig, s as CodeHighlighterAdapter, u as CodeTheme } from "../../types-58Ac3UGI.cjs";
|
|
3
3
|
import { ParsedMeta, parseMetaString } from "@bdocs/unist-utils";
|
|
4
4
|
import * as _$shiki from "shiki";
|
|
5
5
|
//#region src/node/mdx/highlighter.d.ts
|
|
@@ -38,6 +38,8 @@ declare class ShikiAdapter implements CodeHighlighterAdapter {
|
|
|
38
38
|
version: string;
|
|
39
39
|
private theme;
|
|
40
40
|
private regexEngine;
|
|
41
|
+
/** Shiki `colorReplacements`: theme token colors overridden per site. */
|
|
42
|
+
private colorReplacements;
|
|
41
43
|
constructor(config?: ShikiAdapterConfig);
|
|
42
44
|
/**
|
|
43
45
|
* Resolves the code theme from the engine-agnostic configuration.
|
|
@@ -73,7 +75,10 @@ declare class ShikiAdapter implements CodeHighlighterAdapter {
|
|
|
73
75
|
}
|
|
74
76
|
/**
|
|
75
77
|
* Returns a cached ShikiAdapter instance.
|
|
76
|
-
* Recreates only if the resolved
|
|
78
|
+
* Recreates only if the resolved highlighter configuration changes. Every
|
|
79
|
+
* field that can influence rendered output must join this identity — a
|
|
80
|
+
* missing field silently serves stale instances (colorReplacements was once
|
|
81
|
+
* dropped here, pinning old token colors for a whole build).
|
|
77
82
|
*/
|
|
78
83
|
declare function getShikiAdapter(config?: ShikiAdapterConfig): ShikiAdapter;
|
|
79
84
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { l as CodeHighlighterRuntime, o as CodeHighlightConfig, s as CodeHighlighterAdapter, u as CodeTheme } from "../../types-BwnGf-1E.mjs";
|
|
3
3
|
import { ParsedMeta, parseMetaString } from "@bdocs/unist-utils";
|
|
4
4
|
import * as _$shiki from "shiki";
|
|
5
5
|
|
|
@@ -39,6 +39,8 @@ declare class ShikiAdapter implements CodeHighlighterAdapter {
|
|
|
39
39
|
version: string;
|
|
40
40
|
private theme;
|
|
41
41
|
private regexEngine;
|
|
42
|
+
/** Shiki `colorReplacements`: theme token colors overridden per site. */
|
|
43
|
+
private colorReplacements;
|
|
42
44
|
constructor(config?: ShikiAdapterConfig);
|
|
43
45
|
/**
|
|
44
46
|
* Resolves the code theme from the engine-agnostic configuration.
|
|
@@ -74,7 +76,10 @@ declare class ShikiAdapter implements CodeHighlighterAdapter {
|
|
|
74
76
|
}
|
|
75
77
|
/**
|
|
76
78
|
* Returns a cached ShikiAdapter instance.
|
|
77
|
-
* Recreates only if the resolved
|
|
79
|
+
* Recreates only if the resolved highlighter configuration changes. Every
|
|
80
|
+
* field that can influence rendered output must join this identity — a
|
|
81
|
+
* missing field silently serves stale instances (colorReplacements was once
|
|
82
|
+
* dropped here, pinning old token colors for a whole build).
|
|
78
83
|
*/
|
|
79
84
|
declare function getShikiAdapter(config?: ShikiAdapterConfig): ShikiAdapter;
|
|
80
85
|
/**
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import{n as e}from"../../utils-8lzafE49.mjs";import{error as t}from"@bdocs/dui";import{normalizeCodeHighlightConfig as n,parseMetaString as r,parseMetaString as i}from"@bdocs/unist-utils";import{createOnigurumaEngine as a}from"@shikijs/engine-oniguruma";import{createHighlighterCore as o}from"shiki/core";import s from"@shikijs/themes/github-light";import c from"@shikijs/themes/github-dark";import l from"@shikijs/langs/html";import u from"@shikijs/langs/js";import d from"@shikijs/langs/ts";import f from"@shikijs/langs/tsx";import p from"@shikijs/langs/css";import m from"@shikijs/langs/bash";import h from"@shikijs/langs/json";import g from"@shikijs/langs/markdown";import _ from"@shikijs/langs/python";import v from"@shikijs/langs/go";const y=[s.default||s,c.default||c],b=[l,u,d,f,p,m,h,g,_,v],x={scss:()=>import(`@shikijs/langs/scss`),less:()=>import(`@shikijs/langs/less`),jsonc:()=>import(`@shikijs/langs/jsonc`),json5:()=>import(`@shikijs/langs/json5`),ini:()=>import(`@shikijs/langs/ini`),mdx:()=>import(`@shikijs/langs/mdx`),yaml:()=>import(`@shikijs/langs/yaml`),rust:()=>import(`@shikijs/langs/rust`),toml:()=>import(`@shikijs/langs/toml`),csv:()=>import(`@shikijs/langs/csv`),nginx:()=>import(`@shikijs/langs/nginx`),apache:()=>import(`@shikijs/langs/apache`),dockerfile:()=>import(`@shikijs/langs/dockerfile`),docker:()=>import(`@shikijs/langs/docker`),java:()=>import(`@shikijs/langs/java`),php:()=>import(`@shikijs/langs/php`),sql:()=>import(`@shikijs/langs/sql`),graphql:()=>import(`@shikijs/langs/graphql`),http:()=>import(`@shikijs/langs/http`),xml:()=>import(`@shikijs/langs/xml`),vue:()=>import(`@shikijs/langs/vue`),svelte:()=>import(`@shikijs/langs/svelte`),ruby:()=>import(`@shikijs/langs/ruby`),kotlin:()=>import(`@shikijs/langs/kotlin`),swift:()=>import(`@shikijs/langs/swift`),powershell:()=>import(`@shikijs/langs/powershell`),c:()=>import(`@shikijs/langs/c`),cpp:()=>import(`@shikijs/langs/cpp`),elixir:()=>import(`@shikijs/langs/elixir`)},S={javascript:`js`,typescript:`ts`,shell:`bash`,sh:`bash`,zsh:`bash`,console:`bash`,terminal:`bash`,shellsession:`bash`,yml:`yaml`,py:`python`,golang:`go`,rs:`rust`,rb:`ruby`,kt:`kotlin`},C=new Set([`text`,`plaintext`,`txt`,`plain`,`ansi`,`none`]);function w(e){if(!e)return null;let t=e.trim().toLowerCase();return!t||C.has(t)?null:S[t]??t}const T=new Map;async function E(){return a(await import(`shiki/wasm`))}async function D(){let{createJavaScriptRegexEngine:e}=await import(`shiki/engine/javascript`);return e({forgiving:!0})}async function O(e){return e===`javascript`?D():E()}const k=async e=>{let t=e?.regexEngine===`oniguruma`?`oniguruma`:`javascript`,n=T.get(t);if(n)return n;let r=(async()=>{let e=performance.now(),n=await o({themes:y,langs:b,engine:await O(t)});return process.env.BOLTDOCS_DEBUG===`true`&&console.log(`[boltdocs] shiki-ready in ${Math.round(performance.now()-e)}ms (${t}, ${b.length} langs)`),n})();return T.set(t,r),r},A=new Map;async function j(e,t=`oniguruma`){let n=w(e);if(!n)return!0;let r;try{r=await k({regexEngine:t})}catch{return!1}let i=[];try{i=r.getLoadedLanguages()}catch{i=[]}if(i.includes(n))return!0;let a=A.get(n);if(a)return a;let o=x[n];if(!o)return!1;let s=(async()=>{try{let e=await o(),t=e?.default??e;return await r.loadLanguage(t),!0}catch{return!1}finally{A.delete(n)}})();return A.set(n,s),s}const M={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},N={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},P={LIGHT:`github-light`,DARK:`github-dark`},F={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},I=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,N.LINE_NUMBERS)}}},L=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,N.WORD_WRAP)}}},R=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[M.TITLE]=t)}}),z=()=>({name:`AddLanguageProperty`,pre(e){e.properties[M.LANG]=this.options.lang||F.LANG}});var B=class{name=`shiki`;version=`3.23.0`;theme;regexEngine;constructor(e){let t=n(e?.theme?.codeHighlighting);this.theme=t?.theme??e?.theme?.codeTheme??{light:P.LIGHT,dark:P.DARK},this.regexEngine=String(t?.options?.regexEngine)===`oniguruma`?`oniguruma`:`javascript
|
|
6
|
+
import{n as e}from"../../utils-8lzafE49.mjs";import{error as t}from"@bdocs/dui";import{normalizeCodeHighlightConfig as n,parseMetaString as r,parseMetaString as i}from"@bdocs/unist-utils";import{createOnigurumaEngine as a}from"@shikijs/engine-oniguruma";import{createHighlighterCore as o}from"shiki/core";import s from"@shikijs/themes/github-light";import c from"@shikijs/themes/github-dark";import l from"@shikijs/langs/html";import u from"@shikijs/langs/js";import d from"@shikijs/langs/ts";import f from"@shikijs/langs/tsx";import p from"@shikijs/langs/css";import m from"@shikijs/langs/bash";import h from"@shikijs/langs/json";import g from"@shikijs/langs/markdown";import _ from"@shikijs/langs/python";import v from"@shikijs/langs/go";const y=[s.default||s,c.default||c],b=[l,u,d,f,p,m,h,g,_,v],x={scss:()=>import(`@shikijs/langs/scss`),less:()=>import(`@shikijs/langs/less`),jsonc:()=>import(`@shikijs/langs/jsonc`),json5:()=>import(`@shikijs/langs/json5`),ini:()=>import(`@shikijs/langs/ini`),mdx:()=>import(`@shikijs/langs/mdx`),yaml:()=>import(`@shikijs/langs/yaml`),rust:()=>import(`@shikijs/langs/rust`),toml:()=>import(`@shikijs/langs/toml`),csv:()=>import(`@shikijs/langs/csv`),nginx:()=>import(`@shikijs/langs/nginx`),apache:()=>import(`@shikijs/langs/apache`),dockerfile:()=>import(`@shikijs/langs/dockerfile`),docker:()=>import(`@shikijs/langs/docker`),java:()=>import(`@shikijs/langs/java`),php:()=>import(`@shikijs/langs/php`),sql:()=>import(`@shikijs/langs/sql`),graphql:()=>import(`@shikijs/langs/graphql`),http:()=>import(`@shikijs/langs/http`),xml:()=>import(`@shikijs/langs/xml`),vue:()=>import(`@shikijs/langs/vue`),svelte:()=>import(`@shikijs/langs/svelte`),ruby:()=>import(`@shikijs/langs/ruby`),kotlin:()=>import(`@shikijs/langs/kotlin`),swift:()=>import(`@shikijs/langs/swift`),powershell:()=>import(`@shikijs/langs/powershell`),c:()=>import(`@shikijs/langs/c`),cpp:()=>import(`@shikijs/langs/cpp`),elixir:()=>import(`@shikijs/langs/elixir`)},S={javascript:`js`,typescript:`ts`,shell:`bash`,sh:`bash`,zsh:`bash`,console:`bash`,terminal:`bash`,shellsession:`bash`,yml:`yaml`,py:`python`,golang:`go`,rs:`rust`,rb:`ruby`,kt:`kotlin`},C=new Set([`text`,`plaintext`,`txt`,`plain`,`ansi`,`none`]);function w(e){if(!e)return null;let t=e.trim().toLowerCase();return!t||C.has(t)?null:S[t]??t}const T=new Map;async function E(){return a(await import(`shiki/wasm`))}async function D(){let{createJavaScriptRegexEngine:e}=await import(`shiki/engine/javascript`);return e({forgiving:!0})}async function O(e){return e===`javascript`?D():E()}const k=async e=>{let t=e?.regexEngine===`oniguruma`?`oniguruma`:`javascript`,n=T.get(t);if(n)return n;let r=(async()=>{let e=performance.now(),n=await o({themes:y,langs:b,engine:await O(t)});return process.env.BOLTDOCS_DEBUG===`true`&&console.log(`[boltdocs] shiki-ready in ${Math.round(performance.now()-e)}ms (${t}, ${b.length} langs)`),n})();return T.set(t,r),r},A=new Map;async function j(e,t=`oniguruma`){let n=w(e);if(!n)return!0;let r;try{r=await k({regexEngine:t})}catch{return!1}let i=[];try{i=r.getLoadedLanguages()}catch{i=[]}if(i.includes(n))return!0;let a=A.get(n);if(a)return a;let o=x[n];if(!o)return!1;let s=(async()=>{try{let e=await o(),t=e?.default??e;return await r.loadLanguage(t),!0}catch{return!1}finally{A.delete(n)}})();return A.set(n,s),s}const M={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},N={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},P={LIGHT:`github-light`,DARK:`github-dark`},F={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},I=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,N.LINE_NUMBERS)}}},L=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,N.WORD_WRAP)}}},R=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[M.TITLE]=t)}}),z=()=>({name:`AddLanguageProperty`,pre(e){e.properties[M.LANG]=this.options.lang||F.LANG}});var B=class{name=`shiki`;version=`3.23.0`;theme;regexEngine;colorReplacements=null;constructor(e){let t=n(e?.theme?.codeHighlighting);this.theme=t?.theme??e?.theme?.codeTheme??{light:P.LIGHT,dark:P.DARK},this.regexEngine=String(t?.options?.regexEngine)===`oniguruma`?`oniguruma`:`javascript`;let r=t?.options?.colorReplacements;if(r&&typeof r==`object`&&!Array.isArray(r)){let e=e=>{let t=e.trim();return/^#[0-9a-fA-F]{3,8}$/.test(t)?t.toLowerCase():t};this.colorReplacements=Object.fromEntries(Object.entries(r).map(([t,n])=>[e(t),e(String(n))]))}}getTheme(){return this.theme}async getHighlighter(){return await k({regexEngine:this.regexEngine})}async initialize(){let e=await this.getHighlighter();return{codeToHast:(t,n)=>e.codeToHast(t,n),codeToHtml:async(t,n)=>e.codeToHtml(t,n)}}async ensureLanguage(e){return j(e,this.regexEngine)}getOptions(e,t){let n={},r=``;if(typeof t==`string`)r=t,n=i(t);else if(t&&typeof t==`object`){let e=t;n={...e},r=String(e.__raw??``)}let a={__raw:r};for(let[e,t]of Object.entries(n))e!==`__raw`&&Object.defineProperty(a,e,{value:t,enumerable:!1,configurable:!0,writable:!0});return{lang:e||F.LANG,meta:a,transformers:[I(),L(),R(),z()],...this.colorReplacements?{colorReplacements:this.colorReplacements}:{},...typeof this.theme==`string`?{theme:this.theme}:{themes:{light:this.theme.light,dark:this.theme.dark}}}}async render(n,r,i){try{let e=this.getOptions(r,i);return await(await this.initialize()).codeToHtml(n,e)}catch(r){return t(`[ShikiAdapter] Failed to render code:`,r),`<pre class="${N.FALLBACK}"><code>${e(n)}</code></pre>`}}prewarm(e){k({regexEngine:this.regexEngine}).catch(()=>{})}};let V=null,H;function U(e){let t=n(e?.theme?.codeHighlighting),r=t?.theme??e?.theme?.codeTheme,i=JSON.stringify({theme:r,regexEngine:t?.options?.regexEngine??`oniguruma`,colorReplacements:t?.options?.colorReplacements??null});return(V===null||H!==i)&&(V=new B(e),H=i),V}function W(e){U(e).prewarm()}export{B as ShikiAdapter,j as ensureLanguage,U as getShikiAdapter,r as parseMetaString,W as prewarmShiki};
|