@stacksjs/bunpress 0.2.27 → 0.2.28

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-3gbqys0z.js";import"../chunk-5dtz0br7.js";import{ca as a}from"../chunk-778jqyb6.js";import"../chunk-gn1n2yxt.js";export{b as resolveConfig,a as findMarkdownFiles,c as buildDocs};
3
+ import{s as b,t as c}from"../chunk-j0taj7rk.js";import"../chunk-5dtz0br7.js";import{ca as a}from"../chunk-778jqyb6.js";import"../chunk-gn1n2yxt.js";export{b as resolveConfig,a as findMarkdownFiles,c as buildDocs};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{o as $,p as I,q as f,r as h,t as x}from"./chunk-3gbqys0z.js";import"./chunk-5dtz0br7.js";import{B as _}from"./chunk-778jqyb6.js";import"./chunk-gn1n2yxt.js";import{join as D}from"path";var E="@stacksjs/ts-cloud";async function Y(){try{return await import(E)}catch(j){throw Error(`Deploying requires @stacksjs/ts-cloud, which is an optional dependency.
2
+ import{o as $,p as I,q as f,r as h,t as x}from"./chunk-j0taj7rk.js";import"./chunk-5dtz0br7.js";import{B as _}from"./chunk-778jqyb6.js";import"./chunk-gn1n2yxt.js";import{join as D}from"path";var E="@stacksjs/ts-cloud";async function Y(){try{return await import(E)}catch(j){throw Error(`Deploying requires @stacksjs/ts-cloud, which is an optional dependency.
3
3
  Install it with: bun add -d @stacksjs/ts-cloud
4
4
  Original error: ${j instanceof Error?j.message:String(j)}`)}}function W(j,A){let k=A||j?.provider;if(!k||k==="route53")return null;if(k==="porkbun"){let m=j?.apiKey||process.env.PORKBUN_API_KEY,w=j?.secretKey||process.env.PORKBUN_SECRET_KEY;if(!m||!w)throw Error("Porkbun API credentials not found. Set PORKBUN_API_KEY and PORKBUN_SECRET_KEY environment variables, or configure them in bunpress.config.ts under cloud.dnsProvider");return{provider:"porkbun",apiKey:m,secretKey:w}}if(k==="godaddy"){let m=j?.apiKey||process.env.GODADDY_API_KEY,w=j?.secretKey||process.env.GODADDY_API_SECRET,J=j?.environment||process.env.GODADDY_ENVIRONMENT;if(!m||!w)throw Error("GoDaddy API credentials not found. Set GODADDY_API_KEY and GODADDY_API_SECRET environment variables, or configure them in bunpress.config.ts under cloud.dnsProvider");return{provider:"godaddy",apiKey:m,apiSecret:w,environment:J}}throw Error(`Unknown DNS provider: ${k}. Supported: porkbun, godaddy, route53`)}async function F(j={}){let A=await _,k=A.cloud||{},m=j.verbose??A.verbose??!1;if(k.driver&&k.driver!=="aws")return I(`Unsupported cloud driver: ${k.driver}. Only 'aws' is implemented.`),!1;let w=j.region||k.region||"us-east-1",J=j.domain||k.domain,M=j.subdomain||k.subdomain,N=j.baseDomain||k.baseDomain,O=j.bucket||k.bucket,P=j.stackName||k.stackName,U=j.hostedZoneId||k.hostedZoneId,Q=j.certificateArn||k.certificateArn,V=k.cacheControl||"max-age=31536000, public",B;if(J)B=J;else if(M&&N)B=`${M}.${N}`;let K=B?.replace(/\./g,"-")||"bunpress-site",G=null;try{G=W(k.dnsProvider,j.dnsProvider)}catch(H){return I(H.message),!1}let L=G!==null;if(j.dryRun){if(f("Dry run mode - no changes will be made"),console.log(`
5
5
  Configuration:`),console.log(` Region: ${w}`),console.log(` Site Name: ${K}`),console.log(` Bucket: ${O||"auto-generated"}`),console.log(` Domain: ${B||"not specified"}`),console.log(` Stack Name: ${P||`${K}-static-site`}`),console.log(` DNS Provider: ${G?.provider||"route53 (AWS)"}`),!L)console.log(` Hosted Zone ID: ${U||"auto-detected"}`);return console.log(` Certificate ARN: ${Q||"auto-created"}`),!0}if(!process.env.AWS_ACCESS_KEY_ID||!process.env.AWS_SECRET_ACCESS_KEY)return I("AWS credentials not found. Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables."),!1;let z=new h("Building documentation...");try{if(!m)z.start();if(!await x({verbose:m})){if(!m)z.fail("Build failed");return!1}if(!m)z.succeed("Documentation built successfully");let C=A.outDir||"./dist",X=D(C,".bunpress");if(!m)z.text="Deploying infrastructure with CloudFormation...",z.start();else if(console.log(`
@@ -9642,7 +9642,7 @@ ${T}
9642
9642
 
9643
9643
  ${G}
9644
9644
 
9645
- ${$.slice(Y.index+X.length)}`}return $}function A0(J){let Z=J.match(/^([^\s{]+)/),Q=Z?Z[1]:"",$=J.match(/\{([^}]+)\}/),Y=[];if($){let q=$[1].split(",");for(let z of q){let W=z.trim();if(W.includes("-")){let[_,K]=W.split("-").map(Number);for(let G=_;G<=K;G++)Y.push(G)}else Y.push(Number(W))}}let X=J.includes(":line-numbers");return{lang:Q,highlights:Y,showLineNumbers:X}}async function H0(J,Z,Q){let $=J[Z],Y=$.match(/^(`{3,})/),X=Y?Y[1].length:3,q="`".repeat(X),z=$.substring(X).trim(),W=A0(z),_=W.lang,K=Q.lineHighlighting?W.highlights:[],G=Q.lineNumbers?W.showLineNumbers:!1,V=[],U=Z+1;while(U<J.length){let v=J[U];if(v.match(new RegExp(`^\`{${X},}\\s*$`)))break;V.push(v),U++}if(Q.messagePreviews){let v=CQ(_,V.join(`
9645
+ ${$.slice(Y.index+X.length)}`}return $}function A0(J){let Z=J.match(/^([\w#+.-]+)/),Q=Z?Z[1]:"",$=J.match(/\{([^}]+)\}/),Y=[];if($){let q=$[1].split(",");for(let z of q){let W=z.trim();if(W.includes("-")){let[_,K]=W.split("-").map(Number);for(let G=_;G<=K;G++)Y.push(G)}else Y.push(Number(W))}}let X=J.includes(":line-numbers");return{lang:Q,highlights:Y,showLineNumbers:X}}async function H0(J,Z,Q){let $=J[Z],Y=$.match(/^(`{3,})/),X=Y?Y[1].length:3,q="`".repeat(X),z=$.substring(X).trim(),W=A0(z),_=W.lang,K=Q.lineHighlighting?W.highlights:[],G=Q.lineNumbers?W.showLineNumbers:!1,V=[],U=Z+1;while(U<J.length){let v=J[U];if(v.match(new RegExp(`^\`{${X},}\\s*$`)))break;V.push(v),U++}if(Q.messagePreviews){let v=CQ(_,V.join(`
9646
9646
  `));if(v!==null)return{html:v,endIndex:U}}let N=new Set,B=new Set,F=new Set,M=new Set,A=new Set,D=V.map((v,y)=>{let L=v;if(L.includes("// [!code focus]"))N.add(y),L=L.replace(/\/\/ \[!code focus\]/,"").trimEnd();if(L.includes("// [!code ++]"))B.add(y),L=L.replace(/\/\/ \[!code \+\+\]/,"").trimEnd();if(L.includes("// [!code --]"))F.add(y),L=L.replace(/\/\/ \[!code --\]/,"").trimEnd();if(L.includes("// [!code error]"))M.add(y),L=L.replace(/\/\/ \[!code error\]/,"").trimEnd();if(L.includes("// [!code warning]"))A.add(y),L=L.replace(/\/\/ \[!code warning\]/,"").trimEnd();return L}),T=N.size>0,R=D.join(`
9647
9647
  `),j=P.markdown?.syntaxHighlightTheme||"github-light",k=(await qJ(R,_,j)).split(`
9648
9648
  `).map((v,y)=>{let L=y+1,NJ=K.includes(L),h=N.has(y),RJ=Q.diffs&&B.has(y),BJ=Q.diffs&&F.has(y),EJ=Q.errorWarningMarkers&&M.has(y),e=Q.errorWarningMarkers&&A.has(y),S=["line"];if(NJ)S.push("highlighted");if(h)S.push("focused");if(T&&!h)S.push("dimmed");if(RJ)S.push("diff-add");if(BJ)S.push("diff-remove");if(EJ)S.push("has-error");if(e)S.push("has-warning");if(v.startsWith('<span class="line">')){let c=S.join(" "),l=v.replace('<span class="line">',`<span class="${c}">`);if(G)return`<span class="${S.join(" ")}"><span class="line-number">${L}</span>${l.replace(/^<span class="[^"]*">/,"").replace(/<\/span>$/,"")}</span>`;return l}let C=S.length>0?` class="${S.join(" ")}"`:"";if(G)return`<span${C}><span class="line-number">${L}</span>${v}</span>`;return`<span${C}>${v}</span>`}).join(`
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{j as c,k as d,l as e,m as f,n as g}from"./chunk-zep2erh2.js";import{aa as b}from"./chunk-778jqyb6.js";import{ha as a}from"./chunk-gn1n2yxt.js";export{d as wrapInLayout,c as stripConfiguredBasePath,f as startServer,g as serveCLI,e as markdownToHtml,a as getConfiguredBasePath,b as decodeHtmlEntities};
2
+ import{j as c,k as d,l as e,m as f,n as g}from"./chunk-0vf1e5mr.js";import{aa as b}from"./chunk-778jqyb6.js";import{ha as a}from"./chunk-gn1n2yxt.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{v as f4,w as c4,y as p4}from"./chunk-5dtz0br7.js";import{$ as u4,A as g4,B as O,D as $4,I as w4,J as b4,K as v4,Z as d4,ca as r,da as l4}from"./chunk-778jqyb6.js";import{fa as F,ga as i}from"./chunk-gn1n2yxt.js";var{Glob:g6}=globalThis.Bun;import{copyFile as f6,mkdir as c6,readdir as p6}from"fs/promises";import{existsSync as d6}from"fs";import{join as v,resolve as u6}from"path";import S from"process";import{CLI as l6}from"@stacksjs/clapp";var p="0.2.27";import{randomUUID as e4}from"crypto";import{mkdir as R4,mkdtemp as K6,readFile as Q6,realpath as Z6,rename as o,rm as d,rmdir as $6,writeFile as X6}from"fs/promises";import{basename as Y6,dirname as W4,join as q4,resolve as N6}from"path";var u=new Map;async function H6(K,Z){let Q=u.get(K)??Promise.resolve(),$,Y=new Promise((H)=>{$=H}),X=Q.then(()=>Y);u.set(K,X),await Q;try{return await Z()}finally{if($(),u.get(K)===X)u.delete(K)}}function _6(K){return K!==null&&typeof K==="object"&&"code"in K&&K.code==="ENOENT"}async function G4(K,Z,Q){let $=N6(K);await R4(W4($),{recursive:!0});let Y=q4(await Z6(W4($)),Y6($));return H6(Y,async()=>{let X=`${Y}.lock`;try{await R4(X,{mode:448})}catch(V){if(V!==null&&typeof V==="object"&&"code"in V&&V.code==="EEXIST")throw Error(`Documentation output is locked: ${X}. Verify the recorded owner has stopped before removing a stale lock.`);throw V}let H=JSON.stringify({pid:process.pid,token:e4()}),N=q4(X,"owner.json"),_,R,q=!1,G=!1;try{await X6(N,H,{flag:"wx",mode:384}),_=await K6(`${Y}.tmp-`);let V=await Z(_),U=`${_}.previous`;try{await o(Y,U),R=U}catch(W){if(!_6(W))throw W}if(await o(_,Y),q=!0,await Q?.(),G=!0,R)await d(R,{recursive:!0});return V}catch(V){if(!G&&(q||R))try{if(q)await d(Y,{recursive:!0});if(R)await o(R,Y)}catch(U){throw AggregateError([V,U],`Documentation publication failed; previous output is retained at ${R??Y}`)}throw V}finally{try{if(_)await d(_,{recursive:!0,force:!0})}finally{if(await Q6(N,"utf8").catch(()=>{return})===H)await d(N),await $6(X);else throw Error(`Documentation output lock ownership changed: ${X}`)}}})}var{Glob:R6}=globalThis.Bun;import{dirname as W6,relative as q6,resolve as l,sep as V4}from"path";import{mkdir as G6}from"fs/promises";function A4(K){return V4==="/"?K:K.split(V4).join("/")}function V6(K){let Z=new Bun.CryptoHasher("sha256");return Z.update(K),Z.digest("hex")}async function j4(K,Z,Q){let $=l(K),Y=Q?A4(q6($,l(Q))):void 0,X=[],H=new R6("**/*");for await(let R of H.scan({cwd:$,onlyFiles:!0})){let q=A4(R);if(q===Y)continue;X.push(q)}X.sort((R,q)=>R.localeCompare(q));let N=[],_=new Bun.CryptoHasher("sha256");for(let R of X){let q=new Uint8Array(await Bun.file(l($,R)).arrayBuffer()),G=V6(q);N.push({path:R,bytes:q.byteLength,sha256:G}),_.update(`${R}\x00${q.byteLength}\x00${G}
2
+ import{v as f4,w as c4,y as p4}from"./chunk-5dtz0br7.js";import{$ as u4,A as g4,B as O,D as $4,I as w4,J as b4,K as v4,Z as d4,ca as r,da as l4}from"./chunk-778jqyb6.js";import{fa as F,ga as i}from"./chunk-gn1n2yxt.js";var{Glob:g6}=globalThis.Bun;import{copyFile as f6,mkdir as c6,readdir as p6}from"fs/promises";import{existsSync as d6}from"fs";import{join as v,resolve as u6}from"path";import S from"process";import{CLI as l6}from"@stacksjs/clapp";var p="0.2.28";import{randomUUID as e4}from"crypto";import{mkdir as R4,mkdtemp as K6,readFile as Q6,realpath as Z6,rename as o,rm as d,rmdir as $6,writeFile as X6}from"fs/promises";import{basename as Y6,dirname as W4,join as q4,resolve as N6}from"path";var u=new Map;async function H6(K,Z){let Q=u.get(K)??Promise.resolve(),$,Y=new Promise((H)=>{$=H}),X=Q.then(()=>Y);u.set(K,X),await Q;try{return await Z()}finally{if($(),u.get(K)===X)u.delete(K)}}function _6(K){return K!==null&&typeof K==="object"&&"code"in K&&K.code==="ENOENT"}async function G4(K,Z,Q){let $=N6(K);await R4(W4($),{recursive:!0});let Y=q4(await Z6(W4($)),Y6($));return H6(Y,async()=>{let X=`${Y}.lock`;try{await R4(X,{mode:448})}catch(V){if(V!==null&&typeof V==="object"&&"code"in V&&V.code==="EEXIST")throw Error(`Documentation output is locked: ${X}. Verify the recorded owner has stopped before removing a stale lock.`);throw V}let H=JSON.stringify({pid:process.pid,token:e4()}),N=q4(X,"owner.json"),_,R,q=!1,G=!1;try{await X6(N,H,{flag:"wx",mode:384}),_=await K6(`${Y}.tmp-`);let V=await Z(_),U=`${_}.previous`;try{await o(Y,U),R=U}catch(W){if(!_6(W))throw W}if(await o(_,Y),q=!0,await Q?.(),G=!0,R)await d(R,{recursive:!0});return V}catch(V){if(!G&&(q||R))try{if(q)await d(Y,{recursive:!0});if(R)await o(R,Y)}catch(U){throw AggregateError([V,U],`Documentation publication failed; previous output is retained at ${R??Y}`)}throw V}finally{try{if(_)await d(_,{recursive:!0,force:!0})}finally{if(await Q6(N,"utf8").catch(()=>{return})===H)await d(N),await $6(X);else throw Error(`Documentation output lock ownership changed: ${X}`)}}})}var{Glob:R6}=globalThis.Bun;import{dirname as W6,relative as q6,resolve as l,sep as V4}from"path";import{mkdir as G6}from"fs/promises";function A4(K){return V4==="/"?K:K.split(V4).join("/")}function V6(K){let Z=new Bun.CryptoHasher("sha256");return Z.update(K),Z.digest("hex")}async function j4(K,Z,Q){let $=l(K),Y=Q?A4(q6($,l(Q))):void 0,X=[],H=new R6("**/*");for await(let R of H.scan({cwd:$,onlyFiles:!0})){let q=A4(R);if(q===Y)continue;X.push(q)}X.sort((R,q)=>R.localeCompare(q));let N=[],_=new Bun.CryptoHasher("sha256");for(let R of X){let q=new Uint8Array(await Bun.file(l($,R)).arrayBuffer()),G=V6(q);N.push({path:R,bytes:q.byteLength,sha256:G}),_.update(`${R}\x00${q.byteLength}\x00${G}
3
3
  `)}return{schema_version:1,generator:"bunpress",generator_version:Z,outputs:N,tree_sha256:_.digest("hex")}}async function M4(K,Z,Q){let $=await j4(K,Q,Z);return await G6(W6(l(Z)),{recursive:!0}),await Bun.write(Z,`${JSON.stringify($,null,2)}
4
4
  `),$}function J4(K){return new Map(K.outputs.map((Z)=>[Z.path,Z]))}async function U4(K,Z,Q){let $=await Bun.file(Z).json();if($.schema_version!==1||$.generator!=="bunpress"||!Array.isArray($.outputs))throw Error(`Unsupported or malformed BunPress build manifest: ${Z}`);let Y=await j4(K,Q,Z);if(JSON.stringify(Y)===JSON.stringify($))return Y;let X=J4($),H=J4(Y),N=Y.outputs.filter((G)=>!X.has(G.path)).map((G)=>G.path),_=$.outputs.filter((G)=>!H.has(G.path)).map((G)=>G.path),R=Y.outputs.filter((G)=>{let V=X.get(G.path);return V&&(V.bytes!==G.bytes||V.sha256!==G.sha256)}).map((G)=>{let V=X.get(G.path);return`${G.path} [bytes ${V.bytes} -> ${G.bytes}; sha256 ${V.sha256} -> ${G.sha256}]`}),q=[$.generator_version!==Y.generator_version?`generator ${$.generator_version} -> ${Y.generator_version}`:"",N.length?`added: ${N.join(", ")}`:"",_.length?`removed: ${_.join(", ")}`:"",R.length?`changed: ${R.join(", ")}`:""].filter(Boolean);throw Error(`BunPress output does not match ${Z}: ${q.join("; ")||"tree hash changed"}`)}import{existsSync as A6}from"fs";import{rm as J6}from"fs/promises";import{join as j6}from"path";var I={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m"};function z(K,Z){return`${I[Z]}${K}${I.reset}`}function T(K){console.log(`${I.green}\u2713${I.reset} ${K}`)}function A(K){console.error(`${I.red}\u2717${I.reset} ${K}`)}function h(K){console.warn(`${I.yellow}\u26A0${I.reset} ${K}`)}function B(K){console.log(`${I.blue}\u2139${I.reset} ${K}`)}function w(K){if(K===0)return"0 B";let Z=1024,Q=["B","KB","MB","GB"],$=Math.floor(Math.log(K)/Math.log(Z));return`${Number.parseFloat((K/Z**$).toFixed(2))} ${Q[$]}`}function t(K){if(K<1000)return`${K}ms`;if(K<60000)return`${(K/1000).toFixed(2)}s`;return`${(K/60000).toFixed(2)}m`}var B4=!!(process.env.CI||process.env.GITHUB_ACTIONS||process.env.BUILDKITE||process.env.CIRCLECI||process.env.GITLAB_CI);class C{frames=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];index=0;interval=null;text;constructor(K){this.text=K}start(){if(B4){console.log(` ${this.text}`);return}process.stdout.write("\x1B[?25l"),this.interval=setInterval(()=>{let K=this.frames[this.index];process.stdout.write(`\r${I.cyan}${K}${I.reset} ${this.text}`),this.index=(this.index+1)%this.frames.length},80)}succeed(K){this.stop(),T(K||this.text)}fail(K){this.stop(),A(K||this.text)}stop(){if(this.interval)clearInterval(this.interval),this.interval=null;if(!B4)process.stdout.write("\r\x1B[K"),process.stdout.write("\x1B[?25h")}update(K){this.text=K}}async function a(K,Z=!1){let Q=Z?"Y/n":"y/N";process.stdout.write(`${I.cyan}?${I.reset} ${K} ${I.dim}(${Q})${I.reset}: `);let $=Bun.file("/dev/stdin").stream().getReader(),Y=new TextDecoder,{value:X}=await $.read(),H=Y.decode(X).trim().toLowerCase();if(!H)return Z;return H==="y"||H==="yes"}function g(K){if(K.length===0)return;let Z=Object.keys(K[0]),Q={};for(let Y of Z)Q[Y]=Math.max(Y.length,...K.map((X)=>String(X[Y]).length));let $=Z.map((Y)=>Y.padEnd(Q[Y])).join(" ");console.log(z($,"bold")),console.log("\u2500".repeat($.length));for(let Y of K){let X=Z.map((H)=>String(Y[H]).padEnd(Q[H])).join(" ");console.log(X)}}async function n(K){try{return Bun.file(K).size}catch{return 0}}async function M6(K){try{let{Glob:Z}=awaitPromise.resolve(globalThis.Bun),Q=new Z("**/*"),$=0;for await(let Y of Q.scan(K)){let X=`${K}/${Y}`,H=await n(X);$+=H}return $}catch{return 0}}async function T4(K={}){let Z=await O,Q=K.outdir||Z.outDir||"./dist",$=j6(Q,".bunpress"),Y=K.force||!1,X=K.verbose||!1;try{if(!A6($))return B(`Directory "${$}" does not exist, nothing to clean`),!0;let N=await M6($);if(X)B(`Found "${$}" (${w(N)})`);if(!Y){if(!await a(`Delete "${$}" directory? (${w(N)})`,!1))return B("Clean cancelled"),!1}let _=process.env.VITEST==="true"||!1,R=null;if(!_&&!X)R=new C("Cleaning build artifacts..."),R.start();if(await J6($,{recursive:!0,force:!0}),R)R.succeed(`Cleaned ${w(N)} from "${$}"`);else if(X||_)T(`Cleaned ${w(N)} from "${$}"`);return!0}catch(H){return A(`Failed to clean directory: ${H}`),!1}}import{existsSync as e}from"fs";import{join as K4}from"path";async function z4(K={}){try{let Z=["bunpress.config.ts","bunpress.config.js"],Q=null;for(let Y of Z){let X=K4(process.cwd(),Y);if(e(X)){Q=X;break}}if(!Q)return A("No configuration file found"),B('Run "bunpress config init" to create one'),!1;T(`Configuration file: ${Q}`),console.log();let $=await Bun.file(Q).text();return console.log(z("Configuration:","bold")),console.log($),!0}catch(Z){return A(`Failed to show configuration: ${Z}`),!1}}async function O4(K={}){let Z=K.verbose||!1;try{let Q=["bunpress.config.ts","bunpress.config.js"],$=null;for(let _ of Q){let R=K4(process.cwd(),_);if(e(R)){$=R;break}}if(!$)return A("No configuration file found"),!1;if(Z)B(`Validating ${$}...`);let X=(await import($)).default;if(!X)return A("Configuration file does not export a default object"),!1;let H=[],N=[];if(X.markdown){if(X.markdown.toc&&typeof X.markdown.toc!=="object"&&typeof X.markdown.toc!=="boolean")H.push("markdown.toc should be an object or boolean");if(X.markdown.features){if(typeof X.markdown.features!=="object")H.push("markdown.features should be an object")}}if(X.nav){if(!Array.isArray(X.nav))H.push("nav should be an array");else for(let[_,R]of X.nav.entries())if(!R.text||!R.link)H.push(`nav[${_}] is missing required fields (text, link)`)}if(!i(X))N.push("no `url` set: sitemap, RSS, canonical links and Open Graph tags are all skipped without an absolute base URL");if(H.length>0){A("Configuration validation failed:");for(let _ of H)console.log(` \u2022 ${_}`);return!1}for(let _ of N)h(_);return T("Configuration is valid \u2713"),!0}catch(Q){return A(`Failed to validate configuration: ${Q}`),!1}}async function L4(K={}){let Z=K4(process.cwd(),"bunpress.config.ts");if(e(Z))return A("Configuration file already exists"),!1;let Q=`import type { BunPressConfig } from '@stacksjs/bunpress'
5
5
 
@@ -290,8 +290,8 @@ ${Z}`}async function y6(K){let Z=[];async function Q($){let Y=await b.promises.r
290
290
  `)){let X=Y.match(/^#{1,6}\s+(.*)$/);if(!X)continue;let H=X[1].trim(),N=H.match(/\{#([\w-]+)\}\s*$/),_=N?N[1]:b4(w4(H));if(!_)continue;v4(_,Q)}}catch{}return y4.set(K,Q),Q}function k6(K){let Z=[],Q=/!\[([^\]]*)\]\(([^)]+)\)/g,$;while(($=Q.exec(K))!==null){let Y=$[1],X=$[2];if(!Y||Y.trim()==="")Z.push(X)}return Z}function P6(K){if(console.log(""),B("\uD83D\uDCCA SEO Report"),console.log(""),console.log(`Total pages checked: ${z(K.totalPages.toString(),"blue")}`),console.log(`Passed: ${z(K.passed.toString(),"green")}`),console.log(`Errors: ${z(K.errors.length.toString(),K.errors.length>0?"red":"green")}`),console.log(`Warnings: ${z(K.warnings.length.toString(),K.warnings.length>0?"yellow":"green")}`),console.log(""),K.errors.length>0){A(`\u2717 ${K.errors.length} errors found:`),console.log("");let Z=K.errors.map((Q)=>({Category:Q.category,File:Q.file,Message:Q.message}));g(Z),console.log("")}if(K.warnings.length>0){h(`\u26A0 ${K.warnings.length} warnings found:`),console.log("");let Z=K.warnings.map((Q)=>({Category:Q.category,File:Q.file,Message:Q.message}));g(Z),console.log("")}if(K.errors.length===0&&K.warnings.length===0)T("\u2713 All SEO checks passed!");else if(K.errors.length===0)T("\u2713 No errors found (only warnings)")}import{join as h6}from"path";async function m6(K){let Z=await Bun.file(K).text(),Q=Z.split(`
291
291
  `),$=0,Y=!1,X=[];for(let R of Q){if(R.trim().startsWith("```")){Y=!Y;continue}if(!Y)X.push(R)}$=X.join(" ").split(/\s+/).filter((R)=>R.length>0).length;let N=Q.filter((R)=>R.match(/^#{1,6}\s+/)).length,_=(Z.match(/```/g)||[]).length/2;return{path:K,size:await n(K),lines:Q.length,words:$,headings:N,codeBlocks:Math.floor(_)}}async function h4(K={}){let Z=await O,Q=K.dir||Z.docsDir||"./docs",$=K.verbose||!1;try{console.log(z(`
292
292
  Analyzing documentation...
293
- `,"bold"));let{Glob:Y}=awaitPromise.resolve(globalThis.Bun),X=new Y("**/*.md"),H=[];for await(let j of X.scan(Q)){let J=h6(Q,j),f=await m6(J);H.push(f)}if(H.length===0)return A("No markdown files found"),!1;let N=H.reduce((j,J)=>j+J.size,0),_=H.reduce((j,J)=>j+J.lines,0),R=H.reduce((j,J)=>j+J.words,0),q=H.reduce((j,J)=>j+J.headings,0),G=H.reduce((j,J)=>j+J.codeBlocks,0);if(console.log(z("Summary","bold")),console.log("\u2500".repeat(50)),console.log(`Files: ${H.length}`),console.log(`Total size: ${w(N)}`),console.log(`Total lines: ${_.toLocaleString()}`),console.log(`Total words: ${R.toLocaleString()}`),console.log(`Headings: ${q}`),console.log(`Code blocks: ${G}`),console.log(),$){console.log(z("Per-file Statistics","bold")),console.log("\u2500".repeat(50));let j=H.map((J)=>({File:J.path.replace(`${Q}/`,""),Size:w(J.size),Lines:J.lines,Words:J.words,Headings:J.headings,"Code Blocks":J.codeBlocks}));g(j),console.log()}let V=N/H.length,U=_/H.length,W=R/H.length;console.log(z("Averages per File","bold")),console.log("\u2500".repeat(50)),console.log(`Size: ${w(V)}`),console.log(`Lines: ${Math.round(U)}`),console.log(`Words: ${Math.round(W)}`),console.log();let E=[...H].sort((j,J)=>J.size-j.size).slice(0,5);if(E.length>0){console.log(z("Top 5 Largest Files","bold")),console.log("\u2500".repeat(50));for(let j of E){let J=j.path.replace(`${Q}/`,"");console.log(` ${J.padEnd(40)} ${w(j.size)}`)}console.log()}let x=Math.ceil(R/200);return B(`Estimated reading time: ${x} minutes`),!0}catch(Y){return A(`Failed to generate statistics: ${Y}`),!1}}var L=new l6("bunpress"),M={outdir:O.outDir||"./dist",docsdir:O.docsDir||"./docs",port:3000,open:!0,watch:!0,verbose:O.verbose};async function a6(K,Z,Q=!1){let $=`${Z}/public`;try{await p6($);let Y=new g6("**/*");for await(let X of Y.scan($)){let H=v($,X),N=v(K,X);await c6(v(K,X.split("/").slice(0,-1).join("/")),{recursive:!0}),await f6(H,N)}}catch{if(Q)console.log("No public directory found, skipping static assets copy")}}async function n6(K,Z,Q,$){if((Q.search??Q.markdown?.search)?.enabled===!1)return;try{let Y=await u4(K,Q);if(await Bun.write(v(Z,d4.replace(/^\//,"")),JSON.stringify(Y)),$)console.log(`Indexed ${Y.length} sections for search.`)}catch(Y){if($)console.error("Error generating search index:",Y)}}async function i6(K,Z,Q,$){try{if(Q.sitemap?.enabled!==!1&&i(Q))await p4(K,Z,Q);if(Q.robots?.enabled!==!1)await c4(Z,Q);if(Q.rss?.enabled)await f4(K,Z,Q,Q.rss)}catch(Y){if($)console.error("Error generating SEO files:",Y)}}async function s6(K={}){let Z=await O;if(!K.config)return Z;let Q=u6(S.cwd(),K.config);if(!d6(Q))throw Error(`Config file not found: ${Q}`);let $=await import(Q),Y=$.default??$;return g4({...Z,...Y})}async function m4(K={}){if(K.manifest&&K.checkManifest)throw Error("--manifest and --check-manifest are mutually exclusive");let Z=await s6(K),Q=K.outdir||Z.outDir||M.outdir,$=v(Q,".bunpress"),Y=K.dir||Z.docsDir||M.docsdir,X=K.verbose??M.verbose,H=performance.now(),N=new C("Building documentation...");if(!X)N.start();try{let _=await G4($,async(q)=>{let G=await r(Y);if(G.length===0)throw Error("No markdown files found in docs directory");if(X)console.log(`Found ${G.length} markdown files:`),G.forEach((y)=>console.log(`- ${y}`));let{markdownToHtml:V,wrapInLayout:U}=await import("./chunk-nc0j0mjh.js"),{loadI18nTranslations:W,resolveI18nConfig:E}=await import("./chunk-15vwh1bm.js"),{mkdir:x,writeFile:j}=await import("fs/promises"),J=await W(E(Z),Z);if(X)console.log("Transforming markdown to HTML...");let f=l4(G,Y,J),Y4=f.pages;for(let y of Y4){let a4=await Bun.file(y.sourceFile).text(),{html:n4,frontmatter:N4}=await V(a4,Y,{page:y,catalog:f}),m=y.relativePath,i4=`/${m}`,s4=N4.layout||"doc",r4=await U(n4,Z,i4,s4,N4,{i18n:J,locale:y.locale,sourceFile:y.sourceFile,docsDir:Y}),o4=m==="index"||m.endsWith("/index"),H4=y.locale&&y.locale!==J.defaultLocale&&J.enabled?v(q,y.locale):q,c=o4?v(H4,`${m}.html`):v(H4,m,"index.html"),_4=c.substring(0,c.lastIndexOf("/"));if(_4)await x(_4,{recursive:!0});if(await j(c,r4),X)console.log(`Generated: ${c}`)}if(X)console.log(`Processed ${G.length} markdown files into ${Y4.length} pages.`);if(await a6(q,Y,X),await o6(q),await r6(q,Z),K.searchIndex!==!1)await n6(Y,q,Z,X||!1);if(await i6(Y,q,Z,X||!1),K.checkManifest)await U4(q,K.checkManifest,p);return G.length},async()=>{if(K.manifest)await M4($,K.manifest,p)}),R=performance.now()-H;if(!X)N.succeed(`Built ${_} pages to HTML in ${t(R)}`);else T(`Build completed in ${t(R)}`),console.log(`
294
- Generated ${_} HTML files in ${$}`);return!0}catch(_){if(!X)N.fail("Build failed");return console.error("Error during build:",_),!1}}async function r6(K,Z){let{getConfiguredBasePath:Q,wrapInLayout:$}=await import("./chunk-nc0j0mjh.js"),X=`
293
+ `,"bold"));let{Glob:Y}=awaitPromise.resolve(globalThis.Bun),X=new Y("**/*.md"),H=[];for await(let j of X.scan(Q)){let J=h6(Q,j),f=await m6(J);H.push(f)}if(H.length===0)return A("No markdown files found"),!1;let N=H.reduce((j,J)=>j+J.size,0),_=H.reduce((j,J)=>j+J.lines,0),R=H.reduce((j,J)=>j+J.words,0),q=H.reduce((j,J)=>j+J.headings,0),G=H.reduce((j,J)=>j+J.codeBlocks,0);if(console.log(z("Summary","bold")),console.log("\u2500".repeat(50)),console.log(`Files: ${H.length}`),console.log(`Total size: ${w(N)}`),console.log(`Total lines: ${_.toLocaleString()}`),console.log(`Total words: ${R.toLocaleString()}`),console.log(`Headings: ${q}`),console.log(`Code blocks: ${G}`),console.log(),$){console.log(z("Per-file Statistics","bold")),console.log("\u2500".repeat(50));let j=H.map((J)=>({File:J.path.replace(`${Q}/`,""),Size:w(J.size),Lines:J.lines,Words:J.words,Headings:J.headings,"Code Blocks":J.codeBlocks}));g(j),console.log()}let V=N/H.length,U=_/H.length,W=R/H.length;console.log(z("Averages per File","bold")),console.log("\u2500".repeat(50)),console.log(`Size: ${w(V)}`),console.log(`Lines: ${Math.round(U)}`),console.log(`Words: ${Math.round(W)}`),console.log();let E=[...H].sort((j,J)=>J.size-j.size).slice(0,5);if(E.length>0){console.log(z("Top 5 Largest Files","bold")),console.log("\u2500".repeat(50));for(let j of E){let J=j.path.replace(`${Q}/`,"");console.log(` ${J.padEnd(40)} ${w(j.size)}`)}console.log()}let x=Math.ceil(R/200);return B(`Estimated reading time: ${x} minutes`),!0}catch(Y){return A(`Failed to generate statistics: ${Y}`),!1}}var L=new l6("bunpress"),M={outdir:O.outDir||"./dist",docsdir:O.docsDir||"./docs",port:3000,open:!0,watch:!0,verbose:O.verbose};async function a6(K,Z,Q=!1){let $=`${Z}/public`;try{await p6($);let Y=new g6("**/*");for await(let X of Y.scan($)){let H=v($,X),N=v(K,X);await c6(v(K,X.split("/").slice(0,-1).join("/")),{recursive:!0}),await f6(H,N)}}catch{if(Q)console.log("No public directory found, skipping static assets copy")}}async function n6(K,Z,Q,$){if((Q.search??Q.markdown?.search)?.enabled===!1)return;try{let Y=await u4(K,Q);if(await Bun.write(v(Z,d4.replace(/^\//,"")),JSON.stringify(Y)),$)console.log(`Indexed ${Y.length} sections for search.`)}catch(Y){if($)console.error("Error generating search index:",Y)}}async function i6(K,Z,Q,$){try{if(Q.sitemap?.enabled!==!1&&i(Q))await p4(K,Z,Q);if(Q.robots?.enabled!==!1)await c4(Z,Q);if(Q.rss?.enabled)await f4(K,Z,Q,Q.rss)}catch(Y){if($)console.error("Error generating SEO files:",Y)}}async function s6(K={}){let Z=await O;if(!K.config)return Z;let Q=u6(S.cwd(),K.config);if(!d6(Q))throw Error(`Config file not found: ${Q}`);let $=await import(Q),Y=$.default??$;return g4({...Z,...Y})}async function m4(K={}){if(K.manifest&&K.checkManifest)throw Error("--manifest and --check-manifest are mutually exclusive");let Z=await s6(K),Q=K.outdir||Z.outDir||M.outdir,$=v(Q,".bunpress"),Y=K.dir||Z.docsDir||M.docsdir,X=K.verbose??M.verbose,H=performance.now(),N=new C("Building documentation...");if(!X)N.start();try{let _=await G4($,async(q)=>{let G=await r(Y);if(G.length===0)throw Error("No markdown files found in docs directory");if(X)console.log(`Found ${G.length} markdown files:`),G.forEach((y)=>console.log(`- ${y}`));let{markdownToHtml:V,wrapInLayout:U}=await import("./chunk-ebdvjtv3.js"),{loadI18nTranslations:W,resolveI18nConfig:E}=await import("./chunk-15vwh1bm.js"),{mkdir:x,writeFile:j}=await import("fs/promises"),J=await W(E(Z),Z);if(X)console.log("Transforming markdown to HTML...");let f=l4(G,Y,J),Y4=f.pages;for(let y of Y4){let a4=await Bun.file(y.sourceFile).text(),{html:n4,frontmatter:N4}=await V(a4,Y,{page:y,catalog:f}),m=y.relativePath,i4=`/${m}`,s4=N4.layout||"doc",r4=await U(n4,Z,i4,s4,N4,{i18n:J,locale:y.locale,sourceFile:y.sourceFile,docsDir:Y}),o4=m==="index"||m.endsWith("/index"),H4=y.locale&&y.locale!==J.defaultLocale&&J.enabled?v(q,y.locale):q,c=o4?v(H4,`${m}.html`):v(H4,m,"index.html"),_4=c.substring(0,c.lastIndexOf("/"));if(_4)await x(_4,{recursive:!0});if(await j(c,r4),X)console.log(`Generated: ${c}`)}if(X)console.log(`Processed ${G.length} markdown files into ${Y4.length} pages.`);if(await a6(q,Y,X),await o6(q),await r6(q,Z),K.searchIndex!==!1)await n6(Y,q,Z,X||!1);if(await i6(Y,q,Z,X||!1),K.checkManifest)await U4(q,K.checkManifest,p);return G.length},async()=>{if(K.manifest)await M4($,K.manifest,p)}),R=performance.now()-H;if(!X)N.succeed(`Built ${_} pages to HTML in ${t(R)}`);else T(`Build completed in ${t(R)}`),console.log(`
294
+ Generated ${_} HTML files in ${$}`);return!0}catch(_){if(!X)N.fail("Build failed");return console.error("Error during build:",_),!1}}async function r6(K,Z){let{getConfiguredBasePath:Q,wrapInLayout:$}=await import("./chunk-ebdvjtv3.js"),X=`
295
295
  <style>
296
296
  .NotFound {
297
297
  padding: 64px 24px 96px;
@@ -370,7 +370,7 @@ Generated ${_} HTML files in ${$}`);return!0}catch(_){if(!X)N.fail("Build failed
370
370
  </div>
371
371
  `,H=await $(X,Z,"/404","doc");await Bun.write(v(K,"404.html"),H)}async function o6(K){let Z=v(K,"index.html");try{if(!await Bun.file(Z).exists())console.error("Warning: No index.html found at root")}catch(Q){console.error("Error checking root index.html:",Q)}}L.command("build","Build the documentation site").option("--outdir <outdir>","Output directory").option("--dir <dir>","Documentation directory").option("--config <config>","Path to config file").option("--minify","Minify output files",{default:!1}).option("--sourcemap","Generate source maps",{default:!1}).option("--manifest <path>","Write a deterministic rendered-tree manifest").option("--check-manifest <path>","Fail unless the rendered tree matches a checked manifest").option("--search-index","Write the client search index (on by default; --no-search-index skips it)",{default:!0}).option("--watch","Watch for changes and rebuild",{default:!1}).option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{if(!await m4(K))S.exit(1);if(K.watch){let{watch:Q}=await import("fs"),$=await O,Y=K.dir||$.docsDir||"./docs";console.log(`
372
372
  Watching for changes...`),Q(Y,{recursive:!0},async(X,H)=>{if(H&&H.endsWith(".md"))console.log(`
373
- Detected change in ${H}, rebuilding...`),await m4(K)}),await new Promise(()=>{})}});L.command("dev","Build and serve documentation using BunPress server").option("--port <port>","Port to listen on",{default:M.port}).option("--dir <dir>","Documentation directory").option("--watch","Watch for changes",{default:M.watch}).option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{let Z=await O,Q=K.port||M.port,$=K.dir||Z.docsDir||M.docsdir,Y=K.watch??M.watch,X=K.verbose??M.verbose;if(X)console.log("Starting BunPress dev server with options:",{port:Q,root:$,watch:Y,verbose:X});let{serveCLI:H}=await import("./chunk-nc0j0mjh.js");await H({port:Q,root:$,watch:Y,config:Z})});async function t6(K={}){let Z=await O,Q=K.dir||Z.docsDir||M.docsdir,$=K.output||"./docs.md",Y=K.full??!1,X=K.verbose??M.verbose;if(X)console.log(`Generating LLM markdown from ${Q}`),console.log(`Output file: ${$}`),console.log(`Full content: ${Y}`);let H=await r(Q);if(H.length===0)return console.log("No markdown files found in docs directory"),!1;if(X)console.log(`Found ${H.length} markdown files`);H.sort();let N=`# Documentation
373
+ Detected change in ${H}, rebuilding...`),await m4(K)}),await new Promise(()=>{})}});L.command("dev","Build and serve documentation using BunPress server").option("--port <port>","Port to listen on",{default:M.port}).option("--dir <dir>","Documentation directory").option("--watch","Watch for changes",{default:M.watch}).option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{let Z=await O,Q=K.port||M.port,$=K.dir||Z.docsDir||M.docsdir,Y=K.watch??M.watch,X=K.verbose??M.verbose;if(X)console.log("Starting BunPress dev server with options:",{port:Q,root:$,watch:Y,verbose:X});let{serveCLI:H}=await import("./chunk-ebdvjtv3.js");await H({port:Q,root:$,watch:Y,config:Z})});async function t6(K={}){let Z=await O,Q=K.dir||Z.docsDir||M.docsdir,$=K.output||"./docs.md",Y=K.full??!1,X=K.verbose??M.verbose;if(X)console.log(`Generating LLM markdown from ${Q}`),console.log(`Output file: ${$}`),console.log(`Full content: ${Y}`);let H=await r(Q);if(H.length===0)return console.log("No markdown files found in docs directory"),!1;if(X)console.log(`Found ${H.length} markdown files`);H.sort();let N=`# Documentation
374
374
 
375
375
  `;N+=`Generated: ${new Date().toISOString()}
376
376
 
@@ -389,5 +389,5 @@ Detected change in ${H}, rebuilding...`),await m4(K)}),await new Promise(()=>{})
389
389
  `}N+=`---
