@mintlify/cli 4.1.69 → 4.1.71
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/cli-QKHn11xT.js +672 -0
- package/dist/{config-B0nX_eFb.js → config-DpQ1d_vi.js} +7 -7
- package/dist/{config-SaSu7Qdt.js → config-fnUYdROY.js} +1 -1
- package/dist/{converter-C48XPfOX.js → converter-js78Fb8_.js} +17 -17
- package/dist/currencyMath-BHNabTeO.js +7 -0
- package/dist/dist-CMyjEKka.js +7 -0
- package/dist/dist-CmFSyH9b.js +606 -0
- package/dist/dist-DGS-P0UG.js +753 -0
- package/dist/dist-DZy8y-yD.js +7 -0
- package/dist/lib-BstlxGQb.js +7 -0
- package/dist/{multi-repo-command-q9kZjvrH.js → multi-repo-command-BghhOvrq.js} +2 -2
- package/dist/{multi-repo-command-CWv73kzj.js → multi-repo-command-DCykzR86.js} +1 -1
- package/dist/{multi-repo-config-DSgBwhUJ.js → multi-repo-config-IN7JizKN.js} +2 -2
- package/dist/multi-repo-preview-DbB27X4T.js +12 -0
- package/dist/multi-repo-setup-DGRjpipy.js +9 -0
- package/dist/remark-utils-CLJr2toS.js +7 -0
- package/dist/start.js +1 -1
- package/dist/utils-D-zUiakl.js +277 -0
- package/dist/watcher-CrrSXFeO.js +50 -0
- package/package.json +4 -4
- package/dist/cli-DffIfnA4.js +0 -672
- package/dist/currencyMath-ssJIW64e.js +0 -7
- package/dist/dist-CPrrIggp.js +0 -1339
- package/dist/dist-CszUXP_O.js +0 -7
- package/dist/lib-g4r7PSeX.js +0 -7
- package/dist/micromark-extension-mdxjs-BEBdzW1n.js +0 -83
- package/dist/multi-repo-preview-774ll-bJ.js +0 -12
- package/dist/multi-repo-setup-CloDxufU.js +0 -9
- package/dist/utils-Dps9hFB1.js +0 -201
- package/dist/watcher-DNHWA6bY.js +0 -63
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire as __mintCreateRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __mintFileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __mintDirname } from 'node:path';
|
|
4
|
+
const require = __mintCreateRequire(import.meta.url);
|
|
5
|
+
const __filename = __mintFileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __mintDirname(__filename);
|
|
7
|
+
import{f as e,g as t,i as n,l as r,n as i,o as a,t as o,u as s,y as c}from"./esm-BtDK7B-d.js";import{n as l,t as u}from"./agent-Da2kI1tZ.js";import{a as d,c as f,i as p,n as m,o as h,r as g,s as _}from"./multi-repo-config-IN7JizKN.js";import{link as v,mkdir as y,readFile as b,readdir as x,rename as S,rm as C,writeFile as w}from"node:fs/promises";import T from"node:path";import{execFile as E}from"node:child_process";import{randomUUID as D}from"node:crypto";import{promisify as O}from"node:util";function k(e,t){let n=t!==!1;return/^(y|yes)/i.test(e)?n=!0:/^(n|no)/i.test(e)&&(n=!1),n}function A(e){return e?`Yes`:`No`}var j=n((n,i)=>{let{transformer:o=A}=n,[l,u]=e(`idle`),[d,f]=e(``),p=s(n.theme),m=r({status:l,theme:p});a((e,r)=>{if(l===`idle`){if(t(e)){let e=k(d,n.default);f(o(e)),u(`done`),i(e)}else if(c(e)){let e=A(!k(d,n.default));r.clearLine(0),r.write(e),f(e)}else f(r.line)}});let h=d,g=``;return l===`done`?h=p.style.answer(d):g=` ${p.style.defaultAnswer(n.default===!1?`y/N`:`Y/n`)}`,`${m} ${p.style.message(n.message,l)}${g} ${h}`}),M=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const N={text:(e,t)=>i({message:e,default:t}),confirm:(e,t)=>j({message:e,default:t}),folder:(e,t)=>o({message:e+` (type a path to see matching folders)`,source:e=>M(void 0,void 0,void 0,function*(){let n=d(e?.trim()||t,process.cwd()),r=T.dirname(n),i=T.basename(n),a=(yield x(r,{withFileTypes:!0}).catch(()=>[])).filter(e=>e.isDirectory()&&e.name.startsWith(i)).slice(0,30).map(e=>T.join(r,e.name));return(e?.endsWith(`/`)||e?.endsWith(T.sep))&&a.push(...(yield x(n,{withFileTypes:!0}).catch(()=>[])).filter(e=>e.isDirectory()).slice(0,30).map(e=>T.join(n,e.name))),[.../* @__PURE__ */ new Set([n,...a])].map(e=>({name:e,value:e}))}),validate:e=>M(void 0,void 0,void 0,function*(){return(yield p(T.join(e,`docs.json`)))||`Select a folder containing docs.json.`})})};function P(e){return M(this,void 0,void 0,function*(){try{let{stdout:t}=yield O(E)(`git`,[`-C`,e,`config`,`--get`,`remote.origin.url`],{timeout:2e3}),n=t.trim().replace(/\.git$/,``).match(/[:/]([^/:]+\/[^/]+)$/);if(n?.[1])return n[1]}catch{}return`local/${T.basename(e)}`})}function F(e){return Array.isArray(e)?e.flatMap(F):e&&typeof e==`object`?Object.entries(e).flatMap(([e,t])=>e===`sourceRef`&&typeof t==`string`?[t]:F(t)):[]}function I(e,t){return M(this,arguments,void 0,function*(e,t,n=N){let r=(yield p(e))?yield b(e,`utf8`):void 0,i;if(r)try{i=yield _(e)}catch{console.log(`The existing config is invalid. It will remain unchanged unless you confirm a valid replacement.`)}console.log(`Choose the base repo, then secondary repos and their URL mounts. The base supplies theme and global styles.`);let a=i?.sources.find(e=>e.base),o=yield n.folder(`Base repository folder`,a?d(a.directory,T.dirname(e)):t),s=[{repo:yield n.text(`Base repository identifier (owner/repo)`,a?.repo??(yield P(o))),directory:T.relative(T.dirname(e),o)||`.`,mountPath:``,base:!0}],c=(yield h(o)).config,l=[...new Set(F(c))],u=i?.sources.filter(e=>!e.base)??[],m=0;for(;yield n.confirm(m===0?`Add a secondary repository?`:`Add another secondary repository?`,m<u.length||l.some(e=>!s.some(t=>t.repo===e)));){let t=u[m++],r=yield n.folder(`Secondary repository folder`,t?d(t.directory,T.dirname(e)):T.dirname(o)),i=t?.repo??l.find(e=>!s.some(t=>t.repo===e))??(yield P(r)),a=yield n.text(`Repository identifier (match navigation sourceRef when present)`,i),c=(yield n.text(`URL mount path (for example api serves /api)`,t?.mountPath??T.basename(r))).replace(/^\/+|\/+$/g,``);s.push({repo:a,directory:T.relative(T.dirname(e),r)||`.`,mountPath:c})}let g={sources:s};yield f(g,e),console.log(`
|
|
8
|
+
Workspace mapping:`);for(let t of s)console.log(` ${t.repo}${t.base?` (base)`:``}: ${d(t.directory,T.dirname(e))} → /${t.mountPath}`);if(!(yield n.confirm(`Save ${e} and start preview?`,!0)))throw Error(`Setup cancelled. No config was changed.`);if(yield y(T.dirname(e),{recursive:!0}),((yield p(e))?yield b(e,`utf8`):void 0)!==r)throw Error(`The config changed during setup. Nothing was overwritten; run --setup again.`);let x=`${e}.${D()}.tmp`;try{yield w(x,JSON.stringify(g,null,2)+`
|
|
9
|
+
`,{flag:`wx`}),r===void 0?yield v(x,e):yield S(x,e)}finally{yield C(x,{force:!0})}return e})}function L(e,t){return M(this,void 0,void 0,function*(){var n;let r=(yield g(e.cwd,e.workspace))??T.join(e.cwd,m);if((yield p(r))&&!e.setup)return yield f(yield _(r),r),r;let i=t||process.stdin.isTTY&&process.stdout.isTTY&&!u()&&!l();if(e.nonInteractive||!i)throw Error(`${e.setup?`--setup requires an interactive human terminal.`:`No local multi-repo config found at ${r}.`} Create or update ${r}, then run mint dev --multi-repo --workspace "${r}" --non-interactive. Run mint dev --multi-repo --help for the complete example and field explanations.`);let a=yield I(r,e.cwd,t);return(n=e.onSaved)==null||n.call(e,a),a})}export{I as configureWorkspace,L as resolveWorkspace};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __mintCreateRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __mintFileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __mintDirname } from 'node:path';
|
|
4
|
+
const require = __mintCreateRequire(import.meta.url);
|
|
5
|
+
const __filename = __mintFileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __mintDirname(__filename);
|
|
7
|
+
import{at as e,ct as t,m as n,p as r}from"./utils-D-zUiakl.js";`${Math.random().toString(36).slice(2)}${Math.random().toString(36).slice(2)}`;function i(e){if(!t(e)||!Array.isArray(e.body))return;let[r]=e.body;if(n(r)===`ExpressionStatement`&&t(r))return r.expression}const a=e=>[...new Set(e.map(e=>e.trim()))],o=e=>e.every(e=>typeof e==`string`),s=e=>Array.isArray(e)?e:[e];function c(t){if(Array.isArray(t)){if(t.length===0||!e(t)||!o(t))return;let n=a(t);return e(n)?n:void 0}let n=[t];if(!e(n)||o(n))return;let[r]=n.map(({includes:e,excludes:t})=>Object.assign(Object.assign({},e&&{includes:a(e)}),t&&{excludes:a(t)}));return r&&e([r])?r:void 0}function l(e){if(!t(e)||Object.keys(e).length!==1)return;let n=c(e.groups);return n&&{groups:n}}function u(e){return(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&e.name===`Visibility`}const d=[`humans`,`agents`,`signed-in`,`signed-out`];function f(e){return d.some(t=>t===e)}function p(e){let t=(e.data?.estree)?.body[0];return t?.type===`ExpressionStatement`?t.expression:void 0}function m(e){switch(e?.type){case`Literal`:return typeof e.value==`string`?e.value:void 0;case`TemplateLiteral`:{let t=e.quasis[0]?.value.cooked??void 0;for(let[n,r]of e.expressions.entries()){let i=m(r),a=e.quasis[n+1]?.value.cooked;if(t===void 0||i===void 0||a==null)return;t+=i+a}return t}case`BinaryExpression`:{if(e.operator!==`+`)return;let t=m(e.left),n=m(e.right);return t===void 0||n===void 0?void 0:t+n}default:return}}function h(e){if(!(e.type!==`Property`||e.computed))return e.key.type===`Identifier`?e.key.name:e.key.type===`Literal`&&typeof e.key.value==`string`?e.key.value:void 0}function g(e){let t=e.elements.map(e=>m(e));return t.every(e=>e!==void 0)?t:void 0}function _(e){let t={};for(let n of e.properties){let e=h(n);if(n.type!==`Property`||e!==`includes`&&e!==`excludes`)return;let r=n.value.type===`ArrayExpression`?g(n.value):void 0;if(!r)return;t[e]=r}return t}function v(e){let t=p(e);if(t?.type!==`ObjectExpression`||t.properties.length!==1)return;let[n]=t.properties;if(n?.type===`Property`&&h(n)===`groups`)return n.value.type===`ObjectExpression`?c(_(n.value)):n.value.type===`ArrayExpression`?c(g(n.value)):void 0}function y(e){if(e.type!==`mdxJsxExpressionAttribute`)return!1;let t=p(e),n=t?.type===`ObjectExpression`&&t.properties.length===1?t.properties[0]:void 0;return n?.type!==`SpreadElement`||n.argument.type!==`ObjectExpression`||n.argument.properties.some(e=>{if(e.type!==`Property`||e.computed)return!0;let t=e.key.type===`Identifier`?e.key.name:void 0,n=e.key.type===`Literal`?e.key.value:void 0;return(t??n)===`for`})}function b(e,t=/* @__PURE__ */ new Map,n){let a,o=!1,s=e.attributes.findLastIndex(e=>e.type===`mdxJsxAttribute`&&e.name===`for`);if(e.attributes.slice(s+1).some(y))return{kind:`dynamic`};for(let c of s===-1?[]:e.attributes.slice(s,s+1))if(c.type===`mdxJsxAttribute`&&c.name===`for`){if(typeof c.value==`string`){if(f(c.value))return{kind:`audience`,audience:c.value};a??=c.value}else if(c.value&&typeof c.value==`object`){if(`value`in c.value&&typeof c.value.value==`string`){let e=c.value.value.trim(),t=m(p(c.value));if(t!==void 0){if(f(t))return{kind:`audience`,audience:t};a??=t;continue}let n=e.match(/^(["'`])((?:\\.|(?!\1)[^\\])*)\1$/);if(n){let e=n[2]??``;if(!(n[1]==="`"&&e.includes("${"))){if(f(e))return{kind:`audience`,audience:e};a??=e;continue}}let r=v(c.value);if(r)return{kind:`groups`,groups:r};if(p(c.value)?.type===`ObjectExpression`||e.startsWith(`{`)){a??=e;continue}}let e=i(`data`in c.value?c.value.data?.estree:void 0),s=r(e,{scope:t});if(s.ok){let t=s.value;if(f(t)){let i={kind:`audience`,audience:t};if(n===void 0||S(i))return i;let a=r(e,{scope:n});if(a.ok&&a.value===t)return i;o=!0;continue}let i=l(t);if(i)return{kind:`groups`,groups:i.groups};if(typeof t==`string`){a??=t;continue}}o=!0}}return a===void 0?o?{kind:`dynamic`}:{kind:`missing`}:{kind:`invalid`,raw:a}}function x(e){switch(e.kind){case`audience`:return e.audience===`agents`;case`groups`:return!1;case`invalid`:case`missing`:return!0;case`dynamic`:return!1}}function S(e){switch(e.kind){case`audience`:return e.audience===`humans`||e.audience===`signed-in`;case`groups`:case`invalid`:case`dynamic`:case`missing`:return!0}}function C(e){if(e.kind===`groups`)return{groups:e.groups};if(e.kind===`audience`&&(e.audience===`signed-in`||e.audience===`signed-out`))return e.audience}const w=(e,t)=>({type:`mdxJsxAttribute`,name:e,value:t});function T(e,t){let n=e.data,r=n&&`mintlifyTitleMarkdown`in n?n.mintlifyTitleMarkdown:void 0;return r&&typeof r==`object`&&`text`in r&&typeof r.text==`string`?r.text:t}const E=[],D=(e,t=1,n=E)=>{if(`name`in e&&e.name===`Update`)return e.attributes.find(e=>`name`in e&&e.name===`label`&&typeof e.value==`string`)?.value??``;if(u(e)){let t=b(e);if(!(t.kind===`dynamic`||t.kind===`audience`&&t.audience===`humans`))return``}let r=n[t-1],i=e.type===`text`,a=e.type===`inlineCode`,o=r?.type!==`mdxJsxFlowElement`,s=r&&`value`in r&&typeof r.value==`string`&&!r.value.startsWith(`<small`);if(a||i&&(o||s))return e.value;if(`children`in e&&Array.isArray(e.children)){let t=``;return e.children.forEach((e,n,r)=>{t+=D(e,n,r)}),t}return``};export{u as a,s as c,x as i,D as n,b as o,T as r,C as s,w as t};
|
package/dist/start.js
CHANGED
|
@@ -5,4 +5,4 @@ import { dirname as __mintDirname } from 'node:path';
|
|
|
5
5
|
const require = __mintCreateRequire(import.meta.url);
|
|
6
6
|
const __filename = __mintFileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __mintDirname(__filename);
|
|
8
|
-
import{r as e}from"./client-DXQ6Tgw0.js";var t=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function n(e,n=e=>process.exit(e)){let r;return i=>(r??=t(this,void 0,void 0,function*(){try{yield e()}catch(e){return console.error(`Preview cleanup failed:`,e),n(1)}return n(i)}),r)}var r=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const i=process.env.MINTLIFY_PACKAGE_NAME??`mint`;let a;function o(){return r(this,void 0,void 0,function*(){let e=a;a=void 0,yield e?.()})}function s(){return r(this,void 0,void 0,function*(){let e=process.argv.slice(2);if(e.some(e=>[`--multi-repo`,`--workspace`,`--setup`,`--non-interactive`].includes(e.split(`=`)[0]??``))){let{isMultiRepoDev:t,runMultiRepoDev:n}=yield import(`./multi-repo-command-
|
|
8
|
+
import{r as e}from"./client-DXQ6Tgw0.js";var t=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function n(e,n=e=>process.exit(e)){let r;return i=>(r??=t(this,void 0,void 0,function*(){try{yield e()}catch(e){return console.error(`Preview cleanup failed:`,e),n(1)}return n(i)}),r)}var r=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const i=process.env.MINTLIFY_PACKAGE_NAME??`mint`;let a;function o(){return r(this,void 0,void 0,function*(){let e=a;a=void 0,yield e?.()})}function s(){return r(this,void 0,void 0,function*(){let e=process.argv.slice(2);if(e.some(e=>[`--multi-repo`,`--workspace`,`--setup`,`--non-interactive`].includes(e.split(`=`)[0]??``))){let{isMultiRepoDev:t,runMultiRepoDev:n}=yield import(`./multi-repo-command-DCykzR86.js`);if(t(e)){yield n(e,i,e=>{a=e},()=>c(0));return}}let{cli:t}=yield import(`./cli-QKHn11xT.js`);yield t({packageName:i})})}s().catch(e=>r(void 0,void 0,void 0,function*(){console.error(e instanceof Error?e.message:e),yield c(1)}));const c=n(()=>r(void 0,void 0,void 0,function*(){try{yield o()}finally{yield e()}}));process.once(`beforeExit`,()=>r(void 0,void 0,void 0,function*(){try{yield o(),yield e()}catch{}})),process.on(`SIGINT`,()=>{c(130)}),process.on(`SIGTERM`,()=>{c(143)});export{};
|