boltdocs 3.2.2 → 3.3.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/bin/boltdocs.js +20 -1
- package/bin/preloader.mjs +28 -0
- package/dist/{adapters-ByYY44Zy.mjs → adapters-BmB4TKCc.mjs} +1 -1
- package/dist/{adapters-DvmtpdSF.cjs → adapters-Cp1Maurn.cjs} +1 -1
- package/dist/audit-CLXjMzwQ.mjs +11 -0
- package/dist/audit-COgjnQ5n.cjs +11 -0
- package/dist/build-BS2hefiL.cjs +6 -0
- package/dist/build-C5mNh9D-.mjs +6 -0
- package/dist/cache-CJE9nWLE.cjs +6 -0
- package/dist/cache-OY4HzIXl.mjs +6 -0
- package/dist/callout-oI_LCbxS.d.ts +71 -0
- package/dist/callout-plqx9Dw-.d.cts +71 -0
- package/dist/client/index.cjs +1265 -569
- package/dist/client/index.d.cts +3 -542
- package/dist/client/index.d.ts +3 -542
- package/dist/client/index.js +1167 -521
- package/dist/client/mdx.cjs +1 -1
- package/dist/client/mdx.d.cts +24 -2
- package/dist/client/mdx.d.ts +24 -2
- package/dist/client/mdx.js +1 -1
- package/dist/client/primitives.cjs +14 -4
- package/dist/client/primitives.d.cts +281 -38
- package/dist/client/primitives.d.ts +281 -38
- package/dist/client/primitives.js +5 -5
- package/dist/client/router.cjs +49 -0
- package/dist/client/router.d.cts +3 -0
- package/dist/client/router.d.ts +3 -0
- package/dist/client/router.js +8 -0
- package/dist/client/theme/reset.css +40 -4
- package/dist/{config-BpzaPsJj.d.cts → config-BoRlz0Ca.d.mts} +157 -14
- package/dist/{config-xtS0ZkMm.d.mts → config-CTsX_tGM.d.cts} +157 -14
- package/dist/config-Ceib-AOH.cjs +7 -0
- package/dist/config-DGLQsy7y.mjs +7 -0
- package/dist/{package-CH2ChQqw.cjs → config-files-BYHDOrKn.mjs} +1 -1
- package/dist/config-files-D9cdBMl2.cjs +6 -0
- package/dist/config-jJh8WYJI.cjs +6 -0
- package/dist/csp-C4LmN1ko.cjs +6 -0
- package/dist/csp-D6JEOqKh.mjs +6 -0
- package/dist/dev-Ch3hEe5Y.cjs +6 -0
- package/dist/dev-QPNxysrd.mjs +6 -0
- package/dist/{docs-layout-BdtZ9z6s.js → docs-layout-CbZ7LDRe.js} +504 -249
- package/dist/{docs-layout-CFWI15Id.cjs → docs-layout-vzfXed1Q.cjs} +516 -254
- package/dist/{doctor-BBtmNJE0.cjs → doctor-B1_YL0Wt.cjs} +1 -1
- package/dist/doctor-C7whl4ED.cjs +6 -0
- package/dist/doctor-DmQnml2k.mjs +6 -0
- package/dist/{generator-COepVWGi.cjs → generator-BlW45ST7.cjs} +5 -3
- package/dist/{generator-CcOBN5vI.mjs → generator-BwknNejd.mjs} +5 -3
- package/dist/{handler-XX7cLTqe.cjs → handler-CDEoKARD.cjs} +2 -2
- package/dist/{handler-DzQae4eA.mjs → handler-D7UyZlPm.mjs} +2 -2
- package/dist/{image-Bz87fCla.js → image-B-NDSDuY.js} +129 -11
- package/dist/{image-C4TlpMHn.cjs → image-Hnaa2bJd.cjs} +175 -9
- package/dist/index-C56bL-A-.d.cts +1344 -0
- package/dist/{sidebar-COTaMHR-.d.ts → index-CPUUKzxD.d.cts} +344 -327
- package/dist/{sidebar-CrEdJuHX.d.cts → index-Ci4kfOHF.d.ts} +344 -327
- package/dist/index-Cu9H6CRa.d.ts +1344 -0
- package/dist/link-CgdI6O2o.js +872 -0
- package/dist/{link-D1Gjkb-2.cjs → link-vZjmD-es.cjs} +406 -223
- package/dist/{mdx-BuO6a1f7.js → mdx-BRT71V5Q.js} +211 -168
- package/dist/{mdx-CD-tSjRG.cjs → mdx-D0Absdq5.cjs} +225 -169
- package/dist/native-BNCY7PRF.cjs +6 -0
- package/dist/native-Di9Fnfrv.mjs +6 -0
- package/dist/native-Kre2T5eS.cjs +6 -0
- package/dist/node/cache.cjs +1 -1
- package/dist/node/cache.d.cts +19 -3
- package/dist/node/cache.d.mts +19 -3
- package/dist/node/cache.mjs +1 -1
- package/dist/node/cli-entry.cjs +1 -9
- package/dist/node/cli-entry.mjs +1 -9
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +245 -17
- package/dist/node/index.d.mts +246 -18
- package/dist/node/index.mjs +1 -1
- package/dist/node/mdx/shiki-adapter.cjs +1 -1
- package/dist/node/mdx/shiki-adapter.d.cts +24 -3
- package/dist/node/mdx/shiki-adapter.d.mts +24 -2
- package/dist/node/mdx/shiki-adapter.mjs +1 -1
- package/dist/node-Du5UL5wo.mjs +23 -0
- package/dist/node-DunuGqyp.cjs +23 -0
- package/dist/{package-DSSB8B5L.mjs → package-DA848keM.mjs} +1 -1
- package/dist/package-wplzySjz.cjs +6 -0
- package/dist/pages-external-BBw8ObVK.mjs +6 -0
- package/dist/pages-external-DPiPFxxP.cjs +6 -0
- package/dist/parser-BqTOsEUa.cjs +6 -0
- package/dist/parser-CGMY2lJ7.mjs +6 -0
- package/dist/plugin-BcTzvHAJ.mjs +69 -0
- package/dist/plugin-TulVMt1z.cjs +69 -0
- package/dist/plugin-context-C-l90hFt.cjs +15 -0
- package/dist/plugin-context-wqHNSZum.mjs +15 -0
- package/dist/plugin-lifecycle-B1BzSHdn.cjs +6 -0
- package/dist/resolve-B7vWOd8R.cjs +6 -0
- package/dist/resolve-C2kKnk_5.mjs +6 -0
- package/dist/resolve-It1Iug83.cjs +6 -0
- package/dist/resolve-YdTrt_FG.mjs +6 -0
- package/dist/router-C3kygdRK.cjs +1285 -0
- package/dist/router-CZBxMRAH.js +987 -0
- package/dist/routes-BL4y79tb.mjs +6 -0
- package/dist/routes-C2nPecwu.cjs +6 -0
- package/dist/routes-U9L8psZ9.cjs +6 -0
- package/dist/{search-dialog-DHqwjJuG.cjs → search-dialog-BCOHQGSt.cjs} +1 -1
- package/dist/search-dialog-Bp_P1MPP.js +481 -0
- package/dist/{search-dialog-DFnlx8LO.js → search-dialog-BqkzDTq2.js} +107 -57
- package/dist/{search-dialog-BRFno7HD.cjs → search-dialog-CIeIUhAn.cjs} +218 -43
- package/dist/{search-dialog-D6TvjcuV.js → search-dialog-DtmxmfEu.js} +1 -1
- package/dist/{search-dialog-B1NERUNx.cjs → search-dialog-x_qHU8ty.cjs} +107 -58
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.mts +1 -1
- package/dist/server/index.mjs +1 -1
- package/dist/update-check-BKqmYfwT.cjs +11 -0
- package/dist/update-check-QnrVR3q1.mjs +11 -0
- package/dist/utils-8lzafE49.mjs +7 -0
- package/dist/utils-ej6_SjIZ.cjs +7 -0
- package/dist/virtual-modules-Ca5tHk1X.cjs +30 -0
- package/dist/virtual-modules-Dlgt1fP0.mjs +30 -0
- package/package.json +18 -16
- package/src/shared/mdx-path.ts +12 -0
- package/src/shared/structured-data.ts +145 -0
- package/src/shared/types.ts +220 -16
- package/dist/banner-BMop1KLF.d.ts +0 -100
- package/dist/banner-CVD0GugR.d.cts +0 -100
- package/dist/cache-CO4Dy2uQ.cjs +0 -6
- package/dist/cache-Dk53iOo6.mjs +0 -6
- package/dist/config-CCXp3aXO.mjs +0 -7
- package/dist/config-CMd4XoFq.cjs +0 -6
- package/dist/config-DlGoEM9D.cjs +0 -7
- package/dist/csp-CRp_3U7a.cjs +0 -6
- package/dist/csp-oTC2ygvF.mjs +0 -6
- package/dist/doctor-Bv16QSrI.cjs +0 -7
- package/dist/doctor-DOAbSaiL.mjs +0 -7
- package/dist/headers-Ddwek8K7.mjs +0 -6
- package/dist/headers-dg4SDrjY.cjs +0 -6
- package/dist/link-2PzgTnaP.js +0 -673
- package/dist/meta-loader-C4Hu9RN9.mjs +0 -6
- package/dist/meta-loader-Dq1zcFnh.cjs +0 -6
- package/dist/node-B5hu_6qj.cjs +0 -104
- package/dist/node-BXtqM1uH.mjs +0 -6
- package/dist/node-C8725aw7.mjs +0 -104
- package/dist/node-aD1eisrR.cjs +0 -6
- package/dist/pages-external-BYa4JSda.mjs +0 -6
- package/dist/pages-external-XkYIs-d5.cjs +0 -6
- package/dist/parser-DCiEWkSk.cjs +0 -8
- package/dist/parser-qk9FIHJ7.mjs +0 -8
- package/dist/plugin-CX1OZ6jB.cjs +0 -73
- package/dist/plugin-CgfiWaFZ.mjs +0 -73
- package/dist/routes-BW6zsk7Z.mjs +0 -6
- package/dist/routes-BgoIB5wb.cjs +0 -6
- package/dist/routes-CORVxc02.cjs +0 -6
- package/dist/search-dialog-BmxHiKwt.js +0 -312
- package/dist/shiki-adapter-CoQ6jyJ4.cjs +0 -6
- package/dist/shiki-adapter-D-aKw7PP.mjs +0 -6
- package/dist/utils-Crm9oPcV.mjs +0 -7
- package/dist/utils-D6Xtj0FZ.cjs +0 -7
- /package/dist/{errors-0zGHRLue.mjs → errors-N-b6Sn2G.mjs} +0 -0
- /package/dist/{index-1KsTDq4o.d.mts → index-lFoyzCXy.d.mts} +0 -0
- /package/dist/{types-generator-BXhv7Ill.cjs → types-generator-DDSA93P3.cjs} +0 -0
- /package/dist/{types-generator-bDPvUztF.mjs → types-generator-DG1GX1EZ.mjs} +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
+
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import{t as e}from"./chunk-BFSpntXv.mjs";import{_ as t,a as n,h as r,i,l as a,p as o,t as s}from"./utils-8lzafE49.mjs";import{n as c,t as l}from"./errors-N-b6Sn2G.mjs";import{t as u}from"./cache-OY4HzIXl.mjs";import d from"node:path";function f(e){return(e||``).replace(/\\/g,`/`).split(`/`).filter(Boolean)}function p(e,t){return t.length>0&&t.every((t,n)=>e[n]===t)}function m(e,t){let n=t?.versions;if(!n)return{publicSegments:[],consumed:0};let r=n.prefix||``,i=f(r);for(let t of n.versions){let n=f(t.path);if(n.length===0)continue;if(p(e,n))return{version:t.path,publicSegments:n,consumed:n.length};let a=[...i,...n];if(p(e,a))return{version:t.path,publicSegments:a,consumed:a.length};if(r&&!r.includes(`/`)&&e[0]===`${r}${t.path}`)return{version:t.path,publicSegments:[`${r}${t.path}`],consumed:1}}return{publicSegments:[],consumed:0}}function h(e,t,i,a,o){let s=d.relative(t,e).replace(/\\/g,`/`),c=s.split(`/`).filter(Boolean),l,u,f,p,h=m(c,a);if(u=h.version,c=c.slice(h.consumed),a?.i18n&&c.length>0){let e=c[0];(Array.isArray(a.i18n.locales)?a.i18n.locales.includes(e):a.i18n.locales[e])&&(l=e,c=c.slice(1))}if(c.length>0){let e=c[0].match(/^\((.+)\)$/);e&&(f=e[1].toLowerCase(),c=c.slice(1))}if(c.length>0){let e=c[0].match(/^\[(.+)\]$/);e&&(p=e[1].toLowerCase(),c=c.slice(1))}let g=[...c],_=c.map(e=>r(e)).join(`/`),v=o?o.startsWith(`/`)?o:`/${o}`:n(_||`index.md`),y=i.replace(/\\/g,`/`).replace(/\/$/,``)||`/`,b=[...h.publicSegments,l,!o&&!p?f:void 0].filter(Boolean),x=(p?[...b,p,v]:[y,...b,v]).join(`/`).replace(/\\/g,`/`).replace(/\/+/g,`/`).replace(/\/$/,``)||`/`;return{relativePath:s,finalPath:x.startsWith(`/`)?x:`/${x}`,remainingParts:g,locale:l,version:u,inferredTab:f,subRouteGroup:void 0,collection:p}}const g=[`og:`,`twitter:`,`article:`,`music:`,`video:`,`profile:`,`book:`],_=[`noindex`,`robots`,`canonical`,`keywords`,`author`];function v(e){let t={};e.seo&&typeof e.seo==`object`&&Object.assign(t,e.seo);for(let n of Object.keys(e))(_.includes(n)||g.some(e=>n.startsWith(e)))&&(t[n]=e[n]);return e.hidden===!0&&t.noindex===void 0&&(t.noindex=!0),Object.keys(t).length>0?t:void 0}function y(e){return{title:e.title?o(String(e.title)):void 0,badge:e.badge?o(String(e.badge)):void 0,description:e.description?o(String(e.description)):void 0}}function b(e,t){if(e.groupPosition!==void 0)return e.groupPosition;if(e.sidebarPosition!==void 0)return e.sidebarPosition;if(t.remainingParts.length<=1)return;let n=i(t.remainingParts[t.remainingParts.length-2]);return n===void 0?void 0:Number(n)}function x(e){let t;try{t=decodeURIComponent(e)}catch{throw a(`SECURITY_ERROR`,`Invalid encoding in path`,{file:e}),new l(`Security breach: Invalid characters or encoding in path`)}if(t.length>260)throw new c(`Path length exceeds limit`);return t}function S(e,n){let r=e.replace(/\\/g,`/`),i=n.replace(/\\/g,`/`),a=x(r),o=d.resolve(a),s=d.resolve(i);if(d.sep===`/`){let e=e=>{let t=e.replace(/\\/g,`/`);return/^[a-zA-Z]:/.test(t)&&(t=t.replace(/^[a-zA-Z]:/,``)),d.resolve(t)};o=e(a),s=e(i)}let l=d.relative(s,o).replace(/\\/g,`/`);if(l.startsWith(`../`)||l!==`.`&&!t.test(l))throw new c(`Security breach: File is outside of docs directory, contains null bytes, or invalid path characters: ${d.basename(a)}`);return{normalizedFile:r,normalizedDocsDir:i,relativePath:l}}var C=e({parseDocFileWithNative:()=>w});async function w(e,t,n,a,c,l){let f=l??u,{normalizedFile:p,normalizedDocsDir:m}=S(e,n),g=t.frontmatter??{},_=h(d.resolve(p),d.resolve(m),a,c,g.permalink),x=y(g),C=v(g),w=d.basename(_.relativePath),T=r(w),E=_.remainingParts.map(e=>r(e)).slice(0,-1),D=/^_?index\.mdx?$/.test(T),O=g.sidebarPosition??i(w),k=E.join(`/`),A=g.description?o(String(g.description)).trim():t.description,j={route:{path:_.finalPath,componentPath:e,filePath:_.relativePath,title:x.title||r(d.basename(p,d.extname(p))),description:A,sidebarPosition:O,headings:t.headings,locale:_.locale,version:_.version,badge:x.badge,icon:g.icon?String(g.icon):void 0,tab:_.inferredTab,subRouteGroup:_.subRouteGroup,slugParts:E,_content:t.plainText,_rawContent:t.content,date:g.date,lastUpdated:g.lastUpdated,category:g.category,order:g.order,sidebarLabel:g.sidebarLabel,sidebarHidden:g.sidebarHidden||g.hidden,seo:C,frontmatter:g,collection:_.collection,tags:g.tags,author:typeof g.author==`string`?g.author:g.author?.name,draft:g.draft,excerpt:g.excerpt,coverImage:g.coverImage||g.cover},relativeDir:_.collection?void 0:k||void 0,isGroupIndex:D,inferredTab:_.inferredTab,inferredCollection:_.collection,groupMeta:D?{title:g.groupTitle||x.title||(E.length>0?s(E[E.length-1]):``),position:b(g,_),icon:g.icon?String(g.icon):void 0}:void 0,inferredGroupPosition:_.remainingParts.length>1?i(_.remainingParts[_.remainingParts.length-2]):void 0};return await f.set(e,j),j}export{v as a,S as i,w as n,y as o,b as r,h as s,C as t};
|
package/dist/node/cache.cjs
CHANGED
|
@@ -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-
|
|
6
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-D1Md3oWO.cjs`),t=require(`../utils-ej6_SjIZ.cjs`);let n=require(`node:path`);n=e.r(n);let r=require(`node:crypto`);r=e.r(r);let i=require(`node:fs/promises`);i=e.r(i);let a=require(`node:zlib`);a=e.r(a);let o=require(`node:util`),s=require(`lru-cache`);const c=i.default.writeFile,l=i.default.readFile,u=i.default.mkdir,d=i.default.rename,f=(0,o.promisify)(a.default.gzip),p=(0,o.promisify)(a.default.gunzip),m=new Set,h=new FinalizationRegistry(e=>m.delete(e)),g=new class{activeTasks=new Set;add(e){let t=Promise.resolve().then(e).catch(()=>{}).finally(()=>{this.activeTasks.delete(t)});this.activeTasks.add(t)}async flush(){await Promise.all(Array.from(this.activeTasks))}get pending(){return this.activeTasks.size}};async function _(e,t,n){let r=Array(e.length),i=0;async function a(){for(;i<e.length;){let t=i++;r[t]=await n(e[t])}}return await Promise.all(Array.from({length:Math.min(t,e.length)},()=>a())),r}var v=class{entries=new Map;baseDir=null;indexPath=null;shardsDir=null;compress;loaded=!1;savePromise=null;constructor(e={}){let r=t.o();if(this.compress=e.compress===void 0?r.compress:e.compress,e.name){let t=e.root||process.cwd();this.baseDir=n.default.resolve(t,r.dir,`file-${e.name}`),this.indexPath=n.default.resolve(this.baseDir,`index.json`),this.shardsDir=n.default.resolve(this.baseDir,`shards`)}}shardHash(e){return r.default.createHash(`md5`).update(JSON.stringify(e)).digest(`hex`)}shardPath(e){let t=this.compress?`gz`:`json`;return n.default.resolve(this.shardsDir,`${e}.${t}`)}async load(){if(this.loaded||t.o().noCache||!this.indexPath||!this.shardsDir)return;let e={};try{let t=await l(this.indexPath,`utf-8`);e=JSON.parse(t)}catch(e){if(e instanceof Error&&e.code===`ENOENT`){this.loaded=!0;return}this.loaded=!0;return}let n=new Map;await _(Object.keys(e),32,async t=>{let{hash:r,mtime:i}=e[t],a=this.shardPath(r);try{let e=await l(a);this.compress&&(e=await p(new Uint8Array(e)));let r=JSON.parse(e.toString(`utf-8`));n.set(t,{data:r,mtime:i})}catch{}}),this.entries=n,this.loaded=!0}save(){if(t.o().noCache||!this.indexPath||!this.shardsDir)return;let e=Array.from(this.entries.entries()).map(([e,t])=>({key:e,...t,hash:this.shardHash(t.data)})),a={};for(let{key:t,mtime:n,hash:r}of e)a[t]={hash:r,mtime:n};let o=this.indexPath,s=JSON.stringify(a),l=this.compress,p=this.shardsDir,m=new Set(Object.values(a).map(e=>e.hash)),h=async()=>{try{await u(p,{recursive:!0});let t=`${o}.${r.default.randomBytes(4).toString(`hex`)}.tmp`;await c(t,s),await d(t,o);let a=new Map;for(let{hash:t,data:n}of e)a.has(t)||a.set(t,n);await _(Array.from(a.entries()),8,async([e,t])=>{let n=this.shardPath(e);try{await i.default.access(n);return}catch{}let a=JSON.stringify(t),o=Buffer.from(a);l&&(o=await f(o));let s=`${n}.${r.default.randomBytes(4).toString(`hex`)}.tmp`;await c(s,o),await d(s,n)});try{await _(await i.default.readdir(p),8,async e=>{let t=e.replace(/\.(gz|json)$/,``);m.has(t)||await i.default.unlink(n.default.resolve(p,e))})}catch{}}catch{}};this.savePromise=(this.savePromise||Promise.resolve()).then(h,h),g.add(()=>this.savePromise)}get(e){let n=this.entries.get(e);return!n||t.s(e)!==n.mtime?null:n.data}getStale(e){let t=this.entries.get(e);return t?t.data:null}set(e,n){this.entries.set(e,{data:n,mtime:t.s(e)})}isValid(e){let n=this.entries.get(e);return n?t.s(e)===n.mtime:!1}invalidate(e){this.entries.delete(e)}invalidateAll(){this.entries.clear(),this.loaded=!1}pruneStale(e){for(let t of this.entries.keys())e.has(t)||this.entries.delete(t)}get size(){return this.entries.size}async flush(){await g.flush()}},y=class{index=new Map;memoryCache;baseDir;shardsDir;indexPath;saveTimeout=null;constructor(e,r=process.cwd()){let i=t.o();this.baseDir=n.default.resolve(r,i.dir,`transform-${e}`),this.shardsDir=n.default.resolve(this.baseDir,`shards`),this.indexPath=n.default.resolve(this.baseDir,`index.json`),this.memoryCache=new s.LRUCache({max:i.lruLimit,ttl:i.lruTTL,updateAgeOnGet:!0});let a=new WeakRef(this);m.add(a),h.register(this,a,this)}async load(){if(!t.o().noCache)try{let e=await l(this.indexPath,`utf-8`);this.index=new Map(Object.entries(JSON.parse(e)))}catch(e){if(e instanceof Error&&e.code===`ENOENT`)return}}save(){if(t.o().noCache)return;this.saveTimeout&&=(clearTimeout(this.saveTimeout),null);let e=JSON.stringify(Object.fromEntries(this.index)),r=this.indexPath;g.add(async()=>{try{await u(n.default.dirname(r),{recursive:!0}),await c(r,e)}catch{}})}async getMany(e){let t=new Map,r=[];for(let n of e){let e=this.memoryCache.get(n);e===void 0?this.index.has(n)&&r.push(n):t.set(n,e)}if(r.length>0){let e=await Promise.all(r.map(async e=>{let t=this.index.get(e),r=n.default.resolve(this.shardsDir,`${t}.gz`);try{let t=await l(r),n=(await p(new Uint8Array(t))).toString(`utf-8`);return this.memoryCache.set(e,n),{key:e,val:n}}catch{return null}}));for(let n of e)n&&t.set(n.key,n.val)}return t}async getAsync(e){let t=this.memoryCache.get(e);if(t!==void 0)return t;let r=this.index.get(e);if(!r)return null;let i=n.default.resolve(this.shardsDir,`${r}.gz`);try{let t=(await p(await l(i))).toString(`utf-8`);return this.memoryCache.set(e,t),t}catch(e){return e instanceof Error&&e.code,null}}set(e,t){let a=r.default.createHash(`md5`).update(t).digest(`hex`);this.index.set(e,a),this.memoryCache.set(e,t);let o=n.default.resolve(this.shardsDir,`${a}.gz`);g.add(async()=>{try{try{await i.default.access(o);return}catch{}await u(this.shardsDir,{recursive:!0});let e=await f(new Uint8Array(Buffer.from(t))),n=`${o}.${r.default.randomBytes(4).toString(`hex`)}.tmp`;await c(n,new Uint8Array(e)),await d(n,o)}catch{}}),this.saveTimeout&&clearTimeout(this.saveTimeout),this.saveTimeout=setTimeout(()=>{this.saveTimeout=null,this.save()},500),typeof this.saveTimeout.unref==`function`&&this.saveTimeout.unref()}get size(){return this.index.size}async flush(){this.saveTimeout&&(clearTimeout(this.saveTimeout),this.saveTimeout=null,this.save()),await g.flush()}dispose(){this.saveTimeout&&=(clearTimeout(this.saveTimeout),null);for(let e of m)e.deref()===this&&m.delete(e);h.unregister(this)}};async function b(){await Promise.all([...m].map(e=>e.deref()).filter(e=>e!==void 0).map(e=>e.flush())),await g.flush()}exports.FileCache=v,exports.TransformCache=y,exports.flushCache=b,exports.globalBackgroundQueue=g;
|
package/dist/node/cache.d.cts
CHANGED
|
@@ -12,23 +12,37 @@ declare class BackgroundQueue {
|
|
|
12
12
|
declare const globalBackgroundQueue: BackgroundQueue;
|
|
13
13
|
/**
|
|
14
14
|
* Generic file-based cache with per-file granularity and asynchronous persistence.
|
|
15
|
+
*
|
|
16
|
+
* Storage layout (when `name` is provided):
|
|
17
|
+
* <root>/.boltdocs/cache/file-<name>/index.json
|
|
18
|
+
* <root>/.boltdocs/cache/file-<name>/shards/<hash>.json[.gz]
|
|
19
|
+
*
|
|
20
|
+
* Each entry is persisted in its own shard keyed by a hash of the serialized
|
|
21
|
+
* value. This avoids the monolithic JSON.parse/stringify overhead of the
|
|
22
|
+
* previous single-file implementation and mirrors the proven design of
|
|
23
|
+
* `TransformCache`.
|
|
15
24
|
*/
|
|
16
25
|
declare class FileCache<T> {
|
|
17
26
|
private entries;
|
|
18
|
-
private readonly
|
|
27
|
+
private readonly baseDir;
|
|
28
|
+
private readonly indexPath;
|
|
29
|
+
private readonly shardsDir;
|
|
19
30
|
private readonly compress;
|
|
20
31
|
private loaded;
|
|
32
|
+
private savePromise;
|
|
21
33
|
constructor(options?: {
|
|
22
34
|
name?: string;
|
|
23
35
|
root?: string;
|
|
24
36
|
compress?: boolean;
|
|
25
37
|
});
|
|
38
|
+
private shardHash;
|
|
39
|
+
private shardPath;
|
|
26
40
|
/**
|
|
27
|
-
* Loads the cache.
|
|
41
|
+
* Loads the cache index and shards into memory.
|
|
28
42
|
*/
|
|
29
43
|
load(): Promise<void>;
|
|
30
44
|
/**
|
|
31
|
-
* Saves the cache in the background.
|
|
45
|
+
* Saves the cache in the background using a sharded index + shard files.
|
|
32
46
|
*/
|
|
33
47
|
save(): void;
|
|
34
48
|
get(filePath: string): T | null;
|
|
@@ -75,6 +89,8 @@ declare class TransformCache {
|
|
|
75
89
|
set(key: string, result: string): void;
|
|
76
90
|
get size(): number;
|
|
77
91
|
flush(): Promise<void>;
|
|
92
|
+
/** Release this cache from the process-wide flush registry. */
|
|
93
|
+
dispose(): void;
|
|
78
94
|
}
|
|
79
95
|
/**
|
|
80
96
|
* Flushes all pending background cache operations.
|
package/dist/node/cache.d.mts
CHANGED
|
@@ -12,23 +12,37 @@ declare class BackgroundQueue {
|
|
|
12
12
|
declare const globalBackgroundQueue: BackgroundQueue;
|
|
13
13
|
/**
|
|
14
14
|
* Generic file-based cache with per-file granularity and asynchronous persistence.
|
|
15
|
+
*
|
|
16
|
+
* Storage layout (when `name` is provided):
|
|
17
|
+
* <root>/.boltdocs/cache/file-<name>/index.json
|
|
18
|
+
* <root>/.boltdocs/cache/file-<name>/shards/<hash>.json[.gz]
|
|
19
|
+
*
|
|
20
|
+
* Each entry is persisted in its own shard keyed by a hash of the serialized
|
|
21
|
+
* value. This avoids the monolithic JSON.parse/stringify overhead of the
|
|
22
|
+
* previous single-file implementation and mirrors the proven design of
|
|
23
|
+
* `TransformCache`.
|
|
15
24
|
*/
|
|
16
25
|
declare class FileCache<T> {
|
|
17
26
|
private entries;
|
|
18
|
-
private readonly
|
|
27
|
+
private readonly baseDir;
|
|
28
|
+
private readonly indexPath;
|
|
29
|
+
private readonly shardsDir;
|
|
19
30
|
private readonly compress;
|
|
20
31
|
private loaded;
|
|
32
|
+
private savePromise;
|
|
21
33
|
constructor(options?: {
|
|
22
34
|
name?: string;
|
|
23
35
|
root?: string;
|
|
24
36
|
compress?: boolean;
|
|
25
37
|
});
|
|
38
|
+
private shardHash;
|
|
39
|
+
private shardPath;
|
|
26
40
|
/**
|
|
27
|
-
* Loads the cache.
|
|
41
|
+
* Loads the cache index and shards into memory.
|
|
28
42
|
*/
|
|
29
43
|
load(): Promise<void>;
|
|
30
44
|
/**
|
|
31
|
-
* Saves the cache in the background.
|
|
45
|
+
* Saves the cache in the background using a sharded index + shard files.
|
|
32
46
|
*/
|
|
33
47
|
save(): void;
|
|
34
48
|
get(filePath: string): T | null;
|
|
@@ -75,6 +89,8 @@ declare class TransformCache {
|
|
|
75
89
|
set(key: string, result: string): void;
|
|
76
90
|
get size(): number;
|
|
77
91
|
flush(): Promise<void>;
|
|
92
|
+
/** Release this cache from the process-wide flush registry. */
|
|
93
|
+
dispose(): void;
|
|
78
94
|
}
|
|
79
95
|
/**
|
|
80
96
|
* Flushes all pending background cache operations.
|
package/dist/node/cache.mjs
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import{o as e,s as t}from"../utils-
|
|
6
|
+
import{o as e,s as t}from"../utils-8lzafE49.mjs";import n from"node:path";import r from"node:crypto";import i from"node:fs/promises";import a from"node:zlib";import{promisify as o}from"node:util";import{LRUCache as s}from"lru-cache";const c=i.writeFile,l=i.readFile,u=i.mkdir,d=i.rename,f=o(a.gzip),p=o(a.gunzip),m=new Set,h=new FinalizationRegistry(e=>m.delete(e)),g=new class{activeTasks=new Set;add(e){let t=Promise.resolve().then(e).catch(()=>{}).finally(()=>{this.activeTasks.delete(t)});this.activeTasks.add(t)}async flush(){await Promise.all(Array.from(this.activeTasks))}get pending(){return this.activeTasks.size}};async function _(e,t,n){let r=Array(e.length),i=0;async function a(){for(;i<e.length;){let t=i++;r[t]=await n(e[t])}}return await Promise.all(Array.from({length:Math.min(t,e.length)},()=>a())),r}var v=class{entries=new Map;baseDir=null;indexPath=null;shardsDir=null;compress;loaded=!1;savePromise=null;constructor(t={}){let r=e();if(this.compress=t.compress===void 0?r.compress:t.compress,t.name){let e=t.root||process.cwd();this.baseDir=n.resolve(e,r.dir,`file-${t.name}`),this.indexPath=n.resolve(this.baseDir,`index.json`),this.shardsDir=n.resolve(this.baseDir,`shards`)}}shardHash(e){return r.createHash(`md5`).update(JSON.stringify(e)).digest(`hex`)}shardPath(e){let t=this.compress?`gz`:`json`;return n.resolve(this.shardsDir,`${e}.${t}`)}async load(){if(this.loaded||e().noCache||!this.indexPath||!this.shardsDir)return;let t={};try{let e=await l(this.indexPath,`utf-8`);t=JSON.parse(e)}catch(e){if(e instanceof Error&&e.code===`ENOENT`){this.loaded=!0;return}this.loaded=!0;return}let n=new Map;await _(Object.keys(t),32,async e=>{let{hash:r,mtime:i}=t[e],a=this.shardPath(r);try{let t=await l(a);this.compress&&(t=await p(new Uint8Array(t)));let r=JSON.parse(t.toString(`utf-8`));n.set(e,{data:r,mtime:i})}catch{}}),this.entries=n,this.loaded=!0}save(){if(e().noCache||!this.indexPath||!this.shardsDir)return;let t=Array.from(this.entries.entries()).map(([e,t])=>({key:e,...t,hash:this.shardHash(t.data)})),a={};for(let{key:e,mtime:n,hash:r}of t)a[e]={hash:r,mtime:n};let o=this.indexPath,s=JSON.stringify(a),l=this.compress,p=this.shardsDir,m=new Set(Object.values(a).map(e=>e.hash)),h=async()=>{try{await u(p,{recursive:!0});let e=`${o}.${r.randomBytes(4).toString(`hex`)}.tmp`;await c(e,s),await d(e,o);let a=new Map;for(let{hash:e,data:n}of t)a.has(e)||a.set(e,n);await _(Array.from(a.entries()),8,async([e,t])=>{let n=this.shardPath(e);try{await i.access(n);return}catch{}let a=JSON.stringify(t),o=Buffer.from(a);l&&(o=await f(o));let s=`${n}.${r.randomBytes(4).toString(`hex`)}.tmp`;await c(s,o),await d(s,n)});try{await _(await i.readdir(p),8,async e=>{let t=e.replace(/\.(gz|json)$/,``);m.has(t)||await i.unlink(n.resolve(p,e))})}catch{}}catch{}};this.savePromise=(this.savePromise||Promise.resolve()).then(h,h),g.add(()=>this.savePromise)}get(e){let n=this.entries.get(e);return!n||t(e)!==n.mtime?null:n.data}getStale(e){let t=this.entries.get(e);return t?t.data:null}set(e,n){this.entries.set(e,{data:n,mtime:t(e)})}isValid(e){let n=this.entries.get(e);return n?t(e)===n.mtime:!1}invalidate(e){this.entries.delete(e)}invalidateAll(){this.entries.clear(),this.loaded=!1}pruneStale(e){for(let t of this.entries.keys())e.has(t)||this.entries.delete(t)}get size(){return this.entries.size}async flush(){await g.flush()}},y=class{index=new Map;memoryCache;baseDir;shardsDir;indexPath;saveTimeout=null;constructor(t,r=process.cwd()){let i=e();this.baseDir=n.resolve(r,i.dir,`transform-${t}`),this.shardsDir=n.resolve(this.baseDir,`shards`),this.indexPath=n.resolve(this.baseDir,`index.json`),this.memoryCache=new s({max:i.lruLimit,ttl:i.lruTTL,updateAgeOnGet:!0});let a=new WeakRef(this);m.add(a),h.register(this,a,this)}async load(){if(!e().noCache)try{let e=await l(this.indexPath,`utf-8`);this.index=new Map(Object.entries(JSON.parse(e)))}catch(e){if(e instanceof Error&&e.code===`ENOENT`)return}}save(){if(e().noCache)return;this.saveTimeout&&=(clearTimeout(this.saveTimeout),null);let t=JSON.stringify(Object.fromEntries(this.index)),r=this.indexPath;g.add(async()=>{try{await u(n.dirname(r),{recursive:!0}),await c(r,t)}catch{}})}async getMany(e){let t=new Map,r=[];for(let n of e){let e=this.memoryCache.get(n);e===void 0?this.index.has(n)&&r.push(n):t.set(n,e)}if(r.length>0){let e=await Promise.all(r.map(async e=>{let t=this.index.get(e),r=n.resolve(this.shardsDir,`${t}.gz`);try{let t=await l(r),n=(await p(new Uint8Array(t))).toString(`utf-8`);return this.memoryCache.set(e,n),{key:e,val:n}}catch{return null}}));for(let n of e)n&&t.set(n.key,n.val)}return t}async getAsync(e){let t=this.memoryCache.get(e);if(t!==void 0)return t;let r=this.index.get(e);if(!r)return null;let i=n.resolve(this.shardsDir,`${r}.gz`);try{let t=(await p(await l(i))).toString(`utf-8`);return this.memoryCache.set(e,t),t}catch(e){return e instanceof Error&&e.code,null}}set(e,t){let a=r.createHash(`md5`).update(t).digest(`hex`);this.index.set(e,a),this.memoryCache.set(e,t);let o=n.resolve(this.shardsDir,`${a}.gz`);g.add(async()=>{try{try{await i.access(o);return}catch{}await u(this.shardsDir,{recursive:!0});let e=await f(new Uint8Array(Buffer.from(t))),n=`${o}.${r.randomBytes(4).toString(`hex`)}.tmp`;await c(n,new Uint8Array(e)),await d(n,o)}catch{}}),this.saveTimeout&&clearTimeout(this.saveTimeout),this.saveTimeout=setTimeout(()=>{this.saveTimeout=null,this.save()},500),typeof this.saveTimeout.unref==`function`&&this.saveTimeout.unref()}get size(){return this.index.size}async flush(){this.saveTimeout&&(clearTimeout(this.saveTimeout),this.saveTimeout=null,this.save()),await g.flush()}dispose(){this.saveTimeout&&=(clearTimeout(this.saveTimeout),null);for(let e of m)e.deref()===this&&m.delete(e);h.unregister(this)}};async function b(){await Promise.all([...m].map(e=>e.deref()).filter(e=>e!==void 0).map(e=>e.flush())),await g.flush()}export{v as FileCache,y as TransformCache,b as flushCache,g as globalBackgroundQueue};
|
package/dist/node/cli-entry.cjs
CHANGED
|
@@ -4,12 +4,4 @@
|
|
|
4
4
|
* Copyright (c) 2026 Jesus Alcala
|
|
5
5
|
* Licensed under the MIT License.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
`+(0,o.double)([` ${o.colors.green(`➜`)} ${o.colors.green(`Local:`)} ${o.colors.bgGreen.gray(e)}`,n,``,` ${o.colors.dim(`press h + enter for help`)}`],{title:`boltdocs dev server`})+`
|
|
9
|
-
`}function b(e,t){let n=t?` ${o.colors.green(`➜`)} ${o.colors.green(`Network:`)} ${o.colors.cyan(t)}`:` ${o.colors.green(`➜`)} ${o.colors.green(`Network:`)} ${o.colors.gray(`use --host to expose`)}`;return`
|
|
10
|
-
`+(0,o.double)([` ${o.colors.green(`➜`)} ${o.colors.green(`Local:`)} ${o.colors.bgGreen.gray(e)}`,n],{title:`boltdocs preview server`})+`
|
|
11
|
-
`}function x(e,t){return`
|
|
12
|
-
`+(0,o.double)([(0,o.padCenter)(`🚀 Update available!`,50),``,` ${o.colors.dim(`Current:`)} ${o.colors.red(e)} ${o.colors.gray(`→`)} ${o.colors.green(t)}`,``,` ${o.colors.dim(`Run:`)} ${o.colors.bold(`npm install boltdocs@latest`)}`])+`
|
|
13
|
-
`}const S=(0,c.createRequire)(require(`url`).pathToFileURL(__filename).href);function C(e,t){let n=e.split(`-`)[0].split(`.`).map(Number),r=t.split(`-`)[0].split(`.`).map(Number);for(let e=0;e<Math.max(n.length,r.length);e++){let t=n[e]??0,i=r[e]??0;if(Number.isNaN(t)||Number.isNaN(i))return!1;if(t!==i)return t>i}return!1}async function w(){try{let e=new AbortController,t=setTimeout(()=>e.abort(),2e3),n=await fetch(`https://registry.npmjs.org/boltdocs/latest`,{signal:e.signal,headers:{Accept:`application/vnd.npm.install-v1+json`}});return clearTimeout(t),n.ok?(await n.json()).version??null:null}catch{return null}}async function T(){try{let e=(0,f.fileURLToPath)(require(`url`).pathToFileURL(__filename).href),t=i.default.dirname(e);for(let e=0;e<5;e++){let e=i.default.join(t,`package.json`);if(a.default.existsSync(e)){let t=JSON.parse(a.default.readFileSync(e,`utf-8`));if(t.name===`boltdocs`)return t.version}t=i.default.dirname(t)}}catch{}try{return S(`boltdocs/package.json`).version}catch{return`0.0.0`}}async function E(){let e=``;try{e=i.default.join(d.default.homedir(),`.boltdocs`,`update-check.json`)}catch{return}let t=0;try{if(a.default.existsSync(e)){let n=JSON.parse(a.default.readFileSync(e,`utf-8`));t=Number(n.lastCheck)||0}}catch{}let n=Date.now();if(n-t<864e5)return;try{a.default.mkdirSync(i.default.dirname(e),{recursive:!0}),a.default.writeFileSync(e,JSON.stringify({lastCheck:n}),`utf-8`)}catch{}let r=await T();if(r===`0.0.0`)return;let o=await w();o&&C(o,r)&&console.log(x(r,o))}let D=!1;async function O(e=process.cwd(),n={}){if(D)return;D=!0,E();let a;try{a=await r.n(i.default.resolve(e,`docs`),e),t.m(a,e)}catch{}try{let r=await t.n(e,`development`,a);r.logLevel=`warn`,r.clearScreen=!1,n.port!==void 0&&(r.server=r.server||{},r.server.port=Number(n.port)),n.host!==void 0&&(r.server=r.server||{},r.server.host=n.host),n.force&&(r.optimizeDeps=r.optimizeDeps||{},r.optimizeDeps.force=!0);let i=await(0,l.createServer)(r);await i.listen();let o=i.resolvedUrls;console.log(y(o?.local?.[0]??`http://localhost:${n.port??5173}`,o?.network?.[0]??null)),i.bindCLIShortcuts({print:!1})}catch(e){(0,o.error)(`Failed to start dev server:`,e),process.exit(1)}}function k(e){return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function A(e){return e.map(e=>({label:e.name,status:e.success?`success`:`error`,details:e.details}))}async function j(e=process.cwd(),r={}){E();let i=r.turbo||process.env.BOLTDOCS_TURBO===`true`;i&&console.log(o.colors.yellow(`⚠ experimental — Turbo mode enabled, faster parser active`));try{let r=await t.f().run({root:e,timing:{},turbo:i});r.success||((0,o.error)(`Build failed at step "${r.failedStep}":`,r.error),await n.flushCache(),process.exit(1));let a=A(r.stepResults);console.log(``),console.log((0,o.steps)(a)),console.log((0,o.divider)(`═`,44)),console.log(` ${o.colors.dim(`Total`.padEnd(20))} ${o.colors.cyan(k(r.timing.total))}`),console.log(``);let s=r.stepResults.find(e=>e.name===`Build metrics`)?.metrics;if(s){let e=e=>(e/1024).toFixed(0),t=e=>(e/1024/1024).toFixed(1),n=s.jsSize>1024*1024?t(s.jsSize)+` MB`:e(s.jsSize)+` kB`,r=s.cssSize>1024*1024?t(s.cssSize)+` MB`:e(s.cssSize)+` kB`;console.log((0,o.table)([`Metric`,`Result`],[[`Build Time`,k(s.buildTime)],[`Pages`,String(s.totalPages)],[`JavaScript`,n],[`CSS`,r]],{style:`round`,headerSeparator:!0})),console.log(``)}let c=k(r.timing.total);console.log((0,o.double)([`boltdocs build completed in ${c}`,``,`${o.colors.cyan(`boltdocs`)} documentation is ready at ${o.colors.green(`dist/`)}`])),await n.flushCache(),process.exit(0)}catch(e){(0,o.error)(`Build failed:`,e),await n.flushCache(),process.exit(1)}}async function M(e=process.cwd(),n={}){try{let r=await t.n(e,`production`);r.logLevel=`warn`,r.clearScreen=!1,n.port!==void 0&&(r.preview=r.preview||{},r.preview.port=Number(n.port)),n.host!==void 0&&(r.preview=r.preview||{},r.preview.host=n.host);let i=(await(0,p.preview)(r)).resolvedUrls;console.log(b(i?.local?.[0]??`http://localhost:${n.port??4173}`,i?.network?.[0]??null))}catch(e){(0,o.error)(`Failed to start preview server:`,e),process.exit(1)}}function N(e){let t=[];if(!a.default.existsSync(e))return t;try{let n=a.default.readdirSync(e);for(let r of n){let n=i.default.join(e,r);a.default.statSync(n).isDirectory()?r!==`node_modules`&&r!==`.git`&&r!==`dist`&&r!==`coverage`&&t.push(...N(n)):/\.(js|mjs|cjs|ts|tsx|jsx)$/.test(r)&&t.push(n)}}catch{}return t}async function P(e=process.cwd()){(0,o.info)(`Starting static security audit of Boltdocs plugins...`);let t;try{t=await r.n(i.default.resolve(e,`docs`),e)}catch(e){(0,o.error)(`Failed to load Boltdocs configuration for audit:`,e),process.exit(1)}let n=t.plugins||[];if(n.length===0){(0,o.success)(`No plugins configured. Nothing to audit.`);return}let s=[];for(let t of n){if(!t.name)continue;let n=null;try{let r=(0,c.createRequire)(i.default.resolve(e,`package.json`)).resolve(`${t.name}/package.json`);n=i.default.dirname(r)}catch{let r=i.default.resolve(e,`node_modules`,t.name);a.default.existsSync(r)&&(n=r)}if(!n){s.push({name:o.colors.cyan(t.name),status:o.colors.red(`❓ Unresolved`),details:`Could not locate plugin files in node_modules.`});continue}let r=N(n),l=[];for(let e of r)try{let t=a.default.readFileSync(e,`utf-8`);t.includes(`fetch(`)&&l.push(`fetch`),t.includes(`axios`)&&l.push(`axios`),t.includes(`http.request`)&&l.push(`http.request`),t.includes(`https.request`)&&l.push(`https.request`),t.includes(`process.env`)&&l.push(`process.env`)}catch{}let u=Array.from(new Set(l));u.length>0?s.push({name:o.colors.cyan(t.name),status:o.colors.yellow(`⚠️ Warning`),details:`Contains network/env accesses: ${o.colors.bold(u.join(`, `))}. Ensure you trust the author.`}):s.push({name:o.colors.cyan(t.name),status:o.colors.green(`✅ Clean`),details:`No external network calls or env accesses detected.`})}let l=[`Plugin`,`Status`,`Audit Notes`],u=s.map(e=>[e.name,e.status,e.details]);console.log(`
|
|
14
|
-
`+(0,o.table)(l,u)+`
|
|
15
|
-
`),s.some(e=>e.status.includes(`Warning`))?(0,o.warn)(`⚠️ One or more plugins have security warnings. Review the flags above.`):(0,o.success)(`✓ All plugins passed the static security check!`)}const{emitWarning:F}=process;process.emitWarning=function(e,...t){if(!(e&&typeof e==`object`&&e.code===`DEP0205`)&&!(typeof e==`string`&&t.includes(`DEP0205`)))return Reflect.apply(F,process,[e,...t])},v(),(0,o.configure)({prefix:`boltdocs`});const I=(0,u.default)(`boltdocs`);I.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(O),I.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(O),I.command(`build [root]`,`Build for production`).option(`--turbo`,`Enable experimental turbo mode (faster parser, critical CSS, and more)`).action(j),I.command(`preview [root]`,`Preview production build`).option(`--port <port>`,`Port to listen on`).option(`--host [host]`,`Host to bind to`).action(M),I.command(`audit [root]`,`Audit configured plugins for security warnings`).action(P),I.command(`doctor [root]`,`Check the health of your documentation`).option(`--fix`,`Automatically fix broken internal links and sync translations`).option(`--check-external`,`Verify external links (slower)`).option(`--init`,`Initialize doctor.json with default configuration`).option(`--budget`,`Check build performance against configured budgets`).action(async(e,t)=>{let{doctorAction:n}=await Promise.resolve().then(()=>require(`../doctor-BBtmNJE0.cjs`));await n(e,t)}),I.command(`generate-changelog <file>`,`Generate changelog documentation from CHANGELOG.md`).option(`-o, --output <path>`,`Output folder (default: docs/changelog)`,{default:`docs/changelog`}).option(`-t, --title <text>`,`Title for changelog pages`,{default:`Changelog`}).option(`--infer-tab`,`Infer tab from folder name (default: true)`,{default:!0}).option(`-l, --limit <number>`,`Limit number of versions to generate`).action(async(e,t)=>{let{generateChangelog:n}=await Promise.resolve().then(()=>require(`../generator-COepVWGi.cjs`));await n(e,{output:t.output,title:t.title,inferTab:t.inferTab,limit:t.limit?parseInt(String(t.limit),10):void 0})}),I.help(),I.version(`3.0.0`),I.parse(),exports.t=E;
|
|
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();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-Ch3hEe5Y.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-Ch3hEe5Y.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-BS2hefiL.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-BS2hefiL.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-COgjnQ5n.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-B1_YL0Wt.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-BlW45ST7.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,12 +4,4 @@
|
|
|
4
4
|
* Copyright (c) 2026 Jesus Alcala
|
|
5
5
|
* Licensed under the MIT License.
|
|
6
6
|
*/
|
|
7
|
-
import{
|
|
8
|
-
`+d([` ${c.green(`➜`)} ${c.green(`Local:`)} ${c.bgGreen.gray(e)}`,n,``,` ${c.dim(`press h + enter for help`)}`],{title:`boltdocs dev server`})+`
|
|
9
|
-
`}function j(e,t){let n=t?` ${c.green(`➜`)} ${c.green(`Network:`)} ${c.cyan(t)}`:` ${c.green(`➜`)} ${c.green(`Network:`)} ${c.gray(`use --host to expose`)}`;return`
|
|
10
|
-
`+d([` ${c.green(`➜`)} ${c.green(`Local:`)} ${c.bgGreen.gray(e)}`,n],{title:`boltdocs preview server`})+`
|
|
11
|
-
`}function M(e,t){return`
|
|
12
|
-
`+d([m(`🚀 Update available!`,50),``,` ${c.dim(`Current:`)} ${c.red(e)} ${c.gray(`→`)} ${c.green(t)}`,``,` ${c.dim(`Run:`)} ${c.bold(`npm install boltdocs@latest`)}`])+`
|
|
13
|
-
`}const N=a(import.meta.url);function P(e,t){let n=e.split(`-`)[0].split(`.`).map(Number),r=t.split(`-`)[0].split(`.`).map(Number);for(let e=0;e<Math.max(n.length,r.length);e++){let t=n[e]??0,i=r[e]??0;if(Number.isNaN(t)||Number.isNaN(i))return!1;if(t!==i)return t>i}return!1}async function F(){try{let e=new AbortController,t=setTimeout(()=>e.abort(),2e3),n=await fetch(`https://registry.npmjs.org/boltdocs/latest`,{signal:e.signal,headers:{Accept:`application/vnd.npm.install-v1+json`}});return clearTimeout(t),n.ok?(await n.json()).version??null:null}catch{return null}}async function I(){try{let e=C(import.meta.url),t=o.dirname(e);for(let e=0;e<5;e++){let e=o.join(t,`package.json`);if(s.existsSync(e)){let t=JSON.parse(s.readFileSync(e,`utf-8`));if(t.name===`boltdocs`)return t.version}t=o.dirname(t)}}catch{}try{return N(`boltdocs/package.json`).version}catch{return`0.0.0`}}async function L(){let e=``;try{e=o.join(S.homedir(),`.boltdocs`,`update-check.json`)}catch{return}let t=0;try{if(s.existsSync(e)){let n=JSON.parse(s.readFileSync(e,`utf-8`));t=Number(n.lastCheck)||0}}catch{}let n=Date.now();if(n-t<864e5)return;try{s.mkdirSync(o.dirname(e),{recursive:!0}),s.writeFileSync(e,JSON.stringify({lastCheck:n}),`utf-8`)}catch{}let r=await I();if(r===`0.0.0`)return;let i=await F();i&&P(i,r)&&console.log(M(r,i))}let R=!1;async function z(e=process.cwd(),r={}){if(R)return;R=!0,L();let a;try{a=await i(o.resolve(e,`docs`),e),n(a,e)}catch{}try{let n=await t(e,`development`,a);n.logLevel=`warn`,n.clearScreen=!1,r.port!==void 0&&(n.server=n.server||{},n.server.port=Number(r.port)),r.host!==void 0&&(n.server=n.server||{},n.server.host=r.host),r.force&&(n.optimizeDeps=n.optimizeDeps||{},n.optimizeDeps.force=!0);let i=await b(n);await i.listen();let o=i.resolvedUrls;console.log(A(o?.local?.[0]??`http://localhost:${r.port??5173}`,o?.network?.[0]??null)),i.bindCLIShortcuts({print:!1})}catch(e){f(`Failed to start dev server:`,e),process.exit(1)}}function B(e){return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function V(e){return e.map(e=>({label:e.name,status:e.success?`success`:`error`,details:e.details}))}async function H(t=process.cwd(),n={}){L();let i=n.turbo||process.env.BOLTDOCS_TURBO===`true`;i&&console.log(c.yellow(`⚠ experimental — Turbo mode enabled, faster parser active`));try{let n=await e().run({root:t,timing:{},turbo:i});n.success||(f(`Build failed at step "${n.failedStep}":`,n.error),await r(),process.exit(1));let a=V(n.stepResults);console.log(``),console.log(h(a)),console.log(u(`═`,44)),console.log(` ${c.dim(`Total`.padEnd(20))} ${c.cyan(B(n.timing.total))}`),console.log(``);let o=n.stepResults.find(e=>e.name===`Build metrics`)?.metrics;if(o){let e=e=>(e/1024).toFixed(0),t=e=>(e/1024/1024).toFixed(1),n=o.jsSize>1024*1024?t(o.jsSize)+` MB`:e(o.jsSize)+` kB`,r=o.cssSize>1024*1024?t(o.cssSize)+` MB`:e(o.cssSize)+` kB`;console.log(_([`Metric`,`Result`],[[`Build Time`,B(o.buildTime)],[`Pages`,String(o.totalPages)],[`JavaScript`,n],[`CSS`,r]],{style:`round`,headerSeparator:!0})),console.log(``)}let s=B(n.timing.total);console.log(d([`boltdocs build completed in ${s}`,``,`${c.cyan(`boltdocs`)} documentation is ready at ${c.green(`dist/`)}`])),await r(),process.exit(0)}catch(e){f(`Build failed:`,e),await r(),process.exit(1)}}async function U(e=process.cwd(),n={}){try{let r=await t(e,`production`);r.logLevel=`warn`,r.clearScreen=!1,n.port!==void 0&&(r.preview=r.preview||{},r.preview.port=Number(n.port)),n.host!==void 0&&(r.preview=r.preview||{},r.preview.host=n.host);let i=(await w(r)).resolvedUrls;console.log(j(i?.local?.[0]??`http://localhost:${n.port??4173}`,i?.network?.[0]??null))}catch(e){f(`Failed to start preview server:`,e),process.exit(1)}}function W(e){let t=[];if(!s.existsSync(e))return t;try{let n=s.readdirSync(e);for(let r of n){let n=o.join(e,r);s.statSync(n).isDirectory()?r!==`node_modules`&&r!==`.git`&&r!==`dist`&&r!==`coverage`&&t.push(...W(n)):/\.(js|mjs|cjs|ts|tsx|jsx)$/.test(r)&&t.push(n)}}catch{}return t}async function G(e=process.cwd()){p(`Starting static security audit of Boltdocs plugins...`);let t;try{t=await i(o.resolve(e,`docs`),e)}catch(e){f(`Failed to load Boltdocs configuration for audit:`,e),process.exit(1)}let n=t.plugins||[];if(n.length===0){g(`No plugins configured. Nothing to audit.`);return}let r=[];for(let t of n){if(!t.name)continue;let n=null;try{let r=a(o.resolve(e,`package.json`)).resolve(`${t.name}/package.json`);n=o.dirname(r)}catch{let r=o.resolve(e,`node_modules`,t.name);s.existsSync(r)&&(n=r)}if(!n){r.push({name:c.cyan(t.name),status:c.red(`❓ Unresolved`),details:`Could not locate plugin files in node_modules.`});continue}let i=W(n),l=[];for(let e of i)try{let t=s.readFileSync(e,`utf-8`);t.includes(`fetch(`)&&l.push(`fetch`),t.includes(`axios`)&&l.push(`axios`),t.includes(`http.request`)&&l.push(`http.request`),t.includes(`https.request`)&&l.push(`https.request`),t.includes(`process.env`)&&l.push(`process.env`)}catch{}let u=Array.from(new Set(l));u.length>0?r.push({name:c.cyan(t.name),status:c.yellow(`⚠️ Warning`),details:`Contains network/env accesses: ${c.bold(u.join(`, `))}. Ensure you trust the author.`}):r.push({name:c.cyan(t.name),status:c.green(`✅ Clean`),details:`No external network calls or env accesses detected.`})}let l=[`Plugin`,`Status`,`Audit Notes`],u=r.map(e=>[e.name,e.status,e.details]);console.log(`
|
|
14
|
-
`+_(l,u)+`
|
|
15
|
-
`),r.some(e=>e.status.includes(`Warning`))?v(`⚠️ One or more plugins have security warnings. Review the flags above.`):g(`✓ All plugins passed the static security check!`)}const{emitWarning:K}=process;process.emitWarning=function(e,...t){if(!(e&&typeof e==`object`&&e.code===`DEP0205`)&&!(typeof e==`string`&&t.includes(`DEP0205`)))return Reflect.apply(K,process,[e,...t])},k(),l({prefix:`boltdocs`});const q=x(`boltdocs`);q.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(z),q.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(z),q.command(`build [root]`,`Build for production`).option(`--turbo`,`Enable experimental turbo mode (faster parser, critical CSS, and more)`).action(H),q.command(`preview [root]`,`Preview production build`).option(`--port <port>`,`Port to listen on`).option(`--host [host]`,`Host to bind to`).action(U),q.command(`audit [root]`,`Audit configured plugins for security warnings`).action(G),q.command(`doctor [root]`,`Check the health of your documentation`).option(`--fix`,`Automatically fix broken internal links and sync translations`).option(`--check-external`,`Verify external links (slower)`).option(`--init`,`Initialize doctor.json with default configuration`).option(`--budget`,`Check build performance against configured budgets`).action(async(e,t)=>{let{doctorAction:n}=await import(`../doctor-DOAbSaiL.mjs`).then(e=>e.t);await n(e,t)}),q.command(`generate-changelog <file>`,`Generate changelog documentation from CHANGELOG.md`).option(`-o, --output <path>`,`Output folder (default: docs/changelog)`,{default:`docs/changelog`}).option(`-t, --title <text>`,`Title for changelog pages`,{default:`Changelog`}).option(`--infer-tab`,`Infer tab from folder name (default: true)`,{default:!0}).option(`-l, --limit <number>`,`Limit number of versions to generate`).action(async(e,t)=>{let{generateChangelog:n}=await import(`../generator-CcOBN5vI.mjs`);await n(e,{output:t.output,title:t.title,inferTab:t.inferTab,limit:t.limit?parseInt(String(t.limit),10):void 0})}),q.help(),q.version(`3.0.0`),q.parse();export{L as t};
|
|
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();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-QPNxysrd.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-QPNxysrd.mjs`);return n(e,t)}),m.command(`build [root]`,`Build for production`).action(async(...e)=>{await p();let{buildAction:t}=await import(`../build-C5mNh9D-.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-C5mNh9D-.mjs`);return t(...e)}),m.command(`audit [root]`,`Audit configured plugins for security warnings`).action(async(...e)=>{let{auditAction:t}=await import(`../audit-CLXjMzwQ.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-DmQnml2k.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-BwknNejd.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{};
|
package/dist/node/index.cjs
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../node-
|
|
6
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../node-DunuGqyp.cjs`),t=require(`../utils-ej6_SjIZ.cjs`),n=require(`../plugin-context-C-l90hFt.cjs`),r=require(`./cache.cjs`),i=require(`../routes-U9L8psZ9.cjs`),a=require(`../config-Ceib-AOH.cjs`),o=require(`../handler-CDEoKARD.cjs`),s=require(`../adapters-Cp1Maurn.cjs`);exports.BoltdocsPluginStore=e.d,exports.PluginCompatibilityError=e.f,exports.PluginError=e.p,exports.PluginHookError=e.m,exports.PluginLifecycleManager=e.o,exports.PluginValidationError=e.h,exports.createArticleStructuredData=e.g,exports.createBreadcrumbStructuredData=e._,exports.createPlugin=e.i,exports.createStructuredData=e.v,exports.createViteConfig=e.n,exports.createWebSiteStructuredData=e.y,exports.default=e.t,exports.defineConfig=a.r,exports.definePlugin=e.a,exports.defineStructuredData=e.b,exports.flushCache=r.flushCache,exports.generateEntryCode=n.g,exports.generateRoutes=i.t,exports.handleAwsFeedback=s.t,exports.handleFeedback=o.t,exports.handleNetlifyFeedback=s.r,exports.handleVercelFeedback=s.i,exports.handleWebFeedback=s.n,exports.invalidateRouteCache=i.i,exports.normalizePath=t.u,exports.resolveConfig=a.t,exports.resolvePluginHook=e.s,exports.sanitizeFilename=t.f,exports.validatePlugins=e.u;var c=require(`@bdocs/unist-utils`);Object.keys(c).forEach(function(e){e!==`default`&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return c[e]}})});
|