@gunshi/plugin 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
@@ -1297,7 +1297,8 @@ interface CommandEnvironment<G extends GunshiParamsConstraint = DefaultGunshiPar
1297
1297
  * The entry command of the CLI, marked with `entry: true`.
1298
1298
  *
1299
1299
  * It is available whether or not the CLI has sub-commands, while {@linkcode CommandEnvironment.subCommands}
1300
- * includes the entry command only when the sub-commands are given with {@linkcode CliOptions.subCommands}.
1300
+ * includes the entry command only when the CLI has sub-commands, given with {@linkcode CliOptions.subCommands}
1301
+ * or with {@linkcode Command.subCommands} of the entry command.
1301
1302
  * It is not frozen, like the commands in {@linkcode CommandEnvironment.subCommands}.
1302
1303
  */
1303
1304
  entryCommand?: Command<any> | LazyCommand<any>;
@@ -1372,8 +1373,11 @@ interface CliOptions<G extends GunshiParamsConstraint = DefaultGunshiParams> {
1372
1373
  version?: string;
1373
1374
  /**
1374
1375
  * Sub commands.
1376
+ *
1377
+ * An object or a Map keyed by the sub-command names, or an array of commands, which are keyed by their names.
1378
+ * When this is not given, the {@linkcode Command.subCommands} of the entry command are the sub-commands.
1375
1379
  */
1376
- subCommands?: Record<string, SubCommandable> | Map<string, SubCommandable>;
1380
+ subCommands?: Record<string, SubCommandable> | Map<string, SubCommandable> | readonly SubCommandable[];
1377
1381
  /**
1378
1382
  * Left margin of the command output.
1379
1383
  */
@@ -1705,10 +1709,13 @@ interface Command<G extends GunshiParamsConstraint = DefaultGunshiParams> {
1705
1709
  *
1706
1710
  * Allows building command trees like `git remote add`.
1707
1711
  * Each key is the sub-command name, and the value is a command or lazy command.
1712
+ * An array of commands is keyed by the names of the commands.
1713
+ *
1714
+ * On the entry command, these are the top-level sub-commands when {@linkcode CliOptions.subCommands} is not given.
1708
1715
  *
1709
1716
  * @since v0.28.0
1710
1717
  */
1711
- subCommands?: Record<string, SubCommandable> | Map<string, SubCommandable>;
1718
+ subCommands?: Record<string, SubCommandable> | Map<string, SubCommandable> | readonly SubCommandable[];
1712
1719
  }
1713
1720
  /**
1714
1721
  * Lazy command interface.
@@ -1785,7 +1792,7 @@ interface SubCommandable {
1785
1792
  * @see {@link Command.subCommands}
1786
1793
  * @since v0.28.0
1787
1794
  */
1788
- subCommands?: Record<string, any> | Map<string, any>;
1795
+ subCommands?: Record<string, any> | Map<string, any> | readonly any[];
1789
1796
  /**
1790
1797
  * Index signature to allow additional properties
1791
1798
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gunshi/plugin",
3
3
  "description": "plugin development kit for gunshi",
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"
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "deno": "^2.7.14",
55
- "gunshi": "1.0.0-rc.2",
55
+ "gunshi": "1.0.0-rc.3",
56
56
  "jsr": "^0.14.3",
57
57
  "jsr-exports-lint": "^0.4.2",
58
58
  "publint": "^0.3.20",