boltdocs 3.3.5 → 3.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/{build-BVoMHMhw.mjs → build-BJnL-FHG.mjs} +1 -1
  2. package/dist/{build-B672n0hL.cjs → build-CxT38vPv.cjs} +1 -1
  3. package/dist/client/index.cjs +29 -12
  4. package/dist/client/index.d.cts +1 -1
  5. package/dist/client/index.d.ts +1 -1
  6. package/dist/client/index.js +27 -11
  7. package/dist/client/mdx.cjs +1 -1
  8. package/dist/client/mdx.js +1 -1
  9. package/dist/client/primitives.cjs +4 -4
  10. package/dist/client/primitives.d.cts +40 -9
  11. package/dist/client/primitives.d.ts +40 -9
  12. package/dist/client/primitives.js +4 -4
  13. package/dist/config-B3_iVsbi.mjs +7 -0
  14. package/dist/{config-PLvresCv.cjs → config-BC_qhXws.cjs} +1 -1
  15. package/dist/config-BJp3lGzE.cjs +7 -0
  16. package/dist/{dev-DbuhNcF5.cjs → dev-46NiL0MC.cjs} +1 -1
  17. package/dist/{dev-B49V6O6p.mjs → dev-C4kjO5xs.mjs} +1 -1
  18. package/dist/{docs-layout-CbZ7LDRe.js → docs-layout-D3Fmb0Wd.js} +16 -117
  19. package/dist/{docs-layout-vzfXed1Q.cjs → docs-layout-SgphExoE.cjs} +16 -123
  20. package/dist/{doctor-DMECtdK6.cjs → doctor-BqxOFRt3.cjs} +1 -1
  21. package/dist/{doctor-i8Qmd8DJ.mjs → doctor-Cv5lXnay.mjs} +1 -1
  22. package/dist/{doctor-FuFY1jBz.cjs → doctor-TS3JGNEU.cjs} +1 -1
  23. package/dist/{image-B-NDSDuY.js → image-BAiDReNd.js} +1 -1
  24. package/dist/{image-Hnaa2bJd.cjs → image-Bkx85rsq.cjs} +1 -1
  25. package/dist/{index-B3o307nd.d.ts → index-B1Mx0dHl.d.ts} +24 -4
  26. package/dist/{index-Bg-JtZeK.d.cts → index-DLaHgD-i.d.cts} +24 -4
  27. package/dist/{link-vZjmD-es.cjs → link-hLWOsx0x.cjs} +59 -28
  28. package/dist/{link-CgdI6O2o.js → link-q1qHNGK_.js} +54 -29
  29. package/dist/{mdx-BRT71V5Q.js → mdx-CJGWzBGy.js} +2 -2
  30. package/dist/{mdx-D0Absdq5.cjs → mdx-Qi0DmaY8.cjs} +2 -2
  31. package/dist/node/cli-entry.cjs +1 -1
  32. package/dist/node/cli-entry.mjs +1 -1
  33. package/dist/node/highlight.d.cts +2 -2
  34. package/dist/node/highlight.d.mts +2 -2
  35. package/dist/node/index.cjs +1 -1
  36. package/dist/node/index.d.cts +7 -4
  37. package/dist/node/index.d.mts +7 -4
  38. package/dist/node/index.mjs +1 -1
  39. package/dist/node/mdx/shiki-adapter.cjs +1 -1
  40. package/dist/node/mdx/shiki-adapter.d.cts +7 -2
  41. package/dist/node/mdx/shiki-adapter.d.mts +7 -2
  42. package/dist/node/mdx/shiki-adapter.mjs +1 -1
  43. package/dist/node-7Cfw6nMr.cjs +23 -0
  44. package/dist/node-CT2E84nY.mjs +23 -0
  45. package/dist/{package-CNqjEYE1.cjs → package-Bah2tHjK.cjs} +1 -1
  46. package/dist/{package-sdcKhDhe.mjs → package-D6bf68FR.mjs} +1 -1
  47. package/dist/plugin-AgNI3ktz.cjs +69 -0
  48. package/dist/plugin-BAv_pYLt.mjs +69 -0
  49. package/dist/{plugin-context-CscLcXjH.cjs → plugin-context-BZs5lvDu.cjs} +2 -2
  50. package/dist/{plugin-context-DuSg-Hax.mjs → plugin-context-b5qVVQSU.mjs} +1 -1
  51. package/dist/{plugin-lifecycle-BywrEoWK.cjs → plugin-lifecycle-s89gzTlh.cjs} +1 -1
  52. package/dist/{registry-sJqDv0kE.d.mts → registry-B8pt41zj.d.cts} +1 -1
  53. package/dist/{registry-BbB6NqSv.d.cts → registry-BrrH2X9c.d.mts} +1 -1
  54. package/dist/routes-CzhKOw67.cjs +6 -0
  55. package/dist/{routes-C3_w9fLX.cjs → routes-Dq_2EUIB.cjs} +1 -1
  56. package/dist/routes-Dw6g0bfF.mjs +6 -0
  57. package/dist/search-dialog-BYZS9aeO.cjs +747 -0
  58. package/dist/{search-dialog-x_qHU8ty.cjs → search-dialog-CguKVtUu.cjs} +145 -5
  59. package/dist/{search-dialog-B9mdxsUC.js → search-dialog-DQwod5Xc.js} +1 -1
  60. package/dist/search-dialog-DzObE-Ar.js +717 -0
  61. package/dist/{search-dialog-DCtm2dyR.cjs → search-dialog-QgKRRbsI.cjs} +1 -1
  62. package/dist/{search-dialog-BqkzDTq2.js → search-dialog-mYnqU4v7.js} +134 -6
  63. package/dist/{types-Db6zToZH.d.mts → types-74i_xUe2.d.mts} +1 -1
  64. package/dist/{types-o7iZ2BAR.d.cts → types-X_Pwk8Cg.d.cts} +1 -1
  65. package/dist/virtual-modules-C3S3Nz8r.cjs +40 -0
  66. package/dist/virtual-modules-CaxqrFd6.mjs +40 -0
  67. package/package.json +6 -5
  68. package/dist/config-CrsQJHQz.cjs +0 -7
  69. package/dist/config-DC0nMMk7.mjs +0 -7
  70. package/dist/node-BljvHMpS.cjs +0 -23
  71. package/dist/node-CWxGw4H4.mjs +0 -23
  72. package/dist/plugin-BPcm1cU0.mjs +0 -69
  73. package/dist/plugin-WUhxnpko.cjs +0 -69
  74. package/dist/routes-C0kb4ue6.cjs +0 -6
  75. package/dist/routes-C4wrLWwu.mjs +0 -6
  76. package/dist/search-dialog-Bp_ouN1c.cjs +0 -550
  77. package/dist/search-dialog-an2BNMj6.js +0 -526
  78. package/dist/virtual-modules-B2X4Ht2r.mjs +0 -39
  79. package/dist/virtual-modules-DPsdHKcu.cjs +0 -39
@@ -3,4 +3,4 @@
3
3
  * Copyright (c) 2026 Jesus Alcala
4
4
  * Licensed under the MIT License.
5
5
  */
