@stacksjs/bunpress 0.2.31 → 0.2.33

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/bin/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- import{s as b,t as c}from"../chunk-tev1ggac.js";import"../chunk-5dtz0br7.js";import{ca as a}from"../chunk-f5ycxw18.js";import"../chunk-gn1n2yxt.js";export{b as resolveConfig,a as findMarkdownFiles,c as buildDocs};
3
+ import{t as b,u as c}from"../chunk-hnkqm0qx.js";import"../chunk-zxfhq634.js";import{da as a}from"../chunk-dgdd6yma.js";import"../chunk-twt99rzk.js";export{b as resolveConfig,a as findMarkdownFiles,c as buildDocs};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ia as a,ja as b,ka as c,la as d,ma as e,na as f,oa as g,pa as h,qa as i}from"./chunk-gn1n2yxt.js";export{c as splitLocaleFromPath,a as resolveI18nConfig,d as localizeUrl,g as localeLabel,e as localeContentCandidates,b as loadI18nTranslations,i as generateLocaleDetectionScript,h as generateHreflangTags,f as configForLocale};
2
+ import{ja as a,ka as b,la as c,ma as d,na as e,oa as f,pa as g,qa as h,ra as i}from"./chunk-twt99rzk.js";export{c as splitLocaleFromPath,a as resolveI18nConfig,d as localizeUrl,g as localeLabel,e as localeContentCandidates,b as loadI18nTranslations,i as generateLocaleDetectionScript,h as generateHreflangTags,f as configForLocale};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{k as c,l as d,m as e,n as f,o as g}from"./chunk-ds2b3vtw.js";import{ba as b}from"./chunk-dgdd6yma.js";import{ia as a}from"./chunk-twt99rzk.js";export{d as wrapInLayout,c as stripConfiguredBasePath,f as startServer,g as serveCLI,e as markdownToHtml,a as getConfiguredBasePath,b as decodeHtmlEntities};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ha as $0,ia as J0,la as C,ma as K0}from"./chunk-gn1n2yxt.js";import{loadConfig as B0}from"bunfig";var M0={docsDir:"./docs",outDir:"./dist",theme:"vitepress",nav:[{text:"Guide",link:"/install"},{text:"API",link:"/advanced#api-reference"},{text:"Examples",link:"/examples"}],plugins:[],markdown:{title:"BunPress Documentation",meta:{description:"Documentation built with BunPress",generator:"BunPress",viewport:"width=device-width, initial-scale=1.0"},sidebar:{"/":[{text:"Getting Started",items:[{text:"Introduction",link:"/"},{text:"Installation",link:"/install"},{text:"Quick Start",link:"/quick-start"},{text:"Usage",link:"/usage"},{text:"Configuration",link:"/config"}]},{text:"Core Features",items:[{text:"Features Overview",link:"/features"},{text:"Markdown Extensions",link:"/markdown-extensions"},{text:"Syntax Highlighting",link:"/syntax-highlighting"},{text:"Table of Contents",link:"/table-of-contents"},{text:"CLI Commands",link:"/cli"}]},{text:"SEO & Analytics",items:[{text:"SEO Features",link:"/seo"},{text:"Analytics (Fathom)",link:"/config#fathom-analytics-configuration"}]},{text:"Advanced",items:[{text:"Advanced Usage",link:"/advanced"},{text:"Examples",link:"/examples"},{text:"Best Practices",link:"/best-practices"}]},{text:"More",items:[{text:"Showcase",link:"/showcase"},{text:"Partners",link:"/partners"},{text:"License",link:"/license"},{text:"Postcardware",link:"/postcardware"}]}]},css:`
2
+ import{ia as $0,ja as J0,ma as C,na as K0}from"./chunk-twt99rzk.js";import{loadConfig as B0}from"bunfig";var M0={docsDir:"./docs",outDir:"./dist",theme:"vitepress",nav:[{text:"Guide",link:"/install"},{text:"API",link:"/advanced#api-reference"},{text:"Examples",link:"/examples"}],plugins:[],markdown:{title:"BunPress Documentation",meta:{description:"Documentation built with BunPress",generator:"BunPress",viewport:"width=device-width, initial-scale=1.0"},sidebar:{"/":[{text:"Getting Started",items:[{text:"Introduction",link:"/"},{text:"Installation",link:"/install"},{text:"Quick Start",link:"/quick-start"},{text:"Usage",link:"/usage"},{text:"Configuration",link:"/config"}]},{text:"Core Features",items:[{text:"Features Overview",link:"/features"},{text:"Markdown Extensions",link:"/markdown-extensions"},{text:"Syntax Highlighting",link:"/syntax-highlighting"},{text:"Table of Contents",link:"/table-of-contents"},{text:"CLI Commands",link:"/cli"}]},{text:"SEO & Analytics",items:[{text:"SEO Features",link:"/seo"},{text:"Analytics (Fathom)",link:"/config#fathom-analytics-configuration"}]},{text:"Advanced",items:[{text:"Advanced Usage",link:"/advanced"},{text:"Examples",link:"/examples"},{text:"Best Practices",link:"/best-practices"}]},{text:"More",items:[{text:"Showcase",link:"/showcase"},{text:"Partners",link:"/partners"},{text:"License",link:"/license"},{text:"Postcardware",link:"/postcardware"}]}]},css:`
3
3
  /* Additional BunPress customizations */
4
4
  /* Note: Base styles are provided by the VitePress theme */
5
5
 
@@ -1754,4 +1754,4 @@ else {
1754
1754
  `}var{Glob:t,YAML:p0}=globalThis.Bun;import{join as g0}from"path";var F1="/search-index.json",A={include:["**/*.md"],exclude:["public/**","**/node_modules/**"],searchFields:["title","content","headings","keywords"],maxResults:10,minQueryLength:1,fuzzy:!1,fuzziness:1,stemmer:"none",maxContentLength:800,boost:{title:10,headings:5,content:1}};function V0(Z){let Q=Z?.options??{};return{...A,...Q,include:Q.include??A.include,exclude:Q.exclude??A.exclude,searchFields:Q.searchFields??A.searchFields,maxResults:Q.maxResults??Z?.maxResults??A.maxResults,boost:{...A.boost,...Q.boost??{}}}}var e=[{key:"k",meta:!0,ctrl:!1,alt:!1,shift:!1},{key:"k",meta:!1,ctrl:!0,alt:!1,shift:!1},{key:"/",meta:!1,ctrl:!1,alt:!1,shift:!1}];function h0(Z){if(!Z)return e;let Q=(Array.isArray(Z)?Z:[Z]).map((J)=>String(J).toLowerCase()),X={meta:!1,ctrl:!1,alt:!1,shift:!1},$="";for(let J of Q)if(J==="meta"||J==="cmd"||J==="command")X.meta=!0;else if(J==="ctrl"||J==="control")X.ctrl=!0;else if(J==="alt"||J==="option")X.alt=!0;else if(J==="shift")X.shift=!0;else $=J;if(!$)return e;return[{key:$,...X}]}function Q0(Z){if(typeof Z!=="function")return null;let Q=Function.prototype.toString.call(Z);return Q.includes("[native code]")?null:Q}function R1(Z,Q){let X=Z?.search??Z?.markdown?.search,$=V0(X),J=X?.resultOptions??{};return{indexUrl:Q,placeholder:X?.placeholder??"Search documentation",lazy:X?.lazy!==!1,maxResults:$.maxResults,minQueryLength:$.minQueryLength,searchFields:$.searchFields,boost:{title:$.boost.title??10,headings:$.boost.headings??5,content:$.boost.content??1},fuzzy:$.fuzzy,fuzziness:$.fuzziness,stemmer:$.stemmer,shortcuts:{keyboard:X?.keyboardShortcuts!==!1,keys:h0(X?.shortcut)},result:{showDescription:J.showDescription!==!1,descriptionLength:J.descriptionLength??180,highlightMatches:J.highlightMatches!==!1,showPath:J.showPath!==!1},tokenizeSource:Q0(X?.options?.tokenize),onSearchSource:Q0(X?.onSearch),locale:null}}function X0(Z){return p(i(Z)).replace(/^:::.*$/gm," ").replace(/^\s{0,3}>\s*\[!(?:NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*$/gim," ").replace(/<[^>]+>/g," ").replace(/!\[[^\]]*\]\([^)]*\)/g," ").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/[*_~]{1,3}([^*_~]+)[*_~]{1,3}/g,"$1").replace(/^\s{0,3}>\s?/gm,"").replace(/^\s*[-*+]\s+/gm,"").replace(/^\s*\d+\.\s+/gm,"").replace(/^\s*\|?[\s:|-]+\|[\s:|-]*$/gm," ").replace(/^\s{0,3}(?:-{3,}|\*{3,}|_{3,})\s*$/gm," ").replace(/\|/g," ").replace(/\s+/g," ").trim()}function d0(Z){let Q=Z.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);if(!Q)return{body:Z,data:{}};let X={};try{X=p0.parse(Q[1])??{}}catch{X={}}return{body:Z.slice(Q[0].length),data:X}}function c0(Z){let Q=Z.replace(/\.md$/,"");if(Q==="index")return"/";if(Q.endsWith("/index"))return`/${Q.slice(0,-6)}`;return`/${Q}`}function l0(Z,Q,X){let{body:$,data:J}=d0(Q);if(J.search===!1)return[];if(J.layout==="home")return[];let V=typeof J.search==="object"&&J.search!==null?J.search:{},W=Array.isArray(V.keywords)?V.keywords.map(String):[],Y=c0(Z),q=$.split(`
1755
1755
  `),K=$.match(/^#\s+(.+)$/m),j=V.title||J.title||(K?K[1].trim():Y),B=[],G=new Set,z={title:j,anchor:"",level:1,buffer:[]},N=()=>{let M=X0(z.buffer.join(`
1756
1756
  `)).slice(0,X.maxContentLength);if(!M&&!z.title)return;let U={url:z.anchor?`${Y}#${z.anchor}`:Y,page:j,title:X0(z.title)||j,text:M,level:z.level};if(W.length)U.keywords=W;B.push(U)},I=y();for(let M of q){let U=I(M)?null:M.match(/^(#{1,6})\s+(.+?)\s*$/);if(!U){z.buffer.push(M);continue}let L=U[1].length,H=U[2].replace(/\s*\{#([\w-]+)\}\s*$/,""),R=U[2].match(/\{#([\w-]+)\}\s*$/),D=v(R?R[1]:b(T(H)),G);if(L===1){z.buffer.push("");continue}N(),z={title:H,anchor:D,level:L,buffer:[]}}return N(),B.filter((M)=>M.text||M.level>1)}function s0(Z,Q){let{storeFields:X}=Q;if(!X||!X.length)return Z;let $=new Set(["url",...X]);if(Q.searchFields.includes("title"))$.add("title");if(Q.searchFields.includes("content"))$.add("text");if(Q.searchFields.includes("headings"))$.add("page");if(Q.searchFields.includes("keywords"))$.add("keywords");return Z.map((J)=>{let V={};for(let[W,Y]of Object.entries(J))if($.has(W)&&Y!==void 0)V[W]=Y;return V})}function Z0(Z){return Z.split("#")[0]}function r0(Z,Q){if(!Q.enabled)return{locale:Q.defaultLocale,page:Z};let X=Z.split("/");if(X.length>1&&Q.locales.includes(X[0])&&X[0]!==Q.defaultLocale)return{locale:X[0],page:X.slice(1).join("/")};let $=Z.match(/^(.*)\.([A-Za-z-]+)(\.md)$/);if($&&Q.locales.includes($[2]))return{locale:$[2],page:`${$[1]}${$[3]}`};return{locale:Q.defaultLocale,page:Z}}async function D1(Z,Q){let X=Q?.search??Q?.markdown?.search,$=V0(X),J=J0(Q),V=$.exclude.map((j)=>new t(j)),W=[],Y=new Set,q=new Map;for(let j of J.locales)q.set(j,new Set);for(let j of $.include){let B=new t(j);for await(let G of B.scan(Z)){let z=G.replace(/\\/g,"/");if(V.some((N)=>N.match(z)))continue;Y.add(z)}}for(let j of[...Y].sort())try{let B=await Bun.file(g0(Z,j)).text(),{locale:G,page:z}=r0(j,J);for(let N of l0(z,B,$)){if(J.enabled)N.locale=G,N.url=C(J,G,N.url);W.push(N),q.get(G)?.add(Z0(N.url))}}catch{}if(J.enabled){let j=W.filter((B)=>B.locale===J.defaultLocale);for(let B of J.locales){if(B===J.defaultLocale)continue;let G=q.get(B)??new Set;for(let z of j){let N=C(J,B,z.url);if(G.has(Z0(N)))continue;W.push({...z,url:N,locale:B})}}}let K=Q?$0(Q):"";if(K)for(let j of W)j.url=`${K}${j.url}`;return s0(W,$)}function W0(Z){let Q={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};return Z.replace(/&(#x[\da-f]+|#\d+|[a-z]+);/gi,(X,$)=>{if($[0]==="#"){let J=$[1]==="x"||$[1]==="X"?Number.parseInt($.slice(2),16):Number.parseInt($.slice(1),10);return Number.isFinite(J)&&J>0&&J<=1114111?String.fromCodePoint(J):X}return Q[$.toLowerCase()]??X})}function Y0(Z){return String(Z??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var{Glob:o0}=globalThis.Bun;import{dirname as i0,isAbsolute as q0,join as n0,relative as z0,resolve as E,sep as j0}from"path";async function y1(Z){let Q=[];for await(let X of new o0("**/*.md").scan({cwd:Z,onlyFiles:!0}))Q.push(n0(Z,X));return Q}function G0(Z){return Z.split("/").map((Q)=>encodeURIComponent(Q)).join("/")}function x(Z){let Q=Z==="index"?"":Z.replace(/\/index$/,"/");return`/${G0(Q)}`}function k(Z){return Z.split("/").map((X)=>encodeURIComponent(decodeURIComponent(X))).join("/").replace(/\/+$/,"")||"/"}function S1(Z,Q,X){let $=E(Q),J={...X,locales:[...X.locales]},V=new Set(Z.map((G)=>E(G))),W=new Map,Y=new Set;for(let G of V){let z=z0($,G).split(j0).join("/").replace(/\.md$/,"");if(z===".."||z.startsWith("../")||q0(z))throw Error("Markdown source is outside the documentation root");let N=J.defaultLocale,I=!1;if(J.enabled){let M=z.split("/");if(M.length>1&&J.locales.includes(M[0])&&M[0]!==J.defaultLocale)N=M.shift(),I=!0,z=M.join("/");else{let U=z.match(/^(.*)\.([A-Za-z-]+)$/);if(U&&J.locales.includes(U[2]))z=U[1],N=U[2],I=!0}}W.set(G,{path:z,locale:N,explicitLocale:I}),Y.add(z)}let q=[],K=new Map,j=new Map,B=new Map;for(let G of J.locales)for(let z of Y){let N=J.enabled?K0(J,$,G,`/${z}`).map((U)=>E(U)).find((U)=>V.has(U)):E($,`${z}.md`);if(!N||!V.has(N))continue;let I=Object.freeze({sourceFile:N,relativePath:z,locale:G}),M=`${G}\x00${k(x(z))}`;if(j.has(M))throw Error(`Documentation pages share an output route: ${x(z)}`);j.set(M,I),K.set(`${G}\x00${z}`,I),B.set(`${G}\x00${k(`/${G0(z)}`)}`,I),q.push(I)}return Object.freeze({pages:Object.freeze(q),findPage(G,z){let N=`${G}\x00${k(z)}`;return j.get(N)??B.get(N)},resolveLink(G,z){if(!z||/^(?:[a-z][a-z\d+.-]*:|\/|#|\?)/i.test(z))return z;let N=z.search(/[?#]/),I=N===-1?z:z.slice(0,N),M=N===-1?"":z.slice(N),U=I.replace(/%([\da-f]{2})/gi,(a0,N0)=>String.fromCharCode(Number.parseInt(N0,16)));if(!/\.md$/i.test(U))return z;let L=decodeURIComponent(I),H=E(i0(G.sourceFile),L),R=z0($,H);if(R===".."||R.startsWith(`..${j0}`)||q0(R))return z;let D=W.get(H);if(!D)throw Error(`Markdown link has no documentation source: ${I}`);let m=D.explicitLocale?D.locale:G.locale,f=K.get(`${m}\x00${D.path}`);if(!f)throw Error(`Markdown link has no rendered page: ${I}`);return`${C(J,m,x(f.relativePath))}${M}`}})}async function P1(Z,Q,X=new Map){let $=[Q.page],J=new Set(X.keys()),V=await new HTMLRewriter().onDocument({comments(W){let Y=X.get(W.text);if(Y===void 0)return;if(!J.delete(W.text))throw Error("Markdown include source boundary was duplicated");if(Y===null){if($.length===1)throw Error("Markdown include source boundaries are unbalanced");$.pop()}else $.push(Y);W.remove()}}).on("a[href]",{element(W){let Y=W0(W.getAttribute("href")),q=Q.catalog.resolveLink($[$.length-1],Y);if(q!==Y)W.setAttribute("href",Y0(q))}}).transform(new Response(Z)).text();if(J.size||$.length!==1)throw Error("Markdown include source boundaries did not survive rendering");return V}
1757
- export{M0 as z,U0 as A,F0 as B,e0 as C,p as D,X1 as E,$1 as F,J1 as G,b0 as H,T as I,b as J,v as K,n as L,v0 as M,x0 as N,k0 as O,P,a as Q,m0 as R,f0 as S,u0 as T,W1 as U,Y1 as V,q1 as W,z1 as X,j1 as Y,F1 as Z,R1 as _,D1 as $,W0 as aa,Y0 as ba,y1 as ca,S1 as da,P1 as ea};
1757
+ export{M0 as A,U0 as B,F0 as C,e0 as D,p as E,X1 as F,$1 as G,J1 as H,b0 as I,T as J,b as K,v as L,n as M,v0 as N,x0 as O,k0 as P,P as Q,a as R,m0 as S,f0 as T,u0 as U,W1 as V,Y1 as W,q1 as X,z1 as Y,j1 as Z,F1 as _,R1 as $,D1 as aa,W0 as ba,Y0 as ca,y1 as da,S1 as ea,P1 as fa};