@shell-shock/core 0.17.21 → 0.17.23

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 (307) hide show
  1. package/README.md +16 -7
  2. package/dist/api.cjs +4 -5
  3. package/dist/api.d.cts +1 -1
  4. package/dist/api.d.mts +1 -1
  5. package/dist/api.mjs +2 -2
  6. package/dist/command-B6KYexlV.d.mts +308 -0
  7. package/dist/command-B6KYexlV.d.mts.map +1 -0
  8. package/dist/command-CtfR7hKM.d.cts +308 -0
  9. package/dist/command-CtfR7hKM.d.cts.map +1 -0
  10. package/dist/components/command-validation-logic.cjs +153 -216
  11. package/dist/components/command-validation-logic.d.cts +2 -1
  12. package/dist/components/command-validation-logic.d.cts.map +1 -1
  13. package/dist/components/command-validation-logic.d.mts +2 -1
  14. package/dist/components/command-validation-logic.mjs +153 -214
  15. package/dist/components/docs.cjs +6 -364
  16. package/dist/components/docs.d.cts +2 -3
  17. package/dist/components/docs.d.cts.map +1 -1
  18. package/dist/components/docs.d.mts +2 -3
  19. package/dist/components/docs.mjs +2 -356
  20. package/dist/components/exec-builtin.cjs +63 -100
  21. package/dist/components/exec-builtin.d.cts +1 -2
  22. package/dist/components/exec-builtin.d.cts.map +1 -1
  23. package/dist/components/exec-builtin.d.mts +1 -2
  24. package/dist/components/exec-builtin.mjs +7 -41
  25. package/dist/components/helpers.cjs +2 -52
  26. package/dist/components/helpers.d.cts +2 -1
  27. package/dist/components/helpers.d.cts.map +1 -1
  28. package/dist/components/helpers.d.mts +2 -1
  29. package/dist/components/helpers.mjs +2 -50
  30. package/dist/components/index.cjs +7 -23
  31. package/dist/components/index.mjs +9 -9
  32. package/dist/components/options-parser-logic.cjs +198 -420
  33. package/dist/components/options-parser-logic.d.cts +2 -5
  34. package/dist/components/options-parser-logic.d.cts.map +1 -1
  35. package/dist/components/options-parser-logic.d.mts +2 -5
  36. package/dist/components/options-parser-logic.mjs +192 -407
  37. package/dist/components/state-builtin.cjs +106 -164
  38. package/dist/components/state-builtin.d.cts +1 -2
  39. package/dist/components/state-builtin.d.cts.map +1 -1
  40. package/dist/components/state-builtin.d.mts +1 -2
  41. package/dist/components/state-builtin.mjs +12 -68
  42. package/dist/components/usage.cjs +4 -48
  43. package/dist/components/usage.d.cts +1 -2
  44. package/dist/components/usage.d.cts.map +1 -1
  45. package/dist/components/usage.d.mts +1 -2
  46. package/dist/components/usage.mjs +4 -46
  47. package/dist/components/utils-builtin.cjs +77 -144
  48. package/dist/components/utils-builtin.d.cts +1 -2
  49. package/dist/components/utils-builtin.d.cts.map +1 -1
  50. package/dist/components/utils-builtin.d.mts +1 -2
  51. package/dist/components/utils-builtin.mjs +9 -74
  52. package/dist/config-BIF9mEz0.d.cts +157 -0
  53. package/dist/config-BIF9mEz0.d.cts.map +1 -0
  54. package/dist/config-CnNYdfsL.d.mts +157 -0
  55. package/dist/config-CnNYdfsL.d.mts.map +1 -0
  56. package/dist/config.cjs +24 -58
  57. package/dist/config.d.cts +1 -2
  58. package/dist/config.d.cts.map +1 -1
  59. package/dist/config.d.mts +1 -2
  60. package/dist/config.mjs +23 -55
  61. package/dist/{plugin-utils/context-helpers.mjs → context-helpers-D3EJxwbq.mjs} +5 -83
  62. package/dist/context-helpers-D3EJxwbq.mjs.map +1 -0
  63. package/dist/{plugin-utils/context-helpers.cjs → context-helpers-_wUuFRB8.cjs} +63 -92
  64. package/dist/contexts/command.cjs +3 -9
  65. package/dist/contexts/command.d.cts +1 -2
  66. package/dist/contexts/command.d.cts.map +1 -1
  67. package/dist/contexts/command.d.mts +1 -2
  68. package/dist/contexts/command.mjs +2 -7
  69. package/dist/contexts/index.cjs +19 -1
  70. package/dist/contexts/index.d.cts +2 -1
  71. package/dist/contexts/index.d.mts +2 -1
  72. package/dist/contexts/index.mjs +2 -1
  73. package/dist/contexts/options.cjs +7 -30
  74. package/dist/contexts/options.d.cts +1 -2
  75. package/dist/contexts/options.d.cts.map +1 -1
  76. package/dist/contexts/options.d.mts +1 -2
  77. package/dist/contexts/options.mjs +7 -27
  78. package/dist/contexts/power-plant.cjs +19 -0
  79. package/dist/contexts/power-plant.d.cts +2 -0
  80. package/dist/contexts/power-plant.d.mts +2 -0
  81. package/dist/contexts/power-plant.mjs +5 -0
  82. package/dist/docs-C6ZvsVMu.cjs +278 -0
  83. package/dist/docs-CGQ2HtEY.mjs +249 -0
  84. package/dist/docs-CGQ2HtEY.mjs.map +1 -0
  85. package/dist/engine.cjs +5 -39
  86. package/dist/engine.d.cts +1 -2
  87. package/dist/engine.d.cts.map +1 -1
  88. package/dist/engine.d.mts +1 -2
  89. package/dist/engine.mjs +4 -37
  90. package/dist/generator.cjs +68 -0
  91. package/dist/generator.d.cts +15 -0
  92. package/dist/generator.d.cts.map +1 -0
  93. package/dist/generator.d.mts +15 -0
  94. package/dist/generator.d.mts.map +1 -0
  95. package/dist/generator.mjs +66 -0
  96. package/dist/generator.mjs.map +1 -0
  97. package/dist/{helpers/get-framework.cjs → get-framework-CxZc2krd.cjs} +7 -8
  98. package/dist/{helpers/get-framework.mjs → get-framework-Dlqz2hVZ.mjs} +3 -8
  99. package/dist/get-framework-Dlqz2hVZ.mjs.map +1 -0
  100. package/dist/helpers/power-plant.cjs +102 -0
  101. package/dist/helpers/power-plant.d.cts +61 -0
  102. package/dist/helpers/power-plant.d.cts.map +1 -0
  103. package/dist/helpers/power-plant.d.mts +61 -0
  104. package/dist/helpers/power-plant.d.mts.map +1 -0
  105. package/dist/helpers/power-plant.mjs +99 -0
  106. package/dist/helpers/power-plant.mjs.map +1 -0
  107. package/dist/index-D4klH_pj.d.mts +2 -0
  108. package/dist/index-DYOBadKY.d.cts +2 -0
  109. package/dist/index.cjs +1 -37
  110. package/dist/index.d.cts +4 -6
  111. package/dist/index.d.cts.map +1 -1
  112. package/dist/index.d.mts +4 -6
  113. package/dist/index.mjs +0 -35
  114. package/dist/package-B7Vu265G.mjs +6 -0
  115. package/dist/package-B7Vu265G.mjs.map +1 -0
  116. package/dist/{package.cjs → package-BLC4qc8t.cjs} +2 -4
  117. package/dist/plugin-B-hM2twc.mjs +1458 -0
  118. package/dist/plugin-B-hM2twc.mjs.map +1 -0
  119. package/dist/plugin-Bhfq0DMC.cjs +1490 -0
  120. package/dist/plugin-utils/index.cjs +359 -26
  121. package/dist/plugin-utils/index.d.cts +273 -9
  122. package/dist/plugin-utils/index.d.cts.map +1 -0
  123. package/dist/plugin-utils/index.d.mts +273 -9
  124. package/dist/plugin-utils/index.d.mts.map +1 -0
  125. package/dist/plugin-utils/index.mjs +346 -10
  126. package/dist/plugin-utils/index.mjs.map +1 -0
  127. package/dist/plugin.cjs +3 -496
  128. package/dist/plugin.d.cts +1 -3
  129. package/dist/plugin.d.cts.map +1 -1
  130. package/dist/plugin.d.mts +1 -3
  131. package/dist/plugin.mjs +2 -491
  132. package/dist/power-plant-LgxcvlMN.d.cts +4 -0
  133. package/dist/power-plant-LgxcvlMN.d.mts +4 -0
  134. package/dist/reflect-CSiffeL9.cjs +27 -0
  135. package/dist/reflect-DXKSFgvS.mjs +23 -0
  136. package/dist/reflect-DXKSFgvS.mjs.map +1 -0
  137. package/dist/schemas/env.cjs +91 -0
  138. package/dist/schemas/env.d.cts +145 -0
  139. package/dist/schemas/env.d.cts.map +1 -0
  140. package/dist/schemas/env.d.mts +145 -0
  141. package/dist/{types → schemas}/env.d.mts.map +1 -1
  142. package/dist/schemas/env.mjs +91 -0
  143. package/dist/schemas/index.cjs +4 -0
  144. package/dist/schemas/index.d.cts +2 -0
  145. package/dist/schemas/index.d.mts +2 -0
  146. package/dist/schemas/index.mjs +3 -0
  147. package/dist/types/command.cjs +0 -402
  148. package/dist/types/command.d.cts +2 -309
  149. package/dist/types/command.d.mts +2 -309
  150. package/dist/types/command.mjs +1 -368
  151. package/dist/types/config.cjs +0 -175
  152. package/dist/types/config.d.cts +2 -126
  153. package/dist/types/config.d.mts +2 -126
  154. package/dist/types/config.mjs +1 -164
  155. package/dist/types/context.cjs +0 -45
  156. package/dist/types/context.d.cts +2 -31
  157. package/dist/types/context.d.mts +2 -31
  158. package/dist/types/context.mjs +1 -41
  159. package/dist/types/index.cjs +3 -53
  160. package/dist/types/index.d.cts +4 -5
  161. package/dist/types/index.d.mts +4 -5
  162. package/dist/types/index.mjs +4 -5
  163. package/package.json +106 -42
  164. package/dist/_virtual/_rolldown/runtime.cjs +0 -29
  165. package/dist/api.cjs.map +0 -1
  166. package/dist/components/command-validation-logic.cjs.map +0 -1
  167. package/dist/components/docs.cjs.map +0 -1
  168. package/dist/components/docs.mjs.map +0 -1
  169. package/dist/components/exec-builtin.cjs.map +0 -1
  170. package/dist/components/helpers.cjs.map +0 -1
  171. package/dist/components/options-parser-logic.cjs.map +0 -1
  172. package/dist/components/state-builtin.cjs.map +0 -1
  173. package/dist/components/usage.cjs.map +0 -1
  174. package/dist/components/utils-builtin.cjs.map +0 -1
  175. package/dist/config.cjs.map +0 -1
  176. package/dist/contexts/command.cjs.map +0 -1
  177. package/dist/contexts/options.cjs.map +0 -1
  178. package/dist/engine.cjs.map +0 -1
  179. package/dist/helpers/automd.cjs +0 -193
  180. package/dist/helpers/automd.cjs.map +0 -1
  181. package/dist/helpers/automd.mjs +0 -190
  182. package/dist/helpers/automd.mjs.map +0 -1
  183. package/dist/helpers/docs-helpers.cjs +0 -24
  184. package/dist/helpers/docs-helpers.cjs.map +0 -1
  185. package/dist/helpers/docs-helpers.mjs +0 -24
  186. package/dist/helpers/docs-helpers.mjs.map +0 -1
  187. package/dist/helpers/get-framework.cjs.map +0 -1
  188. package/dist/helpers/get-framework.mjs.map +0 -1
  189. package/dist/helpers/paths.cjs +0 -137
  190. package/dist/helpers/paths.cjs.map +0 -1
  191. package/dist/helpers/paths.mjs +0 -134
  192. package/dist/helpers/paths.mjs.map +0 -1
  193. package/dist/helpers/persistence.cjs +0 -114
  194. package/dist/helpers/persistence.cjs.map +0 -1
  195. package/dist/helpers/persistence.mjs +0 -113
  196. package/dist/helpers/persistence.mjs.map +0 -1
  197. package/dist/helpers/update-package-json.cjs +0 -65
  198. package/dist/helpers/update-package-json.cjs.map +0 -1
  199. package/dist/helpers/update-package-json.mjs +0 -64
  200. package/dist/helpers/update-package-json.mjs.map +0 -1
  201. package/dist/helpers/utilities.cjs +0 -95
  202. package/dist/helpers/utilities.cjs.map +0 -1
  203. package/dist/helpers/utilities.mjs +0 -94
  204. package/dist/helpers/utilities.mjs.map +0 -1
  205. package/dist/helpers/validations.cjs +0 -71
  206. package/dist/helpers/validations.cjs.map +0 -1
  207. package/dist/helpers/validations.mjs +0 -70
  208. package/dist/helpers/validations.mjs.map +0 -1
  209. package/dist/index.cjs.map +0 -1
  210. package/dist/package.cjs.map +0 -1
  211. package/dist/package.mjs +0 -6
  212. package/dist/package.mjs.map +0 -1
  213. package/dist/plugin-utils/compute-bin.cjs +0 -49
  214. package/dist/plugin-utils/compute-bin.cjs.map +0 -1
  215. package/dist/plugin-utils/compute-bin.d.cts +0 -13
  216. package/dist/plugin-utils/compute-bin.d.cts.map +0 -1
  217. package/dist/plugin-utils/compute-bin.d.mts +0 -13
  218. package/dist/plugin-utils/compute-bin.d.mts.map +0 -1
  219. package/dist/plugin-utils/compute-bin.mjs +0 -49
  220. package/dist/plugin-utils/compute-bin.mjs.map +0 -1
  221. package/dist/plugin-utils/context-helpers.cjs.map +0 -1
  222. package/dist/plugin-utils/context-helpers.d.cts +0 -106
  223. package/dist/plugin-utils/context-helpers.d.cts.map +0 -1
  224. package/dist/plugin-utils/context-helpers.d.mts +0 -106
  225. package/dist/plugin-utils/context-helpers.d.mts.map +0 -1
  226. package/dist/plugin-utils/context-helpers.mjs.map +0 -1
  227. package/dist/plugin-utils/deepkit.cjs +0 -70
  228. package/dist/plugin-utils/deepkit.cjs.map +0 -1
  229. package/dist/plugin-utils/deepkit.d.cts +0 -23
  230. package/dist/plugin-utils/deepkit.d.cts.map +0 -1
  231. package/dist/plugin-utils/deepkit.d.mts +0 -23
  232. package/dist/plugin-utils/deepkit.d.mts.map +0 -1
  233. package/dist/plugin-utils/deepkit.mjs +0 -69
  234. package/dist/plugin-utils/deepkit.mjs.map +0 -1
  235. package/dist/plugin-utils/description-helpers.cjs +0 -112
  236. package/dist/plugin-utils/description-helpers.cjs.map +0 -1
  237. package/dist/plugin-utils/description-helpers.d.cts +0 -44
  238. package/dist/plugin-utils/description-helpers.d.cts.map +0 -1
  239. package/dist/plugin-utils/description-helpers.d.mts +0 -44
  240. package/dist/plugin-utils/description-helpers.d.mts.map +0 -1
  241. package/dist/plugin-utils/description-helpers.mjs +0 -108
  242. package/dist/plugin-utils/description-helpers.mjs.map +0 -1
  243. package/dist/plugin-utils/get-command-tree.cjs +0 -118
  244. package/dist/plugin-utils/get-command-tree.cjs.map +0 -1
  245. package/dist/plugin-utils/get-command-tree.d.cts +0 -36
  246. package/dist/plugin-utils/get-command-tree.d.cts.map +0 -1
  247. package/dist/plugin-utils/get-command-tree.d.mts +0 -36
  248. package/dist/plugin-utils/get-command-tree.d.mts.map +0 -1
  249. package/dist/plugin-utils/get-command-tree.mjs +0 -115
  250. package/dist/plugin-utils/get-command-tree.mjs.map +0 -1
  251. package/dist/plugin-utils/reflect.cjs +0 -54
  252. package/dist/plugin-utils/reflect.cjs.map +0 -1
  253. package/dist/plugin-utils/reflect.d.cts +0 -14
  254. package/dist/plugin-utils/reflect.d.cts.map +0 -1
  255. package/dist/plugin-utils/reflect.d.mts +0 -14
  256. package/dist/plugin-utils/reflect.d.mts.map +0 -1
  257. package/dist/plugin-utils/reflect.mjs +0 -53
  258. package/dist/plugin-utils/reflect.mjs.map +0 -1
  259. package/dist/plugin-utils/traverse-command-tree.cjs +0 -65
  260. package/dist/plugin-utils/traverse-command-tree.cjs.map +0 -1
  261. package/dist/plugin-utils/traverse-command-tree.d.cts +0 -22
  262. package/dist/plugin-utils/traverse-command-tree.d.cts.map +0 -1
  263. package/dist/plugin-utils/traverse-command-tree.d.mts +0 -22
  264. package/dist/plugin-utils/traverse-command-tree.d.mts.map +0 -1
  265. package/dist/plugin-utils/traverse-command-tree.mjs +0 -63
  266. package/dist/plugin-utils/traverse-command-tree.mjs.map +0 -1
  267. package/dist/plugin-utils/type-checks.cjs +0 -222
  268. package/dist/plugin-utils/type-checks.cjs.map +0 -1
  269. package/dist/plugin-utils/type-checks.d.cts +0 -41
  270. package/dist/plugin-utils/type-checks.d.cts.map +0 -1
  271. package/dist/plugin-utils/type-checks.d.mts +0 -41
  272. package/dist/plugin-utils/type-checks.d.mts.map +0 -1
  273. package/dist/plugin-utils/type-checks.mjs +0 -218
  274. package/dist/plugin-utils/type-checks.mjs.map +0 -1
  275. package/dist/plugin.cjs.map +0 -1
  276. package/dist/plugin.mjs.map +0 -1
  277. package/dist/resolver/deepkit.cjs +0 -110
  278. package/dist/resolver/deepkit.cjs.map +0 -1
  279. package/dist/resolver/deepkit.mjs +0 -109
  280. package/dist/resolver/deepkit.mjs.map +0 -1
  281. package/dist/resolver/helpers.cjs +0 -184
  282. package/dist/resolver/helpers.cjs.map +0 -1
  283. package/dist/resolver/helpers.mjs +0 -180
  284. package/dist/resolver/helpers.mjs.map +0 -1
  285. package/dist/resolver/resolve.cjs +0 -473
  286. package/dist/resolver/resolve.cjs.map +0 -1
  287. package/dist/resolver/resolve.mjs +0 -473
  288. package/dist/resolver/resolve.mjs.map +0 -1
  289. package/dist/types/command.cjs.map +0 -1
  290. package/dist/types/command.d.cts.map +0 -1
  291. package/dist/types/command.d.mts.map +0 -1
  292. package/dist/types/command.mjs.map +0 -1
  293. package/dist/types/config.cjs.map +0 -1
  294. package/dist/types/config.d.cts.map +0 -1
  295. package/dist/types/config.d.mts.map +0 -1
  296. package/dist/types/config.mjs.map +0 -1
  297. package/dist/types/context.cjs.map +0 -1
  298. package/dist/types/context.d.cts.map +0 -1
  299. package/dist/types/context.d.mts.map +0 -1
  300. package/dist/types/context.mjs.map +0 -1
  301. package/dist/types/env.cjs +0 -53
  302. package/dist/types/env.cjs.map +0 -1
  303. package/dist/types/env.d.cts +0 -71
  304. package/dist/types/env.d.cts.map +0 -1
  305. package/dist/types/env.d.mts +0 -71
  306. package/dist/types/env.mjs +0 -51
  307. /package/dist/{types → schemas}/env.mjs.map +0 -0
