@shell-shock/core 0.17.8 → 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 (272) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +29 -1
  2. package/dist/api.cjs +36 -1
  3. package/dist/api.cjs.map +1 -0
  4. package/dist/api.d.cts +2 -77
  5. package/dist/api.d.cts.map +1 -1
  6. package/dist/api.d.mts +2 -76
  7. package/dist/api.d.mts.map +1 -1
  8. package/dist/api.mjs +35 -1
  9. package/dist/api.mjs.map +1 -1
  10. package/dist/components/command-validation-logic.cjs +291 -1
  11. package/dist/components/command-validation-logic.cjs.map +1 -0
  12. package/dist/components/command-validation-logic.d.cts +1 -3
  13. package/dist/components/command-validation-logic.d.cts.map +1 -1
  14. package/dist/components/command-validation-logic.d.mts +1 -3
  15. package/dist/components/command-validation-logic.d.mts.map +1 -1
  16. package/dist/components/command-validation-logic.mjs +288 -1
  17. package/dist/components/command-validation-logic.mjs.map +1 -1
  18. package/dist/components/docs.cjs +265 -1
  19. package/dist/components/docs.cjs.map +1 -0
  20. package/dist/components/docs.d.cts +4 -5
  21. package/dist/components/docs.d.cts.map +1 -1
  22. package/dist/components/docs.d.mts +4 -5
  23. package/dist/components/docs.d.mts.map +1 -1
  24. package/dist/components/docs.mjs +256 -1
  25. package/dist/components/docs.mjs.map +1 -1
  26. package/dist/components/exec-builtin.cjs +429 -15
  27. package/dist/components/exec-builtin.cjs.map +1 -0
  28. package/dist/components/exec-builtin.d.cts +1 -2
  29. package/dist/components/exec-builtin.d.cts.map +1 -1
  30. package/dist/components/exec-builtin.d.mts +1 -2
  31. package/dist/components/exec-builtin.d.mts.map +1 -1
  32. package/dist/components/exec-builtin.mjs +424 -15
  33. package/dist/components/exec-builtin.mjs.map +1 -1
  34. package/dist/components/helpers.cjs +119 -1
  35. package/dist/components/helpers.cjs.map +1 -0
  36. package/dist/components/helpers.d.cts +6 -8
  37. package/dist/components/helpers.d.cts.map +1 -1
  38. package/dist/components/helpers.d.mts +6 -8
  39. package/dist/components/helpers.d.mts.map +1 -1
  40. package/dist/components/helpers.mjs +111 -1
  41. package/dist/components/helpers.mjs.map +1 -1
  42. package/dist/components/index.cjs +58 -1
  43. package/dist/components/index.mjs +10 -1
  44. package/dist/components/options-parser-logic.cjs +959 -5
  45. package/dist/components/options-parser-logic.cjs.map +1 -0
  46. package/dist/components/options-parser-logic.d.cts +8 -9
  47. package/dist/components/options-parser-logic.d.cts.map +1 -1
  48. package/dist/components/options-parser-logic.d.mts +8 -9
  49. package/dist/components/options-parser-logic.d.mts.map +1 -1
  50. package/dist/components/options-parser-logic.mjs +944 -5
  51. package/dist/components/options-parser-logic.mjs.map +1 -1
  52. package/dist/components/state-builtin.cjs +630 -8
  53. package/dist/components/state-builtin.cjs.map +1 -0
  54. package/dist/components/state-builtin.d.cts +4 -5
  55. package/dist/components/state-builtin.d.cts.map +1 -1
  56. package/dist/components/state-builtin.d.mts +4 -5
  57. package/dist/components/state-builtin.d.mts.map +1 -1
  58. package/dist/components/state-builtin.mjs +622 -8
  59. package/dist/components/state-builtin.mjs.map +1 -1
  60. package/dist/components/usage.cjs +116 -1
  61. package/dist/components/usage.cjs.map +1 -0
  62. package/dist/components/usage.d.cts +1 -2
  63. package/dist/components/usage.d.cts.map +1 -1
  64. package/dist/components/usage.d.mts +1 -2
  65. package/dist/components/usage.d.mts.map +1 -1
  66. package/dist/components/usage.mjs +113 -1
  67. package/dist/components/usage.mjs.map +1 -1
  68. package/dist/components/utils-builtin.cjs +839 -33
  69. package/dist/components/utils-builtin.cjs.map +1 -0
  70. package/dist/components/utils-builtin.d.cts +7 -8
  71. package/dist/components/utils-builtin.d.cts.map +1 -1
  72. package/dist/components/utils-builtin.d.mts +7 -8
  73. package/dist/components/utils-builtin.d.mts.map +1 -1
  74. package/dist/components/utils-builtin.mjs +828 -33
  75. package/dist/components/utils-builtin.mjs.map +1 -1
  76. package/dist/config.cjs +65 -1
  77. package/dist/config.cjs.map +1 -0
  78. package/dist/config.d.cts +29 -8
  79. package/dist/config.d.cts.map +1 -1
  80. package/dist/config.d.mts +29 -8
  81. package/dist/config.d.mts.map +1 -1
  82. package/dist/config.mjs +62 -1
  83. package/dist/config.mjs.map +1 -1
  84. package/dist/contexts/command.cjs +26 -1
  85. package/dist/contexts/command.cjs.map +1 -0
  86. package/dist/contexts/command.d.cts.map +1 -1
  87. package/dist/contexts/command.d.mts.map +1 -1
  88. package/dist/contexts/command.mjs +23 -1
  89. package/dist/contexts/command.mjs.map +1 -1
  90. package/dist/contexts/index.cjs +9 -1
  91. package/dist/contexts/index.mjs +4 -1
  92. package/dist/contexts/options.cjs +63 -1
  93. package/dist/contexts/options.cjs.map +1 -0
  94. package/dist/contexts/options.d.cts.map +1 -1
  95. package/dist/contexts/options.d.mts.map +1 -1
  96. package/dist/contexts/options.mjs +57 -1
  97. package/dist/contexts/options.mjs.map +1 -1
  98. package/dist/engine.cjs +138 -0
  99. package/dist/engine.cjs.map +1 -0
  100. package/dist/engine.d.cts +79 -0
  101. package/dist/engine.d.cts.map +1 -0
  102. package/dist/engine.d.mts +79 -0
  103. package/dist/engine.d.mts.map +1 -0
  104. package/dist/engine.mjs +136 -0
  105. package/dist/engine.mjs.map +1 -0
  106. package/dist/helpers/automd.cjs +70 -1
  107. package/dist/helpers/automd.cjs.map +1 -0
  108. package/dist/helpers/automd.mjs +69 -1
  109. package/dist/helpers/automd.mjs.map +1 -1
  110. package/dist/helpers/docs-helpers.cjs +23 -1
  111. package/dist/helpers/docs-helpers.cjs.map +1 -0
  112. package/dist/helpers/docs-helpers.mjs +22 -1
  113. package/dist/helpers/docs-helpers.mjs.map +1 -1
  114. package/dist/helpers/get-framework.cjs +24 -0
  115. package/dist/helpers/get-framework.cjs.map +1 -0
  116. package/dist/helpers/get-framework.mjs +24 -0
  117. package/dist/helpers/get-framework.mjs.map +1 -0
  118. package/dist/helpers/paths.cjs +137 -1
  119. package/dist/helpers/paths.cjs.map +1 -0
  120. package/dist/helpers/paths.mjs +133 -1
  121. package/dist/helpers/paths.mjs.map +1 -1
  122. package/dist/helpers/persistence.cjs +113 -1
  123. package/dist/helpers/persistence.cjs.map +1 -0
  124. package/dist/helpers/persistence.mjs +112 -1
  125. package/dist/helpers/persistence.mjs.map +1 -1
  126. package/dist/helpers/update-package-json.cjs +65 -1
  127. package/dist/helpers/update-package-json.cjs.map +1 -0
  128. package/dist/helpers/update-package-json.mjs +63 -1
  129. package/dist/helpers/update-package-json.mjs.map +1 -1
  130. package/dist/helpers/utilities.cjs +95 -1
  131. package/dist/helpers/utilities.cjs.map +1 -0
  132. package/dist/helpers/utilities.mjs +93 -1
  133. package/dist/helpers/utilities.mjs.map +1 -1
  134. package/dist/helpers/validations.cjs +71 -1
  135. package/dist/helpers/validations.cjs.map +1 -0
  136. package/dist/helpers/validations.mjs +69 -1
  137. package/dist/helpers/validations.mjs.map +1 -1
  138. package/dist/index.cjs +123 -1
  139. package/dist/index.cjs.map +1 -0
  140. package/dist/index.d.cts +80 -5
  141. package/dist/index.d.cts.map +1 -0
  142. package/dist/index.d.mts +80 -5
  143. package/dist/index.d.mts.map +1 -0
  144. package/dist/index.mjs +119 -1
  145. package/dist/index.mjs.map +1 -0
  146. package/dist/package.cjs +12 -0
  147. package/dist/package.cjs.map +1 -0
  148. package/dist/package.mjs +6 -0
  149. package/dist/package.mjs.map +1 -0
  150. package/dist/plugin-utils/compute-bin.cjs +48 -1
  151. package/dist/plugin-utils/compute-bin.cjs.map +1 -0
  152. package/dist/plugin-utils/compute-bin.d.cts +2 -2
  153. package/dist/plugin-utils/compute-bin.d.cts.map +1 -1
  154. package/dist/plugin-utils/compute-bin.d.mts +2 -2
  155. package/dist/plugin-utils/compute-bin.d.mts.map +1 -1
  156. package/dist/plugin-utils/compute-bin.mjs +47 -1
  157. package/dist/plugin-utils/compute-bin.mjs.map +1 -1
  158. package/dist/plugin-utils/context-helpers.cjs +224 -1
  159. package/dist/plugin-utils/context-helpers.cjs.map +1 -0
  160. package/dist/plugin-utils/context-helpers.d.cts +4 -4
  161. package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
  162. package/dist/plugin-utils/context-helpers.d.mts +4 -4
  163. package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
  164. package/dist/plugin-utils/context-helpers.mjs +214 -1
  165. package/dist/plugin-utils/context-helpers.mjs.map +1 -1
  166. package/dist/plugin-utils/deepkit.cjs +70 -1
  167. package/dist/plugin-utils/deepkit.cjs.map +1 -0
  168. package/dist/plugin-utils/deepkit.d.cts +5 -5
  169. package/dist/plugin-utils/deepkit.d.cts.map +1 -1
  170. package/dist/plugin-utils/deepkit.d.mts +5 -5
  171. package/dist/plugin-utils/deepkit.d.mts.map +1 -1
  172. package/dist/plugin-utils/deepkit.mjs +68 -1
  173. package/dist/plugin-utils/deepkit.mjs.map +1 -1
  174. package/dist/plugin-utils/description-helpers.cjs +112 -2
  175. package/dist/plugin-utils/description-helpers.cjs.map +1 -0
  176. package/dist/plugin-utils/description-helpers.d.cts.map +1 -1
  177. package/dist/plugin-utils/description-helpers.d.mts.map +1 -1
  178. package/dist/plugin-utils/description-helpers.mjs +107 -2
  179. package/dist/plugin-utils/description-helpers.mjs.map +1 -1
  180. package/dist/plugin-utils/get-command-tree.cjs +118 -1
  181. package/dist/plugin-utils/get-command-tree.cjs.map +1 -0
  182. package/dist/plugin-utils/get-command-tree.d.cts.map +1 -1
  183. package/dist/plugin-utils/get-command-tree.d.mts.map +1 -1
  184. package/dist/plugin-utils/get-command-tree.mjs +114 -1
  185. package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
  186. package/dist/plugin-utils/index.cjs +39 -1
  187. package/dist/plugin-utils/index.d.cts +2 -2
  188. package/dist/plugin-utils/index.d.mts +2 -2
  189. package/dist/plugin-utils/index.mjs +10 -1
  190. package/dist/plugin-utils/reflect.cjs +52 -1
  191. package/dist/plugin-utils/reflect.cjs.map +1 -0
  192. package/dist/plugin-utils/reflect.d.cts.map +1 -1
  193. package/dist/plugin-utils/reflect.d.mts.map +1 -1
  194. package/dist/plugin-utils/reflect.mjs +50 -1
  195. package/dist/plugin-utils/reflect.mjs.map +1 -1
  196. package/dist/plugin-utils/traverse-command-tree.cjs +65 -1
  197. package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -0
  198. package/dist/plugin-utils/traverse-command-tree.d.cts.map +1 -1
  199. package/dist/plugin-utils/traverse-command-tree.d.mts.map +1 -1
  200. package/dist/plugin-utils/traverse-command-tree.mjs +62 -1
  201. package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
  202. package/dist/plugin-utils/type-checks.cjs +222 -1
  203. package/dist/plugin-utils/type-checks.cjs.map +1 -0
  204. package/dist/plugin-utils/type-checks.d.cts +5 -5
  205. package/dist/plugin-utils/type-checks.d.cts.map +1 -1
  206. package/dist/plugin-utils/type-checks.d.mts +5 -5
  207. package/dist/plugin-utils/type-checks.d.mts.map +1 -1
  208. package/dist/plugin-utils/type-checks.mjs +217 -1
  209. package/dist/plugin-utils/type-checks.mjs.map +1 -1
  210. package/dist/plugin.cjs +495 -4
  211. package/dist/plugin.cjs.map +1 -0
  212. package/dist/plugin.d.cts.map +1 -1
  213. package/dist/plugin.d.mts.map +1 -1
  214. package/dist/plugin.mjs +488 -4
  215. package/dist/plugin.mjs.map +1 -1
  216. package/dist/resolver/helpers.cjs +182 -1
  217. package/dist/resolver/helpers.cjs.map +1 -0
  218. package/dist/resolver/helpers.mjs +178 -1
  219. package/dist/resolver/helpers.mjs.map +1 -1
  220. package/dist/resolver/resolve.cjs +479 -1
  221. package/dist/resolver/resolve.cjs.map +1 -0
  222. package/dist/resolver/resolve.mjs +478 -1
  223. package/dist/resolver/resolve.mjs.map +1 -1
  224. package/dist/types/command.cjs +402 -1
  225. package/dist/types/command.cjs.map +1 -0
  226. package/dist/types/command.d.cts +61 -119
  227. package/dist/types/command.d.cts.map +1 -1
  228. package/dist/types/command.d.mts +61 -119
  229. package/dist/types/command.d.mts.map +1 -1
  230. package/dist/types/command.mjs +367 -1
  231. package/dist/types/command.mjs.map +1 -1
  232. package/dist/types/config.cjs +175 -1
  233. package/dist/types/config.cjs.map +1 -0
  234. package/dist/types/config.d.cts +19 -12
  235. package/dist/types/config.d.cts.map +1 -1
  236. package/dist/types/config.d.mts +19 -12
  237. package/dist/types/config.d.mts.map +1 -1
  238. package/dist/types/config.mjs +163 -1
  239. package/dist/types/config.mjs.map +1 -1
  240. package/dist/types/context.cjs +45 -1
  241. package/dist/types/context.cjs.map +1 -0
  242. package/dist/types/context.d.cts +3 -2
  243. package/dist/types/context.d.cts.map +1 -1
  244. package/dist/types/context.d.mts +3 -2
  245. package/dist/types/context.d.mts.map +1 -1
  246. package/dist/types/context.mjs +40 -1
  247. package/dist/types/context.mjs.map +1 -1
  248. package/dist/types/env.cjs +53 -1
  249. package/dist/types/env.cjs.map +1 -0
  250. package/dist/types/env.d.cts +1 -1
  251. package/dist/types/env.d.cts.map +1 -1
  252. package/dist/types/env.d.mts +1 -1
  253. package/dist/types/env.d.mts.map +1 -1
  254. package/dist/types/env.mjs +50 -1
  255. package/dist/types/env.mjs.map +1 -1
  256. package/dist/types/index.cjs +53 -1
  257. package/dist/types/index.d.cts +4 -4
  258. package/dist/types/index.d.mts +4 -4
  259. package/dist/types/index.mjs +6 -1
  260. package/dist/types/options.cjs +13 -1
  261. package/dist/types/options.cjs.map +1 -0
  262. package/dist/types/options.d.cts.map +1 -1
  263. package/dist/types/options.d.mts.map +1 -1
  264. package/dist/types/options.mjs +10 -1
  265. package/dist/types/options.mjs.map +1 -1
  266. package/package.json +43 -34
  267. package/dist/resolver/deepkit.cjs +0 -1
  268. package/dist/resolver/deepkit.mjs +0 -2
  269. package/dist/resolver/deepkit.mjs.map +0 -1
  270. package/dist/resolver/module.cjs +0 -1
  271. package/dist/resolver/module.mjs +0 -2
  272. package/dist/resolver/module.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"validations.mjs","names":[],"sources":["../../src/helpers/validations.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 { CommandTree } from \"../types\";\nimport { CommandParameterKinds } from \"../types\";\n\nexport interface ValidationFailure {\n code: string;\n details: string;\n}\n\nexport function validateArguments(command: CommandTree): ValidationFailure[] {\n const failures: ValidationFailure[] = [];\n\n let sequential = false;\n for (const argument of command.args ?? []) {\n if (\n (argument.kind === CommandParameterKinds.string ||\n argument.kind === CommandParameterKinds.number) &&\n argument.variadic\n ) {\n if (!sequential) {\n sequential = true;\n } else {\n failures.push({\n code: \"SEQUENTIAL_VARIADIC_ARGUMENTS\",\n details: `Sequential variadic arguments are not allowed - since the argument preceding ${argument.name} is variadic, it must not also be variadic.`\n });\n }\n } else {\n sequential = false;\n }\n }\n\n return failures;\n}\n\nexport function validateOptions(command: CommandTree): ValidationFailure[] {\n const failures: ValidationFailure[] = [];\n\n const optionNames = new Set<string>();\n for (const option of Object.values(command.options ?? {})) {\n if (optionNames.has(option.name)) {\n failures.push({\n code: \"DUPLICATE_OPTION_NAME\",\n details: `Duplicate option name \"${option.name}\" found in command.`\n });\n }\n optionNames.add(option.name);\n\n for (const alias of option.alias) {\n if (optionNames.has(alias)) {\n failures.push({\n code: \"DUPLICATE_OPTION_ALIAS\",\n details: `Duplicate option name \"${alias}\" (an alias of \"${\n option.name\n }\") found in command.`\n });\n }\n optionNames.add(alias);\n }\n }\n\n return failures;\n}\n\nexport function validateCommand(command: CommandTree): ValidationFailure[] {\n const results: ValidationFailure[] = [];\n\n let failures = validateOptions(command);\n if (failures.length > 0) {\n results.push(...failures);\n }\n\n failures = validateArguments(command);\n if (failures.length > 0) {\n results.push(...failures);\n }\n\n return results;\n}\n"],"mappings":"6DAkBA,MAAM,EAAsB,CAAA,OAAS,UAAM,oBAAA,cAAA,eAG3C,IAAO,EAAU,EAAA,CACX,EAAQ,GACZ,IAAA,IAAS,KAAM,EAAA,MAAA,EAAA,EACjB,EAAA,OAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,SAAA,UAKM,KAAU,gCACT,QAAM,gFAAgC,EAAA,KAAA,6CACtC,CAAA,CALA,EAAS,GAQV,EAAS,GAGb,OAAM,EAER,EAAiB,OAAK,CAAA,cAAA,cAAA,EAAA,oBAAA,cAAA,CACtB,SAAgB,EAAC,EAAA,CACf,IAAM,EAAW,EAAC,CACZ,GAAE,IAAA,EAAA,CAAA,CAAA,IAAA,CAAA,CAAA,IAAA,KACR,IAAI,IAAA,KAAA,OAAA,OAAA,EAAA,SAAA,EAAA,CAAA,CAAA,CACA,EAAK,IAAA,EAAA,KAAA,EACL,EAAA,KAAa,CACf,KAAA,wBACF,QAAA,0BAAA,EAAA,KAAA,uBAGF,EAAA,IAAA,EAAA,KAAA,sBAEO,EAAS,IAAA,EAAgB,EACxB,EAAS,KAAC,+BAEV,QAAW,0BAAoB,EAAA,kBAAA,EAAA,KAAA,sBAChC,CAAA,CAED,EAAS,IAAK,EAAA,CAGlB,OAAM,EAER,EAAgB,OAAI,CAAM,cAAM,cAAA,EAAA,kBAAA,cAAA,eAE9B,IAAM,EAAO,EAAK,CACd,EAAI,EAAuB,EAAC,CAQhC,OAPI,EAAE,OAAc,GAClB,EAAM,KAAO,GAAA,EAAA,CAEf,EAAU,EAAO,EAAA,CACb,EAAQ,OAAS,GACnB,EAAM,KAAA,GAAA,EAAA,CAEJ,EAEN,EAAE,OAAA,CAAA,cAAA,cAAA,EAAA,kBAAA,cAAA"}
