@h3ravel/musket 0.6.17 → 0.6.18

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/dist/index.cjs CHANGED
@@ -510,10 +510,18 @@ var Signature = class Signature {
510
510
  } else flags.push(part);
511
511
  }
512
512
  }
513
- const desc = description.match(/^([^:]+?)\s*:\s*\[?([\w\s,]+)\]?$/);
514
- if (match) {
515
- description = desc?.[1].trim() ?? description;
516
- choices = desc?.[2].split(",").map((s) => s.trim()).filter(Boolean) ?? choices;
513
+ /**
514
+ * Extract choices from the descriptions.
515
+ *
516
+ * Choices can be in the format:
517
+ * [choice1, choice2, choice3]
518
+ * choice1, choice2, choice3
519
+ * choices can have dots as well: [opt1.val, opt2.val]
520
+ */
521
+ const desc = description.match(/\[([^\]]+)\]/) || description.match(/: ([^:\[\]]+(?:,[^:\[\]]+)*)$/);
522
+ if (desc) {
523
+ description = description.replace(desc[0], "").trim();
524
+ choices = desc[1].split(",").map((c) => c.trim());
517
525
  }
518
526
  options.push({
519
527
  name: isFlag ? flags[flags.length - 1] : name,
package/dist/index.js CHANGED
@@ -486,10 +486,18 @@ var Signature = class Signature {
486
486
  } else flags.push(part);
487
487
  }
488
488
  }
489
- const desc = description.match(/^([^:]+?)\s*:\s*\[?([\w\s,]+)\]?$/);
490
- if (match) {
491
- description = desc?.[1].trim() ?? description;
492
- choices = desc?.[2].split(",").map((s) => s.trim()).filter(Boolean) ?? choices;
489
+ /**
490
+ * Extract choices from the descriptions.
491
+ *
492
+ * Choices can be in the format:
493
+ * [choice1, choice2, choice3]
494
+ * choice1, choice2, choice3
495
+ * choices can have dots as well: [opt1.val, opt2.val]
496
+ */
497
+ const desc = description.match(/\[([^\]]+)\]/) || description.match(/: ([^:\[\]]+(?:,[^:\[\]]+)*)$/);
498
+ if (desc) {
499
+ description = description.replace(desc[0], "").trim();
500
+ choices = desc[1].split(",").map((c) => c.trim());
493
501
  }
494
502
  options.push({
495
503
  name: isFlag ? flags[flags.length - 1] : name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h3ravel/musket",
3
- "version": "0.6.17",
3
+ "version": "0.6.18",
4
4
  "description": "Musket CLI is a framework-agnostic CLI framework designed to allow you build artisan-like CLI apps and for use in the H3ravel framework.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -63,7 +63,7 @@
63
63
  "vitest": "^3.2.4"
64
64
  },
65
65
  "dependencies": {
66
- "@h3ravel/shared": "^0.29.0-alpha.8",
66
+ "@h3ravel/shared": "^0.28.4",
67
67
  "chalk": "^5.6.2",
68
68
  "commander": "^14.0.1",
69
69
  "dayjs": "^1.11.18",