@mintlify/cli 4.0.595 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/cli",
3
- "version": "4.0.595",
3
+ "version": "4.0.596",
4
4
  "description": "The Mintlify CLI",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -43,7 +43,7 @@
43
43
  "@mintlify/link-rot": "3.0.546",
44
44
  "@mintlify/models": "0.0.197",
45
45
  "@mintlify/prebuild": "1.0.542",
46
- "@mintlify/previewing": "4.0.584",
46
+ "@mintlify/previewing": "4.0.585",
47
47
  "@mintlify/validation": "0.1.397",
48
48
  "chalk": "^5.2.0",
49
49
  "detect-port": "^1.5.1",
@@ -72,5 +72,5 @@
72
72
  "vitest": "^2.0.4",
73
73
  "vitest-mock-process": "^1.0.4"
74
74
  },
75
- "gitHead": "8b45827df34d54e32d6f17b95bf0f9289d05fc12"
75
+ "gitHead": "71ab869ab7f515c10b3401d73d735f89c64902c0"
76
76
  }
package/src/cli.ts CHANGED
@@ -18,12 +18,14 @@ import {
18
18
  checkForDocsJson,
19
19
  getCliVersion,
20
20
  getVersions,
21
+ suppressConsoleWarnings,
21
22
  } from './helpers.js';
22
23
  import { update } from './update.js';
23
24
 
24
25
  export const cli = () =>
25
26
  yargs(hideBin(process.argv))
26
27
  .middleware(checkNodeVersion)
28
+ .middleware(suppressConsoleWarnings)
27
29
  .command(
28
30
  'dev',
29
31
  'Runs Mintlify project locally.',
@@ -50,15 +52,6 @@ export const cli = () =>
50
52
  .example('mintlify dev', 'Run with default settings (opens in browser)')
51
53
  .example('mintlify dev --no-open', 'Run without opening in browser'),
52
54
  async (argv) => {
53
- // Suppress deprecation warning for punycode
54
- const originalConsoleError = console.error;
55
- console.error = (...args) => {
56
- const message = args.join(' ');
57
- if (message.includes('DeprecationWarning')) {
58
- return;
59
- }
60
- originalConsoleError.apply(console, args);
61
- };
62
55
  const port = await checkPort(argv);
63
56
  const packageName = process.argv[1]?.split('/').pop() ?? 'mintlify';
64
57
  const cliVersion = getCliVersion();
package/src/helpers.ts CHANGED
@@ -128,3 +128,28 @@ export const getLatestCliVersion = (packageName: string) => {
128
128
  stdio: ['pipe', 'pipe', 'pipe'],
129
129
  }).trim();
130
130
  };
131
+
132
+ export const suppressConsoleWarnings = (): void => {
133
+ // Ignore tailwind warnings and punycode deprecation warning
134
+ const ignoredMessages = [
135
+ 'No utility classes were detected',
136
+ 'https://tailwindcss.com/docs/content-configuration',
137
+ 'DeprecationWarning',
138
+ ];
139
+ const originalConsoleError = console.error;
140
+ console.error = (...args) => {
141
+ const message = args.join(' ');
142
+ if (ignoredMessages.some((ignoredMessage) => message.includes(ignoredMessage))) {
143
+ return;
144
+ }
145
+ originalConsoleError.apply(console, args);
146
+ };
147
+ const originalConsoleWarn = console.warn;
148
+ console.warn = (...args) => {
149
+ const message = args.join(' ');
150
+ if (ignoredMessages.some((ignoredMessage) => message.includes(ignoredMessage))) {
151
+ return;
152
+ }
153
+ originalConsoleWarn.apply(console, args);
154
+ };
155
+ };