mepcli 1.0.0-beta.4 → 1.0.0-beta.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.
@@ -54,7 +54,7 @@ class DependencyPrompt extends base_1.Prompt {
54
54
  const currentItem = choices[current.idx];
55
55
  if (current.val) {
56
56
  // Turning ON
57
- // 1. Check Conflicts (Disable them)
57
+ // 1. Check Conflicts (Disable items that THIS item conflicts with)
58
58
  if (currentItem.conflictsWith) {
59
59
  currentItem.conflictsWith.forEach(conflictVal => {
60
60
  const conflictIdx = choices.findIndex(c => c.value === conflictVal);
@@ -67,6 +67,20 @@ class DependencyPrompt extends base_1.Prompt {
67
67
  }
68
68
  });
69
69
  }
70
+ // [FIX] 1.5. Reverse Conflict Check (Disable items that conflict with THIS item)
71
+ // Check if any currently SELECTED item has a conflict with the item we are enabling
72
+ choices.forEach((other, otherIdx) => {
73
+ // Skip self and unchecked items
74
+ if (otherIdx === current.idx || !this.checkedState[otherIdx])
75
+ return;
76
+ if (other.conflictsWith && other.conflictsWith.includes(currentItem.value)) {
77
+ queue.push({
78
+ idx: otherIdx,
79
+ val: false,
80
+ reason: `Disabled ${other.title} because it conflicts with ${currentItem.title}`
81
+ });
82
+ }
83
+ });
70
84
  // 2. Check Dependencies (Enable them)
71
85
  if (currentItem.dependsOn) {
72
86
  currentItem.dependsOn.forEach(depVal => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mepcli",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.0-beta.5",
4
4
  "description": "Zero-dependency, interactive CLI prompt for Node.js",
5
5
  "repository": {
6
6
  "type": "git",