@mintlify/cli 4.0.1744 → 4.0.1746

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.
@@ -17,20 +17,28 @@ const IMPORT_TYPES = new Set([
17
17
  ]);
18
18
  const POSITION = /^:(\d+)(?::(\d+))?/;
19
19
  const QUOTED = /"([^"]+)"/;
20
- const toFinding = (site, { type, message }) => {
21
- var _a;
22
- const clean = stripVTControlCharacters(message).trim();
23
- const importer = IMPORT_TYPES.has(type)
20
+ const toFinding = (site, warning) => {
21
+ var _a, _b;
22
+ const clean = stripVTControlCharacters(warning.message).trim();
23
+ const importer = warning.file == null && IMPORT_TYPES.has(warning.type)
24
24
  ? IMPORTERS.map((pattern) => { var _a; return (_a = pattern.exec(clean)) === null || _a === void 0 ? void 0 : _a[1]; }).find(Boolean)
25
25
  : undefined;
26
26
  // Missing nav pages are always about the config, even when the page looks like a file
27
- const match = importer || type === 'missing-nav-page' ? null : FILE_IN_MESSAGE.exec(clean);
27
+ const match = warning.file != null || importer || warning.type === 'missing-nav-page'
28
+ ? null
29
+ : FILE_IN_MESSAGE.exec(clean);
28
30
  const found = importer !== null && importer !== void 0 ? importer : match === null || match === void 0 ? void 0 : match[0];
29
- const file = found ? normalizeRelativePath(toPosixPath(found)) : site.configFile;
31
+ const file = (_a = warning.file) !== null && _a !== void 0 ? _a : (found ? normalizeRelativePath(toPosixPath(found)) : site.configFile);
30
32
  const position = match ? POSITION.exec(clean.slice(match.index + match[0].length)) : null;
31
33
  // Config warnings quote the entry they're about, such as a navigation page
32
- const quoted = file === site.configFile ? (_a = QUOTED.exec(clean)) === null || _a === void 0 ? void 0 : _a[0] : undefined;
33
- return Object.assign(Object.assign(Object.assign({ file }, (position && Object.assign({ line: Number(position[1]) }, (position[2] && { column: Number(position[2]) })))), (quoted && site.locate(file, quoted))), { message: clean });
34
+ const quoted = warning.file == null && file === site.configFile ? (_b = QUOTED.exec(clean)) === null || _b === void 0 ? void 0 : _b[0] : undefined;
35
+ const located = warning.ref != null && warning.line == null
36
+ ? site.locate(file, JSON.stringify(warning.ref))
37
+ : quoted
38
+ ? site.locate(file, quoted)
39
+ : undefined;
40
+ return Object.assign(Object.assign(Object.assign({ file }, (warning.line != null
41
+ ? Object.assign({ line: warning.line }, (warning.column != null && { column: warning.column })) : position && Object.assign({ line: Number(position[1]) }, (position[2] && { column: Number(position[2]) })))), located), { message: clean });
34
42
  };
35
43
  /** Warning types some rule turns into diagnostics, so a strict-build failure is explained. */
36
44
  const COVERED_TYPES = new Set(['parse-error']);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/cli",
3
- "version": "4.0.1744",
3
+ "version": "4.0.1746",
4
4
  "description": "The Mintlify CLI",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -45,12 +45,12 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@inquirer/prompts": "7.9.0",
48
- "@mintlify/common": "1.0.1309",
49
- "@mintlify/link-rot": "3.0.1540",
48
+ "@mintlify/common": "1.0.1310",
49
+ "@mintlify/link-rot": "3.0.1542",
50
50
  "@mintlify/models": "0.0.379",
51
- "@mintlify/og": "0.0.108",
52
- "@mintlify/prebuild": "1.0.1476",
53
- "@mintlify/previewing": "4.0.1558",
51
+ "@mintlify/og": "0.0.109",
52
+ "@mintlify/prebuild": "1.0.1478",
53
+ "@mintlify/previewing": "4.0.1560",
54
54
  "@mintlify/validation": "0.1.944",
55
55
  "adm-zip": "0.6.0",
56
56
  "chalk": "5.2.0",
@@ -84,7 +84,7 @@
84
84
  "keytar": "7.9.0"
85
85
  },
86
86
  "devDependencies": {
87
- "@mintlify/editor": "0.0.582",
87
+ "@mintlify/editor": "0.0.583",
88
88
  "@mintlify/ts-config": "2.0.2",
89
89
  "@tsconfig/recommended": "1.0.2",
90
90
  "@types/detect-port": "1.3.2",
@@ -103,5 +103,5 @@
103
103
  "vitest": "2.1.9",
104
104
  "vitest-mock-process": "1.0.4"
105
105
  },
106
- "gitHead": "c32639354792b7678f023b42e6e85cfd1d942d42"
106
+ "gitHead": "942f3d5baac187dc0f64ed7234d98201e6703353"
107
107
  }
@@ -27,25 +27,39 @@ const POSITION = /^:(\d+)(?::(\d+))?/;
27
27
 
28
28
  const QUOTED = /"([^"]+)"/;
29
29
 
30
- const toFinding = (site: Site, { type, message }: Warning): Finding => {
31
- const clean = stripVTControlCharacters(message).trim();
32
- const importer = IMPORT_TYPES.has(type)
33
- ? IMPORTERS.map((pattern) => pattern.exec(clean)?.[1]).find(Boolean)
34
- : undefined;
30
+ const toFinding = (site: Site, warning: Warning): Finding => {
31
+ const clean = stripVTControlCharacters(warning.message).trim();
32
+ const importer =
33
+ warning.file == null && IMPORT_TYPES.has(warning.type)
34
+ ? IMPORTERS.map((pattern) => pattern.exec(clean)?.[1]).find(Boolean)
35
+ : undefined;
35
36
  // Missing nav pages are always about the config, even when the page looks like a file
36
- const match = importer || type === 'missing-nav-page' ? null : FILE_IN_MESSAGE.exec(clean);
37
+ const match =
38
+ warning.file != null || importer || warning.type === 'missing-nav-page'
39
+ ? null
40
+ : FILE_IN_MESSAGE.exec(clean);
37
41
  const found = importer ?? match?.[0];
38
- const file = found ? normalizeRelativePath(toPosixPath(found)) : site.configFile;
42
+ const file =
43
+ warning.file ?? (found ? normalizeRelativePath(toPosixPath(found)) : site.configFile);
39
44
  const position = match ? POSITION.exec(clean.slice(match.index + match[0].length)) : null;
40
45
  // Config warnings quote the entry they're about, such as a navigation page
41
- const quoted = file === site.configFile ? QUOTED.exec(clean)?.[0] : undefined;
46
+ const quoted =
47
+ warning.file == null && file === site.configFile ? QUOTED.exec(clean)?.[0] : undefined;
48
+ const located =
49
+ warning.ref != null && warning.line == null
50
+ ? site.locate(file, JSON.stringify(warning.ref))
51
+ : quoted
52
+ ? site.locate(file, quoted)
53
+ : undefined;
42
54
  return {
43
55
  file,
44
- ...(position && {
45
- line: Number(position[1]),
46
- ...(position[2] && { column: Number(position[2]) }),
47
- }),
48
- ...(quoted && site.locate(file, quoted)),
56
+ ...(warning.line != null
57
+ ? { line: warning.line, ...(warning.column != null && { column: warning.column }) }
58
+ : position && {
59
+ line: Number(position[1]),
60
+ ...(position[2] && { column: Number(position[2]) }),
61
+ }),
62
+ ...located,
49
63
  message: clean,
50
64
  };
51
65
  };