@@ -1,4 +1,4 @@
1
- import { getDynamicPathSegmentName, isDynamicPathSegment } from "../plugin-utils/context-helpers.mjs";
1
+ import { a as getDynamicPathSegmentName, c as isDynamicPathSegment } from "../context-helpers-D3EJxwbq.mjs";
2
2
  import { computedOptions } from "../contexts/options.mjs";
3
3
  import { BooleanInputParserLogic, CommandParameterType } from "./helpers.mjs";
4
4
  import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
@@ -6,81 +6,44 @@ import { For, Show, code, computed } from "@alloy-js/core";
6
6
  import { camelCase } from "@stryke/string-format/camel-case";
7
7
  import { constantCase } from "@stryke/string-format/constant-case";
8
8
  import { isSetString } from "@stryke/type-checks/is-set-string";
9
- import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
9
+ import { Spacing } from "@power-plant/alloy-js/core/components/spacing";
10
10
  import { ElseClause, ElseIfClause, IfStatement, InterfaceDeclaration, InterfaceMember, VarDeclaration } from "@alloy-js/typescript";
11
11
  import { pascalCase } from "@stryke/string-format/pascal-case";
12
12
 
13
13
  //#region src/components/options-parser-logic.tsx
14
- function __assignType(fn, args) {
15
- fn.__type = args;
16
- return fn;
17
- }
18
- const __ΩDynamicSegmentsParserLogicProps = [
19
- "CommandTree",
20
- "command",
21
- "The command to generate the dynamic path segments parser logic for. This is used to access the command options and parameters when generating the parser logic for dynamic path segments.",
22
- "isCaseSensitive",
23
- "Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.",
24
- "DynamicSegmentsParserLogicProps",
25
- "P\"w!4\"?#)4$?%Mw&y"
26
- ];
27
14
  function DynamicSegmentsParserLogic(props) {
28
15
  const { command } = props;
29
16
  return createComponent(For, {
30
17
  get each() {
31
18
  return command.segments ?? [];
32
19
  },
33
- get children() {
34
- return __assignType((segment, index) => createComponent(Show, {
35
- get when() {
36
- return isDynamicPathSegment(segment);
37
- },
38
- get children() {
39
- return [
40
- createComponent(VarDeclaration, {
41
- "let": true,
42
- get name() {
43
- return camelCase(getDynamicPathSegmentName(segment));
44
- },
45
- type: "string | undefined"
46
- }),
47
- createIntrinsic("hbr", {}),
48
- createComponent(IfStatement, {
49
- condition: code`args.length > ${2 + index} && args[${2 + index}]`,
50
- get children() {
51
- return code`${camelCase(getDynamicPathSegmentName(segment))} = args[${2 + index}];`;
52
- }
53
- }),
54
- createIntrinsic("hbr", {}),
55
- createIntrinsic("hbr", {})
56
- ];
57
- }
58
- }), [
59
- "segment",
60
- "index",
61
- "",
62
- "P\"2!\"2\"\"/#"
63
- ]);
64
- }
20
+ children: (segment, index) => createComponent(Show, {
21
+ get when() {
22
+ return isDynamicPathSegment(segment);
23
+ },
24
+ get children() {
25
+ return [
26
+ createComponent(VarDeclaration, {
27
+ "let": true,
28
+ get name() {
29
+ return camelCase(getDynamicPathSegmentName(segment));
30
+ },
31
+ type: "string | undefined"
32
+ }),
33
+ createIntrinsic("hbr", {}),
34
+ createComponent(IfStatement, {
35
+ condition: code`args.length > ${2 + index} && args[${2 + index}]`,
36
+ get children() {
37
+ return code`${camelCase(getDynamicPathSegmentName(segment))} = args[${2 + index}];`;
38
+ }
39
+ }),
40
+ createIntrinsic("hbr", {}),
41
+ createIntrinsic("hbr", {})
42
+ ];
43
+ }
44
+ })
65
45
  });
66
46
  }