390
390
 
391
391
  `}return await Bun.write($,N),console.log(`
392
- LLM markdown generated successfully: ${$}`),console.log(`Total size: ${(N.length/1024).toFixed(2)} KB`),!0}L.command("llm","Generate LLM-friendly markdown file from documentation").option("--dir <dir>","Documentation directory (defaults to config docsDir)").option("--output <output>","Output file path",{default:"./docs.md"}).option("--full","Include full content (not just titles and headings)",{default:!1}).option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{if(!await t6(K))S.exit(1)});L.command("init","Initialize a new BunPress project").option("--name <name>","Project name").option("--template <template>","Template to use").option("--force","Overwrite existing files",{default:!1}).action(async(K)=>{if(!await E4(K))S.exit(1)});L.command("preview","Preview the built documentation site").option("--port <port>","Port to listen on",{default:M.port}).option("--outdir <outdir>","Output directory (looks for .bunpress folder inside)").option("--open","Open in browser",{default:!1}).option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{await D4(K)});L.command("clean","Clean build artifacts").option("--outdir <outdir>","Output directory to clean",{default:M.outdir}).option("--force","Skip confirmation prompt",{default:!1}).option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{if(!await T4(K))S.exit(1)});L.command("doctor","Run diagnostic checks on the project").option("--dir <dir>","Documentation directory (defaults to config docsDir)").option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{if(!await x4(K))S.exit(1)});L.command("config:show","Show current configuration").option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{if(!await z4(K))S.exit(1)});L.command("config:validate","Validate configuration file").option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{if(!await O4(K))S.exit(1)});L.command("config:init","Initialize configuration file").action(async(K)=>{if(!await L4(K))S.exit(1)});L.command("new <path>","Create a new markdown file").option("--title <title>","Page title").option("--template <template>","Template to use (default, guide, api, blog)",{default:"default"}).option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K,Z)=>{if(!await F4(K,Z))S.exit(1)});L.command("stats","Show documentation statistics").option("--dir <dir>","Documentation directory (defaults to config docsDir)").option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{if(!await h4(K))S.exit(1)});L.command("seo:check","Check SEO for all documentation pages").option("--dir <dir>","Documentation directory (defaults to config docsDir)").option("--fix","Automatically fix issues (add missing titles/descriptions)",{default:!1}).action(async(K)=>{await k4(K)});L.command("deploy","Deploy documentation to AWS using CloudFormation (S3 + CloudFront + Route53)").option("--region <region>","AWS region for S3 bucket",{default:"us-east-1"}).option("--bucket <bucket>","S3 bucket name (auto-generated if not provided)").option("--domain <domain>","Custom domain (e.g., docs.example.com)").option("--subdomain <subdomain>","Subdomain (used with --base-domain)").option("--base-domain <baseDomain>","Base domain (e.g., example.com) - must have Route53 hosted zone").option("--stack-name <stackName>","CloudFormation stack name").option("--hosted-zone-id <hostedZoneId>","Route53 hosted zone ID (auto-detected from domain)").option("--certificate-arn <certificateArn>","ACM certificate ARN (auto-created if not provided)").option("--dry-run","Show configuration without deploying",{default:!1}).option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{let{deployCommand:Z}=await import("./chunk-xda0659n.js");if(!await Z(K))S.exit(1)});L.help();L.version(p);var X4=Bun.argv[1]||"",e6=X4.endsWith("/bunpress")||X4.endsWith("/cli.ts")||X4.endsWith("/cli.js");if(e6)L.parse();
392
+ LLM markdown generated successfully: ${$}`),console.log(`Total size: ${(N.length/1024).toFixed(2)} KB`),!0}L.command("llm","Generate LLM-friendly markdown file from documentation").option("--dir <dir>","Documentation directory (defaults to config docsDir)").option("--output <output>","Output file path",{default:"./docs.md"}).option("--full","Include full content (not just titles and headings)",{default:!1}).option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{if(!await t6(K))S.exit(1)});L.command("init","Initialize a new BunPress project").option("--name <name>","Project name").option("--template <template>","Template to use").option("--force","Overwrite existing files",{default:!1}).action(async(K)=>{if(!await E4(K))S.exit(1)});L.command("preview","Preview the built documentation site").option("--port <port>","Port to listen on",{default:M.port}).option("--outdir <outdir>","Output directory (looks for .bunpress folder inside)").option("--open","Open in browser",{default:!1}).option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{await D4(K)});L.command("clean","Clean build artifacts").option("--outdir <outdir>","Output directory to clean",{default:M.outdir}).option("--force","Skip confirmation prompt",{default:!1}).option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{if(!await T4(K))S.exit(1)});L.command("doctor","Run diagnostic checks on the project").option("--dir <dir>","Documentation directory (defaults to config docsDir)").option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{if(!await x4(K))S.exit(1)});L.command("config:show","Show current configuration").option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{if(!await z4(K))S.exit(1)});L.command("config:validate","Validate configuration file").option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{if(!await O4(K))S.exit(1)});L.command("config:init","Initialize configuration file").action(async(K)=>{if(!await L4(K))S.exit(1)});L.command("new <path>","Create a new markdown file").option("--title <title>","Page title").option("--template <template>","Template to use (default, guide, api, blog)",{default:"default"}).option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K,Z)=>{if(!await F4(K,Z))S.exit(1)});L.command("stats","Show documentation statistics").option("--dir <dir>","Documentation directory (defaults to config docsDir)").option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{if(!await h4(K))S.exit(1)});L.command("seo:check","Check SEO for all documentation pages").option("--dir <dir>","Documentation directory (defaults to config docsDir)").option("--fix","Automatically fix issues (add missing titles/descriptions)",{default:!1}).action(async(K)=>{await k4(K)});L.command("deploy","Deploy documentation to AWS using CloudFormation (S3 + CloudFront + Route53)").option("--region <region>","AWS region for S3 bucket",{default:"us-east-1"}).option("--bucket <bucket>","S3 bucket name (auto-generated if not provided)").option("--domain <domain>","Custom domain (e.g., docs.example.com)").option("--subdomain <subdomain>","Subdomain (used with --base-domain)").option("--base-domain <baseDomain>","Base domain (e.g., example.com) - must have Route53 hosted zone").option("--stack-name <stackName>","CloudFormation stack name").option("--hosted-zone-id <hostedZoneId>","Route53 hosted zone ID (auto-detected from domain)").option("--certificate-arn <certificateArn>","ACM certificate ARN (auto-created if not provided)").option("--dry-run","Show configuration without deploying",{default:!1}).option("--verbose","Enable verbose logging",{default:M.verbose}).action(async(K)=>{let{deployCommand:Z}=await import("./chunk-0tpr86ec.js");if(!await Z(K))S.exit(1)});L.help();L.version(p);var X4=Bun.argv[1]||"",e6=X4.endsWith("/bunpress")||X4.endsWith("/cli.ts")||X4.endsWith("/cli.js");if(e6)L.parse();
393
393
  export{T as o,A as p,B as q,C as r,s6 as s,m4 as t};
