@mintlify/cli 4.0.594 → 4.0.596
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 +2 -10
- package/bin/helpers.js +24 -0
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/cli.ts +2 -9
- package/src/helpers.ts +25 -0
package/bin/cli.js
CHANGED
|
@@ -18,10 +18,11 @@ import semver from 'semver';
|
|
|
18
18
|
import yargs from 'yargs';
|
|
19
19
|
import { hideBin } from 'yargs/helpers';
|
|
20
20
|
import { LOCAL_LINKED_VERSION, MINIMUM_CLI_VERSION } from './constants.js';
|
|
21
|
-
import { checkPort, checkForMintJson, checkNodeVersion, upgradeConfig, checkForDocsJson, getCliVersion, getVersions, } from './helpers.js';
|
|
21
|
+
import { checkPort, checkForMintJson, checkNodeVersion, upgradeConfig, checkForDocsJson, getCliVersion, getVersions, suppressConsoleWarnings, } from './helpers.js';
|
|
22
22
|
import { update } from './update.js';
|
|
23
23
|
export const cli = () => yargs(hideBin(process.argv))
|
|
24
24
|
.middleware(checkNodeVersion)
|
|
25
|
+
.middleware(suppressConsoleWarnings)
|
|
25
26
|
.command('dev', 'Runs Mintlify project locally.', (yargs) => yargs
|
|
26
27
|
.option('open', {
|
|
27
28
|
type: 'boolean',
|
|
@@ -43,15 +44,6 @@ export const cli = () => yargs(hideBin(process.argv))
|
|
|
43
44
|
.example('mintlify dev', 'Run with default settings (opens in browser)')
|
|
44
45
|
.example('mintlify dev --no-open', 'Run without opening in browser'), (argv) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
46
|
var _a, _b;
|
|
46
|
-
// Suppress deprecation warning for punycode
|
|
47
|
-
const originalConsoleError = console.error;
|
|
48
|
-
console.error = (...args) => {
|
|
49
|
-
const message = args.join(' ');
|
|
50
|
-
if (message.includes('DeprecationWarning')) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
originalConsoleError.apply(console, args);
|
|
54
|
-
};
|
|
55
47
|
const port = yield checkPort(argv);
|
|
56
48
|
const packageName = (_b = (_a = process.argv[1]) === null || _a === void 0 ? void 0 : _a.split('/').pop()) !== null && _b !== void 0 ? _b : 'mintlify';
|
|
57
49
|
const cliVersion = getCliVersion();
|
package/bin/helpers.js
CHANGED
|
@@ -119,3 +119,27 @@ export const getLatestCliVersion = (packageName) => {
|
|
|
119
119
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
120
120
|
}).trim();
|
|
121
121
|
};
|
|
122
|
+
export const suppressConsoleWarnings = () => {
|
|
123
|
+
// Ignore tailwind warnings and punycode deprecation warning
|
|
124
|
+
const ignoredMessages = [
|
|
125
|
+
'No utility classes were detected',
|
|
126
|
+
'https://tailwindcss.com/docs/content-configuration',
|
|
127
|
+
'DeprecationWarning',
|
|
128
|
+
];
|
|
129
|
+
const originalConsoleError = console.error;
|
|
130
|
+
console.error = (...args) => {
|
|
131
|
+
const message = args.join(' ');
|
|
132
|
+
if (ignoredMessages.some((ignoredMessage) => message.includes(ignoredMessage))) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
originalConsoleError.apply(console, args);
|
|
136
|
+
};
|
|
137
|
+
const originalConsoleWarn = console.warn;
|
|
138
|
+
console.warn = (...args) => {
|
|
139
|
+
const message = args.join(' ');
|
|
140
|
+
if (ignoredMessages.some((ignoredMessage) => message.includes(ignoredMessage))) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
originalConsoleWarn.apply(console, args);
|
|
144
|
+
};
|
|
145
|
+
};
|