1
+ {"version":3,"file":"validations.mjs","names":[],"sources":[],"mappings":""}
package/dist/index.cjs CHANGED
@@ -1 +1,123 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./types/command.cjs`),t=require(`./types/config.cjs`),n=require(`./types/context.cjs`),r=require(`./types/options.cjs`),i=require(`./api.cjs`);exports.CommandParameterKinds=e.CommandParameterKinds,exports.ShellShockAPI=i.ShellShockAPI,exports.__ΩAsCommandParameterConfig=e.__ΩAsCommandParameterConfig,exports.__ΩBaseBooleanCommandParameter=e.__ΩBaseBooleanCommandParameter,exports.__ΩBaseCommandOptions=r.__ΩBaseCommandOptions,exports.__ΩBaseCommandParameter=e.__ΩBaseCommandParameter,exports.__ΩBaseNumberCommandParameter=e.__ΩBaseNumberCommandParameter,exports.__ΩBaseSingleCommandParameter=e.__ΩBaseSingleCommandParameter,exports.__ΩBaseStringCommandParameter=e.__ΩBaseStringCommandParameter,exports.__ΩBaseVariadicCommandParameter=e.__ΩBaseVariadicCommandParameter,exports.__ΩBooleanCommandOption=e.__ΩBooleanCommandOption,exports.__ΩBooleanCommandParameter=e.__ΩBooleanCommandParameter,exports.__ΩBooleanCommandParameterConfig=e.__ΩBooleanCommandParameterConfig,exports.__ΩCommandArgument=e.__ΩCommandArgument,exports.__ΩCommandArgumentConfig=e.__ΩCommandArgumentConfig,exports.__ΩCommandBase=e.__ΩCommandBase,exports.__ΩCommandConfig=e.__ΩCommandConfig,exports.__ΩCommandMetadata=e.__ΩCommandMetadata,exports.__ΩCommandModule=e.__ΩCommandModule,exports.__ΩCommandOption=e.__ΩCommandOption,exports.__ΩCommandOptionConfig=e.__ΩCommandOptionConfig,exports.__ΩCommandParameter=e.__ΩCommandParameter,exports.__ΩCommandParameterConfig=e.__ΩCommandParameterConfig,exports.__ΩCommandParameterKind=e.__ΩCommandParameterKind,exports.__ΩCommandParameterType=e.__ΩCommandParameterType,exports.__ΩCommandTree=e.__ΩCommandTree,exports.__ΩContext=n.__ΩContext,exports.__ΩNumberCommandParameter=e.__ΩNumberCommandParameter,exports.__ΩNumberCommandParameterConfig=e.__ΩNumberCommandParameterConfig,exports.__ΩOptions=t.__ΩOptions,exports.__ΩOutputConfig=t.__ΩOutputConfig,exports.__ΩReferenceOptions=t.__ΩReferenceOptions,exports.__ΩResolvedConfig=t.__ΩResolvedConfig,exports.__ΩSerializedCommandTree=e.__ΩSerializedCommandTree,exports.__ΩSingleBooleanCommandParameter=e.__ΩSingleBooleanCommandParameter,exports.__ΩSingleNumberCommandParameter=e.__ΩSingleNumberCommandParameter,exports.__ΩSingleStringCommandParameter=e.__ΩSingleStringCommandParameter,exports.__ΩStringCommandParameter=e.__ΩStringCommandParameter,exports.__ΩStringCommandParameterConfig=e.__ΩStringCommandParameterConfig,exports.__ΩUnresolvedContext=n.__ΩUnresolvedContext,exports.__ΩUserConfig=t.__ΩUserConfig,exports.__ΩVariadicBooleanCommandParameter=e.__ΩVariadicBooleanCommandParameter,exports.__ΩVariadicNumberCommandParameter=e.__ΩVariadicNumberCommandParameter,exports.__ΩVariadicStringCommandParameter=e.__ΩVariadicStringCommandParameter,exports.createShellShock=i.createShellShock;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_config = require('./config.cjs');
3
+
4
+ //#region src/index.ts
5
+ const __ΩPartial = [
6
+ "T",
7
+ "Partial",
8
+ "l+e#!e\"!fRb!Pde\"!gN#\"w\"y"
9
+ ];
10
+ const __ΩRecord = [
11
+ "K",
12
+ "T",
13
+ "Record",
14
+ "l'e#\"Rb!b\"Pde\"!N#!w#y"
15
+ ];
16
+ /**
17
+ * A utility function to define a Shell Shock command's metadata.
18
+ *
19
+ * @remarks
20
+ * This function is used to create a user configuration object for Shell Shock projects. It ensures that the configuration adheres to the expected structure.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * import { defineMetadata } from '@shell-shock/core';
25
+ *
26
+ * export const metadata = defineMetadata({
27
+ * name: 'my-command',
28
+ * title: 'My Custom Command',
29
+ * icon: '🗲',
30
+ * description: 'This is my custom command',
31
+ * alias: ['mc', 'my-cmd'],
32
+ * tags: ['custom', 'example']
33
+ * });
34
+ * ```
35
+ *
36
+ * @param metadata - A partial user configuration object.
37
+ * @returns A complete user configuration object.
38
+ */
39
+ function defineMetadata(metadata) {
40
+ return metadata;
41
+ }
42
+ defineMetadata.__type = [
43
+ () => __ΩPartial,
44
+ "CommandMetadata",
45
+ "metadata",
46
+ "defineMetadata",
47
+ "A utility function to define a Shell Shock command's metadata.",
48
+ "P\"w\"o!\"2#\"w\"/$?%"
49
+ ];
50
+ /**
51
+ * A utility function to define a Shell Shock command's options.
52
+ *
53
+ * @remarks
54
+ * This function is used to create a user configuration object for Shell Shock projects. It ensures that the configuration adheres to the expected structure.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * import { defineOptions } from '@shell-shock/core';
59
+ *
60
+ * export const options = defineOptions({
61
+ * verbose: {
62
+ * name: 'verbose',
63
+ * description: 'Enable verbose output',
64
+ * type: 'boolean'
65
+ * }
66
+ * });
67
+ * ```
68
+ *
69
+ * @param options - A record of command option configurations.
70
+ * @returns A complete record of command option configurations.
71
+ */
72
+ function defineOptions(options) {
73
+ return options;
74
+ }
75
+ defineOptions.__type = [
76
+ () => __ΩRecord,
77
+ "CommandOptionConfig",
78
+ "options",
79
+ () => __ΩRecord,
80
+ "defineOptions",
81
+ "A utility function to define a Shell Shock command's options.",
82
+ "P&\"w\"o!#2#&\"w\"o$#/%?&"
83
+ ];
84
+ /**
85
+ * A utility function to define a Shell Shock command's arguments.
86
+ *
87
+ * @remarks
88
+ * This function is used to create a user configuration object for Shell Shock projects. It ensures that the configuration adheres to the expected structure.
89
+ *
90
+ * @example
91
+ * ```ts
92
+ * import { defineArguments } from '@shell-shock/core';
93
+ *
94
+ * export const args = defineArguments([
95
+ * {
96
+ * name: 'input',
97
+ * type: 'string',
98
+ * description: 'The input file',
99
+ * required: true
100
+ * }
101
+ * ]);
102
+ * ```
103
+ *
104
+ * @param args - An array of command argument configurations.
105
+ * @returns A complete array of command argument configurations.
106
+ */
107
+ function defineArguments(args) {
108
+ return args;
109
+ }
110
+ defineArguments.__type = [
111
+ "CommandArgumentConfig",
112
+ "args",
113
+ "defineArguments",
114
+ "A utility function to define a Shell Shock command's arguments.",
115
+ "P\"w!F2\"\"w!F/#?$"
116
+ ];
117
+
118
+ //#endregion
119
+ exports.defineArguments = defineArguments;
120
+ exports.defineConfig = require_config.defineConfig;
121
+ exports.defineMetadata = defineMetadata;
122
+ exports.defineOptions = defineOptions;
123
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":[],"sources":[],"mappings":""}
package/dist/index.d.cts CHANGED
@@ -1,6 +1,81 @@
1
- import { ShellShockAPI, createShellShock } from "./api.cjs";
2
- import { AsCommandParameterConfig, BaseBooleanCommandParameter, BaseCommandParameter, BaseNumberCommandParameter, BaseSingleCommandParameter, BaseStringCommandParameter, BaseVariadicCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterKind, CommandParameterKinds, CommandParameterType, CommandTree, NumberCommandParameter, NumberCommandParameterConfig, SerializedCommandTree, SingleBooleanCommandParameter, SingleNumberCommandParameter, SingleStringCommandParameter, StringCommandParameter, StringCommandParameterConfig, VariadicBooleanCommandParameter, VariadicNumberCommandParameter, VariadicStringCommandParameter } from "./types/command.cjs";
3
- import { Context, UnresolvedContext } from "./types/context.cjs";
4
- import { Options, OutputConfig, ReferenceOptions, ResolvedConfig, UserConfig } from "./types/config.cjs";
1
+ import { AsCommandParameterConfig, BaseBooleanCommandParameter, BaseCommandParameter, BaseNumberCommandParameter, BaseSingleCommandParameter, BaseStringCommandParameter, BaseVariadicCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterType, CommandTree, NumberCommandParameter, NumberCommandParameterConfig, SerializedCommandTree, SingleBooleanCommandParameter, SingleNumberCommandParameter, SingleStringCommandParameter, StringCommandParameter, StringCommandParameterConfig, VariadicBooleanCommandParameter, VariadicNumberCommandParameter, VariadicStringCommandParameter } from "./types/command.cjs";
2
+ import { Context, ExecutionContext, UnresolvedContext } from "./types/context.cjs";
3
+ import { EngineOptions, Options, OutputConfig, ReferenceOptions, ResolvedConfig, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnObject, UserConfigFnPromise } from "./types/config.cjs";
5
4
  import { BaseCommandOptions } from "./types/options.cjs";
