@shell-shock/core 0.17.10 → 0.17.11

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 (257) hide show
  1. package/dist/api.cjs +31 -143
  2. package/dist/api.cjs.map +1 -0
  3. package/dist/api.d.cts +2 -77
  4. package/dist/api.d.cts.map +1 -1
  5. package/dist/api.d.mts +2 -76
  6. package/dist/api.d.mts.map +1 -1
  7. package/dist/api.mjs +30 -140
  8. package/dist/api.mjs.map +1 -1
  9. package/dist/components/command-validation-logic.cjs +14 -15
  10. package/dist/components/command-validation-logic.cjs.map +1 -0
  11. package/dist/components/command-validation-logic.d.cts +1 -3
  12. package/dist/components/command-validation-logic.d.cts.map +1 -1
  13. package/dist/components/command-validation-logic.d.mts +1 -3
  14. package/dist/components/command-validation-logic.d.mts.map +1 -1
  15. package/dist/components/command-validation-logic.mjs +12 -13
  16. package/dist/components/command-validation-logic.mjs.map +1 -1
  17. package/dist/components/docs.cjs +6 -6
  18. package/dist/components/docs.cjs.map +1 -0
  19. package/dist/components/docs.d.cts +4 -5
  20. package/dist/components/docs.d.cts.map +1 -1
  21. package/dist/components/docs.d.mts +4 -5
  22. package/dist/components/docs.d.mts.map +1 -1
  23. package/dist/components/docs.mjs +4 -4
  24. package/dist/components/docs.mjs.map +1 -1
  25. package/dist/components/exec-builtin.cjs +9 -11
  26. package/dist/components/exec-builtin.cjs.map +1 -0
  27. package/dist/components/exec-builtin.d.cts +1 -2
  28. package/dist/components/exec-builtin.d.cts.map +1 -1
  29. package/dist/components/exec-builtin.d.mts +1 -2
  30. package/dist/components/exec-builtin.d.mts.map +1 -1
  31. package/dist/components/exec-builtin.mjs +7 -10
  32. package/dist/components/exec-builtin.mjs.map +1 -1
  33. package/dist/components/helpers.cjs +4 -5
  34. package/dist/components/helpers.cjs.map +1 -0
  35. package/dist/components/helpers.d.cts +6 -8
  36. package/dist/components/helpers.d.cts.map +1 -1
  37. package/dist/components/helpers.d.mts +6 -8
  38. package/dist/components/helpers.d.mts.map +1 -1
  39. package/dist/components/helpers.mjs +2 -3
  40. package/dist/components/helpers.mjs.map +1 -1
  41. package/dist/components/options-parser-logic.cjs +29 -30
  42. package/dist/components/options-parser-logic.cjs.map +1 -0
  43. package/dist/components/options-parser-logic.d.cts +8 -9
  44. package/dist/components/options-parser-logic.d.cts.map +1 -1
  45. package/dist/components/options-parser-logic.d.mts +8 -9
  46. package/dist/components/options-parser-logic.d.mts.map +1 -1
  47. package/dist/components/options-parser-logic.mjs +27 -28
  48. package/dist/components/options-parser-logic.mjs.map +1 -1
  49. package/dist/components/state-builtin.cjs +3 -2
  50. package/dist/components/state-builtin.cjs.map +1 -0
  51. package/dist/components/state-builtin.d.cts +4 -5
  52. package/dist/components/state-builtin.d.cts.map +1 -1
  53. package/dist/components/state-builtin.d.mts +4 -5
  54. package/dist/components/state-builtin.d.mts.map +1 -1
  55. package/dist/components/state-builtin.mjs +1 -1
  56. package/dist/components/state-builtin.mjs.map +1 -1
  57. package/dist/components/usage.cjs +4 -5
  58. package/dist/components/usage.cjs.map +1 -0
  59. package/dist/components/usage.d.cts +1 -2
  60. package/dist/components/usage.d.cts.map +1 -1
  61. package/dist/components/usage.d.mts +1 -2
  62. package/dist/components/usage.d.mts.map +1 -1
  63. package/dist/components/usage.mjs +2 -3
  64. package/dist/components/usage.mjs.map +1 -1
  65. package/dist/components/utils-builtin.cjs +5 -4
  66. package/dist/components/utils-builtin.cjs.map +1 -0
  67. package/dist/components/utils-builtin.d.cts +7 -8
  68. package/dist/components/utils-builtin.d.cts.map +1 -1
  69. package/dist/components/utils-builtin.d.mts +7 -8
  70. package/dist/components/utils-builtin.d.mts.map +1 -1
  71. package/dist/components/utils-builtin.mjs +3 -3
  72. package/dist/components/utils-builtin.mjs.map +1 -1
  73. package/dist/config.cjs +53 -19
  74. package/dist/config.cjs.map +1 -0
  75. package/dist/config.d.cts +29 -8
  76. package/dist/config.d.cts.map +1 -1
  77. package/dist/config.d.mts +29 -8
  78. package/dist/config.d.mts.map +1 -1
  79. package/dist/config.mjs +51 -18
  80. package/dist/config.mjs.map +1 -1
  81. package/dist/contexts/command.cjs +2 -2
  82. package/dist/contexts/command.cjs.map +1 -0
  83. package/dist/contexts/command.d.cts.map +1 -1
  84. package/dist/contexts/command.d.mts.map +1 -1
  85. package/dist/contexts/command.mjs.map +1 -1
  86. package/dist/contexts/options.cjs +4 -4
  87. package/dist/contexts/options.cjs.map +1 -0
  88. package/dist/contexts/options.d.cts.map +1 -1
  89. package/dist/contexts/options.d.mts.map +1 -1
  90. package/dist/contexts/options.mjs +2 -3
  91. package/dist/contexts/options.mjs.map +1 -1
  92. package/dist/engine.cjs +138 -0
  93. package/dist/engine.cjs.map +1 -0
  94. package/dist/engine.d.cts +79 -0
  95. package/dist/engine.d.cts.map +1 -0
  96. package/dist/engine.d.mts +79 -0
  97. package/dist/engine.d.mts.map +1 -0
  98. package/dist/engine.mjs +136 -0
  99. package/dist/engine.mjs.map +1 -0
  100. package/dist/helpers/automd.cjs +6 -7
  101. package/dist/helpers/automd.cjs.map +1 -0
  102. package/dist/helpers/automd.mjs +2 -3
  103. package/dist/helpers/automd.mjs.map +1 -1
  104. package/dist/helpers/docs-helpers.cjs +2 -2
  105. package/dist/helpers/docs-helpers.cjs.map +1 -0
  106. package/dist/helpers/docs-helpers.mjs.map +1 -1
  107. package/dist/helpers/get-framework.cjs +24 -0
  108. package/dist/helpers/get-framework.cjs.map +1 -0
  109. package/dist/helpers/get-framework.mjs +24 -0
  110. package/dist/helpers/get-framework.mjs.map +1 -0
  111. package/dist/helpers/paths.cjs +5 -5
  112. package/dist/helpers/paths.cjs.map +1 -0
  113. package/dist/helpers/paths.mjs +4 -4
  114. package/dist/helpers/paths.mjs.map +1 -1
  115. package/dist/helpers/persistence.cjs +4 -6
  116. package/dist/helpers/persistence.cjs.map +1 -0
  117. package/dist/helpers/persistence.mjs +3 -3
  118. package/dist/helpers/persistence.mjs.map +1 -1
  119. package/dist/helpers/update-package-json.cjs +2 -2
  120. package/dist/helpers/update-package-json.cjs.map +1 -0
  121. package/dist/helpers/update-package-json.mjs.map +1 -1
  122. package/dist/helpers/utilities.cjs +3 -3
  123. package/dist/helpers/utilities.cjs.map +1 -0
  124. package/dist/helpers/utilities.mjs +1 -1
  125. package/dist/helpers/utilities.mjs.map +1 -1
  126. package/dist/helpers/validations.cjs +3 -3
  127. package/dist/helpers/validations.cjs.map +1 -0
  128. package/dist/helpers/validations.mjs +1 -3
  129. package/dist/helpers/validations.mjs.map +1 -1
  130. package/dist/index.cjs +121 -51
  131. package/dist/index.cjs.map +1 -0
  132. package/dist/index.d.cts +80 -5
  133. package/dist/index.d.cts.map +1 -0
  134. package/dist/index.d.mts +80 -5
  135. package/dist/index.d.mts.map +1 -0
  136. package/dist/index.mjs +118 -6
  137. package/dist/index.mjs.map +1 -0
  138. package/dist/package.cjs +12 -0
  139. package/dist/package.cjs.map +1 -0
  140. package/dist/package.mjs +6 -0
  141. package/dist/package.mjs.map +1 -0
  142. package/dist/plugin-utils/compute-bin.cjs +8 -10
  143. package/dist/plugin-utils/compute-bin.cjs.map +1 -0
  144. package/dist/plugin-utils/compute-bin.d.cts +2 -2
  145. package/dist/plugin-utils/compute-bin.d.cts.map +1 -1
  146. package/dist/plugin-utils/compute-bin.d.mts +2 -2
  147. package/dist/plugin-utils/compute-bin.d.mts.map +1 -1
  148. package/dist/plugin-utils/compute-bin.mjs +6 -8
  149. package/dist/plugin-utils/compute-bin.mjs.map +1 -1
  150. package/dist/plugin-utils/context-helpers.cjs +7 -14
  151. package/dist/plugin-utils/context-helpers.cjs.map +1 -0
  152. package/dist/plugin-utils/context-helpers.d.cts +4 -4
  153. package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
  154. package/dist/plugin-utils/context-helpers.d.mts +4 -4
  155. package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
  156. package/dist/plugin-utils/context-helpers.mjs +5 -12
  157. package/dist/plugin-utils/context-helpers.mjs.map +1 -1
  158. package/dist/plugin-utils/deepkit.cjs +15 -16
  159. package/dist/plugin-utils/deepkit.cjs.map +1 -0
  160. package/dist/plugin-utils/deepkit.d.cts +5 -5
  161. package/dist/plugin-utils/deepkit.d.cts.map +1 -1
  162. package/dist/plugin-utils/deepkit.d.mts +5 -5
  163. package/dist/plugin-utils/deepkit.d.mts.map +1 -1
  164. package/dist/plugin-utils/deepkit.mjs +14 -15
  165. package/dist/plugin-utils/deepkit.mjs.map +1 -1
  166. package/dist/plugin-utils/description-helpers.cjs +2 -1
  167. package/dist/plugin-utils/description-helpers.cjs.map +1 -0
  168. package/dist/plugin-utils/description-helpers.d.cts.map +1 -1
  169. package/dist/plugin-utils/description-helpers.d.mts.map +1 -1
  170. package/dist/plugin-utils/description-helpers.mjs.map +1 -1
  171. package/dist/plugin-utils/get-command-tree.cjs +2 -1
  172. package/dist/plugin-utils/get-command-tree.cjs.map +1 -0
  173. package/dist/plugin-utils/get-command-tree.d.cts.map +1 -1
  174. package/dist/plugin-utils/get-command-tree.d.mts.map +1 -1
  175. package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
  176. package/dist/plugin-utils/index.cjs +1 -1
  177. package/dist/plugin-utils/index.d.cts +2 -2
  178. package/dist/plugin-utils/index.d.mts +2 -2
  179. package/dist/plugin-utils/index.mjs +2 -2
  180. package/dist/plugin-utils/reflect.cjs +5 -5
  181. package/dist/plugin-utils/reflect.cjs.map +1 -0
  182. package/dist/plugin-utils/reflect.d.cts.map +1 -1
  183. package/dist/plugin-utils/reflect.d.mts.map +1 -1
  184. package/dist/plugin-utils/reflect.mjs +3 -5
  185. package/dist/plugin-utils/reflect.mjs.map +1 -1
  186. package/dist/plugin-utils/traverse-command-tree.cjs +2 -1
  187. package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -0
  188. package/dist/plugin-utils/traverse-command-tree.d.cts.map +1 -1
  189. package/dist/plugin-utils/traverse-command-tree.d.mts.map +1 -1
  190. package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
  191. package/dist/plugin-utils/type-checks.cjs +146 -17
  192. package/dist/plugin-utils/type-checks.cjs.map +1 -0
  193. package/dist/plugin-utils/type-checks.d.cts +5 -5
  194. package/dist/plugin-utils/type-checks.d.cts.map +1 -1
  195. package/dist/plugin-utils/type-checks.d.mts +5 -5
  196. package/dist/plugin-utils/type-checks.d.mts.map +1 -1
  197. package/dist/plugin-utils/type-checks.mjs +145 -16
  198. package/dist/plugin-utils/type-checks.mjs.map +1 -1
  199. package/dist/plugin.cjs +80 -56
  200. package/dist/plugin.cjs.map +1 -0
  201. package/dist/plugin.d.cts.map +1 -1
  202. package/dist/plugin.d.mts.map +1 -1
  203. package/dist/plugin.mjs +75 -52
  204. package/dist/plugin.mjs.map +1 -1
  205. package/dist/resolver/helpers.cjs +33 -24
  206. package/dist/resolver/helpers.cjs.map +1 -0
  207. package/dist/resolver/helpers.mjs +32 -22
  208. package/dist/resolver/helpers.mjs.map +1 -1
  209. package/dist/resolver/resolve.cjs +316 -59
  210. package/dist/resolver/resolve.cjs.map +1 -0
  211. package/dist/resolver/resolve.mjs +313 -56
  212. package/dist/resolver/resolve.mjs.map +1 -1
  213. package/dist/types/command.cjs +43 -82
  214. package/dist/types/command.cjs.map +1 -0
  215. package/dist/types/command.d.cts +61 -119
  216. package/dist/types/command.d.cts.map +1 -1
  217. package/dist/types/command.d.mts +61 -119
  218. package/dist/types/command.d.mts.map +1 -1
  219. package/dist/types/command.mjs +42 -80
  220. package/dist/types/command.mjs.map +1 -1
  221. package/dist/types/config.cjs +45 -4
  222. package/dist/types/config.cjs.map +1 -0
  223. package/dist/types/config.d.cts +15 -10
  224. package/dist/types/config.d.cts.map +1 -1
  225. package/dist/types/config.d.mts +15 -10
  226. package/dist/types/config.d.mts.map +1 -1
  227. package/dist/types/config.mjs +40 -4
  228. package/dist/types/config.mjs.map +1 -1
  229. package/dist/types/context.cjs +9 -1
  230. package/dist/types/context.cjs.map +1 -0
  231. package/dist/types/context.d.cts +3 -2
  232. package/dist/types/context.d.cts.map +1 -1
  233. package/dist/types/context.d.mts +3 -2
  234. package/dist/types/context.d.mts.map +1 -1
  235. package/dist/types/context.mjs +7 -1
  236. package/dist/types/context.mjs.map +1 -1
  237. package/dist/types/env.cjs +2 -1
  238. package/dist/types/env.cjs.map +1 -0
  239. package/dist/types/env.d.cts.map +1 -1
  240. package/dist/types/env.d.mts.map +1 -1
  241. package/dist/types/env.mjs.map +1 -1
  242. package/dist/types/index.cjs +6 -3
  243. package/dist/types/index.d.cts +4 -4
  244. package/dist/types/index.d.mts +4 -4
  245. package/dist/types/index.mjs +4 -4
  246. package/dist/types/options.cjs +2 -1
  247. package/dist/types/options.cjs.map +1 -0
  248. package/dist/types/options.d.cts.map +1 -1
  249. package/dist/types/options.d.mts.map +1 -1
  250. package/dist/types/options.mjs.map +1 -1
  251. package/package.json +43 -35
  252. package/dist/resolver/deepkit.cjs +0 -135
  253. package/dist/resolver/deepkit.mjs +0 -135
  254. package/dist/resolver/deepkit.mjs.map +0 -1
  255. package/dist/resolver/module.cjs +0 -145
  256. package/dist/resolver/module.mjs +0 -145
  257. package/dist/resolver/module.mjs.map +0 -1
