boltdocs 3.3.5 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/dist/{adapters-BKzKe2mO.mjs → adapters-BXiBWAKs.mjs} +1 -1
  2. package/dist/{adapters-DwDTQoCG.cjs → adapters-Czl3WtQt.cjs} +1 -1
  3. package/dist/{build-B672n0hL.cjs → build-CNkXRdk8.cjs} +1 -1
  4. package/dist/{build-BVoMHMhw.mjs → build-CqUBsXVC.mjs} +1 -1
  5. package/dist/client/index.cjs +245 -56
  6. package/dist/client/index.d.cts +3 -3
  7. package/dist/client/index.d.ts +3 -3
  8. package/dist/client/index.js +246 -60
  9. package/dist/client/mdx.cjs +1 -1
  10. package/dist/client/mdx.js +1 -1
  11. package/dist/client/primitives.cjs +5 -5
  12. package/dist/client/primitives.d.cts +92 -42
  13. package/dist/client/primitives.d.ts +101 -51
  14. package/dist/client/primitives.js +4 -4
  15. package/dist/client/router.cjs +1 -1
  16. package/dist/client/router.d.cts +1 -1
  17. package/dist/client/router.d.ts +1 -1
  18. package/dist/client/router.js +1 -1
  19. package/dist/client/theme/reset.css +41 -0
  20. package/dist/config-B3SEoVjG.cjs +7 -0
  21. package/dist/{config-PLvresCv.cjs → config-Bfakeadu.cjs} +1 -1
  22. package/dist/config-CTcfF-0c.mjs +7 -0
  23. package/dist/dev-D1DmOSjn.mjs +6 -0
  24. package/dist/dev-DH6cSge8.cjs +6 -0
  25. package/dist/{docs-layout-CbZ7LDRe.js → docs-layout-CmntYM6p.js} +46 -147
  26. package/dist/{docs-layout-vzfXed1Q.cjs → docs-layout-DIgxJ5c7.cjs} +23 -130
  27. package/dist/{doctor-DMECtdK6.cjs → doctor-BLxm2alc.cjs} +1 -1
  28. package/dist/{doctor-FuFY1jBz.cjs → doctor-Dd-JMTRo.cjs} +1 -1
  29. package/dist/{doctor-i8Qmd8DJ.mjs → doctor-DogHujrP.mjs} +1 -1
  30. package/dist/{image-Hnaa2bJd.cjs → image-Bke2ojW1.cjs} +3 -3
  31. package/dist/{image-B-NDSDuY.js → image-CaY2w0ua.js} +2 -1
  32. package/dist/index--xbYbT8N.d.ts +343 -0
  33. package/dist/{index-Bg-JtZeK.d.cts → index-B_o5y34l.d.cts} +112 -13
  34. package/dist/{index-B3o307nd.d.ts → index-Bx0CUd7Q.d.ts} +112 -13
  35. package/dist/index-RK7W_Fxy.d.cts +343 -0
  36. package/dist/{link-CgdI6O2o.js → link-CSe_oD8Y.js} +137 -139
  37. package/dist/{link-vZjmD-es.cjs → link-Xb69Oy2F.cjs} +144 -169
  38. package/dist/{mdx-D0Absdq5.cjs → mdx-BCOrMd-P.cjs} +68 -16
  39. package/dist/{mdx-BRT71V5Q.js → mdx-BijiEbkp.js} +62 -15
  40. package/dist/{native-nLA4Jr0T.cjs → native-BbtRkce5.cjs} +1 -1
  41. package/dist/node/cli-entry.cjs +1 -1
  42. package/dist/node/cli-entry.mjs +1 -1
  43. package/dist/node/highlight.d.cts +2 -2
  44. package/dist/node/highlight.d.mts +2 -2
  45. package/dist/node/index.cjs +1 -1
  46. package/dist/node/index.d.cts +19 -37
  47. package/dist/node/index.d.mts +20 -38
  48. package/dist/node/index.mjs +1 -1
  49. package/dist/node/mdx/shiki-adapter.cjs +1 -1
  50. package/dist/node/mdx/shiki-adapter.d.cts +7 -2
  51. package/dist/node/mdx/shiki-adapter.d.mts +7 -2
  52. package/dist/node/mdx/shiki-adapter.mjs +1 -1
  53. package/dist/node-BgiLCa0I.cjs +39 -0
  54. package/dist/node-Da3tYBHo.mjs +39 -0
  55. package/dist/{package-CNqjEYE1.cjs → package-D1gVs5gQ.cjs} +1 -1
  56. package/dist/{package-sdcKhDhe.mjs → package-YgQJn3Yh.mjs} +1 -1
  57. package/dist/pages-external-B_r6gvqP.cjs +6 -0
  58. package/dist/pages-external-jmK7AHaO.mjs +6 -0
  59. package/dist/{parser-CD8Oo8qh.mjs → parser-CvNZc5s3.mjs} +1 -1
  60. package/dist/{parser-vPaKvzLp.cjs → parser-DJLWTiO-.cjs} +1 -1
  61. package/dist/plugin-DW9K2fW5.mjs +69 -0
  62. package/dist/plugin-NwGKyTJX.cjs +69 -0
  63. package/dist/{plugin-context-DuSg-Hax.mjs → plugin-context-COh-cbsW.mjs} +1 -1
  64. package/dist/{plugin-context-CscLcXjH.cjs → plugin-context-FIHaWn6r.cjs} +2 -2
  65. package/dist/{plugin-lifecycle-BywrEoWK.cjs → plugin-lifecycle-D9fTRaWY.cjs} +1 -1
  66. package/dist/{registry-BbB6NqSv.d.cts → registry-BFmzj1yg.d.mts} +1 -1
  67. package/dist/{registry-sJqDv0kE.d.mts → registry-BoswPzYV.d.cts} +1 -1
  68. package/dist/{resolve-C5rT6B21.mjs → resolve-5puUe7eS.mjs} +1 -1
  69. package/dist/{resolve-BelytNYR.cjs → resolve-CF4ZLfqx.cjs} +1 -1
  70. package/dist/route-paths-B6ocUfNY.cjs +6 -0
  71. package/dist/route-paths-DyDji4bX.mjs +6 -0
  72. package/dist/{router-CZBxMRAH.js → router-B5e8k4qK.js} +175 -10
  73. package/dist/{router-C3kygdRK.cjs → router-DKC0Lu0n.cjs} +204 -9
  74. package/dist/{routes-C3_w9fLX.cjs → routes-D55M8UrH.cjs} +1 -1
  75. package/dist/routes-DdE6Lfcl.cjs +6 -0
  76. package/dist/routes-_I_8PQYF.mjs +6 -0
  77. package/dist/{search-dialog-x_qHU8ty.cjs → search-dialog-BOQRHKTb.cjs} +197 -24
  78. package/dist/{search-dialog-BqkzDTq2.js → search-dialog-BXil4_7P.js} +190 -29
  79. package/dist/search-dialog-CwlBd-Mu.cjs +747 -0
  80. package/dist/{search-dialog-B9mdxsUC.js → search-dialog-D3Obh3eA.js} +1 -1
  81. package/dist/search-dialog-DeplpVEB.js +717 -0
  82. package/dist/{search-dialog-DCtm2dyR.cjs → search-dialog-cHXR5zhL.cjs} +1 -1
  83. package/dist/server/index.cjs +1 -1
  84. package/dist/server/index.d.mts +1 -1
  85. package/dist/server/index.mjs +1 -1
  86. package/dist/ssg-static-options-Br1_u9qp.mjs +6 -0
  87. package/dist/ssg-static-options-CVvGKM8i.cjs +6 -0
  88. package/dist/types-58Ac3UGI.d.cts +114 -0
  89. package/dist/types-BwnGf-1E.d.mts +114 -0
  90. package/dist/virtual-modules-C4-qxFlL.cjs +40 -0
  91. package/dist/virtual-modules-DiWUKJGP.mjs +40 -0
  92. package/package.json +8 -5
  93. package/src/shared/types.ts +133 -987
  94. package/dist/config-CrsQJHQz.cjs +0 -7
  95. package/dist/config-DC0nMMk7.mjs +0 -7
  96. package/dist/dev-B49V6O6p.mjs +0 -6
  97. package/dist/dev-DbuhNcF5.cjs +0 -6
  98. package/dist/index-CgWkOCCn.d.cts +0 -1193
  99. package/dist/index-CuNSD3E2.d.ts +0 -1193
  100. package/dist/node-BljvHMpS.cjs +0 -23
  101. package/dist/node-CWxGw4H4.mjs +0 -23
  102. package/dist/pages-external-BBw8ObVK.mjs +0 -6
  103. package/dist/pages-external-DPiPFxxP.cjs +0 -6
  104. package/dist/plugin-BPcm1cU0.mjs +0 -69
  105. package/dist/plugin-WUhxnpko.cjs +0 -69
  106. package/dist/routes-C0kb4ue6.cjs +0 -6
  107. package/dist/routes-C4wrLWwu.mjs +0 -6
  108. package/dist/search-dialog-Bp_ouN1c.cjs +0 -550
  109. package/dist/search-dialog-an2BNMj6.js +0 -526
  110. package/dist/types-Db6zToZH.d.mts +0 -975
  111. package/dist/types-o7iZ2BAR.d.cts +0 -975
  112. package/dist/virtual-modules-B2X4Ht2r.mjs +0 -39
  113. package/dist/virtual-modules-DPsdHKcu.cjs +0 -39
  114. /package/dist/{audit-CMc_ydRr.mjs → audit-CYAkXXvP.mjs} +0 -0
  115. /package/dist/{audit-CHkGiV3c.cjs → audit-DxCZZTuX.cjs} +0 -0
  116. /package/dist/{csp-BiGAG8aF.cjs → csp-B-gc2Iha.cjs} +0 -0
  117. /package/dist/{csp-D0BOH8ae.mjs → csp-f8DOcI_7.mjs} +0 -0
  118. /package/dist/{generator-BCrZL53x.cjs → generator-CBAPKY6r.cjs} +0 -0
  119. /package/dist/{generator-CFukoGa0.mjs → generator-MRpn-yp6.mjs} +0 -0
  120. /package/dist/{handler-Lex5DbvG.mjs → handler-DBZqoWt2.mjs} +0 -0
  121. /package/dist/{handler-Ch-Q9NAB.cjs → handler-ryZR9Q41.cjs} +0 -0
  122. /package/dist/{index-HAwIo4nZ.d.mts → index-CPr34I2C.d.mts} +0 -0
  123. /package/dist/{native-BYKMke79.mjs → native-DZ6WMwjG.mjs} +0 -0
  124. /package/dist/{native-BOet8hpE.cjs → native-DeKxny_T.cjs} +0 -0
  125. /package/dist/{update-check-BXD1atVv.mjs → update-check-BXx8te9F.mjs} +0 -0
  126. /package/dist/{update-check-DFQZyoSU.cjs → update-check-CiIeC7CX.cjs} +0 -0