6
- export { AsCommandParameterConfig, BaseBooleanCommandParameter, BaseCommandOptions, BaseCommandParameter, BaseNumberCommandParameter, BaseSingleCommandParameter, BaseStringCommandParameter, BaseVariadicCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterKind, CommandParameterKinds, CommandParameterType, CommandTree, Context, NumberCommandParameter, NumberCommandParameterConfig, Options, OutputConfig, ReferenceOptions, ResolvedConfig, SerializedCommandTree, ShellShockAPI, SingleBooleanCommandParameter, SingleNumberCommandParameter, SingleStringCommandParameter, StringCommandParameter, StringCommandParameterConfig, UnresolvedContext, UserConfig, VariadicBooleanCommandParameter, VariadicNumberCommandParameter, VariadicStringCommandParameter, createShellShock };
5
+ import { defineConfig } from "./config.cjs";
6
+
7
+ //#region src/index.d.ts
8
+ /**
9
+ * A utility function to define a Shell Shock command's metadata.
10
+ *
11
+ * @remarks
12
+ * This function is used to create a user configuration object for Shell Shock projects. It ensures that the configuration adheres to the expected structure.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * import { defineMetadata } from '@shell-shock/core';
17
+ *
18
+ * export const metadata = defineMetadata({
19
+ * name: 'my-command',
20
+ * title: 'My Custom Command',
21
+ * icon: '🗲',
22
+ * description: 'This is my custom command',
23
+ * alias: ['mc', 'my-cmd'],
24
+ * tags: ['custom', 'example']
25
+ * });
26
+ * ```
27
+ *
28
+ * @param metadata - A partial user configuration object.
29
+ * @returns A complete user configuration object.
30
+ */
31
+ declare function defineMetadata(metadata: Partial<CommandMetadata>): CommandMetadata;
32
+ /**
33
+ * A utility function to define a Shell Shock command's options.
34
+ *
35
+ * @remarks
36
+ * This function is used to create a user configuration object for Shell Shock projects. It ensures that the configuration adheres to the expected structure.
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * import { defineOptions } from '@shell-shock/core';
41
+ *
42
+ * export const options = defineOptions({
43
+ * verbose: {
44
+ * name: 'verbose',
45
+ * description: 'Enable verbose output',
46
+ * type: 'boolean'
47
+ * }
48
+ * });
49
+ * ```
50
+ *
51
+ * @param options - A record of command option configurations.
52
+ * @returns A complete record of command option configurations.
53
+ */
54
+ declare function defineOptions(options: Record<string, CommandOptionConfig>): Record<string, CommandOptionConfig>;
55
+ /**
56
+ * A utility function to define a Shell Shock command's arguments.
57
+ *
58
+ * @remarks
59
+ * This function is used to create a user configuration object for Shell Shock projects. It ensures that the configuration adheres to the expected structure.
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * import { defineArguments } from '@shell-shock/core';
64
+ *
65
+ * export const args = defineArguments([
66
+ * {
67
+ * name: 'input',
68
+ * type: 'string',
69
+ * description: 'The input file',
70
+ * required: true
71
+ * }
72
+ * ]);
73
+ * ```
74
+ *
75
+ * @param args - An array of command argument configurations.
76
+ * @returns A complete array of command argument configurations.
77
+ */
78
+ declare function defineArguments(args: CommandArgumentConfig[]): CommandArgumentConfig[];
79
+ //#endregion
80
+ export { type AsCommandParameterConfig, type BaseBooleanCommandParameter, type BaseCommandOptions, type BaseCommandParameter, type BaseNumberCommandParameter, type BaseSingleCommandParameter, type BaseStringCommandParameter, type BaseVariadicCommandParameter, type BooleanCommandOption, type BooleanCommandParameter, type BooleanCommandParameterConfig, type CommandArgument, type CommandArgumentConfig, type CommandBase, type CommandConfig, type CommandMetadata, type CommandModule, type CommandOption, type CommandOptionConfig, type CommandParameter, type CommandParameterConfig, type CommandParameterType, type CommandTree, type Context, type EngineOptions, type ExecutionContext, type NumberCommandParameter, type NumberCommandParameterConfig, type Options, type OutputConfig, type ReferenceOptions, type ResolvedConfig, type SerializedCommandTree, type SingleBooleanCommandParameter, type SingleNumberCommandParameter, type SingleStringCommandParameter, type StringCommandParameter, type StringCommandParameterConfig, type UnresolvedContext, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, type VariadicBooleanCommandParameter, type VariadicNumberCommandParameter, type VariadicStringCommandParameter, defineArguments, defineConfig, defineMetadata, defineOptions };
81
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;AAkDA;;;;;;;;;;;;;AAEkB;AA0BlB;;;;iBA5BgB,cAAA,CACd,QAAA,EAAU,OAAA,CAAQ,eAAA,IACjB,eAAA;;;;;;;;;;;AA4BkC;AA2BrC;;;;;;;;AAEwB;;;iBA/BR,aAAA,CACd,OAAA,EAAS,MAAA,SAAe,mBAAA,IACvB,MAAA,SAAe,mBAAA;;;;;;;;;;;;;;;;;;;;;;;;iBA2BF,eAAA,CACd,IAAA,EAAM,qBAAA,KACL,qBAAqB"}
package/dist/index.d.mts CHANGED
@@ -1,6 +1,81 @@
1
- import { ShellShockAPI, createShellShock } from "./api.mjs";
2
- import { AsCommandParameterConfig, BaseBooleanCommandParameter, BaseCommandParameter, BaseNumberCommandParameter, BaseSingleCommandParameter, BaseStringCommandParameter, BaseVariadicCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterKind, CommandParameterKinds, CommandParameterType, CommandTree, NumberCommandParameter, NumberCommandParameterConfig, SerializedCommandTree, SingleBooleanCommandParameter, SingleNumberCommandParameter, SingleStringCommandParameter, StringCommandParameter, StringCommandParameterConfig, VariadicBooleanCommandParameter, VariadicNumberCommandParameter, VariadicStringCommandParameter } from "./types/command.mjs";
3
- import { Context, UnresolvedContext } from "./types/context.mjs";
4
- import { Options, OutputConfig, ReferenceOptions, ResolvedConfig, UserConfig } from "./types/config.mjs";
1
+ import { AsCommandParameterConfig, BaseBooleanCommandParameter, BaseCommandParameter, BaseNumberCommandParameter, BaseSingleCommandParameter, BaseStringCommandParameter, BaseVariadicCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterType, CommandTree, NumberCommandParameter, NumberCommandParameterConfig, SerializedCommandTree, SingleBooleanCommandParameter, SingleNumberCommandParameter, SingleStringCommandParameter, StringCommandParameter, StringCommandParameterConfig, VariadicBooleanCommandParameter, VariadicNumberCommandParameter, VariadicStringCommandParameter } from "./types/command.mjs";
2
+ import { Context, ExecutionContext, UnresolvedContext } from "./types/context.mjs";
3
+ import { EngineOptions, Options, OutputConfig, ReferenceOptions, ResolvedConfig, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnObject, UserConfigFnPromise } from "./types/config.mjs";
5
4
  import { BaseCommandOptions } from "./types/options.mjs";