@@ -1,6 +1,5 @@
1
1
  import { getAppDescription, getAppName, getAppTitle } from "./context-helpers.mjs";
2
2
  import { joinPaths } from "@stryke/path/join-paths";
3
- import { computed } from "@alloy-js/core";
4
3
 
5
4
  //#region src/plugin-utils/compute-bin.ts
6
5
  function __assignType(fn, args) {
@@ -8,23 +7,22 @@ function __assignType(fn, args) {
8
7
  return fn;
9
8
  }
10
9
  /**
11
- * Compute the command tree for the CLI application, starting from the root bin command. This will be used to determine which commands are available in the CLI application and their respective details.
10
+ * Computes the command tree for the root binary command based on the provided context.
12
11
  *
13
12
  * @param context - The plugin context containing the necessary information to compute the command tree.
14
- * @returns The computed command tree for the CLI application, starting from the root bin command. This will include all commands discovered in the project and their respective details, organized in a hierarchical structure based on their segments and paths.
13
+ * @returns The computed command tree for the root binary command.
15
14
  */
16
15
  function computeBin(context) {
17
- return computed(() => ({
16
+ return {
18
17
  id: "",
19
18
  name: getAppName(context),
20
19
  title: getAppTitle(context),
21
20
  description: getAppDescription(context),
22
- isVirtual: true,
21
+ virtual: true,
23
22
  path: null,
24
23
  segments: [],
25
24
  alias: [],
26
25
  tags: [],
27
- source: "file",
28
26
  options: Object.fromEntries(context.globalOptions.map(__assignType((option) => [option.name, option], [
29
27
  "option",
30
28
  "",
@@ -34,14 +32,14 @@ function computeBin(context) {
34
32
  entry: { file: joinPaths(context.entryPath, "bin.ts") },
35
33
  parent: null,
36
34
  children: context.commands
37
- })).value;
35
+ };
38
36
  }
39
37
  computeBin.__type = [
40
38
  "Context",
41
39
  "context",
42
40
  "CommandTree",
43
41
  "computeBin",
44
- "Compute the command tree for the CLI application, starting from the root bin command. This will be used to determine which commands are available in the CLI application and their respective details.",
42
+ "Computes the command tree for the root binary command based on the provided context.",
45
43
  "P\"w!2\"\"w#/$?%"
46
44
  ];
47
45
 
@@ -1 +1 @@
1
- {"version":3,"file":"compute-bin.mjs","names":[],"sources":["../../src/plugin-utils/compute-bin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { computed } from \"@alloy-js/core\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { CommandTree, Context } from \"../types\";\nimport { getAppDescription, getAppName, getAppTitle } from \"./context-helpers\";\n\n/**\n * Compute the command tree for the CLI application, starting from the root bin command. This will be used to determine which commands are available in the CLI application and their respective details.\n *\n * @param context - The plugin context containing the necessary information to compute the command tree.\n * @returns The computed command tree for the CLI application, starting from the root bin command. This will include all commands discovered in the project and their respective details, organized in a hierarchical structure based on their segments and paths.\n */\nexport function computeBin(context: Context): CommandTree {\n const bin = computed(() => ({\n id: \"\",\n name: getAppName(context),\n title: getAppTitle(context),\n description: getAppDescription(context),\n isVirtual: true,\n path: null,\n segments: [],\n alias: [],\n tags: [],\n source: \"file\",\n options: Object.fromEntries(\n context.globalOptions.map(option => [option.name, option])\n ),\n args: [],\n entry: {\n file: joinPaths(context.entryPath, \"bin.ts\")\n },\n parent: null,\n children: context.commands\n }));\n\n return bin.value;\n}\n"],"mappings":";;;;;AAAA,SAAS,aAAa,IAAI,MAAM;;AAE9B,QAAO;;;;;;;;AA4BT,SAAc,WAAa,SAAG;AAoB5B,QAnBQ,gBAAA;EACN,IAAI;EACJ,MAAM,WAAC,QAAY;EACnB,OAAA,YAAa,QAAA;EACb,aAAW,kBAAI,QAAA;EACf,WAAU;EACV,MAAA;EACA,UAAS,EAAA;EACT,OAAO,EAAC;EACR,MAAM,EAAE;EACR,QAAQ;EACR,SAAS,OAAC,YAAkB,QAAQ,cAAc,IAAE,cAAO,WAAA,CAAA,OAAA,MAAA,OAAA,EAAA;GAAA;GAAA;GAAA;GAAA,CAAA,CAAA,CAAA;EAC3D,MAAC,EAAA;EACD,OAAO,EACP,MAAO,UAAA,QAAA,WAAA,SAAA,EACN;EACD,QAAC;EACD,UAAQ,QAAI;EACb,EACE,CAAA;;AAEL,WAAS,SAAS;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
1
+ {"version":3,"file":"compute-bin.mjs","names":[],"sources":[],"mappings":""}
@@ -1,8 +1,7 @@
1
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
1
  let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
2
+ let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
3
3
  let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
4
4
  let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
5
- let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
6
5
 
7
6
  //#region src/plugin-utils/context-helpers.ts
8
7
  function __assignType(fn, args) {
@@ -53,12 +52,10 @@ function getAppName(context) {
53
52
  return (0, _stryke_string_format_kebab_case.kebabCase)(result);
54
53
  }
55
54
  getAppName.__type = [
56
- "UnresolvedContext",
57
- "Context",
58
55
  "context",
59
56
  "getAppName",
60
57
  "Retrieves the application name from the context and configuration.",
61
- "PP\"w!\"w\"J2#&/$?%"
58
+ "P\"2!&/\"?#"
62
59
  ];
63
60
  /**
64
61
  * Retrieves the application title from the context and configuration.
@@ -72,13 +69,11 @@ function getAppTitle(context, replaceCLI = false) {
72
69
  return (replaceCLI ? title.replace(/(?:cli|command-line|command line)\s*(?:interface\s*)?(?:application|app)?$/gi, "") : title).trim();
73
70
  }
74
71
  getAppTitle.__type = [
75
- "UnresolvedContext",
76
- "Context",
77
72
  "context",
78
73
  "replaceCLI",
79
74
  "getAppTitle",
80
75
  "Retrieves the application title from the context and configuration.",
81
- "PP\"w!\"w\"J2#\"2$&/%?&"
76
+ "P\"2!\"2\"&/#?$"
82
77
  ];
83
78
  /**
84
79
  * Retrieves the application description from the context and configuration.
@@ -90,12 +85,10 @@ function getAppDescription(context) {
90
85
  return context.config.description || context.packageJson?.description || `The ${getAppTitle(context, true)} command-line interface application.`;
91
86
  }
92
87
  getAppDescription.__type = [
93
- "UnresolvedContext",
94
- "Context",
95
88
  "context",
96
89
  "getAppDescription",
97
90
  "Retrieves the application description from the context and configuration.",
98
- "PP\"w!\"w\"J2#&/$?%"
91
+ "P\"2!&/\"?#"
99
92
  ];
100
93
  /**
101
94
  * Retrieves the primary binary name for the application.
@@ -107,11 +100,10 @@ function getAppBin(context) {
107
100
  return (0, _stryke_type_checks_is_set_object.isSetObject)(context.config.bin) ? Object.keys(context.config.bin)[0] : (0, _stryke_string_format_kebab_case.kebabCase)(getAppName(context));
108
101
  }
109
102
  getAppBin.__type = [
110
- "Context",
111
103
  "context",
112
104
  "getAppBin",
113
105
  "Retrieves the primary binary name for the application.",
114
- "P\"w!2\"&/#?$"
106
+ "P\"2!&/\"?#"
115
107
  ];
116
108
  /**
117
109
  * Determines if a given command path segment is variable (enclosed in square brackets).
@@ -228,4 +220,5 @@ exports.getPathSegmentGroupName = getPathSegmentGroupName;
228
220
  exports.getPathSegmentName = getPathSegmentName;
229
221
  exports.isDynamicPathSegment = isDynamicPathSegment;
230
222
  exports.isPathSegmentGroup = isPathSegmentGroup;
231
- exports.sortArgAliases = sortArgAliases;
223
+ exports.sortArgAliases = sortArgAliases;
224
+ //# sourceMappingURL=context-helpers.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-helpers.cjs","names":[],"sources":[],"mappings":""}
@@ -14,7 +14,7 @@ declare function sortArgAliases(aliases: string[]): string[];
14
14
  * @returns The application name in kebab-case format.
15
15
  * @throws An error if no valid application name is found.
16
16
  */
17
- declare function getAppName(context: UnresolvedContext | Context): string;
17
+ declare function getAppName<TContext extends UnresolvedContext | Context>(context: TContext): string;
18
18
  /**
19
19
  * Retrieves the application title from the context and configuration.
20
20
  *
@@ -22,21 +22,21 @@ declare function getAppName(context: UnresolvedContext | Context): string;
22
22
  * @param replaceCLI - Whether to replace CLI-related terms in the title with the application name.
23
23
  * @returns The application title in title-case format.
24
24
  */
25
- declare function getAppTitle(context: UnresolvedContext | Context, replaceCLI?: boolean): string;
25
+ declare function getAppTitle<TContext extends UnresolvedContext | Context>(context: TContext, replaceCLI?: boolean): string;
26
26
  /**
27
27
  * Retrieves the application description from the context and configuration.
28
28
  *
29
29
  * @param context - The build context containing workspace and package information.
30
30
  * @returns The application description.
31
31
  */
32
- declare function getAppDescription(context: UnresolvedContext | Context): string;
32
+ declare function getAppDescription<TContext extends UnresolvedContext | Context>(context: TContext): string;
33
33
  /**
34
34
  * Retrieves the primary binary name for the application.
35
35
  *
36
36
  * @param context - The build context containing workspace and package information.
37
37
  * @returns The primary binary name as a string.
38
38
  */
39
- declare function getAppBin(context: Context): string;
39
+ declare function getAppBin<TContext extends UnresolvedContext | Context>(context: TContext): string;
40
40
  /**
41
41
  * Determines if a given command path segment is variable (enclosed in square brackets).
42
42
  *
@@ -1 +1 @@
1
- {"version":3,"file":"context-helpers.d.cts","names":[],"sources":["../../src/plugin-utils/context-helpers.ts"],"mappings":";;;;;AA8BA;;;iBAAgB,cAAA,CAAe,OAAA;;AAkB/B;;;;;;iBAAgB,UAAA,CAAW,OAAA,EAAS,iBAAA,GAAoB,OAAA;;;AA2BxD;;;;;iBAAgB,WAAA,CACd,OAAA,EAAS,iBAAA,GAAoB,OAAA,EAC7B,UAAA;;;;;AAsBF;;iBAAgB,iBAAA,CACd,OAAA,EAAS,iBAAA,GAAoB,OAAA;;;;;;;iBAef,SAAA,CAAU,OAAA,EAAS,OAAA;;;;;AAkBnC;;;;;AAeA;;;iBAfgB,oBAAA,CAAqB,IAAA;;AAgCrC;;;;;AAgBA;;;;;iBAjCgB,yBAAA,CAA0B,IAAA;;;;;;;;;;;;;;iBAiB1B,kBAAA,CAAmB,IAAA;;;;;;;;;;;;;iBAgBnB,uBAAA,CAAwB,IAAA;;;;;;;;;;;;iBAkBxB,kBAAA,CAAmB,IAAA"}
1
+ {"version":3,"file":"context-helpers.d.cts","names":[],"sources":["../../src/plugin-utils/context-helpers.ts"],"mappings":";;;;;AA8BA;;;iBAAgB,cAAA,CAAe,OAAiB;AAAA;AAkBhD;;;;;;AAlBgD,iBAkBhC,UAAA,kBAA4B,iBAAA,GAAoB,OAAA,EAC9D,OAAA,EAAS,QAAA;;;;;;;;iBA4BK,WAAA,kBAA6B,iBAAA,GAAoB,OAAA,EAC/D,OAAA,EAAS,QAAA,EACT,UAAA;AAFF;;;;;;AAAA,iBAwBgB,iBAAA,kBAAmC,iBAAA,GAAoB,OAAA,EACrE,OAAA,EAAS,QAAA;;;;;;;iBAeK,SAAA,kBAA2B,iBAAA,GAAoB,OAAA,EAC7D,OAAA,EAAS,QAAA;;AAvCS;AAsBpB;;;;;;;;;;iBAoCgB,oBAAA,CAAqB,IAAY;;;;AAnC9B;AAenB;;;;;;;iBAmCgB,yBAAA,CAA0B,IAAY;;;;;;;AAlCnC;AAmBnB;;;;AAAiD;AAejD;iBAiBgB,kBAAA,CAAmB,IAAY;;;AAjBO;AAiBtD;;;;AAA+C;AAgB/C;;;;iBAAgB,uBAAA,CAAwB,IAAY;AAkBpD;;;;AAA+C;;;;;;;AAA/C,iBAAgB,kBAAA,CAAmB,IAAY"}
@@ -14,7 +14,7 @@ declare function sortArgAliases(aliases: string[]): string[];
14
14
  * @returns The application name in kebab-case format.
15
15
  * @throws An error if no valid application name is found.
16
16
  */
17
- declare function getAppName(context: UnresolvedContext | Context): string;
17
+ declare function getAppName<TContext extends UnresolvedContext | Context>(context: TContext): string;
18
18
  /**
19
19
  * Retrieves the application title from the context and configuration.
20
20
  *
@@ -22,21 +22,21 @@ declare function getAppName(context: UnresolvedContext | Context): string;
22
22
  * @param replaceCLI - Whether to replace CLI-related terms in the title with the application name.
23
23
  * @returns The application title in title-case format.
24
24
  */
25
- declare function getAppTitle(context: UnresolvedContext | Context, replaceCLI?: boolean): string;
25
+ declare function getAppTitle<TContext extends UnresolvedContext | Context>(context: TContext, replaceCLI?: boolean): string;
26
26
  /**
27
27
  * Retrieves the application description from the context and configuration.
28
28
  *
29
29
  * @param context - The build context containing workspace and package information.
30
30
  * @returns The application description.
31
31
  */
32
- declare function getAppDescription(context: UnresolvedContext | Context): string;
32
+ declare function getAppDescription<TContext extends UnresolvedContext | Context>(context: TContext): string;
33
33
  /**
34
34
  * Retrieves the primary binary name for the application.
35
35
  *
36
36
  * @param context - The build context containing workspace and package information.
37
37
  * @returns The primary binary name as a string.
38
38
  */
39
- declare function getAppBin(context: Context): string;
39
+ declare function getAppBin<TContext extends UnresolvedContext | Context>(context: TContext): string;
40
40
  /**
41
41
  * Determines if a given command path segment is variable (enclosed in square brackets).
42
42
  *
@@ -1 +1 @@
1
- {"version":3,"file":"context-helpers.d.mts","names":[],"sources":["../../src/plugin-utils/context-helpers.ts"],"mappings":";;;;;AA8BA;;;iBAAgB,cAAA,CAAe,OAAA;;AAkB/B;;;;;;iBAAgB,UAAA,CAAW,OAAA,EAAS,iBAAA,GAAoB,OAAA;;;AA2BxD;;;;;iBAAgB,WAAA,CACd,OAAA,EAAS,iBAAA,GAAoB,OAAA,EAC7B,UAAA;;;;;AAsBF;;iBAAgB,iBAAA,CACd,OAAA,EAAS,iBAAA,GAAoB,OAAA;;;;;;;iBAef,SAAA,CAAU,OAAA,EAAS,OAAA;;;;;AAkBnC;;;;;AAeA;;;iBAfgB,oBAAA,CAAqB,IAAA;;AAgCrC;;;;;AAgBA;;;;;iBAjCgB,yBAAA,CAA0B,IAAA;;;;;;;;;;;;;;iBAiB1B,kBAAA,CAAmB,IAAA;;;;;;;;;;;;;iBAgBnB,uBAAA,CAAwB,IAAA;;;;;;;;;;;;iBAkBxB,kBAAA,CAAmB,IAAA"}
1
+ {"version":3,"file":"context-helpers.d.mts","names":[],"sources":["../../src/plugin-utils/context-helpers.ts"],"mappings":""}
@@ -1,7 +1,7 @@
1
1
  import { kebabCase } from "@stryke/string-format/kebab-case";
2
+ import { isSetObject } from "@stryke/type-checks/is-set-object";
2
3
  import { isSetString } from "@stryke/type-checks/is-set-string";
3
4
  import { titleCase } from "@stryke/string-format/title-case";
4
- import { isSetObject } from "@stryke/type-checks/is-set-object";
5
5
 
6
6
  //#region src/plugin-utils/context-helpers.ts
7
7
  function __assignType(fn, args) {
@@ -52,12 +52,10 @@ function getAppName(context) {
52
52
  return kebabCase(result);
53
53
  }
54
54
  getAppName.__type = [
55
- "UnresolvedContext",
56
- "Context",
57
55
  "context",
58
56
  "getAppName",
59
57
  "Retrieves the application name from the context and configuration.",
60
- "PP\"w!\"w\"J2#&/$?%"
58
+ "P\"2!&/\"?#"
61
59
  ];
62
60
  /**
63
61
  * Retrieves the application title from the context and configuration.
@@ -71,13 +69,11 @@ function getAppTitle(context, replaceCLI = false) {
71
69
  return (replaceCLI ? title.replace(/(?:cli|command-line|command line)\s*(?:interface\s*)?(?:application|app)?$/gi, "") : title).trim();
72
70
  }
73
71
  getAppTitle.__type = [
74
- "UnresolvedContext",
75
- "Context",
76
72
  "context",
77
73
  "replaceCLI",
78
74
  "getAppTitle",
79
75
  "Retrieves the application title from the context and configuration.",
80
- "PP\"w!\"w\"J2#\"2$&/%?&"
76
+ "P\"2!\"2\"&/#?$"
81
77
  ];
82
78
  /**
83
79
  * Retrieves the application description from the context and configuration.
@@ -89,12 +85,10 @@ function getAppDescription(context) {
89
85
  return context.config.description || context.packageJson?.description || `The ${getAppTitle(context, true)} command-line interface application.`;
90
86
  }
91
87
  getAppDescription.__type = [
92
- "UnresolvedContext",
93
- "Context",
94
88
  "context",
95
89
  "getAppDescription",
96
90
  "Retrieves the application description from the context and configuration.",
97
- "PP\"w!\"w\"J2#&/$?%"
91
+ "P\"2!&/\"?#"
98
92
  ];
99
93
  /**
100
94
  * Retrieves the primary binary name for the application.
@@ -106,11 +100,10 @@ function getAppBin(context) {
106
100
  return isSetObject(context.config.bin) ? Object.keys(context.config.bin)[0] : kebabCase(getAppName(context));
107
101
  }
108
102
  getAppBin.__type = [
109
- "Context",
110
103
  "context",
111
104
  "getAppBin",
112
105
  "Retrieves the primary binary name for the application.",
113
- "P\"w!2\"&/#?$"
106
+ "P\"2!&/\"?#"
114
107
  ];
115
108
  /**
116
109
  * Determines if a given command path segment is variable (enclosed in square brackets).
@@ -1 +1 @@
1
- {"version":3,"file":"context-helpers.mjs","names":[],"sources":["../../src/plugin-utils/context-helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport type { Context, UnresolvedContext } from \"../types\";\n\n/**\n * Sorts command argument aliases, placing single-character aliases first, followed by multi-character aliases, and then sorting them alphabetically.\n *\n * @param aliases - An array of argument aliases to sort.\n * @returns A new array of sorted aliases.\n */\nexport function sortArgAliases(aliases: string[]): string[] {\n if (aliases.length === 0) {\n return [];\n }\n\n const result = aliases.filter(alias => alias.length === 1);\n result.push(...aliases.filter(alias => alias.length > 1));\n\n return result.sort((a, b) => a.localeCompare(b));\n}\n\n/**\n * Retrieves the application name from the context and configuration.\n *\n * @param context - The build context containing workspace and package information.\n * @returns The application name in kebab-case format.\n * @throws An error if no valid application name is found.\n */\nexport function getAppName(context: UnresolvedContext | Context): string {\n const result =\n context.config.name ||\n (isSetString(context.config.bin) ||\n (Array.isArray(context.config.bin) &&\n context.config.bin.length > 0 &&\n isSetString(context.config.bin[0]))\n ? isSetString(context.config.bin)\n ? context.config.bin\n : context.config.bin[0]\n : context.packageJson?.name);\n if (!isSetString(result)) {\n throw new Error(\n \"No application name found. Please provide a 'bin' option in the configuration or ensure the package.json has a valid 'name' field.\"\n );\n }\n\n return kebabCase(result);\n}\n\n/**\n * Retrieves the application title from the context and configuration.\n *\n * @param context - The build context containing workspace and package information.\n * @param replaceCLI - Whether to replace CLI-related terms in the title with the application name.\n * @returns The application title in title-case format.\n */\nexport function getAppTitle(\n context: UnresolvedContext | Context,\n replaceCLI = false\n): string {\n const title =\n context.config.title ||\n titleCase(context.config.name || getAppName(context));\n\n return (\n replaceCLI\n ? title.replace(\n /(?:cli|command-line|command line)\\s*(?:interface\\s*)?(?:application|app)?$/gi,\n \"\"\n )\n : title\n ).trim();\n}\n\n/**\n * Retrieves the application description from the context and configuration.\n *\n * @param context - The build context containing workspace and package information.\n * @returns The application description.\n */\nexport function getAppDescription(\n context: UnresolvedContext | Context\n): string {\n return (\n context.config.description ||\n context.packageJson?.description ||\n `The ${getAppTitle(context, true)} command-line interface application.`\n );\n}\n\n/**\n * Retrieves the primary binary name for the application.\n *\n * @param context - The build context containing workspace and package information.\n * @returns The primary binary name as a string.\n */\nexport function getAppBin(context: Context): string {\n return isSetObject(context.config.bin)\n ? Object.keys(context.config.bin)[0]!\n : kebabCase(getAppName(context));\n}\n\n/**\n * Determines if a given command path segment is variable (enclosed in square brackets).\n *\n * @example\n * ```typescript\n * isDynamicPathSegment(\"[user]\"); // true\n * isDynamicPathSegment(\"user\"); // false\n * ```\n *\n * @param path - The command path segment to check.\n * @returns True if the path is variable, false otherwise.\n */\nexport function isDynamicPathSegment(path: string): boolean {\n return path.startsWith(\"[\") && path.endsWith(\"]\");\n}\n\n/**\n * Extracts the variable name from a command path segment by removing enclosing square brackets.\n *\n * @example\n * ```typescript\n * getDynamicPathSegmentName(\"[user]\"); // \"user\"\n * ```\n *\n * @param path - The command path segment.\n * @returns The variable name without square brackets.\n */\nexport function getDynamicPathSegmentName(path: string): string {\n return path.replaceAll(/^\\[+/g, \"\").replaceAll(/\\]+$/g, \"\");\n}\n\n/**\n * Determines if a given command path segment is a path segment group (enclosed in parentheses).\n *\n * @example\n * ```typescript\n * isPathSegmentGroup(\"(user)\"); // true\n * isPathSegmentGroup(\"[user]\"); // false\n * isPathSegmentGroup(\"user\"); // false\n * ```\n *\n * @param path - The command path segment to check.\n * @returns True if the path is a path segment group, false otherwise.\n */\nexport function isPathSegmentGroup(path: string): boolean {\n return (path.startsWith(\"(\") && path.endsWith(\")\")) || path.startsWith(\"_\");\n}\n\n/**\n * Extracts the group name from a command path segment by removing enclosing parentheses.\n *\n * @example\n * ```typescript\n * getPathSegmentGroupName(\"(admin)\"); // \"admin\"\n * getPathSegmentGroupName(\"((group))\"); // \"group\"\n * ```\n *\n * @param path - The command path segment.\n * @returns The group name without parentheses.\n */\nexport function getPathSegmentGroupName(path: string): string {\n return path\n .replaceAll(/^\\(+/g, \"\")\n .replaceAll(/\\)+$/g, \"\")\n .replaceAll(/^_+/g, \"\");\n}\n\n/**\n * Extracts the variable name from a command path segment by removing enclosing square brackets.\n *\n * @example\n * ```typescript\n * getDynamicPathSegmentName(\"[user]\"); // \"user\"\n * ```\n *\n * @param path - The command path segment.\n * @returns The variable name without square brackets.\n */\nexport function getPathSegmentName(path: string): string {\n return getPathSegmentGroupName(getDynamicPathSegmentName(path));\n}\n"],"mappings":";;;;;;AAAA,SAAS,aAAa,IAAI,MAAM;;AAE9B,QAAO;;;;;;;;AA6BT,SAAc,eAAc,SAAA;AAC1B,KAAE,QAAS,WAAA,EACX,QAAA,EAAA;CAEA,MAAM,SAAS,QAAQ,OAAO,cAAS,UAAa,MAAM,WAAA,GAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA;AAC1D,QAAO,KAAK,GAAG,QAAQ,OAAO,cAAS,UAAa,MAAK,SAAA,GAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA;;;;;;;;AAG3D,eAAA,SAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;;AAQA,SAAE,WAAA,SAAA;CACF,MAAO,SAAS,QAAA,OAAW,SAAS,YAAiB,QAAG,OAAU,IAAM,IAAC,MAAA,QAAA,QAAA,OAAA,IAAA,IAAA,QAAA,OAAA,IAAA,SAAA,KAAA,YAAA,QAAA,OAAA,IAAA,GAAA,GAAA,YAAA,QAAA,OAAA,IAAA,GAAA,QAAA,OAAA,MAAA,QAAA,OAAA,IAAA,KAAA,QAAA,aAAA;AACvE,KAAA,CAAK,YAAQ,OAAA,CACX,OAAA,IAAQ,MAAO,qIAAM;AAEvB,QAAG,UAAc,OAAO;;AAE1B,WAAM,SAAY;CAAA;CAAsB;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;;AAQxC,SAAK,YAAA,SAAA,aAAA,OAAA;CACH,MAAA,QAAA,QAAA,OAAA,SAAA,UAAA,QAAA,OAAA,QAAA,WAAA,QAAA,CAAA;;;AAGF,YAAA,SAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;AAOA,SAAgB,kBAAkB,SAAS;AACzC,QAAA,QAAA,OAAA,eAAA,QAAA,aAAA,eAAA,OAAA,YAAA,SAAA,KAAA,CAAA;;AAEF,kBAAW,SAAA;CAAiB;CAAU;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;AAOtC,SAAS,UAAA,SAAA;AACP,QAAE,YAAA,QAAA,OAAA,IAAA,GAAA,OAAA,KAAA,QAAA,OAAA,IAAA,CAAA,KAAA,UAAA,WAAA,QAAA,CAAA;;AAEJ,UAAU,SAAQ;CAAA;CAAa;CAAQ;CAAW;CAAsC;CAAA;;;;;;;;;;;;;AAaxF,SAAgB,qBAAiB,MAAA;AAC/B,QAAO,KAAE,WAAA,IAAkB,IAAE,KAAA,SAAA,IAAA;;AAE/B,qBAAS,SAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;;;;;;AAYT,SAAE,0BAAA,MAAA;AACF,QAAO,KAAA,WAAkB,SAAS,GAAC,CAAA,WAAU,SAAO,GAAA;;AAEpD,0BAA0B,SAAO;CAAG;CAAI;CAAA;CAAA;CAAA;;;;;;;;;;;;;;AAcxC,SAAgB,mBAAgB,MAAS;AACvC,QAAA,KAAA,WAAA,IAAA,IAAA,KAAA,SAAA,IAAA,IAAA,KAAA,WAAA,IAAA;;AAEF,mBAAc,SAAc;CAAC;CAAQ;CAAc;CAAA;CAAA;;;;;;;;;;;;;AAanD,SAAE,wBAAA,MAAA;AACF,QAAO,KAAA,WAAS,SAAA,GAAA,CAAA,WAAgC,SAAS,GAAA,CAAA,WAAO,QAAA,GAAA;;AAEhE,wBAAA,SAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;;;;;;AAYA,SAAgB,mBAAkB,MAAO;AACvC,QAAE,wBAA6B,0BAA0B,KAAC,CAAA;;AAE5D,mBAAgB,SAAA;CAAA;CAAmB;CAAuB;CAAA;CAAA"}
1
+ {"version":3,"file":"context-helpers.mjs","names":[],"sources":[],"mappings":""}
@@ -1,34 +1,32 @@
1
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
- const require_types_command = require('../types/command.cjs');
3
1
  const require_type_checks = require('./type-checks.cjs');
4
- let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
5
2
  let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
3
+ let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
6
4
 
7
5
  //#region src/plugin-utils/deepkit.ts
8
6
  /**
9
- * Extracts a {@link ReflectionKind} from a {@link BaseCommandParameter} or {@link CommandParameterKind}.
7
+ * Extracts a {@link ReflectionKind} from a {@link BaseCommandParameter} or {@link CommandParameterType}.
10
8
  *
11
9
  * @param command - The command parameter or kind to extract the reflection kind from.
12
10
  * @param checkVariadic - Whether to check for variadic parameters (arrays).
13
11
  * @returns The extracted {@link ReflectionKind}.
14
12
  */
15
13
  function extractReflectionKind(command, checkVariadic = true) {
16
- if (require_type_checks.isCommandParameterKind(command) && command === require_types_command.CommandParameterKinds.string || (0, _stryke_type_checks_is_set_object.isSetObject)(command) && command.kind === require_types_command.CommandParameterKinds.string) return checkVariadic && command.variadic ? _powerlines_deepkit_vendor_type.ReflectionKind.array : _powerlines_deepkit_vendor_type.ReflectionKind.string;
17
- else if (require_type_checks.isCommandParameterKind(command) && command === require_types_command.CommandParameterKinds.number || (0, _stryke_type_checks_is_set_object.isSetObject)(command) && command.kind === require_types_command.CommandParameterKinds.number) return checkVariadic && command.variadic ? _powerlines_deepkit_vendor_type.ReflectionKind.array : _powerlines_deepkit_vendor_type.ReflectionKind.number;
18
- else if (require_type_checks.isCommandParameterKind(command) && command === require_types_command.CommandParameterKinds.boolean || (0, _stryke_type_checks_is_set_object.isSetObject)(command) && command.kind === require_types_command.CommandParameterKinds.boolean) return _powerlines_deepkit_vendor_type.ReflectionKind.boolean;
14
+ if (require_type_checks.isCommandParameterType(command) && command === "string" || (0, _stryke_type_checks_is_set_object.isSetObject)(command) && command.type === "string") return checkVariadic && command.variadic ? _powerlines_deepkit_vendor_type.ReflectionKind.array : _powerlines_deepkit_vendor_type.ReflectionKind.string;
15
+ else if (require_type_checks.isCommandParameterType(command) && command === "number" || (0, _stryke_type_checks_is_set_object.isSetObject)(command) && command.type === "number") return checkVariadic && command.variadic ? _powerlines_deepkit_vendor_type.ReflectionKind.array : _powerlines_deepkit_vendor_type.ReflectionKind.number;
16
+ else if (require_type_checks.isCommandParameterType(command) && command === "boolean" || (0, _stryke_type_checks_is_set_object.isSetObject)(command) && command.type === "boolean") return _powerlines_deepkit_vendor_type.ReflectionKind.boolean;
19
17
  else return _powerlines_deepkit_vendor_type.ReflectionKind.string;
20
18
  }
21
19
  extractReflectionKind.__type = [
22
20
  "BaseCommandParameter",
23
- "CommandParameterKind",
21
+ "CommandParameterType",
24
22
  "command",
25
23
  "checkVariadic",
26
24
  "extractReflectionKind",
27
- "Extracts a {@link ReflectionKind} from a {@link BaseCommandParameter} or {@link CommandParameterKind}.",
25
+ "Extracts a {@link ReflectionKind} from a {@link BaseCommandParameter} or {@link CommandParameterType}.",
28
26
  "PP\"w!\"w\"J2#\"2$!/%?&"
29
27
  ];
30
28
  /**
31
- * Extracts a {@link Type} from a {@link BaseCommandParameter} or {@link CommandParameterKind}.
29
+ * Extracts a {@link Type} from a {@link BaseCommandParameter} or {@link CommandParameterType}.
32
30
  *
33
31
  * @param command - The command parameter or kind to extract the type from.
34
32
  * @param checkVariadic - Whether to check for variadic parameters (arrays).
@@ -39,15 +37,15 @@ function extractType(command, checkVariadic = true) {
39
37
  if (reflectionKind === _powerlines_deepkit_vendor_type.ReflectionKind.string) return { kind: _powerlines_deepkit_vendor_type.ReflectionKind.string };
40
38
  else if (reflectionKind === _powerlines_deepkit_vendor_type.ReflectionKind.number) return { kind: _powerlines_deepkit_vendor_type.ReflectionKind.number };
41
39
  else if (reflectionKind === _powerlines_deepkit_vendor_type.ReflectionKind.boolean) return { kind: _powerlines_deepkit_vendor_type.ReflectionKind.boolean };
42
- else if (reflectionKind === _powerlines_deepkit_vendor_type.ReflectionKind.array) if (require_type_checks.isCommandParameterKind(command)) return {
40
+ else if (reflectionKind === _powerlines_deepkit_vendor_type.ReflectionKind.array) if (require_type_checks.isCommandParameterType(command)) return {
43
41
  kind: _powerlines_deepkit_vendor_type.ReflectionKind.array,
44
- type: extractType({ kind: command }, false)
42
+ type: extractType({ type: command }, false)
45
43
  };
46
44
  else if ((0, _stryke_type_checks_is_set_object.isSetObject)(command)) return {
47
45
  kind: _powerlines_deepkit_vendor_type.ReflectionKind.array,
48
46
  type: extractType({
49
47
  ...command,
50
- kind: command.kind
48
+ type: command.type
51
49
  }, false)
52
50
  };
53
51
  else return {
@@ -58,14 +56,15 @@ function extractType(command, checkVariadic = true) {
58
56
  }
59
57
  extractType.__type = [
60
58
  "BaseCommandParameter",
61
- "CommandParameterKind",
59
+ "CommandParameterType",
62
60
  "command",
63
61
  "checkVariadic",
64
62
  "extractType",
65
- "Extracts a {@link Type} from a {@link BaseCommandParameter} or {@link CommandParameterKind}.",
63
+ "Extracts a {@link Type} from a {@link BaseCommandParameter} or {@link CommandParameterType}.",
66
64
  "PP\"w!\"w\"J2#\"2$!/%?&"
67
65
  ];
68
66
 
69
67
  //#endregion
70
68
  exports.extractReflectionKind = extractReflectionKind;
71
- exports.extractType = extractType;
69
+ exports.extractType = extractType;
70
+ //# sourceMappingURL=deepkit.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepkit.cjs","names":[],"sources":[],"mappings":""}
@@ -1,23 +1,23 @@
1
- import { BaseCommandParameter, CommandParameterKind } from "../types/command.cjs";
1
+ import { BaseCommandParameter, CommandParameterType } from "../types/command.cjs";
2
2
  import { ReflectionKind, Type } from "@powerlines/deepkit/vendor/type";
3
3
 
4
4
  //#region src/plugin-utils/deepkit.d.ts
5
5
  /**
6
- * Extracts a {@link ReflectionKind} from a {@link BaseCommandParameter} or {@link CommandParameterKind}.
6
+ * Extracts a {@link ReflectionKind} from a {@link BaseCommandParameter} or {@link CommandParameterType}.
7
7
  *
8
8
  * @param command - The command parameter or kind to extract the reflection kind from.
9
9
  * @param checkVariadic - Whether to check for variadic parameters (arrays).
10
10
  * @returns The extracted {@link ReflectionKind}.
11
11
  */
12
- declare function extractReflectionKind(command: BaseCommandParameter | CommandParameterKind, checkVariadic?: boolean): ReflectionKind;
12
+ declare function extractReflectionKind(command: BaseCommandParameter | CommandParameterType, checkVariadic?: boolean): ReflectionKind;
13
13
  /**
14
- * Extracts a {@link Type} from a {@link BaseCommandParameter} or {@link CommandParameterKind}.
14
+ * Extracts a {@link Type} from a {@link BaseCommandParameter} or {@link CommandParameterType}.
15
15
  *
16
16
  * @param command - The command parameter or kind to extract the type from.
17
17
  * @param checkVariadic - Whether to check for variadic parameters (arrays).
18
18
  * @returns The extracted {@link Type}.
19
19
  */
20
- declare function extractType(command: BaseCommandParameter | CommandParameterKind, checkVariadic?: boolean): Type;
20
+ declare function extractType(command: BaseCommandParameter | CommandParameterType, checkVariadic?: boolean): Type;
21
21
  //#endregion
22
22
  export { extractReflectionKind, extractType };
23
23
  //# sourceMappingURL=deepkit.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deepkit.d.cts","names":[],"sources":["../../src/plugin-utils/deepkit.ts"],"mappings":";;;;;AAoCA;;;;;;iBAAgB,qBAAA,CACd,OAAA,EAAS,oBAAA,GAAuB,oBAAA,EAChC,aAAA,aACC,cAAA;;;;;;;;iBAqCa,WAAA,CACd,OAAA,EAAS,oBAAA,GAAuB,oBAAA,EAChC,aAAA,aACC,IAAA"}
1
+ {"version":3,"file":"deepkit.d.cts","names":[],"sources":["../../src/plugin-utils/deepkit.ts"],"mappings":";;;;;AAmCA;;;;;;iBAAgB,qBAAA,CACd,OAAA,EAAS,oBAAA,GAAuB,oBAAA,EAChC,aAAA,aACC,cAAA;;;;;;;;iBAgCa,WAAA,CACd,OAAA,EAAS,oBAAA,GAAuB,oBAAA,EAChC,aAAA,aACC,IAAA"}
@@ -1,23 +1,23 @@
1
- import { BaseCommandParameter, CommandParameterKind } from "../types/command.mjs";
1
+ import { BaseCommandParameter, CommandParameterType } from "../types/command.mjs";
2
2
  import { ReflectionKind, Type } from "@powerlines/deepkit/vendor/type";
3
3
 
4
4
  //#region src/plugin-utils/deepkit.d.ts
5
5
  /**
6
- * Extracts a {@link ReflectionKind} from a {@link BaseCommandParameter} or {@link CommandParameterKind}.
6
+ * Extracts a {@link ReflectionKind} from a {@link BaseCommandParameter} or {@link CommandParameterType}.
7
7
  *
8
8
  * @param command - The command parameter or kind to extract the reflection kind from.
9
9
  * @param checkVariadic - Whether to check for variadic parameters (arrays).
10
10
  * @returns The extracted {@link ReflectionKind}.
11
11
  */
12
- declare function extractReflectionKind(command: BaseCommandParameter | CommandParameterKind, checkVariadic?: boolean): ReflectionKind;
12
+ declare function extractReflectionKind(command: BaseCommandParameter | CommandParameterType, checkVariadic?: boolean): ReflectionKind;
13
13
  /**
14
- * Extracts a {@link Type} from a {@link BaseCommandParameter} or {@link CommandParameterKind}.
14
+ * Extracts a {@link Type} from a {@link BaseCommandParameter} or {@link CommandParameterType}.
15
15
  *
16
16
  * @param command - The command parameter or kind to extract the type from.
17
17
  * @param checkVariadic - Whether to check for variadic parameters (arrays).
18
18
  * @returns The extracted {@link Type}.
19
19
  */
20
- declare function extractType(command: BaseCommandParameter | CommandParameterKind, checkVariadic?: boolean): Type;
20
+ declare function extractType(command: BaseCommandParameter | CommandParameterType, checkVariadic?: boolean): Type;
21
21
  //#endregion
22
22
  export { extractReflectionKind, extractType };
23
23
  //# sourceMappingURL=deepkit.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deepkit.d.mts","names":[],"sources":["../../src/plugin-utils/deepkit.ts"],"mappings":";;;;;AAoCA;;;;;;iBAAgB,qBAAA,CACd,OAAA,EAAS,oBAAA,GAAuB,oBAAA,EAChC,aAAA,aACC,cAAA;;;;;;;;iBAqCa,WAAA,CACd,OAAA,EAAS,oBAAA,GAAuB,oBAAA,EAChC,aAAA,aACC,IAAA"}
1
+ {"version":3,"file":"deepkit.d.mts","names":[],"sources":["../../src/plugin-utils/deepkit.ts"],"mappings":""}
@@ -1,33 +1,32 @@
1
- import { CommandParameterKinds } from "../types/command.mjs";
2
- import { isCommandParameterKind } from "./type-checks.mjs";
3
- import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
1
+ import { isCommandParameterType } from "./type-checks.mjs";
4
2
  import { isSetObject } from "@stryke/type-checks/is-set-object";
3
+ import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
5
4
 
6
5
  //#region src/plugin-utils/deepkit.ts
7
6
  /**
8
- * Extracts a {@link ReflectionKind} from a {@link BaseCommandParameter} or {@link CommandParameterKind}.
7
+ * Extracts a {@link ReflectionKind} from a {@link BaseCommandParameter} or {@link CommandParameterType}.
9
8
  *
10
9
  * @param command - The command parameter or kind to extract the reflection kind from.
11
10
  * @param checkVariadic - Whether to check for variadic parameters (arrays).
12
11
  * @returns The extracted {@link ReflectionKind}.
13
12
  */
14
13
  function extractReflectionKind(command, checkVariadic = true) {
15
- if (isCommandParameterKind(command) && command === CommandParameterKinds.string || isSetObject(command) && command.kind === CommandParameterKinds.string) return checkVariadic && command.variadic ? ReflectionKind.array : ReflectionKind.string;
16
- else if (isCommandParameterKind(command) && command === CommandParameterKinds.number || isSetObject(command) && command.kind === CommandParameterKinds.number) return checkVariadic && command.variadic ? ReflectionKind.array : ReflectionKind.number;
17
- else if (isCommandParameterKind(command) && command === CommandParameterKinds.boolean || isSetObject(command) && command.kind === CommandParameterKinds.boolean) return ReflectionKind.boolean;
14
+ if (isCommandParameterType(command) && command === "string" || isSetObject(command) && command.type === "string") return checkVariadic && command.variadic ? ReflectionKind.array : ReflectionKind.string;
15
+ else if (isCommandParameterType(command) && command === "number" || isSetObject(command) && command.type === "number") return checkVariadic && command.variadic ? ReflectionKind.array : ReflectionKind.number;
16
+ else if (isCommandParameterType(command) && command === "boolean" || isSetObject(command) && command.type === "boolean") return ReflectionKind.boolean;
18
17
  else return ReflectionKind.string;
19
18
  }
20
19
  extractReflectionKind.__type = [
21
20
  "BaseCommandParameter",
22
- "CommandParameterKind",
21
+ "CommandParameterType",
23
22
  "command",
24
23
  "checkVariadic",
25
24
  "extractReflectionKind",
26
- "Extracts a {@link ReflectionKind} from a {@link BaseCommandParameter} or {@link CommandParameterKind}.",
25
+ "Extracts a {@link ReflectionKind} from a {@link BaseCommandParameter} or {@link CommandParameterType}.",
27
26
  "PP\"w!\"w\"J2#\"2$!/%?&"
28
27
  ];
29
28
  /**
30
- * Extracts a {@link Type} from a {@link BaseCommandParameter} or {@link CommandParameterKind}.
29
+ * Extracts a {@link Type} from a {@link BaseCommandParameter} or {@link CommandParameterType}.
31
30
  *
32
31
  * @param command - The command parameter or kind to extract the type from.
33
32
  * @param checkVariadic - Whether to check for variadic parameters (arrays).
@@ -38,15 +37,15 @@ function extractType(command, checkVariadic = true) {
38
37
  if (reflectionKind === ReflectionKind.string) return { kind: ReflectionKind.string };
39
38
  else if (reflectionKind === ReflectionKind.number) return { kind: ReflectionKind.number };
40
39
  else if (reflectionKind === ReflectionKind.boolean) return { kind: ReflectionKind.boolean };
41
- else if (reflectionKind === ReflectionKind.array) if (isCommandParameterKind(command)) return {
40
+ else if (reflectionKind === ReflectionKind.array) if (isCommandParameterType(command)) return {
42
41
  kind: ReflectionKind.array,
43
- type: extractType({ kind: command }, false)
42
+ type: extractType({ type: command }, false)
44
43
  };
45
44
  else if (isSetObject(command)) return {
46
45
  kind: ReflectionKind.array,
47
46
  type: extractType({
48
47
  ...command,
49
- kind: command.kind
48
+ type: command.type
50
49
  }, false)
51
50
  };
52
51
  else return {
@@ -57,11 +56,11 @@ function extractType(command, checkVariadic = true) {
57
56
  }
58
57
  extractType.__type = [
59
58
  "BaseCommandParameter",
60
- "CommandParameterKind",
59
+ "CommandParameterType",
61
60
  "command",
62
61
  "checkVariadic",
63
62
  "extractType",
64
- "Extracts a {@link Type} from a {@link BaseCommandParameter} or {@link CommandParameterKind}.",
63
+ "Extracts a {@link Type} from a {@link BaseCommandParameter} or {@link CommandParameterType}.",
65
64
  "PP\"w!\"w\"J2#\"2$!/%?&"
66
65
  ];
67
66
 
@@ -1 +1 @@
1
- {"version":3,"file":"deepkit.mjs","names":[],"sources":["../../src/plugin-utils/deepkit.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Type } from \"@powerlines/deepkit/vendor/type\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport type {\n BaseCommandParameter,\n CommandParameterKind,\n StringCommandParameter\n} from \"../types/command\";\nimport { CommandParameterKinds } from \"../types/command\";\nimport { isCommandParameterKind } from \"./type-checks\";\n\n/**\n * Extracts a {@link ReflectionKind} from a {@link BaseCommandParameter} or {@link CommandParameterKind}.\n *\n * @param command - The command parameter or kind to extract the reflection kind from.\n * @param checkVariadic - Whether to check for variadic parameters (arrays).\n * @returns The extracted {@link ReflectionKind}.\n */\nexport function extractReflectionKind(\n command: BaseCommandParameter | CommandParameterKind,\n checkVariadic = true\n): ReflectionKind {\n if (\n (isCommandParameterKind(command) &&\n command === CommandParameterKinds.string) ||\n (isSetObject(command as BaseCommandParameter) &&\n (command as BaseCommandParameter).kind === CommandParameterKinds.string)\n ) {\n return checkVariadic && (command as StringCommandParameter).variadic\n ? ReflectionKind.array\n : ReflectionKind.string;\n } else if (\n (isCommandParameterKind(command) &&\n command === CommandParameterKinds.number) ||\n (isSetObject(command as BaseCommandParameter) &&\n (command as BaseCommandParameter).kind === CommandParameterKinds.number)\n ) {\n return checkVariadic && (command as any).variadic\n ? ReflectionKind.array\n : ReflectionKind.number;\n } else if (\n (isCommandParameterKind(command) &&\n command === CommandParameterKinds.boolean) ||\n (isSetObject(command) && command.kind === CommandParameterKinds.boolean)\n ) {\n return ReflectionKind.boolean;\n } else {\n return ReflectionKind.string;\n }\n}\n\n/**\n * Extracts a {@link Type} from a {@link BaseCommandParameter} or {@link CommandParameterKind}.\n *\n * @param command - The command parameter or kind to extract the type from.\n * @param checkVariadic - Whether to check for variadic parameters (arrays).\n * @returns The extracted {@link Type}.\n */\nexport function extractType(\n command: BaseCommandParameter | CommandParameterKind,\n checkVariadic = true\n): Type {\n const reflectionKind = extractReflectionKind(command, checkVariadic);\n if (reflectionKind === ReflectionKind.string) {\n return { kind: ReflectionKind.string };\n } else if (reflectionKind === ReflectionKind.number) {\n return { kind: ReflectionKind.number };\n } else if (reflectionKind === ReflectionKind.boolean) {\n return { kind: ReflectionKind.boolean };\n } else if (reflectionKind === ReflectionKind.array) {\n if (isCommandParameterKind(command)) {\n return {\n kind: ReflectionKind.array,\n type: extractType(\n {\n kind: command\n } as BaseCommandParameter,\n false\n )\n };\n } else if (isSetObject(command)) {\n return {\n kind: ReflectionKind.array,\n type: extractType(\n {\n ...command,\n kind: command.kind\n } as BaseCommandParameter,\n false\n )\n };\n } else {\n return {\n kind: ReflectionKind.array,\n type: { kind: ReflectionKind.string }\n };\n }\n } else {\n return { kind: ReflectionKind.string };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AA6BE,KAAA,uBAAA,QAAA,IAAA,YAAA,sBAAA,UAAA,YAAA,QAAA,IAAA,QAAA,SAAA,sBAAA,OACC,QAAQ,iBAAU,QAAe,WAAU,eAAK,QAAA,eAAgC;UAClF,uBAAA,QAAA,IAAA,YAAA,sBAAA,UAAA,YAAA,QAAA,IAAA,QAAA,SAAA,sBAAA,OACG,QAAM,iBAAc,QAAQ,WAAa,eAAgB,QAAI,eAAoB;UAC3E,uBAA0B,QAAO,IAAI,YAAS,sBAAmB,WAAA,YAAA,QAAA,IAAA,QAAA,SAAA,sBAAA,QACvE,QAAO,eAAe;KAE1B,QAAO,eAAS;;AAGhB,sBAAkB,SAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;;AAQlB,SAAQ,YAAe,SAAA,gBAAA,MAAA;CACrB,MAAM,iBAAe,sBAAM,SAAA,cAAA;AAC3B,KAAE,mBAAQ,eAAA,OACR,QAAC,EACC,MAAA,eAAY,QACb;UACE,mBAAW,eAA6B,OAC3C,QAAA,EACA,MAAO,eAAgB,QACtB;UACG,mBAAqB,eAAA,QACzB,QAAO,EACN,MAAA,eAAsB,SACtB;UACA,mBAAwB,eAAiB,MAC1C,KAAA,uBAAA,QAAA,CACA,QAAO;EACH,MAAC,eAAA;EACL,MAAO,YAAe,EACxB,MAAA,SACF,EAAA,MAAA;;UAEE,YAAA,QAAA,CACC,QAAU;EACZ,MAAA,eAAA;EACG,MAAM,YAAc;GACd,GAAA;GACN,MAAY,QAAA;GACd,EAAA,MAAA;EACK;KAEL,QAAA;EACM,MAAA,eAAA;EACA,MAAA,EACF,MAAA,eAAmB,QACrB;EACA;KAGA,QAAO,EACP,MAAQ,eAAe,QACvB;;AAGJ,YAAY,SAAE;CAAA;CAAW;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
1
+ {"version":3,"file":"deepkit.mjs","names":[],"sources":[],"mappings":""}
@@ -108,4 +108,5 @@ formatShortDescription.__type = [
108
108
  exports.__ΩFormatDescriptionOptions = __ΩFormatDescriptionOptions;
109
109
  exports.__ΩFormatShortDescriptionOptions = __ΩFormatShortDescriptionOptions;
110
110
  exports.formatDescription = formatDescription;
111
- exports.formatShortDescription = formatShortDescription;
111
+ exports.formatShortDescription = formatShortDescription;
112
+ //# sourceMappingURL=description-helpers.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"description-helpers.cjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"description-helpers.d.cts","names":[],"sources":["../../src/plugin-utils/description-helpers.ts"],"mappings":";UAkBiB,wBAAA;EAAA;;;;;EAMf,eAAA;EA4D+B;;;;;EArD/B,kBAAA;AAAA;;AA8DF;;;;;AAgBA;;;iBAzBgB,iBAAA,CACd,WAAA,UACA,OAAA,GAAS,wBAAA;AAAA,UAOM,6BAAA,SAAsC,wBAAA;EAkB5C;;;;;EAZT,MAAA;AAAA;;;;;;;;iBAUc,sBAAA,CACd,WAAA,UACA,OAAA,GAAS,6BAAA"}
1
+ {"version":3,"file":"description-helpers.d.cts","names":[],"sources":["../../src/plugin-utils/description-helpers.ts"],"mappings":";UAkBiB,wBAAA;EAAA;;;;AAaG;EAPlB,eAAA;EA4D+B;;;;;EArD/B,kBAAkB;AAAA;AAuDoB;AAOxC;;;;AAMQ;AAUR;;;AAvBwC,iBAFxB,iBAAA,CACd,WAAA,UACA,OAAA,GAAS,wBAA6B;AAAA,UAOvB,6BAAA,SAAsC,wBAAwB;EAkBpE;;;AAAkC;;EAZ3C,MAAM;AAAA;;;;;;;;iBAUQ,sBAAA,CACd,WAAA,UACA,OAAA,GAAS,6BAAkC"}
@@ -1 +1 @@
1
- {"version":3,"file":"description-helpers.d.mts","names":[],"sources":["../../src/plugin-utils/description-helpers.ts"],"mappings":";UAkBiB,wBAAA;EAAA;;;;;EAMf,eAAA;EA4D+B;;;;;EArD/B,kBAAA;AAAA;;AA8DF;;;;;AAgBA;;;iBAzBgB,iBAAA,CACd,WAAA,UACA,OAAA,GAAS,wBAAA;AAAA,UAOM,6BAAA,SAAsC,wBAAA;EAkB5C;;;;;EAZT,MAAA;AAAA;;;;;;;;iBAUc,sBAAA,CACd,WAAA,UACA,OAAA,GAAS,6BAAA"}
1
+ {"version":3,"file":"description-helpers.d.mts","names":[],"sources":["../../src/plugin-utils/description-helpers.ts"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"description-helpers.mjs","names":[],"sources":["../../src/plugin-utils/description-helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport interface FormatDescriptionOptions {\n /**\n * If true, replaces newlines in the description with spaces. This is useful for ensuring that descriptions are displayed as a single line in contexts where multiline descriptions may not be supported or may cause formatting issues.\n *\n * @defaultValue false\n */\n replaceNewlines?: boolean;\n\n /**\n * If true, collapses multiple consecutive spaces in the description into a single space. This helps to ensure that descriptions are concise and do not contain unnecessary whitespace.\n *\n * @defaultValue false\n */\n collapseWhitespace?: boolean;\n}\n\n/**\n * Formats a description string by trimming whitespace, replacing newlines with spaces (optionally), collapsing multiple spaces into a single space (optionally), and escaping special characters.\n *\n * @remarks\n * This is useful for ensuring that descriptions are concise and well-formatted when displayed in the CLI or documentation.\n *\n * @param description - The full description string.\n * @returns The formatted description string.\n */\nfunction formatDescriptionWhitespace(\n description: string,\n options: FormatDescriptionOptions = {}\n): string {\n let formattedDescription = description.trim();\n if (options.replaceNewlines) {\n formattedDescription = formattedDescription.replace(/\\s*\\n\\s*/g, \" \");\n }\n if (options.collapseWhitespace) {\n formattedDescription = formattedDescription.replace(/\\s{2,}/g, \" \");\n }\n\n return formattedDescription.trim();\n}\n\n/**\n * Formats a description string by trimming whitespace, replacing newlines with spaces (optionally), collapsing multiple spaces into a single space (optionally), and escaping special characters.\n *\n * @remarks\n * This is useful for ensuring that descriptions are concise and well-formatted when displayed in the CLI or documentation.\n *\n * @param description - The full description string.\n * @returns The formatted description string.\n */\nfunction formatDescriptionEscapes(description: string): string {\n return description\n .replaceAll(\"'\", \"\\\\'\")\n .replaceAll('\"', '\\\\\"')\n .replaceAll(\"`\", \"\\\\`\")\n .replace(/\\$\\{/g, \"\\\\${\");\n}\n\n/**\n * Formats a description string by trimming whitespace, replacing newlines with spaces (optionally), collapsing multiple spaces into a single space (optionally), and escaping special characters.\n *\n * @remarks\n * This is useful for ensuring that descriptions are concise and well-formatted when displayed in the CLI or documentation.\n *\n * @param description - The full description string.\n * @returns The formatted description string.\n */\nexport function formatDescription(\n description: string,\n options: FormatDescriptionOptions = {}\n): string {\n return formatDescriptionEscapes(\n formatDescriptionWhitespace(description, options)\n );\n}\n\nexport interface FormatShortDescriptionOptions extends FormatDescriptionOptions {\n /**\n * The maximum length of the short description. If the first sentence exceeds this length, it will be truncated.\n *\n * @defaultValue 62\n */\n length?: number;\n}\n\n/**\n * Extracts the short description from a longer description string. The short description is typically the first sentence or the first line of the description.\n *\n * @param description - The full description string.\n * @param options - Options for formatting the short description, including the maximum length.\n * @returns The extracted short description.\n */\nexport function formatShortDescription(\n description: string,\n options: FormatShortDescriptionOptions = {}\n): string {\n const length = options.length ?? 62;\n const formattedDescription = formatDescriptionWhitespace(\n description,\n options\n );\n\n const firstSentenceMatch =\n formattedDescription.indexOf(\"\\n\") < length - 3 ||\n formattedDescription.search(/[.!?\\n]\\s*\\S/) > length - 3\n ? formattedDescription\n .match(/^.*[.!?\\n]\\s?\\S/)?.[0]\n ?.trim()\n ?.slice(0, -1)\n ?.trim()\n : undefined;\n\n let result = (firstSentenceMatch || formattedDescription).trim();\n if (result.trim().length > length) {\n result = `${result.substring(0, Math.max(0, length - 3)).trim()}...`;\n }\n\n return formatDescriptionEscapes(result);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA4BA,SAAG,4BAAA,aAAA,UAAA,EAAA,EAAA;CACD,IAAI,uBAAa,YAAA,MAAA;AACjB,KAAE,QAAA,gBACF,wBAAqB,qBAAO,QAAA,aAAA,IAAA;gCAG5B,wBAAA,qBAAA,QAAA,WAAA,IAAA;AAED,QAAA,qBAAA,MAAA;;AAED,4BAAsB,SAAc;CAAA;OAAiB;CAAgC;QAAqB,EAAE;CAAC;CAAa;CAAA;CAAA;;;;;;;;;;AAU1H,SAAM,yBAAyB,aAAA;AAC7B,QAAE,YAAA,WAAuB,KAAA,MAAA,CAAA,WAA4B,MAAK,OAAM,CAAC,WAAM,KAAA,MAAA,CAAA,QAAA,SAAA,OAAA;;AAEzE,yBAAc,SAAoB;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;;;;AAUlC,SAAI,kBAAA,aAAA,UAAA,EAAA,EAAA;AACF,QAAM,yBAAuB,4BAA8B,aAAS,QAAU,CAAI;;AAEpF,kBAAU,SAAiB;CAAC;OAAiB;CAAM;QAAA,EAAA;CAAA;CAAA;CAAA;CAAA;AACnD,MAAI,mCAAkC;OAAM;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;;;CAU1C,MAAA,SAAA,QAAA,UAAA;CACA,MAAC,uBAA4B,4BAAyB,aAAU,QAAc;CAE9E,IAAE,WADH,qBAAA,QAAA,KAAA,GAAA,SAAA,KAAA,qBAAA,OAAA,eAAA,GAAA,SAAA,IAAA,qBAAA,MAAA,kBAAA,GAAA,IAAA,MAAA,EAAA,MAAA,GAAA,GAAA,EAAA,MAAA,GAAA,WACG,sBAAA,MAAA;AACF,KAAC,OAAQ,MAAO,CAAA,SAAI,OACrB,UAAA,GAAA,OAAA,UAAA,GAAA,KAAA,IAAA,GAAA,SAAA,EAAA,CAAA,CAAA,MAAA,CAAA;AAEC,QAAE,yBAAsB,OAAY;;AAEtC,uBAAgB,SAAA;CAAiB;OAAA;CAAA;QAAA,EAAA;CAAA;CAAA;CAAA;CAAA"}
1
+ {"version":3,"file":"description-helpers.mjs","names":[],"sources":[],"mappings":""}
@@ -114,4 +114,5 @@ getCommandSegments.__type = [
114
114
  exports.getCommandList = getCommandList;
115
115
  exports.getCommandPaths = getCommandPaths;
116
116
  exports.getCommandSegments = getCommandSegments;
117
- exports.getCommandTree = getCommandTree;
117
+ exports.getCommandTree = getCommandTree;
118
+ //# sourceMappingURL=get-command-tree.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-command-tree.cjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"get-command-tree.d.cts","names":[],"sources":["../../src/plugin-utils/get-command-tree.ts"],"mappings":";;;;;;AA8BA;;;;;iBAAgB,cAAA,CACd,OAAA,EAAS,OAAA,EACT,IAAA,cACC,WAAA;;;;;AA+BH;;iBAAsB,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,OAAA,CAAQ,WAAA;;;;;;;iBAe1C,eAAA,CAAgB,OAAA,EAAS,OAAA,GAAU,OAAA;;;;;AAAzD;;iBAiBsB,kBAAA,CACpB,OAAA,EAAS,OAAA,GACR,OAAA"}
1
+ {"version":3,"file":"get-command-tree.d.cts","names":[],"sources":["../../src/plugin-utils/get-command-tree.ts"],"mappings":";;;;;;AA8BA;;;;;iBAAgB,cAAA,CACd,OAAA,EAAS,OAAA,EACT,IAAA,cACC,WAAW;;;;AAAA;AA+Bd;;iBAAsB,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,OAAA,CAAQ,WAAA;;;;;;;iBAe1C,eAAA,CAAgB,OAAA,EAAS,OAAA,GAAU,OAAO;;;;AAfW;AAe3E;;iBAiBsB,kBAAA,CACpB,OAAA,EAAS,OAAA,GACR,OAAO"}