@mintlify/cli 4.0.1733 → 4.0.1734

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 CHANGED
@@ -43,6 +43,7 @@ import { sendPublishPrompt, signup } from './signup.js';
43
43
  import { status, getCliSubdomains } from './status.js';
44
44
  import { trackTelemetryPreferenceChange } from './telemetry/track.js';
45
45
  import { update } from './update.js';
46
+ import { runLintStep, splitList } from './validate/command.js';
46
47
  import { renderWelcome } from './welcome.js';
47
48
  import { workflowsBuilder } from './workflows/index.js';
48
49
  // The branded welcome screen replaces yargs' default help, but only for an
@@ -303,9 +304,29 @@ export const cli = ({ packageName = 'mint' }) => {
303
304
  type: 'boolean',
304
305
  default: false,
305
306
  description: 'Disable OpenAPI file generation',
307
+ })
308
+ .option('files', {
309
+ type: 'string',
310
+ array: true,
311
+ description: 'Limit page checks to these files or globs; site-wide checks and the build still cover the whole site',
312
+ })
313
+ .option('enable', {
314
+ type: 'string',
315
+ array: true,
316
+ coerce: splitList,
317
+ description: 'Turn on rules or groups (comma-separated), for example after --disable all',
318
+ })
319
+ .option('disable', {
320
+ type: 'string',
321
+ array: true,
322
+ coerce: splitList,
323
+ description: 'Turn off rules or groups (comma-separated), or all; parse errors are still reported',
306
324
  })
307
325
  .usage('usage: mintlify validate [options]')
308
326
  .example('mintlify validate', 'validate the build'), (argv) => __awaiter(void 0, void 0, void 0, function* () {
327
+ const lintPassed = yield runLintStep(argv);
328
+ if (!lintPassed)
329
+ return;
309
330
  if (!argv['disable-openapi']) {
310
331
  let openApiFilenames = [];
311
332
  try {
@@ -79,6 +79,8 @@ function walk(baseDir_1) {
79
79
  return files;
80
80
  });
81
81
  }
82
+ export class NoMatchingFilesError extends Error {
83
+ }
82
84
  export function resolveExplicitFiles(baseDir, args) {
83
85
  return __awaiter(this, void 0, void 0, function* () {
84
86
  let allFiles = null;
@@ -105,7 +107,7 @@ export function resolveExplicitFiles(baseDir, args) {
105
107
  }
106
108
  }
107
109
  if (unmatched.length > 0) {
108
- throw new Error(`No matching files for: ${unmatched.join(', ')} (globs match .md and .mdx files)`);
110
+ throw new NoMatchingFilesError(`No matching files for: ${unmatched.join(', ')} (globs match .md and .mdx files)`);
109
111
  }
110
112
  return [...new Set(matched)];
111
113
  });