67
- DynamicSegmentsParserLogic.__type = [
68
- () => __ΩDynamicSegmentsParserLogicProps,
69
- "props",
70
- "DynamicSegmentsParserLogic",
71
- "Pn!2\"\"/#"
72
- ];
73
- const __ΩArgumentsParserLogicProps = [
74
- "CommandTree",
75
- "command",
76
- "The command to generate the positional parameters parser logic for.",
77
- "appSpecificEnvPrefix",
78
- "The environment variable prefix to use for options that have an associated environment variable. This prefix will be used in the generated code to access the environment variables (e.g., `env.${appSpecificEnvPrefix}_OPTION_NAME`).",
79
- "isCaseSensitive",
80
- "Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.",
81
- "ArgumentsParserLogicProps",
82
- "P\"w!4\"?#&4$?%)4&?'Mw(y"
83
- ];
84
47
  function ArgumentsParserLogic(props) {
85
48
  const { command, appSpecificEnvPrefix, isCaseSensitive } = props;
86
49
  return createComponent(Show, {
@@ -94,15 +57,7 @@ function ArgumentsParserLogic(props) {
94
57
  name: "optionsIndex",
95
58
  type: "number",
96
59
  get initializer() {
97
- return code`Math.max(0, args.slice(${command.segments.length + 1}).findIndex(arg => arg.startsWith("-") && /^(${Object.values(command.options ?? {}).map(__assignType((option) => `${isCaseSensitive || option.name.length === 1 ? option.name : option.name.toLowerCase().replaceAll("-", "").replaceAll("_", "")}${option.alias && option.alias.length > 0 ? "|" : ""}${option.alias?.map(__assignType((a) => (isCaseSensitive || option.name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", "")) === "?" ? "\\?" : isCaseSensitive || option.name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", ""), [
98
- "a",
99
- "",
100
- "P\"2!\"/\""
101
- ])).join("|")}`, [
102
- "option",
103
- "",
104
- "P\"2!\"/\""
105
- ])).join("|")})=?.*$/.test(arg${isCaseSensitive ? "" : ".toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")"}))) + ${command.segments.length + 1};`;
60
+ return code`Math.max(0, args.slice(${command.segments.length + 1}).findIndex(arg => arg.startsWith("-") && /^(${Object.values(command.options ?? {}).map((option) => `${isCaseSensitive || option.name.length === 1 ? option.name : option.name.toLowerCase().replaceAll("-", "").replaceAll("_", "")}${option.alias && option.alias.length > 0 ? "|" : ""}${option.alias?.map((a) => (isCaseSensitive || option.name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", "")) === "?" ? "\\?" : isCaseSensitive || option.name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", "")).join("|")}`).join("|")})=?.*$/.test(arg${isCaseSensitive ? "" : ".toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")"}))) + ${command.segments.length + 1};`;
106
61
  }
107
62
  }),
108
63
  createComponent(Spacing, {}),
@@ -111,15 +66,7 @@ function ArgumentsParserLogic(props) {
111
66
  name: "argsIndex",
112
67
  type: "number",
113
68
  get initializer() {
114
- return code`optionsIndex > ${command.segments.length + 1} ? ${command.segments.length + 1} : (Math.max(0, args.slice(optionsIndex).findLastIndex(arg => arg.startsWith("-") && /^(${Object.values(command.options ?? {}).map(__assignType((option) => `${isCaseSensitive || option.name.length === 1 ? option.name : option.name.toLowerCase().replaceAll("-", "").replaceAll("_", "")}${option.alias && option.alias.length > 0 ? "|" : ""}${option.alias?.map(__assignType((a) => (isCaseSensitive || option.name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", "")) === "?" ? "\\?" : isCaseSensitive || option.name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", ""), [
115
- "a",
116
- "",
117
- "P\"2!\"/\""
118
- ])).join("|")}`, [
119
- "option",
120
- "",
121
- "P\"2!\"/\""
122
- ])).join("|")})=?.*$/.test(arg${isCaseSensitive ? "" : ".toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")"}))) + ${command.segments.length + 1});`;
69
+ return code`optionsIndex > ${command.segments.length + 1} ? ${command.segments.length + 1} : (Math.max(0, args.slice(optionsIndex).findLastIndex(arg => arg.startsWith("-") && /^(${Object.values(command.options ?? {}).map((option) => `${isCaseSensitive || option.name.length === 1 ? option.name : option.name.toLowerCase().replaceAll("-", "").replaceAll("_", "")}${option.alias && option.alias.length > 0 ? "|" : ""}${option.alias?.map((a) => (isCaseSensitive || option.name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", "")) === "?" ? "\\?" : isCaseSensitive || option.name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", "")).join("|")}`).join("|")})=?.*$/.test(arg${isCaseSensitive ? "" : ".toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")"}))) + ${command.segments.length + 1});`;
123
70
  }
124
71
  }),
125
72
  createComponent(Spacing, {}),
@@ -128,136 +75,119 @@ function ArgumentsParserLogic(props) {
128
75
  return command.args ?? [];
129
76
  },
130
77
  hardline: true,
131
- get children() {
132
- return __assignType((arg, index) => [
133
- createComponent(Show, {
134
- get when() {
135
- return isSetString(arg.env) || arg.default !== void 0 || arg.variadic;
136
- },
137
- get fallback() {
138
- return [
139
- memo(() => code`let ${camelCase(arg.name)}!: `),
140
- createComponent(CommandParameterType, { parameter: arg }),
141
- code`; `
142
- ];
143
- },
144
- get children() {
145
- return createComponent(VarDeclaration, {
146
- "let": true,
147
- get name() {
148
- return camelCase(arg.name);
78
+ children: (arg, index) => [
79
+ createComponent(Show, {
80
+ get when() {
81
+ return isSetString(arg.env) || arg.default !== void 0 || arg.variadic;
82
+ },
83
+ get fallback() {
84
+ return [
85
+ memo(() => code`let ${camelCase(arg.name)}!: `),
86
+ createComponent(CommandParameterType, { parameter: arg }),
87
+ code`; `
88
+ ];
89
+ },
90
+ get children() {
91
+ return createComponent(VarDeclaration, {
92
+ "let": true,
93
+ get name() {
94
+ return camelCase(arg.name);
95
+ },
96
+ get type() {
97
+ return createComponent(CommandParameterType, { parameter: arg });
98
+ },
99
+ get initializer() {
100
+ return [
101
+ code` ( `,
102
+ createComponent(Show, {
103
+ get when() {
104
+ return isSetString(arg.env);
105
+ },
106
+ get children() {
107
+ return code`env.${appSpecificEnvPrefix}_${constantCase(String(arg.env))} ?? `;
108
+ }
109
+ }),
110
+ createComponent(Show, {
111
+ get when() {
112
+ return arg.default !== void 0 && (!arg.variadic || arg.default.length > 0);
113
+ },
114
+ get fallback() {
115
+ return createComponent(Show, {
116
+ get when() {
117
+ return arg.variadic;
118
+ },
119
+ fallback: code`undefined`,
120
+ children: code`[]`
121
+ });
122
+ },
123
+ get children() {
124
+ return createComponent(Show, {
125
+ get when() {
126
+ return arg.variadic;
127
+ },
128
+ get fallback() {
129
+ return arg.type === "string" ? code`"${arg.default}"` : code`${arg.default}`;
130
+ },
131
+ get children() {
132
+ return code`[${arg.default?.map((value) => arg.type === "string" ? `"${value}"` : value).join(", ")}]`;
133
+ }
134
+ });
135
+ }
136
+ }),
137
+ code`) as `,
138
+ createComponent(CommandParameterType, { parameter: arg }),
139
+ code`; `
140
+ ];
141
+ }
142
+ });
143
+ }
144
+ }),
145
+ createComponent(Spacing, {}),
146
+ createComponent(IfStatement, {
147
+ condition: code`argsIndex + ${index} < args.length && argsIndex + ${index} !== optionsIndex`,
148
+ get children() {
149
+ return [
150
+ memo(() => code`${camelCase(arg.name)} = `),
151
+ createComponent(Show, {
152
+ get when() {
153
+ return arg.type === "string" || arg.type === "number";
149
154
  },
150
- get type() {
151
- return createComponent(CommandParameterType, { parameter: arg });
155
+ get fallback() {
156
+ return createComponent(BooleanInputParserLogic, { name: `args[argsIndex + ${index}] ` });
152
157
  },
153
- get initializer() {
154
- return [
155
- code` ( `,
156
- createComponent(Show, {
157
- get when() {
158
- return isSetString(arg.env);
159
- },
160
- get children() {
161
- return code`env.${appSpecificEnvPrefix}_${constantCase(String(arg.env))} ?? `;
162
- }
163
- }),
164
- createComponent(Show, {
165
- get when() {
166
- return arg.default !== void 0 && (!arg.variadic || arg.default.length > 0);
167
- },
168
- get fallback() {
169
- return createComponent(Show, {
170
- get when() {
171
- return arg.variadic;
172
- },
173
- fallback: code`undefined`,
174
- children: code`[]`
175
- });
176
- },
177
- get children() {
178
- return createComponent(Show, {
179
- get when() {
180
- return arg.variadic;
181
- },
182
- get fallback() {
183
- return arg.type === "string" ? code`"${arg.default}"` : code`${arg.default}`;
184
- },
185
- get children() {
186
- return code`[${arg.default?.map(__assignType((value) => arg.type === "string" ? `"${value}"` : value, [
187
- "value",
188
- "",
189
- "P\"2!\"/\""
190
- ])).join(", ")}]`;
191
- }
192
- });
193
- }
194
- }),
195
- code`) as `,
196
- createComponent(CommandParameterType, { parameter: arg }),
197
- code`; `
198
- ];
158
+ get children() {
159
+ return createComponent(Show, {
160
+ get when() {
161
+ return arg.variadic;
162
+ },
163
+ get fallback() {
164
+ return createComponent(Show, {
165
+ get when() {
166
+ return arg.type === "number";
167
+ },
168
+ fallback: code`args[argsIndex + ${index}] `,
169
+ children: code`Number(args[argsIndex + ${index}]) `
170
+ });
171
+ },
172
+ get children() {
173
+ return code`args.slice(argsIndex + ${index}, (optionsIndex > argsIndex ? optionsIndex : args.length) - ${command.args.length - index}).join(" ").split(",").map(item => item.trim().replace(/^("|')/, "").replace(/("|')$/, "")).filter(Boolean)`;
174
+ }
175
+ });
199
176
  }
200
- });
201
- }
202
- }),
203
- createComponent(Spacing, {}),
204
- createComponent(IfStatement, {
205
- condition: code`argsIndex + ${index} < args.length && argsIndex + ${index} !== optionsIndex`,
206
- get children() {
207
- return [
208
- memo(() => code`${camelCase(arg.name)} = `),
209
- createComponent(Show, {
210
- get when() {
211
- return arg.type === "string" || arg.type === "number";
212
- },
213
- get fallback() {
214
- return createComponent(BooleanInputParserLogic, { name: `args[argsIndex + ${index}] ` });
215
- },
216
- get children() {
217
- return createComponent(Show, {
218
- get when() {
219
- return arg.variadic;
220
- },
221
- get fallback() {
222
- return createComponent(Show, {
223
- get when() {
224
- return arg.type === "number";
225
- },
226
- fallback: code`args[argsIndex + ${index}] `,
227
- children: code`Number(args[argsIndex + ${index}]) `
228
- });
229
- },
230
- get children() {
231
- return code`args.slice(argsIndex + ${index}, (optionsIndex > argsIndex ? optionsIndex : args.length) - ${command.args.length - index}).join(" ").split(",").map(item => item.trim().replace(/^("|')/, "").replace(/("|')$/, "")).filter(Boolean)`;
232
- }
233
- });
234
- }
235
- }),
236
- code` as `,
237
- createComponent(CommandParameterType, { parameter: arg }),
238
- code`; `
239
- ];
240
- }
241
- }),
242
- createComponent(Spacing, {})
243
- ], [
244
- "arg",
245
- "index",
246
- "",
247
- "P\"2!\"2\"\"/#"
248
- ]);
249
- }
177
+ }),
178
+ code` as `,
179
+ createComponent(CommandParameterType, { parameter: arg }),
180
+ code`; `
181
+ ];
182
+ }
183
+ }),
184
+ createComponent(Spacing, {})
185
+ ]
250
186
  })
251
187
  ];
252
188
  }
