@gunshi/bone 0.29.3 → 0.29.4

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.js +5 -16
  2. package/package.json +7 -7
package/lib/index.js CHANGED
@@ -194,7 +194,6 @@ function hasLongOptionPrefix(arg) {
194
194
  function hasOptionValue(value) {
195
195
  return !(value == null) && value.codePointAt(0) !== HYPHEN_CODE;
196
196
  }
197
-
198
197
  //#endregion
199
198
  //#region ../../node_modules/.pnpm/args-tokens@0.24.3/node_modules/args-tokens/lib/utils.js
200
199
  /**
@@ -217,7 +216,6 @@ function hasOptionValue(value) {
217
216
  function kebabnize(str) {
218
217
  return str.replace(/[A-Z]/g, (match, offset) => (offset > 0 ? "-" : "") + match.toLowerCase());
219
218
  }
220
-
221
219
  //#endregion
222
220
  //#region ../../node_modules/.pnpm/args-tokens@0.24.3/node_modules/args-tokens/lib/resolver.js
223
221
  /**
@@ -518,7 +516,6 @@ function checkConflicts(args, explicit, toKebab, actualInputNames) {
518
516
  }
519
517
  return [];
520
518
  }
521
-
522
519
  //#endregion
523
520
  //#region ../gunshi/src/constants.ts
524
521
  const ANONYMOUS_COMMAND_NAME = "(anonymous)";
@@ -543,7 +540,6 @@ const CLI_OPTIONS_DEFAULT = {
543
540
  plugins: void 0,
544
541
  fallbackToEntry: false
545
542
  };
546
-
547
543
  //#endregion
548
544
  //#region ../gunshi/src/utils.ts
549
545
  /**
@@ -648,7 +644,6 @@ function deepFreeze(obj, ignores = []) {
648
644
  }
649
645
  return Object.freeze(obj);
650
646
  }
651
-
652
647
  //#endregion
653
648
  //#region ../gunshi/src/context.ts
654
649
  /**
@@ -733,11 +728,10 @@ async function createCommandContext({ args = {}, explicit = {}, values = {}, pos
733
728
  return deepFreeze(core, ["extensions"]);
734
729
  }
735
730
  function getCommandName(cmd) {
736
- if (isLazyCommand(cmd)) return cmd.commandName || cmd.name || ANONYMOUS_COMMAND_NAME;
737
- else if (typeof cmd === "object") return cmd.name || ANONYMOUS_COMMAND_NAME;
731
+ if (isLazyCommand(cmd)) return cmd.commandName || cmd.name || "(anonymous)";
732
+ else if (typeof cmd === "object") return cmd.name || "(anonymous)";
738
733
  else return ANONYMOUS_COMMAND_NAME;
739
734
  }
740
-
741
735
  //#endregion
742
736
  //#region ../gunshi/src/decorators.ts
743
737
  const EMPTY_RENDERER = () => Promise.resolve("");
@@ -802,7 +796,6 @@ function createDecorators() {
802
796
  }
803
797
  });
804
798
  }
805
-
806
799
  //#endregion
807
800
  //#region ../gunshi/src/plugin/context.ts
808
801
  /**
@@ -857,7 +850,6 @@ function createPluginContext(decorators, initialSubCommands) {
857
850
  }
858
851
  });
859
852
  }
860
-
861
853
  //#endregion
862
854
  //#region ../gunshi/src/plugin/dependency.ts
863
855
  /**
@@ -895,7 +887,6 @@ function resolveDependencies(plugins) {
895
887
  for (const plugin of plugins) visit(plugin);
896
888
  return sorted;
897
889
  }
898
-
899
890
  //#endregion
900
891
  //#region ../gunshi/src/cli/core.ts
901
892
  /**
@@ -986,7 +977,7 @@ function createInitialSubCommands(options, entryCmd) {
986
977
  const entryCopy = Object.assign(create(), entryCmd, { entry: true });
987
978
  subCommands.set(resolveEntryName(entryCopy), entryCopy);
988
979
  } else if (typeof entryCmd === "function") {
989
- const name = entryCmd.name || ANONYMOUS_COMMAND_NAME;
980
+ const name = entryCmd.name || "(anonymous)";
990
981
  subCommands.set(name, {
991
982
  run: entryCmd,
992
983
  name,
@@ -1103,7 +1094,7 @@ function resolveCommandTree(tokens, entry, options) {
1103
1094
  };
1104
1095
  }
1105
1096
  function resolveEntryName(entry) {
1106
- return isLazyCommand(entry) ? entry.commandName || ANONYMOUS_COMMAND_NAME : entry.name || ANONYMOUS_COMMAND_NAME;
1097
+ return isLazyCommand(entry) ? entry.commandName || "(anonymous)" : entry.name || "(anonymous)";
1107
1098
  }
1108
1099
  function getPluginExtensions(plugins) {
1109
1100
  const extensions = create();
@@ -1131,7 +1122,6 @@ async function executeCommand(cmd, ctx, decorators) {
1131
1122
  throw error;
1132
1123
  }
1133
1124
  }
1134
-
1135
1125
  //#endregion
1136
1126
  //#region ../gunshi/src/cli/bone.ts
1137
1127
  /**
@@ -1151,6 +1141,5 @@ async function executeCommand(cmd, ctx, decorators) {
1151
1141
  async function cli(args, entry, options = {}) {
1152
1142
  return cliCore(args, entry, options, []);
1153
1143
  }
1154
-
1155
1144
  //#endregion
1156
- export { cli };
1145
+ export { cli };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gunshi/bone",
3
3
  "description": "gunshi minimum",
4
- "version": "0.29.3",
4
+ "version": "0.29.4",
5
5
  "author": {
6
6
  "name": "kazuya kawaguchi",
7
7
  "email": "kawakazu80@gmail.com"
@@ -51,15 +51,15 @@
51
51
  }
52
52
  },
53
53
  "devDependencies": {
54
- "deno": "^2.7.4",
55
- "jsr": "^0.13.5",
54
+ "deno": "^2.7.11",
55
+ "jsr": "^0.14.3",
56
56
  "jsr-exports-lint": "^0.4.2",
57
57
  "publint": "^0.3.18",
58
58
  "tsdown": "0.15.12",
59
- "@gunshi/definition": "0.29.3",
60
- "@gunshi/plugin-global": "0.29.3",
61
- "gunshi": "0.29.3",
62
- "@gunshi/plugin-renderer": "0.29.3"
59
+ "@gunshi/definition": "0.29.4",
60
+ "@gunshi/plugin-global": "0.29.4",
61
+ "@gunshi/plugin-renderer": "0.29.4",
62
+ "gunshi": "0.29.4"
63
63
  },
64
64
  "scripts": {
65
65
  "build": "tsdown",