6
- export { AsCommandParameterConfig, BaseBooleanCommandParameter, BaseCommandOptions, BaseCommandParameter, BaseNumberCommandParameter, BaseSingleCommandParameter, BaseStringCommandParameter, BaseVariadicCommandParameter, BooleanCommandOption, BooleanCommandParameter, BooleanCommandParameterConfig, CommandArgument, CommandArgumentConfig, CommandBase, CommandConfig, CommandMetadata, CommandModule, CommandOption, CommandOptionConfig, CommandParameter, CommandParameterConfig, CommandParameterKind, CommandParameterKinds, CommandParameterType, CommandTree, Context, NumberCommandParameter, NumberCommandParameterConfig, Options, OutputConfig, ReferenceOptions, ResolvedConfig, SerializedCommandTree, ShellShockAPI, SingleBooleanCommandParameter, SingleNumberCommandParameter, SingleStringCommandParameter, StringCommandParameter, StringCommandParameterConfig, UnresolvedContext, UserConfig, VariadicBooleanCommandParameter, VariadicNumberCommandParameter, VariadicStringCommandParameter, createShellShock };
5
+ import { defineConfig } from "./config.mjs";
6
+
7
+ //#region src/index.d.ts
8
+ /**
9
+ * A utility function to define a Shell Shock command's metadata.
10
+ *
11
+ * @remarks
12
+ * This function is used to create a user configuration object for Shell Shock projects. It ensures that the configuration adheres to the expected structure.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * import { defineMetadata } from '@shell-shock/core';
17
+ *
18
+ * export const metadata = defineMetadata({
19
+ * name: 'my-command',
20
+ * title: 'My Custom Command',
21
+ * icon: '🗲',
22
+ * description: 'This is my custom command',
23
+ * alias: ['mc', 'my-cmd'],
24
+ * tags: ['custom', 'example']
25
+ * });
26
+ * ```
27
+ *
28
+ * @param metadata - A partial user configuration object.
29
+ * @returns A complete user configuration object.
30
+ */
31
+ declare function defineMetadata(metadata: Partial<CommandMetadata>): CommandMetadata;
32
+ /**
33
+ * A utility function to define a Shell Shock command's options.
34
+ *
35
+ * @remarks
36
+ * This function is used to create a user configuration object for Shell Shock projects. It ensures that the configuration adheres to the expected structure.
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * import { defineOptions } from '@shell-shock/core';
41
+ *
42
+ * export const options = defineOptions({
43
+ * verbose: {
44
+ * name: 'verbose',
45
+ * description: 'Enable verbose output',
46
+ * type: 'boolean'
47
+ * }
48
+ * });
49
+ * ```
50
+ *
51
+ * @param options - A record of command option configurations.
52
+ * @returns A complete record of command option configurations.
53
+ */
54
+ declare function defineOptions(options: Record<string, CommandOptionConfig>): Record<string, CommandOptionConfig>;
55
+ /**
56
+ * A utility function to define a Shell Shock command's arguments.
57
+ *
58
+ * @remarks
59
+ * This function is used to create a user configuration object for Shell Shock projects. It ensures that the configuration adheres to the expected structure.
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * import { defineArguments } from '@shell-shock/core';
64
+ *
65
+ * export const args = defineArguments([
66
+ * {
67
+ * name: 'input',
68
+ * type: 'string',
69
+ * description: 'The input file',
70
+ * required: true
71
+ * }
72
+ * ]);
73
+ * ```
74
+ *
75
+ * @param args - An array of command argument configurations.
76
+ * @returns A complete array of command argument configurations.
77
+ */
78
+ declare function defineArguments(args: CommandArgumentConfig[]): CommandArgumentConfig[];
79
+ //#endregion
80
+ export { type AsCommandParameterConfig, type BaseBooleanCommandParameter, type BaseCommandOptions, type BaseCommandParameter, type BaseNumberCommandParameter, type BaseSingleCommandParameter, type BaseStringCommandParameter, type BaseVariadicCommandParameter, type BooleanCommandOption, type BooleanCommandParameter, type BooleanCommandParameterConfig, type CommandArgument, type CommandArgumentConfig, type CommandBase, type CommandConfig, type CommandMetadata, type CommandModule, type CommandOption, type CommandOptionConfig, type CommandParameter, type CommandParameterConfig, type CommandParameterType, type CommandTree, type Context, type EngineOptions, type ExecutionContext, type NumberCommandParameter, type NumberCommandParameterConfig, type Options, type OutputConfig, type ReferenceOptions, type ResolvedConfig, type SerializedCommandTree, type SingleBooleanCommandParameter, type SingleNumberCommandParameter, type SingleStringCommandParameter, type StringCommandParameter, type StringCommandParameterConfig, type UnresolvedContext, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, type VariadicBooleanCommandParameter, type VariadicNumberCommandParameter, type VariadicStringCommandParameter, defineArguments, defineConfig, defineMetadata, defineOptions };
81
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":""}
package/dist/index.mjs CHANGED
@@ -1 +1,119 @@
1
- import{CommandParameterKinds as e,__ΩAsCommandParameterConfig as t,__ΩBaseBooleanCommandParameter as n,__ΩBaseCommandParameter as r,__ΩBaseNumberCommandParameter as i,__ΩBaseSingleCommandParameter as a,__ΩBaseStringCommandParameter as o,__ΩBaseVariadicCommandParameter as s,__ΩBooleanCommandOption as c,__ΩBooleanCommandParameter as l,__ΩBooleanCommandParameterConfig as u,__ΩCommandArgument as d,__ΩCommandArgumentConfig as f,__ΩCommandBase as p,__ΩCommandConfig as m,__ΩCommandMetadata as h,__ΩCommandModule as g,__ΩCommandOption as _,__ΩCommandOptionConfig as v,__ΩCommandParameter as y,__ΩCommandParameterConfig as b,__ΩCommandParameterKind as x,__ΩCommandParameterType as S,__ΩCommandTree as C,__ΩNumberCommandParameter as w,__ΩNumberCommandParameterConfig as T,__ΩSerializedCommandTree as E,__ΩSingleBooleanCommandParameter as D,__ΩSingleNumberCommandParameter as O,__ΩSingleStringCommandParameter as k,__ΩStringCommandParameter as A,__ΩStringCommandParameterConfig as j,__ΩVariadicBooleanCommandParameter as M,__ΩVariadicNumberCommandParameter as N,__ΩVariadicStringCommandParameter as P}from"./types/command.mjs";import{__ΩOptions as F,__ΩOutputConfig as I,__ΩReferenceOptions as L,__ΩResolvedConfig as R,__ΩUserConfig as z}from"./types/config.mjs";import{__ΩContext as B,__ΩUnresolvedContext as V}from"./types/context.mjs";import{__ΩBaseCommandOptions as H}from"./types/options.mjs";import{ShellShockAPI as U,createShellShock as W}from"./api.mjs";export{e as CommandParameterKinds,U as ShellShockAPI,t as __ΩAsCommandParameterConfig,n as __ΩBaseBooleanCommandParameter,H as __ΩBaseCommandOptions,r as __ΩBaseCommandParameter,i as __ΩBaseNumberCommandParameter,a as __ΩBaseSingleCommandParameter,o as __ΩBaseStringCommandParameter,s as __ΩBaseVariadicCommandParameter,c as __ΩBooleanCommandOption,l as __ΩBooleanCommandParameter,u as __ΩBooleanCommandParameterConfig,d as __ΩCommandArgument,f as __ΩCommandArgumentConfig,p as __ΩCommandBase,m as __ΩCommandConfig,h as __ΩCommandMetadata,g as __ΩCommandModule,_ as __ΩCommandOption,v as __ΩCommandOptionConfig,y as __ΩCommandParameter,b as __ΩCommandParameterConfig,x as __ΩCommandParameterKind,S as __ΩCommandParameterType,C as __ΩCommandTree,B as __ΩContext,w as __ΩNumberCommandParameter,T as __ΩNumberCommandParameterConfig,F as __ΩOptions,I as __ΩOutputConfig,L as __ΩReferenceOptions,R as __ΩResolvedConfig,E as __ΩSerializedCommandTree,D as __ΩSingleBooleanCommandParameter,O as __ΩSingleNumberCommandParameter,k as __ΩSingleStringCommandParameter,A as __ΩStringCommandParameter,j as __ΩStringCommandParameterConfig,V as __ΩUnresolvedContext,z as __ΩUserConfig,M as __ΩVariadicBooleanCommandParameter,N as __ΩVariadicNumberCommandParameter,P as __ΩVariadicStringCommandParameter,W as createShellShock};
1
+ import { defineConfig } from "./config.mjs";
2
+
3
+ //#region src/index.ts
4
+ const __ΩPartial = [
5
+ "T",
6
+ "Partial",
7
+ "l+e#!e\"!fRb!Pde\"!gN#\"w\"y"
8
+ ];
9
+ const __ΩRecord = [
10
+ "K",
11
+ "T",
12
+ "Record",
13
+ "l'e#\"Rb!b\"Pde\"!N#!w#y"
14
+ ];
15
+ /**
16
+ * A utility function to define a Shell Shock command's metadata.
17
+ *
18
+ * @remarks
19
+ * This function is used to create a user configuration object for Shell Shock projects. It ensures that the configuration adheres to the expected structure.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * import { defineMetadata } from '@shell-shock/core';
24
+ *
25
+ * export const metadata = defineMetadata({
26
+ * name: 'my-command',
27
+ * title: 'My Custom Command',
28
+ * icon: '🗲',
29
+ * description: 'This is my custom command',
30
+ * alias: ['mc', 'my-cmd'],
31
+ * tags: ['custom', 'example']
32
+ * });
33
+ * ```
34
+ *
35
+ * @param metadata - A partial user configuration object.
36
+ * @returns A complete user configuration object.
37
+ */
38
+ function defineMetadata(metadata) {
39
+ return metadata;
40
+ }
41
+ defineMetadata.__type = [
42
+ () => __ΩPartial,
43
+ "CommandMetadata",
44
+ "metadata",
45
+ "defineMetadata",
46
+ "A utility function to define a Shell Shock command's metadata.",
47
+ "P\"w\"o!\"2#\"w\"/$?%"
48
+ ];
49
+ /**
50
+ * A utility function to define a Shell Shock command's options.
51
+ *
52
+ * @remarks
53
+ * This function is used to create a user configuration object for Shell Shock projects. It ensures that the configuration adheres to the expected structure.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * import { defineOptions } from '@shell-shock/core';
58
+ *
59
+ * export const options = defineOptions({
60
+ * verbose: {
61
+ * name: 'verbose',
62
+ * description: 'Enable verbose output',
63
+ * type: 'boolean'
64
+ * }
65
+ * });
66
+ * ```
67
+ *
68
+ * @param options - A record of command option configurations.
69
+ * @returns A complete record of command option configurations.
70
+ */
71
+ function defineOptions(options) {
72
+ return options;
73
+ }
74
+ defineOptions.__type = [
75
+ () => __ΩRecord,
76
+ "CommandOptionConfig",
77
+ "options",
78
+ () => __ΩRecord,
79
+ "defineOptions",
80
+ "A utility function to define a Shell Shock command's options.",
81
+ "P&\"w\"o!#2#&\"w\"o$#/%?&"
82
+ ];
83
+ /**
84
+ * A utility function to define a Shell Shock command's arguments.
85
+ *
86
+ * @remarks
87
+ * This function is used to create a user configuration object for Shell Shock projects. It ensures that the configuration adheres to the expected structure.
88
+ *
89
+ * @example
90
+ * ```ts
91
+ * import { defineArguments } from '@shell-shock/core';
92
+ *
93
+ * export const args = defineArguments([
94
+ * {
95
+ * name: 'input',
96
+ * type: 'string',
97
+ * description: 'The input file',
98
+ * required: true
99
+ * }
100
+ * ]);
101
+ * ```
102
+ *
103
+ * @param args - An array of command argument configurations.
104
+ * @returns A complete array of command argument configurations.
105
+ */
106
+ function defineArguments(args) {
107
+ return args;
108
+ }
109
+ defineArguments.__type = [
110
+ "CommandArgumentConfig",
111
+ "args",
112
+ "defineArguments",
113
+ "A utility function to define a Shell Shock command's arguments.",
114
+ "P\"w!F2\"\"w!F/#?$"
115
+ ];
116
+
117
+ //#endregion
118
+ export { defineArguments, defineConfig, defineMetadata, defineOptions };
119
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+
2
+ //#region package.json
3
+ var version = "0.17.10";
4
+
5
+ //#endregion
6
+ Object.defineProperty(exports, 'version', {
7
+ enumerable: true,
8
+ get: function () {
9
+ return version;
10
+ }
11
+ });
12
+ //# sourceMappingURL=package.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.cjs","names":[],"sources":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ //#region package.json
2
+ var version = "0.17.10";
3
+
4
+ //#endregion
5
+ export { version };
6
+ //# sourceMappingURL=package.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1,48 @@
1
- require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./context-helpers.cjs`);let t=require(`@stryke/path/join-paths`),n=require(`@alloy-js/core`);function r(e,t){return e.__type=t,e}function i(i){return(0,n.computed)(()=>({id:``,name:e.getAppName(i),title:e.getAppTitle(i),description:e.getAppDescription(i),isVirtual:!0,path:null,segments:[],alias:[],tags:[],source:`file`,options:Object.fromEntries(i.globalOptions.map(r(e=>[e.name,e],[`option`,``,`P"2!"/"`]))),args:[],entry:{file:(0,t.joinPaths)(i.entryPath,`bin.ts`)},parent:null,children:i.commands})).value}i.__type=[`Context`,`context`,`CommandTree`,`computeBin`,`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.`,`P"w!2""w#/$?%`],exports.computeBin=i;
1
+ const require_context_helpers = require('./context-helpers.cjs');
2
+ let _stryke_path_join_paths = require("@stryke/path/join-paths");
3
+
4
+ //#region src/plugin-utils/compute-bin.ts
5
+ function __assignType(fn, args) {
6
+ fn.__type = args;
7
+ return fn;
8
+ }
9
+ /**
10
+ * Computes the command tree for the root binary command based on the provided context.
11
+ *
12
+ * @param context - The plugin context containing the necessary information to compute the command tree.
13
+ * @returns The computed command tree for the root binary command.
14
+ */
15
+ function computeBin(context) {
16
+ return {
17
+ id: "",
18
+ name: require_context_helpers.getAppName(context),
19
+ title: require_context_helpers.getAppTitle(context),
20
+ description: require_context_helpers.getAppDescription(context),
21
+ virtual: true,
22
+ path: null,
23
+ segments: [],
24
+ alias: [],
25
+ tags: [],
26
+ options: Object.fromEntries(context.globalOptions.map(__assignType((option) => [option.name, option], [
27
+ "option",
28
+ "",
29
+ "P\"2!\"/\""
30
+ ]))),
31
+ args: [],
32
+ entry: { file: (0, _stryke_path_join_paths.joinPaths)(context.entryPath, "bin.ts") },
33
+ parent: null,
34
+ children: context.commands
35
+ };
36
+ }
37
+ computeBin.__type = [
38
+ "Context",
39
+ "context",
40
+ "CommandTree",
41
+ "computeBin",
42
+ "Computes the command tree for the root binary command based on the provided context.",
43
+ "P\"w!2\"\"w#/$?%"
44
+ ];
45
+
46
+ //#endregion
47
+ exports.computeBin = computeBin;
48
+ //# sourceMappingURL=compute-bin.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute-bin.cjs","names":[],"sources":[],"mappings":""}
@@ -2,10 +2,10 @@ import { CommandTree } from "../types/command.cjs";
2
2
  import { Context } from "../types/context.cjs";