253
189
  });
254
190
  }
255
- ArgumentsParserLogic.__type = [
256
- () => __ΩArgumentsParserLogicProps,
257
- "props",
258
- "ArgumentsParserLogic",
259
- "Pn!2\"\"/#"
260
- ];
261
191
  /**
262
192
  * The command option interface property.
263
193
  */
@@ -330,36 +260,12 @@ function OptionsMember({ option }) {
330
260
  }
331
261
  })];
332
262
  }
333
- OptionsMember.__type = [
334
- "CommandOption",
335
- "option",
336
- "param0",
337
- "OptionsMember",
338
- "The command option interface property.",
339
- "PP\"w!4\"M2#\"/$?%"
340
- ];
341
- const __ΩOptionsMemberParserLogicProps = [
342
- "name",
343
- "The option name to generate the parser logic for.",
344
- "CommandOption",
345
- "option",
346
- "The command option to generate the parser logic for.",
347
- "isCaseSensitive",
348
- true,
349
- "Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.",
350
- "OptionsMemberParserLogicProps",
351
- "P&4!?\"\"w#4$?%)4&>'?(Mw)y"
352
- ];
353
263
  /**
354
264
  * The command option property parser logic.
355
265
  */
356
266
  function OptionsMemberParserLogic(props) {
357
267
  const { name, option, isCaseSensitive } = props;
358
- const equalsRegex = `/^--?(${isCaseSensitive || name.length === 1 ? name : name.toLowerCase().replaceAll("-", "").replaceAll("_", "")}${option.alias && option.alias.length > 0 ? "|" : ""}${option.alias?.map(__assignType((a) => (isCaseSensitive || name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", "")) === "?" ? "\\?" : isCaseSensitive || name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", ""), [
359
- "a",
360
- "",
361
- "P\"2!\"/\""
362
- ])).join("|")})=/`;
268
+ const equalsRegex = `/^--?(${isCaseSensitive || name.length === 1 ? name : name.toLowerCase().replaceAll("-", "").replaceAll("_", "")}${option.alias && option.alias.length > 0 ? "|" : ""}${option.alias?.map((a) => (isCaseSensitive || name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", "")) === "?" ? "\\?" : isCaseSensitive || name.length === 1 ? a : a.toLowerCase().replaceAll("-", "").replaceAll("_", "")).join("|")})=/`;
363
269
  return [createComponent(Show, {
364
270
  get when() {
365
271
  return option.type === "string" || option.type === "number";
@@ -407,11 +313,7 @@ function OptionsMemberParserLogic(props) {
407
313
  return (option.type === "string" || option.type === "number") && option.choices && option.choices.length > 0;
408
314
  },
409
315
  get children() {
410
- return code` as ${option.choices?.map(__assignType((choice) => isSetString(choice) ? `"${choice}"` : choice, [
411
- "choice",
412
- "",
413
- "P\"2!\"/\""
414
- ])).join(" | ")} `;
316
+ return code` as ${option.choices?.map((choice) => isSetString(choice) ? `"${choice}"` : choice).join(" | ")} `;
415
317
  }
416
318
  }),
417
319
  code`); `
@@ -446,11 +348,7 @@ function OptionsMemberParserLogic(props) {
446
348
  return (option.type === "string" || option.type === "number") && option.choices && option.choices.length > 0;
447
349
  },
448
350
  get children() {
449
- return code` as ${option.choices?.map(__assignType((choice) => isSetString(choice) ? `"${choice}"` : choice, [
450
- "choice",
451
- "",
452
- "P\"2!\"/\""
453
- ])).join(" | ")} `;
351
+ return code` as ${option.choices?.map((choice) => isSetString(choice) ? `"${choice}"` : choice).join(" | ")} `;
454
352
  }
455
353
  }),
456
354
  code`); `
@@ -487,11 +385,7 @@ function OptionsMemberParserLogic(props) {
487
385
  return option.choices && option.choices.length > 0;
488
386
  },
489
387
  get children() {
490
- return code` as ${option.choices?.map(__assignType((choice) => `"${choice}"`, [
491
- "choice",
492
- "",
493
- "P\"2!\"/\""
494
- ])).join(" | ")}`;
388
+ return code` as ${option.choices?.map((choice) => `"${choice}"`).join(" | ")}`;
495
389
  }
496
390
  }),
