@brainwav/diagram 1.0.6 → 1.0.7
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/diagram.js +14 -3
package/package.json
CHANGED
package/src/diagram.js
CHANGED
|
@@ -1469,7 +1469,10 @@ program
|
|
|
1469
1469
|
.option('-d, --manifest-dir <dir>', 'Directory containing manifest.json', '.diagram')
|
|
1470
1470
|
.option('-o, --output <file>', 'Write summary JSON to a file')
|
|
1471
1471
|
.option('--require-types <list>', 'Require all listed diagram types, comma-separated')
|
|
1472
|
-
.option(
|
|
1472
|
+
.option(
|
|
1473
|
+
'--fail-on-placeholder',
|
|
1474
|
+
'Fail if any required diagram was a placeholder (or any placeholder if no required types are set)'
|
|
1475
|
+
)
|
|
1473
1476
|
.action(async (targetPath, options) => {
|
|
1474
1477
|
const root = resolveRootPathOrExit(targetPath);
|
|
1475
1478
|
const manifestDir = path.join(root, options.manifestDir || '.diagram');
|
|
@@ -1517,8 +1520,16 @@ program
|
|
|
1517
1520
|
process.exit(2);
|
|
1518
1521
|
}
|
|
1519
1522
|
|
|
1520
|
-
|
|
1521
|
-
|
|
1523
|
+
const placeholderTypesToCheck = required.length > 0
|
|
1524
|
+
? summary.placeholderTypes.filter((type) => required.includes(type))
|
|
1525
|
+
: summary.placeholderTypes;
|
|
1526
|
+
|
|
1527
|
+
if (options.failOnPlaceholder && placeholderTypesToCheck.length > 0) {
|
|
1528
|
+
console.error(
|
|
1529
|
+
chalk.yellow(
|
|
1530
|
+
`⚠️ Manifest includes ${placeholderTypesToCheck.length} required placeholder diagram(s): ${placeholderTypesToCheck.join(', ')}`
|
|
1531
|
+
)
|
|
1532
|
+
);
|
|
1522
1533
|
process.exit(2);
|
|
1523
1534
|
}
|
|
1524
1535
|
|