@mintlify/cli 4.0.1055 → 4.0.1057
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/bin/cli.js +28 -16
- package/bin/helpers.js +8 -2
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/cli.tsx +37 -22
- package/src/helpers.tsx +11 -2
package/bin/cli.js
CHANGED
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { validate, getOpenApiDocumentFromUrl, isAllowedLocalSchemaUrl } from '@mintlify/common';
|
|
12
12
|
import { buildGraph, getBrokenExternalLinks, renameFilesAndUpdateLinksInContent, } from '@mintlify/link-rot';
|
|
13
|
-
import { addLog, dev, validateBuild, ErrorLog, SpinnerLog, SuccessLog, Logs, clearLogs, BrokenLinksLog, WarningLog, } from '@mintlify/previewing';
|
|
13
|
+
import { addLog, dev, exportSite, validateBuild, ErrorLog, SpinnerLog, SuccessLog, Logs, clearLogs, BrokenLinksLog, WarningLog, } from '@mintlify/previewing';
|
|
14
14
|
import { checkUrl } from '@mintlify/scraping';
|
|
15
15
|
import { render, Text } from 'ink';
|
|
16
16
|
import path from 'path';
|
|
@@ -65,21 +65,6 @@ export const cli = ({ packageName = 'mint' }) => {
|
|
|
65
65
|
.usage('usage: mintlify dev [options]')
|
|
66
66
|
.example('mintlify dev', 'run with default settings (opens in browser)')
|
|
67
67
|
.example('mintlify dev --no-open', 'run without opening in browser'), (argv) => __awaiter(void 0, void 0, void 0, function* () {
|
|
68
|
-
let nodeVersionString = process.version;
|
|
69
|
-
if (nodeVersionString.charAt(0) === 'v') {
|
|
70
|
-
nodeVersionString = nodeVersionString.slice(1);
|
|
71
|
-
}
|
|
72
|
-
const versionArr = nodeVersionString.split('.');
|
|
73
|
-
const majorVersion = parseInt(versionArr[0], 10);
|
|
74
|
-
const minorVersion = parseInt(versionArr[1], 10);
|
|
75
|
-
if (majorVersion >= 25) {
|
|
76
|
-
addLog(_jsx(ErrorLog, { message: "mint dev is not supported on node versions 25+. Please downgrade to an LTS node version." }));
|
|
77
|
-
yield terminate(1);
|
|
78
|
-
}
|
|
79
|
-
if (majorVersion < 20 || (majorVersion === 20 && minorVersion < 17)) {
|
|
80
|
-
addLog(_jsx(ErrorLog, { message: "mint dev is not supported on node versions below 20.17 Please upgrade to an LTS node version." }));
|
|
81
|
-
yield terminate(1);
|
|
82
|
-
}
|
|
83
68
|
const port = yield checkPort(argv);
|
|
84
69
|
const { cli: cliVersion } = getVersions();
|
|
85
70
|
if (port != undefined) {
|
|
@@ -118,6 +103,33 @@ export const cli = ({ packageName = 'mint' }) => {
|
|
|
118
103
|
const { cli: cliVersion } = getVersions();
|
|
119
104
|
yield validateBuild(Object.assign(Object.assign({}, argv), { packageName,
|
|
120
105
|
cliVersion }));
|
|
106
|
+
}))
|
|
107
|
+
.command('export', 'export a static site for air-gapped deployment', (yargs) => yargs
|
|
108
|
+
.option('output', {
|
|
109
|
+
type: 'string',
|
|
110
|
+
default: 'export.zip',
|
|
111
|
+
description: 'output zip file path',
|
|
112
|
+
})
|
|
113
|
+
.option('client-version', {
|
|
114
|
+
type: 'string',
|
|
115
|
+
hidden: true,
|
|
116
|
+
})
|
|
117
|
+
.option('groups', {
|
|
118
|
+
type: 'array',
|
|
119
|
+
description: 'Mock user groups for export',
|
|
120
|
+
})
|
|
121
|
+
.option('disable-openapi', {
|
|
122
|
+
type: 'boolean',
|
|
123
|
+
default: false,
|
|
124
|
+
description: 'Disable OpenAPI file generation',
|
|
125
|
+
})
|
|
126
|
+
.usage('usage: mintlify export [options]')
|
|
127
|
+
.example('mintlify export', 'export as export.zip')
|
|
128
|
+
.example('mintlify export --output docs.zip', 'export to custom filename'), (argv) => __awaiter(void 0, void 0, void 0, function* () {
|
|
129
|
+
const { cli: cliVersion } = getVersions();
|
|
130
|
+
yield exportSite(Object.assign(Object.assign({}, argv), { packageName,
|
|
131
|
+
cliVersion }));
|
|
132
|
+
yield terminate(0);
|
|
121
133
|
}))
|
|
122
134
|
.command('openapi-check <filename>', 'check if an openapi spec is valid', (yargs) => yargs
|
|
123
135
|
.positional('filename', {
|
package/bin/helpers.js
CHANGED
|
@@ -39,8 +39,14 @@ export const checkNodeVersion = () => __awaiter(void 0, void 0, void 0, function
|
|
|
39
39
|
}
|
|
40
40
|
const versionArr = nodeVersionString.split('.');
|
|
41
41
|
const majorVersion = parseInt(versionArr[0], 10);
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
const minorVersion = parseInt(versionArr[1], 10);
|
|
43
|
+
if (majorVersion >= 25) {
|
|
44
|
+
addLog(_jsx(ErrorLog, { message: `mintlify is not supported on node versions 25+ (current version ${nodeVersionString}). Please downgrade to an LTS node version.` }));
|
|
45
|
+
yield terminate(1);
|
|
46
|
+
}
|
|
47
|
+
if (majorVersion < 20 || (majorVersion === 20 && minorVersion < 17)) {
|
|
48
|
+
addLog(_jsx(ErrorLog, { message: "mintlify requires node 20.17 or higher. Please upgrade to an LTS node version." }));
|
|
49
|
+
yield terminate(1);
|
|
44
50
|
}
|
|
45
51
|
});
|
|
46
52
|
export const checkForMintJson = () => __awaiter(void 0, void 0, void 0, function* () {
|