dotmd-cli 0.76.4 → 0.76.5
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 +1 -1
- package/src/validate.mjs +5 -7
package/package.json
CHANGED
package/src/validate.mjs
CHANGED
|
@@ -262,17 +262,15 @@ export function validateDoc(doc, frontmatter, headingTitle, config) {
|
|
|
262
262
|
const skipRefValidation = config.lifecycle.isTerminal?.(doc.status, doc.type)
|
|
263
263
|
?? config.lifecycle.terminalStatuses.has(doc.status);
|
|
264
264
|
if (!skipRefValidation) {
|
|
265
|
-
const compatibilityWarning = config.lifecycle.skipsWarnings(doc.status, doc.type);
|
|
266
265
|
for (const field of allRefFields) {
|
|
267
266
|
for (const relPath of (doc.refFields[field] || [])) {
|
|
268
267
|
if (!resolveRefPath(relPath, docDir, config.repoRoot)) {
|
|
269
|
-
|
|
268
|
+
doc.errors.push({
|
|
270
269
|
path: doc.path,
|
|
271
|
-
level:
|
|
270
|
+
level: 'error',
|
|
272
271
|
message: `${field} entry \`${relPath}\` does not resolve to an existing file.`,
|
|
273
|
-
meta: { kind:
|
|
274
|
-
};
|
|
275
|
-
(compatibilityWarning ? doc.warnings : doc.errors).push(issue);
|
|
272
|
+
meta: { kind: 'ref-resolution', field, relPath },
|
|
273
|
+
});
|
|
276
274
|
}
|
|
277
275
|
}
|
|
278
276
|
}
|
|
@@ -328,7 +326,7 @@ function candidatePathsForType(docs, type) {
|
|
|
328
326
|
// name implies one (e.g. `related_plans` → plans only).
|
|
329
327
|
export function enrichRefErrorSuggestions(docs, config) {
|
|
330
328
|
const enrich = (entry) => {
|
|
331
|
-
if (!entry?.meta ||
|
|
329
|
+
if (!entry?.meta || entry.meta.kind !== 'ref-resolution') return;
|
|
332
330
|
if (entry._suggested) return;
|
|
333
331
|
const inferred = inferRefFieldType(entry.meta.field);
|
|
334
332
|
const candidates = candidatePathsForType(docs, inferred);
|