@mintlify/cli 4.0.625 → 4.0.627
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 +12 -2
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/src/cli.tsx +17 -1
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 { getBrokenInternalLinks, renameFilesAndUpdateLinksInContent } from '@mintlify/link-rot';
|
|
13
|
-
import { addLog, dev, ErrorLog, SpinnerLog, SuccessLog, Logs, clearLogs, BrokenLinksLog, } from '@mintlify/previewing';
|
|
13
|
+
import { addLog, dev, ErrorLog, SpinnerLog, SuccessLog, Logs, clearLogs, BrokenLinksLog, WarningLog, } from '@mintlify/previewing';
|
|
14
14
|
import { render, Text } from 'ink';
|
|
15
15
|
import path from 'path';
|
|
16
16
|
import semver from 'semver';
|
|
@@ -84,6 +84,11 @@ export const cli = () => {
|
|
|
84
84
|
addLog(_jsx(SuccessLog, { message: "OpenAPI definition is valid." }));
|
|
85
85
|
yield terminate(0);
|
|
86
86
|
}
|
|
87
|
+
if (filename.startsWith('http://') && !localSchema) {
|
|
88
|
+
addLog(_jsx(WarningLog, { message: "include the --local-schema flag to check locally hosted OpenAPI files" }));
|
|
89
|
+
addLog(_jsx(WarningLog, { message: "only https protocol is supported in production" }));
|
|
90
|
+
yield terminate(0);
|
|
91
|
+
}
|
|
87
92
|
const document = yield readLocalOpenApiFile(filename);
|
|
88
93
|
if (!document) {
|
|
89
94
|
throw new Error('failed to parse OpenAPI spec: could not parse file correctly, please check for any syntax errors.');
|
|
@@ -92,7 +97,12 @@ export const cli = () => {
|
|
|
92
97
|
addLog(_jsx(SuccessLog, { message: "OpenAPI definition is valid." }));
|
|
93
98
|
}
|
|
94
99
|
catch (err) {
|
|
95
|
-
|
|
100
|
+
if (err && typeof err === 'object' && 'code' in err && err.code === 'ENOENT') {
|
|
101
|
+
addLog(_jsx(ErrorLog, { message: `file not found, please check the path provided: ${filename}` }));
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
addLog(_jsx(ErrorLog, { message: err instanceof Error ? err.message : 'unknown error' }));
|
|
105
|
+
}
|
|
96
106
|
yield terminate(1);
|
|
97
107
|
}
|
|
98
108
|
yield terminate(0);
|