@stacksjs/bunpress 0.1.11 → 0.1.12
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.d.ts +26 -0
- package/dist/bin/cli.js +1 -1
- package/dist/bin/commands/clean.d.ts +9 -0
- package/dist/bin/commands/config.d.ts +15 -0
- package/dist/bin/commands/doctor.d.ts +7 -0
- package/dist/bin/commands/init.d.ts +9 -0
- package/dist/bin/commands/new.d.ts +9 -0
- package/dist/bin/commands/preview.d.ts +11 -0
- package/dist/bin/commands/seo.d.ts +7 -0
- package/dist/bin/commands/stats.d.ts +8 -0
- package/dist/bin/utils.d.ts +83 -0
- package/dist/{chunk-0sfpwr5e.js → chunk-b99gqcxe.js} +1 -1
- package/dist/{chunk-sregzvcv.js → chunk-jxdbykx2.js} +5 -5
- package/dist/chunk-mch0qmg4.js +688 -0
- package/dist/{chunk-zdvnysqn.js → chunk-w17epehd.js} +2 -2
- package/dist/{chunk-semwkmam.js → chunk-z0v4c8zz.js} +1 -1
- package/dist/src/index.js +1 -1
- package/dist/{themes → src/themes}/bun/index.d.ts +1 -0
- package/dist/{themes → src/themes}/index.d.ts +3 -6
- package/dist/src/themes/vitepress/index.d.ts +33 -0
- package/dist/{types.d.ts → src/types.d.ts} +10 -0
- package/dist/templates/sidebar-section.stx +1 -1
- package/package.json +4 -4
- package/dist/chunk-rfaz4x5j.js +0 -658
- package/dist/themes/vitepress/index.d.ts +0 -210
- /package/dist/{config.d.ts → src/config.d.ts} +0 -0
- /package/dist/{data-loader.d.ts → src/data-loader.d.ts} +0 -0
- /package/dist/{highlighter.d.ts → src/highlighter.d.ts} +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{robots.d.ts → src/robots.d.ts} +0 -0
- /package/dist/{rss.d.ts → src/rss.d.ts} +0 -0
- /package/dist/{serve.d.ts → src/serve.d.ts} +0 -0
- /package/dist/{sitemap.d.ts → src/sitemap.d.ts} +0 -0
- /package/dist/{stx-components.d.ts → src/stx-components.d.ts} +0 -0
- /package/dist/{template-loader.d.ts → src/template-loader.d.ts} +0 -0
- /package/dist/{toc.d.ts → src/toc.d.ts} +0 -0
|
@@ -7452,7 +7452,7 @@ if (document.readyState === 'loading') {
|
|
|
7452
7452
|
else {
|
|
7453
7453
|
initToc()
|
|
7454
7454
|
}
|
|
7455
|
-
`}async function wZ(Q,Z){let $=Q.themeConfig?.sidebar||Q.markdown?.sidebar;if(!$)return"";let Y=[];if(Array.isArray($))Y=$;else if(typeof $==="object"){let q=Object.keys($).sort((K,X)=>X.length-K.length).find((K)=>Z.startsWith(K))||"/";Y=$[q]||[]}let J=await Promise.all(Y.map(async(O)=>{let q=O.items?O.items.map((K)=>{let X=K.link||"/",z=VQ(Q,X);return`<li><a class="${X===Z||K.link===Z?"BPSidebarItem-link is-active":"BPSidebarItem-link"}" href="${z}">${K.text}</a></li>`}).join(""):"";return await v("sidebar-section",{title:O.text,items:q})}));return await v("sidebar",{sections:J.join("")})}async function DZ(Q){let Z=/<h([2-6])([^>]*)>(.*?)<\/h\1>/g,$=[],Y;while((Y=Z.exec(Q))!==null){let O=Number.parseInt(Y[1]),q=Y[2],K=Y[3];K=K.replace(/<[^>]*>/g,"");let X=q.match(/id="([^"]*)"/),z=X?X[1]:K.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"");$.push({level:O,text:K,id:z})}if($.length===0)return"";let J=$.map((O)=>{let q=O.level>2?`level-${O.level}`:"";return`<a href="#${O.id}" class="${q}">${O.text}</a>`}).join(`
|
|
7455
|
+
`}async function wZ(Q,Z){let $=Q.themeConfig?.sidebar||Q.markdown?.sidebar;if(!$)return"";let Y=[];if(Array.isArray($))Y=$;else if(typeof $==="object"){let q=Object.keys($).sort((K,X)=>X.length-K.length).find((K)=>Z.startsWith(K))||"/";Y=$[q]||[]}let J=await Promise.all(Y.map(async(O)=>{let q=O.items?O.items.map((K)=>{let X=K.link||"/",z=VQ(Q,X);return`<li><a class="${X===Z||K.link===Z?"BPSidebarItem-link is-active":"BPSidebarItem-link"}" href="${z}">${K.text}</a></li>`}).join(""):"";return await v("sidebar-section",{title:O.text,items:q,collapsedClass:O.collapsed?" collapsed":""})}));return await v("sidebar",{sections:J.join("")})}async function DZ(Q){let Z=/<h([2-6])([^>]*)>(.*?)<\/h\1>/g,$=[],Y;while((Y=Z.exec(Q))!==null){let O=Number.parseInt(Y[1]),q=Y[2],K=Y[3];K=K.replace(/<[^>]*>/g,"");let X=q.match(/id="([^"]*)"/),z=X?X[1]:K.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"");$.push({level:O,text:K,id:z})}if($.length===0)return"";let J=$.map((O)=>{let q=O.level>2?`level-${O.level}`:"";return`<a href="#${O.id}" class="${q}">${O.text}</a>`}).join(`
|
|
7456
7456
|
`);return await v("page-toc",{items:J})}function TZ(Q){return Q.replace(/<h([1-6])([^>]*)>(.*?)<\/h\1>/g,(Z,$,Y,J)=>{if(Y.includes("id="))return Z;let O=J.match(/\s*\{#([\w-]+)\}\s*$/),q,K=J;if(O)q=O[1],K=J.replace(/\s*\{#[\w-]+\}\s*$/,"");else q=J.replace(/<[^>]*>/g,"").toLowerCase().replace(/\//g,"-").replace(/\s+/g,"-").replace(/[^\w-]/g,"").replace(/-+/g,"-").replace(/^-+|-+$/g,"");return`<h${$}${Y} id="${q}">${K}</h${$}>`})}function qQ(Q){let Z=LZ(),$=Q.lastIndexOf("</body>");if($===-1)return Q+Z;return Q.slice(0,$)+Z+Q.slice($)}function KQ(Q,Z){if(!Z)return Q;let $=Q.lastIndexOf("</body>");if($===-1)return Q+Z;return Q.slice(0,$)+Z+Q.slice($)}function LZ(){return`<script data-bp-router="1">
|
|
7457
7457
|
(function(){
|
|
7458
7458
|
if (history.scrollRestoration) history.scrollRestoration = 'manual';
|
|
@@ -7795,7 +7795,7 @@ ${K}
|
|
|
7795
7795
|
${X}
|
|
7796
7796
|
${o}
|
|
7797
7797
|
${z}
|
|
7798
|
-
${_}`,a=await v("layout-doc",{htmlClass:p,themeMode:S,title:J,description:O,meta:I,customCSS:m,nav:L,sidebar:R,content:H,pageTOC:D});return _Q(qQ(KQ(a,w)),Z)}var s=null,hQ=!1;async function xZ(){if(hQ)return s;hQ=!0;try{s=await import("./chunk-
|
|
7798
|
+
${_}`,a=await v("layout-doc",{htmlClass:p,themeMode:S,title:J,description:O,meta:I,customCSS:m,nav:L,sidebar:R,content:H,pageTOC:D});return _Q(qQ(KQ(a,w)),Z)}var s=null,hQ=!1;async function xZ(){if(hQ)return s;hQ=!0;try{s=await import("./chunk-mch0qmg4.js")}catch{s=null}return s}async function zQ(Q){let Z=await xZ();if(!Z)return"";let Y=new Z.Scanner([]).scanContent(Q);if(Y.size===0)return"";let J=new Z.CSSGenerator(Z.defaultConfig);for(let O of Y)J.generate(O);return J.toCSS(!1,!1)}function CZ(Q){if(!Q.fathom?.enabled||!Q.fathom?.siteId)return"";let Z=Q.fathom.scriptUrl||"https://cdn.usefathom.com/script.js",$=Q.fathom.defer!==!1,Y=Q.fathom.honorDNT||!1,J=Q.fathom.auto!==!1,O=Q.fathom.canonical,q=Q.fathom.spa||!1,K=[`data-site="${Q.fathom.siteId}"`,Y?'data-honor-dnt="true"':"",!J?'data-auto="false"':"",O?`data-canonical="${O}"`:"",q?'data-spa="auto"':""].filter(Boolean).join(" ");return`<script src="${Z}" ${K}${$?" defer":""}></script>`}function uZ(Q){let Z=Q.analytics||Q.selfHostedAnalytics;if(!Z?.enabled||!Z?.siteId)return"";let $=dQ(Z.siteId),Y=Z.apiEndpoint?dQ(Z.apiEndpoint):"",J=Z.honorDNT?`var dnt=n.doNotTrack||w.doNotTrack||n.msDoNotTrack;if(dnt==="1"||dnt==="yes"||dnt===true){l('DNT enabled, skipping');return;}`:"",O=Z.trackHashChanges?"w.addEventListener('hashchange',function(){pv();});":"",q=Z.trackOutboundLinks?`d.addEventListener('click',function(e){try{var a=e.target.closest('a');if(a&&a.hostname&&a.hostname!==location.hostname){t('outbound',{url:a.href,text:(a.textContent||'').slice(0,100)});}}
|
|
7799
7799
|
catch (err){l('Outbound error',err);}});`:"",K=Y?` data-api="${Y}"`:"";return`<!-- ts-analytics: privacy-first analytics -->
|
|
7800
7800
|
<script data-site="${$}"${K} defer>
|
|
7801
7801
|
(function(){
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{E as $,F as I,G as f,H as h,J as x}from"./chunk-
|
|
2
|
+
import{E as $,F as I,G as f,H as h,J as x}from"./chunk-jxdbykx2.js";import"./chunk-ss6yzy9f.js";import{Q as _}from"./chunk-e5q66hsy.js";import"./chunk-w6byd4st.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
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
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
5
|
`+"=".repeat(50)),$("Deployment complete!"),console.log("=".repeat(50)),console.log(`
|
package/dist/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{A as d,B as f,C as a,D as g,a as O,b as P,c as Q,d as S,e as T,f as V,g as W,h as X,i as Y,j as Z,k as _,l as $,m as b,n as v,o as x,p as A,q as F,r as R,s as U,t as m,u as C,v as h,w as l,x as y,y as p,z as c}from"../chunk-
|
|
2
|
+
import{A as d,B as f,C as a,D as g,a as O,b as P,c as Q,d as S,e as T,f as V,g as W,h as X,i as Y,j as Z,k as _,l as $,m as b,n as v,o as x,p as A,q as F,r as R,s as U,t as m,u as C,v as h,w as l,x as y,y as p,z as c}from"../chunk-w17epehd.js";import{K as j,L as k,M as q,N as u,O as w}from"../chunk-ss6yzy9f.js";import{P as L,Q as M,R as N}from"../chunk-e5q66hsy.js";import"../chunk-w6byd4st.js";export{d as wrapInLayout,c as stripConfiguredBasePath,a as startServer,g as serveCLI,O as resetHighlighter,C as processInlineTocSyntax,W as prewarmHighlighter,P as normalizeLanguage,f as markdownToHtml,Q as isLanguageSupported,T as highlightCodeSync,S as highlightCode,V as getSyntaxHighlightingStyles,X as getHighlighterInstance,p as getConfiguredBasePath,N as getConfig,_ as generateUniqueSlug,l as generateTocStyles,y as generateTocScripts,m as generateTocPositions,x as generateTocHtml,U as generateTocData,Z as generateSlug,w as generateSitemap,F as generateSidebarTocHtml,k as generateRssFeed,q as generateRobotsTxt,A as generateInlineTocHtml,R as generateFloatingTocHtml,v as filterHeadings,$ as extractHeadings,h as enhanceHeadingsWithAnchors,Y as defaultTocConfig,L as defaultConfig,M as config,b as buildTocHierarchy,u as buildSitemap,j as buildRssFeed};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import bunTheme, { getBunThemeCSS } from './bun';
|
|
2
|
-
import vitePressTheme, { getVitePressThemeCSS } from './vitepress';
|
|
1
|
+
import bunTheme, { getBunThemeCSS } from './bun/index';
|
|
2
|
+
import vitePressTheme, { getVitePressThemeCSS } from './vitepress/index';
|
|
3
3
|
/**
|
|
4
4
|
* Get theme CSS by name
|
|
5
5
|
*/
|
|
@@ -7,10 +7,7 @@ export declare function getThemeCSS(themeName?: ThemeName): string;
|
|
|
7
7
|
/**
|
|
8
8
|
* Available themes
|
|
9
9
|
*/
|
|
10
|
-
export declare const themes:
|
|
11
|
-
vitepress: unknown;
|
|
12
|
-
bun: unknown
|
|
13
|
-
};
|
|
10
|
+
export declare const themes: Record<ThemeName, Theme>;
|
|
14
11
|
/**
|
|
15
12
|
* Default theme name
|
|
16
13
|
*/
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get all VitePress theme CSS combined
|
|
3
|
+
*/
|
|
4
|
+
export declare function getVitePressThemeCSS(): string;
|
|
5
|
+
/**
|
|
6
|
+
* Get VitePress theme CSS variables only
|
|
7
|
+
*/
|
|
8
|
+
export declare function getVitePressVars(): string;
|
|
9
|
+
/**
|
|
10
|
+
* Get VitePress base styles only
|
|
11
|
+
*/
|
|
12
|
+
export declare function getVitePressBase(): string;
|
|
13
|
+
/**
|
|
14
|
+
* Get VitePress custom block styles only
|
|
15
|
+
*/
|
|
16
|
+
export declare function getVitePressCustomBlocks(): string;
|
|
17
|
+
/**
|
|
18
|
+
* Get VitePress code group styles only
|
|
19
|
+
*/
|
|
20
|
+
export declare function getVitePressCodeGroups(): string;
|
|
21
|
+
// Layout / chrome styles — classes referenced by layout-doc.stx, layout-page.stx, layout-home.stx,
|
|
22
|
+
// and the nav/sidebar generators in serve.ts. Keeps templates declarative and dark-mode aware.
|
|
23
|
+
export declare const layoutCSS: string;
|
|
24
|
+
declare const vitePressTheme: VitePressTheme;
|
|
25
|
+
export declare interface VitePressTheme {
|
|
26
|
+
name: string
|
|
27
|
+
getCSS: () => string
|
|
28
|
+
getVars: () => string
|
|
29
|
+
getBase: () => string
|
|
30
|
+
getCustomBlocks: () => string
|
|
31
|
+
getCodeGroups: () => string
|
|
32
|
+
}
|
|
33
|
+
export default vitePressTheme;
|
|
@@ -94,6 +94,7 @@ export declare interface SidebarItem {
|
|
|
94
94
|
text: string
|
|
95
95
|
link?: string
|
|
96
96
|
items?: SidebarItem[]
|
|
97
|
+
collapsed?: boolean
|
|
97
98
|
}
|
|
98
99
|
/**
|
|
99
100
|
* Navigation bar item
|
|
@@ -246,6 +247,15 @@ export declare interface SearchResult {
|
|
|
246
247
|
* Theme configuration
|
|
247
248
|
*/
|
|
248
249
|
export declare interface ThemeConfig {
|
|
250
|
+
logo?: string
|
|
251
|
+
footer?: {
|
|
252
|
+
message?: string
|
|
253
|
+
copyright?: string
|
|
254
|
+
}
|
|
255
|
+
socialLinks?: Array<{
|
|
256
|
+
icon: string
|
|
257
|
+
link: string
|
|
258
|
+
}>
|
|
249
259
|
colors?: {
|
|
250
260
|
primary?: string
|
|
251
261
|
secondary?: string
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div class="BPSidebarItem sidebar-section">
|
|
1
|
+
<div class="BPSidebarItem sidebar-section{{ collapsedClass }}">
|
|
2
2
|
<button class="sidebar-section-toggle" onclick="toggleSection(this.parentElement)" type="button">
|
|
3
3
|
<span>{{ title }}</span>
|
|
4
4
|
<svg class="chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/bunpress",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.12",
|
|
5
5
|
"description": "Modern documentation engine. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
"typecheck": "bun --bun tsc --noEmit"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@stacksjs/stx": "^0.2.
|
|
55
|
+
"@stacksjs/stx": "^0.2.82",
|
|
56
56
|
"@stacksjs/ts-md": "^0.1.1",
|
|
57
|
-
"@stacksjs/ts-cloud": "^0.
|
|
57
|
+
"@stacksjs/ts-cloud": "^0.7.10",
|
|
58
58
|
"bunfig": "^0.15.6"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@stacksjs/clapp": "^0.2.0",
|
|
62
62
|
"ts-syntax-highlighter": "^0.2.1",
|
|
63
|
-
"typescript": "^
|
|
63
|
+
"typescript": "^7.0.2"
|
|
64
64
|
}
|
|
65
65
|
}
|