497
391
  code`; `
@@ -560,11 +454,7 @@ function OptionsMemberParserLogic(props) {
560
454
  return option.choices && option.choices.length > 0;
561
455
  },
562
456
  get children() {
563
- return code` as ${option.choices?.map(__assignType((choice) => `"${choice}"`, [
564
- "choice",
565
- "",
566
- "P\"2!\"/\""
567
- ])).join(" | ")}`;
457
+ return code` as ${option.choices?.map((choice) => `"${choice}"`).join(" | ")}`;
568
458
  }
569
459
  }),
570
460
  code`; `
@@ -674,24 +564,6 @@ function OptionsMemberParserLogic(props) {
674
564
  }
675
565
  })];
676
566
  }
677
- OptionsMemberParserLogic.__type = [
678
- () => __ΩOptionsMemberParserLogicProps,
679
- "props",
680
- "OptionsMemberParserLogic",
681
- "The command option property parser logic.",
682
- "Pn!2\"\"/#?$"
683
- ];
684
- const __ΩOptionsMemberParserConditionProps = [
685
- "name",
686
- "The option name to generate the parser logic for.",
687
- "alias",
688
- "Aliases for the option, which will also be parsed in the generated code. This will affect how the generated code compares command-line arguments to option names and aliases.",
689
- "isCaseSensitive",
690
- true,
691
- "Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.",
692
- "OptionsMemberParserConditionProps",
693
- "P&4!?\"&F4#8?$)4%>&?'Mw(y"
694
- ];
695
567
  function OptionsMemberParserCondition(props) {
696
568
  const { name, alias: aliasProp, isCaseSensitive } = props;
697
569
  return [memo(() => code`${isCaseSensitive ? "arg.startsWith(\"--" : "arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\").startsWith(\""}${isCaseSensitive ? name : name.toLowerCase().replaceAll("-", "").replaceAll("_", "")}=") || ${isCaseSensitive ? "arg" : "arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")"} === "${isCaseSensitive ? name : name.toLowerCase().replaceAll("-", "").replaceAll("_", "")}" || ${isCaseSensitive ? "arg.startsWith(\"-" : "arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\").startsWith(\""}${isCaseSensitive ? name : name.toLowerCase().replaceAll("-", "").replaceAll("_", "")}=") || ${isCaseSensitive ? "arg" : "arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")"} === "${isCaseSensitive ? name : name.toLowerCase().replaceAll("-", "").replaceAll("_", "")}"`), createComponent(Show, {
@@ -701,33 +573,17 @@ function OptionsMemberParserCondition(props) {
701
573
  get children() {
702
574
  return createComponent(For, {
703
575
  each: aliasProp ?? [],
704
- get children() {
705
- return __assignType((alias) => code` || ${isCaseSensitive || alias.length === 1 ? "arg.startsWith(\"--" : "arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\").startsWith(\""}${isCaseSensitive || alias.length === 1 ? alias : alias.toLowerCase().replaceAll("-", "").replaceAll("_", "")}=") || ${isCaseSensitive || alias.length === 1 ? "arg" : "arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")"} === "${isCaseSensitive || alias.length === 1 ? alias : alias.toLowerCase().replaceAll("-", "").replaceAll("_", "")}" || ${isCaseSensitive || alias.length === 1 ? "arg.startsWith(\"-" : "arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\").startsWith(\""}${isCaseSensitive || alias.length === 1 ? alias : alias.toLowerCase().replaceAll("-", "").replaceAll("_", "")}=") || ${isCaseSensitive || alias.length === 1 ? "arg" : "arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")"} === "${isCaseSensitive || alias.length === 1 ? alias : alias.toLowerCase().replaceAll("-", "").replaceAll("_", "")}"`, [
706
- "alias",
707
- "",
708
- "P\"2!\"/\""
709
- ]);
710
- }
576
+ children: (alias) => code` || ${isCaseSensitive || alias.length === 1 ? "arg.startsWith(\"--" : "arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\").startsWith(\""}${isCaseSensitive || alias.length === 1 ? alias : alias.toLowerCase().replaceAll("-", "").replaceAll("_", "")}=") || ${isCaseSensitive || alias.length === 1 ? "arg" : "arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")"} === "${isCaseSensitive || alias.length === 1 ? alias : alias.toLowerCase().replaceAll("-", "").replaceAll("_", "")}" || ${isCaseSensitive || alias.length === 1 ? "arg.startsWith(\"-" : "arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\").startsWith(\""}${isCaseSensitive || alias.length === 1 ? alias : alias.toLowerCase().replaceAll("-", "").replaceAll("_", "")}=") || ${isCaseSensitive || alias.length === 1 ? "arg" : "arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")"} === "${isCaseSensitive || alias.length === 1 ? alias : alias.toLowerCase().replaceAll("-", "").replaceAll("_", "")}"`
711
577
  });
712
578
  }
713
579
  })];
714
580
  }
715
- OptionsMemberParserCondition.__type = [
716
- () => __ΩOptionsMemberParserConditionProps,
717
- "props",
718
- "OptionsMemberParserCondition",
719
- "Pn!2\"\"/#"
720
- ];
721
581
  function OptionsInterfaceDeclaration(props) {
722
582
  const { command } = props;
723
- const options = computed(() => computedOptions(Object.entries(command.options).map(__assignType(([name, option]) => ({
583
+ const options = computed(() => computedOptions(Object.entries(command.options).map(([name, option]) => ({
724
584
  ...option,
725
585
  name
726
- }), [
727
- "param0",
728
- "",
729
- "P\"2!\"/\""
730
- ]))));
586
+ }))));
731
587
  return createComponent(InterfaceDeclaration, {
732
588
  "export": true,
733
589
  get name() {
@@ -740,75 +596,37 @@ function OptionsInterfaceDeclaration(props) {
740
596
  return Object.values(options.value);
741
597
  },
742
598
  hardline: true,
743
- get children() {
744
- return __assignType((option) => createComponent(OptionsMember, { option }), [
745
- "option",
746
- "",
747
- "P\"2!\"/\""
748
- ]);
749
- }
599
+ children: (option) => createComponent(OptionsMember, { option })
750
600
  });
751
601
  }
752
602
  });
