poe-code 3.0.252 → 3.0.253

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.
@@ -13618,12 +13618,27 @@ function createNodeCommand(node, casing, globalLongOptionFlags, execute, presets
13618
13618
  node.aliases.forEach((alias) => group.alias(alias));
13619
13619
  group.addHelpCommand(false);
13620
13620
  addGlobalOptions(group, presetsEnabled, controls);
13621
+ const childNames = new Set(visibleChildren.map((child) => child.name()));
13621
13622
  for (const child of visibleChildren) {
13622
13623
  const isDefaultChild = node.default !== void 0 && node.default.scope.includes("cli") && (child.name() === node.default.name || child.aliases().includes(node.default.name));
13623
- group.addCommand(child, isDefaultChild ? { isDefault: true } : void 0);
13624
+ addCommanderChild(group, child, isDefaultChild, childNames);
13624
13625
  }
13625
13626
  return group;
13626
13627
  }
13628
+ function addCommanderChild(parent, child, isDefault, siblingNames) {
13629
+ if (isDefault && child.name().length === 0) {
13630
+ let internalName = "__toolcraft_default__";
13631
+ let suffix = 2;
13632
+ while (siblingNames.has(internalName)) {
13633
+ internalName = `__toolcraft_default_${suffix}`;
13634
+ suffix += 1;
13635
+ }
13636
+ child.name(internalName);
13637
+ parent.addCommand(child, { hidden: true, isDefault: true });
13638
+ return;
13639
+ }
13640
+ parent.addCommand(child, isDefault ? { isDefault: true } : void 0);
13641
+ }
13627
13642
  function addGlobalOptions(command, presetsEnabled, controls) {
13628
13643
  const options = [];
13629
13644
  if (presetsEnabled) {
@@ -15507,6 +15522,9 @@ async function runCLI(roots, options = {}) {
15507
15522
  }
15508
15523
  );
15509
15524
  };
15525
+ const rootChildNames = new Set(
15526
+ root.children.filter((candidate) => isNodeVisibleInScope(candidate, "cli")).map((candidate) => candidate.name)
15527
+ );
15510
15528
  for (const child of root.children) {
15511
15529
  const command = createNodeCommand(
15512
15530
  child,
@@ -15520,7 +15538,7 @@ async function runCLI(roots, options = {}) {
15520
15538
  continue;
15521
15539
  }
15522
15540
  const isDefaultChild = root.default !== void 0 && root.default.scope.includes("cli") && (command.name() === root.default.name || command.aliases().includes(root.default.name));
15523
- program.addCommand(command, isDefaultChild ? { isDefault: true } : void 0);
15541
+ addCommanderChild(program, command, isDefaultChild, rootChildNames);
15524
15542
  }
15525
15543
  configureCommanderSuggestionOutput(program);
15526
15544
  const unknownCommand = findUnknownCommanderCommand(program, process.argv);