6
- import{t as e}from"./chunk-BFSpntXv.mjs";import{a as t,d as n,g as r,u as i}from"./utils-8lzafE49.mjs";import{n as a}from"./pages-external-BBw8ObVK.mjs";import{n as o}from"./config-DC0nMMk7.mjs";import{i as s,n as c,r as l,s as u,t as d}from"./update-check-BXD1atVv.mjs";import f from"node:path";import p from"node:fs";import{badge as m,colorize as h,colors as g,confirm as _,error as v,info as y,section as b,success as x,tasks as ee,warn as S}from"@bdocs/dui";import{fdir as C}from"fdir";import te from"picomatch";import{distance as w}from"fastest-levenshtein";const T={$schema:`https://boltdocs.vercel.app/schemas/doctor-config.schema.json`,checks:{metadata:{enabled:!0,titleMin:10,titleMax:60,descriptionMin:50,required:[`title`,`description`],optional:[],validateDates:!1},links:{internal:!0,external:!1,timeout:1e4,concurrency:10,ignore:[]},i18n:{enabled:!0},performance:{enabled:!0,budgets:{maxJSBundleSize:`200kb`,maxCSSBundleSize:`30kb`,maxPageHTMLSize:`80kb`,maxImagesKB:500,maxBuildTime:3e4,maxFontCount:3}}},fix:{confirmChanges:!1,backupFiles:!1,backupPath:`.boltdocs/backups`},reporting:{format:`pretty`,outputFile:`.boltdocs/reports/doctor.json`,failOnError:!1,maxWarnings:-1},severity:{missingTranslation:`warning`,brokenLink:`high`,brokenAnchor:`warning`,largeFile:`warning`,orphanedPage:`low`,duplicateTitle:`low`,shortMetadata:`low`,missingMetadata:`warning`,malformedFrontmatter:`high`,invalidFrontmatter:`high`,budgetExceeded:`warning`},exclude:[]};function E(e,t){if(e==null)return t;if(typeof e==`number`)return e;let n=e.toLowerCase().match(/^(\d+(?:\.\d+)?)\s*(b|kb|mb|gb)?$/);if(!n)return t;let r=Number.parseFloat(n[1]),i=n[2]||`b`;return Math.round(r*({b:1,kb:1024,mb:1024*1024,gb:1024*1024*1024}[i]||1))}function D(e,t,n){return e.doctorConfig.severity[t]||n}async function ne(e,t){p.existsSync(t)||p.mkdirSync(t,{recursive:!0});let n=f.basename(e),r=new Date().toISOString().replace(/[:.]/g,`-`),i=f.join(t,`${n}.${r}.bak`);p.copyFileSync(e,i)}const O=new Map;function k(e){let t=O.get(e);if(t)return t;let r=(async()=>{let t=await n(e,!1);return{raw:t.raw,data:t.data,content:t.content}})();return O.set(e,r),r}const A=new Map;function j(e){if(A.has(e))return A.get(e);let t=!1;try{t=p.existsSync(e)&&p.statSync(e).isFile()}catch{t=!1}return A.set(e,t),t}async function M(e){let t=f.resolve(e,`doctor.json`);if(p.existsSync(t))try{let e=JSON.parse(p.readFileSync(t,`utf-8`));return{...T,...e,checks:{...T.checks,...e.checks,metadata:{...T.checks.metadata,...e.checks?.metadata},links:{...T.checks.links,...e.checks?.links},i18n:{...T.checks.i18n,...e.checks?.i18n},performance:{...T.checks.performance,...e.checks?.performance,budgets:{...T.checks.performance?.budgets,...e.checks?.performance?.budgets}}},fix:{...T.fix,...e.fix},reporting:{...T.reporting,...e.reporting},severity:{...T.severity,...e.severity},exclude:[...T.exclude,...e.exclude||[]]}}catch(e){S(`Failed to parse doctor.json: ${e}`)}return T}async function N(e,n=process.cwd(),r,i){let o=f.resolve(n,`.boltdocs`,`generated`);p.existsSync(o)||p.mkdirSync(o,{recursive:!0});let s=i;s||=await new C().withFullPaths().filter(e=>e.endsWith(`.md`)||e.endsWith(`.mdx`)).crawl(e).withPromise();let c=r?.base||`/`,l=[];for(let n=0;n<s.length;n+=100){let r=s.slice(n,n+100),i=await Promise.all(r.map(async n=>{let r=f.isAbsolute(n)?n:f.resolve(e,n),i=f.relative(e,r),{data:a}=await k(r),o;return o=a.permalink?String(a.permalink).startsWith(`/`)?String(a.permalink):`/${a.permalink}`:t(i),c===`/`?o:(c.endsWith(`/`)?c:c+`/`)+(o.startsWith(`/`)?o.substring(1):o)}));l.push(...i)}l.includes(c)||l.push(c);let u=a(e,r);for(let e of u)l.includes(e)||l.push(e);let d={routes:Array.from(new Set(l)).sort(),timestamp:Date.now()};return p.writeFileSync(f.resolve(o,`link-tree.json`),JSON.stringify(d,null,2)),d}function P(e,t){if(e===t)return 1;if(!e||!t)return 0;let n=e.split(`/`).filter(Boolean),r=t.split(`/`).filter(Boolean),i=n[n.length-1]||``,a=r[r.length-1]||``;if(i===a){let e=0;for(let t of n)r.includes(t)&&e++;return e>=2?.99:.9}if(i.length>3&&a.length>3&&(a.startsWith(i)||i.startsWith(a))&&Math.min(i.length,a.length)/Math.max(i.length,a.length)>.5)return .88;let o=1-w(i,a)/Math.max(i.length,a.length);return o>.8?o*.95:1-w(e,t)/Math.max(e.length,t.length)}const F=new Map;function I(e,t){if(F.has(e))return F.get(e);let n=e.length,r=``,i=0;for(let a of t){if(a===e)continue;let t=a.length,o=Math.max(n,t);if(o===0)continue;let s=1-Math.abs(n-t)/o;if(s<=.8&&s<=i)continue;let c=P(e,a);c>i&&(i=c,r=a)}let a={bestMatch:r,similarity:i};return F.set(e,a),a}function L(e,t,n){let r=/```[\s\S]*?```/g,i=/`[^`\n]*`/g,a=0,o=[],s=t=>{e=e.replace(t,e=>(o.push(e),`__BD_CODE_MASK_${a++}__`))};return s(r),s(i),e.split(t).join(n).replace(/__BD_CODE_MASK_(\d+)__/g,(e,t)=>o[Number(t)]??``)}async function R(e){let t=[];if(!e.doctorConfig.checks.metadata.enabled)return t;let{titleMin:n,titleMax:a,descriptionMin:o}=e.doctorConfig.checks.metadata,s=new Map;for(let c of e.files){let l=i(f.relative(e.docsDir,c));try{let{raw:i,data:u}=await k(c);if(i.trim().startsWith(`---`)&&i.split(`---`).length>=3&&Object.keys(u).length===0){let n=D(e,`malformedFrontmatter`,`high`);n!==`off`&&t.push({file:l,level:n,message:`Malformed frontmatter (YAML parsing failed).`,suggestion:`Check your YAML syntax for indentation or unquoted special characters.`})}let d=r.safeParse(u);if(!d.success){let n=D(e,`invalidFrontmatter`,`high`);if(n!==`off`)for(let e of d.error.issues)t.push({file:l,level:n,message:`Invalid frontmatter field "${e.path.join(`.`)}": ${e.message}`,suggestion:`Ensure the field follows the correct type.`})}let f=Array.from(new Set([`title`,...e.doctorConfig.checks.metadata.required]));for(let n of f)if(u[n]===void 0){let r=D(e,`missingMetadata`,`warning`);r!==`off`&&t.push({file:l,level:r,message:`Missing required frontmatter field: "${n}".`,suggestion:`Add the "${n}" field to your frontmatter.`})}if(e.doctorConfig.checks.metadata.validateDates){let n=[`date`,`lastUpdated`,...e.doctorConfig.checks.metadata.optional.filter(e=>e.toLowerCase().includes(`date`))];for(let r of n)if(u[r]&&Number.isNaN(Date.parse(String(u[r])))){let n=D(e,`invalidFrontmatter`,`high`);n!==`off`&&t.push({file:l,level:n,message:`Invalid date format in field "${r}": "${u[r]}".`,suggestion:`Use a valid ISO date format (e.g., YYYY-MM-DD).`})}}if(u.title){let r=String(u.title);if(r.length<n){let i=D(e,`shortMetadata`,`low`);i!==`off`&&t.push({file:l,level:i,message:`Title is too short (${r.length} chars).`,suggestion:`Titles should be at least ${n} characters for better SEO.`})}else if(r.length>a){let n=D(e,`shortMetadata`,`low`);n!==`off`&&t.push({file:l,level:n,message:`Title is too long (${r.length} chars).`,suggestion:`Titles should be under ${a} characters.`})}let i=s.get(r)||[];i.push(l),s.set(r,i)}if(u.description&&String(u.description).length<o){let n=D(e,`shortMetadata`,`low`);n!==`off`&&t.push({file:l,level:n,message:`Description is very short.`,suggestion:`Descriptions should ideally be at least ${o} characters.`})}}catch(n){if(n instanceof Error){let r=D(e,`malformedFrontmatter`,`high`);r!==`off`&&t.push({file:l,level:r,message:`Malformed frontmatter (YAML error): ${n.message}`,suggestion:`Check your YAML syntax for indentation or unquoted special characters.`})}}}for(let[n,r]of s.entries())if(r.length>1){let i=D(e,`duplicateTitle`,`low`);if(i!==`off`)for(let e of r)t.push({file:e,level:i,message:`Duplicate title found: "${n}"`,suggestion:`Ensure each page has a unique title. Also used in: ${r.filter(t=>t!==e).join(`, `)}`})}return t}const z=/(?:\[([^\]]*)\]\(([^)\s]+)(?:\s+["'][^"']*["'])?\))|(?:href=["']([^"']+)["'])|(?:<Link\s+[^>]*?to=["'](\/[^"']+)["'])/g,B=[``,`.md`,`.mdx`,`/index.md`,`/index.mdx`];function V(e){let t=[],n=e=>{t.includes(e)||t.push(e)};n(e),e.endsWith(`/`)?n(e.slice(0,-1)):n(e+`/`);let r=e.replace(/\.(md|mdx)$/i,``);r!==e&&(n(r),n(r+`/`));let i=e.replace(/\/index\.(md|mdx)$/i,``);return i!==e&&(n(i),n(i+`/`)),n(e.endsWith(`/`)?e+`index`:e+`/index`),e.endsWith(`/index`)&&n(e.replace(/\/index$/,``)),t}async function H(e){let t=[],{internal:n,external:r,ignore:a,timeout:o,concurrency:s}=e.doctorConfig.checks.links;if(!n&&!r&&!e.options.checkExternal)return t;let c=new Set,l=5e5;for(let o of e.files){let s=i(f.relative(e.docsDir,o)),{content:u}=await k(o),d=[...(u.length>l?u.slice(0,l):u).replace(/<!--[\s\S]*?-->/g,``).replace(/```[\s\S]*?```/g,``).replace(/`[^`\n]*`/g,``).matchAll(z)];for(let i of d){let l=i[2]||i[3]||i[4],u=!!i[2],d=!!i[4];if(!l||a.some(e=>l.includes(e)))continue;if(/^(https?:|mailto:|tel:|data:|javascript:|blob:|ftp:)/i.test(l)){(r||e.options.checkExternal)&&c.add({url:l,file:o});continue}if(l.startsWith(`//`)){(r||e.options.checkExternal)&&c.add({url:l,file:o});continue}if(!n||l.startsWith(`#`))continue;let m;try{m=decodeURIComponent(l.split(`#`)[0].split(`?`)[0])}catch{m=l.split(`#`)[0].split(`?`)[0]}if(!m)continue;let h=!1,g=!1,_=``;if(m.startsWith(`/`)){let t=V(m);for(let n of t)if(e.routeIndex.has(n)||e.routeIndexWithSlash.has(n)||e.routeIndexWithoutSlash.has(n)){h=!0;break}if(!h&&e.basePrefix)for(let n of t){let t=e.basePrefix+(n.startsWith(`/`)?n:`/`+n);if(t!==n&&(e.routeIndex.has(t)||e.routeIndexWithSlash.has(t))){g=!0,_=t;break}}if(!h&&!g){let t=m.replace(/^\/+/,``),n=f.join(e.docsDir,t);h=B.some(e=>j(n+e))}}else{let e=f.resolve(f.dirname(o),m);h=B.some(t=>j(e+t))}if(!h){let{bestMatch:n,similarity:r}=I(m,e.linkTree.routes);g&&(n=_,r=1);let i=r>.6||g,a=r>.75&&n!==m||g,c=D(e,`brokenLink`,`high`);c!==`off`&&t.push({file:s,level:c,message:`Broken internal link: "${l}"`,suggestion:i?`Did you mean "${n}"?`:`Ensure the target exists or check for typos.`,fix:a?async()=>{let e=l.includes(`#`)?`#`+l.split(`#`)[1]:``,t=u?`(${l})`:d?`to="${l}"`:`href="${l}"`,r=u?`(${n}${e})`:d?`to="${n}${e}"`:`href="${n}${e}"`,i=L(p.readFileSync(o,`utf-8`),t,r);p.writeFileSync(o,i),O.delete(o)}:void 0})}}}if(c.size>0){y(g.gray(`Verifying ${c.size} external links...`));let n=new Map;for(let e of c)n.has(e.url)||n.set(e.url,[]),n.get(e.url).push(e.file);let r=async e=>{try{let t=new AbortController,n=setTimeout(()=>t.abort(),o),r=await fetch(e,{method:`HEAD`,signal:t.signal,headers:{"User-Agent":`boltdocs-doctor/1.0`}});return clearTimeout(n),!r.ok&&r.status!==404?{url:e,ok:(await fetch(e,{method:`GET`,signal:t.signal,headers:{"User-Agent":`boltdocs-doctor/1.0`}})).ok}:{url:e,ok:r.ok}}catch(t){return{url:e,ok:!1,error:t instanceof Error?t.message:String(t)}}},a=Array.from(n.keys()),l=[];for(let e=0;e<a.length;e+=s){let t=a.slice(e,e+s),n=await Promise.allSettled(t.map(r));l.push(...n.map(e=>e.status===`fulfilled`?e.value:{url:`unknown`,ok:!1,error:String(e.reason)}))}for(let r of l)if(!r.ok){let a=D(e,`brokenLink`,`warning`);if(a!==`off`){let o=n.get(r.url)||[];for(let n of o)t.push({file:i(f.relative(e.docsDir,n)),level:a,message:`Broken external link: "${r.url}"`,suggestion:`Verify the URL or update it if it's permanently down. Error: ${r.error||`Status >= 400`}`})}}}return t}async function U(e){let t=[];if(!e.doctorConfig.checks.i18n.enabled||!e.config.i18n)return t;let{defaultLocale:n,locales:r}=e.config.i18n,a=Object.keys(r),o=a.filter(e=>e!==n);if(o.length===0)return t;let s=f.resolve(e.docsDir),c=f.join(s,n),l=p.existsSync(c)&&p.statSync(c).isDirectory(),u=e=>{let t=f.resolve(e);if(t!==s&&!t.startsWith(s+f.sep))throw Error(`Refusing to write outside docs dir: ${t}`);return t};for(let r of e.files){let d=i(f.relative(e.docsDir,r)),m=d.split(`/`),h=m[0],g,_;if(a.includes(h)&&h!==n?(g=h,_=m.slice(1).join(`/`)):h===n&&l?(g=n,_=m.slice(1).join(`/`)):(g=n,_=d),_)if(g===n)for(let n of o){let i=f.join(s,n,_);if(!j(i)){let a=D(e,`missingTranslation`,`warning`);a!==`off`&&t.push({file:d,level:a,message:`Missing translation for locale "${n}"`,suggestion:`Create a version at "${n}/${_}".`,fix:async()=>{let e=u(i),t=f.dirname(e);p.existsSync(t)||p.mkdirSync(t,{recursive:!0}),p.copyFileSync(r,e)}})}}else{let i=f.join(s,_),a=l?f.join(c,_):``;if(!(j(i)||a!==``&&j(a))){let i=D(e,`missingTranslation`,`low`);i!==`off`&&t.push({file:d,level:i,message:`Orphaned translation (source missing in "${n}")`,suggestion:`Remove this file or create the source at "${n}/${_}".`,fix:async()=>{p.unlinkSync(u(r))}})}}}return t}async function W(e){let t=[];if(!e.config.theme?.sidebar)return t;let n=new Set,r=e.config.theme.sidebar;for(let[i,a]of Object.entries(r))for(let r of a){if(!r.text){let n=D(e,`invalidFrontmatter`,`warning`);n!==`off`&&t.push({file:`boltdocs.config.ts`,level:n,message:`Sidebar item in group "${i}" is missing a label.`,suggestion:`Add a "text" property to the sidebar item.`})}if(r.link&&(n.add(r.link),!e.routeIndex.has(r.link))){let{bestMatch:n,similarity:i}=I(r.link,e.linkTree.routes),a=i>.6,o=D(e,`brokenLink`,`high`);o!==`off`&&t.push({file:`boltdocs.config.ts`,level:o,message:`Broken sidebar link: "${r.link}"`,suggestion:a?`Did you mean "${n}"?`:`Ensure the route exists and is correctly formatted.`})}}for(let r of e.linkTree.routes)if(!(r===`/`||r===``)&&!n.has(r)){let n=D(e,`orphanedPage`,`low`);n!==`off`&&t.push({file:`Sidebar`,level:n,message:`Orphaned page found: "${r}" is not linked in the sidebar.`,suggestion:`Consider adding it to the sidebar for better discoverability.`})}return t}async function G(e){let t=[],n=e.doctorConfig.checks.performance;if(!n?.enabled)return t;let r=f.resolve(e.root,`.boltdocs`,`reports`,`performance.json`);if(!p.existsSync(r))return t.push({file:`(build)`,level:D(e,`budgetExceeded`,`warning`)??`warning`,message:"Performance metrics not found. Run `boltdocs build` first."}),t;let i;try{i=JSON.parse(p.readFileSync(r,`utf-8`))}catch{return t.push({file:`(build)`,level:D(e,`budgetExceeded`,`warning`)??`warning`,message:`Failed to parse performance metrics file.`}),t}let a=n.budgets,o=D(e,`budgetExceeded`,`warning`),s=E(a?.maxJSBundleSize,1/0),c=E(a?.maxCSSBundleSize,1/0),l=E(a?.maxPageHTMLSize,1/0),u=a?.maxImagesKB??1/0,d=a?.maxBuildTime??1/0,m=a?.maxFontCount??1/0;if(s!==1/0&&i.totalJSBundleSize>s){let e=(i.totalJSBundleSize/1024).toFixed(0),n=(s/1024).toFixed(0);t.push({file:`(build)`,level:o,message:`JS bundle size exceeds budget: ${e}kb > ${n}kb`,suggestion:`Code-split large dependencies or lazy-load route components.`})}if(c!==1/0&&i.totalCSSBundleSize>c){let e=(i.totalCSSBundleSize/1024).toFixed(0),n=(c/1024).toFixed(0);t.push({file:`(build)`,level:o,message:`CSS bundle size exceeds budget: ${e}kb > ${n}kb`,suggestion:`Remove unused styles or split CSS by route.`})}if(l!==1/0){for(let e of i.pages)if(e.htmlSize>l){let n=(e.htmlSize/1024).toFixed(0),r=(l/1024).toFixed(0);t.push({file:e.route,level:o,message:`Page HTML size exceeds budget: ${n}kb > ${r}kb`,suggestion:`Reduce the amount of inline content or split into sub-pages.`})}}let h=u*1024;if(u!==1/0&&i.totalImagesSize>h){let e=(i.totalImagesSize/1024).toFixed(0);t.push({file:`(build)`,level:o,message:`Image assets exceed budget: ${e}kb > ${u}kb`,suggestion:`Optimize images with lossy compression or use next-gen formats (webp/avif).`})}if(d!==1/0&&i.buildTime>d){let e=(i.buildTime/1e3).toFixed(1),n=(d/1e3).toFixed(1);t.push({file:`(build)`,level:o,message:`Build time exceeds budget: ${e}s > ${n}s`,suggestion:"Check for large unoptimized assets or increase `concurrency` in SSG options."})}return m!==1/0&&i.fontCount>m&&t.push({file:`(build)`,level:o,message:`Font files exceed budget: ${i.fontCount} > ${m}`,suggestion:`Reduce the number of font families or use variable fonts.`}),t}var K=e({DEFAULT_DOCTOR_CONFIG:()=>T,checkI18n:()=>U,checkLinks:()=>H,checkMetadata:()=>R,checkPerformance:()=>G,checkSidebar:()=>W,doctorAction:()=>J,doctorInit:()=>q,generateLinkTree:()=>N,loadDoctorConfig:()=>M});async function q(e){let t=f.resolve(e,`doctor.json`);if(p.existsSync(t)){S(`"doctor.json" already exists at ${e}.`);return}try{p.writeFileSync(t,JSON.stringify(T,null,2)),x(`Created "doctor.json" with default configuration.`)}catch(e){v(`Failed to create "doctor.json": ${e}`)}}async function J(e=process.cwd(),t={}){if(t.init){await q(e);return}d();try{let n=await M(e),{format:r}=n.reporting,i=performance.now(),a=await o(`docs`,e),d=f.resolve(e,`docs`);if(p.existsSync(d)||(r===`pretty`&&v(`Docs dir not found at ${d}`),process.exit(1)),r===`pretty`){let t=c?` ${s(`v${c}`)}`:``;console.log(`\n ${g.bold(`⚡`)} ${u(`boltdocs`)}${t} ${g.dim(`—`)} ${g.bold(`doctor`)} ${g.dim(`· documentation health check`)}\n`),console.log(` ${g.dim(`Docs dir ${d}`)}\n ${g.dim(`Reports ${e}/.boltdocs/reports/`)}\n`)}r===`pretty`&&y(g.dim(`🔍 Discovering files and routes...`));let S=te(n.exclude||[]),w=await new C().withFullPaths().filter(e=>{if(!(e.endsWith(`.md`)||e.endsWith(`.mdx`)))return!1;let t=f.relative(d,e).replace(/\\/g,`/`),n=t.split(`/`).some(e=>e.startsWith(`_`)&&e!==`_index.md`&&e!==`_index.mdx`);return!S(t)&&!n}).crawl(d).withPromise();for(let e of w)A.set(e,!0);let T=await N(d,e,a,w),E=a.base||`/`,D=E===`/`?``:E.endsWith(`/`)?E.slice(0,-1):E,O=new Set(T.routes),k=new Set(T.routes.map(e=>e.endsWith(`/`)?e:e+`/`)),j=new Set(T.routes.map(e=>e.endsWith(`/`)?e.slice(0,-1):e));r===`pretty`&&y(g.dim(`🧪 Running diagnostic checks in parallel...`));let P={root:e,docsDir:d,config:a,doctorConfig:n,linkTree:T,files:w,options:t,routeIndex:O,routeIndexWithSlash:k,routeIndexWithoutSlash:j,basePrefix:D};r===`pretty`&&y(g.dim(`🧪 Running diagnostic checks in parallel...`));let F=[R(P),H(P),U(P),W(P)];t.budget&&F.push(G(P));let[I,L,z,B,...V]=await Promise.all(F),K=t.budget?V[0]??[]:[],q=[...I,...L,...z,...B,...K];if(r===`pretty`){let e=e=>e>0?g.red(`${e} issue${e===1?``:`s`}`):g.green(`OK`),n=[{label:`Metadata checks ${e(I.length)}`,done:I.length===0},{label:`Link checks ${e(L.length)}`,done:L.length===0},{label:`i18n checks ${e(z.length)}`,done:z.length===0},{label:`Sidebar checks ${e(B.length)}`,done:B.length===0}];t.budget&&n.push({label:`Performance budget ${e(K.length)}`,done:K.length===0}),console.log(`\n${ee(n)}\n`)}let J=0;if(t.fix){for(let e of q)if(e.fix){if(P.doctorConfig.fix.confirmChanges&&!await _(`Fix issue in "${e.file}": ${e.message}?`))continue;if(P.doctorConfig.fix.backupFiles){let t=f.resolve(P.docsDir,e.file);p.existsSync(t)&&await ne(t,f.resolve(P.root,P.doctorConfig.fix.backupPath))}await e.fix(),J++}}let Y=((performance.now()-i)/1e3).toFixed(2),X=q.filter(e=>e.level===`high`).length,Z=q.filter(e=>e.level===`warning`).length,Q=q.filter(e=>e.level===`low`).length,$={summary:{total:q.length,high:X,warning:Z,low:Q,fixed:J,duration:Y},issues:q.map(e=>({...e,fix:void 0}))};if(n.reporting.outputFile){let t=f.resolve(e,n.reporting.outputFile);p.existsSync(f.dirname(t))||p.mkdirSync(f.dirname(t),{recursive:!0}),p.writeFileSync(t,JSON.stringify($,null,2))}if(r===`json`)console.log(JSON.stringify($,null,2));else if(r===`pretty`){let e=q.reduce((e,t)=>(e[t.file]||(e[t.file]=[]),e[t.file].push(t),e),{});if(q.length>0){console.log(b({title:`Issues`,colors:{title:l}}));for(let[n,r]of Object.entries(e)){let e=r.some(e=>e.level===`high`)?`high`:r.some(e=>e.level===`warning`)?`warning`:`low`,i=e.toUpperCase(),a=m(e===`high`?{label:i,status:`error`}:e===`warning`?{label:i,status:`warning`}:{label:i,colors:{text:`#ffffff`,bg:l}});console.log(`\n ${a} ${g.bold(n)}`);for(let e of r){let n=e.level===`high`?`✖`:e.level===`warning`?`⚠`:`ℹ`,r=e.level===`high`?g.red:e.level===`warning`?g.yellow:e=>h(e,l,`fg`);console.log(` ${r(n)} ${e.message}`),e.suggestion&&console.log(` ${g.dim(`💡 ${e.suggestion}`)}`),t.fix&&e.fix&&console.log(` ${g.green(`✅ Fixed automatically`)}`)}}console.log(``)}q.length===0?(console.log(` ${g.green.bold(`✨ Everything looks perfect!`)} ${g.dim(`— your documentation is in great shape.`)}`),console.log(` ${g.dim(`Scanned ${w.length} file${w.length===1?``:`s`} in ${Y}s`)}`)):(console.log(`\n${b({title:`Summary`,colors:{title:l}})}`),X>0&&console.log(` ${m({label:String(X),status:`error`})} ${g.bold(`high`)}`),Z>0&&console.log(` ${m({label:String(Z),status:`warning`})} ${g.bold(`warning`)}${Z===1?``:`s`}`),Q>0&&console.log(` ${m({label:String(Q),colors:{text:`#ffffff`,bg:l}})} ${g.bold(`low`)}`),console.log(` ${g.dim(`Scanned ${w.length} file${w.length===1?``:`s`} in ${Y}s`)}`),J>0&&x(`Successfully fixed ${J} issues automatically!`),X>0?v(`Please fix the critical errors before building for production.`):x(`No critical issues found. You are ready to go!`))}n.reporting.failOnError&&X>0&&process.exit(1),n.reporting.maxWarnings!==-1&&Z>n.reporting.maxWarnings&&(r===`pretty`&&v(`Failed: Too many warnings (${Z} > ${n.reporting.maxWarnings})`),process.exit(1))}catch(e){v(`Doctor failed: ${e}`),process.exit(1)}}export{N as n,K as t};
6
+ import{t as e}from"./chunk-BFSpntXv.mjs";import{a as t,d as n,g as r,u as i}from"./utils-8lzafE49.mjs";import{n as a}from"./pages-external-BBw8ObVK.mjs";import{n as o}from"./config-B3_iVsbi.mjs";import{i as s,n as c,r as l,s as u,t as d}from"./update-check-BXD1atVv.mjs";import f from"node:path";import p from"node:fs";import{badge as m,colorize as h,colors as g,confirm as _,error as v,info as y,section as b,success as x,tasks as ee,warn as S}from"@bdocs/dui";import{fdir as C}from"fdir";import te from"picomatch";import{distance as w}from"fastest-levenshtein";const T={$schema:`https://boltdocs.vercel.app/schemas/doctor-config.schema.json`,checks:{metadata:{enabled:!0,titleMin:10,titleMax:60,descriptionMin:50,required:[`title`,`description`],optional:[],validateDates:!1},links:{internal:!0,external:!1,timeout:1e4,concurrency:10,ignore:[]},i18n:{enabled:!0},performance:{enabled:!0,budgets:{maxJSBundleSize:`200kb`,maxCSSBundleSize:`30kb`,maxPageHTMLSize:`80kb`,maxImagesKB:500,maxBuildTime:3e4,maxFontCount:3}}},fix:{confirmChanges:!1,backupFiles:!1,backupPath:`.boltdocs/backups`},reporting:{format:`pretty`,outputFile:`.boltdocs/reports/doctor.json`,failOnError:!1,maxWarnings:-1},severity:{missingTranslation:`warning`,brokenLink:`high`,brokenAnchor:`warning`,largeFile:`warning`,orphanedPage:`low`,duplicateTitle:`low`,shortMetadata:`low`,missingMetadata:`warning`,malformedFrontmatter:`high`,invalidFrontmatter:`high`,budgetExceeded:`warning`},exclude:[]};function E(e,t){if(e==null)return t;if(typeof e==`number`)return e;let n=e.toLowerCase().match(/^(\d+(?:\.\d+)?)\s*(b|kb|mb|gb)?$/);if(!n)return t;let r=Number.parseFloat(n[1]),i=n[2]||`b`;return Math.round(r*({b:1,kb:1024,mb:1024*1024,gb:1024*1024*1024}[i]||1))}function D(e,t,n){return e.doctorConfig.severity[t]||n}async function ne(e,t){p.existsSync(t)||p.mkdirSync(t,{recursive:!0});let n=f.basename(e),r=new Date().toISOString().replace(/[:.]/g,`-`),i=f.join(t,`${n}.${r}.bak`);p.copyFileSync(e,i)}const O=new Map;function k(e){let t=O.get(e);if(t)return t;let r=(async()=>{let t=await n(e,!1);return{raw:t.raw,data:t.data,content:t.content}})();return O.set(e,r),r}const A=new Map;function j(e){if(A.has(e))return A.get(e);let t=!1;try{t=p.existsSync(e)&&p.statSync(e).isFile()}catch{t=!1}return A.set(e,t),t}async function M(e){let t=f.resolve(e,`doctor.json`);if(p.existsSync(t))try{let e=JSON.parse(p.readFileSync(t,`utf-8`));return{...T,...e,checks:{...T.checks,...e.checks,metadata:{...T.checks.metadata,...e.checks?.metadata},links:{...T.checks.links,...e.checks?.links},i18n:{...T.checks.i18n,...e.checks?.i18n},performance:{...T.checks.performance,...e.checks?.performance,budgets:{...T.checks.performance?.budgets,...e.checks?.performance?.budgets}}},fix:{...T.fix,...e.fix},reporting:{...T.reporting,...e.reporting},severity:{...T.severity,...e.severity},exclude:[...T.exclude,...e.exclude||[]]}}catch(e){S(`Failed to parse doctor.json: ${e}`)}return T}async function N(e,n=process.cwd(),r,i){let o=f.resolve(n,`.boltdocs`,`generated`);p.existsSync(o)||p.mkdirSync(o,{recursive:!0});let s=i;s||=await new C().withFullPaths().filter(e=>e.endsWith(`.md`)||e.endsWith(`.mdx`)).crawl(e).withPromise();let c=r?.base||`/`,l=[];for(let n=0;n<s.length;n+=100){let r=s.slice(n,n+100),i=await Promise.all(r.map(async n=>{let r=f.isAbsolute(n)?n:f.resolve(e,n),i=f.relative(e,r),{data:a}=await k(r),o;return o=a.permalink?String(a.permalink).startsWith(`/`)?String(a.permalink):`/${a.permalink}`:t(i),c===`/`?o:(c.endsWith(`/`)?c:c+`/`)+(o.startsWith(`/`)?o.substring(1):o)}));l.push(...i)}l.includes(c)||l.push(c);let u=a(e,r);for(let e of u)l.includes(e)||l.push(e);let d={routes:Array.from(new Set(l)).sort(),timestamp:Date.now()};return p.writeFileSync(f.resolve(o,`link-tree.json`),JSON.stringify(d,null,2)),d}function P(e,t){if(e===t)return 1;if(!e||!t)return 0;let n=e.split(`/`).filter(Boolean),r=t.split(`/`).filter(Boolean),i=n[n.length-1]||``,a=r[r.length-1]||``;if(i===a){let e=0;for(let t of n)r.includes(t)&&e++;return e>=2?.99:.9}if(i.length>3&&a.length>3&&(a.startsWith(i)||i.startsWith(a))&&Math.min(i.length,a.length)/Math.max(i.length,a.length)>.5)return .88;let o=1-w(i,a)/Math.max(i.length,a.length);return o>.8?o*.95:1-w(e,t)/Math.max(e.length,t.length)}const F=new Map;function I(e,t){if(F.has(e))return F.get(e);let n=e.length,r=``,i=0;for(let a of t){if(a===e)continue;let t=a.length,o=Math.max(n,t);if(o===0)continue;let s=1-Math.abs(n-t)/o;if(s<=.8&&s<=i)continue;let c=P(e,a);c>i&&(i=c,r=a)}let a={bestMatch:r,similarity:i};return F.set(e,a),a}function L(e,t,n){let r=/```[\s\S]*?```/g,i=/`[^`\n]*`/g,a=0,o=[],s=t=>{e=e.replace(t,e=>(o.push(e),`__BD_CODE_MASK_${a++}__`))};return s(r),s(i),e.split(t).join(n).replace(/__BD_CODE_MASK_(\d+)__/g,(e,t)=>o[Number(t)]??``)}async function R(e){let t=[];if(!e.doctorConfig.checks.metadata.enabled)return t;let{titleMin:n,titleMax:a,descriptionMin:o}=e.doctorConfig.checks.metadata,s=new Map;for(let c of e.files){let l=i(f.relative(e.docsDir,c));try{let{raw:i,data:u}=await k(c);if(i.trim().startsWith(`---`)&&i.split(`---`).length>=3&&Object.keys(u).length===0){let n=D(e,`malformedFrontmatter`,`high`);n!==`off`&&t.push({file:l,level:n,message:`Malformed frontmatter (YAML parsing failed).`,suggestion:`Check your YAML syntax for indentation or unquoted special characters.`})}let d=r.safeParse(u);if(!d.success){let n=D(e,`invalidFrontmatter`,`high`);if(n!==`off`)for(let e of d.error.issues)t.push({file:l,level:n,message:`Invalid frontmatter field "${e.path.join(`.`)}": ${e.message}`,suggestion:`Ensure the field follows the correct type.`})}let f=Array.from(new Set([`title`,...e.doctorConfig.checks.metadata.required]));for(let n of f)if(u[n]===void 0){let r=D(e,`missingMetadata`,`warning`);r!==`off`&&t.push({file:l,level:r,message:`Missing required frontmatter field: "${n}".`,suggestion:`Add the "${n}" field to your frontmatter.`})}if(e.doctorConfig.checks.metadata.validateDates){let n=[`date`,`lastUpdated`,...e.doctorConfig.checks.metadata.optional.filter(e=>e.toLowerCase().includes(`date`))];for(let r of n)if(u[r]&&Number.isNaN(Date.parse(String(u[r])))){let n=D(e,`invalidFrontmatter`,`high`);n!==`off`&&t.push({file:l,level:n,message:`Invalid date format in field "${r}": "${u[r]}".`,suggestion:`Use a valid ISO date format (e.g., YYYY-MM-DD).`})}}if(u.title){let r=String(u.title);if(r.length<n){let i=D(e,`shortMetadata`,`low`);i!==`off`&&t.push({file:l,level:i,message:`Title is too short (${r.length} chars).`,suggestion:`Titles should be at least ${n} characters for better SEO.`})}else if(r.length>a){let n=D(e,`shortMetadata`,`low`);n!==`off`&&t.push({file:l,level:n,message:`Title is too long (${r.length} chars).`,suggestion:`Titles should be under ${a} characters.`})}let i=s.get(r)||[];i.push(l),s.set(r,i)}if(u.description&&String(u.description).length<o){let n=D(e,`shortMetadata`,`low`);n!==`off`&&t.push({file:l,level:n,message:`Description is very short.`,suggestion:`Descriptions should ideally be at least ${o} characters.`})}}catch(n){if(n instanceof Error){let r=D(e,`malformedFrontmatter`,`high`);r!==`off`&&t.push({file:l,level:r,message:`Malformed frontmatter (YAML error): ${n.message}`,suggestion:`Check your YAML syntax for indentation or unquoted special characters.`})}}}for(let[n,r]of s.entries())if(r.length>1){let i=D(e,`duplicateTitle`,`low`);if(i!==`off`)for(let e of r)t.push({file:e,level:i,message:`Duplicate title found: "${n}"`,suggestion:`Ensure each page has a unique title. Also used in: ${r.filter(t=>t!==e).join(`, `)}`})}return t}const z=/(?:\[([^\]]*)\]\(([^)\s]+)(?:\s+["'][^"']*["'])?\))|(?:href=["']([^"']+)["'])|(?:<Link\s+[^>]*?to=["'](\/[^"']+)["'])/g,B=[``,`.md`,`.mdx`,`/index.md`,`/index.mdx`];function V(e){let t=[],n=e=>{t.includes(e)||t.push(e)};n(e),e.endsWith(`/`)?n(e.slice(0,-1)):n(e+`/`);let r=e.replace(/\.(md|mdx)$/i,``);r!==e&&(n(r),n(r+`/`));let i=e.replace(/\/index\.(md|mdx)$/i,``);return i!==e&&(n(i),n(i+`/`)),n(e.endsWith(`/`)?e+`index`:e+`/index`),e.endsWith(`/index`)&&n(e.replace(/\/index$/,``)),t}async function H(e){let t=[],{internal:n,external:r,ignore:a,timeout:o,concurrency:s}=e.doctorConfig.checks.links;if(!n&&!r&&!e.options.checkExternal)return t;let c=new Set,l=5e5;for(let o of e.files){let s=i(f.relative(e.docsDir,o)),{content:u}=await k(o),d=[...(u.length>l?u.slice(0,l):u).replace(/<!--[\s\S]*?-->/g,``).replace(/```[\s\S]*?```/g,``).replace(/`[^`\n]*`/g,``).matchAll(z)];for(let i of d){let l=i[2]||i[3]||i[4],u=!!i[2],d=!!i[4];if(!l||a.some(e=>l.includes(e)))continue;if(/^(https?:|mailto:|tel:|data:|javascript:|blob:|ftp:)/i.test(l)){(r||e.options.checkExternal)&&c.add({url:l,file:o});continue}if(l.startsWith(`//`)){(r||e.options.checkExternal)&&c.add({url:l,file:o});continue}if(!n||l.startsWith(`#`))continue;let m;try{m=decodeURIComponent(l.split(`#`)[0].split(`?`)[0])}catch{m=l.split(`#`)[0].split(`?`)[0]}if(!m)continue;let h=!1,g=!1,_=``;if(m.startsWith(`/`)){let t=V(m);for(let n of t)if(e.routeIndex.has(n)||e.routeIndexWithSlash.has(n)||e.routeIndexWithoutSlash.has(n)){h=!0;break}if(!h&&e.basePrefix)for(let n of t){let t=e.basePrefix+(n.startsWith(`/`)?n:`/`+n);if(t!==n&&(e.routeIndex.has(t)||e.routeIndexWithSlash.has(t))){g=!0,_=t;break}}if(!h&&!g){let t=m.replace(/^\/+/,``),n=f.join(e.docsDir,t);h=B.some(e=>j(n+e))}}else{let e=f.resolve(f.dirname(o),m);h=B.some(t=>j(e+t))}if(!h){let{bestMatch:n,similarity:r}=I(m,e.linkTree.routes);g&&(n=_,r=1);let i=r>.6||g,a=r>.75&&n!==m||g,c=D(e,`brokenLink`,`high`);c!==`off`&&t.push({file:s,level:c,message:`Broken internal link: "${l}"`,suggestion:i?`Did you mean "${n}"?`:`Ensure the target exists or check for typos.`,fix:a?async()=>{let e=l.includes(`#`)?`#`+l.split(`#`)[1]:``,t=u?`(${l})`:d?`to="${l}"`:`href="${l}"`,r=u?`(${n}${e})`:d?`to="${n}${e}"`:`href="${n}${e}"`,i=L(p.readFileSync(o,`utf-8`),t,r);p.writeFileSync(o,i),O.delete(o)}:void 0})}}}if(c.size>0){y(g.gray(`Verifying ${c.size} external links...`));let n=new Map;for(let e of c)n.has(e.url)||n.set(e.url,[]),n.get(e.url).push(e.file);let r=async e=>{try{let t=new AbortController,n=setTimeout(()=>t.abort(),o),r=await fetch(e,{method:`HEAD`,signal:t.signal,headers:{"User-Agent":`boltdocs-doctor/1.0`}});return clearTimeout(n),!r.ok&&r.status!==404?{url:e,ok:(await fetch(e,{method:`GET`,signal:t.signal,headers:{"User-Agent":`boltdocs-doctor/1.0`}})).ok}:{url:e,ok:r.ok}}catch(t){return{url:e,ok:!1,error:t instanceof Error?t.message:String(t)}}},a=Array.from(n.keys()),l=[];for(let e=0;e<a.length;e+=s){let t=a.slice(e,e+s),n=await Promise.allSettled(t.map(r));l.push(...n.map(e=>e.status===`fulfilled`?e.value:{url:`unknown`,ok:!1,error:String(e.reason)}))}for(let r of l)if(!r.ok){let a=D(e,`brokenLink`,`warning`);if(a!==`off`){let o=n.get(r.url)||[];for(let n of o)t.push({file:i(f.relative(e.docsDir,n)),level:a,message:`Broken external link: "${r.url}"`,suggestion:`Verify the URL or update it if it's permanently down. Error: ${r.error||`Status >= 400`}`})}}}return t}async function U(e){let t=[];if(!e.doctorConfig.checks.i18n.enabled||!e.config.i18n)return t;let{defaultLocale:n,locales:r}=e.config.i18n,a=Object.keys(r),o=a.filter(e=>e!==n);if(o.length===0)return t;let s=f.resolve(e.docsDir),c=f.join(s,n),l=p.existsSync(c)&&p.statSync(c).isDirectory(),u=e=>{let t=f.resolve(e);if(t!==s&&!t.startsWith(s+f.sep))throw Error(`Refusing to write outside docs dir: ${t}`);return t};for(let r of e.files){let d=i(f.relative(e.docsDir,r)),m=d.split(`/`),h=m[0],g,_;if(a.includes(h)&&h!==n?(g=h,_=m.slice(1).join(`/`)):h===n&&l?(g=n,_=m.slice(1).join(`/`)):(g=n,_=d),_)if(g===n)for(let n of o){let i=f.join(s,n,_);if(!j(i)){let a=D(e,`missingTranslation`,`warning`);a!==`off`&&t.push({file:d,level:a,message:`Missing translation for locale "${n}"`,suggestion:`Create a version at "${n}/${_}".`,fix:async()=>{let e=u(i),t=f.dirname(e);p.existsSync(t)||p.mkdirSync(t,{recursive:!0}),p.copyFileSync(r,e)}})}}else{let i=f.join(s,_),a=l?f.join(c,_):``;if(!(j(i)||a!==``&&j(a))){let i=D(e,`missingTranslation`,`low`);i!==`off`&&t.push({file:d,level:i,message:`Orphaned translation (source missing in "${n}")`,suggestion:`Remove this file or create the source at "${n}/${_}".`,fix:async()=>{p.unlinkSync(u(r))}})}}}return t}async function W(e){let t=[];if(!e.config.theme?.sidebar)return t;let n=new Set,r=e.config.theme.sidebar;for(let[i,a]of Object.entries(r))for(let r of a){if(!r.text){let n=D(e,`invalidFrontmatter`,`warning`);n!==`off`&&t.push({file:`boltdocs.config.ts`,level:n,message:`Sidebar item in group "${i}" is missing a label.`,suggestion:`Add a "text" property to the sidebar item.`})}if(r.link&&(n.add(r.link),!e.routeIndex.has(r.link))){let{bestMatch:n,similarity:i}=I(r.link,e.linkTree.routes),a=i>.6,o=D(e,`brokenLink`,`high`);o!==`off`&&t.push({file:`boltdocs.config.ts`,level:o,message:`Broken sidebar link: "${r.link}"`,suggestion:a?`Did you mean "${n}"?`:`Ensure the route exists and is correctly formatted.`})}}for(let r of e.linkTree.routes)if(!(r===`/`||r===``)&&!n.has(r)){let n=D(e,`orphanedPage`,`low`);n!==`off`&&t.push({file:`Sidebar`,level:n,message:`Orphaned page found: "${r}" is not linked in the sidebar.`,suggestion:`Consider adding it to the sidebar for better discoverability.`})}return t}async function G(e){let t=[],n=e.doctorConfig.checks.performance;if(!n?.enabled)return t;let r=f.resolve(e.root,`.boltdocs`,`reports`,`performance.json`);if(!p.existsSync(r))return t.push({file:`(build)`,level:D(e,`budgetExceeded`,`warning`)??`warning`,message:"Performance metrics not found. Run `boltdocs build` first."}),t;let i;try{i=JSON.parse(p.readFileSync(r,`utf-8`))}catch{return t.push({file:`(build)`,level:D(e,`budgetExceeded`,`warning`)??`warning`,message:`Failed to parse performance metrics file.`}),t}let a=n.budgets,o=D(e,`budgetExceeded`,`warning`),s=E(a?.maxJSBundleSize,1/0),c=E(a?.maxCSSBundleSize,1/0),l=E(a?.maxPageHTMLSize,1/0),u=a?.maxImagesKB??1/0,d=a?.maxBuildTime??1/0,m=a?.maxFontCount??1/0;if(s!==1/0&&i.totalJSBundleSize>s){let e=(i.totalJSBundleSize/1024).toFixed(0),n=(s/1024).toFixed(0);t.push({file:`(build)`,level:o,message:`JS bundle size exceeds budget: ${e}kb > ${n}kb`,suggestion:`Code-split large dependencies or lazy-load route components.`})}if(c!==1/0&&i.totalCSSBundleSize>c){let e=(i.totalCSSBundleSize/1024).toFixed(0),n=(c/1024).toFixed(0);t.push({file:`(build)`,level:o,message:`CSS bundle size exceeds budget: ${e}kb > ${n}kb`,suggestion:`Remove unused styles or split CSS by route.`})}if(l!==1/0){for(let e of i.pages)if(e.htmlSize>l){let n=(e.htmlSize/1024).toFixed(0),r=(l/1024).toFixed(0);t.push({file:e.route,level:o,message:`Page HTML size exceeds budget: ${n}kb > ${r}kb`,suggestion:`Reduce the amount of inline content or split into sub-pages.`})}}let h=u*1024;if(u!==1/0&&i.totalImagesSize>h){let e=(i.totalImagesSize/1024).toFixed(0);t.push({file:`(build)`,level:o,message:`Image assets exceed budget: ${e}kb > ${u}kb`,suggestion:`Optimize images with lossy compression or use next-gen formats (webp/avif).`})}if(d!==1/0&&i.buildTime>d){let e=(i.buildTime/1e3).toFixed(1),n=(d/1e3).toFixed(1);t.push({file:`(build)`,level:o,message:`Build time exceeds budget: ${e}s > ${n}s`,suggestion:"Check for large unoptimized assets or increase `concurrency` in SSG options."})}return m!==1/0&&i.fontCount>m&&t.push({file:`(build)`,level:o,message:`Font files exceed budget: ${i.fontCount} > ${m}`,suggestion:`Reduce the number of font families or use variable fonts.`}),t}var K=e({DEFAULT_DOCTOR_CONFIG:()=>T,checkI18n:()=>U,checkLinks:()=>H,checkMetadata:()=>R,checkPerformance:()=>G,checkSidebar:()=>W,doctorAction:()=>J,doctorInit:()=>q,generateLinkTree:()=>N,loadDoctorConfig:()=>M});async function q(e){let t=f.resolve(e,`doctor.json`);if(p.existsSync(t)){S(`"doctor.json" already exists at ${e}.`);return}try{p.writeFileSync(t,JSON.stringify(T,null,2)),x(`Created "doctor.json" with default configuration.`)}catch(e){v(`Failed to create "doctor.json": ${e}`)}}async function J(e=process.cwd(),t={}){if(t.init){await q(e);return}d();try{let n=await M(e),{format:r}=n.reporting,i=performance.now(),a=await o(`docs`,e),d=f.resolve(e,`docs`);if(p.existsSync(d)||(r===`pretty`&&v(`Docs dir not found at ${d}`),process.exit(1)),r===`pretty`){let t=c?` ${s(`v${c}`)}`:``;console.log(`\n ${g.bold(`⚡`)} ${u(`boltdocs`)}${t} ${g.dim(`—`)} ${g.bold(`doctor`)} ${g.dim(`· documentation health check`)}\n`),console.log(` ${g.dim(`Docs dir ${d}`)}\n ${g.dim(`Reports ${e}/.boltdocs/reports/`)}\n`)}r===`pretty`&&y(g.dim(`🔍 Discovering files and routes...`));let S=te(n.exclude||[]),w=await new C().withFullPaths().filter(e=>{if(!(e.endsWith(`.md`)||e.endsWith(`.mdx`)))return!1;let t=f.relative(d,e).replace(/\\/g,`/`),n=t.split(`/`).some(e=>e.startsWith(`_`)&&e!==`_index.md`&&e!==`_index.mdx`);return!S(t)&&!n}).crawl(d).withPromise();for(let e of w)A.set(e,!0);let T=await N(d,e,a,w),E=a.base||`/`,D=E===`/`?``:E.endsWith(`/`)?E.slice(0,-1):E,O=new Set(T.routes),k=new Set(T.routes.map(e=>e.endsWith(`/`)?e:e+`/`)),j=new Set(T.routes.map(e=>e.endsWith(`/`)?e.slice(0,-1):e));r===`pretty`&&y(g.dim(`🧪 Running diagnostic checks in parallel...`));let P={root:e,docsDir:d,config:a,doctorConfig:n,linkTree:T,files:w,options:t,routeIndex:O,routeIndexWithSlash:k,routeIndexWithoutSlash:j,basePrefix:D};r===`pretty`&&y(g.dim(`🧪 Running diagnostic checks in parallel...`));let F=[R(P),H(P),U(P),W(P)];t.budget&&F.push(G(P));let[I,L,z,B,...V]=await Promise.all(F),K=t.budget?V[0]??[]:[],q=[...I,...L,...z,...B,...K];if(r===`pretty`){let e=e=>e>0?g.red(`${e} issue${e===1?``:`s`}`):g.green(`OK`),n=[{label:`Metadata checks ${e(I.length)}`,done:I.length===0},{label:`Link checks ${e(L.length)}`,done:L.length===0},{label:`i18n checks ${e(z.length)}`,done:z.length===0},{label:`Sidebar checks ${e(B.length)}`,done:B.length===0}];t.budget&&n.push({label:`Performance budget ${e(K.length)}`,done:K.length===0}),console.log(`\n${ee(n)}\n`)}let J=0;if(t.fix){for(let e of q)if(e.fix){if(P.doctorConfig.fix.confirmChanges&&!await _(`Fix issue in "${e.file}": ${e.message}?`))continue;if(P.doctorConfig.fix.backupFiles){let t=f.resolve(P.docsDir,e.file);p.existsSync(t)&&await ne(t,f.resolve(P.root,P.doctorConfig.fix.backupPath))}await e.fix(),J++}}let Y=((performance.now()-i)/1e3).toFixed(2),X=q.filter(e=>e.level===`high`).length,Z=q.filter(e=>e.level===`warning`).length,Q=q.filter(e=>e.level===`low`).length,$={summary:{total:q.length,high:X,warning:Z,low:Q,fixed:J,duration:Y},issues:q.map(e=>({...e,fix:void 0}))};if(n.reporting.outputFile){let t=f.resolve(e,n.reporting.outputFile);p.existsSync(f.dirname(t))||p.mkdirSync(f.dirname(t),{recursive:!0}),p.writeFileSync(t,JSON.stringify($,null,2))}if(r===`json`)console.log(JSON.stringify($,null,2));else if(r===`pretty`){let e=q.reduce((e,t)=>(e[t.file]||(e[t.file]=[]),e[t.file].push(t),e),{});if(q.length>0){console.log(b({title:`Issues`,colors:{title:l}}));for(let[n,r]of Object.entries(e)){let e=r.some(e=>e.level===`high`)?`high`:r.some(e=>e.level===`warning`)?`warning`:`low`,i=e.toUpperCase(),a=m(e===`high`?{label:i,status:`error`}:e===`warning`?{label:i,status:`warning`}:{label:i,colors:{text:`#ffffff`,bg:l}});console.log(`\n ${a} ${g.bold(n)}`);for(let e of r){let n=e.level===`high`?`✖`:e.level===`warning`?`⚠`:`ℹ`,r=e.level===`high`?g.red:e.level===`warning`?g.yellow:e=>h(e,l,`fg`);console.log(` ${r(n)} ${e.message}`),e.suggestion&&console.log(` ${g.dim(`💡 ${e.suggestion}`)}`),t.fix&&e.fix&&console.log(` ${g.green(`✅ Fixed automatically`)}`)}}console.log(``)}q.length===0?(console.log(` ${g.green.bold(`✨ Everything looks perfect!`)} ${g.dim(`— your documentation is in great shape.`)}`),console.log(` ${g.dim(`Scanned ${w.length} file${w.length===1?``:`s`} in ${Y}s`)}`)):(console.log(`\n${b({title:`Summary`,colors:{title:l}})}`),X>0&&console.log(` ${m({label:String(X),status:`error`})} ${g.bold(`high`)}`),Z>0&&console.log(` ${m({label:String(Z),status:`warning`})} ${g.bold(`warning`)}${Z===1?``:`s`}`),Q>0&&console.log(` ${m({label:String(Q),colors:{text:`#ffffff`,bg:l}})} ${g.bold(`low`)}`),console.log(` ${g.dim(`Scanned ${w.length} file${w.length===1?``:`s`} in ${Y}s`)}`),J>0&&x(`Successfully fixed ${J} issues automatically!`),X>0?v(`Please fix the critical errors before building for production.`):x(`No critical issues found. You are ready to go!`))}n.reporting.failOnError&&X>0&&process.exit(1),n.reporting.maxWarnings!==-1&&Z>n.reporting.maxWarnings&&(r===`pretty`&&v(`Failed: Too many warnings (${Z} > ${n.reporting.maxWarnings})`),process.exit(1))}catch(e){v(`Doctor failed: ${e}`),process.exit(1)}}export{N as n,K as t};
@@ -3,4 +3,4 @@
3
3
  * Copyright (c) 2026 Jesus Alcala
4
4
  * Licensed under the MIT License.
5
5
  */
6
- const e=require(`./doctor-DMECtdK6.cjs`);exports.doctorAction=e.t;
6
+ const e=require(`./doctor-BqxOFRt3.cjs`);exports.doctorAction=e.t;
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2026 Jesus Alcala
4
4
  * Licensed under the MIT License.
5
5
  */
6
- import { M as Link, W as useConfig, d as resolvePublicAssetUrl, o as cn, t as Link$1 } from "./link-CgdI6O2o.js";
6
+ import { G as useConfig, N as Link, f as resolvePublicAssetUrl, o as cn, t as Link$1 } from "./link-q1qHNGK_.js";
7
7
  import * as React$1 from "react";
8
8
  import { createContext, use, useEffect, useState } from "react";
9
9
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  const require_router = require('./router-C3kygdRK.cjs');
7
- const require_link = require('./link-vZjmD-es.cjs');
7
+ const require_link = require('./link-hLWOsx0x.cjs');
8
8
  let react = require("react");
9
9
  react = require_router.__toESM(react);
10
10
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -395,7 +395,14 @@ declare function useSidebar(routes: ComponentRoute[]): {
395
395
  };
396
396
  //#endregion
397
397
  //#region src/client/hooks/use-search.d.ts
398
- declare function useSearch(routes: ComponentRoute[]): {
398
+ type SearchStatus = 'idle' | 'loading' | 'indexing' | 'ready' | 'searching' | 'error';
399
+ interface SearchHotContext {
400
+ on: (event: string, callback: (payload?: unknown) => void) => void;
401
+ off?: (event: string, callback: (payload?: unknown) => void) => void;
402
+ }
403
+ declare function useSearch(routes: ComponentRoute[], options?: {
404
+ hot?: SearchHotContext;
405
+ }): {
399
406
  isOpen: boolean;
400
407
  setIsOpen: React$2.Dispatch<React$2.SetStateAction<boolean>>;
401
408
  query: string;
@@ -407,12 +414,17 @@ declare function useSearch(routes: ComponentRoute[]): {
407
414
  bio: string;
408
415
  groupTitle: string | undefined;
409
416
  }[];
417
+ status: SearchStatus;
418
+ isLoading: boolean;
419
+ isIndexing: boolean;
420
+ error: Error | null;
410
421
  searchDataLoading: boolean;
411
422
  searchDataError: Error | null;
423
+ searchError: Error | null;
412
424
  handleSelect: (key: React.Key) => void;
413
425
  input: {
414
426
  value: string;
415
- onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
427
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
416
428
  };
417
429
  };
418
430
  //#endregion
@@ -667,8 +679,16 @@ declare function SidebarHeader({
667
679
  */
668
680
  declare function SidebarContent({
669
681
  children,
670
- className
671
- }: ComponentBase): _$react_jsx_runtime0.JSX.Element;
682
+ className,
683
+ label
684
+ }: ComponentBase & {
685
+ /**
686
+ * Accessible name for the nav landmark. Pages render multiple navs
687
+ * (navbar links, sidebar); unlabeled landmarks fail axe's
688
+ * `landmark-unique` rule.
689
+ */
690
+ label?: string;
691
+ }): _$react_jsx_runtime0.JSX.Element;
672
692
  /**
673
693
  * Navigation Group
674
694
  */
@@ -395,7 +395,14 @@ declare function useSidebar(routes: ComponentRoute[]): {
395
395
  };
396
396
  //#endregion
397
397
  //#region src/client/hooks/use-search.d.ts
398
- declare function useSearch(routes: ComponentRoute[]): {
398
+ type SearchStatus = 'idle' | 'loading' | 'indexing' | 'ready' | 'searching' | 'error';
399
+ interface SearchHotContext {
400
+ on: (event: string, callback: (payload?: unknown) => void) => void;
401
+ off?: (event: string, callback: (payload?: unknown) => void) => void;
402
+ }
403
+ declare function useSearch(routes: ComponentRoute[], options?: {
404
+ hot?: SearchHotContext;
405
+ }): {
399
406
  isOpen: boolean;
400
407
  setIsOpen: React$2.Dispatch<React$2.SetStateAction<boolean>>;
401
408
  query: string;
@@ -407,12 +414,17 @@ declare function useSearch(routes: ComponentRoute[]): {
407
414
  bio: string;
408
415
  groupTitle: string | undefined;
409
416
  }[];
417
+ status: SearchStatus;
418
+ isLoading: boolean;
419
+ isIndexing: boolean;
420
+ error: Error | null;
410
421
  searchDataLoading: boolean;
411
422
  searchDataError: Error | null;
423
+ searchError: Error | null;
412
424
  handleSelect: (key: React.Key) => void;
413
425
  input: {
414
426
  value: string;
415
- onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
427
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
416
428
  };
417
429
  };
418
430
  //#endregion
@@ -667,8 +679,16 @@ declare function SidebarHeader({
667
679
  */
668
680
  declare function SidebarContent({
669
681
  children,
670
- className
671
- }: ComponentBase): _$react_jsx_runtime0.JSX.Element;
682
+ className,
683
+ label
684
+ }: ComponentBase & {
685
+ /**
686
+ * Accessible name for the nav landmark. Pages render multiple navs
687
+ * (navbar links, sidebar); unlabeled landmarks fail axe's
688
+ * `landmark-unique` rule.
689
+ */
690
+ label?: string;
691
+ }): _$react_jsx_runtime0.JSX.Element;
672
692
  /**
673
693
  * Navigation Group
674
694
  */
@@ -48,7 +48,7 @@ function BoltdocsProvider({ children, initialLocale = "", initialVersion = "" })
48
48
  return newL;
49
49
  });
50
50
  if (typeof globalThis !== "undefined") Reflect.set(globalThis, BOLTDOCS_INSTANCE_SYMBOL, {
51
- ...globalThis[BOLTDOCS_INSTANCE_SYMBOL],
51
+ ...globalRegistry$1[BOLTDOCS_INSTANCE_SYMBOL],
52
52
  currentLocale: newL
53
53
  });
54
54
  if (typeof window !== "undefined") try {
@@ -66,7 +66,7 @@ function BoltdocsProvider({ children, initialLocale = "", initialVersion = "" })
66
66
  return newV;
67
67
  });
68
68
  if (typeof globalThis !== "undefined") Reflect.set(globalThis, BOLTDOCS_INSTANCE_SYMBOL, {
69
- ...globalThis[BOLTDOCS_INSTANCE_SYMBOL],
69
+ ...globalRegistry$1[BOLTDOCS_INSTANCE_SYMBOL],
70
70
  currentVersion: newV
71
71
  });
72
72
  if (typeof window !== "undefined") try {
@@ -573,13 +573,58 @@ function resolvePublicAssetUrl(value, base) {
573
573
 
574
574
  //#endregion
575
575
  //#region src/client/app/routes-context.tsx
576
+ const emptyRouteIndex = {
577
+ byPath: /* @__PURE__ */ new Map(),
578
+ hintsByPath: /* @__PURE__ */ new Map(),
579
+ collectionNames: [],
580
+ byCollectionPath: /* @__PURE__ */ new Map(),
581
+ countsByFilePath: /* @__PURE__ */ new Map()
582
+ };
583
+ function getCollectionPathKey(route) {
584
+ if (!route.collection) return void 0;
585
+ const parts = normalizePath(route.path).split("/").filter(Boolean);
586
+ const collectionIndex = parts.indexOf(route.collection);
587
+ if (collectionIndex < 0) return void 0;
588
+ return `/${parts.slice(collectionIndex).join("/")}`;
589
+ }
590
+ /** Build all client route lookup structures in one cached pass. */
591
+ function createRouteIndex(routes) {
592
+ const byPath = /* @__PURE__ */ new Map();
593
+ const hintsByPath = /* @__PURE__ */ new Map();
594
+ const byCollectionPath = /* @__PURE__ */ new Map();
595
+ const countsByFilePath = /* @__PURE__ */ new Map();
596
+ const collectionNames = /* @__PURE__ */ new Set();
597
+ for (const route of routes) {
598
+ if (!route.path) continue;
599
+ const path = normalizePath(route.path);
600
+ byPath.set(path, route);
601
+ hintsByPath.set(path, {
602
+ path: route.path,
603
+ kind: route.collection ? "collection" : void 0,
604
+ collection: route.collection
605
+ });
606
+ countsByFilePath.set(route.filePath, (countsByFilePath.get(route.filePath) || 0) + 1);
607
+ if (route.collection) {
608
+ collectionNames.add(route.collection);
609
+ const collectionPath = getCollectionPathKey(route);
610
+ if (collectionPath) {
611
+ const variants = byCollectionPath.get(collectionPath) || [];
612
+ variants.push(route);
613
+ byCollectionPath.set(collectionPath, variants);
614
+ }
615
+ }
616
+ }
617
+ return {
618
+ byPath,
619
+ hintsByPath,
620
+ byCollectionPath,
621
+ countsByFilePath,
622
+ collectionNames: [...collectionNames]
623
+ };
624
+ }
576
625
  const RoutesContext = (0, react.createContext)({
577
626
  routes: [],
578
- index: {
579
- byPath: /* @__PURE__ */ new Map(),
580
- hintsByPath: /* @__PURE__ */ new Map(),
581
- collectionNames: []
582
- }
627
+ index: emptyRouteIndex
583
628
  });
584
629
  /**
585
630
  * Hook to access the processed routes list from the closest provider.
@@ -592,27 +637,7 @@ function useRoutesContext() {
592
637
  */
593
638
  function RoutesProvider({ routes: initialRoutes, children }) {
594
639
  const [routes, setRoutes] = (0, react.useState)(initialRoutes);
595
- const index = (0, react.useMemo)(() => {
596
- const byPath = /* @__PURE__ */ new Map();
597
- const hintsByPath = /* @__PURE__ */ new Map();
598
- const collectionNames = /* @__PURE__ */ new Set();
599
- for (const route of routes) {
600
- if (!route.path) continue;
601
- const path = normalizePath(route.path);
602
- byPath.set(path, route);
603
- hintsByPath.set(path, {
604
- path: route.path,
605
- kind: route.collection ? "collection" : void 0,
606
- collection: route.collection
607
- });
608
- if (route.collection) collectionNames.add(route.collection);
609
- }
610
- return {
611
- byPath,
612
- hintsByPath,
613
- collectionNames: [...collectionNames]
614
- };
615
- }, [routes]);
640
+ const index = (0, react.useMemo)(() => createRouteIndex(routes), [routes]);
616
641
  (0, react.useEffect)(() => {
617
642
  if (!{}.hot) return;
618
643
  const handler = (payload) => {
@@ -1074,6 +1099,12 @@ Object.defineProperty(exports, 'cn', {
1074
1099
  return cn;
1075
1100
  }
1076
1101
  });
1102
+ Object.defineProperty(exports, 'createRouteIndex', {
1103
+ enumerable: true,
1104
+ get: function () {
1105
+ return createRouteIndex;
1106
+ }
1107
+ });
1077
1108
  Object.defineProperty(exports, 'icons_exports', {
1078
1109
  enumerable: true,
1079
1110
  get: function () {
@@ -65,7 +65,7 @@ function BoltdocsProvider({ children, initialLocale = "", initialVersion = "" })
65
65
  return newL;
66
66
  });
67
67
  if (typeof globalThis !== "undefined") Reflect.set(globalThis, BOLTDOCS_INSTANCE_SYMBOL, {
68
- ...globalThis[BOLTDOCS_INSTANCE_SYMBOL],
68
+ ...globalRegistry$1[BOLTDOCS_INSTANCE_SYMBOL],
69
69
  currentLocale: newL
70
70
  });
71
71
  if (typeof window !== "undefined") try {
@@ -83,7 +83,7 @@ function BoltdocsProvider({ children, initialLocale = "", initialVersion = "" })
83
83
  return newV;
84
84
  });
85
85
  if (typeof globalThis !== "undefined") Reflect.set(globalThis, BOLTDOCS_INSTANCE_SYMBOL, {
86
- ...globalThis[BOLTDOCS_INSTANCE_SYMBOL],
86
+ ...globalRegistry$1[BOLTDOCS_INSTANCE_SYMBOL],
87
87
  currentVersion: newV
88
88
  });
89
89
  if (typeof window !== "undefined") try {
@@ -590,13 +590,58 @@ function resolvePublicAssetUrl(value, base) {
590
590
 
591
591
  //#endregion
592
592
  //#region src/client/app/routes-context.tsx
593
+ const emptyRouteIndex = {
594
+ byPath: /* @__PURE__ */ new Map(),
595
+ hintsByPath: /* @__PURE__ */ new Map(),
596
+ collectionNames: [],
597
+ byCollectionPath: /* @__PURE__ */ new Map(),
598
+ countsByFilePath: /* @__PURE__ */ new Map()
599
+ };
600
+ function getCollectionPathKey(route) {
601
+ if (!route.collection) return void 0;
602
+ const parts = normalizePath(route.path).split("/").filter(Boolean);
603
+ const collectionIndex = parts.indexOf(route.collection);
604
+ if (collectionIndex < 0) return void 0;
605
+ return `/${parts.slice(collectionIndex).join("/")}`;
606
+ }
607
+ /** Build all client route lookup structures in one cached pass. */
608
+ function createRouteIndex(routes) {
609
+ const byPath = /* @__PURE__ */ new Map();
610
+ const hintsByPath = /* @__PURE__ */ new Map();
611
+ const byCollectionPath = /* @__PURE__ */ new Map();
612
+ const countsByFilePath = /* @__PURE__ */ new Map();
613
+ const collectionNames = /* @__PURE__ */ new Set();
614
+ for (const route of routes) {
615
+ if (!route.path) continue;
616
+ const path = normalizePath(route.path);
617
+ byPath.set(path, route);
618
+ hintsByPath.set(path, {
619
+ path: route.path,
620
+ kind: route.collection ? "collection" : void 0,
621
+ collection: route.collection
622
+ });
623
+ countsByFilePath.set(route.filePath, (countsByFilePath.get(route.filePath) || 0) + 1);
624
+ if (route.collection) {
625
+ collectionNames.add(route.collection);
626
+ const collectionPath = getCollectionPathKey(route);
627
+ if (collectionPath) {
628
+ const variants = byCollectionPath.get(collectionPath) || [];
629
+ variants.push(route);
630
+ byCollectionPath.set(collectionPath, variants);
631
+ }
632
+ }
633
+ }
634
+ return {
635
+ byPath,
636
+ hintsByPath,
637
+ byCollectionPath,
638
+ countsByFilePath,
639
+ collectionNames: [...collectionNames]
640
+ };
641
+ }
593
642
  const RoutesContext = createContext({
594
643
  routes: [],
595
- index: {
596
- byPath: /* @__PURE__ */ new Map(),
597
- hintsByPath: /* @__PURE__ */ new Map(),
598
- collectionNames: []
599
- }
644
+ index: emptyRouteIndex
600
645
  });
601
646
  /**
602
647
  * Hook to access the processed routes list from the closest provider.
@@ -609,27 +654,7 @@ function useRoutesContext() {
609
654
  */
610
655
  function RoutesProvider({ routes: initialRoutes, children }) {
611
656
  const [routes, setRoutes] = useState(initialRoutes);
612
- const index = useMemo(() => {
613
- const byPath = /* @__PURE__ */ new Map();
614
- const hintsByPath = /* @__PURE__ */ new Map();
615
- const collectionNames = /* @__PURE__ */ new Set();
616
- for (const route of routes) {
617
- if (!route.path) continue;
618
- const path = normalizePath(route.path);
619
- byPath.set(path, route);
620
- hintsByPath.set(path, {
621
- path: route.path,
622
- kind: route.collection ? "collection" : void 0,
623
- collection: route.collection
624
- });
625
- if (route.collection) collectionNames.add(route.collection);
626
- }
627
- return {
628
- byPath,
629
- hintsByPath,
630
- collectionNames: [...collectionNames]
631
- };
632
- }, [routes]);
657
+ const index = useMemo(() => createRouteIndex(routes), [routes]);
633
658
  useEffect(() => {
634
659
  if (!import.meta.hot) return;
635
660
  const handler = (payload) => {
@@ -869,4 +894,4 @@ function NavLink(props) {
869
894
  }
870
895
 
871
896
  //#endregion
872
- export { Languages as A, TextAlignStart as B, FaceBad as C, Hash as D, FileText as E, Moon as F, useOptionalConfig as G, icons_exports as H, MoreVertical as I, BoltdocsProvider as K, Pencil as L, Link$1 as M, Menu as N, Home as O, Monitor as P, Search as R, ExternalLink as S, FaceRegular as T, ConfigContext as U, X as V, useConfig as W, ChevronLeft as _, useViewTransition as a, Copy as b, RoutesProvider as c, resolvePublicAssetUrl as d, AlertCircle as f, ChevronDown as g, Check as h, startViewTransition as i, Lightbulb as j, Info as k, useRoutesContext as l, ArrowLeft as m, NavLink as n, cn as o, AlertTriangle as p, useBoltdocsContext as q, TransitionLink as r, useLocalizedTo as s, Link as t, normalizePath as u, ChevronRight as v, FaceGood as w, CornerDownLeft as x, CircleHelp as y, Sun as z };
897
+ export { Info as A, Sun as B, ExternalLink as C, FileText as D, FaceRegular as E, Monitor as F, useConfig as G, X as H, Moon as I, useBoltdocsContext as J, useOptionalConfig as K, MoreVertical as L, Lightbulb as M, Link$1 as N, Hash as O, Menu as P, Pencil as R, CornerDownLeft as S, FaceGood as T, icons_exports as U, TextAlignStart as V, ConfigContext as W, ChevronDown as _, useViewTransition as a, CircleHelp as b, RoutesProvider as c, normalizePath as d, resolvePublicAssetUrl as f, Check as g, ArrowLeft as h, startViewTransition as i, Languages as j, Home as k, createRouteIndex as l, AlertTriangle as m, NavLink as n, cn as o, AlertCircle as p, BoltdocsProvider as q, TransitionLink as r, useLocalizedTo as s, Link as t, useRoutesContext as u, ChevronLeft as v, FaceBad as w, Copy as x, ChevronRight as y, Search as z };
@@ -3,8 +3,8 @@
3
3
  * Copyright (c) 2026 Jesus Alcala
4
4
  * Licensed under the MIT License.
5
5
  */
6
- import { W as useConfig, b as Copy, f as AlertCircle, h as Check, j as Lightbulb, k as Info, o as cn, p as AlertTriangle, t as Link } from "./link-CgdI6O2o.js";
7
- 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-B-NDSDuY.js";
6
+ import { A as Info, G as useConfig, M as Lightbulb, g as Check, m as AlertTriangle, o as cn, p as AlertCircle, t as Link, x as Copy } from "./link-q1qHNGK_.js";
7
+ 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-BAiDReNd.js";
8
8
  import { useCallback, useEffect, useRef, useState } from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  import { Button } from "react-aria-components";
@@ -4,8 +4,8 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  const require_router = require('./router-C3kygdRK.cjs');
7
- const require_link = require('./link-vZjmD-es.cjs');
8
- const require_image = require('./image-Hnaa2bJd.cjs');
7
+ const require_link = require('./link-hLWOsx0x.cjs');
8
+ const require_image = require('./image-Bkx85rsq.cjs');
9
9
  let react = require("react");
10
10
  let react_jsx_runtime = require("react/jsx-runtime");
11
11
  let react_aria_components = require("react-aria-components");
@@ -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(({enableCompileCache:e})=>{typeof e==`function`&&e()}).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-DbuhNcF5.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-DbuhNcF5.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-B672n0hL.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-B672n0hL.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-CHkGiV3c.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-FuFY1jBz.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-BCrZL53x.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();
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-46NiL0MC.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-46NiL0MC.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-CxT38vPv.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-CxT38vPv.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-CHkGiV3c.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-TS3JGNEU.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-BCrZL53x.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();
@@ -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(({enableCompileCache:e})=>{typeof e==`function`&&e()}).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-B49V6O6p.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-B49V6O6p.mjs`);return n(e,t)}),m.command(`build [root]`,`Build for production`).action(async(...e)=>{await p();let{buildAction:t}=await import(`../build-BVoMHMhw.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-BVoMHMhw.mjs`);return t(...e)}),m.command(`audit [root]`,`Audit configured plugins for security warnings`).action(async(...e)=>{let{auditAction:t}=await import(`../audit-CMc_ydRr.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-i8Qmd8DJ.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-CFukoGa0.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{};
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-C4kjO5xs.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-C4kjO5xs.mjs`);return n(e,t)}),m.command(`build [root]`,`Build for production`).action(async(...e)=>{await p();let{buildAction:t}=await import(`../build-BJnL-FHG.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-BJnL-FHG.mjs`);return t(...e)}),m.command(`audit [root]`,`Audit configured plugins for security warnings`).action(async(...e)=>{let{auditAction:t}=await import(`../audit-CMc_ydRr.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-Cv5lXnay.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-CFukoGa0.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 { a as CodeHighlightConfig, c as CodeHighlighterRuntime, l as CodeTheme, o as CodeHighlighterAdapter, s as CodeHighlighterEngine } from "../types-o7iZ2BAR.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-BbB6NqSv.cjs";
2
+ import { a as CodeHighlightConfig, c as CodeHighlighterRuntime, l as CodeTheme, o as CodeHighlighterAdapter, s as CodeHighlighterEngine } from "../types-X_Pwk8Cg.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-B8pt41zj.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 { a as CodeHighlightConfig, c as CodeHighlighterRuntime, l as CodeTheme, o as CodeHighlighterAdapter, s as CodeHighlighterEngine } from "../types-Db6zToZH.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-sJqDv0kE.mjs";
2
+ import { a as CodeHighlightConfig, c as CodeHighlighterRuntime, l as CodeTheme, o as CodeHighlighterAdapter, s as CodeHighlighterEngine } from "../types-74i_xUe2.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-BrrH2X9c.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 };
@@ -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-BljvHMpS.cjs`),t=require(`../utils-ej6_SjIZ.cjs`),n=require(`../plugin-context-CscLcXjH.cjs`),r=require(`./cache.cjs`),i=require(`../routes-C0kb4ue6.cjs`),a=require(`../config-CrsQJHQz.cjs`),o=require(`../registry-DLJIooEu.cjs`),s=require(`../handler-Ch-Q9NAB.cjs`),c=require(`../adapters-DwDTQoCG.cjs`);let l=require(`@bdocs/unist-utils`);exports.BUILTIN_HIGHLIGHTERS=o.t,exports.BoltdocsPluginStore=e.d,exports.DEFAULT_HIGHLIGHTER=o.n,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.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.s,exports.sanitizeFilename=t.f,exports.validatePlugins=e.u,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]}})});
6
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../chunk-D1Md3oWO.cjs`);const e=require(`../node-7Cfw6nMr.cjs`),t=require(`../utils-ej6_SjIZ.cjs`),n=require(`../plugin-context-BZs5lvDu.cjs`),r=require(`./cache.cjs`),i=require(`../routes-CzhKOw67.cjs`),a=require(`../config-BJp3lGzE.cjs`),o=require(`../registry-DLJIooEu.cjs`),s=require(`../handler-Ch-Q9NAB.cjs`),c=require(`../adapters-DwDTQoCG.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]}})});