boltdocs 2.9.0 → 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/{cache-C2PiGyg8.cjs → cache-B19MLTpN.cjs} +1 -1
- package/dist/{cache-DFW4R3S0.mjs → cache-CfhOTR3Q.mjs} +1 -1
- 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-BPWGa2W3.mjs +6 -0
- package/dist/config-CnmfjOE4.cjs +6 -0
- package/dist/config-D7ERJhqe.cjs +7 -0
- package/dist/csp-CUAEgrxR.mjs +6 -0
- package/dist/csp-DbbF3R9Q.cjs +6 -0
- package/dist/doctor-A17UhTRn.cjs +7 -0
- package/dist/{parser-DJoEF96Y.cjs → doctor-BL6c8x2Q.cjs} +1 -1
- package/dist/doctor-hKOBLhBF.mjs +7 -0
- package/dist/errors-C0Hx15Ag.mjs +6 -0
- package/dist/errors-Dx6JHoKE.cjs +6 -0
- package/dist/{doctor-wsPTzt8Y.mjs → handler-eNNcucnf.mjs} +1 -1
- package/dist/headers-DBzZ9yC6.mjs +6 -0
- package/dist/headers-DuCAOgYX.cjs +6 -0
- 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/{meta-loader-By22EnYa.mjs → meta-loader-CD3Yptr5.mjs} +1 -1
- package/dist/{meta-loader-D0V6oOQt.cjs → meta-loader-CjphwtS7.cjs} +1 -1
- package/dist/node/cli-entry.cjs +9 -3
- package/dist/node/cli-entry.mjs +9 -3
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +8 -278
- package/dist/node/index.d.mts +9 -280
- 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-CVw_u5VT.cjs +6 -0
- package/dist/{package-BK_82QLX.mjs → package-D6O7a8qA.mjs} +1 -1
- package/dist/parser-8u0xHVc7.mjs +6 -0
- package/dist/{doctor-Bknon8f5.cjs → parser-CHsNUEhU.cjs} +1 -1
- package/dist/parser-CLtGv_XH.cjs +6 -0
- package/dist/plugin-CHa0IT49.mjs +61 -0
- package/dist/plugin-Dqj9plKB.cjs +61 -0
- package/dist/routes-B2joDAlC.cjs +6 -0
- package/dist/routes-BTx0ngdX.mjs +6 -0
- package/dist/{routes-CKgGAy8P.mjs → routes-Bm0CQvyL.mjs} +1 -1
- package/dist/{routes-C6Kr2HFN.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/dist/{shiki-adapter-CUtj-xKv.cjs → shiki-adapter-BB71nVsG.cjs} +1 -1
- package/dist/{handler-B31cxNw0.mjs → shiki-adapter-CL-IQwKI.cjs} +1 -1
- package/dist/shiki-adapter-CxTLkjew.mjs +6 -0
- package/dist/{shiki-adapter-F-P-lDon.mjs → shiki-adapter-rQ087Lx3.mjs} +1 -1
- package/dist/types-generator-BRyf4o9F.mjs +26 -0
- package/dist/types-generator-BqNKCbrx.cjs +26 -0
- package/dist/types-generator-Cu2jQP-V.mjs +6 -0
- package/dist/utils-BWy_8ASj.cjs +7 -0
- package/dist/utils-DexBrwiP.mjs +7 -0
- package/dist/{worker-pool-DRv8ef4z.mjs → worker-pool-v6tW2MDQ.mjs} +1 -1
- package/package.json +6 -1
- package/dist/doctor-BY1tSmQd.mjs +0 -34
- package/dist/doctor-DcFLi4t1.cjs +0 -34
- package/dist/node-DV-EPtMU.mjs +0 -160
- package/dist/node-vOVNRABe.cjs +0 -160
- package/dist/package-OxKE0p6j.cjs +0 -6
- package/dist/parser-C2Pw18LY.cjs +0 -6
- package/dist/parser-DScG_PTs.mjs +0 -6
- package/dist/routes--LYHSHT7.cjs +0 -6
- package/dist/routes-BAsfsn_e.mjs +0 -6
- package/dist/shiki-adapter-EZptJAmW.mjs +0 -6
- package/dist/shiki-adapter-PQBl32AN.cjs +0 -6
- package/dist/utils-DC4Wq-S2.mjs +0 -7
- package/dist/utils-wHud9ny5.cjs +0 -7
- /package/dist/{generator-DILs0EFN.mjs → generator-BaSvGlxR.mjs} +0 -0
- /package/dist/{generator-BEIF6MOx.cjs → generator-DsajVrDx.cjs} +0 -0
- /package/dist/{handler-Djy0HfsI.cjs → handler-1LRMYeI4.cjs} +0 -0
- /package/dist/{handler-DfhH9D1b.mjs → handler-CyIBbZdb.mjs} +0 -0
- /package/dist/{worker-pool-BS1LX67P.cjs → worker-pool-CgOMozUz.cjs} +0 -0
package/dist/node/cli-entry.mjs
CHANGED
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
* Copyright (c) 2026 Jesus Alcala
|
|
5
5
|
* Licensed under the MIT License.
|
|
6
6
|
*/
|
|
7
|
-
import{
|
|
8
|
-
`+
|
|
9
|
-
`
|
|
7
|
+
import{S as e,b as t,n}from"../node-FkxzriO7.mjs";import{n as r}from"../config-BCqkPkjC.mjs";import{a as i}from"../cache-CfhOTR3Q.mjs";import{createRequire as a}from"node:module";import o from"node:path";import s from"node:fs";import{colors as c,configure as l,double as u,error as d,info as f,padCenter as p,success as m,table as h,warn as g}from"@bdocs/dui";import _ from"node:fs/promises";import{createServer as v}from"@bdocs/ssg/node";import y from"cac";import b from"node:os";import{fileURLToPath as x}from"node:url";import{preview as S}from"vite";function C(e){let t=e;for(;t&&t!==o.dirname(t);){if(s.existsSync(o.join(t,`.git`))||s.existsSync(o.join(t,`pnpm-workspace.yaml`)))return t;t=o.dirname(t)}t=e;let n=e;for(;t&&t!==o.dirname(t);)s.existsSync(o.join(t,`package.json`))&&(n=t),t=o.dirname(t);return n}let w=C(process.cwd());function T(e){if(!e)return;let t;if(typeof e==`string`)t=e;else if(e instanceof URL){if(e.protocol!==`file:`)return;t=e.pathname}else if(Buffer.isBuffer(e))t=e.toString();else return;let n=o.resolve(w,t),r=o.relative(w,n),i=r.startsWith(`..`)||o.isAbsolute(r),a=n.split(o.sep),s=a.some(e=>e.startsWith(`.env`)),c=a.some((e,t)=>{if(e===`node_modules`){let e=a[t+1];return!e||!e.startsWith(`.`)}return!1});if(i||s||c)throw Error(`[Boltdocs Security] Write/delete operation blocked on path: "${n}". Modifications are restricted to the project root, and cannot access .env or non-cache node_modules folders.`)}function E(e){return e==null?!1:typeof e==`number`?e!==0:typeof e==`string`?e.includes(`w`)||e.includes(`a`)||e.includes(`+`):!0}function D(){let e=s.writeFile;s.writeFile=((t,...n)=>{try{T(t)}catch(e){let t=n[n.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return e.call(s,t,...n)});let t=s.writeFileSync;s.writeFileSync=(e,...n)=>(T(e),t.call(s,e,...n));let n=s.rm;s.rm=((e,...t)=>{try{T(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return n.call(s,e,...t)});let r=s.rmSync;s.rmSync=(e,...t)=>(T(e),r.call(s,e,...t));let i=s.unlink;s.unlink=((e,...t)=>{try{T(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return i.call(s,e,...t)});let a=s.unlinkSync;s.unlinkSync=(e,...t)=>(T(e),a.call(s,e,...t));let o=s.mkdir;s.mkdir=((e,...t)=>{try{T(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return o.call(s,e,...t)});let c=s.mkdirSync;s.mkdirSync=(e,...t)=>(T(e),c.call(s,e,...t));let l=s.rmdir;s.rmdir=((e,...t)=>{try{T(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return l.call(s,e,...t)});let u=s.rmdirSync;s.rmdirSync=(e,...t)=>(T(e),u.call(s,e,...t));let d=s.appendFile;s.appendFile=((e,...t)=>{try{T(e)}catch(e){let n=t[t.length-1];if(typeof n==`function`){process.nextTick(()=>n(e));return}throw e}return d.call(s,e,...t)});let f=s.appendFileSync;s.appendFileSync=(e,...t)=>(T(e),f.call(s,e,...t));let p=s.copyFile;s.copyFile=((e,t,...n)=>{try{T(e),T(t)}catch(e){let t=n[n.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return p.call(s,e,t,...n)});let m=s.copyFileSync;s.copyFileSync=(e,t,...n)=>(T(e),T(t),m.call(s,e,t,...n));let h=s.rename;s.rename=((e,t,...n)=>{try{T(e),T(t)}catch(e){let t=n[n.length-1];if(typeof t==`function`){process.nextTick(()=>t(e));return}throw e}return h.call(s,e,t,...n)});let g=s.renameSync;s.renameSync=(e,t,...n)=>(T(e),T(t),g.call(s,e,t,...n));let v=s.createWriteStream;s.createWriteStream=(e,...t)=>(T(e),v.call(s,e,...t));let y=s.open;s.open=((e,t,...n)=>{if(E(typeof t==`function`?void 0:t))try{T(e)}catch(e){let r=n[n.length-1],i=typeof t==`function`?t:typeof r==`function`?r:void 0;if(i){process.nextTick(()=>i(e));return}throw e}return y.call(s,e,t,...n)});let b=s.openSync;s.openSync=(e,t,...n)=>(E(t)&&T(e),b.call(s,e,t,...n));let x=e=>{if(!e)return;let t=e.writeFile;t&&(e.writeFile=async(n,...r)=>(T(n),t.call(e,n,...r)));let n=e.rm;n&&(e.rm=async(t,...r)=>(T(t),n.call(e,t,...r)));let r=e.mkdir;r&&(e.mkdir=async(t,...n)=>(T(t),r.call(e,t,...n)));let i=e.rmdir;i&&(e.rmdir=async(t,...n)=>(T(t),i.call(e,t,...n)));let a=e.unlink;a&&(e.unlink=async(t,...n)=>(T(t),a.call(e,t,...n)));let o=e.appendFile;o&&(e.appendFile=async(t,...n)=>(T(t),o.call(e,t,...n)));let s=e.copyFile;s&&(e.copyFile=async(t,n,...r)=>(T(t),T(n),s.call(e,t,n,...r)));let c=e.rename;c&&(e.rename=async(t,n,...r)=>(T(t),T(n),c.call(e,t,n,...r)));let l=e.open;l&&(e.open=async(t,n,...r)=>(E(n)&&T(t),l.call(e,t,n,...r)))};x(s.promises),x(_)}function O(e,t){let n=t?` ${c.green(`➜`)} ${c.green(`Network:`)} ${c.cyan(t)}`:` ${c.green(`➜`)} ${c.green(`Network:`)} ${c.gray(`use --host to expose`)}`;return`
|
|
8
|
+
`+u([` ${c.green(`➜`)} ${c.green(`Local:`)} ${c.cyan(e)}`,n,``,` ${c.dim(`press h + enter for help`)}`],{title:`boltdocs dev server`})+`
|
|
9
|
+
`}function k(e,t){let n=t?` ${c.green(`➜`)} ${c.green(`Network:`)} ${c.cyan(t)}`:` ${c.green(`➜`)} ${c.green(`Network:`)} ${c.gray(`use --host to expose`)}`;return`
|
|
10
|
+
`+u([` ${c.green(`➜`)} ${c.green(`Local:`)} ${c.cyan(e)}`,n],{title:`boltdocs preview server`})+`
|
|
11
|
+
`}function A(e,t){return`
|
|
12
|
+
`+u([p(`🚀 Update available!`,50),``,` ${c.dim(`Current:`)} ${c.red(e)} ${c.gray(`→`)} ${c.green(t)}`,``,` ${c.dim(`Run:`)} ${c.bold(`npm install boltdocs@latest`)}`])+`
|
|
13
|
+
`}const j=a(import.meta.url);function M(e,t){let n=e.split(`-`)[0].split(`.`).map(Number),r=t.split(`-`)[0].split(`.`).map(Number);for(let e=0;e<Math.max(n.length,r.length);e++){let t=n[e]??0,i=r[e]??0;if(Number.isNaN(t)||Number.isNaN(i))return!1;if(t!==i)return t>i}return!1}async function N(){try{let e=new AbortController,t=setTimeout(()=>e.abort(),2e3),n=await fetch(`https://registry.npmjs.org/boltdocs/latest`,{signal:e.signal,headers:{Accept:`application/vnd.npm.install-v1+json`}});return clearTimeout(t),n.ok?(await n.json()).version??null:null}catch{return null}}async function P(){try{let e=x(import.meta.url),t=o.dirname(e);for(let e=0;e<5;e++){let e=o.join(t,`package.json`);if(s.existsSync(e)){let t=JSON.parse(s.readFileSync(e,`utf-8`));if(t.name===`boltdocs`)return t.version}t=o.dirname(t)}}catch{}try{return j(`boltdocs/package.json`).version}catch{return`0.0.0`}}async function F(){let e=``;try{e=o.join(b.homedir(),`.boltdocs`,`update-check.json`)}catch{return}let t=0;try{if(s.existsSync(e)){let n=JSON.parse(s.readFileSync(e,`utf-8`));t=Number(n.lastCheck)||0}}catch{}let n=Date.now();if(n-t<864e5)return;try{s.mkdirSync(o.dirname(e),{recursive:!0}),s.writeFileSync(e,JSON.stringify({lastCheck:n}),`utf-8`)}catch{}let r=await P();if(r===`0.0.0`)return;let i=await N();i&&M(i,r)&&console.log(A(r,i))}let I=!1;async function L(t=process.cwd(),i={}){if(I)return;I=!0,F();let a;try{a=await r(o.resolve(t,`docs`),t),e(a,t)}catch{}try{let e=await n(t,`development`,a);e.logLevel=`warn`,e.clearScreen=!1,i.port!==void 0&&(e.server=e.server||{},e.server.port=Number(i.port)),i.host!==void 0&&(e.server=e.server||{},e.server.host=i.host),i.force&&(e.optimizeDeps=e.optimizeDeps||{},e.optimizeDeps.force=!0);let r=await v(e);await r.listen();let o=r.resolvedUrls;console.log(O(o?.local?.[0]??`http://localhost:${i.port??5173}`,o?.network?.[0]??null)),r.bindCLIShortcuts({print:!1})}catch(e){d(`Failed to start dev server:`,e),process.exit(1)}}async function R(e=process.cwd()){F();try{let n=await t().run({root:e,timing:{}});n.success||(d(`Build failed at step "${n.failedStep}":`,n.error),await i(),process.exit(1)),console.log(u([`SSG build completed in ${(Math.round(n.timing.total)/1e3).toFixed(1)}s`,``,`${c.cyan(`boltdocs`)} documentation is ready at ${c.green(`dist/`)}`])),await i(),process.exit(0)}catch(e){d(`Build failed:`,e),await i(),process.exit(1)}}async function z(e=process.cwd(),t={}){try{let r=await n(e,`production`);r.logLevel=`warn`,r.clearScreen=!1,t.port!==void 0&&(r.preview=r.preview||{},r.preview.port=Number(t.port)),t.host!==void 0&&(r.preview=r.preview||{},r.preview.host=t.host);let i=(await S(r)).resolvedUrls;console.log(k(i?.local?.[0]??`http://localhost:${t.port??4173}`,i?.network?.[0]??null))}catch(e){d(`Failed to start preview server:`,e),process.exit(1)}}function B(e){let t=[];if(!s.existsSync(e))return t;try{let n=s.readdirSync(e);for(let r of n){let n=o.join(e,r);s.statSync(n).isDirectory()?r!==`node_modules`&&r!==`.git`&&r!==`dist`&&r!==`coverage`&&t.push(...B(n)):/\.(js|mjs|cjs|ts|tsx|jsx)$/.test(r)&&t.push(n)}}catch{}return t}async function V(e=process.cwd()){f(`Starting static security audit of Boltdocs plugins...`);let t;try{t=await r(o.resolve(e,`docs`),e)}catch(e){d(`Failed to load Boltdocs configuration for audit:`,e),process.exit(1)}let n=t.plugins||[];if(n.length===0){m(`No plugins configured. Nothing to audit.`);return}let i=[];for(let t of n){if(!t.name)continue;let n=null;try{let{createRequire:r}=await import(`node:module`),i=r(o.resolve(e,`package.json`)).resolve(`${t.name}/package.json`);n=o.dirname(i)}catch{let r=o.resolve(e,`node_modules`,t.name);s.existsSync(r)&&(n=r)}if(!n){i.push({name:c.cyan(t.name),status:c.red(`❓ Unresolved`),details:`Could not locate plugin files in node_modules.`});continue}let r=B(n),a=[];for(let e of r)try{let t=s.readFileSync(e,`utf-8`);t.includes(`fetch(`)&&a.push(`fetch`),t.includes(`axios`)&&a.push(`axios`),t.includes(`http.request`)&&a.push(`http.request`),t.includes(`https.request`)&&a.push(`https.request`),t.includes(`process.env`)&&a.push(`process.env`)}catch{}let l=Array.from(new Set(a));l.length>0?i.push({name:c.cyan(t.name),status:c.yellow(`⚠️ Warning`),details:`Contains network/env accesses: ${c.bold(l.join(`, `))}. Ensure you trust the author.`}):i.push({name:c.cyan(t.name),status:c.green(`✅ Clean`),details:`No external network calls or env accesses detected.`})}let a=[`Plugin`,`Status`,`Audit Notes`],l=i.map(e=>[e.name,e.status,e.details]);console.log(`
|
|
14
|
+
`+h(a,l)+`
|
|
15
|
+
`),i.some(e=>e.status.includes(`Warning`))?g(`⚠️ One or more plugins have security warnings. Review the flags above.`):m(`✓ All plugins passed the static security check!`)}const{emitWarning:H}=process;process.emitWarning=function(e,...t){if(!(e&&typeof e==`object`&&e.code===`DEP0205`)&&!(typeof e==`string`&&t.includes(`DEP0205`)))return Reflect.apply(H,process,[e,...t])},D(),l({prefix:`boltdocs`});const U=y(`boltdocs`);U.command(`dev [root]`,`Start development server`).option(`--port <port>`,`Port to listen on`).option(`--host [host]`,`Host to bind to`).option(`--force`,`Force Vite to re-optimize dependencies`).action(L),U.command(`[root]`,`Start development server`).option(`--port <port>`,`Port to listen on`).option(`--host [host]`,`Host to bind to`).option(`--force`,`Force Vite to re-optimize dependencies`).action(L),U.command(`build [root]`,`Build for production`).action(R),U.command(`preview [root]`,`Preview production build`).option(`--port <port>`,`Port to listen on`).option(`--host [host]`,`Host to bind to`).action(z),U.command(`audit [root]`,`Audit configured plugins for security warnings`).action(V),U.command(`doctor [root]`,`Check the health of your documentation`).option(`--fix`,`Automatically fix broken internal links and sync translations`).option(`--check-external`,`Verify external links (slower)`).option(`--init`,`Initialize doctor.json with default configuration`).option(`--budget`,`Check build performance against configured budgets`).action(async(e,t)=>{let{doctorAction:n}=await import(`../doctor-hKOBLhBF.mjs`).then(e=>e.t);await n(e,t)}),U.command(`generate-changelog <file>`,`Generate changelog documentation from CHANGELOG.md`).option(`-o, --output <path>`,`Output folder (default: docs/changelog)`,{default:`docs/changelog`}).option(`-t, --title <text>`,`Title for changelog pages`,{default:`Changelog`}).option(`--infer-tab`,`Infer tab from folder name (default: true)`,{default:!0}).option(`-l, --limit <number>`,`Limit number of versions to generate`).action(async(e,t)=>{let{generateChangelog:n}=await import(`../generator-BaSvGlxR.mjs`);await n(e,{output:t.output,title:t.title,inferTab:t.inferTab,limit:t.limit?parseInt(String(t.limit),10):void 0})}),U.help(),U.version(`2.0.0`),U.parse();export{F as t};
|
package/dist/node/index.cjs
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../chunk-Ds5LZdWN.cjs`);const e=require(`../utils-
|
|
6
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../chunk-Ds5LZdWN.cjs`);const e=require(`../utils-BWy_8ASj.cjs`),t=require(`../node-B-I15rGR.cjs`),n=require(`../config-D7ERJhqe.cjs`),r=require(`../cache-B19MLTpN.cjs`),i=require(`../shiki-adapter-BB71nVsG.cjs`),a=require(`../handler-1LRMYeI4.cjs`),o=require(`../adapters-uGz-UKQa.cjs`);let s=require(`unist-util-visit`);exports.AssetCache=r.n,exports.BoltdocsPluginStore=t.S,exports.EXIT=s.EXIT,exports.MDX_NODES=i.o,exports.PluginCompatibilityError=t.C,exports.PluginError=t.w,exports.PluginHookError=t.T,exports.PluginLifecycleManager=t._,exports.PluginValidationError=t.E,exports.SKIP=s.SKIP,exports.addNodeClass=t.i,exports.createMdxAttribute=t.a,exports.createMdxElement=t.o,exports.createPlugin=t.r,exports.createRehypeElement=t.s,exports.createViteConfig=t.n,exports.default=t.t,exports.defineConfig=n.a,exports.flushCache=r.a,exports.generateEntryCode=t.D,exports.getNodeProperty=t.c,exports.handleAwsFeedback=o.t,exports.handleFeedback=a.t,exports.handleNetlifyFeedback=o.r,exports.handleVercelFeedback=o.i,exports.handleWebFeedback=o.n,exports.hasNodeClass=t.l,exports.normalizePath=e.u,exports.parseMetaString=i.r,exports.removeNodeClass=t.u,exports.resolveConfig=n.n,exports.sanitizeFilename=e.f,exports.setNodeProperty=t.d,exports.validatePlugins=t.x,exports.visitMdxElements=t.f,exports.visitNodes=t.p,exports.visitRehypeElements=t.m,exports.visitRemarkHeadings=t.h,exports.visitRemarkLinks=t.g;
|
package/dist/node/index.d.cts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
|
|
2
|
+
import { i as handleVercelFeedback, n as handleWebFeedback, r as handleNetlifyFeedback, t as handleAwsFeedback } from "../index-aWC0KjDF.cjs";
|
|
2
3
|
import { InlineConfig, Plugin } from "vite";
|
|
3
4
|
import { EXIT, SKIP } from "unist-util-visit";
|
|
4
|
-
import { VercelRequest, VercelResponse } from "@vercel/node";
|
|
5
|
-
import { HandlerEvent, HandlerResponse } from "@netlify/functions";
|
|
6
|
-
import { Writable } from "node:stream";
|
|
7
5
|
//#region src/shared/types.d.ts
|
|
8
6
|
/**
|
|
9
7
|
* Represents a single social link in the configuration.
|
|
@@ -236,7 +234,7 @@ interface BoltdocsIntegrationsConfig {
|
|
|
236
234
|
/**
|
|
237
235
|
* The root configuration object for Boltdocs.
|
|
238
236
|
*/
|
|
239
|
-
interface BoltdocsConfig
|
|
237
|
+
interface BoltdocsConfig {
|
|
240
238
|
siteUrl?: string;
|
|
241
239
|
docsDir?: string;
|
|
242
240
|
base?: string;
|
|
@@ -282,7 +280,7 @@ type BoltdocsRoutePathWithFallback = BoltdocsRoutePath extends never ? string :
|
|
|
282
280
|
*
|
|
283
281
|
* @param config - The Boltdocs configuration object
|
|
284
282
|
*/
|
|
285
|
-
declare function defineConfig(config: BoltdocsConfig
|
|
283
|
+
declare function defineConfig(config: BoltdocsConfig): BoltdocsConfig;
|
|
286
284
|
//#endregion
|
|
287
285
|
//#region src/node/config.d.ts
|
|
288
286
|
/**
|
|
@@ -293,7 +291,7 @@ declare function defineConfig(config: BoltdocsConfig$1): BoltdocsConfig$1;
|
|
|
293
291
|
* @param root - The project root directory (defaults to process.cwd())
|
|
294
292
|
* @returns The merged configuration object
|
|
295
293
|
*/
|
|
296
|
-
declare function resolveConfig(docsDir: string, root?: string): Promise<BoltdocsConfig
|
|
294
|
+
declare function resolveConfig(docsDir: string, root?: string): Promise<BoltdocsConfig>;
|
|
297
295
|
//#endregion
|
|
298
296
|
//#region src/node/plugin/types.d.ts
|
|
299
297
|
/**
|
|
@@ -313,7 +311,7 @@ interface BoltdocsPluginOptions {
|
|
|
313
311
|
* @param config - The resolved Boltdocs configuration containing custom plugins and components
|
|
314
312
|
* @returns A string of JavaScript code to be evaluated by the browser
|
|
315
313
|
*/
|
|
316
|
-
declare function generateEntryCode(options: BoltdocsPluginOptions, config?: BoltdocsConfig
|
|
314
|
+
declare function generateEntryCode(options: BoltdocsPluginOptions, config?: BoltdocsConfig): string;
|
|
317
315
|
//#endregion
|
|
318
316
|
//#region src/node/routes/types.d.ts
|
|
319
317
|
/**
|
|
@@ -419,7 +417,7 @@ declare function flushCache(): Promise<void>;
|
|
|
419
417
|
//#endregion
|
|
420
418
|
//#region src/node/plugins/plugin-types.d.ts
|
|
421
419
|
interface PluginContext {
|
|
422
|
-
readonly config: BoltdocsConfig
|
|
420
|
+
readonly config: BoltdocsConfig;
|
|
423
421
|
readonly logger: PluginLogger;
|
|
424
422
|
readonly store: PluginStore;
|
|
425
423
|
readonly meta: PluginMeta;
|
|
@@ -537,7 +535,7 @@ declare class PluginLifecycleManager {
|
|
|
537
535
|
private store;
|
|
538
536
|
private docsDir;
|
|
539
537
|
private rootDir;
|
|
540
|
-
constructor(plugins: SecureBoltdocsPlugin[], config: BoltdocsConfig
|
|
538
|
+
constructor(plugins: SecureBoltdocsPlugin[], config: BoltdocsConfig, docsDir?: string, rootDir?: string);
|
|
541
539
|
runHook(hookName: keyof PluginLifecycleHooks, ...args: unknown[]): Promise<void>;
|
|
542
540
|
runChain<TParams>(hookName: keyof PluginLifecycleHooks, initialParams: TParams): Promise<TParams>;
|
|
543
541
|
private getSortedPlugins;
|
|
@@ -729,274 +727,6 @@ declare const MDX_NODES: {
|
|
|
729
727
|
//#region src/node/plugins/index.d.ts
|
|
730
728
|
declare function createPlugin(plugin: SecureBoltdocsPlugin): SecureBoltdocsPlugin;
|
|
731
729
|
//#endregion
|
|
732
|
-
//#region src/node/feedback/adapters/vercel.d.ts
|
|
733
|
-
declare function handleVercelFeedback(req: VercelRequest, res: VercelResponse): Promise<VercelResponse | undefined>;
|
|
734
|
-
//#endregion
|
|
735
|
-
//#region src/node/feedback/adapters/netlify.d.ts
|
|
736
|
-
declare function handleNetlifyFeedback(event: HandlerEvent, env?: Record<string, string | undefined>): Promise<HandlerResponse>;
|
|
737
|
-
//#endregion
|
|
738
|
-
//#region src/node/feedback/adapters/web.d.ts
|
|
739
|
-
declare function handleWebFeedback(request: Request, env?: Record<string, string | undefined>): Promise<Response>;
|
|
740
|
-
//#endregion
|
|
741
|
-
//#region ../../node_modules/.pnpm/@types+aws-lambda@8.10.161/node_modules/@types/aws-lambda/common/api-gateway.d.ts
|
|
742
|
-
// Default authorizer type, prefer using a specific type with the "...WithAuthorizer..." variant types.
|
|
743
|
-
// Note that this doesn't have to be a context from a custom lambda outhorizer, AWS also has a cognito
|
|
744
|
-
// authorizer type and could add more, so the property won't always be a string.
|
|
745
|
-
type APIGatewayEventDefaultAuthorizerContext = undefined | null | {
|
|
746
|
-
[name: string]: any;
|
|
747
|
-
};
|
|
748
|
-
// The requestContext property of both request authorizer and proxy integration events.
|
|
749
|
-
interface APIGatewayEventRequestContextWithAuthorizer<TAuthorizerContext> {
|
|
750
|
-
accountId: string;
|
|
751
|
-
apiId: string; // This one is a bit confusing: it is not actually present in authorizer calls
|
|
752
|
-
// and proxy calls without an authorizer. We model this by allowing undefined in the type,
|
|
753
|
-
// since it ends up the same and avoids breaking users that are testing the property.
|
|
754
|
-
// This lets us allow parameterizing the authorizer for proxy events that know what authorizer
|
|
755
|
-
// context values they have.
|
|
756
|
-
authorizer: TAuthorizerContext;
|
|
757
|
-
connectedAt?: number | undefined;
|
|
758
|
-
connectionId?: string | undefined;
|
|
759
|
-
domainName?: string | undefined;
|
|
760
|
-
domainPrefix?: string | undefined;
|
|
761
|
-
eventType?: string | undefined;
|
|
762
|
-
extendedRequestId?: string | undefined;
|
|
763
|
-
protocol: string;
|
|
764
|
-
httpMethod: string;
|
|
765
|
-
identity: APIGatewayEventIdentity;
|
|
766
|
-
messageDirection?: string | undefined;
|
|
767
|
-
messageId?: string | null | undefined;
|
|
768
|
-
path: string;
|
|
769
|
-
stage: string;
|
|
770
|
-
requestId: string;
|
|
771
|
-
requestTime?: string | undefined;
|
|
772
|
-
requestTimeEpoch: number;
|
|
773
|
-
resourceId: string;
|
|
774
|
-
resourcePath: string;
|
|
775
|
-
routeKey?: string | undefined;
|
|
776
|
-
}
|
|
777
|
-
interface APIGatewayEventClientCertificate {
|
|
778
|
-
clientCertPem: string;
|
|
779
|
-
serialNumber: string;
|
|
780
|
-
subjectDN: string;
|
|
781
|
-
issuerDN: string;
|
|
782
|
-
validity: {
|
|
783
|
-
notAfter: string;
|
|
784
|
-
notBefore: string;
|
|
785
|
-
};
|
|
786
|
-
}
|
|
787
|
-
interface APIGatewayEventIdentity {
|
|
788
|
-
accessKey: string | null;
|
|
789
|
-
accountId: string | null;
|
|
790
|
-
apiKey: string | null;
|
|
791
|
-
apiKeyId: string | null;
|
|
792
|
-
caller: string | null;
|
|
793
|
-
clientCert: APIGatewayEventClientCertificate | null;
|
|
794
|
-
cognitoAuthenticationProvider: string | null;
|
|
795
|
-
cognitoAuthenticationType: string | null;
|
|
796
|
-
cognitoIdentityId: string | null;
|
|
797
|
-
cognitoIdentityPoolId: string | null;
|
|
798
|
-
principalOrgId: string | null;
|
|
799
|
-
sourceIp: string;
|
|
800
|
-
user: string | null;
|
|
801
|
-
userAgent: string | null;
|
|
802
|
-
userArn: string | null;
|
|
803
|
-
vpcId?: string | undefined;
|
|
804
|
-
vpceId?: string | undefined;
|
|
805
|
-
}
|
|
806
|
-
//#endregion
|
|
807
|
-
//#region ../../node_modules/.pnpm/@types+aws-lambda@8.10.161/node_modules/@types/aws-lambda/handler.d.ts
|
|
808
|
-
/**
|
|
809
|
-
* {@link Handler} context parameter.
|
|
810
|
-
* See {@link https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html AWS documentation}.
|
|
811
|
-
*/
|
|
812
|
-
interface Context {
|
|
813
|
-
callbackWaitsForEmptyEventLoop: boolean;
|
|
814
|
-
functionName: string;
|
|
815
|
-
functionVersion: string;
|
|
816
|
-
invokedFunctionArn: string;
|
|
817
|
-
memoryLimitInMB: string;
|
|
818
|
-
awsRequestId: string;
|
|
819
|
-
logGroupName: string;
|
|
820
|
-
logStreamName: string;
|
|
821
|
-
identity?: CognitoIdentity | undefined;
|
|
822
|
-
clientContext?: ClientContext | undefined;
|
|
823
|
-
tenantId?: string | undefined;
|
|
824
|
-
getRemainingTimeInMillis(): number; // Functions for compatibility with earlier Node.js Runtime v0.10.42
|
|
825
|
-
// No longer documented, so they are deprecated, but they still work
|
|
826
|
-
// as of the 12.x runtime, so they are not removed from the types.
|
|
827
|
-
/** @deprecated Use handler callback or promise result */
|
|
828
|
-
done(error?: Error, result?: any): void;
|
|
829
|
-
/** @deprecated Use handler callback with first argument or reject a promise result */
|
|
830
|
-
fail(error: Error | string): void;
|
|
831
|
-
/** @deprecated Use handler callback with second argument or resolve a promise result */
|
|
832
|
-
succeed(messageOrObject: any): void; // Unclear what behavior this is supposed to have, I couldn't find any still extant reference,
|
|
833
|
-
// and it behaves like the above, ignoring the object parameter.
|
|
834
|
-
/** @deprecated Use handler callback or promise result */
|
|
835
|
-
succeed(message: string, object: any): void;
|
|
836
|
-
}
|
|
837
|
-
interface CognitoIdentity {
|
|
838
|
-
cognitoIdentityId: string;
|
|
839
|
-
cognitoIdentityPoolId: string;
|
|
840
|
-
}
|
|
841
|
-
interface ClientContext {
|
|
842
|
-
client: ClientContextClient;
|
|
843
|
-
custom?: any;
|
|
844
|
-
env: ClientContextEnv;
|
|
845
|
-
}
|
|
846
|
-
interface ClientContextClient {
|
|
847
|
-
installationId: string;
|
|
848
|
-
appTitle: string;
|
|
849
|
-
appVersionName: string;
|
|
850
|
-
appVersionCode: string;
|
|
851
|
-
appPackageName: string;
|
|
852
|
-
}
|
|
853
|
-
interface ClientContextEnv {
|
|
854
|
-
platformVersion: string;
|
|
855
|
-
platform: string;
|
|
856
|
-
make: string;
|
|
857
|
-
model: string;
|
|
858
|
-
locale: string;
|
|
859
|
-
}
|
|
860
|
-
/**
|
|
861
|
-
* Interface for using response streaming from AWS Lambda.
|
|
862
|
-
* To indicate to the runtime that Lambda should stream your function’s responses, you must wrap your function handler with the `awslambda.streamifyResponse()` decorator.
|
|
863
|
-
*
|
|
864
|
-
* The `streamifyResponse` decorator accepts the following additional parameter, `responseStream`, besides the default node handler parameters, `event`, and `context`.
|
|
865
|
-
* The new `responseStream` object provides a stream object that your function can write data to. Data written to this stream is sent immediately to the client. You can optionally set the Content-Type header of the response to pass additional metadata to your client about the contents of the stream.
|
|
866
|
-
*
|
|
867
|
-
* {@link https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/ AWS blog post}
|
|
868
|
-
* {@link https://docs.aws.amazon.com/lambda/latest/dg/config-rs-write-functions.html AWS documentation}
|
|
869
|
-
*
|
|
870
|
-
* @example <caption>Writing to the response stream</caption>
|
|
871
|
-
* import 'aws-lambda';
|
|
872
|
-
*
|
|
873
|
-
* export const handler = awslambda.streamifyResponse(
|
|
874
|
-
* async (event, responseStream, context) => {
|
|
875
|
-
* responseStream.setContentType("text/plain");
|
|
876
|
-
* responseStream.write("Hello, world!");
|
|
877
|
-
* responseStream.end();
|
|
878
|
-
* }
|
|
879
|
-
* );
|
|
880
|
-
*
|
|
881
|
-
* @example <caption>Using pipeline</caption>
|
|
882
|
-
* import 'aws-lambda';
|
|
883
|
-
* import { Readable } from 'stream';
|
|
884
|
-
* import { pipeline } from 'stream/promises';
|
|
885
|
-
* import zlib from 'zlib';
|
|
886
|
-
*
|
|
887
|
-
* export const handler = awslambda.streamifyResponse(
|
|
888
|
-
* async (event, responseStream, context) => {
|
|
889
|
-
* // As an example, convert event to a readable stream.
|
|
890
|
-
* const requestStream = Readable.from(Buffer.from(JSON.stringify(event)));
|
|
891
|
-
*
|
|
892
|
-
* await pipeline(requestStream, zlib.createGzip(), responseStream);
|
|
893
|
-
* }
|
|
894
|
-
* );
|
|
895
|
-
*/
|
|
896
|
-
type StreamifyHandler<TEvent = any, TResult = any> = (event: TEvent, responseStream: awslambda.HttpResponseStream, context: Context) => TResult | Promise<TResult>;
|
|
897
|
-
declare global {
|
|
898
|
-
namespace awslambda {
|
|
899
|
-
class HttpResponseStream extends Writable {
|
|
900
|
-
static from(writable: Writable, metadata: Record<string, unknown>): HttpResponseStream;
|
|
901
|
-
setContentType: (contentType: string) => void;
|
|
902
|
-
}
|
|
903
|
-
/**
|
|
904
|
-
* Decorator for using response streaming from AWS Lambda.
|
|
905
|
-
* To indicate to the runtime that Lambda should stream your function’s responses, you must wrap your function handler with the `awslambda.streamifyResponse()` decorator.
|
|
906
|
-
*
|
|
907
|
-
* The `streamifyResponse` decorator accepts the following additional parameter, `responseStream`, besides the default node handler parameters, `event`, and `context`.
|
|
908
|
-
* The new `responseStream` object provides a stream object that your function can write data to. Data written to this stream is sent immediately to the client. You can optionally set the Content-Type header of the response to pass additional metadata to your client about the contents of the stream.
|
|
909
|
-
*
|
|
910
|
-
* {@link https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/ AWS blog post}
|
|
911
|
-
* {@link https://docs.aws.amazon.com/lambda/latest/dg/config-rs-write-functions.html AWS documentation}
|
|
912
|
-
*
|
|
913
|
-
* @example <caption>Writing to the response stream</caption>
|
|
914
|
-
* import 'aws-lambda';
|
|
915
|
-
*
|
|
916
|
-
* export const handler = awslambda.streamifyResponse(
|
|
917
|
-
* async (event, responseStream, context) => {
|
|
918
|
-
* responseStream.setContentType("text/plain");
|
|
919
|
-
* responseStream.write("Hello, world!");
|
|
920
|
-
* responseStream.end();
|
|
921
|
-
* }
|
|
922
|
-
* );
|
|
923
|
-
*
|
|
924
|
-
* @example <caption>Using pipeline</caption>
|
|
925
|
-
* import 'aws-lambda';
|
|
926
|
-
* import { Readable } from 'stream';
|
|
927
|
-
* import { pipeline } from 'stream/promises';
|
|
928
|
-
* import zlib from 'zlib';
|
|
929
|
-
*
|
|
930
|
-
* export const handler = awslambda.streamifyResponse(
|
|
931
|
-
* async (event, responseStream, context) => {
|
|
932
|
-
* // As an example, convert event to a readable stream.
|
|
933
|
-
* const requestStream = Readable.from(Buffer.from(JSON.stringify(event)));
|
|
934
|
-
*
|
|
935
|
-
* await pipeline(requestStream, zlib.createGzip(), responseStream);
|
|
936
|
-
* }
|
|
937
|
-
* );
|
|
938
|
-
*/
|
|
939
|
-
function streamifyResponse<TEvent = any, TResult = void>(handler: StreamifyHandler<TEvent, TResult>): StreamifyHandler<TEvent, TResult>;
|
|
940
|
-
}
|
|
941
|
-
}
|
|
942
|
-
//#endregion
|
|
943
|
-
//#region ../../node_modules/.pnpm/@types+aws-lambda@8.10.161/node_modules/@types/aws-lambda/trigger/api-gateway-proxy.d.ts
|
|
944
|
-
/**
|
|
945
|
-
* Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
|
|
946
|
-
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
|
947
|
-
*/
|
|
948
|
-
type APIGatewayProxyEvent = APIGatewayProxyEventBase<APIGatewayEventDefaultAuthorizerContext>;
|
|
949
|
-
interface APIGatewayProxyEventHeaders {
|
|
950
|
-
[name: string]: string | undefined;
|
|
951
|
-
}
|
|
952
|
-
interface APIGatewayProxyEventMultiValueHeaders {
|
|
953
|
-
[name: string]: string[] | undefined;
|
|
954
|
-
}
|
|
955
|
-
interface APIGatewayProxyEventPathParameters {
|
|
956
|
-
[name: string]: string | undefined;
|
|
957
|
-
}
|
|
958
|
-
interface APIGatewayProxyEventQueryStringParameters {
|
|
959
|
-
[name: string]: string | undefined;
|
|
960
|
-
}
|
|
961
|
-
interface APIGatewayProxyEventMultiValueQueryStringParameters {
|
|
962
|
-
[name: string]: string[] | undefined;
|
|
963
|
-
}
|
|
964
|
-
interface APIGatewayProxyEventStageVariables {
|
|
965
|
-
[name: string]: string | undefined;
|
|
966
|
-
}
|
|
967
|
-
interface APIGatewayProxyEventBase<TAuthorizerContext> {
|
|
968
|
-
body: string | null;
|
|
969
|
-
headers: APIGatewayProxyEventHeaders;
|
|
970
|
-
multiValueHeaders: APIGatewayProxyEventMultiValueHeaders;
|
|
971
|
-
httpMethod: string;
|
|
972
|
-
isBase64Encoded: boolean;
|
|
973
|
-
path: string;
|
|
974
|
-
pathParameters: APIGatewayProxyEventPathParameters | null;
|
|
975
|
-
queryStringParameters: APIGatewayProxyEventQueryStringParameters | null;
|
|
976
|
-
multiValueQueryStringParameters: APIGatewayProxyEventMultiValueQueryStringParameters | null;
|
|
977
|
-
stageVariables: APIGatewayProxyEventStageVariables | null;
|
|
978
|
-
requestContext: APIGatewayEventRequestContextWithAuthorizer<TAuthorizerContext>;
|
|
979
|
-
resource: string;
|
|
980
|
-
}
|
|
981
|
-
/**
|
|
982
|
-
* Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
|
|
983
|
-
* @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
|
984
|
-
*/
|
|
985
|
-
interface APIGatewayProxyResult {
|
|
986
|
-
statusCode: number;
|
|
987
|
-
headers?: {
|
|
988
|
-
[header: string]: boolean | number | string;
|
|
989
|
-
} | undefined;
|
|
990
|
-
multiValueHeaders?: {
|
|
991
|
-
[header: string]: Array<boolean | number | string>;
|
|
992
|
-
} | undefined;
|
|
993
|
-
body: string;
|
|
994
|
-
isBase64Encoded?: boolean | undefined;
|
|
995
|
-
}
|
|
996
|
-
//#endregion
|
|
997
|
-
//#region src/node/feedback/adapters/aws.d.ts
|
|
998
|
-
declare function handleAwsFeedback(event: APIGatewayProxyEvent, env?: Record<string, string | undefined>): Promise<APIGatewayProxyResult>;
|
|
999
|
-
//#endregion
|
|
1000
730
|
//#region src/node/feedback/handler.d.ts
|
|
1001
731
|
interface FeedbackHandlerOptions {
|
|
1002
732
|
owner?: string;
|
|
@@ -1037,4 +767,4 @@ declare function boltdocs(options?: BoltdocsPluginOptions): Promise<Plugin[]>;
|
|
|
1037
767
|
*/
|
|
1038
768
|
declare function createViteConfig(root: string, mode?: 'development' | 'production', preResolvedConfig?: BoltdocsConfig): Promise<InlineConfig>;
|
|
1039
769
|
//#endregion
|
|
1040
|
-
export { AssetCache, type BoltdocsConfig
|
|
770
|
+
export { AssetCache, type BoltdocsConfig, type BoltdocsPlugin, type BoltdocsPluginOptions, BoltdocsPluginStore, type BoltdocsThemeConfig, EXIT, MDX_NODES, NodeWithHProperties, PluginCompatibilityError, PluginContext, PluginError, PluginHookError, PluginLifecycleHooks, PluginLifecycleManager, PluginLogger, PluginMeta, PluginStore, PluginValidationError, type RouteMeta, SKIP, SecureBoltdocsPlugin, addNodeClass, createMdxAttribute, createMdxElement, createPlugin, createRehypeElement, createViteConfig, boltdocs as default, defineConfig, flushCache, generateEntryCode, getNodeProperty, handleAwsFeedback, handleFeedback, handleNetlifyFeedback, handleVercelFeedback, handleWebFeedback, hasNodeClass, normalizePath, parseMetaString, removeNodeClass, resolveConfig, sanitizeFilename, setNodeProperty, validatePlugins, visitMdxElements, visitNodes, visitRehypeElements, visitRemarkHeadings, visitRemarkLinks };
|