boltdocs 3.0.2 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -18
- package/dist/{adapters-DEXNIv3x.mjs → adapters-ByYY44Zy.mjs} +1 -1
- package/dist/{adapters-C5AWWGfb.cjs → adapters-DvmtpdSF.cjs} +1 -1
- package/dist/{banner-CfdalYLL.d.ts → banner-BMop1KLF.d.ts} +2 -2
- package/dist/{banner-DNSkgUsO.d.cts → banner-CVD0GugR.d.cts} +2 -2
- package/dist/cache-CO4Dy2uQ.cjs +6 -0
- package/dist/cache-Dk53iOo6.mjs +6 -0
- package/dist/chunk-BFSpntXv.mjs +6 -0
- package/dist/{chunk-Ds5LZdWN.cjs → chunk-D1Md3oWO.cjs} +1 -1
- package/dist/client/index.cjs +433 -272
- package/dist/client/index.d.cts +129 -18
- package/dist/client/index.d.ts +129 -18
- package/dist/client/index.js +337 -178
- package/dist/client/mdx.cjs +1 -1
- package/dist/client/mdx.d.cts +1 -1
- package/dist/client/mdx.d.ts +1 -1
- package/dist/client/mdx.js +1 -1
- package/dist/client/primitives.cjs +7 -7
- package/dist/client/primitives.d.cts +5 -22
- package/dist/client/primitives.d.ts +5 -22
- package/dist/client/primitives.js +4 -4
- package/dist/client/theme/neutral.css +1 -3
- package/dist/client/theme/reset.css +31 -4
- package/dist/config-BpzaPsJj.d.cts +781 -0
- package/dist/config-CCXp3aXO.mjs +7 -0
- package/dist/{config-JGkMJoJQ.cjs → config-CMd4XoFq.cjs} +1 -1
- package/dist/config-DlGoEM9D.cjs +7 -0
- package/dist/config-xtS0ZkMm.d.mts +781 -0
- package/dist/{csp-CBysWlAf.cjs → csp-CRp_3U7a.cjs} +1 -1
- package/dist/csp-oTC2ygvF.mjs +6 -0
- package/dist/{docs-layout-6FQ8__ok.js → docs-layout-BdtZ9z6s.js} +9 -28
- package/dist/{docs-layout-3TpAt6MB.cjs → docs-layout-CFWI15Id.cjs} +69 -88
- package/dist/{doctor-BR1B2Mkz.cjs → doctor-BBtmNJE0.cjs} +1 -1
- package/dist/doctor-Bv16QSrI.cjs +7 -0
- package/dist/doctor-DOAbSaiL.mjs +7 -0
- package/dist/{generator-DtUU3Cfk.cjs → generator-COepVWGi.cjs} +1 -1
- package/dist/{handler-Btd4t_67.mjs → handler-DzQae4eA.mjs} +1 -1
- package/dist/{handler-Dzf4dSnV.cjs → handler-XX7cLTqe.cjs} +1 -1
- package/dist/headers-Ddwek8K7.mjs +6 -0
- package/dist/{headers-BXKxiPUv.cjs → headers-dg4SDrjY.cjs} +1 -1
- package/dist/{image-C9md50h2.js → image-Bz87fCla.js} +2 -2
- package/dist/{image-CR6UlaI5.cjs → image-C4TlpMHn.cjs} +18 -18
- package/dist/link-2PzgTnaP.js +673 -0
- package/dist/{icons-dev-BryEFkJu.cjs → link-D1Gjkb-2.cjs} +8 -353
- package/dist/{mdx-DhyMkc35.js → mdx-BuO6a1f7.js} +199 -40
- package/dist/{mdx-DJBg5DuL.cjs → mdx-CD-tSjRG.cjs} +237 -72
- package/dist/{meta-loader-C9MKjAs0.cjs → meta-loader-Dq1zcFnh.cjs} +1 -1
- package/dist/node/cache.cjs +6 -0
- package/dist/node/cache.d.cts +84 -0
- package/dist/node/cache.d.mts +84 -0
- package/dist/node/cache.mjs +6 -0
- package/dist/node/cli-entry.cjs +6 -6
- package/dist/node/cli-entry.mjs +9 -9
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +27 -638
- package/dist/node/index.d.mts +27 -640
- package/dist/node/index.mjs +1 -1
- package/dist/node/mdx/shiki-adapter.cjs +6 -0
- package/dist/node/mdx/shiki-adapter.d.cts +51 -0
- package/dist/node/mdx/shiki-adapter.d.mts +51 -0
- package/dist/node/mdx/shiki-adapter.mjs +6 -0
- package/dist/node-BXtqM1uH.mjs +6 -0
- package/dist/node-BlVk4EVg.cjs +104 -0
- package/dist/node-DOf4zhWc.mjs +104 -0
- package/dist/node-aD1eisrR.cjs +6 -0
- package/dist/{package-CEDhVAfO.cjs → package-BcISI5-P.cjs} +1 -1
- package/dist/{package-_dCCKVvG.mjs → package-CCYEAYeA.mjs} +1 -1
- package/dist/{pages-external-CX2uyW95.cjs → pages-external-XkYIs-d5.cjs} +1 -1
- package/dist/parser-DCiEWkSk.cjs +8 -0
- package/dist/parser-qk9FIHJ7.mjs +8 -0
- package/dist/plugin-C95kvu6h.mjs +73 -0
- package/dist/plugin-DM3u2bVj.cjs +73 -0
- package/dist/routes-BW6zsk7Z.mjs +6 -0
- package/dist/routes-BgoIB5wb.cjs +6 -0
- package/dist/{routes-BajCwrvX.cjs → routes-CORVxc02.cjs} +1 -1
- package/dist/{search-dialog-D4rplZMv.cjs → search-dialog-B1NERUNx.cjs} +101 -55
- package/dist/{search-dialog-Cx7aGW3U.cjs → search-dialog-BRFno7HD.cjs} +8 -8
- package/dist/{search-dialog-DDopgbKM.js → search-dialog-BmxHiKwt.js} +2 -2
- package/dist/{search-dialog-BNdRV60O.js → search-dialog-D6TvjcuV.js} +1 -1
- package/dist/{search-dialog-DaeSPvEo.js → search-dialog-DFnlx8LO.js} +44 -4
- package/dist/{search-dialog-CW1f6dn6.cjs → search-dialog-DHqwjJuG.cjs} +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.mts +1 -1
- package/dist/server/index.mjs +1 -1
- package/dist/shiki-adapter-CoQ6jyJ4.cjs +6 -0
- package/dist/shiki-adapter-D-aKw7PP.mjs +6 -0
- package/dist/sidebar-COTaMHR-.d.ts +1100 -0
- package/dist/sidebar-CrEdJuHX.d.cts +1100 -0
- package/dist/{types-generator-CYcHkDzZ.cjs → types-generator-BXhv7Ill.cjs} +1 -1
- package/dist/types-generator-bDPvUztF.mjs +26 -0
- package/dist/utils-Crm9oPcV.mjs +7 -0
- package/dist/utils-D6Xtj0FZ.cjs +7 -0
- package/package.json +26 -12
- package/src/shared/types.ts +532 -23
- package/dist/cache-DETwlACe.cjs +0 -6
- package/dist/cache-SF59enb3.mjs +0 -6
- package/dist/config-B5uVv5q4.cjs +0 -7
- package/dist/config-D3_zDkHh.mjs +0 -7
- package/dist/csp-gaZ51xzq.mjs +0 -6
- package/dist/doctor-3MheVMwd.mjs +0 -7
- package/dist/doctor-DQxLM202.cjs +0 -7
- package/dist/headers-CXyf0auY.mjs +0 -6
- package/dist/icons-dev-kJyGWNeg.js +0 -916
- package/dist/node-B9JSyEIU.mjs +0 -105
- package/dist/node-Cedquois.cjs +0 -105
- package/dist/parser-CNIPHx4s.cjs +0 -8
- package/dist/parser-D0QHIQsi.mjs +0 -8
- package/dist/plugin-WYNORxp1.cjs +0 -68
- package/dist/plugin-YWNVRpws.mjs +0 -68
- package/dist/rolldown-runtime-fkIsjY3S.mjs +0 -6
- package/dist/routes-CyrnmVuG.mjs +0 -6
- package/dist/routes-D6Tuu7Fs.cjs +0 -6
- package/dist/shiki-adapter-CGTmrR6S.cjs +0 -6
- package/dist/shiki-adapter-CXEGRnjr.mjs +0 -6
- package/dist/shiki-adapter-Mr8_oT_9.cjs +0 -6
- package/dist/sidebar-7gIifpBX.d.cts +0 -615
- package/dist/sidebar-BAKgJ-Er.d.ts +0 -615
- package/dist/types-generator-DVOnRVKU.mjs +0 -26
- package/dist/utils-B3xYMrpK.mjs +0 -7
- package/dist/utils-Bz1tG9Dg.cjs +0 -7
- /package/dist/{errors-C0Hx15Ag.mjs → errors-0zGHRLue.mjs} +0 -0
- /package/dist/{errors-Dx6JHoKE.cjs → errors-vKw8CkiX.cjs} +0 -0
- /package/dist/{index-CdJv4ocW.d.mts → index-1KsTDq4o.d.mts} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
+
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import{t as e}from"./chunk-BFSpntXv.mjs";import{_ as t,a as n,d as r,u as i}from"./utils-Crm9oPcV.mjs";import{t as a}from"./pages-external-BYa4JSda.mjs";import{r as o}from"./config-CCXp3aXO.mjs";import{t as s}from"./node/cli-entry.mjs";import c from"node:path";import l from"node:fs";import{bullet as u,colors as d,confirm as f,dividerLog as p,double as m,error as h,info as g,round as _,single as v,success as y,tasks as b,warn as x}from"@bdocs/dui";import{fdir as S}from"fdir";import C 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 ee(e,t){l.existsSync(t)||l.mkdirSync(t,{recursive:!0});let n=c.basename(e),r=new Date().toISOString().replace(/[:.]/g,`-`),i=c.join(t,`${n}.${r}.bak`);l.copyFileSync(e,i)}const O=new Map;function k(e){let t=O.get(e);if(t)return t;let n=(async()=>{let t=await r(e,!1);return{raw:t.raw,data:t.data,content:t.content}})();return O.set(e,n),n}const A=new Map;function j(e){if(A.has(e))return A.get(e);let t=!1;try{t=l.existsSync(e)&&l.statSync(e).isFile()}catch{t=!1}return A.set(e,t),t}async function M(e){let t=c.resolve(e,`doctor.json`);if(l.existsSync(t))try{let e=JSON.parse(l.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){x(`Failed to parse doctor.json: ${e}`)}return T}async function N(e,t=process.cwd(),r,i){let o=c.resolve(t,`.boltdocs`,`generated`);l.existsSync(o)||l.mkdirSync(o,{recursive:!0});let s=i;s||=await new S().withFullPaths().filter(e=>e.endsWith(`.md`)||e.endsWith(`.mdx`)).crawl(e).withPromise();let u=r?.base||`/docs`,d=[];for(let t=0;t<s.length;t+=100){let r=s.slice(t,t+100),i=await Promise.all(r.map(async t=>{let r=c.isAbsolute(t)?t:c.resolve(e,t),i=c.relative(e,r),{data:a}=await k(r),o;return o=a.permalink?String(a.permalink).startsWith(`/`)?String(a.permalink):`/${a.permalink}`:n(i),u===`/`?o:(u.endsWith(`/`)?u:u+`/`)+(o.startsWith(`/`)?o.substring(1):o)}));d.push(...i)}d.includes(u)||d.push(u);let f=a(e,r);for(let e of f)d.includes(e)||d.push(e);let p={routes:Array.from(new Set(d)).sort(),timestamp:Date.now()};return l.writeFileSync(c.resolve(o,`link-tree.json`),JSON.stringify(p,null,2)),p}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}async function L(e){let n=[];if(!e.doctorConfig.checks.metadata.enabled)return n;let{titleMin:r,titleMax:a,descriptionMin:o}=e.doctorConfig.checks.metadata,s=new Map;for(let l of e.files){let u=i(c.relative(e.docsDir,l));try{let{raw:i,data:c}=await k(l);if(i.trim().startsWith(`---`)&&i.split(`---`).length>=3&&Object.keys(c).length===0){let t=D(e,`malformedFrontmatter`,`high`);t!==`off`&&n.push({file:u,level:t,message:`Malformed frontmatter (YAML parsing failed).`,suggestion:`Check your YAML syntax for indentation or unquoted special characters.`})}let d=t.safeParse(c);if(!d.success){let t=D(e,`invalidFrontmatter`,`high`);if(t!==`off`)for(let e of d.error.issues)n.push({file:u,level:t,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 t of f)if(c[t]===void 0){let r=D(e,`missingMetadata`,`warning`);r!==`off`&&n.push({file:u,level:r,message:`Missing required frontmatter field: "${t}".`,suggestion:`Add the "${t}" field to your frontmatter.`})}if(e.doctorConfig.checks.metadata.validateDates){let t=[`date`,`lastUpdated`,...e.doctorConfig.checks.metadata.optional.filter(e=>e.toLowerCase().includes(`date`))];for(let r of t)if(c[r]&&Number.isNaN(Date.parse(String(c[r])))){let t=D(e,`invalidFrontmatter`,`high`);t!==`off`&&n.push({file:u,level:t,message:`Invalid date format in field "${r}": "${c[r]}".`,suggestion:`Use a valid ISO date format (e.g., YYYY-MM-DD).`})}}if(c.title){let t=String(c.title);if(t.length<r){let i=D(e,`shortMetadata`,`low`);i!==`off`&&n.push({file:u,level:i,message:`Title is too short (${t.length} chars).`,suggestion:`Titles should be at least ${r} characters for better SEO.`})}else if(t.length>a){let r=D(e,`shortMetadata`,`low`);r!==`off`&&n.push({file:u,level:r,message:`Title is too long (${t.length} chars).`,suggestion:`Titles should be under ${a} characters.`})}let i=s.get(t)||[];i.push(u),s.set(t,i)}if(c.description&&String(c.description).length<o){let t=D(e,`shortMetadata`,`low`);t!==`off`&&n.push({file:u,level:t,message:`Description is very short.`,suggestion:`Descriptions should ideally be at least ${o} characters.`})}}catch(t){if(t instanceof Error){let r=D(e,`malformedFrontmatter`,`high`);r!==`off`&&n.push({file:u,level:r,message:`Malformed frontmatter (YAML error): ${t.message}`,suggestion:`Check your YAML syntax for indentation or unquoted special characters.`})}}}for(let[t,r]of s.entries())if(r.length>1){let i=D(e,`duplicateTitle`,`low`);if(i!==`off`)for(let e of r)n.push({file:e,level:i,message:`Duplicate title found: "${t}"`,suggestion:`Ensure each page has a unique title. Also used in: ${r.filter(t=>t!==e).join(`, `)}`})}return n}async function R(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 u=/(?:\[.*?\]\((.*?)\))|(?:href=["']([^"']+)["'])/g,f=new Set,p=5e5;for(let o of e.files){let s=i(c.relative(e.docsDir,o)),{content:d}=await k(o),m=[...(d.length>p?d.slice(0,p):d).replace(/```[\s\S]*?```/g,``).replace(/`[^`\n]*`/g,``).matchAll(u)];for(let i of m){let u=i[1]||i[2],d=!!i[1];if(!u||a.some(e=>u.includes(e)))continue;if(/^https?:\/\//i.test(u)){(r||e.options.checkExternal)&&f.add({url:u,file:o});continue}if(!n||/^(mailto|tel|#)/i.test(u))continue;let p;try{p=decodeURIComponent(u.split(`#`)[0].split(`?`)[0])}catch{p=u.split(`#`)[0].split(`?`)[0]}if(!p)continue;let m=!1,h=``;if(p.startsWith(`/`))if(e.routeIndex.has(p)||e.routeIndexWithSlash.has(p)||e.routeIndexWithoutSlash.has(p))m=!0;else{let t=e.basePrefix+(p.startsWith(`/`)?p:`/`+p);if(e.routeIndex.has(t)||e.routeIndexWithSlash.has(t))m=!1,h=t;else{let t=e.config.base!==`/`&&p.startsWith(e.config.base||`/`)?p.substring((e.config.base||`/`).length):p,n=t.startsWith(`/`)?t.substring(1):t;h=c.join(e.docsDir,n),m=[``,`.md`,`.mdx`,`/index.md`,`/index.mdx`].some(e=>j(h+e))}}else h=c.resolve(c.dirname(o),p),m=[``,`.md`,`.mdx`,`/index.md`,`/index.mdx`].some(e=>j(h+e));if(!m){let{bestMatch:n,similarity:r}=I(p,e.linkTree.routes),i=!1,a=e.basePrefix+(p.startsWith(`/`)?p:`/`+p);(e.routeIndex.has(a)||e.routeIndexWithSlash.has(a))&&(n=a,r=1,i=!0);let c=r>.6||i,f=r>.75&&n!==p||i,m=D(e,`brokenLink`,`high`);m!==`off`&&t.push({file:s,level:m,message:`Broken internal link: "${u}"`,suggestion:c?`Did you mean "${n}"?`:`Ensure the target exists or check for typos.`,fix:f?async()=>{let e=u.includes(`#`)?`#`+u.split(`#`)[1]:``,t=d?`(${u})`:`href="${u}"`,r=d?`(${n}${e})`:`href="${n}${e}"`,i=l.readFileSync(o,`utf-8`).replace(t,r);l.writeFileSync(o,i),O.delete(o)}:void 0})}}}if(f.size>0){g(d.gray(`Verifying ${f.size} external links...`));let n=new Map;for(let e of f)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(c.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 z(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);for(let r of e.files){let s=i(c.relative(e.docsDir,r)),u=s.split(`/`),d=u[0];if(d===n){let n=u.slice(1).join(`/`);for(let i of o){let a=c.join(e.docsDir,i,n);if(!j(a)){let o=D(e,`missingTranslation`,`warning`);o!==`off`&&t.push({file:s,level:o,message:`Missing translation for locale "${i}"`,suggestion:`Create a version at "${i}/${n}".`,fix:async()=>{let e=c.dirname(a);l.existsSync(e)||l.mkdirSync(e,{recursive:!0}),l.copyFileSync(r,a)}})}}}else if(a.includes(d)){let i=u.slice(1).join(`/`);if(!j(c.join(e.docsDir,n,i))){let a=D(e,`missingTranslation`,`low`);a!==`off`&&t.push({file:s,level:a,message:`Orphaned translation (source missing in "${n}")`,suggestion:`Remove this file or create the source at "${n}/${i}".`,fix:async()=>{l.unlinkSync(r)}})}}}return t}async function B(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 V(e){let t=[],n=e.doctorConfig.checks.performance;if(!n?.enabled)return t;let r=c.resolve(e.root,`.boltdocs`,`reports`,`performance.json`);if(!l.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(l.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),u=E(a?.maxCSSBundleSize,1/0),d=E(a?.maxPageHTMLSize,1/0),f=a?.maxImagesKB??1/0,p=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(u!==1/0&&i.totalCSSBundleSize>u){let e=(i.totalCSSBundleSize/1024).toFixed(0),n=(u/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(d!==1/0){for(let e of i.pages)if(e.htmlSize>d){let n=(e.htmlSize/1024).toFixed(0),r=(d/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=f*1024;if(f!==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 > ${f}kb`,suggestion:`Optimize images with lossy compression or use next-gen formats (webp/avif).`})}if(p!==1/0&&i.buildTime>p){let e=(i.buildTime/1e3).toFixed(1),n=(p/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 H=e({DEFAULT_DOCTOR_CONFIG:()=>T,checkI18n:()=>z,checkLinks:()=>R,checkMetadata:()=>L,checkPerformance:()=>V,checkSidebar:()=>B,doctorAction:()=>W,doctorInit:()=>U,generateLinkTree:()=>N,loadDoctorConfig:()=>M});async function U(e){let t=c.resolve(e,`doctor.json`);if(l.existsSync(t)){x(`"doctor.json" already exists at ${e}.`);return}try{l.writeFileSync(t,JSON.stringify(T,null,2)),y(`Created "doctor.json" with default configuration.`)}catch(e){h(`Failed to create "doctor.json": ${e}`)}}async function W(e=process.cwd(),t={}){if(t.init){await U(e);return}s();try{let n=await M(e),{format:r}=n.reporting,i=performance.now(),a=await o(`docs`,e),s=c.resolve(e,`docs`);l.existsSync(s)||(r===`pretty`&&h(`Docs dir not found at ${s}`),process.exit(1)),r===`pretty`&&console.log(m([` ${d.dim(`Docs dir:`)} ${s}`,` ${d.dim(`Reports:`)} ${e}/.boltdocs/reports/`],{title:`✦ DOCTOR — Documentation Health Check`})),r===`pretty`&&g(d.dim(`🔍 Discovering files and routes...`));let x=C(n.exclude||[]),w=await new S().withFullPaths().filter(e=>{if(!(e.endsWith(`.md`)||e.endsWith(`.mdx`)))return!1;let t=c.relative(s,e).replace(/\\/g,`/`),n=t.split(`/`).some(e=>e.startsWith(`_`)&&e!==`_index.md`&&e!==`_index.mdx`);return!x(t)&&!n}).crawl(s).withPromise();for(let e of w)A.set(e,!0);let T=await N(s,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`&&g(d.dim(`🧪 Running diagnostic checks in parallel...`));let P={root:e,docsDir:s,config:a,doctorConfig:n,linkTree:T,files:w,options:t,routeIndex:O,routeIndexWithSlash:k,routeIndexWithoutSlash:j,basePrefix:D};r===`pretty`&&g(d.dim(`🧪 Running diagnostic checks in parallel...`));let F=[L(P),R(P),z(P),B(P)];t.budget&&F.push(V(P));let[I,H,U,W,...G]=await Promise.all(F),K=t.budget?G[0]??[]:[],q=[...I,...H,...U,...W,...K];if(r===`pretty`){let e=[{label:`Metadata checks ${I.length>0?`— ${I.length} issue${I.length===1?``:`s`}`:`— OK`}`,done:I.length===0},{label:`Link checks ${H.length>0?`— ${H.length} issue${H.length===1?``:`s`}`:`— OK`}`,done:H.length===0},{label:`i18n checks ${U.length>0?`— ${U.length} issue${U.length===1?``:`s`}`:`— OK`}`,done:U.length===0},{label:`Sidebar checks ${W.length>0?`— ${W.length} issue${W.length===1?``:`s`}`:`— OK`}`,done:W.length===0}];t.budget&&e.push({label:`Performance budget ${K.length>0?`— ${K.length} issue${K.length===1?``:`s`}`:`— OK`}`,done:K.length===0}),console.log(`\n${b(e)}`)}let J=0;if(t.fix){for(let e of q)if(e.fix){if(P.doctorConfig.fix.confirmChanges&&!await f(`Fix issue in "${e.file}": ${e.message}?`))continue;if(P.doctorConfig.fix.backupFiles){let t=c.resolve(P.docsDir,e.file);l.existsSync(t)&&await ee(t,c.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=c.resolve(e,n.reporting.outputFile);l.existsSync(c.dirname(t))||l.mkdirSync(c.dirname(t),{recursive:!0}),l.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){p();for(let[n,r]of Object.entries(e)){let e=[];for(let n of r){let r=n.level===`high`?`❌`:n.level===`warning`?`⚠️`:`ℹ️`,i=n.level===`high`?d.red:n.level===`warning`?d.yellow:d.blue;e.push(`${r} ${i(n.level.toUpperCase())}: ${n.message}`),n.suggestion&&e.push(` ${d.dim(`💡 ${n.suggestion}`)}`),t.fix&&n.fix&&e.push(` ${d.green(`✅ Fixed automatically`)}`)}console.log(`\n${v(e,{title:`📄 ${n}`})}`)}p()}if(q.length===0)console.log(_([` Everything looks perfect!`,` Your documentation is in great shape.`,``,` ${d.dim(`Scanned ${w.length} file${w.length===1?``:`s`} in ${Y}s`)}`],{title:`✨ Documentation Health Check`}));else{let e=[];X>0&&e.push(d.red(`${X} Critical Error${X===1?``:`s`}`)),Z>0&&e.push(d.yellow(`${Z} Warning${Z===1?``:`s`}`)),Q>0&&e.push(d.blue(`${Q} Improvement${Q===1?``:`s`}`));let t=[...u(e).split(`
|
|
7
|
+
`).map(e=>e.trimStart()),``,d.dim(`Scanned ${w.length} file${w.length===1?``:`s`} in ${Y}s`)];console.log(`\n${m(t,{title:`Diagnosis Results`})}\n`),J>0&&y(`Successfully fixed ${J} issues automatically!`),X>0?h(`Please fix the critical errors before building for production.`):y(`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`&&h(`Failed: Too many warnings (${Z} > ${n.reporting.maxWarnings})`),process.exit(1))}catch(e){h(`Doctor failed: ${e}`),process.exit(1)}}export{N as n,H as t};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
const e=require(`./chunk-
|
|
6
|
+
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(`@bdocs/dui`);function i(e){return e.replace(/^v/,``).replace(/^\[|\]$/g,``)}function a(e){let t=e.match(/Thanks \[@(\w+)\]/);return t?t[1]:void 0}function o(e){let t=e.match(/Thanks \[@[^\]]+\]\(([^)]+)\)/);return t?t[1]:void 0}function s(e){let t=e.match(/\[`([a-f0-9]+)`\]/);return t?t[1]:void 0}function c(e){let t=e.match(/\[`[a-f0-9]+`\]\(([^)]+)\)/);return t?t[1]:void 0}function l(e,t){let n=e;return n=n.replace(/Thanks \[@[^\]]+\]\([^)]+\)/g,``),n=n.replace(/\[`[a-f0-9]+`\]\([^)]+\)/g,``),n=n.replace(/!\s*-/g,``),n=n.replace(/^-\s*/,``),n=n.replace(/^feat:\s*/i,``),n=n.replace(/^fix:\s*/i,``),n=n.replace(/^perf:\s*/i,``),n=n.replace(/^refactor:\s*/i,``),n=n.replace(/^docs:\s*/i,``),n=n.replace(/^chore:\s*/i,``),n=n.replace(/^\*\*[a-z]+(\([^)]+\))?:\*\*/gi,``),n.trim()}function u(e){let t=/^###\s+(Minor Changes|Major Changes|Patch Changes)/m.test(e),n=/^##\s+v?(\d+\.\d+\.\d+)/m.test(e);return t&&n}function d(e,t){for(let n=t+1;n<Math.min(t+10,e.length);n++){let t=e[n].trim().toLowerCase();if(t.startsWith(`### major`))return`major`;if(t.startsWith(`### minor`))return`minor`;if(t.startsWith(`### patch`))return`patch`}return null}function f(e){let t=e.split(`
|
|
7
7
|
`),n=[],r=null,u=``;for(let e=0;e<t.length;e++){let f=t[e].trim(),p=f.match(/^##\s+v?(\d+\.\d+\.\d+)/);if(p){r&&n.push(r);let a=i(p[1]),o=`patch`,s,c=f.match(/\((\d{4}-\d{2}-\d{2})\)/);c&&(s=c[1]);let l=d(t,e);l&&(o=l),r={version:a,type:o,date:s,changes:[]},u=``;continue}let m=f.match(/^###\s+(.+)$/i);if(m){u=m[1].toLowerCase();continue}if(f.startsWith(`- `)&&r){let e=f.slice(2).trim(),t=`other`;u.includes(`feat`)||u.includes(`minor`)?t=`feat`:u.includes(`fix`)||u.includes(`patch`)?t=`fix`:u.includes(`perf`)?t=`perf`:u.includes(`refactor`)?t=`refactor`:u.includes(`docs`)||u.includes(`documentation`)?t=`docs`:u.includes(`chore`)&&(t=`chore`);let n={type:t,message:l(e,t),author:a(e),authorUrl:o(e),commit:s(e),commitUrl:c(e)};r.changes.push(n)}}return r&&n.push(r),n}const p={name:`changesets`,detect:u,parse:f},m={added:`feat`,changed:`refactor`,deprecated:`fix`,removed:`fix`,fixed:`fix`,security:`fix`};function h(e){let t=/^#\s+Changelog/i.test(e),n=/^##\s*\[[\d.]+\]\s*-\s*\d{4}-\d{2}-\d{2}/m.test(e),r=/^###\s+(Added|Changed|Deprecated|Removed|Fixed|Security)$/m.test(e);return t&&n&&r}function g(e){let t=e.split(`
|
|
8
8
|
`),n=[],r=null,u=``;for(let e=0;e<t.length;e++){let d=t[e].trim(),f=d.match(/^##\s*\[(\d+\.\d+\.\d+[^\]]*)\]\s*-\s*(\d{4}-\d{2}-\d{2})/);if(f){r&&n.push(r),r={version:i(f[1]),type:`patch`,date:f[2],changes:[]},u=``;continue}if(d.match(/^##\s*\[Unreleased\]/i)){r&&n.push(r),r={version:`unreleased`,type:`patch`,date:void 0,changes:[]},u=``;continue}let p=d.match(/^###\s+(Added|Changed|Deprecated|Removed|Fixed|Security)$/i);if(p){u=p[1].toLowerCase();continue}if((d.startsWith(`- `)||d.startsWith(`* `))&&r){let e=d.slice(2).trim(),t=m[u]||`other`,n={type:t,message:l(e,t),author:a(e),authorUrl:o(e),commit:s(e),commitUrl:c(e)};r.changes.push(n)}}return r&&n.push(r),n}const _={name:`keep-a-changelog`,detect:h,parse:g},v={features:`feat`,"breaking changes":`feat`,breaking:`feat`,"bug fixes":`fix`,bugfixes:`fix`,fixes:`fix`,performance:`perf`,"build system":`chore`,builds:`chore`,tests:`chore`,chores:`chore`,documentation:`docs`,docs:`docs`,revert:`fix`,reverts:`fix`,refactor:`refactor`,"code refactoring":`refactor`};function y(e){let t=/^###\s+(Features|Bug Fixes|BREAKING CHANGES|Build System|Tests|Chores|Documentation|Reverts)/m.test(e),n=/^\*\*[a-z]+(\([^)]+\))?:\*\*/m.test(e),r=/^##\s*\[[\d.]+\]\([^)]+\)\s*\(\d{4}-\d{2}-\d{2}\)/m.test(e);return t&&(n||r)}function b(e){let t=e.split(`
|
|
9
9
|
`),n=[],r=null,u=``;for(let e=0;e<t.length;e++){let d=t[e].trim(),f=d.match(/^##\s*\[(\d+\.\d+\.\d+[^\]]*)\]\([^)]+\)\s*\((\d{4}-\d{2}-\d{2})\)/);if(f){r&&n.push(r);let a=i(f[1]),o=`patch`;for(let n=e+1;n<Math.min(e+20,t.length);n++){let e=t[n].toLowerCase();if(e.includes(`major`)||e.includes(`breaking`)){o=`major`;break}(e.includes(`minor`)||e.includes(`feat`))&&(o=`minor`)}r={version:a,type:o,date:f[2],changes:[]},u=``;continue}let p=d.match(/^###\s+(.+)$/i);if(p){u=p[1].toLowerCase();continue}if((d.startsWith(`- `)||d.startsWith(`* `))&&r){let e=d.slice(2).trim(),t=v[u]||`other`,n={type:t,message:l(e,t),author:a(e),authorUrl:o(e),commit:s(e),commitUrl:c(e)};r.changes.push(n)}}return r&&n.push(r),n}const x={name:`semantic-release`,detect:y,parse:b},S={features:`feat`,"breaking changes":`feat`,breaking:`feat`,"bug fixes":`fix`,fixes:`fix`,performance:`perf`,"build system":`chore`,builds:`chore`,tests:`chore`,chores:`chore`,documentation:`docs`,docs:`docs`,revert:`fix`,reverts:`fix`,refactor:`refactor`,"code refactoring":`refactor`};function C(e){let t=/^##\s+(\d+\.\d+\.\d+)\s*\((\d{4}-\d{2}-\d{2})\)/m.test(e),n=/^###\s+(Features|Bug Fixes|BREAKING CHANGES|Build System|Tests|Chores|Documentation)/m.test(e),r=/^[*-]\s+/m.test(e);return t&&n&&r}function w(e){let t=e.split(`
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import{t as e}from"./
|
|
6
|
+
import{t as e}from"./chunk-BFSpntXv.mjs";import*as t from"zod";import n from"node:crypto";function r(e,t){let r={alg:`RS256`,typ:`JWT`},i=Math.floor(Date.now()/1e3),a={iat:i-60,exp:i+600,iss:e},o=e=>Buffer.from(JSON.stringify(e)).toString(`base64url`),s=o(r),c=o(a),l=n.createSign(`RSA-SHA256`);l.update(`${s}.${c}`);let u=t.replace(/\\n/g,`
|
|
7
7
|
`);return`${s}.${c}.${l.sign(u,`base64`)}`}async function i(e,t,n){let i=r(e,t),a=await fetch(`https://api.github.com/app/installations/${n}/access_tokens`,{method:`POST`,headers:{Authorization:`Bearer ${i}`,Accept:`application/vnd.github+json`,"User-Agent":`Boltdocs-Feedback`}});if(!a.ok){let e=await a.text();throw Error(`Failed to get installation access token: ${a.status} ${e}`)}return(await a.json()).token}async function a(e,t,n={}){let r=await fetch(`https://api.github.com/graphql`,{method:`POST`,headers:{Authorization:`bearer ${e}`,"Content-Type":`application/json`,"User-Agent":`Boltdocs-Feedback`},body:JSON.stringify({query:t,variables:n})});if(!r.ok){let e=await r.text();throw Error(`GitHub GraphQL API error: ${r.status} ${e}`)}let i=await r.json();if(i.errors?.length){let e=i.errors.map(e=>e.message).join(`, `);throw Error(`GitHub GraphQL Error: ${e}`)}return i.data}async function o(e,t){let n=t.token;if(!n)if(t.appId&&t.privateKey&&t.installationId)n=await i(t.appId,t.privateKey,t.installationId);else throw Error(`GitHub authentication credentials missing. Provide GITHUB_TOKEN or GITHUB_APP_* variables.`);let{owner:r,repo:o,categorySlug:s=`general`}=t,{rating:c,comment:l,path:u,title:d,blockId:f}=e,p=await a(n,`query GetRepoAndCategory($owner: String!, $name: String!, $categorySlug: String!) {
|
|
8
8
|
repository(owner: $owner, name: $name) {
|
|
9
9
|
id
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
const e=require(`./chunk-
|
|
6
|
+
const e=require(`./chunk-D1Md3oWO.cjs`);let t=require(`zod`);t=e.r(t);let n=require(`node:crypto`);n=e.r(n);function r(e,t){let r={alg:`RS256`,typ:`JWT`},i=Math.floor(Date.now()/1e3),a={iat:i-60,exp:i+600,iss:e},o=e=>Buffer.from(JSON.stringify(e)).toString(`base64url`),s=o(r),c=o(a),l=n.default.createSign(`RSA-SHA256`);l.update(`${s}.${c}`);let u=t.replace(/\\n/g,`
|
|
7
7
|
`);return`${s}.${c}.${l.sign(u,`base64`)}`}async function i(e,t,n){let i=r(e,t),a=await fetch(`https://api.github.com/app/installations/${n}/access_tokens`,{method:`POST`,headers:{Authorization:`Bearer ${i}`,Accept:`application/vnd.github+json`,"User-Agent":`Boltdocs-Feedback`}});if(!a.ok){let e=await a.text();throw Error(`Failed to get installation access token: ${a.status} ${e}`)}return(await a.json()).token}async function a(e,t,n={}){let r=await fetch(`https://api.github.com/graphql`,{method:`POST`,headers:{Authorization:`bearer ${e}`,"Content-Type":`application/json`,"User-Agent":`Boltdocs-Feedback`},body:JSON.stringify({query:t,variables:n})});if(!r.ok){let e=await r.text();throw Error(`GitHub GraphQL API error: ${r.status} ${e}`)}let i=await r.json();if(i.errors?.length){let e=i.errors.map(e=>e.message).join(`, `);throw Error(`GitHub GraphQL Error: ${e}`)}return i.data}async function o(e,t){let n=t.token;if(!n)if(t.appId&&t.privateKey&&t.installationId)n=await i(t.appId,t.privateKey,t.installationId);else throw Error(`GitHub authentication credentials missing. Provide GITHUB_TOKEN or GITHUB_APP_* variables.`);let{owner:r,repo:o,categorySlug:s=`general`}=t,{rating:c,comment:l,path:u,title:d,blockId:f}=e,p=await a(n,`query GetRepoAndCategory($owner: String!, $name: String!, $categorySlug: String!) {
|
|
8
8
|
repository(owner: $owner, name: $name) {
|
|
9
9
|
id
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
+
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import{t as e}from"./chunk-BFSpntXv.mjs";var t=e({SECURITY_HEADERS:()=>n});const n={"X-Content-Type-Options":`nosniff`,"X-Frame-Options":`DENY`,"X-XSS-Protection":`1; mode=block`,"Referrer-Policy":`strict-origin-when-cross-origin`,"Permissions-Policy":`camera=(), microphone=(), geolocation=()`,"Strict-Transport-Security":`max-age=31536000; includeSubDomains; preload`};export{t as n,n as t};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
var e=require(`./chunk-
|
|
6
|
+
var e=require(`./chunk-D1Md3oWO.cjs`).t({SECURITY_HEADERS:()=>t});const t={"X-Content-Type-Options":`nosniff`,"X-Frame-Options":`DENY`,"X-XSS-Protection":`1; mode=block`,"Referrer-Policy":`strict-origin-when-cross-origin`,"Permissions-Policy":`camera=(), microphone=(), geolocation=()`,"Strict-Transport-Security":`max-age=31536000; includeSubDomains; preload`};Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { O as Link, r as cn, t as Link$1 } from "./link-2PzgTnaP.js";
|
|
7
7
|
import * as React$1 from "react";
|
|
8
8
|
import { createContext, use, useEffect, useState } from "react";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -125,7 +125,7 @@ const Heading = React$1.forwardRef(({ level, id, children, className, showAnchor
|
|
|
125
125
|
return /* @__PURE__ */ jsx(Tag, {
|
|
126
126
|
ref,
|
|
127
127
|
id,
|
|
128
|
-
className: cn("boltdocs-heading relative group flex items-center scroll-mt-24", className),
|
|
128
|
+
className: cn("boltdocs-heading relative group flex items-center gap-4 scroll-mt-24", className),
|
|
129
129
|
...props,
|
|
130
130
|
children: renderContent()
|
|
131
131
|
});
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
const
|
|
6
|
+
const require_link = require('./link-D1Gjkb-2.cjs');
|
|
7
7
|
let react = require("react");
|
|
8
|
-
react =
|
|
8
|
+
react = require_link.__toESM(react);
|
|
9
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
10
|
let react_aria_components = require("react-aria-components");
|
|
11
|
-
react_aria_components =
|
|
11
|
+
react_aria_components = require_link.__toESM(react_aria_components);
|
|
12
12
|
|
|
13
13
|
//#region src/client/app/theme-context.tsx
|
|
14
14
|
const THEME_CONTEXT_SYMBOL = Symbol.for("__BDOCS_THEME_CONTEXT__");
|
|
@@ -94,30 +94,30 @@ function useTheme() {
|
|
|
94
94
|
const Heading = react.forwardRef(({ level, id, children, className, showAnchor = true, anchorPosition = "wrap", anchorIcon, anchorClassName, ...props }, ref) => {
|
|
95
95
|
const Tag = `h${Math.min(Math.max(Math.floor(level), 1), 6)}`;
|
|
96
96
|
const hasAnchor = !!(id && showAnchor);
|
|
97
|
-
const defaultIcon = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
98
|
-
className:
|
|
97
|
+
const defaultIcon = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_link.Link$1, {
|
|
98
|
+
className: require_link.cn("transition-all duration-200", anchorPosition === "wrap" ? "opacity-0 ml-2 text-muted/50 group-hover:text-primary-500 group-hover:opacity-100" : "text-muted/50 hover:text-primary-500"),
|
|
99
99
|
size: 16
|
|
100
100
|
});
|
|
101
101
|
const icon = anchorIcon ?? defaultIcon;
|
|
102
102
|
const renderContent = () => {
|
|
103
103
|
if (!hasAnchor) return children;
|
|
104
|
-
if (anchorPosition === "wrap") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
104
|
+
if (anchorPosition === "wrap") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_link.Link, {
|
|
105
105
|
href: `#${id}`,
|
|
106
|
-
className:
|
|
106
|
+
className: require_link.cn("header-anchor flex flex-row items-center no-underline text-inherit", anchorClassName),
|
|
107
107
|
"aria-label": "Anchor",
|
|
108
108
|
children: [children, icon]
|
|
109
109
|
});
|
|
110
110
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
111
|
-
anchorPosition === "before" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
111
|
+
anchorPosition === "before" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_link.Link, {
|
|
112
112
|
href: `#${id}`,
|
|
113
|
-
className:
|
|
113
|
+
className: require_link.cn("header-anchor mr-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200", anchorClassName),
|
|
114
114
|
"aria-label": "Anchor",
|
|
115
115
|
children: icon
|
|
116
116
|
}),
|
|
117
117
|
children,
|
|
118
|
-
anchorPosition === "after" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
118
|
+
anchorPosition === "after" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_link.Link, {
|
|
119
119
|
href: `#${id}`,
|
|
120
|
-
className:
|
|
120
|
+
className: require_link.cn("header-anchor ml-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200", anchorClassName),
|
|
121
121
|
"aria-label": "Anchor",
|
|
122
122
|
children: icon
|
|
123
123
|
})
|
|
@@ -126,7 +126,7 @@ const Heading = react.forwardRef(({ level, id, children, className, showAnchor =
|
|
|
126
126
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tag, {
|
|
127
127
|
ref,
|
|
128
128
|
id,
|
|
129
|
-
className:
|
|
129
|
+
className: require_link.cn("boltdocs-heading relative group flex items-center gap-4 scroll-mt-24", className),
|
|
130
130
|
...props,
|
|
131
131
|
children: renderContent()
|
|
132
132
|
});
|
|
@@ -141,7 +141,7 @@ Heading.displayName = "Heading";
|
|
|
141
141
|
*/
|
|
142
142
|
function CodeBlock({ children, className, plain = false, ...props }) {
|
|
143
143
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
144
|
-
className:
|
|
144
|
+
className: require_link.cn("not-prose boltdocs-code-block", "group relative overflow-hidden bg-(--color-code-bg)", "contain-layout contain-paint", { "my-6 rounded-xl border border-subtle": !plain }, className),
|
|
145
145
|
...props,
|
|
146
146
|
children
|
|
147
147
|
});
|
|
@@ -152,7 +152,7 @@ function CodeBlock({ children, className, plain = false, ...props }) {
|
|
|
152
152
|
*/
|
|
153
153
|
function CodeBlockHeader({ children, className, ...props }) {
|
|
154
154
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
155
|
-
className:
|
|
155
|
+
className: require_link.cn("flex h-9 items-center justify-between px-4 py-1.5", "text-[13px] font-medium text-muted", className),
|
|
156
156
|
...props,
|
|
157
157
|
children
|
|
158
158
|
});
|
|
@@ -162,7 +162,7 @@ function CodeBlockHeader({ children, className, ...props }) {
|
|
|
162
162
|
*/
|
|
163
163
|
function CodeBlockGroup({ children, className, ...props }) {
|
|
164
164
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
165
|
-
className:
|
|
165
|
+
className: require_link.cn("flex items-center space-x-2", className),
|
|
166
166
|
...props,
|
|
167
167
|
children
|
|
168
168
|
});
|
|
@@ -173,7 +173,7 @@ function CodeBlockGroup({ children, className, ...props }) {
|
|
|
173
173
|
*/
|
|
174
174
|
function CodeBlockContent({ className, children, shouldTruncate = false, ...props }) {
|
|
175
175
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
176
|
-
className:
|
|
176
|
+
className: require_link.cn("relative", { "[&>pre]:max-h-[300px] [&>pre]:overflow-hidden [&>div>pre]:max-h-[300px] [&>div>pre]:overflow-hidden": shouldTruncate }, className),
|
|
177
177
|
...props,
|
|
178
178
|
children
|
|
179
179
|
});
|
|
@@ -192,7 +192,7 @@ function TooltipContent({ className, children, ...props }) {
|
|
|
192
192
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Tooltip, {
|
|
193
193
|
...props,
|
|
194
194
|
offset: 8,
|
|
195
|
-
className: (values) =>
|
|
195
|
+
className: (values) => require_link.cn("group z-50 overflow-visible rounded-md bg-surface px-2.5 py-1.5 text-xs font-medium text-body ring-1 ring-subtle outline-hidden select-none", "data-entering:animate-in data-entering:fade-in data-entering:zoom-in-95 data-entering:duration-100", "data-exiting:animate-out data-exiting:fade-out data-exiting:zoom-out-95 data-exiting:duration-75", "data-[placement=top]:slide-in-from-bottom-1", "data-[placement=bottom]:slide-in-from-top-1", "data-[placement=left]:slide-in-from-right-1", "data-[placement=right]:slide-in-from-left-1", typeof className === "function" ? className(values) : className),
|
|
196
196
|
children: (values) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.OverlayArrow, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
197
197
|
width: 8,
|
|
198
198
|
height: 8,
|
|
@@ -225,7 +225,7 @@ function Image({ theme, className, ...props }) {
|
|
|
225
225
|
const { resolvedTheme } = useTheme();
|
|
226
226
|
if (theme && theme !== resolvedTheme) return null;
|
|
227
227
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
228
|
-
className:
|
|
228
|
+
className: require_link.cn("max-w-full h-auto rounded-lg my-8", className),
|
|
229
229
|
...props
|
|
230
230
|
});
|
|
231
231
|
}
|