@mintlify/cli 4.1.34 → 4.1.36
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/start.js +1 -1
- package/package.json +11 -11
package/dist/start.js
CHANGED
|
@@ -2316,7 +2316,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2316
2316
|
`)}function R6t(e){return S9(this,void 0,void 0,function*(){return new Promise(t=>setTimeout(t,e))})}function z6t(e,t,n){return S9(this,void 0,void 0,function*(){let r=Date.now()+A6t;for(;Date.now()<r;){yield R6t(3e3),n?.();let r=yield x9(e);if(r&&(t===null||new Date(r.computedAt).getTime()>new Date(t).getTime()))return r}throw Error(`Score did not complete within ${A6t/1e3}s`)})}function B6t(){return S9(this,void 0,void 0,function*(){let e=N1(`subdomain`);if(e)return e;let t=yield x1();if(t)return(yield R1(t))[0]})}const V6t=e=>S9(void 0,void 0,void 0,function*(){let t=j6t(e);try{let n=e.url;if(!n){let e=yield B6t();if(!e)throw Error("No URL provided and no default subdomain set. Run `mint login` to set one, or pass a URL: `mint score <url>`.");n=`${e}.mintlify.site`}t===`table`&&OH((0,R.jsx)(vH,{message:`Checking agent readiness...`}));let r=yield k6t(n),i;if(r.status===`ready`){let e=yield x9(r.slug);if(t===`table`&&NH(),!e)throw Error(`Score was unexpectedly unavailable`);i=e}else if(r.status===`stale_refresh_queued`){let e=yield x9(r.slug);if(t===`table`&&NH(),!e)throw Error(`Stale score was unexpectedly unavailable`);t===`table`?(C9(`table`,L6t(e,{stale:!0})),OH((0,R.jsx)(vH,{message:`Refreshing score in the background...`}))):process.stderr.write(`Refreshing score in the background...
|
|
2317
2317
|
`),i=yield z6t(r.slug,e.computedAt),t===`table`&&NH()}else t===`table`?(NH(),OH((0,R.jsx)(vH,{message:`Queued a new scoring run. Waiting for first result...`}))):process.stderr.write(`Queued a new scoring run. Waiting for first result...
|
|
2318
2318
|
`),i=yield z6t(r.slug,null),t===`table`&&NH();n0(`cli.score.executed`,{url:n,score:i.overallScore,format:t,status:r.status}),t===`json`?C9(t,JSON.stringify(i,null,2)):t===`plain`?C9(t,[`SCORE\t${i.overallScore}`,...I6t(i.checks)].join(`
|
|
2319
|
-
`)):C9(t,L6t(i)),yield d1(0)}catch(e){let n=e instanceof Error?e.message:`unknown error`;t===`table`?(NH(),OH((0,R.jsx)(bH,{message:n}))):process.stderr.write(`Error: ${n}\n`),yield d1(1)}});var w9=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 H6t=`https://mintlify.com/auth.md`,U6t=()=>{kH((0,R.jsx)(pH,{children:`Agent Detected - sending AI friendly prompt`}),(0,R.jsx)(pH,{children:`<mint-cli-instructions>`}),(0,R.jsxs)(pH,{children:[`Could not fetch the agent signup guide. Read `,H6t," directly, or create a site without an account by running `mint deploy --subdomain [subdomain]` from the documentation directory and following the instructions it prints."]}),(0,R.jsx)(pH,{children:"To hand the site to the user, ask for their email (never invent one) and run `mint claim --email [email]`."}),(0,R.jsx)(pH,{children:`</mint-cli-instructions>`}))},W6t=()=>w9(void 0,void 0,void 0,function*(){!p1()||F$()||process.env.MINTLIFY_SESSION_TOKEN||(yield x1().catch(()=>void 0))||(EMt(a1)?OH((0,R.jsx)(pH,{children:"Not published yet. Run `mint signup` or `mint login` to publish."})):(kH((0,R.jsx)(pH,{children:`<mint-cli-instructions>`}),(0,R.jsx)(pH,{children:`Ready to publish? The
|
|
2319
|
+
`)):C9(t,L6t(i)),yield d1(0)}catch(e){let n=e instanceof Error?e.message:`unknown error`;t===`table`?(NH(),OH((0,R.jsx)(bH,{message:n}))):process.stderr.write(`Error: ${n}\n`),yield d1(1)}});var w9=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 H6t=`https://mintlify.com/auth.md`,U6t=()=>{kH((0,R.jsx)(pH,{children:`Agent Detected - sending AI friendly prompt`}),(0,R.jsx)(pH,{children:`<mint-cli-instructions>`}),(0,R.jsxs)(pH,{children:[`Could not fetch the agent signup guide. Read `,H6t," directly, or create a site without an account by running `mint deploy --subdomain [subdomain]` from the documentation directory and following the instructions it prints."]}),(0,R.jsx)(pH,{children:"To hand the site to the user, ask for their email (never invent one) and run `mint claim --email [email]`."}),(0,R.jsx)(pH,{children:`</mint-cli-instructions>`}))},W6t=()=>w9(void 0,void 0,void 0,function*(){!p1()||F$()||process.env.MINTLIFY_SESSION_TOKEN||(yield x1().catch(()=>void 0))||(EMt(a1)?OH((0,R.jsx)(pH,{children:"Not published yet. Run `mint signup` or `mint login` to publish."})):(kH((0,R.jsx)(pH,{children:`<mint-cli-instructions>`}),(0,R.jsx)(pH,{children:`Ready to publish? The Free plan needs no credit card.`}),(0,R.jsx)(pH,{children:"Offer to create the user's Mintlify account: run `mint signup` and follow the instructions it prints."}),(0,R.jsx)(pH,{children:"Have an account: `mint login`."}),(0,R.jsx)(pH,{children:"Your site will then be live at https://[subdomain].mintlify.site (`mint status` shows the exact URL)."}),(0,R.jsx)(pH,{children:`</mint-cli-instructions>`})),yield DMt(a1).catch(()=>void 0)))}),G6t=()=>w9(void 0,void 0,void 0,function*(){try{let e=yield fetch(H6t,{signal:AbortSignal.timeout(3e4)});if(!e.ok)throw Error(`auth.md returned ${e.status}`);process.stdout.write(`${yield e.text()}\n`)}catch{U6t()}});function K6t(){return w9(this,arguments,void 0,function*(e={}){if(p1()){yield G6t();return}let t=e.firstName??(yield T0({message:`First name`})),n=e.lastName??(yield T0({message:`Last name`})),r=e.company??(yield T0({message:`Company name`})),i=e.email??(yield T0({message:`Email`})),a=lBt(),o=yield cBt(a),s=uBt(),c=dBt(),l=Buffer.from(JSON.stringify({nonce:s,clientState:c})).toString(`base64url`),{codePromise:u,close:d}=yield gBt();u.catch(()=>{});try{let e=yield fetch(`${C1}/api/cli-onboarding/signup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({firstName:t,lastName:n,company:r,email:i,state:l,codeChallenge:o})});if(!e.ok){let t=yield e.json().catch(()=>({}));d(),OH((0,R.jsx)(bH,{message:`signup failed: ${t.error??`unknown error`}`}));return}}catch{d(),OH((0,R.jsx)(bH,{message:`signup failed: could not reach the server`}));return}OH((0,R.jsxs)(fH,{flexDirection:`column`,gap:1,paddingY:1,children:[(0,R.jsxs)(pH,{bold:!0,children:[(0,R.jsx)(pH,{color:`green`,children:`◆ `}),`Check your email to verify your account`]}),(0,R.jsx)(fH,{flexDirection:`column`,paddingLeft:3,gap:1,children:(0,R.jsxs)(pH,{dimColor:!0,children:[`We sent a verification link to `,i,`. Click it to continue.`]})})]}));let f;try{f=yield u}catch{OH((0,R.jsx)(bH,{message:`signup cancelled`}));return}let p=yield fetch(T1,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({grant_type:`authorization_code`,code:f,code_verifier:a})}),m=yield p.json().catch(()=>({}));if(!p.ok){let e=m.error_message??m.error??`unknown error`;OH((0,R.jsx)(bH,{message:`signup failed: ${e}`}));return}let h=m;yield b1(h.access_token,h.refresh_token,E1(h.id_token)??i),yield TMt(`subdomain`).catch(()=>void 0),OH((0,R.jsx)(_H,{message:`account created and logged in successfully`})),OH((0,R.jsx)(pH,{children:`Continue in the browser tab where you verified your email to connect GitHub.`}))})}var T9=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 q6t=(e,t)=>T9(void 0,void 0,void 0,function*(){let n=yield oMt({packageName:e});try{yield f1(n,rMt(n,e),c1);return}catch(r){return`Failed to update ${e}@${t} using ${n}: ${u1(r)}`}}),J6t=e=>T9(void 0,void 0,void 0,function*(){let t=WK().trim();try{yield xdt({targetVersion:e,existingVersion:t===`none`?null:t});return}catch(e){return`Failed to update client: ${u1(e)}`}}),Y6t=e=>T9(void 0,[e],void 0,function*({packageName:e}){l1(e),OH((0,R.jsx)(vH,{message:`updating...`}));let{cli:t}=s1(e),[n,r]=yield Promise.all([nMt(e),bdt()]),i=!!t&&!!n&&n!==t.trim(),a=!!r&&WK().trim()!==r.trim();MH(),i&&OH((0,R.jsx)(vH,{message:`updating ${e} package...`})),a&&OH((0,R.jsx)(vH,{message:`updating client...`}));let o=(yield Promise.all([n?i?q6t(e,n):void 0:`Failed to fetch the latest ${e} version`,a?J6t(r.trim()):void 0])).filter(e=>!!e);MH(),o.length?o.forEach(e=>jH((0,R.jsx)(bH,{message:e}))):OH(!i&&!a?(0,R.jsx)(_H,{message:`already up to date`}):(0,R.jsx)(_H,{message:`updated ${e} to the latest version: ${n}`}))});var X6t=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 Z6t=new RegExp(S.source,`gm`),Q6t=/^(?:import|export)(?=[\s{*])/,$6t=/<[A-Za-z][\w.:-]*(?:"[^"]*"|'[^']*'|\{[^{}]*\}|[^<>"'{}])*>/g,e8t=/"[^"]*"|'[^']*'|\{[^{}]*\}/g,t8t=e=>/\{\s*#[^}]+?\s*\}\s*$/.test(e),n8t=e=>{let t=e.replace(Z6t,(e,t,n,r)=>{let i=e.indexOf(r,t.length+n.length)+r.length;return e.slice(0,i).padEnd(e.length,` `)});return PT().parse(t)},E9=(e,t)=>{let n=``,r=0;for(let[i,a]of[...t].sort((e,t)=>e[0]-t[0])){let t=Math.max(i,r);a<=t||(n+=e.slice(r,t)+e.slice(t,a).replace(/[^\n]/g,` `),r=a)}return n+e.slice(r)},r8t=(e,t)=>t.reduce((e,t)=>E9(e,t(e)),e),i8t=e=>{try{return Rg.parse(e,{ecmaVersion:`latest`,sourceType:`module`}),!0}catch(t){let n=t.pos;return typeof n!=`number`||n<e.trimEnd().length}},a8t=e=>{let t=hPe.exec(e);return t?[[t.index,t.index+t[0].length]]:[]},o8t=(e,t)=>{let n,r=!0,i=[],a=0;for(let o of e.split(`
|
|
2320
2320
|
`)){let e=o.trim()===``,s=r;r=e,n?e&&i8t(n.join(`
|
|
2321
2321
|
`))?n=void 0:(n.push(o),i.push([a,a+o.length])):s&&Q6t.test(o)&&!t.some(([e,t])=>e<=a&&a<t)&&(n=[o],i.push([a,a+o.length])),a+=o.length+1}return i},s8t=e=>E9(e,a8t(e)),D9=(e,{keepEsm:t=!1}={})=>{let n=dNe(e);return E9(e,[...a8t(e),...n,...t?[]:o8t(e,n)])},c8t=/* @__PURE__ */ new Set([`{`,"${"]),l8t=(e,t)=>{let n=[],r=0;try{let i=Rg.tokenizer(e.slice(t),{ecmaVersion:`latest`,onComment:(e,r,i,a)=>n.push([t+i+2,t+a-(e?2:0)])});for(let a of i){let i=a.type.label;if(i===`template`)n.push([t+a.start,t+a.end]);else if(i===`string`)n.push([t+a.start+1,t+a.end-1]);else if(i===`regexp`){let r=e.slice(t+a.start,t+a.end);n.push([t+a.start+1,t+a.start+r.lastIndexOf(`/`)])}else if(c8t.has(i))r++;else if(i===`}`&&r--===0)return{ranges:n,end:t+a.end}}}catch(r){if(!(r instanceof SyntaxError&&`pos`in r&&typeof r.pos==`number`))return{ranges:n,end:e.length};let i=t+r.pos;if(!r.message.startsWith(`Unterminated string`))return{ranges:n,end:i};let a=e.indexOf(`
|
|
2322
2322
|
`,i);n.push([i+1,a===-1?e.length:a])}return{ranges:n,end:e.length}},u8t=e=>{let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(r===`\\`)n++;else if(r===`{`){let r=l8t(e,n+1);t.push(...r.ranges),n=r.end-1}}return t},d8t=e=>[...e.matchAll($6t)].flatMap(({index:e,0:t})=>[...t.matchAll(e8t)].map(({index:t,0:n})=>[e+t+1,e+t+n.length-1])),f8t=e=>[...e.matchAll(/\\[\s\S]/g)].flatMap(({index:e,0:t})=>t===`\\<`?[[e+1,e+2]]:[]),p8t=e=>r8t(D9(e),[d8t,f8t,u8t]),O9=e=>{let t=e.map((e,t)=>({edit:e,index:t})).sort((e,t)=>t.edit.start-e.edit.start||t.edit.end-e.edit.end||t.index-e.index),n=[],r=1/0;for(let{edit:e}of t)e.end>r||(n.push(e),r=e.start);return n},k9=(e,t)=>O9(t).reduce((e,t)=>e.slice(0,t.start)+t.text+e.slice(t.end),e),m8t=(e,t,n=1)=>{let r=0;for(let n=1;n<t;n++){let t=e.indexOf(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/cli",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.36",
|
|
4
4
|
"description": "The Mintlify CLI",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -51,21 +51,21 @@
|
|
|
51
51
|
"sharp": "0.33.5"
|
|
52
52
|
},
|
|
53
53
|
"optionalDependencies": {
|
|
54
|
-
"@mintlify/package-builder": "0.0.
|
|
54
|
+
"@mintlify/package-builder": "0.0.158",
|
|
55
55
|
"fsevents": "2.3.3",
|
|
56
56
|
"keytar": "7.9.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@inquirer/prompts": "7.9.0",
|
|
60
|
-
"@mintlify/common": "1.0.
|
|
61
|
-
"@mintlify/editor": "0.0.
|
|
62
|
-
"@mintlify/link-rot": "3.0.
|
|
63
|
-
"@mintlify/models": "0.0.
|
|
64
|
-
"@mintlify/og": "0.0.
|
|
65
|
-
"@mintlify/prebuild": "1.0.
|
|
66
|
-
"@mintlify/previewing": "4.0.
|
|
60
|
+
"@mintlify/common": "1.0.1369",
|
|
61
|
+
"@mintlify/editor": "0.0.648",
|
|
62
|
+
"@mintlify/link-rot": "3.0.1618",
|
|
63
|
+
"@mintlify/models": "0.0.395",
|
|
64
|
+
"@mintlify/og": "0.0.168",
|
|
65
|
+
"@mintlify/prebuild": "1.0.1547",
|
|
66
|
+
"@mintlify/previewing": "4.0.1635",
|
|
67
67
|
"@mintlify/ts-config": "2.0.2",
|
|
68
|
-
"@mintlify/validation": "0.1.
|
|
68
|
+
"@mintlify/validation": "0.1.974",
|
|
69
69
|
"@tsconfig/recommended": "1.0.2",
|
|
70
70
|
"@types/detect-port": "1.3.2",
|
|
71
71
|
"@types/keytar": "4.4.2",
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"yargs": "17.7.1",
|
|
114
114
|
"zod": "4.3.6"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "9338bff7c8384aeeb8ff1b70d9e2789e16768518"
|
|
117
117
|
}
|