753
603
  }
754
- OptionsInterfaceDeclaration.__type = [
755
- "CommandTree",
756
- "command",
757
- "props",
758
- "OptionsInterfaceDeclaration",
759
- "PP\"w!4\"M2#\"/$"
760
- ];
761
- const __ΩOptionsParserLogicProps = [
762
- "appSpecificEnvPrefix",
763
- "The environment variable prefix to use for options that have an associated environment variable. This prefix will be used in the generated code to access the environment variables (e.g., `env.${appSpecificEnvPrefix}_OPTION_NAME`).",
764
- "isCaseSensitive",
765
- true,
766
- "Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.",
767
- "OptionsParserLogicProps",
768
- "P!&4!?\")4#8>$?%Mw&y"
769
- ];
770
604
  /**
771
605
  * The command options parser logic.
772
606
  */
773
607
  function OptionsParserLogic(props) {
774
608
  const { segments = [], options: _options, name: _name, appSpecificEnvPrefix, isCaseSensitive = false } = props;
775
- const options = computed(() => computedOptions(Object.entries(_options).map(__assignType(([name, option]) => ({
609
+ const options = computed(() => computedOptions(Object.entries(_options).map(([name, option]) => ({
776
610
  ...option,
777
611
  name
778
- }), [
779
- "param0",
780
- "",
781
- "P\"2!\"/\""
782
- ]))));
612
+ }))));
783
613
  return [
784
614
  createComponent(VarDeclaration, {
785
615
  "const": true,
786
616
  name: "options",
787
617
  get initializer() {
788
618
  return code` {
789
- ${segments.length > 0 ? "...useGlobalOptions(), " : ""}${Object.entries(options.value).filter(__assignType(([, option]) => option.env || option.default !== void 0 || (option.type === "string" || option.type === "number") && option.variadic, [
790
- "param0",
791
- "",
792
- "P\"2!\"/\""
793
- ])).map(__assignType(([name, option]) => {
619
+ ${segments.length > 0 ? "...useGlobalOptions(), " : ""}${Object.entries(options.value).filter(([, option]) => option.env || option.default !== void 0 || (option.type === "string" || option.type === "number") && option.variadic).map(([name, option]) => {
794
620
  if (option.type === "string") return ` ${name.includes("?") || name.includes("-") ? `"${name}"` : `${name}`}: ${option.env ? `env.${appSpecificEnvPrefix}_${option.env}` : ""}${option.variadic ? option.default !== void 0 ? `${option.env ? " ?? " : ""}${JSON.stringify(option.default)}` : option.env ? " ?? []" : "[]" : option.default !== void 0 ? `${option.env ? " ?? " : ""}"${option.default}"` : ""}, `;
795
621
  else if (option.type === "number") return ` ${name.includes("?") || name.includes("-") ? `"${name}"` : `${name}`}: ${option.env ? `env.${appSpecificEnvPrefix}_${option.env}` : ""}${option.variadic ? option.default && Array.isArray(option.default) ? `${option.env ? " ?? " : ""}${JSON.stringify(option.default)}` : option.env ? " ?? []" : "[]" : option.default !== void 0 ? `${option.env ? " ?? " : ""}${option.default}` : ""}, `;
796
622
  else if (option.type === "boolean") return ` ${name.includes("?") || name.includes("-") ? `"${name}"` : `${name}`}: ${option.env ? `env.${appSpecificEnvPrefix}_${option.env} ?? ` : ""}${option.default ? "true" : "false"},`;
797
623
  return "";
798
- }, [
799
- "param0",
800
- "",
801
- "P\"2!\"/\""
802
- ])).join("")}
624
+ }).join("")}
803
625
  } as unknown as ${segments.length > 0 ? pascalCase(_name) : "Global"}Options;`;
804
626
  }
805
627
  }),
806
628
  createComponent(Spacing, {}),
807
- memo(() => code`for (let i = 0; i < args.slice(${segments.filter(__assignType((segment) => isDynamicPathSegment(segment), [
808
- "segment",
809
- "",
810
- "P\"2!\"/\""
811
- ])).length}).length; i++) { `),
629
+ memo(() => code`for (let i = 0; i < args.slice(${segments.filter((segment) => isDynamicPathSegment(segment)).length}).length; i++) { `),
812
630
  createIntrinsic("hbr", {}),
813
631
  createComponent(VarDeclaration, {
814
632
  "const": true,
@@ -826,81 +644,55 @@ function OptionsParserLogic(props) {
826
644
  return Object.entries(options.value);
827
645
  },
828
646
  hardline: true,
829
- get children() {
830
- return __assignType(([name, option], i) => createComponent(Show, {
831
- when: i === 0,
832
- get fallback() {
833
- return createComponent(ElseIfClause, {
834
- get condition() {
835
- return [createComponent(OptionsMemberParserCondition, {
836
- name,
837
- get alias() {
838
- return option.alias;
839
- },
840
- isCaseSensitive
841
- })];
842
- },
843
- get children() {
844
- return createComponent(OptionsMemberParserLogic, {
845
- name,
846
- option,
847
- isCaseSensitive
848
- });
849
- }
850
- });
851
- },
852
- get children() {
853
- return createComponent(IfStatement, {
854
- get condition() {
855
- return createComponent(OptionsMemberParserCondition, {
856
- name,
857
- get alias() {
858
- return option.alias;
859
- },
860
- isCaseSensitive
861
- });
862
- },
863
- get children() {
864
- return createComponent(OptionsMemberParserLogic, {
865
- name,
866
- option,
867
- isCaseSensitive
868
- });
869
- }
870
- });
871
- }
872
- }), [
873
- "param0",
874
- "i",
875
- "",
876
- "P\"2!\"2\"\"/#"
877
- ]);
878
- }
647
+ children: ([name, option], i) => createComponent(Show, {
648
+ when: i === 0,
649
+ get fallback() {
650
+ return createComponent(ElseIfClause, {
651
+ get condition() {
652
+ return [createComponent(OptionsMemberParserCondition, {
653
+ name,
654
+ get alias() {
655
+ return option.alias;
656
+ },
657
+ isCaseSensitive
658
+ })];
659
+ },
660
+ get children() {
661
+ return createComponent(OptionsMemberParserLogic, {
662
+ name,
663
+ option,
664
+ isCaseSensitive
665
+ });
666
+ }
667
+ });
668
+ },
669
+ get children() {
670
+ return createComponent(IfStatement, {
671
+ get condition() {
672
+ return createComponent(OptionsMemberParserCondition, {
673
+ name,
674
+ get alias() {
675
+ return option.alias;
676
+ },
677
+ isCaseSensitive
678
+ });
679
+ },
680
+ get children() {
681
+ return createComponent(OptionsMemberParserLogic, {
682
+ name,
683
+ option,
684
+ isCaseSensitive
685
+ });
686
+ }
687
+ });
688
+ }
689
+ })
879
690
  }),
880
691
  createIntrinsic("hbr", {}),
881
692
  code` } `,
882
693
  createIntrinsic("hbr", {})
883
694
  ];
884
695
  }