3
3
  //#region src/plugin-utils/compute-bin.d.ts
4
4
  /**
5
- * 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.
5
+ * Computes the command tree for the root binary command based on the provided context.
6
6
  *
7
7
  * @param context - The plugin context containing the necessary information to compute the command tree.
8
- * @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.
8
+ * @returns The computed command tree for the root binary command.
9
9
  */
10
10
  declare function computeBin(context: Context): CommandTree;
11
11
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"compute-bin.d.cts","names":[],"sources":["../../src/plugin-utils/compute-bin.ts"],"mappings":";;;;;;;AA6BA;;iBAAgB,UAAA,CAAW,OAAA,EAAS,OAAA,GAAU,WAAA"}
1
+ {"version":3,"file":"compute-bin.d.cts","names":[],"sources":["../../src/plugin-utils/compute-bin.ts"],"mappings":";;;;;;;AA4BA;;iBAAgB,UAAA,CAAW,OAAA,EAAS,OAAA,GAAU,WAAW"}
@@ -2,10 +2,10 @@ import { CommandTree } from "../types/command.mjs";
2
2
  import { Context } from "../types/context.mjs";
3
3
  //#region src/plugin-utils/compute-bin.d.ts
4
4
  /**
5
- * 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.
5
+ * Computes the command tree for the root binary command based on the provided context.
6
6
  *
7
7
  * @param context - The plugin context containing the necessary information to compute the command tree.
8
- * @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.
8
+ * @returns The computed command tree for the root binary command.
9
9
  */