package/dist/src/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{a as W,b as X,c as Y,d as Z,e as _,f as $,g as b,h as v,i as A,j as Dj,k as Ej,l as Gj,m as Hj,n as Ij}from"../chunk-zep2erh2.js";import{u as j,v as k,w as q,x as u,y as w}from"../chunk-5dtz0br7.js";import{$ as D,A as S,B as T,C as V,H as f,I as c,J as d,K as g,L as a,M as n,N as o,O as r,P as t,Q as i,R as s,S as e,T as jj,U as kj,V as qj,W as uj,X as wj,Y as zj,Z as z,_ as B,aa as Bj,z as Q}from"../chunk-778jqyb6.js";import{ha as F,ia as R,ja as U,ka as m,la as x,ma as C,na as l,oa as h,pa as y,qa as p}from"../chunk-gn1n2yxt.js";export{Ej as wrapInLayout,Dj as stripConfiguredBasePath,Hj as startServer,m as splitLocaleFromPath,X as setLanguageAliases,Ij as serveCLI,R as resolveI18nConfig,W as resetHighlighter,g as reserveUniqueSlug,qj as processInlineTocSyntax,v as prewarmHighlighter,Y as normalizeLanguage,Gj as markdownToHtml,c as markdownHeadingText,x as localizeUrl,h as localeLabel,C as localeContentCandidates,U as loadI18nTranslations,Z as isLanguageSupported,$ as highlightCodeSync,_ as highlightCode,b as getSyntaxHighlightingStyles,A as getHighlighterInstance,F as getConfiguredBasePath,V as getConfig,a as generateUniqueSlug,wj as generateTocStyles,zj as generateTocScripts,kj as generateTocPositions,t as generateTocHtml,jj as generateTocData,d as generateSlug,w as generateSitemap,s as generateSidebarTocHtml,k as generateRssFeed,q as generateRobotsTxt,p as generateLocaleDetectionScript,i as generateInlineTocHtml,y as generateHreflangTags,e as generateFloatingTocHtml,r as filterHeadings,n as extractHeadings,uj as enhanceHeadingsWithAnchors,f as defaultTocConfig,Q as defaultConfig,Bj as decodeHtmlEntities,l as configForLocale,T as config,o as buildTocHierarchy,u as buildSitemap,B as buildSearchRuntimeConfig,D as buildSearchIndex,j as buildRssFeed,S as applyConfigPlugins,z as SEARCH_INDEX_PATH};
2
+ import{a as W,b as X,c as Y,d as Z,e as _,f as $,g as b,h as v,i as A,j as Dj,k as Ej,l as Gj,m as Hj,n as Ij}from"../chunk-0vf1e5mr.js";import{u as j,v as k,w as q,x as u,y as w}from"../chunk-5dtz0br7.js";import{$ as D,A as S,B as T,C as V,H as f,I as c,J as d,K as g,L as a,M as n,N as o,O as r,P as t,Q as i,R as s,S as e,T as jj,U as kj,V as qj,W as uj,X as wj,Y as zj,Z as z,_ as B,aa as Bj,z as Q}from"../chunk-778jqyb6.js";import{ha as F,ia as R,ja as U,ka as m,la as x,ma as C,na as l,oa as h,pa as y,qa as p}from"../chunk-gn1n2yxt.js";export{Ej as wrapInLayout,Dj as stripConfiguredBasePath,Hj as startServer,m as splitLocaleFromPath,X as setLanguageAliases,Ij as serveCLI,R as resolveI18nConfig,W as resetHighlighter,g as reserveUniqueSlug,qj as processInlineTocSyntax,v as prewarmHighlighter,Y as normalizeLanguage,Gj as markdownToHtml,c as markdownHeadingText,x as localizeUrl,h as localeLabel,C as localeContentCandidates,U as loadI18nTranslations,Z as isLanguageSupported,$ as highlightCodeSync,_ as highlightCode,b as getSyntaxHighlightingStyles,A as getHighlighterInstance,F as getConfiguredBasePath,V as getConfig,a as generateUniqueSlug,wj as generateTocStyles,zj as generateTocScripts,kj as generateTocPositions,t as generateTocHtml,jj as generateTocData,d as generateSlug,w as generateSitemap,s as generateSidebarTocHtml,k as generateRssFeed,q as generateRobotsTxt,p as generateLocaleDetectionScript,i as generateInlineTocHtml,y as generateHreflangTags,e as generateFloatingTocHtml,r as filterHeadings,n as extractHeadings,uj as enhanceHeadingsWithAnchors,f as defaultTocConfig,Q as defaultConfig,Bj as decodeHtmlEntities,l as configForLocale,T as config,o as buildTocHierarchy,u as buildSitemap,B as buildSearchRuntimeConfig,D as buildSearchIndex,j as buildRssFeed,S as applyConfigPlugins,z as SEARCH_INDEX_PATH};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/bunpress",
3
3
  "type": "module",
4
- "version": "0.2.27",
4
+ "version": "0.2.28",
5
5
  "description": "Modern documentation engine. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",