885
- OptionsParserLogic.__type = [
886
- () => __ΩOptionsParserLogicProps,
887
- "props",
888
- "OptionsParserLogic",
889
- "The command options parser logic.",
890
- "Pn!2\"\"/#?$"
891
- ];
892
- const __ΩCommandParserLogicProps = [
893
- "CommandTree",
894
- "command",
895
- "The command to generate the parser logic for.",
896
- "appSpecificEnvPrefix",
897
- "The environment variable prefix to use for options that have an associated environment variable. This prefix will be used in the generated code to access the environment variables (e.g., `env.${appSpecificEnvPrefix}_OPTION_NAME`).",
898
- "isCaseSensitive",
899
- true,
900
- "Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.",
901
- "CommandParserLogicProps",
902
- "P\"w!4\"?#&4$?%)4&8>'?(Mw)y"
903
- ];
904
696
  /**
905
697
  * The command parser logic, which includes parsing dynamic path segments, positional parameters, and options.
906
698
  */
@@ -934,14 +726,7 @@ function CommandParserLogic(props) {
934
726
  createComponent(Spacing, {})
935
727
  ];
936
728
  }
937
- CommandParserLogic.__type = [
938
- () => __ΩCommandParserLogicProps,
939
- "props",
940
- "CommandParserLogic",
941
- "The command parser logic, which includes parsing dynamic path segments, positional parameters, and options.",
942
- "Pn!2\"\"/#?$"
943
- ];
944
729
 
945
730
  //#endregion
946
- export { ArgumentsParserLogic, CommandParserLogic, DynamicSegmentsParserLogic, OptionsInterfaceDeclaration, OptionsMember, OptionsMemberParserCondition, OptionsMemberParserLogic, OptionsParserLogic, __ΩArgumentsParserLogicProps, __ΩCommandParserLogicProps, __ΩDynamicSegmentsParserLogicProps, __ΩOptionsMemberParserConditionProps, __ΩOptionsMemberParserLogicProps, __ΩOptionsParserLogicProps };
731
+ export { ArgumentsParserLogic, CommandParserLogic, DynamicSegmentsParserLogic, OptionsInterfaceDeclaration, OptionsMember, OptionsMemberParserCondition, OptionsMemberParserLogic, OptionsParserLogic };
947
732
  //# sourceMappingURL=options-parser-logic.mjs.map