@gunshi/plugin-renderer 1.0.0-beta.1 → 1.0.0-beta.2

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/lib/index.d.ts CHANGED
@@ -688,7 +688,7 @@ interface UsageRendererExtension<G extends GunshiParams<any> = DefaultGunshiPara
688
688
  *
689
689
  * @returns A list of commands loaded from the usage renderer plugin. At the top-level entry,
690
690
  * the list includes the CLI entry command even when a plugin registered the other commands
691
- * without adding the entry to `env.subCommands`.
691
+ * without adding the entry to `env.subCommands`; nested lists use their local entry.
692
692
  */
693
693
  loadCommands: <G extends GunshiParams = DefaultGunshiParams>() => Promise<Command<G>[]>;
694
694
  /**
package/lib/index.js CHANGED
@@ -717,6 +717,11 @@ async function resolveDisplayValue(ctx, key) {
717
717
  if ((schema.type === "boolean" || schema.type === "number" || schema.type === "string" || schema.type === "custom") && schema.default !== void 0) return `(${await generateDefaultDisplayValue(ctx, schema)})`;
718
718
  if (schema.type === "enum") {
719
719
  const _default = schema.default === void 0 ? "" : await generateDefaultDisplayValue(ctx, schema);
720
+ /**
721
+ * NOTE(kazupon): an `enum` argument that has a `parse` function needs no `choices`, as args-tokens
722
+ * resolves its value with the function. There is no list to show then (#800).
723
+ */
724
+ if (!Array.isArray(schema.choices)) return _default ? `(${_default})` : "";
720
725
  const choices = `${await ctx.extensions[pluginId].text(resolveBuiltInKey("CHOICES"))}: ${schema.choices.join(" | ")}`;
721
726
  return `(${_default ? `${_default}, ${choices}` : choices})`;
722
727
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gunshi/plugin-renderer",
3
3
  "description": "usage renderer plugin for gunshi",
4
- "version": "1.0.0-beta.1",
4
+ "version": "1.0.0-beta.2",
5
5
  "author": {
6
6
  "name": "kazuya kawaguchi",
7
7
  "email": "kawakazu80@gmail.com"
@@ -53,13 +53,13 @@
53
53
  }
54
54
  },
55
55
  "dependencies": {
56
- "@gunshi/plugin": "1.0.0-beta.1"
56
+ "@gunshi/plugin": "1.0.0-beta.2"
57
57
  },
58
58
  "peerDependencies": {
59
- "@gunshi/plugin-i18n": "1.0.0-beta.1"
59
+ "@gunshi/plugin-i18n": "1.0.0-beta.2"
60
60
  },
61
61
  "devDependencies": {
62
- "@gunshi/shared": "1.0.0-beta.1",
62
+ "@gunshi/shared": "1.0.0-beta.2",
63
63
  "deno": "^2.7.14",
64
64
  "jsr": "^0.14.3",
65
65
  "jsr-exports-lint": "^0.4.2",