@@ -1,39 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- import{_ as e,g as t,h as n}from"./plugin-context-DuSg-Hax.mjs";import{u as r}from"./utils-8lzafE49.mjs";import{c as i,l as a,s as o,t as s}from"./routes-C4wrLWwu.mjs";import c from"node:path";import l from"node:fs";function u(e){return typeof e==`string`?[e]:Array.isArray(e)?e.flatMap(u):e&&typeof e==`object`?Object.values(e).flatMap(u):[]}const d=new Set([`title`,`description`,`permalink`,`sidebarPosition`,`sidebarLabel`,`sidebarHidden`,`hidden`,`category`,`order`,`badge`,`icon`,`date`,`lastUpdated`,`groupTitle`,`groupPosition`,`seo`]);function f(e){let t=[];for(let n of e){let e=``;n.frontmatter&&(e=u(Object.entries(n.frontmatter).filter(([e])=>!d.has(e)).map(([e,t])=>t)).join(` `));let r=(e?`${n._content||``} ${e}`:n._content||``).slice(0,500);if(t.push({id:n.path,title:n.title,content:r,url:n.path,display:n.groupTitle?`${n.groupTitle} > ${n.title}`:n.title,locale:n.locale,version:n.version}),n.headings)for(let e of n.headings)t.push({id:`${n.path}#${e.id}`,title:e.text,content:`${e.text} in ${n.title}`,url:`${n.path}#${e.id}`,display:`${n.title} > ${e.text}`,locale:n.locale,version:n.version})}return t}function p(e){return{path:e.path,filePath:e.filePath,title:e.title,description:e.description||``,sidebarPosition:e.sidebarPosition,badge:e.badge,icon:e.icon,headings:e.headings||[],frontmatter:e.frontmatter,locale:e.locale,version:e.version,tab:e.tab,collection:e.collection,tags:e.tags,author:e.author,draft:e.draft,excerpt:e.excerpt,coverImage:e.coverImage,group:e.group,groupTitle:e.groupTitle,groupPosition:e.groupPosition,groupIcon:e.groupIcon,subRouteGroup:e.subRouteGroup,seo:e.seo,date:e.date,lastUpdated:e.lastUpdated,category:e.category,order:e.order,sidebarLabel:e.sidebarLabel,sidebarHidden:e.sidebarHidden,slugParts:e.slugParts}}function m(e){return{routeCacheContext:e,routeGenerationFingerprint:void 0,directoryMetaCache:null,routesDataMap:new Map,collectionsDataMap:new Map,searchDataMap:new Map}}const h=m();function g(e){return e??h}function _(e){let t=g(e);t.directoryMetaCache=null,t.routeGenerationFingerprint=void 0,t.routeCacheVariant=void 0,t.routesDataMap.clear(),t.collectionsDataMap.clear(),t.searchDataMap.clear()}function v(e,t){return(!t.routeCacheContext||t.routeCacheContext.disposed)&&(t.routeCacheContext=o(e),t.routeCacheVariant=void 0,t.routeGenerationFingerprint=void 0,t.routesDataMap.clear(),t.collectionsDataMap.clear(),t.searchDataMap.clear()),t.routeCacheContext}async function y(e,t,n,r){let o=g(n),c=v(e,o),l=a(t),u=(r?.fingerprint===l&&c.variants.get(l)===r?r:void 0)??i(c,l);o.routeCacheVariant=u,o.routeGenerationFingerprint=l;let d=await s(e,t,void 0,!1,c,u);o.routesDataMap.clear();for(let e of d)o.routesDataMap.set(e.path,e);b(o)}function b(e){let t=g(e),n=Array.from(t.routesDataMap.values()),r=f(n);t.searchDataMap.clear();for(let e of r)t.searchDataMap.set(e.id,e);t.collectionsDataMap.clear();for(let e of n)if(e.collection){let n={path:e.path,title:e.title,date:e.date,excerpt:e.excerpt,tags:e.tags,author:e.author,coverImage:e.coverImage,filePath:e.filePath,locale:e.locale,version:e.version,frontmatter:e.frontmatter,draft:e.frontmatter?.draft,collection:e.collection};t.collectionsDataMap.set(e.filePath,n)}}async function x(e,t,n){let r=g(n);v(e,r);let i=a(t);(r.routesDataMap.size===0||r.routeGenerationFingerprint!==i)&&(r.routesDataMap.clear(),r.collectionsDataMap.clear(),r.searchDataMap.clear(),await y(e,t,r))}function S(e){let t=g(e),n={},r=Array.from(t.collectionsDataMap.values()).sort((e,t)=>{let n=e=>{if(!e)return-1/0;let t=new Date(e).getTime();return Number.isFinite(t)?t:-1/0},r=n(e.date),i=n(t.date)-r;return i===0?e.path.localeCompare(t.path):i});for(let e of r){let t=e.collection;t&&(n[t]||(n[t]=[]),n[t].push(e))}return n}function C(e,t=e=>e){let n=Array.from(e.values(),t).sort((e,t)=>{let n=e=>{if(typeof e!=`object`||!e)return String(e);let t=e;return`${String(t.path||``)}\u0000${String(t.id||``)}\u0000${String(t.filePath||``)}`};return n(e).localeCompare(n(t))});return`export default ${JSON.stringify(n)};`}function w(e){return Array.from(g(e).searchDataMap.values()).sort((e,t)=>e.id.localeCompare(t.id))}function T(e){return`export default ${JSON.stringify(e)};`}async function E(e,t,n,r,i){let o=g(n);r&&(o.routeCacheContext=r),i&&(o.routeCacheVariant=i);let s=a(t);o.routeGenerationFingerprint!==s&&(o.routesDataMap.clear(),o.collectionsDataMap.clear(),o.searchDataMap.clear());let c=new Map(o.routesDataMap),l=new Map(o.collectionsDataMap),u=new Map(o.searchDataMap);await y(e,t,o);let d={routes:{updated:[],deleted:[]},collections:{updated:[],deleted:[]},search:{updated:[],deleted:[]}};for(let[e,t]of o.routesDataMap){let n=c.get(e);(!n||JSON.stringify(n)!==JSON.stringify(t))&&d.routes.updated.push(p(t))}for(let e of c.keys())o.routesDataMap.has(e)||d.routes.deleted.push(e);for(let[e,t]of o.collectionsDataMap){let n=l.get(e);(!n||JSON.stringify(n)!==JSON.stringify(t))&&d.collections.updated.push(t)}for(let e of l.keys())o.collectionsDataMap.has(e)||d.collections.deleted.push(e);for(let[e,t]of o.searchDataMap){let n=u.get(e);(!n||JSON.stringify(n)!==JSON.stringify(t))&&d.search.updated.push(t)}for(let e of u.keys())o.searchDataMap.has(e)||d.search.deleted.push(e);return d}function D(i,a,o,s,u,d){let f=u?.virtualModuleRegistry??n,m=g(d);return{name:`vite-plugin-boltdocs-virtual-modules`,resolveId(e){if(o()?.root||process.cwd(),e.includes(`boltdocs-entry`)||e===`virtual:boltdocs-entry`||e===`boltdocs/entry`||e===`boltdocs-entry`||e===`\0virtual:boltdocs-entry`||e===`\0virtual:boltdocs-entry.tsx`)return`\0virtual:boltdocs-entry.tsx`;if(e.includes(`boltdocs-client`)||e===`virtual:boltdocs-client`||e===`boltdocs/client`||e===`boltdocs-client`||e===`\0virtual:boltdocs-client.mjs`)return`\0virtual:boltdocs-client.mjs`;if(e.startsWith(`\0`)){let t=e.slice(1);if(!t.startsWith(`virtual:boltdocs-`)&&f?.has(t))return e}else if(!e.startsWith(`virtual:boltdocs-`)&&f?.has(e))return`\0`+e;return e.startsWith(`virtual:boltdocs-`)?`\0`+e:e.startsWith(`\0virtual:boltdocs-`)?e:null},async load(n,u){let d=a(),h=n.startsWith(`\0`)?n.slice(1):n;if(!h.includes(`boltdocs-entry.tsx`)&&!h.includes(`boltdocs-client.mjs`)&&!h.startsWith(`virtual:boltdocs-`)&&f?.has(h)){let e=f?.get(h);if(!e)return null;try{let t=await e.loader();if(typeof t!=`string`)throw Error(`[boltdocs] Plugin virtual module '${h}' loader must return a string source code, got ${typeof t}.`);return t}catch(e){throw Error(`[boltdocs] Plugin virtual module '${h}' failed to load: ${e instanceof Error?e.message:String(e)}`)}}if(n.includes(`boltdocs-entry.tsx`)||n===`\0virtual:boltdocs-entry`){let e=this.environment?.config?.consumer,n=o(),r=e===void 0?!!n?.build?.ssr:e!==`client`;return t({...i,ssr:r,useCompiledPages:n?.command===`build`},d)}if(n.includes(`boltdocs-client.mjs`)||n===`\0virtual:boltdocs-client.ts`||n===`virtual:boltdocs-client`){let t=e,n=t;for(;t!==c.parse(t).root;){if(l.existsSync(c.join(t,`package.json`))&&JSON.parse(l.readFileSync(c.join(t,`package.json`),`utf-8`)).name===`boltdocs`){n=t;break}t=c.dirname(t)}let i=c.join(n,`src/client/index.ts`),a=c.join(n,`dist/client/index.js`);return`export * from '${r(l.existsSync(i)?i:a)}';`}if(!n.startsWith(`\0virtual:boltdocs-`))return;let g=n.replace(`\0virtual:boltdocs-`,``).replace(/\.tsx?$/,``);if(g===`routes`)return await x(s,d,m),C(m.routesDataMap,p);if(g===`collections`)return await x(s,d,m),T(S(m));if(g===`config`){await x(s,d,m);let e=m.routeCacheVariant?.directoryMeta||{};m.directoryMetaCache=e;let t=[...new Set(Array.from(m.routesDataMap.values()).map(e=>e.collection).filter(e=>!!e))].sort((e,t)=>e.localeCompare(t)),n=d?.collections,r=n?{...n,labels:{...n.labels||{},...Object.fromEntries(t.map(e=>[e,n.labels?.[e]??e]))}}:t.length>0?t:void 0,i={base:d?.base,theme:d?.theme,i18n:d?.i18n,versions:d?.versions,siteUrl:d?.siteUrl,integrations:d?.integrations,collections:r,seo:d?.seo,experimental:d?.experimental,plugins:d?.plugins?.map(e=>({name:e.name})),directoryMeta:e};return`export default ${JSON.stringify(i,null,2)};`}if(g===`entry`){let e=this,n=o(),r=e.environment?.config?.consumer,a=r===void 0?!!(u?.ssr??n?.build?.ssr):r!==`client`;return t({...i,ssr:a,useCompiledPages:n?.command===`build`},d)}if(g===`mdx-components`){let e=[`tsx`,`ts`,`jsx`,`js`],t=null;for(let n of e){let e=c.resolve(s,`mdx-components.${n}`);if(l.existsSync(e)){t=e;break}}let n={};if(d?.plugins)for(let e of d.plugins)e.components&&Object.assign(n,e.components);let i=Object.entries(n),a=i.map(([e,t],n)=>`import * as _pluginCompMod_${n} from '${t}';`).join(`
7
- `),o=i.map(([e],t)=>`${JSON.stringify(e)}: _pluginCompMod_${t}[${JSON.stringify(e)}] || _pluginCompMod_${t}["default"] || _pluginCompMod_${t}`).join(`,
8
- `);if(t){let e=r(t);return`${a}
9
- import * as components from '${e}';
10
- const userMdxComponents = components.default || components;
11
- const mdxComponents = {
12
- ${o}${o?`,`:``}
13
- ...userMdxComponents,
14
- };
15
- export default mdxComponents;
16
- export * from '${e}';`}return`${a}
17
- const mdxComponents = {
18
- ${o}
19
- };
20
- export default mdxComponents;`}if(g===`layout`){let e=[`tsx`,`jsx`],t=null;for(let n of e){let e=c.resolve(s,`layout.${n}`);if(l.existsSync(e)){t=e;break}}if(t)return`import UserLayout from '${r(t)}';
21
- export default UserLayout;`;throw Error(`[Boltdocs] Layout file not found. A 'layout.tsx' or 'layout.jsx' file is mandatory in your docs directory. Please create one to define your site structure.`)}if(g===`icons`){let e=[`tsx`,`jsx`,`ts`,`js`],t=null;for(let n of e){let e=c.resolve(s,`icons.${n}`);if(l.existsSync(e)){t=e;break}}return t?`import * as icons from '${r(t)}';\nexport default icons;`:`export default {};`}if(g===`search`)return await x(s,d,m),`export default async function fetchSearchData(options = {}) {
22
- const base = import.meta.env.BASE_URL || '/';
23
- const origin = typeof window !== 'undefined' ? window.location.origin : 'http://localhost';
24
- const basePath = base.endsWith('/') ? base : base + '/';
25
- const url = new URL('search.json', new URL(basePath, origin));
26
- if (options.bustCache) url.searchParams.set('t', String(Date.now()));
27
- const res = await fetch(url, { cache: options.bustCache ? 'no-store' : 'default' });
28
- if (!res.ok) throw new Error('Failed to fetch search index');
29
- return res.json();
30
- }`;if(g===`page-source`){await x(s,d,m);let e={};for(let t of m.routesDataMap.values())t.path&&t._rawContent&&(e[t.path]=t._rawContent);return`export default async function fetchPageSource(options = {}) {
31
- const base = import.meta.env.BASE_URL || '/';
32
- const origin = typeof window !== 'undefined' ? window.location.origin : 'http://localhost';
33
- const basePath = base.endsWith('/') ? base : base + '/';
34
- const url = new URL('page-source.json', new URL(basePath, origin));
35
- if (options.bustCache) url.searchParams.set('t', String(Date.now()));
36
- const res = await fetch(url, { cache: options.bustCache ? 'no-store' : 'default' });
37
- if (!res.ok) throw new Error('Failed to fetch page source');
38
- return res.json();
39
- }`}if(g===`client`){let t=e,n=``;for(;t&&t!==c.parse(t).root;){let e=c.join(t,`src/client/index.ts`),i=c.join(t,`dist/client/index.mjs`),a=c.join(t,`client/index.ts`);if(l.existsSync(e)){n=r(e);break}if(l.existsSync(i)){n=r(i);break}if(l.existsSync(a)){n=r(a);break}t=c.dirname(t)}if(!n)throw Error(`[boltdocs] Could not resolve boltdocs/client entry point starting from ${e}`);return`export * from '${n}';`}}}}export{E as computeFrontmatterDelta,m as createVirtualModuleState,D as createVirtualModulesPlugin,w as getSearchDataExport,_ as invalidateDirectoryMetaCache};
@@ -1,39 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- const e=require(`./chunk-D1Md3oWO.cjs`),t=require(`./utils-ej6_SjIZ.cjs`),n=require(`./plugin-context-CscLcXjH.cjs`),r=require(`./routes-C0kb4ue6.cjs`);let i=require(`node:path`);i=e.r(i);let a=require(`node:fs`);a=e.r(a);function o(e){return typeof e==`string`?[e]:Array.isArray(e)?e.flatMap(o):e&&typeof e==`object`?Object.values(e).flatMap(o):[]}const s=new Set([`title`,`description`,`permalink`,`sidebarPosition`,`sidebarLabel`,`sidebarHidden`,`hidden`,`category`,`order`,`badge`,`icon`,`date`,`lastUpdated`,`groupTitle`,`groupPosition`,`seo`]);function c(e){let t=[];for(let n of e){let e=``;n.frontmatter&&(e=o(Object.entries(n.frontmatter).filter(([e])=>!s.has(e)).map(([e,t])=>t)).join(` `));let r=(e?`${n._content||``} ${e}`:n._content||``).slice(0,500);if(t.push({id:n.path,title:n.title,content:r,url:n.path,display:n.groupTitle?`${n.groupTitle} > ${n.title}`:n.title,locale:n.locale,version:n.version}),n.headings)for(let e of n.headings)t.push({id:`${n.path}#${e.id}`,title:e.text,content:`${e.text} in ${n.title}`,url:`${n.path}#${e.id}`,display:`${n.title} > ${e.text}`,locale:n.locale,version:n.version})}return t}function l(e){return{path:e.path,filePath:e.filePath,title:e.title,description:e.description||``,sidebarPosition:e.sidebarPosition,badge:e.badge,icon:e.icon,headings:e.headings||[],frontmatter:e.frontmatter,locale:e.locale,version:e.version,tab:e.tab,collection:e.collection,tags:e.tags,author:e.author,draft:e.draft,excerpt:e.excerpt,coverImage:e.coverImage,group:e.group,groupTitle:e.groupTitle,groupPosition:e.groupPosition,groupIcon:e.groupIcon,subRouteGroup:e.subRouteGroup,seo:e.seo,date:e.date,lastUpdated:e.lastUpdated,category:e.category,order:e.order,sidebarLabel:e.sidebarLabel,sidebarHidden:e.sidebarHidden,slugParts:e.slugParts}}function u(e){return{routeCacheContext:e,routeGenerationFingerprint:void 0,directoryMetaCache:null,routesDataMap:new Map,collectionsDataMap:new Map,searchDataMap:new Map}}const d=u();function f(e){return e??d}function p(e){let t=f(e);t.directoryMetaCache=null,t.routeGenerationFingerprint=void 0,t.routeCacheVariant=void 0,t.routesDataMap.clear(),t.collectionsDataMap.clear(),t.searchDataMap.clear()}function m(e,t){return(!t.routeCacheContext||t.routeCacheContext.disposed)&&(t.routeCacheContext=r.s(e),t.routeCacheVariant=void 0,t.routeGenerationFingerprint=void 0,t.routesDataMap.clear(),t.collectionsDataMap.clear(),t.searchDataMap.clear()),t.routeCacheContext}async function h(e,t,n,i){let a=f(n),o=m(e,a),s=r.l(t),c=(i?.fingerprint===s&&o.variants.get(s)===i?i:void 0)??r.c(o,s);a.routeCacheVariant=c,a.routeGenerationFingerprint=s;let l=await r.t(e,t,void 0,!1,o,c);a.routesDataMap.clear();for(let e of l)a.routesDataMap.set(e.path,e);g(a)}function g(e){let t=f(e),n=Array.from(t.routesDataMap.values()),r=c(n);t.searchDataMap.clear();for(let e of r)t.searchDataMap.set(e.id,e);t.collectionsDataMap.clear();for(let e of n)if(e.collection){let n={path:e.path,title:e.title,date:e.date,excerpt:e.excerpt,tags:e.tags,author:e.author,coverImage:e.coverImage,filePath:e.filePath,locale:e.locale,version:e.version,frontmatter:e.frontmatter,draft:e.frontmatter?.draft,collection:e.collection};t.collectionsDataMap.set(e.filePath,n)}}async function _(e,t,n){let i=f(n);m(e,i);let a=r.l(t);(i.routesDataMap.size===0||i.routeGenerationFingerprint!==a)&&(i.routesDataMap.clear(),i.collectionsDataMap.clear(),i.searchDataMap.clear(),await h(e,t,i))}function v(e){let t=f(e),n={},r=Array.from(t.collectionsDataMap.values()).sort((e,t)=>{let n=e=>{if(!e)return-1/0;let t=new Date(e).getTime();return Number.isFinite(t)?t:-1/0},r=n(e.date),i=n(t.date)-r;return i===0?e.path.localeCompare(t.path):i});for(let e of r){let t=e.collection;t&&(n[t]||(n[t]=[]),n[t].push(e))}return n}function y(e,t=e=>e){let n=Array.from(e.values(),t).sort((e,t)=>{let n=e=>{if(typeof e!=`object`||!e)return String(e);let t=e;return`${String(t.path||``)}\u0000${String(t.id||``)}\u0000${String(t.filePath||``)}`};return n(e).localeCompare(n(t))});return`export default ${JSON.stringify(n)};`}function b(e){return Array.from(f(e).searchDataMap.values()).sort((e,t)=>e.id.localeCompare(t.id))}function x(e){return`export default ${JSON.stringify(e)};`}async function S(e,t,n,i,a){let o=f(n);i&&(o.routeCacheContext=i),a&&(o.routeCacheVariant=a);let s=r.l(t);o.routeGenerationFingerprint!==s&&(o.routesDataMap.clear(),o.collectionsDataMap.clear(),o.searchDataMap.clear());let c=new Map(o.routesDataMap),u=new Map(o.collectionsDataMap),d=new Map(o.searchDataMap);await h(e,t,o);let p={routes:{updated:[],deleted:[]},collections:{updated:[],deleted:[]},search:{updated:[],deleted:[]}};for(let[e,t]of o.routesDataMap){let n=c.get(e);(!n||JSON.stringify(n)!==JSON.stringify(t))&&p.routes.updated.push(l(t))}for(let e of c.keys())o.routesDataMap.has(e)||p.routes.deleted.push(e);for(let[e,t]of o.collectionsDataMap){let n=u.get(e);(!n||JSON.stringify(n)!==JSON.stringify(t))&&p.collections.updated.push(t)}for(let e of u.keys())o.collectionsDataMap.has(e)||p.collections.deleted.push(e);for(let[e,t]of o.searchDataMap){let n=d.get(e);(!n||JSON.stringify(n)!==JSON.stringify(t))&&p.search.updated.push(t)}for(let e of d.keys())o.searchDataMap.has(e)||p.search.deleted.push(e);return p}function C(e,r,o,s,c,u){let d=c?.virtualModuleRegistry??n.h,p=f(u);return{name:`vite-plugin-boltdocs-virtual-modules`,resolveId(e){if(o()?.root||process.cwd(),e.includes(`boltdocs-entry`)||e===`virtual:boltdocs-entry`||e===`boltdocs/entry`||e===`boltdocs-entry`||e===`\0virtual:boltdocs-entry`||e===`\0virtual:boltdocs-entry.tsx`)return`\0virtual:boltdocs-entry.tsx`;if(e.includes(`boltdocs-client`)||e===`virtual:boltdocs-client`||e===`boltdocs/client`||e===`boltdocs-client`||e===`\0virtual:boltdocs-client.mjs`)return`\0virtual:boltdocs-client.mjs`;if(e.startsWith(`\0`)){let t=e.slice(1);if(!t.startsWith(`virtual:boltdocs-`)&&d?.has(t))return e}else if(!e.startsWith(`virtual:boltdocs-`)&&d?.has(e))return`\0`+e;return e.startsWith(`virtual:boltdocs-`)?`\0`+e:e.startsWith(`\0virtual:boltdocs-`)?e:null},async load(c,u){let f=r(),m=c.startsWith(`\0`)?c.slice(1):c;if(!m.includes(`boltdocs-entry.tsx`)&&!m.includes(`boltdocs-client.mjs`)&&!m.startsWith(`virtual:boltdocs-`)&&d?.has(m)){let e=d?.get(m);if(!e)return null;try{let t=await e.loader();if(typeof t!=`string`)throw Error(`[boltdocs] Plugin virtual module '${m}' loader must return a string source code, got ${typeof t}.`);return t}catch(e){throw Error(`[boltdocs] Plugin virtual module '${m}' failed to load: ${e instanceof Error?e.message:String(e)}`)}}if(c.includes(`boltdocs-entry.tsx`)||c===`\0virtual:boltdocs-entry`){let t=this.environment?.config?.consumer,r=o(),i=t===void 0?!!r?.build?.ssr:t!==`client`;return n.g({...e,ssr:i,useCompiledPages:r?.command===`build`},f)}if(c.includes(`boltdocs-client.mjs`)||c===`\0virtual:boltdocs-client.ts`||c===`virtual:boltdocs-client`){let e=__dirname,n=e;for(;e!==i.default.parse(e).root;){if(a.default.existsSync(i.default.join(e,`package.json`))&&JSON.parse(a.default.readFileSync(i.default.join(e,`package.json`),`utf-8`)).name===`boltdocs`){n=e;break}e=i.default.dirname(e)}let r=i.default.join(n,`src/client/index.ts`),o=i.default.join(n,`dist/client/index.js`);return`export * from '${t.u(a.default.existsSync(r)?r:o)}';`}if(!c.startsWith(`\0virtual:boltdocs-`))return;let h=c.replace(`\0virtual:boltdocs-`,``).replace(/\.tsx?$/,``);if(h===`routes`)return await _(s,f,p),y(p.routesDataMap,l);if(h===`collections`)return await _(s,f,p),x(v(p));if(h===`config`){await _(s,f,p);let e=p.routeCacheVariant?.directoryMeta||{};p.directoryMetaCache=e;let t=[...new Set(Array.from(p.routesDataMap.values()).map(e=>e.collection).filter(e=>!!e))].sort((e,t)=>e.localeCompare(t)),n=f?.collections,r=n?{...n,labels:{...n.labels||{},...Object.fromEntries(t.map(e=>[e,n.labels?.[e]??e]))}}:t.length>0?t:void 0,i={base:f?.base,theme:f?.theme,i18n:f?.i18n,versions:f?.versions,siteUrl:f?.siteUrl,integrations:f?.integrations,collections:r,seo:f?.seo,experimental:f?.experimental,plugins:f?.plugins?.map(e=>({name:e.name})),directoryMeta:e};return`export default ${JSON.stringify(i,null,2)};`}if(h===`entry`){let t=this,r=o(),i=t.environment?.config?.consumer,a=i===void 0?!!(u?.ssr??r?.build?.ssr):i!==`client`;return n.g({...e,ssr:a,useCompiledPages:r?.command===`build`},f)}if(h===`mdx-components`){let e=[`tsx`,`ts`,`jsx`,`js`],n=null;for(let t of e){let e=i.default.resolve(s,`mdx-components.${t}`);if(a.default.existsSync(e)){n=e;break}}let r={};if(f?.plugins)for(let e of f.plugins)e.components&&Object.assign(r,e.components);let o=Object.entries(r),c=o.map(([e,t],n)=>`import * as _pluginCompMod_${n} from '${t}';`).join(`
7
- `),l=o.map(([e],t)=>`${JSON.stringify(e)}: _pluginCompMod_${t}[${JSON.stringify(e)}] || _pluginCompMod_${t}["default"] || _pluginCompMod_${t}`).join(`,
8
- `);if(n){let e=t.u(n);return`${c}
9
- import * as components from '${e}';
10
- const userMdxComponents = components.default || components;
11
- const mdxComponents = {
12
- ${l}${l?`,`:``}
13
- ...userMdxComponents,
14
- };
15
- export default mdxComponents;
16
- export * from '${e}';`}return`${c}
17
- const mdxComponents = {
18
- ${l}
19
- };
20
- export default mdxComponents;`}if(h===`layout`){let e=[`tsx`,`jsx`],n=null;for(let t of e){let e=i.default.resolve(s,`layout.${t}`);if(a.default.existsSync(e)){n=e;break}}if(n)return`import UserLayout from '${t.u(n)}';
21
- export default UserLayout;`;throw Error(`[Boltdocs] Layout file not found. A 'layout.tsx' or 'layout.jsx' file is mandatory in your docs directory. Please create one to define your site structure.`)}if(h===`icons`){let e=[`tsx`,`jsx`,`ts`,`js`],n=null;for(let t of e){let e=i.default.resolve(s,`icons.${t}`);if(a.default.existsSync(e)){n=e;break}}return n?`import * as icons from '${t.u(n)}';\nexport default icons;`:`export default {};`}if(h===`search`)return await _(s,f,p),`export default async function fetchSearchData(options = {}) {
22
- const base = import.meta.env.BASE_URL || '/';
23
- const origin = typeof window !== 'undefined' ? window.location.origin : 'http://localhost';
24
- const basePath = base.endsWith('/') ? base : base + '/';
25
- const url = new URL('search.json', new URL(basePath, origin));
26
- if (options.bustCache) url.searchParams.set('t', String(Date.now()));
27
- const res = await fetch(url, { cache: options.bustCache ? 'no-store' : 'default' });
28
- if (!res.ok) throw new Error('Failed to fetch search index');
29
- return res.json();
30
- }`;if(h===`page-source`){await _(s,f,p);let e={};for(let t of p.routesDataMap.values())t.path&&t._rawContent&&(e[t.path]=t._rawContent);return`export default async function fetchPageSource(options = {}) {
31
- const base = import.meta.env.BASE_URL || '/';
32
- const origin = typeof window !== 'undefined' ? window.location.origin : 'http://localhost';
33
- const basePath = base.endsWith('/') ? base : base + '/';
34
- const url = new URL('page-source.json', new URL(basePath, origin));
35
- if (options.bustCache) url.searchParams.set('t', String(Date.now()));
36
- const res = await fetch(url, { cache: options.bustCache ? 'no-store' : 'default' });
37
- if (!res.ok) throw new Error('Failed to fetch page source');
38
- return res.json();
39
- }`}if(h===`client`){let e=__dirname,n=``;for(;e&&e!==i.default.parse(e).root;){let r=i.default.join(e,`src/client/index.ts`),o=i.default.join(e,`dist/client/index.mjs`),s=i.default.join(e,`client/index.ts`);if(a.default.existsSync(r)){n=t.u(r);break}if(a.default.existsSync(o)){n=t.u(o);break}if(a.default.existsSync(s)){n=t.u(s);break}e=i.default.dirname(e)}if(!n)throw Error(`[boltdocs] Could not resolve boltdocs/client entry point starting from ${__dirname}`);return`export * from '${n}';`}}}}exports.computeFrontmatterDelta=S,exports.createVirtualModuleState=u,exports.createVirtualModulesPlugin=C,exports.getSearchDataExport=b,exports.invalidateDirectoryMetaCache=p;
File without changes
File without changes
File without changes
File without changes