@mintlify/cli 4.0.1141 → 4.0.1142

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.
@@ -24,12 +24,31 @@ function resolveFormat(argv) {
24
24
  return argv.format;
25
25
  return 'table';
26
26
  }
27
- function statusIcon(pass) {
28
- return pass ? chalk.green('✓') : chalk.red('✗');
27
+ function statusIcon(status) {
28
+ switch (status) {
29
+ case 'pass':
30
+ return chalk.green('✓');
31
+ case 'warn':
32
+ return chalk.yellow('⚠');
33
+ case 'skip':
34
+ return chalk.dim('○');
35
+ case 'fail':
36
+ case 'error':
37
+ return chalk.red('✗');
38
+ default: {
39
+ const _exhaustive = status;
40
+ void _exhaustive;
41
+ return chalk.dim('?');
42
+ }
43
+ }
44
+ }
45
+ function plainStatusLabel(status) {
46
+ return status.toUpperCase();
29
47
  }
30
48
  function formatCheckName(name) {
31
49
  return name
32
- .replace(/([A-Z])/g, ' $1')
50
+ .replace(/[-_]+/g, ' ')
51
+ .replace(/([a-z])([A-Z])/g, '$1 $2')
33
52
  .replace(/^./, (c) => c.toUpperCase())
34
53
  .trim();
35
54
  }
@@ -37,7 +56,7 @@ function renderChecks(checks, indent = 0) {
37
56
  const lines = [];
38
57
  const pad = ' '.repeat(indent + 1);
39
58
  for (const check of checks) {
40
- lines.push(`${pad}${statusIcon(check.pass)} ${formatCheckName(check.name)}`);
59
+ lines.push(`${pad}${statusIcon(check.status)} ${formatCheckName(check.name)}`);
41
60
  if (check.children && check.children.length > 0) {
42
61
  lines.push(...renderChecks(check.children, indent + 1));
43
62
  }
@@ -47,7 +66,7 @@ function renderChecks(checks, indent = 0) {
47
66
  function renderPlain(checks, prefix = '') {
48
67
  const lines = [];
49
68
  for (const check of checks) {
50
- lines.push(`${prefix}${check.pass ? 'PASS' : 'FAIL'}\t${check.name}`);
69
+ lines.push(`${prefix}${plainStatusLabel(check.status)}\t${check.name}`);
51
70
  if (check.children && check.children.length > 0) {
52
71
  lines.push(...renderPlain(check.children, prefix + ' '));
53
72
  }