10
10
  declare function computeBin(context: Context): CommandTree;
11
11
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"compute-bin.d.mts","names":[],"sources":["../../src/plugin-utils/compute-bin.ts"],"mappings":";;;;;;;AA6BA;;iBAAgB,UAAA,CAAW,OAAA,EAAS,OAAA,GAAU,WAAA"}
1
+ {"version":3,"file":"compute-bin.d.mts","names":[],"sources":["../../src/plugin-utils/compute-bin.ts"],"mappings":""}
@@ -1,2 +1,48 @@
1
- import{getAppDescription as e,getAppName as t,getAppTitle as n}from"./context-helpers.mjs";import{joinPaths as r}from"@stryke/path/join-paths";import{computed as i}from"@alloy-js/core";function a(e,t){return e.__type=t,e}function o(o){return i(()=>({id:``,name:t(o),title:n(o),description:e(o),isVirtual:!0,path:null,segments:[],alias:[],tags:[],source:`file`,options:Object.fromEntries(o.globalOptions.map(a(e=>[e.name,e],[`option`,``,`P"2!"/"`]))),args:[],entry:{file:r(o.entryPath,`bin.ts`)},parent:null,children:o.commands})).value}o.__type=[`Context`,`context`,`CommandTree`,`computeBin`,`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.`,`P"w!2""w#/$?%`];export{o as computeBin};
1
+ import { getAppDescription, getAppName, getAppTitle } from "./context-helpers.mjs";
2
+ import { joinPaths } from "@stryke/path/join-paths";
3
+
4
+ //#region src/plugin-utils/compute-bin.ts
5
+ function __assignType(fn, args) {
6
+ fn.__type = args;
7
+ return fn;
8
+ }
9
+ /**
10
+ * Computes the command tree for the root binary command based on the provided context.
11
+ *
12
+ * @param context - The plugin context containing the necessary information to compute the command tree.
13
+ * @returns The computed command tree for the root binary command.
14
+ */
15
+ function computeBin(context) {
16
+ return {
17
+ id: "",
18
+ name: getAppName(context),
19
+ title: getAppTitle(context),
20
+ description: getAppDescription(context),
21
+ virtual: true,
22
+ path: null,
23
+ segments: [],
24
+ alias: [],
25
+ tags: [],
26
+ options: Object.fromEntries(context.globalOptions.map(__assignType((option) => [option.name, option], [
27
+ "option",
28
+ "",
29
+ "P\"2!\"/\""
30
+ ]))),
31
+ args: [],
32
+ entry: { file: joinPaths(context.entryPath, "bin.ts") },
33
+ parent: null,
34
+ children: context.commands
35
+ };
36
+ }
37
+ computeBin.__type = [
38
+ "Context",
39
+ "context",
40
+ "CommandTree",
41
+ "computeBin",
42
+ "Computes the command tree for the root binary command based on the provided context.",
43
+ "P\"w!2\"\"w#/$?%"
44
+ ];
45
+
46
+ //#endregion
47
+ export { computeBin };
2
48
  //# sourceMappingURL=compute-bin.mjs.map
