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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poe-code",
3
- "version": "3.0.252",
3
+ "version": "3.0.253",
4
4
  "description": "CLI tool to configure Poe API for developer workflows.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -13546,12 +13546,27 @@ function createNodeCommand(node, casing, globalLongOptionFlags, execute, presets
13546
13546
  node.aliases.forEach((alias) => group.alias(alias));
13547
13547
  group.addHelpCommand(false);
13548
13548
  addGlobalOptions(group, presetsEnabled, controls);
13549
+ const childNames = new Set(visibleChildren.map((child) => child.name()));
13549
13550
  for (const child of visibleChildren) {
13550
13551
  const isDefaultChild = node.default !== void 0 && node.default.scope.includes("cli") && (child.name() === node.default.name || child.aliases().includes(node.default.name));
13551
- group.addCommand(child, isDefaultChild ? { isDefault: true } : void 0);
13552
+ addCommanderChild(group, child, isDefaultChild, childNames);
13552
13553
  }
13553
13554
  return group;
13554
13555
  }
13556
+ function addCommanderChild(parent, child, isDefault, siblingNames) {
13557
+ if (isDefault && child.name().length === 0) {
13558
+ let internalName = "__toolcraft_default__";
13559
+ let suffix = 2;
13560
+ while (siblingNames.has(internalName)) {
13561
+ internalName = `__toolcraft_default_${suffix}`;
13562
+ suffix += 1;
13563
+ }
13564
+ child.name(internalName);
13565
+ parent.addCommand(child, { hidden: true, isDefault: true });
13566
+ return;
13567
+ }
13568
+ parent.addCommand(child, isDefault ? { isDefault: true } : void 0);
13569
+ }
13555
13570
  function addGlobalOptions(command, presetsEnabled, controls) {
13556
13571
  const options = [];
13557
13572
  if (presetsEnabled) {
@@ -15435,6 +15450,9 @@ async function runCLI(roots, options = {}) {
15435
15450
  }
15436
15451
  );
15437
15452
  };
15453
+ const rootChildNames = new Set(
15454
+ root.children.filter((candidate) => isNodeVisibleInScope(candidate, "cli")).map((candidate) => candidate.name)
15455
+ );
15438
15456
  for (const child of root.children) {
15439
15457
  const command = createNodeCommand(
15440
15458
  child,
@@ -15448,7 +15466,7 @@ async function runCLI(roots, options = {}) {
15448
15466
  continue;
15449
15467
  }
15450
15468
  const isDefaultChild = root.default !== void 0 && root.default.scope.includes("cli") && (command.name() === root.default.name || command.aliases().includes(root.default.name));
15451
- program.addCommand(command, isDefaultChild ? { isDefault: true } : void 0);
15469
+ addCommanderChild(program, command, isDefaultChild, rootChildNames);
15452
15470
  }
15453
15471
  configureCommanderSuggestionOutput(program);
15454
15472
  const unknownCommand = findUnknownCommanderCommand(program, process.argv);