@mintlify/cli 4.0.1056 → 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 +4 -4
- package/src/cli.tsx +37 -22
- package/src/helpers.tsx +11 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1057",
|
|
4
4
|
"description": "The Mintlify CLI",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@inquirer/prompts": "7.9.0",
|
|
48
48
|
"@mintlify/common": "1.0.818",
|
|
49
|
-
"@mintlify/link-rot": "3.0.
|
|
49
|
+
"@mintlify/link-rot": "3.0.989",
|
|
50
50
|
"@mintlify/models": "0.0.286",
|
|
51
51
|
"@mintlify/prebuild": "1.0.959",
|
|
52
|
-
"@mintlify/previewing": "4.0.
|
|
52
|
+
"@mintlify/previewing": "4.0.1018",
|
|
53
53
|
"@mintlify/scraping": "4.0.681",
|
|
54
54
|
"@mintlify/validation": "0.1.643",
|
|
55
55
|
"adm-zip": "0.5.16",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"vitest": "2.1.9",
|
|
88
88
|
"vitest-mock-process": "1.0.4"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "689313194fd46d5dd2211b59062a041ba91f3981"
|
|
91
91
|
}
|
package/src/cli.tsx
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
addLog,
|
|
9
9
|
dev,
|
|
10
|
+
exportSite,
|
|
10
11
|
validateBuild,
|
|
11
12
|
ErrorLog,
|
|
12
13
|
SpinnerLog,
|
|
@@ -90,28 +91,6 @@ export const cli = ({ packageName = 'mint' }: { packageName?: string }) => {
|
|
|
90
91
|
.example('mintlify dev', 'run with default settings (opens in browser)')
|
|
91
92
|
.example('mintlify dev --no-open', 'run without opening in browser'),
|
|
92
93
|
async (argv) => {
|
|
93
|
-
let nodeVersionString = process.version;
|
|
94
|
-
if (nodeVersionString.charAt(0) === 'v') {
|
|
95
|
-
nodeVersionString = nodeVersionString.slice(1);
|
|
96
|
-
}
|
|
97
|
-
const versionArr = nodeVersionString.split('.');
|
|
98
|
-
const majorVersion = parseInt(versionArr[0]!, 10);
|
|
99
|
-
const minorVersion = parseInt(versionArr[1]!, 10);
|
|
100
|
-
|
|
101
|
-
if (majorVersion >= 25) {
|
|
102
|
-
addLog(
|
|
103
|
-
<ErrorLog message="mint dev is not supported on node versions 25+. Please downgrade to an LTS node version." />
|
|
104
|
-
);
|
|
105
|
-
await terminate(1);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (majorVersion < 20 || (majorVersion === 20 && minorVersion < 17)) {
|
|
109
|
-
addLog(
|
|
110
|
-
<ErrorLog message="mint dev is not supported on node versions below 20.17 Please upgrade to an LTS node version." />
|
|
111
|
-
);
|
|
112
|
-
await terminate(1);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
94
|
const port = await checkPort(argv);
|
|
116
95
|
const { cli: cliVersion } = getVersions();
|
|
117
96
|
if (port != undefined) {
|
|
@@ -163,6 +142,42 @@ export const cli = ({ packageName = 'mint' }: { packageName?: string }) => {
|
|
|
163
142
|
});
|
|
164
143
|
}
|
|
165
144
|
)
|
|
145
|
+
.command(
|
|
146
|
+
'export',
|
|
147
|
+
'export a static site for air-gapped deployment',
|
|
148
|
+
(yargs) =>
|
|
149
|
+
yargs
|
|
150
|
+
.option('output', {
|
|
151
|
+
type: 'string',
|
|
152
|
+
default: 'export.zip',
|
|
153
|
+
description: 'output zip file path',
|
|
154
|
+
})
|
|
155
|
+
.option('client-version', {
|
|
156
|
+
type: 'string',
|
|
157
|
+
hidden: true,
|
|
158
|
+
})
|
|
159
|
+
.option('groups', {
|
|
160
|
+
type: 'array',
|
|
161
|
+
description: 'Mock user groups for export',
|
|
162
|
+
})
|
|
163
|
+
.option('disable-openapi', {
|
|
164
|
+
type: 'boolean',
|
|
165
|
+
default: false,
|
|
166
|
+
description: 'Disable OpenAPI file generation',
|
|
167
|
+
})
|
|
168
|
+
.usage('usage: mintlify export [options]')
|
|
169
|
+
.example('mintlify export', 'export as export.zip')
|
|
170
|
+
.example('mintlify export --output docs.zip', 'export to custom filename'),
|
|
171
|
+
async (argv) => {
|
|
172
|
+
const { cli: cliVersion } = getVersions();
|
|
173
|
+
await exportSite({
|
|
174
|
+
...argv,
|
|
175
|
+
packageName,
|
|
176
|
+
cliVersion,
|
|
177
|
+
});
|
|
178
|
+
await terminate(0);
|
|
179
|
+
}
|
|
180
|
+
)
|
|
166
181
|
.command(
|
|
167
182
|
'openapi-check <filename>',
|
|
168
183
|
'check if an openapi spec is valid',
|
package/src/helpers.tsx
CHANGED
|
@@ -41,13 +41,22 @@ export const checkNodeVersion = async () => {
|
|
|
41
41
|
}
|
|
42
42
|
const versionArr = nodeVersionString.split('.');
|
|
43
43
|
const majorVersion = parseInt(versionArr[0]!, 10);
|
|
44
|
+
const minorVersion = parseInt(versionArr[1]!, 10);
|
|
44
45
|
|
|
45
|
-
if (majorVersion
|
|
46
|
+
if (majorVersion >= 25) {
|
|
46
47
|
addLog(
|
|
47
48
|
<ErrorLog
|
|
48
|
-
message={`mintlify
|
|
49
|
+
message={`mintlify is not supported on node versions 25+ (current version ${nodeVersionString}). Please downgrade to an LTS node version.`}
|
|
49
50
|
/>
|
|
50
51
|
);
|
|
52
|
+
await terminate(1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (majorVersion < 20 || (majorVersion === 20 && minorVersion < 17)) {
|
|
56
|
+
addLog(
|
|
57
|
+
<ErrorLog message="mintlify requires node 20.17 or higher. Please upgrade to an LTS node version." />
|
|
58
|
+
);
|
|
59
|
+
await terminate(1);
|
|
51
60
|
}
|
|
52
61
|
};
|
|
53
62
|
|