@@ -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":"yLAAA,SAAS,EAAa,EAAI,EAAM,CAE9B,kBAAO,EA4BT,SAAc,EAAa,EAAG,CAoB5B,OAnBQ,OAAA,CACN,GAAI,GACJ,KAAM,EAAC,EAAY,CACnB,MAAA,EAAa,EAAA,CACb,YAAW,EAAI,EAAA,CACf,UAAU,GACV,KAAA,KACA,SAAS,EAAA,CACT,MAAO,EAAC,CACR,KAAM,EAAE,CACR,OAAQ,OACR,QAAS,OAAC,YAAkB,EAAQ,cAAc,IAAE,EAAO,GAAA,CAAA,EAAA,KAAA,EAAA,CAAA,CAAA,SAAA,GAAA,UAAA,CAAA,CAAA,CAAA,CAC3D,KAAC,EAAA,CACD,MAAO,CACP,KAAO,EAAA,EAAA,UAAA,SAAA,CACN,CACD,OAAC,KACD,SAAQ,EAAI,SACb,EACE,CAAA,MAEL,EAAS,OAAS,CAAA,UAAA,UAAA,cAAA,aAAA,yMAAA,gBAAA"}
1
+ {"version":3,"file":"compute-bin.mjs","names":[],"sources":[],"mappings":""}