boltdocs 2.9.1 → 2.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters-HVuXENAe.mjs +6 -0
- package/dist/adapters-uGz-UKQa.cjs +6 -0
- package/dist/client/index.cjs +2 -2
- package/dist/client/index.js +2 -2
- package/dist/client/mdx.cjs +1 -1
- package/dist/client/mdx.js +1 -1
- package/dist/client/primitives.cjs +1 -1
- package/dist/client/primitives.js +1 -1
- package/dist/config-BCqkPkjC.mjs +7 -0
- package/dist/{config-GPVEdeon.mjs → config-BPWGa2W3.mjs} +1 -1
- package/dist/{config-kIQOJHXC.cjs → config-CnmfjOE4.cjs} +1 -1
- package/dist/config-D7ERJhqe.cjs +7 -0
- package/dist/{csp-RJyh0nHV.mjs → csp-CUAEgrxR.mjs} +1 -1
- package/dist/{doctor-DzEgMMRo.cjs → doctor-A17UhTRn.cjs} +1 -1
- package/dist/{doctor-D8fl3Sbg.cjs → doctor-BL6c8x2Q.cjs} +1 -1
- package/dist/{doctor-C19DsI1e.mjs → doctor-hKOBLhBF.mjs} +1 -1
- package/dist/{headers-HD_qTVVW.mjs → headers-DBzZ9yC6.mjs} +1 -1
- package/dist/{image-CjYu9Eml.js → image-BCDyLHyD.js} +1 -4
- package/dist/{image-B9YA_oQ_.cjs → image-DWdmichO.cjs} +1 -4
- package/dist/index-ZqgZUvwp.d.mts +274 -0
- package/dist/index-aWC0KjDF.d.cts +274 -0
- package/dist/{mdx-WXjAMS8Y.cjs → mdx-9QJoSITt.cjs} +1 -1
- package/dist/{mdx-Cy_c2zio.js → mdx-DFbspTP9.js} +1 -1
- package/dist/node/cli-entry.cjs +3 -3
- package/dist/node/cli-entry.mjs +3 -3
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +1 -271
- package/dist/node/index.d.mts +2 -273
- package/dist/node/index.mjs +1 -1
- package/dist/node/routes/worker.cjs +1 -1
- package/dist/node/routes/worker.mjs +1 -1
- package/dist/node-B-I15rGR.cjs +105 -0
- package/dist/node-FkxzriO7.mjs +105 -0
- package/dist/{package-ByXh2JHp.cjs → package-CVw_u5VT.cjs} +1 -1
- package/dist/{package-DQBAV8uo.mjs → package-D6O7a8qA.mjs} +1 -1
- package/dist/{parser-IR9tfyGE.mjs → parser-8u0xHVc7.mjs} +1 -1
- package/dist/{parser-B8naUXl2.cjs → parser-CHsNUEhU.cjs} +1 -1
- package/dist/{plugin-BkquLpOI.mjs → plugin-CHa0IT49.mjs} +4 -4
- package/dist/plugin-Dqj9plKB.cjs +61 -0
- package/dist/{routes-DX8ryKjs.cjs → routes-B2joDAlC.cjs} +1 -1
- package/dist/{routes-DR13Y1em.mjs → routes-BTx0ngdX.mjs} +1 -1
- package/dist/{routes-TUSK5wD7.mjs → routes-Bm0CQvyL.mjs} +1 -1
- package/dist/{routes-DgTQxpZi.cjs → routes-CyKj3dzf.cjs} +1 -1
- package/dist/server/index.cjs +6 -0
- package/dist/server/index.d.cts +3 -0
- package/dist/server/index.d.mts +3 -0
- package/dist/server/index.mjs +6 -0
- package/package.json +6 -1
- package/dist/config-BqZUYono.cjs +0 -7
- package/dist/config-DBKBEj3j.mjs +0 -7
- package/dist/node-B7qbjtLl.mjs +0 -105
- package/dist/node-Dj3-2YYP.cjs +0 -105
- package/dist/plugin-CL1LsQXk.cjs +0 -61
- /package/dist/{csp-CBysWlAf.cjs → csp-DbbF3R9Q.cjs} +0 -0
- /package/dist/{generator-B6lrnDZ-.mjs → generator-BaSvGlxR.mjs} +0 -0
- /package/dist/{generator-DtUU3Cfk.cjs → generator-DsajVrDx.cjs} +0 -0
- /package/dist/{headers-BJ4jJAhU.cjs → headers-DuCAOgYX.cjs} +0 -0
- /package/dist/{meta-loader-CxAoQthW.mjs → meta-loader-CD3Yptr5.mjs} +0 -0
- /package/dist/{meta-loader-C9MKjAs0.cjs → meta-loader-CjphwtS7.cjs} +0 -0
- /package/dist/{parser-D4oEyuP-.cjs → parser-CLtGv_XH.cjs} +0 -0
- /package/dist/{worker-pool-m81xuM5v.cjs → worker-pool-CgOMozUz.cjs} +0 -0
- /package/dist/{worker-pool-C6r6V05j.mjs → worker-pool-v6tW2MDQ.mjs} +0 -0
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
const e=require(`./chunk-Ds5LZdWN.cjs`),t=require(`./utils-BWy_8ASj.cjs`),n=require(`./cache-B19MLTpN.cjs`);let r=require(`node:path`);r=e.n(r);let i=require(`fdir`);const a=new n.r({name:`routes`});function o(){a.invalidateAll(),n.t.clear()}function s(e){a.invalidate(e),n.t.invalidate(e)}function c(e){return e.sort((e,t)=>{let n=e.group?e.groupPosition??999:e.sidebarPosition??999,r=t.group?t.groupPosition??999:t.sidebarPosition??999;return n===r?!e.group&&t.group?-1:e.group&&!t.group?1:e.group&&t.group&&e.group!==t.group?(e.groupTitle||e.group).localeCompare(t.groupTitle||t.group):l(e,t):n-r})}function l(e,t){return e.sidebarPosition!==void 0&&t.sidebarPosition!==void 0?e.sidebarPosition-t.sidebarPosition:e.sidebarPosition===void 0?t.sidebarPosition===void 0?e.title.localeCompare(t.title):1:-1}let u=null;const d=new Map;let f=null;function p(){u=null,d.clear(),o()}async function m(e,n,o,s=!1){if(f)return f;let l=(async()=>{let l=o||n?.base||`/docs`;await a.load(),d.clear();let f;if(!s&&u)f=u;else{let t=await new i.fdir().withFullPaths().filter(t=>t.endsWith(`.md`)||t.endsWith(`.mdx`)?!r.default.relative(e,t).replace(/\\/g,`/`).split(`/`).some(e=>e.startsWith(`_`)&&e!==`_index.md`&&e!==`_index.mdx`):!1).crawl(e).withPromise(),n=[/index\./i,/intro/i,/getting-started/i,/readme/i],a=t.map(e=>{let t=r.default.basename(e),i=n.findIndex(e=>e.test(t));return{f:e,score:i===-1?2**53-1:i}});a.sort((e,t)=>e.score-t.score),f=a.map(e=>e.f),u=f}a.pruneStale(new Set(f));let p=process.env.NODE_ENV===`test`||process.env.VITEST===`true`,m;if(p){let{parseDocFile:t}=await Promise.resolve().then(()=>require(`./parser-
|
|
6
|
+
const e=require(`./chunk-Ds5LZdWN.cjs`),t=require(`./utils-BWy_8ASj.cjs`),n=require(`./cache-B19MLTpN.cjs`);let r=require(`node:path`);r=e.n(r);let i=require(`fdir`);const a=new n.r({name:`routes`});function o(){a.invalidateAll(),n.t.clear()}function s(e){a.invalidate(e),n.t.invalidate(e)}function c(e){return e.sort((e,t)=>{let n=e.group?e.groupPosition??999:e.sidebarPosition??999,r=t.group?t.groupPosition??999:t.sidebarPosition??999;return n===r?!e.group&&t.group?-1:e.group&&!t.group?1:e.group&&t.group&&e.group!==t.group?(e.groupTitle||e.group).localeCompare(t.groupTitle||t.group):l(e,t):n-r})}function l(e,t){return e.sidebarPosition!==void 0&&t.sidebarPosition!==void 0?e.sidebarPosition-t.sidebarPosition:e.sidebarPosition===void 0?t.sidebarPosition===void 0?e.title.localeCompare(t.title):1:-1}let u=null;const d=new Map;let f=null;function p(){u=null,d.clear(),o()}async function m(e,n,o,s=!1){if(f)return f;let l=(async()=>{let l=o||n?.base||`/docs`;await a.load(),d.clear();let f;if(!s&&u)f=u;else{let t=await new i.fdir().withFullPaths().filter(t=>t.endsWith(`.md`)||t.endsWith(`.mdx`)?!r.default.relative(e,t).replace(/\\/g,`/`).split(`/`).some(e=>e.startsWith(`_`)&&e!==`_index.md`&&e!==`_index.mdx`):!1).crawl(e).withPromise(),n=[/index\./i,/intro/i,/getting-started/i,/readme/i],a=t.map(e=>{let t=r.default.basename(e),i=n.findIndex(e=>e.test(t));return{f:e,score:i===-1?2**53-1:i}});a.sort((e,t)=>e.score-t.score),f=a.map(e=>e.f),u=f}a.pruneStale(new Set(f));let p=process.env.NODE_ENV===`test`||process.env.VITEST===`true`,m;if(p){let{parseDocFile:t}=await Promise.resolve().then(()=>require(`./parser-CHsNUEhU.cjs`));m=await Promise.all(f.map(async r=>{let i=a.get(r);if(i)return i;let o=await t(r,e,l,n);return a.set(r,o),o}))}else{let{pool:t}=await Promise.resolve().then(()=>require(`./worker-pool-CgOMozUz.cjs`)),r=n?{i18n:n.i18n,versions:n.versions}:void 0;m=await Promise.all(f.map(async n=>{let i=a.get(n);if(i)return i;let o=await t.parseFile(n,e,l,r);return a.set(n,o),o}))}a.save();let g=[],_=new Map;for(let e of m)if(!(process.env.NODE_ENV===`production`&&e.route.draft))if(e.inferredCollection){let t=e.inferredCollection;_.has(t)||_.set(t,[]),_.get(t).push(e)}else g.push(e);let v=new Map,y=[],b=n?.i18n?.defaultLocale||``;for(let e of g)if(e.isGroupIndex&&e.relativeDir&&y.push(e),e.relativeDir){let n=`${e.route.locale||b}:${e.relativeDir}`,r=v.get(n);r?r.position===void 0&&e.inferredGroupPosition!==void 0&&(r.position=e.inferredGroupPosition):(r={title:t.t(e.relativeDir),position:e.inferredGroupPosition},v.set(n,r))}for(let e of y){let t=`${e.route.locale||b}:${e.relativeDir}`,n=v.get(t);e.groupMeta&&(n.title=e.groupMeta.title,e.groupMeta.position!==void 0&&(n.position=e.groupMeta.position),e.groupMeta.icon&&(n.icon=e.groupMeta.icon))}if(n?.theme?.sidebarGroups){let e=n.i18n?Object.keys(n.i18n.locales):[b];for(let[r,i]of Object.entries(n.theme.sidebarGroups))for(let n of e){let e=`${n}:${r}`,a=v.get(e),o;typeof i.title==`string`?o=i.title:i.title&&(o=i.title[n]||i.title[b]),a?(o&&(a.title=o),i.icon&&(a.icon=i.icon)):v.set(e,{title:o||t.t(r),icon:i.icon})}}let x=Array(g.length);for(let e=0;e<g.length;e++){let n=g[e],r=n.relativeDir,i=n.route.locale||b,a=r?`${i}:${r}`:void 0,o=a?v.get(a):void 0,s;o&&(s=typeof o.title==`string`?o.title:o.title[i]||o.title[b]),x[e]={...n.route,group:r,groupTitle:s||(r?t.t(r):void 0),groupPosition:o?.position,groupIcon:o?.icon}}let S=[];for(let[,e]of _)for(let t of e)S.push({...t.route,collection:t.inferredCollection});S.sort((e,t)=>{let n=e.date?new Date(e.date).getTime():0;return(t.date?new Date(t.date).getTime():0)-n});let C=x;if(n?.i18n){let e=h(x,n,l);C=[...x,...e]}return[...c(C),...S]})();f=l;try{return await l}finally{f=null}}function h(e,t,n){let r=t.i18n.defaultLocale,i=Object.keys(t.i18n.locales),a=[],o=new Map,s=[];for(let t of e){let e=t.locale||r;o.has(e)||o.set(e,new Set),o.get(e).add(t.path),e===r&&s.push(t)}for(let e of i){let i=o.get(e)||new Set;for(let o of s){let s=g(o.path,r,e,n,t);s!==o.path&&(i.has(s)||a.push({...o,path:s,locale:e}))}}return a}function g(e,t,n,r,i){let a=`${e}:${n}`,o=d.get(a);if(o)return o;let s=r.startsWith(`/`)?r:`/`+r,c=s;if(i?.versions){let t=i.versions.prefix||``;for(let n of i.versions.versions){let r=`${s}/${t+n.path}`;if(e.startsWith(r)){c=r;break}let i=`${s}/${n.path}`;if(e.startsWith(i)){c=i;break}}}let l=e.substring(c.length),u=`/${t}`;if(l.startsWith(u+`/`))l=`/`+n+`/`+l.substring(u.length+1);else if(l===u)l=`/`+n;else if(l===`/`||l===``)l=`/`+n;else{let e=l.startsWith(`/`)?``:`/`;l=`/`+n+e+l}let f=c+l;return d.size>2e3&&d.clear(),d.set(a,f),f}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return m}});
|
|
@@ -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
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../adapters-uGz-UKQa.cjs`);exports.handleAwsFeedback=e.t,exports.handleNetlifyFeedback=e.r,exports.handleVercelFeedback=e.i,exports.handleWebFeedback=e.n;
|
|
@@ -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{i as e,n as t,r as n,t as r}from"../adapters-HVuXENAe.mjs";export{r as handleAwsFeedback,n as handleNetlifyFeedback,e as handleVercelFeedback,t as handleWebFeedback};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "boltdocs",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.2",
|
|
4
4
|
"description": "A lightweight documentation generator for React projects.",
|
|
5
5
|
"main": "dist/node/index.mjs",
|
|
6
6
|
"module": "dist/node/index.mjs",
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
"import": "./dist/node/index.mjs",
|
|
23
23
|
"require": "./dist/node/index.cjs"
|
|
24
24
|
},
|
|
25
|
+
"./server": {
|
|
26
|
+
"types": "./dist/server/index.d.ts",
|
|
27
|
+
"import": "./dist/server/index.mjs",
|
|
28
|
+
"require": "./dist/server/index.cjs"
|
|
29
|
+
},
|
|
25
30
|
"./client": {
|
|
26
31
|
"types": "./dist/client/index.d.ts",
|
|
27
32
|
"import": "./dist/client/index.js",
|
package/dist/config-BqZUYono.cjs
DELETED
|
@@ -1,7 +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-Ds5LZdWN.cjs`),t=require(`./errors-Dx6JHoKE.cjs`),n=require(`./types-generator-BqNKCbrx.cjs`);let r=require(`node:path`);r=e.n(r);let i=require(`node:fs`);i=e.n(i);let a=require(`zod`),o=require(`@bdocs/dui`),s=require(`vite`);function c(e){return e}const l=a.z.object({icon:a.z.string().max(50),link:a.z.string().url()});a.z.object({text:a.z.string().max(2e3).optional()});const u=a.z.object({name:a.z.string(),enforce:a.z.enum([`pre`,`post`]).optional(),version:a.z.string().optional(),boltdocsVersion:a.z.string().optional(),remarkPlugins:a.z.array(a.z.unknown()).optional(),rehypePlugins:a.z.array(a.z.unknown()).optional(),vitePlugins:a.z.array(a.z.unknown()).optional(),components:a.z.record(a.z.string(),a.z.string()).optional(),hooks:a.z.record(a.z.string(),a.z.unknown()).optional()}),d=a.z.object({title:a.z.union([a.z.string(),a.z.record(a.z.string(),a.z.string())]).optional(),description:a.z.union([a.z.string(),a.z.record(a.z.string(),a.z.string())]).optional(),logo:a.z.union([a.z.string(),a.z.object({dark:a.z.string(),light:a.z.string(),alt:a.z.string().optional(),width:a.z.number().optional(),height:a.z.number().optional()})]).optional(),navbar:a.z.array(a.z.object({label:a.z.union([a.z.string(),a.z.record(a.z.string(),a.z.string())]),href:a.z.string(),items:a.z.array(a.z.object({label:a.z.union([a.z.string(),a.z.record(a.z.string(),a.z.string())]),href:a.z.string()})).optional()})).optional(),sidebar:a.z.record(a.z.string(),a.z.array(a.z.object({text:a.z.string(),link:a.z.string()}))).optional(),sidebarGroups:a.z.record(a.z.string(),a.z.object({title:a.z.union([a.z.string(),a.z.record(a.z.string(),a.z.string())]).optional(),icon:a.z.string().optional()})).optional(),socialLinks:a.z.array(l).optional(),editLink:a.z.string().refine(e=>!e||e.includes(`:path`),{message:`editLink must contain ':path' placeholder if specified`}).optional(),communityHelp:a.z.string().url().optional(),version:a.z.string().max(50).optional(),githubRepo:a.z.string().max(100).optional(),favicon:a.z.string().optional(),tabs:a.z.array(a.z.object({id:a.z.string(),text:a.z.union([a.z.string(),a.z.record(a.z.string(),a.z.string())]),icon:a.z.string().optional()})).optional(),codeTheme:a.z.union([a.z.string(),a.z.object({light:a.z.string(),dark:a.z.string()})]).optional()}),f=a.z.union([a.z.string(),a.z.object({rules:a.z.array(a.z.object({userAgent:a.z.string(),allow:a.z.union([a.z.string(),a.z.array(a.z.string())]).optional(),disallow:a.z.union([a.z.string(),a.z.array(a.z.string())]).optional()})).optional(),sitemaps:a.z.array(a.z.string().url()).optional()})]),p=a.z.object({defaultLocale:a.z.string(),locales:a.z.union([a.z.record(a.z.string(),a.z.string()),a.z.array(a.z.string())]).transform(e=>Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e),localeConfigs:a.z.record(a.z.string(),a.z.object({label:a.z.string().optional(),direction:a.z.enum([`ltr`,`rtl`]).optional(),htmlLang:a.z.string().optional(),calendar:a.z.string().optional()})).optional()}),m=a.z.object({defaultVersion:a.z.string(),prefix:a.z.string().optional(),versions:a.z.array(a.z.object({label:a.z.string(),path:a.z.string()}))}),h=a.z.object({headers:a.z.record(a.z.string(),a.z.string()).optional(),enableCSP:a.z.boolean().optional(),customHeaders:a.z.record(a.z.string(),a.z.string()).optional()}),g=a.z.object({metatags:a.z.record(a.z.string(),a.z.string()).optional(),indexing:a.z.enum([`all`,`public`]).optional(),thumbnails:a.z.object({background:a.z.string().optional()}).optional()}),_=a.z.object({measurementId:a.z.string().min(1,`Measurement ID is required for GA4`),debug:a.z.boolean().optional(),anonymizeIp:a.z.boolean().optional(),sendPageView:a.z.boolean().optional(),cookieFlags:a.z.string().optional(),autoTrack:a.z.object({pageViews:a.z.boolean().optional(),downloads:a.z.boolean().optional(),externalLinks:a.z.boolean().optional(),search:a.z.boolean().optional()}).optional()}),v=a.z.object({tagId:a.z.string().min(1,`Tag ID is required for GTM`),dataLayerName:a.z.string().optional(),preview:a.z.string().optional()}),y=a.z.object({appId:a.z.string().min(1,`Algolia App ID is required`),apiKey:a.z.string().min(1,`Algolia API Key is required`),indexName:a.z.string().min(1,`Algolia Index Name is required`)}),b=a.z.object({repo:a.z.string().min(1,`Giscus repository is required`),repoId:a.z.string().min(1,`Giscus repository ID is required`),category:a.z.string().optional(),categoryId:a.z.string().optional(),mapping:a.z.enum([`pathname`,`url`,`title`,`og:title`,`specific`,`number`]).optional(),strict:a.z.union([a.z.enum([`0`,`1`]),a.z.boolean()]).optional(),reactionsEnabled:a.z.union([a.z.enum([`0`,`1`]),a.z.boolean()]).optional(),emitMetadata:a.z.union([a.z.enum([`0`,`1`]),a.z.boolean()]).optional(),inputPosition:a.z.enum([`top`,`bottom`]).optional(),theme:a.z.string().optional(),darkTheme:a.z.string().optional(),lang:a.z.string().optional(),loading:a.z.enum([`lazy`,`eager`]).optional()}),x=a.z.object({enabled:a.z.boolean(),owner:a.z.string().min(1,`GitHub owner is required`),repo:a.z.string().min(1,`GitHub repository name is required`),categorySlug:a.z.string().optional(),endpoint:a.z.string().optional()}),S=a.z.object({ga4:_.optional(),gtm:v.optional(),algolia:y.optional(),feedback:a.z.object({giscus:b.optional(),custom:x.optional()}).optional()}),C=a.z.object({siteUrl:a.z.string().url().optional(),docsDir:a.z.string().optional(),base:a.z.string().optional(),theme:d.optional(),i18n:p.optional(),versions:m.optional(),plugins:a.z.array(u).optional(),robots:f.optional(),security:h.optional(),seo:g.optional(),integrations:S.optional(),vite:a.z.record(a.z.string(),a.z.unknown()).optional()}),w=[`boltdocs.config.js`,`boltdocs.config.mjs`,`boltdocs.config.ts`];async function T(e,n=process.cwd()){let a=n,c={docsDir:r.default.resolve(e),theme:{title:`Boltdocs`,description:`A Vite documentation framework`,navbar:[{label:`Home`,href:`/`},{label:`Documentation`,href:`/docs`}],codeTheme:{light:`github-light`,dark:`github-dark`}}},l={};for(let e of w){let t=r.default.resolve(a,e);if(i.default.existsSync(t))try{let e=await(0,s.loadConfigFromFile)({command:`serve`,mode:`development`},t,a);if(e){l=e.config;break}}catch(t){(0,o.warn)(`Failed to load config from ${e}:`,t)}}let u={title:l.title,description:l.description,logo:l.logo,favicon:l.favicon,navbar:l.navbar,sidebar:l.sidebar,sidebarGroups:l.theme?.sidebarGroups,socialLinks:l.socialLinks,githubRepo:l.githubRepo,tabs:l.tabs,codeTheme:l.codeTheme,communityHelp:l.communityHelp,version:l.version,editLink:l.editLink,...l.theme||{}},d=Object.fromEntries(Object.entries(u).filter(([e,t])=>t!==void 0));d.navbar&&=d.navbar.map(e=>({label:e.label||e.text||``,href:e.href||e.link||e.to||``,items:e.items}));let f={docsDir:r.default.resolve(e),theme:{...c.theme,...d},i18n:l.i18n?{...l.i18n,locales:Array.isArray(l.i18n.locales)?Object.fromEntries(l.i18n.locales.map(e=>[e,e])):l.i18n.locales}:void 0,versions:l.versions,siteUrl:l.siteUrl,base:l.base,seo:l.seo,plugins:l.plugins||[],robots:l.robots,security:l.security,integrations:l.integrations,vite:l.vite},p=C.safeParse(f);if(!p.success)throw new t.r(`Invalid Boltdocs configuration:\n${p.error.issues.map(e=>` - ${e.path.join(`.`)}: ${e.message}`).join(`
|
|
7
|
-
`)}`);return p.data}async function E(e,t=process.cwd()){let r=await T(e,t);return n.t(r,e,t),r}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return w}});
|
package/dist/config-DBKBEj3j.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
-
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
import{r as e}from"./errors-C0Hx15Ag.mjs";import{t}from"./types-generator-BRyf4o9F.mjs";import n from"node:path";import r from"node:fs";import{z as i}from"zod";import{warn as a}from"@bdocs/dui";import{loadConfigFromFile as o}from"vite";function s(e){return e}const c=i.object({icon:i.string().max(50),link:i.string().url()});i.object({text:i.string().max(2e3).optional()});const l=i.object({name:i.string(),enforce:i.enum([`pre`,`post`]).optional(),version:i.string().optional(),boltdocsVersion:i.string().optional(),remarkPlugins:i.array(i.unknown()).optional(),rehypePlugins:i.array(i.unknown()).optional(),vitePlugins:i.array(i.unknown()).optional(),components:i.record(i.string(),i.string()).optional(),hooks:i.record(i.string(),i.unknown()).optional()}),u=i.object({title:i.union([i.string(),i.record(i.string(),i.string())]).optional(),description:i.union([i.string(),i.record(i.string(),i.string())]).optional(),logo:i.union([i.string(),i.object({dark:i.string(),light:i.string(),alt:i.string().optional(),width:i.number().optional(),height:i.number().optional()})]).optional(),navbar:i.array(i.object({label:i.union([i.string(),i.record(i.string(),i.string())]),href:i.string(),items:i.array(i.object({label:i.union([i.string(),i.record(i.string(),i.string())]),href:i.string()})).optional()})).optional(),sidebar:i.record(i.string(),i.array(i.object({text:i.string(),link:i.string()}))).optional(),sidebarGroups:i.record(i.string(),i.object({title:i.union([i.string(),i.record(i.string(),i.string())]).optional(),icon:i.string().optional()})).optional(),socialLinks:i.array(c).optional(),editLink:i.string().refine(e=>!e||e.includes(`:path`),{message:`editLink must contain ':path' placeholder if specified`}).optional(),communityHelp:i.string().url().optional(),version:i.string().max(50).optional(),githubRepo:i.string().max(100).optional(),favicon:i.string().optional(),tabs:i.array(i.object({id:i.string(),text:i.union([i.string(),i.record(i.string(),i.string())]),icon:i.string().optional()})).optional(),codeTheme:i.union([i.string(),i.object({light:i.string(),dark:i.string()})]).optional()}),d=i.union([i.string(),i.object({rules:i.array(i.object({userAgent:i.string(),allow:i.union([i.string(),i.array(i.string())]).optional(),disallow:i.union([i.string(),i.array(i.string())]).optional()})).optional(),sitemaps:i.array(i.string().url()).optional()})]),f=i.object({defaultLocale:i.string(),locales:i.union([i.record(i.string(),i.string()),i.array(i.string())]).transform(e=>Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e),localeConfigs:i.record(i.string(),i.object({label:i.string().optional(),direction:i.enum([`ltr`,`rtl`]).optional(),htmlLang:i.string().optional(),calendar:i.string().optional()})).optional()}),p=i.object({defaultVersion:i.string(),prefix:i.string().optional(),versions:i.array(i.object({label:i.string(),path:i.string()}))}),m=i.object({headers:i.record(i.string(),i.string()).optional(),enableCSP:i.boolean().optional(),customHeaders:i.record(i.string(),i.string()).optional()}),h=i.object({metatags:i.record(i.string(),i.string()).optional(),indexing:i.enum([`all`,`public`]).optional(),thumbnails:i.object({background:i.string().optional()}).optional()}),g=i.object({measurementId:i.string().min(1,`Measurement ID is required for GA4`),debug:i.boolean().optional(),anonymizeIp:i.boolean().optional(),sendPageView:i.boolean().optional(),cookieFlags:i.string().optional(),autoTrack:i.object({pageViews:i.boolean().optional(),downloads:i.boolean().optional(),externalLinks:i.boolean().optional(),search:i.boolean().optional()}).optional()}),_=i.object({tagId:i.string().min(1,`Tag ID is required for GTM`),dataLayerName:i.string().optional(),preview:i.string().optional()}),v=i.object({appId:i.string().min(1,`Algolia App ID is required`),apiKey:i.string().min(1,`Algolia API Key is required`),indexName:i.string().min(1,`Algolia Index Name is required`)}),y=i.object({repo:i.string().min(1,`Giscus repository is required`),repoId:i.string().min(1,`Giscus repository ID is required`),category:i.string().optional(),categoryId:i.string().optional(),mapping:i.enum([`pathname`,`url`,`title`,`og:title`,`specific`,`number`]).optional(),strict:i.union([i.enum([`0`,`1`]),i.boolean()]).optional(),reactionsEnabled:i.union([i.enum([`0`,`1`]),i.boolean()]).optional(),emitMetadata:i.union([i.enum([`0`,`1`]),i.boolean()]).optional(),inputPosition:i.enum([`top`,`bottom`]).optional(),theme:i.string().optional(),darkTheme:i.string().optional(),lang:i.string().optional(),loading:i.enum([`lazy`,`eager`]).optional()}),b=i.object({enabled:i.boolean(),owner:i.string().min(1,`GitHub owner is required`),repo:i.string().min(1,`GitHub repository name is required`),categorySlug:i.string().optional(),endpoint:i.string().optional()}),x=i.object({ga4:g.optional(),gtm:_.optional(),algolia:v.optional(),feedback:i.object({giscus:y.optional(),custom:b.optional()}).optional()}),S=i.object({siteUrl:i.string().url().optional(),docsDir:i.string().optional(),base:i.string().optional(),theme:u.optional(),i18n:f.optional(),versions:p.optional(),plugins:i.array(l).optional(),robots:d.optional(),security:m.optional(),seo:h.optional(),integrations:x.optional(),vite:i.record(i.string(),i.unknown()).optional()}),C=[`boltdocs.config.js`,`boltdocs.config.mjs`,`boltdocs.config.ts`];async function w(t,i=process.cwd()){let s=i,c={docsDir:n.resolve(t),theme:{title:`Boltdocs`,description:`A Vite documentation framework`,navbar:[{label:`Home`,href:`/`},{label:`Documentation`,href:`/docs`}],codeTheme:{light:`github-light`,dark:`github-dark`}}},l={};for(let e of C){let t=n.resolve(s,e);if(r.existsSync(t))try{let e=await o({command:`serve`,mode:`development`},t,s);if(e){l=e.config;break}}catch(t){a(`Failed to load config from ${e}:`,t)}}let u={title:l.title,description:l.description,logo:l.logo,favicon:l.favicon,navbar:l.navbar,sidebar:l.sidebar,sidebarGroups:l.theme?.sidebarGroups,socialLinks:l.socialLinks,githubRepo:l.githubRepo,tabs:l.tabs,codeTheme:l.codeTheme,communityHelp:l.communityHelp,version:l.version,editLink:l.editLink,...l.theme||{}},d=Object.fromEntries(Object.entries(u).filter(([e,t])=>t!==void 0));d.navbar&&=d.navbar.map(e=>({label:e.label||e.text||``,href:e.href||e.link||e.to||``,items:e.items}));let f={docsDir:n.resolve(t),theme:{...c.theme,...d},i18n:l.i18n?{...l.i18n,locales:Array.isArray(l.i18n.locales)?Object.fromEntries(l.i18n.locales.map(e=>[e,e])):l.i18n.locales}:void 0,versions:l.versions,siteUrl:l.siteUrl,base:l.base,seo:l.seo,plugins:l.plugins||[],robots:l.robots,security:l.security,integrations:l.integrations,vite:l.vite},p=S.safeParse(f);if(!p.success)throw new e(`Invalid Boltdocs configuration:\n${p.error.issues.map(e=>` - ${e.path.join(`.`)}: ${e.message}`).join(`
|
|
7
|
-
`)}`);return p.data}async function T(e,n=process.cwd()){let r=await w(e,n);return t(r,e,n),r}export{s as a,l as i,w as n,T as r,C as t};
|
package/dist/node-B7qbjtLl.mjs
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
-
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
import{r as e,u as t}from"./utils-DexBrwiP.mjs";import{i as n,n as r}from"./config-DBKBEj3j.mjs";import{n as i,t as a}from"./types-generator-BRyf4o9F.mjs";import{t as o}from"./routes-TUSK5wD7.mjs";import{o as s}from"./shiki-adapter-rQ087Lx3.mjs";import{t as c}from"./handler-CyIBbZdb.mjs";import{createRequire as l}from"node:module";import u from"node:path";import d from"node:fs";import{z as f}from"zod";import*as p from"@bdocs/dui";import{colors as m,warn as h}from"@bdocs/dui";import g from"semver";import{build as _}from"@bdocs/ssg/node";import{EXIT as v,SKIP as y,visit as b}from"unist-util-visit";var x=Object.defineProperty,ee=(e,t)=>{let n={};for(var r in e)x(n,r,{get:e[r],enumerable:!0});return t||x(n,Symbol.toStringTag,{value:`Module`}),n},S=l(import.meta.url);function te(e,n){let r=u.resolve(process.cwd(),`index.css`),i=d.existsSync(r)?`import './index.css';`:``,a=n?.plugins?.flatMap(e=>Object.entries(e.components||{}))||[],o=a.map(([e,n])=>`import * as _comp_${e} from '${t(n)}';
|
|
7
|
-
const ${e} = _comp_${e}.default || _comp_${e}['${e}'] || _comp_${e};`).join(`
|
|
8
|
-
`),s=a.map(([e])=>e).join(`, `),c=u.basename(e.docsDir||`docs`),l=u.resolve(process.cwd(),e.docsDir||`docs`),f=[`tsx`,`ts`,`jsx`,`js`].map(e=>u.resolve(l,`pages-external/index.${e}`)).find(e=>d.existsSync(e)),p=f?`import * as _external_module from '${t(f)}';`:``,m=f?`externalPages: _external_module.pages, externalLayout: _external_module.layout,`:``,h=process.env.VITE_SSG===`true`,g=h?`{ eager: true }`:`{}`,_=h?``:`
|
|
9
|
-
if (typeof window !== 'undefined') {
|
|
10
|
-
const prefetchAll = () => {
|
|
11
|
-
const getters = Object.values(mdxModules)
|
|
12
|
-
if (getters.length === 0) return
|
|
13
|
-
let i = 0
|
|
14
|
-
const nextBatch = () => {
|
|
15
|
-
if (i >= getters.length) return
|
|
16
|
-
const batch = getters.slice(i, i + 6)
|
|
17
|
-
i += batch.length
|
|
18
|
-
Promise.allSettled(batch.map(fn => fn())).then(() => {
|
|
19
|
-
setTimeout(nextBatch, 0)
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
;(typeof requestIdleCallback === 'function' ? requestIdleCallback : function(cb) { setTimeout(cb, 500) })(nextBatch)
|
|
23
|
-
}
|
|
24
|
-
prefetchAll()
|
|
25
|
-
}
|
|
26
|
-
`;return`
|
|
27
|
-
import { ViteReactSSG, createRoutes } from 'boltdocs/client'
|
|
28
|
-
import _routes from 'virtual:boltdocs-routes.ts'
|
|
29
|
-
import _collections from 'virtual:boltdocs-collections.ts'
|
|
30
|
-
import _config from 'virtual:boltdocs-config.ts'
|
|
31
|
-
import _user_mdx_components from 'virtual:boltdocs-mdx-components.tsx'
|
|
32
|
-
${i}
|
|
33
|
-
${o}
|
|
34
|
-
${p}
|
|
35
|
-
|
|
36
|
-
const mdxModules = import.meta.glob('/${c}/**/*.{md,mdx}', ${g});
|
|
37
|
-
|
|
38
|
-
const _collLayoutMods = import.meta.glob('${`/${c}/**/layout.tsx`}', { eager: true });
|
|
39
|
-
const _collListMods = import.meta.glob('${`/${c}/**/list.tsx`}', { eager: true });
|
|
40
|
-
const _collPostMods = import.meta.glob('${`/${c}/**/post.tsx`}', { eager: true });
|
|
41
|
-
|
|
42
|
-
const _collectionLayouts = {};
|
|
43
|
-
for (const [p, mod] of Object.entries(_collLayoutMods)) {
|
|
44
|
-
const dir = p.split('/').slice(-2, -1)[0];
|
|
45
|
-
if (dir.startsWith('[') && dir.endsWith(']')) {
|
|
46
|
-
_collectionLayouts[dir.slice(1, -1)] = mod.default || mod;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const _collectionLists = {};
|
|
51
|
-
for (const [p, mod] of Object.entries(_collListMods)) {
|
|
52
|
-
const dir = p.split('/').slice(-2, -1)[0];
|
|
53
|
-
if (dir.startsWith('[') && dir.endsWith(']')) {
|
|
54
|
-
_collectionLists[dir.slice(1, -1)] = mod.default || mod;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const _collectionPosts = {};
|
|
59
|
-
for (const [p, mod] of Object.entries(_collPostMods)) {
|
|
60
|
-
const dir = p.split('/').slice(-2, -1)[0];
|
|
61
|
-
if (dir.startsWith('[') && dir.endsWith(']')) {
|
|
62
|
-
_collectionPosts[dir.slice(1, -1)] = mod.default || mod;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export const createRoot = ViteReactSSG(
|
|
67
|
-
{
|
|
68
|
-
routes: createRoutes({
|
|
69
|
-
routesData: _routes,
|
|
70
|
-
collectionsData: _collections,
|
|
71
|
-
collectionLayouts: _collectionLayouts,
|
|
72
|
-
collectionLists: _collectionLists,
|
|
73
|
-
collectionPosts: _collectionPosts,
|
|
74
|
-
config: _config,
|
|
75
|
-
mdxModules,
|
|
76
|
-
${m}
|
|
77
|
-
components: { ${s}${s?`, `:``} ...(_user_mdx_components || {}) },
|
|
78
|
-
}),
|
|
79
|
-
},
|
|
80
|
-
({ isClient }) => {
|
|
81
|
-
// Boltdocs initialization hook
|
|
82
|
-
if (isClient) {
|
|
83
|
-
// Client-side initialization
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
);
|
|
87
|
-
${_}
|
|
88
|
-
`}var C=class extends Error{name=this.constructor.name;constructor(e,t,n){super(`[plugin:${e}] ${t}`,n),this.pluginName=e}},w=class extends C{constructor(e,t){super(e,`Validation failed: ${t}`)}},T=class extends C{constructor(e,t){super(e,`Compatibility error: ${t}`)}},E=class extends C{constructor(e,t,n){super(e,`Error in hook '${t}': ${n.message}`,{cause:n}),this.hookName=t}},D=class{data=new Map;getNamespaceKey(e,t){return`${e}:${t}`}get(e,t){let n=this.getNamespaceKey(e,t),r=this.data.get(n);if(r!==void 0)return typeof r==`object`&&r?JSON.parse(JSON.stringify(r)):r}set(e,t,n){let r=this.getNamespaceKey(e,t),i=typeof n==`object`&&n?JSON.parse(JSON.stringify(n)):n;this.data.set(r,i)}has(e,t){let n=this.getNamespaceKey(e,t);return this.data.has(n)}};const O=n.extend({version:f.string().optional(),boltdocsVersion:f.string().optional(),hooks:f.object({beforeBuild:f.function().optional(),afterBuild:f.function().optional(),beforeDev:f.function().optional(),afterDev:f.function().optional(),buildEnd:f.function().optional(),transformSource:f.function().optional(),transformMdx:f.function().optional(),transformHtml:f.function().optional()}).optional()});function k(e,t){let n=[],r=new Set;for(let i of e){let e=O.safeParse(i);if(!e.success)throw new w(i.name||`unknown`,e.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `));let a=e.data;if(r.has(a.name))throw new w(a.name,`Duplicate plugin name detected`);if(r.add(a.name),a.boltdocsVersion&&!g.satisfies(t,a.boltdocsVersion))throw new T(a.name,`Plugin expects Boltdocs version ${a.boltdocsVersion}, but current is ${t}`);if(a.components){for(let[e,t]of Object.entries(a.components))if((t.includes(`..`)||u.isAbsolute(t))&&t.includes(`..`))throw new w(a.name,`Component '${e}' has an invalid path: traversal sequences are not allowed.`)}n.push(a)}return n}function A(e,t=process.cwd()){let n=e.plugins||[];for(let e of n)if(e.name)try{let n=null;try{let{createRequire:r}=S(`node:module`);n=r(u.resolve(t,`package.json`)).resolve(`${e.name}/package.json`)}catch{let r=u.resolve(t,`node_modules`,e.name,`package.json`);d.existsSync(r)&&(n=r)}if(n&&d.existsSync(n)){let t=JSON.parse(d.readFileSync(n,`utf-8`)).scripts||{};(t.preinstall||t.postinstall||t.install)&&h(`💡 ${m.yellow(m.bold(`Nota de seguridad:`))} El plugin ${m.cyan(e.name)} ejecuta scripts nativos al instalarse. Corre ${m.bold(`boltdocs audit`)} para un análisis detallado.`)}}catch{}}var ne=class{name=`ConfigResolve`;async execute(e){e.config=await r(`docs`,e.root),A(e.config,e.root),e.viteConfig=await $(e.root,`production`)}};function j(e){return e.map(e=>({path:e.path,filePath:e.filePath,title:e.title,description:e.description||``,sidebarPosition:e.sidebarPosition,badge:e.badge,icon:e.icon,headings:e.headings||[],_content:e._content||``,_rawContent:e._rawContent||``,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,frontmatter:e.frontmatter,slugParts:e.slugParts}))}var M=class{name=`RouteGenerate`;async execute(e){if(!e.config)throw Error(`Config not resolved. Run ConfigResolve first.`);let t=u.resolve(e.root,`docs`),n=e.viteConfig?.base||e.config.base||`/docs`;e.routes=[...await o(t,e.config,n)],e.ssgRoutes=j(e.routes)}};const N=f.object({title:f.string().optional(),description:f.string().optional(),canonical:f.string().url().optional(),robots:f.string().optional(),noindex:f.boolean().optional(),"og:title":f.string().optional(),"og:description":f.string().optional(),"og:image":f.string().optional(),"og:type":f.string().optional(),"og:url":f.string().url().optional()});var P=class{name=`SEOValidate`;async execute(e){if(!e.routes||!e.config)throw Error(`Routes or Config not initialized.`);let t=e.config.siteUrl;e.routes=e.routes.map(e=>{let n=e.seo||{},r=n.canonical||(t?`${t.replace(/\/$/,``)}${e.path}`:void 0),i=n[`og:url`]||r||void 0,a={...n};r&&(a.canonical=r),i&&(a[`og:url`]=i),!a[`og:title`]&&e.title&&(a[`og:title`]=e.title),!a[`og:description`]&&e.description&&(a[`og:description`]=e.description);let o=N.safeParse(a);return o.success||h(`[SEOValidate] Validation issues on route "${e.path}":`,o.error.message),e.title||h(`[SEOValidate] Route "${e.path}" is missing a title.`),{...e,seo:a}}),e.ssgRoutes=j(e.routes)}},F=class{name=`TypeGenerate`;async execute(e){if(!e.config||!e.routes)throw Error(`Config or Routes not initialized.`);let t=u.resolve(e.root,`docs`),n=e.routes.map(e=>e.path),r=(e.config.base||`/docs`).replace(/\/$/,``);n.includes(r)||n.push(r),a(e.config,t,e.root,n),i(n)}},I=class{name=`SSGBuild`;async execute(e){if(!e.routes||!e.viteConfig)throw Error(`Routes or ViteConfig not initialized.`);let t={};for(let n of e.routes)if(n.path&&n.componentPath){t[n.path]=n.componentPath;let e=n.path.replace(/\/$/,``);t[e]=n.componentPath}await _({entry:`boltdocs/entry`,routeToSourceFileMap:t,cacheDir:u.resolve(e.root,`.boltdocs/build`)},e.viteConfig),e.outDir=e.viteConfig.build?.outDir||`dist`}};function L(t,n){let r=(n.siteUrl||``).replace(/\/$/,``);if(!r)return``;let i=n.seo?.indexing!==`all`&&n.seo?.indexing!==`public`;return`<?xml version="1.0" encoding="UTF-8"?>
|
|
89
|
-
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
90
|
-
${t.filter(e=>e.seo?.noindex||typeof e.seo?.robots==`string`&&e.seo.robots.includes(`noindex`)?!1:(i&&e.seo?.index,!0)).map(t=>` <url>
|
|
91
|
-
<loc>${e(`${r}${t.path.startsWith(`/`)?t.path:`/${t.path}`}`)}</loc>
|
|
92
|
-
<changefreq>weekly</changefreq>
|
|
93
|
-
<priority>0.7</priority>
|
|
94
|
-
</url>`).join(`
|
|
95
|
-
`)}
|
|
96
|
-
</urlset>`}function R(e){let t=e.siteUrl||``,n=t?`${t.replace(/\/$/,``)}/sitemap.xml`:``;if(e.seo?.indexing!==`all`&&e.seo?.indexing!==`public`&&e.seo?.indexing)return[`User-agent: *`,`Disallow: /`].filter(Boolean).join(`
|
|
97
|
-
`);if(typeof e.robots==`string`)return e.robots;if(e.robots&&typeof e.robots==`object`){let t=e.robots.rules||[],r=e.robots.sitemaps||[],i=t.map(e=>{let t=`User-agent: ${e.userAgent}\n`;return e.allow&&(Array.isArray(e.allow)?t+=e.allow.map(e=>`Allow: ${e}`).join(`
|
|
98
|
-
`)+`
|
|
99
|
-
`:t+=`Allow: ${e.allow}\n`),e.disallow&&(Array.isArray(e.disallow)?t+=e.disallow.map(e=>`Disallow: ${e}`).join(`
|
|
100
|
-
`)+`
|
|
101
|
-
`:t+=`Disallow: ${e.disallow}\n`),t.trim()}).join(`
|
|
102
|
-
|
|
103
|
-
`),a=[...n?[n]:[],...r].map(e=>`Sitemap: ${e}`).join(`
|
|
104
|
-
`);return`${i}${a?`\n\n${a}`:``}`}return[`User-agent: *`,`Allow: /`,``,n?`Sitemap: ${n}`:``].filter(Boolean).join(`
|
|
105
|
-
`)}var z=class{name=`SEOWrite`;async execute(e){if(!e.ssgRoutes||!e.config||!e.outDir)throw Error(`SSG Routes, Config, or OutDir not initialized.`);let t=L(e.ssgRoutes,e.config),n=u.resolve(e.root,e.outDir);t&&d.writeFileSync(u.join(n,`sitemap.xml`),t,`utf-8`);let r=R(e.config);d.writeFileSync(u.join(n,`robots.txt`),r,`utf-8`)}};function B(){return new V().addStep(new ne).addStep(new M).addStep(new P).addStep(new F).addStep(new I).addStep(new z)}var V=class{steps=[];addStep(e){return this.steps.push(e),this}async run(e){let t=[],n=performance.now(),r={...e,timing:{}};for(let e of this.steps){let i=performance.now();try{await e.execute(r);let n=performance.now()-i;t.push({name:e.name,duration:n,success:!0}),r.timing[e.name]=n}catch(a){let o=performance.now()-i;t.push({name:e.name,duration:o,success:!1,error:a instanceof Error?a:Error(String(a))});for(let e of t.filter(e=>e.success).reverse()){let t=this.steps.find(t=>t.name===e.name);if(t?.rollback)try{await t.rollback(r)}catch(t){console.error(`[pipeline] rollback failed for step "${e.name}":`,t)}}let s=performance.now()-n;return{success:!1,failedStep:e.name,error:a instanceof Error?a:Error(String(a)),timing:{total:s,steps:r.timing},stepResults:t}}}return{success:!0,timing:{total:performance.now()-n,steps:r.timing},stepResults:t}}},H=class{plugins;config;store;docsDir;rootDir;constructor(e,t,n,r){this.plugins=e,this.config=t,this.store=new D,this.docsDir=n||process.cwd(),this.rootDir=r||process.cwd()}async runHook(e,...t){let n=this.getSortedPlugins(),r=new V;for(let i of n)i.hooks?.[e]&&r.addStep(this.createStep(i,e,t));await r.run({})}async runChain(e,t){let n=this.getSortedPlugins(),r=t;for(let t of n){if(!t.hooks?.[e])continue;let n=this.createContext(t);try{let i=t.hooks[e],a=await i(n,r);a!==void 0&&(r=a)}catch(r){let i=new E(t.name,e,r instanceof Error?r:Error(String(r)));n.logger.error(i)}}return r}getSortedPlugins(){let e=this.plugins.filter(e=>e.enforce===`pre`),t=this.plugins.filter(e=>!e.enforce),n=this.plugins.filter(e=>e.enforce===`post`);return[...e,...t,...n]}createStep(e,t,n){return{name:`${e.name}:${String(t)}`,execute:async()=>{let r=this.createContext(e);try{let i=e.hooks[t];await i(r,...n)}catch(n){let i=new E(e.name,t,n instanceof Error?n:Error(String(n)));r.logger.error(i)}},rollback:async()=>{let t=e.hooks?.buildEnd;if(t){let n=this.createContext(e);try{await t(n)}catch{}}}}}createContext(e){return{config:Object.freeze({...this.config}),docsDir:this.docsDir,rootDir:this.rootDir,meta:{name:e.name,version:e.version,boltdocsVersion:e.boltdocsVersion},store:{get:(e,t)=>this.store.get(e,t),set:(e,t,n)=>this.store.set(e,t,n),has:(e,t)=>this.store.has(e,t)},logger:this.createLogger(e.name)}}createLogger(e){let t=`[plugin:${e}]`;return{info:e=>p.info(`${t} ${e}`),warn:e=>p.warn(`${t} ${e}`),error:e=>{p.error(`${t} ${e instanceof Error?e.message:e}`)},debug:e=>p.debug(`${t} ${e}`)}}};function U(e,t,n){e&&b(e,typeof t==`function`?t:e=>Array.isArray(t)?t.includes(e.type):e.type===t,(e,t,r)=>{if(t!==void 0&&r!==void 0)return n(e,t,r)})}function W(e,t,n){U(e,s.ELEMENT,(e,r,i)=>{if(e.tagName===t)return n(e,r,i)})}function G(e,t,n){let r=Array.isArray(t)?t:[t],i=[s.JSX_FLOW_ELEMENT,s.JSX_TEXT_ELEMENT];U(e,e=>i.includes(e.type),(e,t,i)=>{if(e.name&&r.includes(e.name))return n(e,t,i)})}function K(e,t,n){e&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties[t]=n)}function q(e,t){return e?.data?.hProperties?.[t]}function J(e,t){return typeof t==`object`&&t?{type:s.JSX_ATTRIBUTE,name:e,value:t}:{type:s.JSX_ATTRIBUTE,name:e,value:String(t)}}function Y(e,t={},n=[]){return{type:s.ELEMENT,tagName:e,properties:t,children:n}}function X(e,t={},n=[],r=!0){let i=Object.entries(t).map(([e,t])=>J(e,t));return{type:r?s.JSX_FLOW_ELEMENT:s.JSX_TEXT_ELEMENT,name:e,attributes:i,children:n}}function re(e,t){e&&b(e,s.HEADING,(e,n,r)=>{if(n!==void 0&&r!==void 0)return t(e,n,r)})}function ie(e,t){e&&b(e,s.LINK,(e,n,r)=>{if(n!==void 0&&r!==void 0)return t(e,n,r)})}function ae(e,t){if(!e)return;e.properties=e.properties||{};let n=e.properties.className;Array.isArray(n)?n.includes(t)||n.push(t):typeof n==`string`?n!==t&&(e.properties.className=[n,t]):e.properties.className=[t]}function oe(e,t){if(!e||!e.properties||!e.properties.className)return;let n=e.properties.className;Array.isArray(n)?e.properties.className=n.filter(e=>e!==t):typeof n==`string`&&n===t&&delete e.properties.className}function se(e,t){if(!e||!e.properties||!e.properties.className)return!1;let n=e.properties.className;return Array.isArray(n)?n.includes(t):typeof n==`string`?n===t:!1}function ce(e){return e}const Z={"Access-Control-Allow-Origin":`*`,"Access-Control-Allow-Methods":`POST, OPTIONS`,"Access-Control-Allow-Headers":`Content-Type`,"Content-Type":`application/json`};async function le(e,t){if(Object.entries(Z).forEach(([e,n])=>{t.setHeader(e,n)}),e.method===`OPTIONS`){t.status(200).end();return}if(e.method!==`POST`){t.status(405).json({error:`Method Not Allowed`});return}try{let n=await c(e.body,process.env);t.status(200).json(n)}catch(e){let n=e instanceof Error?e.message:`Failed to submit feedback`;return t.status(500).json({error:n})}}async function ue(e,t=process.env){let n=(e,t=200)=>({statusCode:t,headers:Z,body:e?JSON.stringify(e):``});if(e.httpMethod===`OPTIONS`)return n(null,200);if(e.httpMethod!==`POST`)return n({error:`Method Not Allowed`},405);try{return n(await c(e.body?JSON.parse(e.body):{},t))}catch(e){return n({error:e instanceof Error?e.message:`Failed to submit feedback`},500)}}async function Q(e,t={}){let n=(e,t=200)=>new Response(e?JSON.stringify(e):null,{status:t,headers:Z});if(e.method===`OPTIONS`)return n(null);if(e.method!==`POST`)return n({error:`Method Not Allowed`},405);try{return n(await c(await e.json(),{...process.env,...t}))}catch(e){return n({error:e instanceof Error?e.message:`Failed to submit feedback`},500)}}async function de(e,t=process.env){let n=(e,t=200)=>({statusCode:t,headers:Z,body:e?JSON.stringify(e):``});if(e.httpMethod===`OPTIONS`)return n(null,200);if(e.httpMethod!==`POST`)return n({error:`Method Not Allowed`},405);try{return n(await c(e.body?JSON.parse(e.body):{},t))}catch(e){return n({error:e instanceof Error?e.message:`Failed to submit feedback`},500)}}async function fe(e){let{resolveConfig:t}=await import(`./config-GPVEdeon.mjs`),{generateRoutes:n}=await import(`./routes-DR13Y1em.mjs`),{generateProjectTypes:r,writeLinkTree:i}=await import(`./types-generator-Cu2jQP-V.mjs`),{boltdocsPlugin:a}=await import(`./plugin-BkquLpOI.mjs`),o=e?.docsDir||`docs`,s=await t(o),c=(await n(o,s)).map(e=>e.path),l=(s.base||`/docs`).replace(/\/$/,``);return c.includes(l)||c.push(l),r(s,o,void 0,c),i(c),a({...e},s)}async function $(e,t=`development`,n){let[r,i,{boltdocsPlugin:a,getExternalAbsolutePaths:o},{SECURITY_HEADERS:s},{getCSPHeader:c},{resolveConfig:l},{generateRoutes:d},{generateProjectTypes:f,writeLinkTree:p},{normalizePath:m}]=await Promise.all([import(`@vitejs/plugin-react`),import(`@tailwindcss/vite`),import(`./plugin-BkquLpOI.mjs`),import(`./headers-HD_qTVVW.mjs`).then(e=>e.n),import(`./csp-RJyh0nHV.mjs`).then(e=>e.t),import(`./config-GPVEdeon.mjs`),import(`./routes-DR13Y1em.mjs`),import(`./types-generator-Cu2jQP-V.mjs`),import(`vite`).then(e=>({normalizePath:e.normalizePath}))]),h=r.default,g=i.default,_=n||await l(`docs`,e),v=(await d(`docs`,_)).map(e=>e.path),y=(_.base||`/docs`).replace(/\/$/,``);v.includes(y)||v.push(y),f(_,`docs`,e,v),p(v);let b=t===`production`,x=b?{...s}:{};return _.security?.enableCSP&&(x[`Content-Security-Policy`]=c(_)),{root:e,mode:t,oxc:{jsx:{development:!b,runtime:`automatic`,importSource:`react`}},optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-helmet-async`,`react-router-dom`,`react-fast-compare`,`invariant`,`use-sync-external-store/shim`]},build:{},plugins:[h(),g(),...a({docsDir:`docs`,root:e},_)],resolve:{alias:[{find:`boltdocs/entry`,replacement:m(u.resolve(e,`boltdocs-entry.tsx`))},{find:`boltdocs/client`,replacement:m(u.resolve(e,`boltdocs-client.mjs`))},{find:`use-sync-external-store/shim/index.js`,replacement:`react`},{find:`use-sync-external-store/shim`,replacement:`react`},{find:`use-sync-external-store`,replacement:`react`},{find:`@`,replacement:m(u.resolve(e,`../packages/core/src`))}],dedupe:[`react`,`react-dom`]},ssr:{external:[`react`,`react-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`,...o()],optimizeDeps:{include:[`react`,`react-dom`,`react-fast-compare`,`invariant`,..._.vite?.ssr?.optimizeDeps?.include||[]]},noExternal:[`boltdocs`,/@bdocs\/(?!ssg).*/,`react-aria-components`,`@react-aria/collections`,`@react-aria/utils`,`react-router-dom`]},server:{headers:{...x,..._.vite?.server?.headers},..._.vite?.server},preview:{headers:{...x,..._.vite?.preview?.headers},..._.vite?.preview},..._.vite}}export{C as A,H as C,k as D,A as E,w as M,te as N,D as O,ee as P,ie as S,j as T,K as _,ue as a,W as b,v as c,J as d,X as f,oe as g,se as h,Q as i,E as j,T as k,y as l,q as m,$ as n,le as o,Y as p,de as r,ce as s,fe as t,ae as u,G as v,B as w,re as x,U as y};
|
package/dist/node-Dj3-2YYP.cjs
DELETED
|
@@ -1,105 +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-Ds5LZdWN.cjs`),t=require(`./utils-BWy_8ASj.cjs`),n=require(`./config-BqZUYono.cjs`),r=require(`./types-generator-BqNKCbrx.cjs`),i=require(`./routes-DgTQxpZi.cjs`),a=require(`./shiki-adapter-BB71nVsG.cjs`),o=require(`./handler-1LRMYeI4.cjs`);let s=require(`node:path`);s=e.n(s);let c=require(`node:fs`);c=e.n(c);let l=require(`zod`),u=require(`@bdocs/dui`);u=e.n(u);let d=require(`semver`);d=e.n(d);let f=require(`@bdocs/ssg/node`),p=require(`unist-util-visit`);function m(e,n){let r=s.default.resolve(process.cwd(),`index.css`),i=c.default.existsSync(r)?`import './index.css';`:``,a=n?.plugins?.flatMap(e=>Object.entries(e.components||{}))||[],o=a.map(([e,n])=>`import * as _comp_${e} from '${t.u(n)}';
|
|
7
|
-
const ${e} = _comp_${e}.default || _comp_${e}['${e}'] || _comp_${e};`).join(`
|
|
8
|
-
`),l=a.map(([e])=>e).join(`, `),u=s.default.basename(e.docsDir||`docs`),d=s.default.resolve(process.cwd(),e.docsDir||`docs`),f=[`tsx`,`ts`,`jsx`,`js`].map(e=>s.default.resolve(d,`pages-external/index.${e}`)).find(e=>c.default.existsSync(e)),p=f?`import * as _external_module from '${t.u(f)}';`:``,m=f?`externalPages: _external_module.pages, externalLayout: _external_module.layout,`:``,h=process.env.VITE_SSG===`true`,g=h?`{ eager: true }`:`{}`,_=h?``:`
|
|
9
|
-
if (typeof window !== 'undefined') {
|
|
10
|
-
const prefetchAll = () => {
|
|
11
|
-
const getters = Object.values(mdxModules)
|
|
12
|
-
if (getters.length === 0) return
|
|
13
|
-
let i = 0
|
|
14
|
-
const nextBatch = () => {
|
|
15
|
-
if (i >= getters.length) return
|
|
16
|
-
const batch = getters.slice(i, i + 6)
|
|
17
|
-
i += batch.length
|
|
18
|
-
Promise.allSettled(batch.map(fn => fn())).then(() => {
|
|
19
|
-
setTimeout(nextBatch, 0)
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
;(typeof requestIdleCallback === 'function' ? requestIdleCallback : function(cb) { setTimeout(cb, 500) })(nextBatch)
|
|
23
|
-
}
|
|
24
|
-
prefetchAll()
|
|
25
|
-
}
|
|
26
|
-
`;return`
|
|
27
|
-
import { ViteReactSSG, createRoutes } from 'boltdocs/client'
|
|
28
|
-
import _routes from 'virtual:boltdocs-routes.ts'
|
|
29
|
-
import _collections from 'virtual:boltdocs-collections.ts'
|
|
30
|
-
import _config from 'virtual:boltdocs-config.ts'
|
|
31
|
-
import _user_mdx_components from 'virtual:boltdocs-mdx-components.tsx'
|
|
32
|
-
${i}
|
|
33
|
-
${o}
|
|
34
|
-
${p}
|
|
35
|
-
|
|
36
|
-
const mdxModules = import.meta.glob('/${u}/**/*.{md,mdx}', ${g});
|
|
37
|
-
|
|
38
|
-
const _collLayoutMods = import.meta.glob('${`/${u}/**/layout.tsx`}', { eager: true });
|
|
39
|
-
const _collListMods = import.meta.glob('${`/${u}/**/list.tsx`}', { eager: true });
|
|
40
|
-
const _collPostMods = import.meta.glob('${`/${u}/**/post.tsx`}', { eager: true });
|
|
41
|
-
|
|
42
|
-
const _collectionLayouts = {};
|
|
43
|
-
for (const [p, mod] of Object.entries(_collLayoutMods)) {
|
|
44
|
-
const dir = p.split('/').slice(-2, -1)[0];
|
|
45
|
-
if (dir.startsWith('[') && dir.endsWith(']')) {
|
|
46
|
-
_collectionLayouts[dir.slice(1, -1)] = mod.default || mod;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const _collectionLists = {};
|
|
51
|
-
for (const [p, mod] of Object.entries(_collListMods)) {
|
|
52
|
-
const dir = p.split('/').slice(-2, -1)[0];
|
|
53
|
-
if (dir.startsWith('[') && dir.endsWith(']')) {
|
|
54
|
-
_collectionLists[dir.slice(1, -1)] = mod.default || mod;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const _collectionPosts = {};
|
|
59
|
-
for (const [p, mod] of Object.entries(_collPostMods)) {
|
|
60
|
-
const dir = p.split('/').slice(-2, -1)[0];
|
|
61
|
-
if (dir.startsWith('[') && dir.endsWith(']')) {
|
|
62
|
-
_collectionPosts[dir.slice(1, -1)] = mod.default || mod;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export const createRoot = ViteReactSSG(
|
|
67
|
-
{
|
|
68
|
-
routes: createRoutes({
|
|
69
|
-
routesData: _routes,
|
|
70
|
-
collectionsData: _collections,
|
|
71
|
-
collectionLayouts: _collectionLayouts,
|
|
72
|
-
collectionLists: _collectionLists,
|
|
73
|
-
collectionPosts: _collectionPosts,
|
|
74
|
-
config: _config,
|
|
75
|
-
mdxModules,
|
|
76
|
-
${m}
|
|
77
|
-
components: { ${l}${l?`, `:``} ...(_user_mdx_components || {}) },
|
|
78
|
-
}),
|
|
79
|
-
},
|
|
80
|
-
({ isClient }) => {
|
|
81
|
-
// Boltdocs initialization hook
|
|
82
|
-
if (isClient) {
|
|
83
|
-
// Client-side initialization
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
);
|
|
87
|
-
${_}
|
|
88
|
-
`}var h=class extends Error{name=this.constructor.name;constructor(e,t,n){super(`[plugin:${e}] ${t}`,n),this.pluginName=e}},g=class extends h{constructor(e,t){super(e,`Validation failed: ${t}`)}},_=class extends h{constructor(e,t){super(e,`Compatibility error: ${t}`)}},v=class extends h{constructor(e,t,n){super(e,`Error in hook '${t}': ${n.message}`,{cause:n}),this.hookName=t}},y=class{data=new Map;getNamespaceKey(e,t){return`${e}:${t}`}get(e,t){let n=this.getNamespaceKey(e,t),r=this.data.get(n);if(r!==void 0)return typeof r==`object`&&r?JSON.parse(JSON.stringify(r)):r}set(e,t,n){let r=this.getNamespaceKey(e,t),i=typeof n==`object`&&n?JSON.parse(JSON.stringify(n)):n;this.data.set(r,i)}has(e,t){let n=this.getNamespaceKey(e,t);return this.data.has(n)}};const b=n.i.extend({version:l.z.string().optional(),boltdocsVersion:l.z.string().optional(),hooks:l.z.object({beforeBuild:l.z.function().optional(),afterBuild:l.z.function().optional(),beforeDev:l.z.function().optional(),afterDev:l.z.function().optional(),buildEnd:l.z.function().optional(),transformSource:l.z.function().optional(),transformMdx:l.z.function().optional(),transformHtml:l.z.function().optional()}).optional()});function x(e,t){let n=[],r=new Set;for(let i of e){let e=b.safeParse(i);if(!e.success)throw new g(i.name||`unknown`,e.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `));let a=e.data;if(r.has(a.name))throw new g(a.name,`Duplicate plugin name detected`);if(r.add(a.name),a.boltdocsVersion&&!d.default.satisfies(t,a.boltdocsVersion))throw new _(a.name,`Plugin expects Boltdocs version ${a.boltdocsVersion}, but current is ${t}`);if(a.components){for(let[e,t]of Object.entries(a.components))if((t.includes(`..`)||s.default.isAbsolute(t))&&t.includes(`..`))throw new g(a.name,`Component '${e}' has an invalid path: traversal sequences are not allowed.`)}n.push(a)}return n}function S(e,t=process.cwd()){let n=e.plugins||[];for(let e of n)if(e.name)try{let n=null;try{let{createRequire:r}=require(`node:module`);n=r(s.default.resolve(t,`package.json`)).resolve(`${e.name}/package.json`)}catch{let r=s.default.resolve(t,`node_modules`,e.name,`package.json`);c.default.existsSync(r)&&(n=r)}if(n&&c.default.existsSync(n)){let t=JSON.parse(c.default.readFileSync(n,`utf-8`)).scripts||{};(t.preinstall||t.postinstall||t.install)&&(0,u.warn)(`💡 ${u.colors.yellow(u.colors.bold(`Nota de seguridad:`))} El plugin ${u.colors.cyan(e.name)} ejecuta scripts nativos al instalarse. Corre ${u.colors.bold(`boltdocs audit`)} para un análisis detallado.`)}}catch{}}var C=class{name=`ConfigResolve`;async execute(e){e.config=await n.n(`docs`,e.root),S(e.config,e.root),e.viteConfig=await $(e.root,`production`)}};function w(e){return e.map(e=>({path:e.path,filePath:e.filePath,title:e.title,description:e.description||``,sidebarPosition:e.sidebarPosition,badge:e.badge,icon:e.icon,headings:e.headings||[],_content:e._content||``,_rawContent:e._rawContent||``,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,frontmatter:e.frontmatter,slugParts:e.slugParts}))}var T=class{name=`RouteGenerate`;async execute(e){if(!e.config)throw Error(`Config not resolved. Run ConfigResolve first.`);let t=s.default.resolve(e.root,`docs`),n=e.viteConfig?.base||e.config.base||`/docs`;e.routes=[...await i.t(t,e.config,n)],e.ssgRoutes=w(e.routes)}};const E=l.z.object({title:l.z.string().optional(),description:l.z.string().optional(),canonical:l.z.string().url().optional(),robots:l.z.string().optional(),noindex:l.z.boolean().optional(),"og:title":l.z.string().optional(),"og:description":l.z.string().optional(),"og:image":l.z.string().optional(),"og:type":l.z.string().optional(),"og:url":l.z.string().url().optional()});var D=class{name=`SEOValidate`;async execute(e){if(!e.routes||!e.config)throw Error(`Routes or Config not initialized.`);let t=e.config.siteUrl;e.routes=e.routes.map(e=>{let n=e.seo||{},r=n.canonical||(t?`${t.replace(/\/$/,``)}${e.path}`:void 0),i=n[`og:url`]||r||void 0,a={...n};r&&(a.canonical=r),i&&(a[`og:url`]=i),!a[`og:title`]&&e.title&&(a[`og:title`]=e.title),!a[`og:description`]&&e.description&&(a[`og:description`]=e.description);let o=E.safeParse(a);return o.success||(0,u.warn)(`[SEOValidate] Validation issues on route "${e.path}":`,o.error.message),e.title||(0,u.warn)(`[SEOValidate] Route "${e.path}" is missing a title.`),{...e,seo:a}}),e.ssgRoutes=w(e.routes)}},O=class{name=`TypeGenerate`;async execute(e){if(!e.config||!e.routes)throw Error(`Config or Routes not initialized.`);let t=s.default.resolve(e.root,`docs`),n=e.routes.map(e=>e.path),i=(e.config.base||`/docs`).replace(/\/$/,``);n.includes(i)||n.push(i),r.t(e.config,t,e.root,n),r.r(n)}},ee=class{name=`SSGBuild`;async execute(e){if(!e.routes||!e.viteConfig)throw Error(`Routes or ViteConfig not initialized.`);let t={};for(let n of e.routes)if(n.path&&n.componentPath){t[n.path]=n.componentPath;let e=n.path.replace(/\/$/,``);t[e]=n.componentPath}await(0,f.build)({entry:`boltdocs/entry`,routeToSourceFileMap:t,cacheDir:s.default.resolve(e.root,`.boltdocs/build`)},e.viteConfig),e.outDir=e.viteConfig.build?.outDir||`dist`}};function k(e,n){let r=(n.siteUrl||``).replace(/\/$/,``);if(!r)return``;let i=n.seo?.indexing!==`all`&&n.seo?.indexing!==`public`;return`<?xml version="1.0" encoding="UTF-8"?>
|
|
89
|
-
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
90
|
-
${e.filter(e=>e.seo?.noindex||typeof e.seo?.robots==`string`&&e.seo.robots.includes(`noindex`)?!1:(i&&e.seo?.index,!0)).map(e=>` <url>
|
|
91
|
-
<loc>${t.r(`${r}${e.path.startsWith(`/`)?e.path:`/${e.path}`}`)}</loc>
|
|
92
|
-
<changefreq>weekly</changefreq>
|
|
93
|
-
<priority>0.7</priority>
|
|
94
|
-
</url>`).join(`
|
|
95
|
-
`)}
|
|
96
|
-
</urlset>`}function A(e){let t=e.siteUrl||``,n=t?`${t.replace(/\/$/,``)}/sitemap.xml`:``;if(e.seo?.indexing!==`all`&&e.seo?.indexing!==`public`&&e.seo?.indexing)return[`User-agent: *`,`Disallow: /`].filter(Boolean).join(`
|
|
97
|
-
`);if(typeof e.robots==`string`)return e.robots;if(e.robots&&typeof e.robots==`object`){let t=e.robots.rules||[],r=e.robots.sitemaps||[],i=t.map(e=>{let t=`User-agent: ${e.userAgent}\n`;return e.allow&&(Array.isArray(e.allow)?t+=e.allow.map(e=>`Allow: ${e}`).join(`
|
|
98
|
-
`)+`
|
|
99
|
-
`:t+=`Allow: ${e.allow}\n`),e.disallow&&(Array.isArray(e.disallow)?t+=e.disallow.map(e=>`Disallow: ${e}`).join(`
|
|
100
|
-
`)+`
|
|
101
|
-
`:t+=`Disallow: ${e.disallow}\n`),t.trim()}).join(`
|
|
102
|
-
|
|
103
|
-
`),a=[...n?[n]:[],...r].map(e=>`Sitemap: ${e}`).join(`
|
|
104
|
-
`);return`${i}${a?`\n\n${a}`:``}`}return[`User-agent: *`,`Allow: /`,``,n?`Sitemap: ${n}`:``].filter(Boolean).join(`
|
|
105
|
-
`)}var j=class{name=`SEOWrite`;async execute(e){if(!e.ssgRoutes||!e.config||!e.outDir)throw Error(`SSG Routes, Config, or OutDir not initialized.`);let t=k(e.ssgRoutes,e.config),n=s.default.resolve(e.root,e.outDir);t&&c.default.writeFileSync(s.default.join(n,`sitemap.xml`),t,`utf-8`);let r=A(e.config);c.default.writeFileSync(s.default.join(n,`robots.txt`),r,`utf-8`)}};function M(){return new N().addStep(new C).addStep(new T).addStep(new D).addStep(new O).addStep(new ee).addStep(new j)}var N=class{steps=[];addStep(e){return this.steps.push(e),this}async run(e){let t=[],n=performance.now(),r={...e,timing:{}};for(let e of this.steps){let i=performance.now();try{await e.execute(r);let n=performance.now()-i;t.push({name:e.name,duration:n,success:!0}),r.timing[e.name]=n}catch(a){let o=performance.now()-i;t.push({name:e.name,duration:o,success:!1,error:a instanceof Error?a:Error(String(a))});for(let e of t.filter(e=>e.success).reverse()){let t=this.steps.find(t=>t.name===e.name);if(t?.rollback)try{await t.rollback(r)}catch(t){console.error(`[pipeline] rollback failed for step "${e.name}":`,t)}}let s=performance.now()-n;return{success:!1,failedStep:e.name,error:a instanceof Error?a:Error(String(a)),timing:{total:s,steps:r.timing},stepResults:t}}}return{success:!0,timing:{total:performance.now()-n,steps:r.timing},stepResults:t}}},P=class{plugins;config;store;docsDir;rootDir;constructor(e,t,n,r){this.plugins=e,this.config=t,this.store=new y,this.docsDir=n||process.cwd(),this.rootDir=r||process.cwd()}async runHook(e,...t){let n=this.getSortedPlugins(),r=new N;for(let i of n)i.hooks?.[e]&&r.addStep(this.createStep(i,e,t));await r.run({})}async runChain(e,t){let n=this.getSortedPlugins(),r=t;for(let t of n){if(!t.hooks?.[e])continue;let n=this.createContext(t);try{let i=t.hooks[e],a=await i(n,r);a!==void 0&&(r=a)}catch(r){let i=new v(t.name,e,r instanceof Error?r:Error(String(r)));n.logger.error(i)}}return r}getSortedPlugins(){let e=this.plugins.filter(e=>e.enforce===`pre`),t=this.plugins.filter(e=>!e.enforce),n=this.plugins.filter(e=>e.enforce===`post`);return[...e,...t,...n]}createStep(e,t,n){return{name:`${e.name}:${String(t)}`,execute:async()=>{let r=this.createContext(e);try{let i=e.hooks[t];await i(r,...n)}catch(n){let i=new v(e.name,t,n instanceof Error?n:Error(String(n)));r.logger.error(i)}},rollback:async()=>{let t=e.hooks?.buildEnd;if(t){let n=this.createContext(e);try{await t(n)}catch{}}}}}createContext(e){return{config:Object.freeze({...this.config}),docsDir:this.docsDir,rootDir:this.rootDir,meta:{name:e.name,version:e.version,boltdocsVersion:e.boltdocsVersion},store:{get:(e,t)=>this.store.get(e,t),set:(e,t,n)=>this.store.set(e,t,n),has:(e,t)=>this.store.has(e,t)},logger:this.createLogger(e.name)}}createLogger(e){let t=`[plugin:${e}]`;return{info:e=>u.info(`${t} ${e}`),warn:e=>u.warn(`${t} ${e}`),error:e=>{u.error(`${t} ${e instanceof Error?e.message:e}`)},debug:e=>u.debug(`${t} ${e}`)}}};function F(e,t,n){e&&(0,p.visit)(e,typeof t==`function`?t:e=>Array.isArray(t)?t.includes(e.type):e.type===t,(e,t,r)=>{if(t!==void 0&&r!==void 0)return n(e,t,r)})}function I(e,t,n){F(e,a.o.ELEMENT,(e,r,i)=>{if(e.tagName===t)return n(e,r,i)})}function L(e,t,n){let r=Array.isArray(t)?t:[t],i=[a.o.JSX_FLOW_ELEMENT,a.o.JSX_TEXT_ELEMENT];F(e,e=>i.includes(e.type),(e,t,i)=>{if(e.name&&r.includes(e.name))return n(e,t,i)})}function R(e,t,n){e&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties[t]=n)}function z(e,t){return e?.data?.hProperties?.[t]}function B(e,t){return typeof t==`object`&&t?{type:a.o.JSX_ATTRIBUTE,name:e,value:t}:{type:a.o.JSX_ATTRIBUTE,name:e,value:String(t)}}function V(e,t={},n=[]){return{type:a.o.ELEMENT,tagName:e,properties:t,children:n}}function H(e,t={},n=[],r=!0){let i=Object.entries(t).map(([e,t])=>B(e,t));return{type:r?a.o.JSX_FLOW_ELEMENT:a.o.JSX_TEXT_ELEMENT,name:e,attributes:i,children:n}}function U(e,t){e&&(0,p.visit)(e,a.o.HEADING,(e,n,r)=>{if(n!==void 0&&r!==void 0)return t(e,n,r)})}function W(e,t){e&&(0,p.visit)(e,a.o.LINK,(e,n,r)=>{if(n!==void 0&&r!==void 0)return t(e,n,r)})}function G(e,t){if(!e)return;e.properties=e.properties||{};let n=e.properties.className;Array.isArray(n)?n.includes(t)||n.push(t):typeof n==`string`?n!==t&&(e.properties.className=[n,t]):e.properties.className=[t]}function K(e,t){if(!e||!e.properties||!e.properties.className)return;let n=e.properties.className;Array.isArray(n)?e.properties.className=n.filter(e=>e!==t):typeof n==`string`&&n===t&&delete e.properties.className}function q(e,t){if(!e||!e.properties||!e.properties.className)return!1;let n=e.properties.className;return Array.isArray(n)?n.includes(t):typeof n==`string`?n===t:!1}function J(e){return e}const Y={"Access-Control-Allow-Origin":`*`,"Access-Control-Allow-Methods":`POST, OPTIONS`,"Access-Control-Allow-Headers":`Content-Type`,"Content-Type":`application/json`};async function X(e,t){if(Object.entries(Y).forEach(([e,n])=>{t.setHeader(e,n)}),e.method===`OPTIONS`){t.status(200).end();return}if(e.method!==`POST`){t.status(405).json({error:`Method Not Allowed`});return}try{let n=await o.t(e.body,process.env);t.status(200).json(n)}catch(e){let n=e instanceof Error?e.message:`Failed to submit feedback`;return t.status(500).json({error:n})}}async function Z(e,t=process.env){let n=(e,t=200)=>({statusCode:t,headers:Y,body:e?JSON.stringify(e):``});if(e.httpMethod===`OPTIONS`)return n(null,200);if(e.httpMethod!==`POST`)return n({error:`Method Not Allowed`},405);try{return n(await o.t(e.body?JSON.parse(e.body):{},t))}catch(e){return n({error:e instanceof Error?e.message:`Failed to submit feedback`},500)}}async function Q(e,t={}){let n=(e,t=200)=>new Response(e?JSON.stringify(e):null,{status:t,headers:Y});if(e.method===`OPTIONS`)return n(null);if(e.method!==`POST`)return n({error:`Method Not Allowed`},405);try{return n(await o.t(await e.json(),{...process.env,...t}))}catch(e){return n({error:e instanceof Error?e.message:`Failed to submit feedback`},500)}}async function te(e,t=process.env){let n=(e,t=200)=>({statusCode:t,headers:Y,body:e?JSON.stringify(e):``});if(e.httpMethod===`OPTIONS`)return n(null,200);if(e.httpMethod!==`POST`)return n({error:`Method Not Allowed`},405);try{return n(await o.t(e.body?JSON.parse(e.body):{},t))}catch(e){return n({error:e instanceof Error?e.message:`Failed to submit feedback`},500)}}async function ne(e){let{resolveConfig:t}=await Promise.resolve().then(()=>require(`./config-kIQOJHXC.cjs`)),{generateRoutes:n}=await Promise.resolve().then(()=>require(`./routes-DX8ryKjs.cjs`)),{generateProjectTypes:r,writeLinkTree:i}=await Promise.resolve().then(()=>require(`./types-generator-BqNKCbrx.cjs`)).then(e=>e.n),{boltdocsPlugin:a}=await Promise.resolve().then(()=>require(`./plugin-CL1LsQXk.cjs`)),o=e?.docsDir||`docs`,s=await t(o),c=(await n(o,s)).map(e=>e.path),l=(s.base||`/docs`).replace(/\/$/,``);return c.includes(l)||c.push(l),r(s,o,void 0,c),i(c),a({...e},s)}async function $(e,t=`development`,n){let[r,i,{boltdocsPlugin:a,getExternalAbsolutePaths:o},{SECURITY_HEADERS:c},{getCSPHeader:l},{resolveConfig:u},{generateRoutes:d},{generateProjectTypes:f,writeLinkTree:p},{normalizePath:m}]=await Promise.all([import(`@vitejs/plugin-react`),import(`@tailwindcss/vite`),Promise.resolve().then(()=>require(`./plugin-CL1LsQXk.cjs`)),Promise.resolve().then(()=>require(`./headers-BJ4jJAhU.cjs`)).then(e=>e.n),Promise.resolve().then(()=>require(`./csp-CBysWlAf.cjs`)).then(e=>e.t),Promise.resolve().then(()=>require(`./config-kIQOJHXC.cjs`)),Promise.resolve().then(()=>require(`./routes-DX8ryKjs.cjs`)),Promise.resolve().then(()=>require(`./types-generator-BqNKCbrx.cjs`)).then(e=>e.n),import(`vite`).then(e=>({normalizePath:e.normalizePath}))]),h=r.default,g=i.default,_=n||await u(`docs`,e),v=(await d(`docs`,_)).map(e=>e.path),y=(_.base||`/docs`).replace(/\/$/,``);v.includes(y)||v.push(y),f(_,`docs`,e,v),p(v);let b=t===`production`,x=b?{...c}:{};return _.security?.enableCSP&&(x[`Content-Security-Policy`]=l(_)),{root:e,mode:t,oxc:{jsx:{development:!b,runtime:`automatic`,importSource:`react`}},optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-helmet-async`,`react-router-dom`,`react-fast-compare`,`invariant`,`use-sync-external-store/shim`]},build:{},plugins:[h(),g(),...a({docsDir:`docs`,root:e},_)],resolve:{alias:[{find:`boltdocs/entry`,replacement:m(s.default.resolve(e,`boltdocs-entry.tsx`))},{find:`boltdocs/client`,replacement:m(s.default.resolve(e,`boltdocs-client.mjs`))},{find:`use-sync-external-store/shim/index.js`,replacement:`react`},{find:`use-sync-external-store/shim`,replacement:`react`},{find:`use-sync-external-store`,replacement:`react`},{find:`@`,replacement:m(s.default.resolve(e,`../packages/core/src`))}],dedupe:[`react`,`react-dom`]},ssr:{external:[`react`,`react-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`,...o()],optimizeDeps:{include:[`react`,`react-dom`,`react-fast-compare`,`invariant`,..._.vite?.ssr?.optimizeDeps?.include||[]]},noExternal:[`boltdocs`,/@bdocs\/(?!ssg).*/,`react-aria-components`,`@react-aria/collections`,`@react-aria/utils`,`react-router-dom`]},server:{headers:{...x,..._.vite?.server?.headers},..._.vite?.server},preview:{headers:{...x,..._.vite?.preview?.headers},..._.vite?.preview},..._.vite}}Object.defineProperty(exports,`A`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`O`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,`j`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`k`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return U}});
|
package/dist/plugin-CL1LsQXk.cjs
DELETED
|
@@ -1,61 +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-Ds5LZdWN.cjs`),t=require(`./utils-BWy_8ASj.cjs`),n=require(`./node-Dj3-2YYP.cjs`),r=require(`./config-BqZUYono.cjs`),i=require(`./types-generator-BqNKCbrx.cjs`),a=require(`./cache-B19MLTpN.cjs`),o=require(`./routes-DgTQxpZi.cjs`),s=require(`./shiki-adapter-BB71nVsG.cjs`),c=require(`./doctor-DzEgMMRo.cjs`),l=require(`./headers-BJ4jJAhU.cjs`),u=require(`./csp-CBysWlAf.cjs`);let d=require(`node:path`);d=e.n(d);let f=require(`node:fs`);f=e.n(f);let p=require(`@bdocs/dui`),m=require(`vite`),h=require(`node:module`);h=e.n(h);let g=require(`node:crypto`);g=e.n(g);let ee=require(`@bdocs/plugin-image-optimizer`),_=require(`@mdx-js/rollup`);_=e.n(_);let v=require(`remark-gfm`);v=e.n(v);let y=require(`remark-frontmatter`);y=e.n(y);let b=require(`rehype-slug`);b=e.n(b);let x=require(`unist-util-visit`);function S(e){return`<!doctype html>
|
|
7
|
-
<html lang="en">
|
|
8
|
-
<head>
|
|
9
|
-
<meta charset="UTF-8" />
|
|
10
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
11
|
-
<title>${e.theme?.title||`Boltdocs`}</title>
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
<div id="root"></div>
|
|
15
|
-
</body>
|
|
16
|
-
</html>`}function C(e,t){(!e||!e.includes(`<body`)||!e.includes(`<head`))&&(e=S(t));let n=t.theme,r=n?.title||`Boltdocs`;if(typeof r==`object`){let e=t.i18n?.defaultLocale||``;r=r[e]||Object.values(r)[0]||`Boltdocs`}let i=n?.description||``;if(typeof i==`object`){let e=t.i18n?.defaultLocale||``;i=i[e]||Object.values(i)[0]||``}let a=n?.favicon;!a&&n?.logo&&(a=typeof n.logo==`string`?n.logo:n.logo.light||n.logo.dark);let o=[a?`<link rel="icon" href="${a}">`:``,`<meta name="description" content="${i}">`,`<meta property="og:title" content="${r}">`,`<meta property="og:description" content="${i}">`,`<meta property="og:type" content="website">`,t.siteUrl?`<meta property="og:url" content="${t.siteUrl}">`:``,t.siteUrl?`<link rel="canonical" href="${t.siteUrl}">`:``,`<meta name="twitter:card" content="summary_large_image">`,`<meta name="twitter:title" content="${r}">`,`<meta name="twitter:description" content="${i}">`,`<meta name="generator" content="Boltdocs">`].filter(Boolean).join(`
|
|
17
|
-
`);e=e.includes(`<title>`)?e.replace(/<title>.*?<\/title>/,`<title>${r}</title>`):e.replace(`</head>`,` <title>${r}</title>\n </head>`);let s=``;if(t.integrations?.ga4){let e=t.integrations.ga4;if(process.env.NODE_ENV===`production`||e.debug){let t=e.anonymizeIp?`gtag('set', 'ip', true);`:``,n=e.sendPageView===!1?`{send_page_view: false}`:`{}`,r=e.cookieFlags?`, {'cookie_flags': '${e.cookieFlags}'}`:``;s=`
|
|
18
|
-
<!-- Google tag (gtag.js) - ${e.measurementId} -->
|
|
19
|
-
<script async src="https://www.googletagmanager.com/gtag/js?id=${e.measurementId}"><\/script>
|
|
20
|
-
<script>
|
|
21
|
-
window.dataLayer = window.dataLayer || [];
|
|
22
|
-
function gtag(){dataLayer.push(arguments);}
|
|
23
|
-
gtag('js', new Date());
|
|
24
|
-
${t}
|
|
25
|
-
gtag('config', '${e.measurementId}', ${n}${r});
|
|
26
|
-
<\/script>
|
|
27
|
-
`}}let c=``,l=``;if(t.integrations?.gtm){let e=t.integrations.gtm;if(process.env.NODE_ENV===`production`){let t=e.dataLayerName||`dataLayer`;c=`
|
|
28
|
-
<!-- Google Tag Manager -->
|
|
29
|
-
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
30
|
-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
31
|
-
j=d.createElement(s),dl=l!='${t}'?'&l='+l:'';j.async=true;j.src=
|
|
32
|
-
'https://www.googletagmanager.com/gtm.js?id='+i+dl+'${e.preview?`>m_preview=${e.preview}`:``}';f.parentNode.insertBefore(j,f);
|
|
33
|
-
})(window,document,'script','${t}','${e.tagId}');<\/script>
|
|
34
|
-
<!-- End Google Tag Manager -->
|
|
35
|
-
`,l=`
|
|
36
|
-
<!-- Google Tag Manager (noscript) -->
|
|
37
|
-
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=${e.tagId}"
|
|
38
|
-
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
|
39
|
-
<!-- End Google Tag Manager (noscript) -->
|
|
40
|
-
`}}return e=e.replace(`<head>`,`<head>
|
|
41
|
-
|
|
42
|
-
<script>
|
|
43
|
-
(function() {
|
|
44
|
-
try {
|
|
45
|
-
var stored = localStorage.getItem("boltdocs-theme");
|
|
46
|
-
var isDark =
|
|
47
|
-
stored === "dark" ||
|
|
48
|
-
(stored !== "light" && window.matchMedia("(prefers-color-scheme: dark)").matches);
|
|
49
|
-
document.documentElement.classList.toggle("dark", isDark);
|
|
50
|
-
document.documentElement.dataset.theme = isDark ? "dark" : "light";
|
|
51
|
-
} catch (e) {
|
|
52
|
-
// Ignore localStorage errors (e.g. if cookies/storage are disabled)
|
|
53
|
-
}
|
|
54
|
-
})();
|
|
55
|
-
<\/script>
|
|
56
|
-
`),e=e.replace(`</head>`,` ${o}\n${s}${c} </head>`),l&&(e=e.replace(/<body([^>]*)>/,`<body$1>\n${l}`)),!e.includes(`src/main`)&&!e.includes(`virtual:boltdocs-entry`)&&(e=e.replace(`</body>`,` <script type="module">import "virtual:boltdocs-entry";<\/script>
|
|
57
|
-
</body>`)),e}function w(e){return typeof e==`string`?[e]:Array.isArray(e)?e.flatMap(w):e&&typeof e==`object`?Object.values(e).flatMap(w):[]}const te=new Set([`title`,`description`,`permalink`,`sidebarPosition`,`sidebarLabel`,`sidebarHidden`,`hidden`,`category`,`order`,`badge`,`icon`,`date`,`lastUpdated`,`groupTitle`,`groupPosition`,`seo`]);function ne(e){let t=[];for(let n of e){let e=``;n.frontmatter&&(e=w(Object.entries(n.frontmatter).filter(([e])=>!te.has(e)).map(([e,t])=>t)).join(` `));let r=e?`${n._content||``} ${e}`:n._content||``;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}let T=null,E=null;function D(){T=null,E=null}function re(e,r,i,a){return{name:`vite-plugin-boltdocs-virtual-modules`,resolveId(e){let n=i()?.root||process.cwd();return e.includes(`boltdocs-entry.tsx`)||e===`virtual:boltdocs-entry`||e===`boltdocs-entry`||e===`\0virtual:boltdocs-entry`?t.u(d.default.resolve(n,`boltdocs-entry.tsx`)):e.includes(`boltdocs-client.mjs`)||e===`virtual:boltdocs-client`||e===`boltdocs-client`||e===`\0virtual:boltdocs-client.ts`?t.u(d.default.resolve(n,`boltdocs-client.mjs`)):e.startsWith(`virtual:boltdocs-`)?`\0`+e:e.startsWith(`\0virtual:boltdocs-`)?e:null},async load(i){let s=r();if(i.includes(`boltdocs-entry.tsx`)||i===`\0virtual:boltdocs-entry`)return n.j(e,s);if(i.includes(`boltdocs-client.mjs`)||i===`\0virtual:boltdocs-client.ts`||i===`virtual:boltdocs-client`){let e=__dirname,n=e;for(;e!==d.default.parse(e).root;){if(f.default.existsSync(d.default.join(e,`package.json`))&&JSON.parse(f.default.readFileSync(d.default.join(e,`package.json`),`utf-8`)).name===`boltdocs`){n=e;break}e=d.default.dirname(e)}let r=d.default.join(n,`src/client/index.ts`),i=d.default.join(n,`dist/client/index.js`);return`export * from '${t.u(f.default.existsSync(r)?r:i)}';`}if(!i.startsWith(`\0virtual:boltdocs-`))return;let c=i.replace(`\0virtual:boltdocs-`,``).replace(/\.tsx?$/,``);if(c===`routes`){let e=n.C(await o.t(a,s));return`export default ${JSON.stringify(e,null,2)};`}if(c===`collections`){let e=n.C(await o.t(a,s)),t={};for(let n of e)n.collection&&(t[n.collection]||(t[n.collection]=[]),t[n.collection].push({path:n.path,title:n.title,date:n.date,excerpt:n.excerpt,tags:n.tags,author:n.author,coverImage:n.coverImage,filePath:n.filePath,frontmatter:n.frontmatter}));return`export default ${JSON.stringify(t,null,2)};`}if(c===`config`){if(T===null){let{loadDirectoryMeta:e}=await Promise.resolve().then(()=>require(`./meta-loader-C9MKjAs0.cjs`));T=await e(a)}let e=T,t={base:s?.base,theme:s?.theme,i18n:s?.i18n,versions:s?.versions,siteUrl:s?.siteUrl,integrations:s?.integrations,plugins:s?.plugins?.map(e=>({name:e.name})),directoryMeta:e};return`export default ${JSON.stringify(t,null,2)};`}if(c===`entry`)return n.j(e,s);if(c===`mdx-components`){let e=[`tsx`,`ts`,`jsx`,`js`],n=null;for(let t of e){let e=d.default.resolve(a,`mdx-components.${t}`);if(f.default.existsSync(e)){n=e;break}}if(n){let e=t.u(n);return`import * as components from '${e}';
|
|
58
|
-
const mdxComponents = components.default || components;
|
|
59
|
-
export default mdxComponents;
|
|
60
|
-
export * from '${e}';`}return`export default {};`}if(c===`layout`){let e=[`tsx`,`jsx`],n=null;for(let t of e){let e=d.default.resolve(a,`layout.${t}`);if(f.default.existsSync(e)){n=e;break}}if(n)return`import UserLayout from '${t.u(n)}';
|
|
61
|
-
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(c===`icons`){let e=[`tsx`,`jsx`,`ts`,`js`],n=null;for(let t of e){let e=d.default.resolve(a,`icons.${t}`);if(f.default.existsSync(e)){n=e;break}}return n?`import * as icons from '${t.u(n)}';\nexport default icons;`:`export default {};`}if(c===`search`){if(!E){let e=ne(await o.t(a,s));E=`export default ${JSON.stringify(e,null,2)};`}return E}if(c===`client`){let e=__dirname,n=``;for(;e&&e!==d.default.parse(e).root;){let r=d.default.join(e,`src/client/index.ts`),i=d.default.join(e,`dist/client/index.mjs`),a=d.default.join(e,`client/index.ts`);if(f.default.existsSync(r)){n=t.u(r);break}if(f.default.existsSync(i)){n=t.u(i);break}if(f.default.existsSync(a)){n=t.u(a);break}e=d.default.dirname(e)}if(!n)throw Error(`[boltdocs] Could not resolve boltdocs/client entry point starting from ${__dirname}`);return`export * from '${n}';`}}}}function O(e){return(t,n,r)=>{let i=e().integrations?.feedback?.custom,a=i?.endpoint||`/api/feedback`;if(!i?.enabled||t.method!==`POST`||t.url?.split(`?`)[0]!==a)return r();let o=``;t.on(`data`,e=>{o+=e}),t.on(`end`,async()=>{n.setHeader(`Content-Type`,`application/json`);try{let{handleFeedback:e}=await Promise.resolve().then(()=>require(`./handler-1LRMYeI4.cjs`)).then(e=>e.n),t=await e(JSON.parse(o),process.env,{owner:i.owner,repo:i.repo,categorySlug:i.categorySlug});n.statusCode=200,n.end(JSON.stringify(t))}catch(e){n.statusCode=500;let t=e instanceof Error?e.message:`Failed to submit feedback`;n.end(JSON.stringify({error:t}))}})}}function k(e){return(t,n,r)=>{let i=t.url||`/`,a=i.split(`?`)[0].split(`#`)[0];if(d.default.extname(a))return r();let o=e(),s=d.default.resolve(o?.root||process.cwd(),o?.build?.outDir||`dist`),c=a.replace(/\/$/,``)||`/`,l=d.default.join(s,c,`index.html`);c!==`/`&&f.default.existsSync(l)&&(t.url=`${c}/index.html${i.includes(`?`)?`?${i.split(`?`)[1]}`:``}`),r()}}const A=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i;function j(e,t,n){let r=process.env.NODE_ENV===`production`;e.middlewares.use(O(n)),e.middlewares.use((e,t,i)=>{r&&Object.entries(l.t).forEach(([e,n])=>{t.setHeader(e,n)});let a=n();a.security?.enableCSP&&t.setHeader(`Content-Security-Policy`,u.n(a)),i()}),e.middlewares.use((e,t,n)=>{if(e.url===`/robots.txt`){n();return}n()}),e.middlewares.use(async(t,r,i)=>{let a=t.url?.split(`?`)[0]||`/`,o=t.headers.accept||``,s=n();if(o.includes(`text/html`)&&!A.test(a)){let n=S(s);n=C(n,s),n=await e.transformIndexHtml(t.url||`/`,n),r.statusCode=200,r.setHeader(`Content-Type`,`text/html`),r.end(n);return}i()})}function M(e,t,n){setTimeout(async()=>{try{let{generateRoutes:r}=await Promise.resolve().then(()=>require(`./routes-DX8ryKjs.cjs`)),i=(await r(t,n())).filter(e=>e.filePath).map(e=>e.filePath);for(let t=0;t<i.length;t+=32){let n=i.slice(t,t+32);await Promise.allSettled(n.map(t=>{let n=d.default.relative(process.cwd(),t).replace(/\\/g,`/`),r=n.startsWith(`/`)?n:`/${n}`;return e.transformRequest(r)}))}}catch{}},0)}const N=[`tsx`,`jsx`],P=[`tsx`,`ts`,`jsx`,`js`];function ie(e,t){let n=r.t.map(e=>d.default.resolve(process.cwd(),e)),i=N.map(e=>d.default.resolve(t,`layout.${e}`)),a=P.map(e=>d.default.resolve(t,`mdx-components.${e}`)),o=P.map(e=>d.default.resolve(t,`pages-external/index.${e}`)),s=P.map(e=>d.default.resolve(t,`icons.${e}`));e.watcher.add([...n,...a,...i,...o,...s])}const F=new Map;function I(e){let{lastUpdated:t,...n}=e;return g.default.createHash(`md5`).update(JSON.stringify(n)).digest(`hex`)}async function L(e){try{let{data:n}=await t.d(e);return I(n)}catch{return``}}function R(e){let t=F.get(e);if(t===void 0){let n=o.r.getStale(e);n?.route?.frontmatter&&(t=I(n.route.frontmatter),F.set(e,t))}return t}function z(e,t){F.set(e,t)}function B(e){F.delete(e)}const V=[`tsx`,`ts`,`jsx`,`js`];function H(e,t){let n=e.moduleGraph.getModuleById(`\0virtual:boltdocs-${t}.ts`);n&&e.moduleGraph.invalidateModule(n)}function U(e,n,a,s){let l=new Map,u=a.toLowerCase(),f=async(a,f)=>{try{let m=t.u(a);if(r.t.some(e=>m.endsWith(e))){e.restart();return}if(V.some(e=>m.endsWith(`mdx-components.${e}`))){i.t(s(),n),H(e,`mdx-components.tsx`),e.ws.send({type:`full-reload`});return}if(V.some(e=>m.endsWith(`icons.${e}`))){H(e,`icons.tsx`),e.ws.send({type:`full-reload`});return}if(m.endsWith(`layout.tsx`)||m.endsWith(`layout.jsx`)){H(e,`layout.tsx`),e.ws.send({type:`full-reload`});return}if(m.includes(`/pages-external/`)||m.includes(`\\pages-external\\`)){H(e,`entry`),e.ws.send({type:`full-reload`});return}if(!m.toLowerCase().startsWith(u))return;let h=m.endsWith(`meta.json`)||m.endsWith(`_meta.json`);if(!h&&!t.c(m))return;if(f===`add`||f===`unlink`||h){f===`unlink`&&B(a),o.n(),D();let t=s();i.t(t,n),H(e,`config`),H(e,`routes`),H(e,`search`),H(e,`collections`),c.c(n,process.cwd(),t).catch(e=>{(0,p.error)(`Failed to update link tree:`,e)}),e.ws.send({type:`custom`,event:`boltdocs:config-update`,data:{theme:t?.theme,i18n:t?.i18n,versions:t?.versions,siteUrl:t?.siteUrl}}),e.ws.send({type:`full-reload`});return}l.has(m)&&clearTimeout(l.get(m)),l.set(m,setTimeout(async()=>{l.delete(m);try{let r=R(a),i=await L(a);if(z(a,i),o.i(a),r!==void 0&&r!==i){H(e,`routes`),H(e,`search`),H(e,`collections`),e.ws.send({type:`full-reload`});return}let s=t.u(d.default.relative(n,a)),c=e.moduleGraph.getModulesByFile(m);if(c&&c.size>0)for(let t of c)e.moduleGraph.invalidateModule(t);else{e.ws.send({type:`full-reload`});return}e.ws.send({type:`custom`,event:`boltdocs:mdx-update`,data:{file:m,relPath:s}})}catch(e){(0,p.error)(`HMR error processing content change:`,e)}},150))}catch(e){(0,p.error)(`HMR error during ${f} event:`,e)}};e.watcher.on(`add`,e=>f(e,`add`)),e.watcher.on(`unlink`,e=>f(e,`unlink`)),e.watcher.on(`change`,e=>f(e,`change`))}function W(e){let n=e.toLowerCase();return({file:e})=>{let r=e.toLowerCase();if(r.startsWith(n)&&(t.c(e)||r.endsWith(`meta.json`)))return[]}}function G(e,t,n,r,i){return{name:`vite-plugin-boltdocs-dev-server`,apply:`serve`,async configureServer(r){let a=i();await a?.runHook(`beforeDev`),c.c(e,process.cwd(),n()).catch(e=>{(0,p.error)(`Failed to generate initial link tree:`,e)}),M(r,e,n),j(r,e,n),ie(r,e),U(r,e,t,n),await a?.runHook(`afterDev`)},hotUpdate:W(t)}}const K=new a.i(`mdx`);function q(e){let t=s.n(e);return async e=>{let r=await t.getHighlighter();n._(e,s.o.ELEMENT,e=>{if(e.tagName!==`pre`)return;let n=e.children?.[0];if(!n||n.type!==s.o.ELEMENT||n.tagName!==`code`)return;let i=(n.properties?.className||[]).find(e=>e.startsWith(`language-`)),a=i?i.slice(9):s.a.MDX_DEFAULT_LANG;if(a===`mermaid`)return;let o=s.r(n.properties?.metastring||n.data?.meta||``),c=t.getOptions(a,o),l=n.children?.[0]?.value||``;try{let t=r.codeToHast(l,c),n=t.type===`root`?t.children[0]:t;e.children=n.children,e.properties={...e.properties,...n.properties,[s.i.HIGHLIGHTED]:`true`,[s.i.LANG]:a}}catch(t){(0,p.error)(`[rehypeShiki] Failed to highlight code block:`,t),e.properties=e.properties||{},e.properties.className=[...e.properties.className||[],s.s.FALLBACK],e.properties[s.i.HIGHLIGHTED]=`false`,e.properties[s.i.LANG]=a}return o.title&&(e.properties[s.i.TITLE]=o.title),x.SKIP})}}function J(){return e=>{n._(e,s.o.CODE,e=>{e.meta&&n.h(e,`metastring`,e.meta)})}}let ae=!1;function oe(e,t,n=_.default){let r=e?.plugins?.flatMap(e=>e.remarkPlugins||[])||[],i=e?.plugins?.flatMap(e=>e.rehypePlugins||[])||[],a=n({remarkPlugins:[v.default,y.default,J,...r],rehypePlugins:[b.default,[q,e],...i],jsxRuntime:`automatic`});return{...a,name:`vite-plugin-boltdocs-mdx`,async buildStart(){ae||=(await K.load(),!0),a.buildStart&&await a.buildStart.call(this)},async load(e,n){if(e.endsWith(`.md`)||e.endsWith(`.mdx`))try{let n=f.default.readFileSync(e,`utf-8`),r=t?.();return r&&(n=(await r.runChain(`transformSource`,{code:n,filePath:e})).code),n}catch{return null}return a.load?a.load.call(this,e,n):null},async transform(e,n,r){let[i]=n.split(`?`);if(!i.endsWith(`.md`)&&!i.endsWith(`.mdx`))return a.transform?.call(this,e,n,r);let o=`${i}:${g.default.createHash(`md5`).update(e).digest(`hex`)}:${process.env.NODE_ENV===`production`?`prod`:`dev`}:v3`,s=await K.getAsync(o);if(s)return{code:s,map:null};let c=await a.transform.call(this,e,i,r);if(c&&typeof c==`object`&&c.code){let e=c.code,n=t?.();return n&&(e=(await n.runChain(`transformMdx`,{code:e,filePath:i})).code),K.set(o,e),{code:e,map:null}}return c},async buildEnd(){K.save(),await K.flush(),a.buildEnd&&await a.buildEnd.call(this)}}}const Y=h.createRequire(require(`url`).pathToFileURL(__filename).href),se=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`],ce=[`react/jsx-runtime`,`react/jsx-dev-runtime`,`react-dom/client`];function X(e=Y){try{let e=d.default.join(process.cwd(),`node_modules/boltdocs/package.json`);return f.default.existsSync(e)?h.createRequire(f.default.realpathSync(e)):h.createRequire(d.default.join(process.cwd(),`package.json`))}catch{return e}}function Z(e,t=Y){try{let n=e.split(`/`),r=e.startsWith(`@`)?n.slice(0,2).join(`/`):n[0],i=e.startsWith(`@`)?n.slice(2).join(`/`):n.slice(1).join(`/`),a=``;try{a=t.resolve(`${r}/package.json`)}catch{let e=t.resolve(r),n=d.default.dirname(e);for(;n&&n!==d.default.dirname(n);){let e=d.default.join(n,`package.json`);if(f.default.existsSync(e)){a=e;break}n=d.default.dirname(n)}}if(!a)throw Error();let o=d.default.dirname(a),s=JSON.parse(f.default.readFileSync(a,`utf-8`)),c=i?`./${i}`:`.`,l=s.exports?.[c]||s.exports?.[i]||``;typeof l==`object`&&l&&(l=l.import||l.default||l.require||``),!l&&!i&&(l=s.module||s.main||`index.js`);let u=d.default.resolve(o,l);if(f.default.existsSync(u))return u}catch{}return t.resolve(e)}function Q(e=Y){let n=[],r=X(e),i=new Set([r,e]);for(let e of i){for(let t of se)try{let r=[`@bdocs/ssg`,`react-router-dom`,`react-helmet-async`].includes(t)?Z(t,e):e.resolve(t);r&&n.push(f.default.realpathSync(r))}catch{}for(let t of ce)try{n.push(f.default.realpathSync(e.resolve(t)))}catch{}}return Array.from(new Set(n)).map(e=>t.u(e))}const $=h.createRequire(require(`url`).pathToFileURL(__filename).href),le=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`];function ue(e={},a){let s=d.default.resolve(process.cwd(),e.docsDir||`docs`),c=t.u(s),l=a,u,p=!1,h,g=[],_=()=>l,v=e=>{l=e},y=()=>u,b=()=>h;return[{name:`vite-plugin-boltdocs`,enforce:`pre`,async config(e,t){p=t.command===`build`;let a=!!(t.isSsrBuild||e.build?.ssr);if(Object.assign(process.env,(0,m.loadEnv)(t.mode,e.envDir||process.cwd(),``)),!l){l=await r.n(s);let e=(await o.t(s,l)).map(e=>e.path),t=(l.base||`/docs`).replace(/\/$/,``);e.includes(t)||e.push(t),i.t(l,s,void 0,e),i.r(e)}Promise.resolve().then(()=>require(`./shiki-adapter-CL-IQwKI.cjs`)).then(({getShikiAdapter:e})=>{e(l).getHighlighter().catch(()=>{})}).catch(()=>{});let{version:c}=await Promise.resolve().then(()=>require(`./package-ByXh2JHp.cjs`)),u=n.T(l.plugins||[],c);return l.plugins=u,h=new n.x(u,l),g=u.flatMap(e=>e.vitePlugins||[]),p&&await h.runHook(`beforeBuild`),{ssgOptions:{entry:`boltdocs/entry`,htmlEntry:`index.html`,dirStyle:`flat`,includeAllRoutes:!0,mock:!0,script:`async`,beastiesOptions:{preload:`media`}},build:{ssrManifest:p},optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-router-dom`,`react-helmet-async`,`react-fast-compare`,`invariant`],exclude:[`boltdocs`,`boltdocs/client`]},resolve:{alias:[{find:`react-router-dom`,replacement:Z(`react-router-dom`)},{find:`react-helmet-async`,replacement:Z(`react-helmet-async`)},{find:`@bdocs/ssg`,replacement:Z(`@bdocs/ssg`)}],dedupe:[`react`,`react-dom`,...a?[]:[`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`]]},ssr:{external:[`react`,`react-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`,...Q($)],optimizeDeps:{include:[`react-fast-compare`,`invariant`]},noExternal:[`react-router-dom`]}}},configResolved(e){u=e},resolveId(e,t,n){let r=le.find(t=>e===t||e.startsWith(`${t}/`)||e.includes(`/node_modules/${t}/`)||t.startsWith(`@`)&&e.includes(`/node_modules/${t.replace(`/`,d.default.sep)}/`));if(r&&n?.ssr&&!d.default.isAbsolute(e)&&r!==`react`&&r!==`react-dom`){let t=X($),n=e;try{n=[`@bdocs/ssg`,`react-router-dom`,`react-helmet-async`].includes(r)?Z(e,t):t.resolve(e)}catch{try{n=[`@bdocs/ssg`,`react-router-dom`,`react-helmet-async`].includes(r)?Z(e,$):$.resolve(e)}catch{}}try{n=f.default.realpathSync(n)}catch{}return{id:n,external:!0}}return null},transformIndexHtml:{order:`pre`,handler:e=>C(e,l)},async buildEnd(){let{pool:e}=await Promise.resolve().then(()=>require(`./worker-pool-m81xuM5v.cjs`));await e.terminate()},async closeBundle(){!p||u?.build?.ssr||(await h?.runHook(`afterBuild`),await h?.runHook(`buildEnd`))},configurePreviewServer(e){e.middlewares.use(O(_)),e.middlewares.use(k(y))}},re(e,_,y,s),G(s,c,_,v,b),oe(l,b),(0,ee.ViteImageOptimizer)({includePublic:!0}),...g]}exports.boltdocsPlugin=ue,exports.getBaseRequire=X,exports.getExternalAbsolutePaths=Q,exports.resolveEsm=Z;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|