@stacksjs/bunpress 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +296 -0
  2. package/README.md +113 -26
  3. package/dist/bin/cli.js +2 -104
  4. package/dist/chunk-16hpnayn.js +505 -0
  5. package/dist/chunk-njjmvdjd.js +8 -0
  6. package/dist/chunk-nt1zw6bf.js +9632 -0
  7. package/dist/chunk-zabbw4a8.js +2 -0
  8. package/dist/config.d.ts +3 -5
  9. package/dist/robots.d.ts +5 -0
  10. package/dist/rss.d.ts +16 -0
  11. package/dist/serve.d.ts +8 -0
  12. package/dist/sitemap.d.ts +5 -0
  13. package/dist/src/index.js +1 -1
  14. package/dist/templates/blocks/alerts/caution.stx +9 -0
  15. package/dist/templates/blocks/alerts/important.stx +9 -0
  16. package/dist/templates/blocks/alerts/note.stx +9 -0
  17. package/dist/templates/blocks/alerts/tip.stx +9 -0
  18. package/dist/templates/blocks/alerts/warning.stx +9 -0
  19. package/dist/templates/blocks/containers/danger.stx +6 -0
  20. package/dist/templates/blocks/containers/details.stx +6 -0
  21. package/dist/templates/blocks/containers/info.stx +6 -0
  22. package/dist/templates/blocks/containers/raw.stx +3 -0
  23. package/dist/templates/blocks/containers/tip.stx +6 -0
  24. package/dist/templates/blocks/containers/warning.stx +6 -0
  25. package/dist/templates/blocks/inline/code.stx +1 -0
  26. package/dist/templates/blocks/inline/del.stx +1 -0
  27. package/dist/templates/blocks/inline/em.stx +1 -0
  28. package/dist/templates/blocks/inline/mark.stx +1 -0
  29. package/dist/templates/blocks/inline/strong.stx +1 -0
  30. package/dist/templates/blocks/inline/sub.stx +1 -0
  31. package/dist/templates/blocks/inline/sup.stx +1 -0
  32. package/dist/templates/features.stx +20 -0
  33. package/dist/templates/hero.stx +10 -0
  34. package/dist/templates/layout-doc.stx +157 -0
  35. package/dist/templates/layout-home.stx +23 -0
  36. package/dist/templates/page-toc.stx +267 -0
  37. package/dist/templates/sidebar-section.stx +42 -0
  38. package/dist/templates/sidebar.stx +54 -0
  39. package/dist/themes/bun/index.d.ts +34 -0
  40. package/dist/themes/index.d.ts +24 -0
  41. package/dist/themes/vitepress/base.css +549 -0
  42. package/dist/themes/vitepress/code-group.css +121 -0
  43. package/dist/themes/vitepress/custom-block.css +330 -0
  44. package/dist/themes/vitepress/index.d.ts +29 -0
  45. package/dist/themes/vitepress/index.ts +1963 -0
  46. package/dist/themes/vitepress/vars.css +436 -0
  47. package/dist/types.d.ts +85 -2
  48. package/package.json +30 -18
  49. package/dist/chunk-he6c5f4e.js +0 -1354
  50. package/dist/plugin.d.ts +0 -0
@@ -0,0 +1,8 @@
1
+ // @bun
2
+ import{a as $,b as I,c as f,d as h,f as x}from"./chunk-16hpnayn.js";import{i as _}from"./chunk-nt1zw6bf.js";import{join as D}from"path";var Y="@stacksjs/ts-cloud";function E(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 v(j={}){let A=await _,k=A.cloud||{},m=j.verbose??A.verbose??!1,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=E(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(`
3
+ 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(`
4
+ Deploying with CloudFormation...`),L)console.log(`Using external DNS provider: ${G.provider}`);let q;if(L&&B){let R={siteName:K,region:w,domain:B,bucket:O,stackName:P,certificateArn:Q,cacheControl:V,defaultRootObject:"index.html",errorDocument:"404.html",sourceDir:X,dnsProvider:G,tags:{Project:"BunPress",Environment:k.environment||"production"},onProgress:Z(z,m)},{deployStaticSiteWithExternalDnsFull:T}=await import(Y);q=await T(R)}else{let R={siteName:K,region:w,bucket:O,domain:B,subdomain:M,baseDomain:N,stackName:P,hostedZoneId:U,certificateArn:Q,cacheControl:V,defaultRootObject:"index.html",errorDocument:"404.html",sourceDir:X,tags:{Project:"BunPress",Environment:k.environment||"production"},onProgress:Z(z,m)},{deployStaticSiteFull:T}=await import(Y);q=await T(R)}if(!q.success){if(!m)z.fail("Deployment failed");return I(q.message),!1}if(console.log(`
5
+ `+"=".repeat(50)),$("Deployment complete!"),console.log("=".repeat(50)),console.log(`
6
+ CloudFormation Stack: ${q.stackName}`),console.log(`S3 Bucket: ${q.bucket}`),q.distributionId)console.log(`CloudFront Distribution: ${q.distributionId}`),console.log(`CloudFront Domain: ${q.distributionDomain}`);if(q.filesUploaded)console.log(`Files Uploaded: ${q.filesUploaded}`);if(L)console.log(`DNS Provider: ${G.provider}`);if(q.domain)console.log(`
7
+ Your site: https://${q.domain}`);else if(q.distributionDomain)console.log(`
8
+ Your site: https://${q.distributionDomain}`);return!0}catch(H){if(!m)z.fail("Deployment failed");if(I(H.message),m&&H.stack)console.error(H.stack);return!1}}function Z(j,A){return(k,m)=>{if(A)console.log(`[${k}] ${m||""}`);else switch(k){case"infrastructure":j.text=m||"Deploying CloudFormation stack...",j.start();break;case"upload":if(m?.startsWith("Uploading"))j.text=m;break;case"invalidate":j.text="Invalidating CloudFront cache...";break;case"complete":j.succeed("Deployment complete!");break}}}export{v as deployCommand};