dotmd-cli 0.48.0 → 0.48.1
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/config.mjs +9 -0
- package/src/validate.mjs +7 -2
package/package.json
CHANGED
package/src/config.mjs
CHANGED
|
@@ -66,6 +66,11 @@ const DEFAULTS = {
|
|
|
66
66
|
|
|
67
67
|
taxonomy: {
|
|
68
68
|
surfaces: null,
|
|
69
|
+
// modules: when null (default), the project doesn't enumerate product
|
|
70
|
+
// modules — the modules-required validator silently skips. When set to
|
|
71
|
+
// an array, modules are taxonomy-enforced AND moduleRequiredFor activates.
|
|
72
|
+
// Mirrors the long-standing semantics of `taxonomy.surfaces`.
|
|
73
|
+
modules: null,
|
|
69
74
|
moduleRequiredFor: ['partial', 'paused', 'awaiting', 'queued-after'],
|
|
70
75
|
},
|
|
71
76
|
|
|
@@ -444,6 +449,9 @@ export async function resolveConfig(cwd, explicitConfigPath) {
|
|
|
444
449
|
const validSurfaces = config.taxonomy.surfaces
|
|
445
450
|
? new Set(config.taxonomy.surfaces)
|
|
446
451
|
: null;
|
|
452
|
+
const validModules = config.taxonomy.modules
|
|
453
|
+
? new Set(config.taxonomy.modules)
|
|
454
|
+
: null;
|
|
447
455
|
const moduleRequiredStatuses = new Set(config.taxonomy.moduleRequiredFor);
|
|
448
456
|
|
|
449
457
|
const indexPath = config.index?.path
|
|
@@ -497,6 +505,7 @@ export async function resolveConfig(cwd, explicitConfigPath) {
|
|
|
497
505
|
lifecycle: { archiveStatuses, skipStaleFor, skipWarningsFor, terminalStatuses, filedStatuses },
|
|
498
506
|
|
|
499
507
|
validSurfaces,
|
|
508
|
+
validModules,
|
|
500
509
|
moduleRequiredStatuses,
|
|
501
510
|
|
|
502
511
|
indexPath,
|
package/src/validate.mjs
CHANGED
|
@@ -117,8 +117,13 @@ export function validateDoc(doc, frontmatter, headingTitle, config) {
|
|
|
117
117
|
doc.errors.push({ path: doc.path, level: 'error', message: '`modules` must be a YAML list when present.' });
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
// modules-required gate: only fires when the project has actively declared
|
|
121
|
+
// a module taxonomy (`taxonomy.modules` is an array). Repos with no product
|
|
122
|
+
// modules (CLIs, dev tooling, single-domain apps) shouldn't be forced to
|
|
123
|
+
// sprinkle `modules: [none]` on every plan as a sentinel. Mirrors the
|
|
124
|
+
// long-standing `taxonomy.surfaces` opt-in semantics.
|
|
125
|
+
if (config.validModules && config.moduleRequiredStatuses.has(doc.status) && !doc.modules?.length) {
|
|
126
|
+
doc.errors.push({ path: doc.path, level: 'error', message: '`modules` is required for this status; declare a real module from `taxonomy.modules`, or `none` as the explicit no-module sentinel.' });
|
|
122
127
|
}
|
|
123
128
|
|
|
124
129
|
if (config.validSurfaces && !config.lifecycle.skipWarningsFor.has(doc.status)) {
|