@gunshi/definition 1.0.0-rc.2 → 1.0.0-rc.3

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/lib/index.d.ts +11 -4
  2. package/package.json +2 -2
package/lib/index.d.ts CHANGED
@@ -1034,7 +1034,8 @@ interface CommandEnvironment<G extends GunshiParamsConstraint = DefaultGunshiPar
1034
1034
  * The entry command of the CLI, marked with `entry: true`.
1035
1035
  *
1036
1036
  * It is available whether or not the CLI has sub-commands, while {@linkcode CommandEnvironment.subCommands}
1037
- * includes the entry command only when the sub-commands are given with {@linkcode CliOptions.subCommands}.
1037
+ * includes the entry command only when the CLI has sub-commands, given with {@linkcode CliOptions.subCommands}
1038
+ * or with {@linkcode Command.subCommands} of the entry command.
1038
1039
  * It is not frozen, like the commands in {@linkcode CommandEnvironment.subCommands}.
1039
1040
  */
1040
1041
  entryCommand?: Command<any> | LazyCommand<any>;
@@ -1109,8 +1110,11 @@ interface CliOptions<G extends GunshiParamsConstraint = DefaultGunshiParams> {
1109
1110
  version?: string;
1110
1111
  /**
1111
1112
  * Sub commands.
1113
+ *
1114
+ * An object or a Map keyed by the sub-command names, or an array of commands, which are keyed by their names.
1115
+ * When this is not given, the {@linkcode Command.subCommands} of the entry command are the sub-commands.
1112
1116
  */
1113
- subCommands?: Record<string, SubCommandable> | Map<string, SubCommandable>;
1117
+ subCommands?: Record<string, SubCommandable> | Map<string, SubCommandable> | readonly SubCommandable[];
1114
1118
  /**
1115
1119
  * Left margin of the command output.
1116
1120
  */
@@ -1442,10 +1446,13 @@ interface Command<G extends GunshiParamsConstraint = DefaultGunshiParams> {
1442
1446
  *
1443
1447
  * Allows building command trees like `git remote add`.
1444
1448
  * Each key is the sub-command name, and the value is a command or lazy command.
1449
+ * An array of commands is keyed by the names of the commands.
1450
+ *
1451
+ * On the entry command, these are the top-level sub-commands when {@linkcode CliOptions.subCommands} is not given.
1445
1452
  *
1446
1453
  * @since v0.28.0
1447
1454
  */
1448
- subCommands?: Record<string, SubCommandable> | Map<string, SubCommandable>;
1455
+ subCommands?: Record<string, SubCommandable> | Map<string, SubCommandable> | readonly SubCommandable[];
1449
1456
  }
1450
1457
  /**
1451
1458
  * Lazy command interface.
@@ -1522,7 +1529,7 @@ interface SubCommandable {
1522
1529
  * @see {@link Command.subCommands}
1523
1530
  * @since v0.28.0
1524
1531
  */
1525
- subCommands?: Record<string, any> | Map<string, any>;
1532
+ subCommands?: Record<string, any> | Map<string, any> | readonly any[];
1526
1533
  /**
1527
1534
  * Index signature to allow additional properties
1528
1535
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gunshi/definition",
3
3
  "description": "utilities for gunshi command definition",
4
- "version": "1.0.0-rc.2",
4
+ "version": "1.0.0-rc.3",
5
5
  "author": {
6
6
  "name": "kazuya kawaguchi",
7
7
  "email": "kawakazu80@gmail.com"
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "deno": "^2.7.14",
56
- "gunshi": "1.0.0-rc.2",
56
+ "gunshi": "1.0.0-rc.3",
57
57
  "jsr": "^0.14.3",
58
58
  "jsr-exports-lint": "^0.4.2",
59
59
  "publint": "^0.3.20",