@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/diagram.js +14 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainwav/diagram",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Generate architecture diagrams from codebases",
5
5
  "main": "src/diagram.js",
6
6
  "bin": {
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('--fail-on-placeholder', 'Fail if any diagram was a placeholder')
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
- if (options.failOnPlaceholder && summary.placeholders > 0) {
1521
- console.error(chalk.yellow(`⚠️ Manifest includes ${summary.placeholders} placeholder diagram(s)`));
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