@shell-shock/core 0.17.10 → 0.17.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/dist/api.cjs +31 -143
  2. package/dist/api.cjs.map +1 -0
  3. package/dist/api.d.cts +2 -77
  4. package/dist/api.d.cts.map +1 -1
  5. package/dist/api.d.mts +2 -76
  6. package/dist/api.d.mts.map +1 -1
  7. package/dist/api.mjs +30 -140
  8. package/dist/api.mjs.map +1 -1
  9. package/dist/components/command-validation-logic.cjs +14 -15
  10. package/dist/components/command-validation-logic.cjs.map +1 -0
  11. package/dist/components/command-validation-logic.d.cts +1 -3
  12. package/dist/components/command-validation-logic.d.cts.map +1 -1
  13. package/dist/components/command-validation-logic.d.mts +1 -3
  14. package/dist/components/command-validation-logic.d.mts.map +1 -1
  15. package/dist/components/command-validation-logic.mjs +12 -13
  16. package/dist/components/command-validation-logic.mjs.map +1 -1
  17. package/dist/components/docs.cjs +6 -6
  18. package/dist/components/docs.cjs.map +1 -0
  19. package/dist/components/docs.d.cts +4 -5
  20. package/dist/components/docs.d.cts.map +1 -1
  21. package/dist/components/docs.d.mts +4 -5
  22. package/dist/components/docs.d.mts.map +1 -1
  23. package/dist/components/docs.mjs +4 -4
  24. package/dist/components/docs.mjs.map +1 -1
  25. package/dist/components/exec-builtin.cjs +9 -11
  26. package/dist/components/exec-builtin.cjs.map +1 -0
  27. package/dist/components/exec-builtin.d.cts +1 -2
  28. package/dist/components/exec-builtin.d.cts.map +1 -1
  29. package/dist/components/exec-builtin.d.mts +1 -2
  30. package/dist/components/exec-builtin.d.mts.map +1 -1
  31. package/dist/components/exec-builtin.mjs +7 -10
  32. package/dist/components/exec-builtin.mjs.map +1 -1
  33. package/dist/components/helpers.cjs +4 -5
  34. package/dist/components/helpers.cjs.map +1 -0
  35. package/dist/components/helpers.d.cts +6 -8
  36. package/dist/components/helpers.d.cts.map +1 -1
  37. package/dist/components/helpers.d.mts +6 -8
  38. package/dist/components/helpers.d.mts.map +1 -1
  39. package/dist/components/helpers.mjs +2 -3
  40. package/dist/components/helpers.mjs.map +1 -1
  41. package/dist/components/options-parser-logic.cjs +29 -30
  42. package/dist/components/options-parser-logic.cjs.map +1 -0
  43. package/dist/components/options-parser-logic.d.cts +8 -9
  44. package/dist/components/options-parser-logic.d.cts.map +1 -1
  45. package/dist/components/options-parser-logic.d.mts +8 -9
  46. package/dist/components/options-parser-logic.d.mts.map +1 -1
  47. package/dist/components/options-parser-logic.mjs +27 -28
  48. package/dist/components/options-parser-logic.mjs.map +1 -1
  49. package/dist/components/state-builtin.cjs +3 -2
  50. package/dist/components/state-builtin.cjs.map +1 -0
  51. package/dist/components/state-builtin.d.cts +4 -5
  52. package/dist/components/state-builtin.d.cts.map +1 -1
  53. package/dist/components/state-builtin.d.mts +4 -5
  54. package/dist/components/state-builtin.d.mts.map +1 -1
  55. package/dist/components/state-builtin.mjs +1 -1
  56. package/dist/components/state-builtin.mjs.map +1 -1
  57. package/dist/components/usage.cjs +4 -6
  58. package/dist/components/usage.cjs.map +1 -0
  59. package/dist/components/usage.d.cts +1 -2
  60. package/dist/components/usage.d.cts.map +1 -1
  61. package/dist/components/usage.d.mts +1 -2
  62. package/dist/components/usage.d.mts.map +1 -1
  63. package/dist/components/usage.mjs +2 -4
  64. package/dist/components/usage.mjs.map +1 -1
  65. package/dist/components/utils-builtin.cjs +5 -4
  66. package/dist/components/utils-builtin.cjs.map +1 -0
  67. package/dist/components/utils-builtin.d.cts +7 -8
  68. package/dist/components/utils-builtin.d.cts.map +1 -1
  69. package/dist/components/utils-builtin.d.mts +7 -8
  70. package/dist/components/utils-builtin.d.mts.map +1 -1
  71. package/dist/components/utils-builtin.mjs +3 -3
  72. package/dist/components/utils-builtin.mjs.map +1 -1
  73. package/dist/config.cjs +53 -19
  74. package/dist/config.cjs.map +1 -0
  75. package/dist/config.d.cts +29 -8
  76. package/dist/config.d.cts.map +1 -1
  77. package/dist/config.d.mts +29 -8
  78. package/dist/config.d.mts.map +1 -1
  79. package/dist/config.mjs +51 -18
  80. package/dist/config.mjs.map +1 -1
  81. package/dist/contexts/command.cjs +2 -2
  82. package/dist/contexts/command.cjs.map +1 -0
  83. package/dist/contexts/command.d.cts.map +1 -1
  84. package/dist/contexts/command.d.mts.map +1 -1
  85. package/dist/contexts/command.mjs.map +1 -1
  86. package/dist/contexts/options.cjs +4 -4
  87. package/dist/contexts/options.cjs.map +1 -0
  88. package/dist/contexts/options.d.cts.map +1 -1
  89. package/dist/contexts/options.d.mts.map +1 -1
  90. package/dist/contexts/options.mjs +2 -3
  91. package/dist/contexts/options.mjs.map +1 -1
  92. package/dist/engine.cjs +138 -0
  93. package/dist/engine.cjs.map +1 -0
  94. package/dist/engine.d.cts +79 -0
  95. package/dist/engine.d.cts.map +1 -0
  96. package/dist/engine.d.mts +79 -0
  97. package/dist/engine.d.mts.map +1 -0
  98. package/dist/engine.mjs +136 -0
  99. package/dist/engine.mjs.map +1 -0
  100. package/dist/helpers/automd.cjs +6 -7
  101. package/dist/helpers/automd.cjs.map +1 -0
  102. package/dist/helpers/automd.mjs +2 -3
  103. package/dist/helpers/automd.mjs.map +1 -1
  104. package/dist/helpers/docs-helpers.cjs +2 -2
  105. package/dist/helpers/docs-helpers.cjs.map +1 -0
  106. package/dist/helpers/docs-helpers.mjs.map +1 -1
  107. package/dist/helpers/get-framework.cjs +24 -0
  108. package/dist/helpers/get-framework.cjs.map +1 -0
  109. package/dist/helpers/get-framework.mjs +24 -0
  110. package/dist/helpers/get-framework.mjs.map +1 -0
  111. package/dist/helpers/paths.cjs +5 -5
  112. package/dist/helpers/paths.cjs.map +1 -0
  113. package/dist/helpers/paths.mjs +4 -4
  114. package/dist/helpers/paths.mjs.map +1 -1
  115. package/dist/helpers/persistence.cjs +4 -6
  116. package/dist/helpers/persistence.cjs.map +1 -0
  117. package/dist/helpers/persistence.mjs +3 -3
  118. package/dist/helpers/persistence.mjs.map +1 -1
  119. package/dist/helpers/update-package-json.cjs +2 -2
  120. package/dist/helpers/update-package-json.cjs.map +1 -0
  121. package/dist/helpers/update-package-json.mjs.map +1 -1
  122. package/dist/helpers/utilities.cjs +3 -3
  123. package/dist/helpers/utilities.cjs.map +1 -0
  124. package/dist/helpers/utilities.mjs +1 -1
  125. package/dist/helpers/utilities.mjs.map +1 -1
  126. package/dist/helpers/validations.cjs +3 -3
  127. package/dist/helpers/validations.cjs.map +1 -0
  128. package/dist/helpers/validations.mjs +1 -3
  129. package/dist/helpers/validations.mjs.map +1 -1
  130. package/dist/index.cjs +121 -51
  131. package/dist/index.cjs.map +1 -0
  132. package/dist/index.d.cts +80 -5
  133. package/dist/index.d.cts.map +1 -0
  134. package/dist/index.d.mts +80 -5
  135. package/dist/index.d.mts.map +1 -0
  136. package/dist/index.mjs +118 -6
  137. package/dist/index.mjs.map +1 -0
  138. package/dist/package.cjs +12 -0
  139. package/dist/package.cjs.map +1 -0
  140. package/dist/package.mjs +6 -0
  141. package/dist/package.mjs.map +1 -0
  142. package/dist/plugin-utils/compute-bin.cjs +8 -10
  143. package/dist/plugin-utils/compute-bin.cjs.map +1 -0
  144. package/dist/plugin-utils/compute-bin.d.cts +2 -2
  145. package/dist/plugin-utils/compute-bin.d.cts.map +1 -1
  146. package/dist/plugin-utils/compute-bin.d.mts +2 -2
  147. package/dist/plugin-utils/compute-bin.d.mts.map +1 -1
  148. package/dist/plugin-utils/compute-bin.mjs +6 -8
  149. package/dist/plugin-utils/compute-bin.mjs.map +1 -1
  150. package/dist/plugin-utils/context-helpers.cjs +7 -14
  151. package/dist/plugin-utils/context-helpers.cjs.map +1 -0
  152. package/dist/plugin-utils/context-helpers.d.cts +4 -4
  153. package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
  154. package/dist/plugin-utils/context-helpers.d.mts +4 -4
  155. package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
  156. package/dist/plugin-utils/context-helpers.mjs +5 -12
  157. package/dist/plugin-utils/context-helpers.mjs.map +1 -1
  158. package/dist/plugin-utils/deepkit.cjs +15 -16
  159. package/dist/plugin-utils/deepkit.cjs.map +1 -0
  160. package/dist/plugin-utils/deepkit.d.cts +5 -5
  161. package/dist/plugin-utils/deepkit.d.cts.map +1 -1
  162. package/dist/plugin-utils/deepkit.d.mts +5 -5
  163. package/dist/plugin-utils/deepkit.d.mts.map +1 -1
  164. package/dist/plugin-utils/deepkit.mjs +14 -15
  165. package/dist/plugin-utils/deepkit.mjs.map +1 -1
  166. package/dist/plugin-utils/description-helpers.cjs +2 -1
  167. package/dist/plugin-utils/description-helpers.cjs.map +1 -0
  168. package/dist/plugin-utils/description-helpers.d.cts.map +1 -1
  169. package/dist/plugin-utils/description-helpers.d.mts.map +1 -1
  170. package/dist/plugin-utils/description-helpers.mjs.map +1 -1
  171. package/dist/plugin-utils/get-command-tree.cjs +2 -1
  172. package/dist/plugin-utils/get-command-tree.cjs.map +1 -0
  173. package/dist/plugin-utils/get-command-tree.d.cts.map +1 -1
  174. package/dist/plugin-utils/get-command-tree.d.mts.map +1 -1
  175. package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
  176. package/dist/plugin-utils/index.cjs +1 -1
  177. package/dist/plugin-utils/index.d.cts +2 -2
  178. package/dist/plugin-utils/index.d.mts +2 -2
  179. package/dist/plugin-utils/index.mjs +2 -2
  180. package/dist/plugin-utils/reflect.cjs +5 -5
  181. package/dist/plugin-utils/reflect.cjs.map +1 -0
  182. package/dist/plugin-utils/reflect.d.cts.map +1 -1
  183. package/dist/plugin-utils/reflect.d.mts.map +1 -1
  184. package/dist/plugin-utils/reflect.mjs +3 -5
  185. package/dist/plugin-utils/reflect.mjs.map +1 -1
  186. package/dist/plugin-utils/traverse-command-tree.cjs +2 -1
  187. package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -0
  188. package/dist/plugin-utils/traverse-command-tree.d.cts.map +1 -1
  189. package/dist/plugin-utils/traverse-command-tree.d.mts.map +1 -1
  190. package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
  191. package/dist/plugin-utils/type-checks.cjs +146 -17
  192. package/dist/plugin-utils/type-checks.cjs.map +1 -0
  193. package/dist/plugin-utils/type-checks.d.cts +5 -5
  194. package/dist/plugin-utils/type-checks.d.cts.map +1 -1
  195. package/dist/plugin-utils/type-checks.d.mts +5 -5
  196. package/dist/plugin-utils/type-checks.d.mts.map +1 -1
  197. package/dist/plugin-utils/type-checks.mjs +145 -16
  198. package/dist/plugin-utils/type-checks.mjs.map +1 -1
  199. package/dist/plugin.cjs +80 -56
  200. package/dist/plugin.cjs.map +1 -0
  201. package/dist/plugin.d.cts.map +1 -1
  202. package/dist/plugin.d.mts.map +1 -1
  203. package/dist/plugin.mjs +75 -52
  204. package/dist/plugin.mjs.map +1 -1
  205. package/dist/resolver/helpers.cjs +33 -24
  206. package/dist/resolver/helpers.cjs.map +1 -0
  207. package/dist/resolver/helpers.mjs +32 -22
  208. package/dist/resolver/helpers.mjs.map +1 -1
  209. package/dist/resolver/resolve.cjs +319 -61
  210. package/dist/resolver/resolve.cjs.map +1 -0
  211. package/dist/resolver/resolve.mjs +316 -58
  212. package/dist/resolver/resolve.mjs.map +1 -1
  213. package/dist/types/command.cjs +43 -82
  214. package/dist/types/command.cjs.map +1 -0
  215. package/dist/types/command.d.cts +61 -119
  216. package/dist/types/command.d.cts.map +1 -1
  217. package/dist/types/command.d.mts +61 -119
  218. package/dist/types/command.d.mts.map +1 -1
  219. package/dist/types/command.mjs +42 -80
  220. package/dist/types/command.mjs.map +1 -1
  221. package/dist/types/config.cjs +45 -4
  222. package/dist/types/config.cjs.map +1 -0
  223. package/dist/types/config.d.cts +16 -11
  224. package/dist/types/config.d.cts.map +1 -1
  225. package/dist/types/config.d.mts +16 -11
  226. package/dist/types/config.d.mts.map +1 -1
  227. package/dist/types/config.mjs +40 -4
  228. package/dist/types/config.mjs.map +1 -1
  229. package/dist/types/context.cjs +9 -1
  230. package/dist/types/context.cjs.map +1 -0
  231. package/dist/types/context.d.cts +3 -2
  232. package/dist/types/context.d.cts.map +1 -1
  233. package/dist/types/context.d.mts +3 -2
  234. package/dist/types/context.d.mts.map +1 -1
  235. package/dist/types/context.mjs +7 -1
  236. package/dist/types/context.mjs.map +1 -1
  237. package/dist/types/env.cjs +2 -1
  238. package/dist/types/env.cjs.map +1 -0
  239. package/dist/types/env.d.cts.map +1 -1
  240. package/dist/types/env.d.mts.map +1 -1
  241. package/dist/types/env.mjs.map +1 -1
  242. package/dist/types/index.cjs +6 -3
  243. package/dist/types/index.d.cts +4 -4
  244. package/dist/types/index.d.mts +4 -4
  245. package/dist/types/index.mjs +4 -4
  246. package/dist/types/options.cjs +2 -1
  247. package/dist/types/options.cjs.map +1 -0
  248. package/dist/types/options.d.cts.map +1 -1
  249. package/dist/types/options.d.mts.map +1 -1
  250. package/dist/types/options.mjs.map +1 -1
  251. package/package.json +43 -35
  252. package/dist/resolver/deepkit.cjs +0 -135
  253. package/dist/resolver/deepkit.mjs +0 -135
  254. package/dist/resolver/deepkit.mjs.map +0 -1
  255. package/dist/resolver/module.cjs +0 -145
  256. package/dist/resolver/module.mjs +0 -145
  257. package/dist/resolver/module.mjs.map +0 -1
@@ -1,24 +1,269 @@
1
1
  import { getDynamicPathSegmentName, isDynamicPathSegment } from "../plugin-utils/context-helpers.mjs";
2
- import { extractType } from "../plugin-utils/deepkit.mjs";
3
2
  import { getGlobalOptions } from "../helpers/utilities.mjs";
4
3
  import { applyArgsDefaults, applyDefaults, applyOptionsDefaults, resolveVirtualCommand } from "./helpers.mjs";
5
- import { resolveFromBytecode } from "./deepkit.mjs";
6
- import { resolveFromExports } from "./module.mjs";
7
- import { ReflectionVisibility } from "@powerlines/deepkit/vendor/type";
4
+ import { addProperty, extract, getPropertiesList, resolveModule } from "@powerlines/schema";
5
+ import { toArray } from "@stryke/convert/to-array";
6
+ import { replacePath } from "@stryke/path/replace";
8
7
  import { constantCase } from "@stryke/string-format/constant-case";
9
- import { titleCase } from "@stryke/string-format/title-case";
10
8
  import { isSetObject } from "@stryke/type-checks/is-set-object";
9
+ import { isSetString } from "@stryke/type-checks/is-set-string";
10
+ import { titleCase } from "@stryke/string-format/title-case";
11
+ import { isBoolean } from "@stryke/type-checks/is-boolean";
12
+ import { getUnique } from "@stryke/helpers/get-unique";
11
13
  import { esbuildPlugin } from "@powerlines/deepkit/esbuild-plugin";
12
- import { resolveModule } from "@powerlines/plugin-esbuild/helpers/resolve";
14
+ import { isJsonSchemaObjectType, isJsonSchemaTupleType } from "@stryke/json";
13
15
 
14
16
  //#region src/resolver/resolve.ts
17
+ const __ΩRecord = [
18
+ "K",
19
+ "T",
20
+ "Record",
21
+ "l'e#\"Rb!b\"Pde\"!N#!w#y"
22
+ ];
15
23
  function __assignType(fn, args) {
16
24
  fn.__type = args;
17
25
  return fn;
18
26
  }
19
- async function initialize(input) {
27
+ function isFiniteNumber(value) {
28
+ return typeof value === "number" && Number.isFinite(value);
29
+ }
30
+ isFiniteNumber.__type = [
31
+ "value",
32
+ "isFiniteNumber",
33
+ "P#2!!/\""
34
+ ];
35
+ function asRecord(value) {
36
+ return isSetObject(value) ? value : {};
37
+ }
38
+ asRecord.__type = [
39
+ "value",
40
+ () => __ΩRecord,
41
+ "asRecord",
42
+ "P#2!&#o\"#/#"
43
+ ];
44
+ function toAliasList(value) {
45
+ if (Array.isArray(value)) return getUnique(value.filter(isSetString));
46
+ return isSetString(value) ? [value] : [];
47
+ }
48
+ toAliasList.__type = [
49
+ "value",
50
+ "toAliasList",
51
+ "P#2!&F/\""
52
+ ];
53
+ function inferParameterType(input) {
54
+ const schemaType = input.type;
55
+ if (Array.isArray(schemaType)) {
56
+ const first = schemaType.find(__assignType((type) => type !== "null", [
57
+ "type",
58
+ "",
59
+ "P\"2!\"/\""
60
+ ]));
61
+ if (first === "integer" || first === "number") return "number";
62
+ if (first === "boolean") return "boolean";
63
+ if (first === "array") {
64
+ const nestedType = asRecord(input.items).type;
65
+ if (nestedType === "integer" || nestedType === "number") return "number";
66
+ if (nestedType === "boolean") return "boolean";
67
+ return "string";
68
+ }
69
+ return "string";
70
+ }
71
+ if (schemaType === "integer" || schemaType === "number") return "number";
72
+ if (schemaType === "boolean") return "boolean";
73
+ if (schemaType === "array") {
74
+ const nestedType = asRecord(input.items).type;
75
+ if (nestedType === "integer" || nestedType === "number") return "number";
76
+ if (nestedType === "boolean") return "boolean";
77
+ return "string";
78
+ }
79
+ if (Array.isArray(input.enum) && input.enum.length > 0) {
80
+ const first = input.enum.find(__assignType((value) => value !== null, [
81
+ "value",
82
+ "",
83
+ "P\"2!\"/\""
84
+ ]));
85
+ if (isFiniteNumber(first)) return "number";
86
+ if (isBoolean(first)) return "boolean";
87
+ }
88
+ if (isFiniteNumber(input.default)) return "number";
89
+ if (isBoolean(input.default)) return "boolean";
90
+ return "string";
91
+ }
92
+ inferParameterType.__type = [
93
+ () => __ΩRecord,
94
+ "input",
95
+ "CommandOption",
96
+ "type",
97
+ "inferParameterType",
98
+ "P&#o!#2\"\"w#.$f/%"
99
+ ];
100
+ function inferVariadic(input) {
101
+ if (isBoolean(input.variadic)) return input.variadic;
102
+ return input.type === "array";
103
+ }
104
+ inferVariadic.__type = [
105
+ () => __ΩRecord,
106
+ "input",
107
+ "inferVariadic",
108
+ "P&#o!#2\")/#"
109
+ ];
110
+ function normalizeDefault(input, type, variadic) {
111
+ const defaultValue = input.default;
112
+ if (defaultValue === void 0) return;
113
+ if (type === "boolean") {
114
+ if (variadic) {
115
+ if (Array.isArray(defaultValue)) return defaultValue.filter(isBoolean);
116
+ return isBoolean(defaultValue) ? [defaultValue] : void 0;
117
+ }
118
+ if (Array.isArray(defaultValue)) return defaultValue.find(isBoolean);
119
+ return isBoolean(defaultValue) ? defaultValue : void 0;
120
+ }
121
+ if (type === "number") {
122
+ if (variadic) {
123
+ if (Array.isArray(defaultValue)) return defaultValue.map(__assignType((item) => typeof item === "bigint" ? Number(item) : item, [
124
+ "item",
125
+ "",
126
+ "P\"2!\"/\""
127
+ ])).filter(isFiniteNumber);
128
+ const normalized = typeof defaultValue === "bigint" ? Number(defaultValue) : defaultValue;
129
+ return isFiniteNumber(normalized) ? [normalized] : void 0;
130
+ }
131
+ if (Array.isArray(defaultValue)) return defaultValue.map(__assignType((item) => typeof item === "bigint" ? Number(item) : item, [
132
+ "item",
133
+ "",
134
+ "P\"2!\"/\""
135
+ ])).find(isFiniteNumber);
136
+ const normalized = typeof defaultValue === "bigint" ? Number(defaultValue) : defaultValue;
137
+ return isFiniteNumber(normalized) ? normalized : void 0;
138
+ }
139
+ if (variadic) {
140
+ if (Array.isArray(defaultValue)) return defaultValue.filter(isSetString);
141
+ return isSetString(defaultValue) ? [defaultValue] : void 0;
142
+ }
143
+ if (Array.isArray(defaultValue)) return defaultValue.find(isSetString);
144
+ return isSetString(defaultValue) ? defaultValue : void 0;
145
+ }
146
+ normalizeDefault.__type = [
147
+ () => __ΩRecord,
148
+ "input",
149
+ "CommandOption",
150
+ "type",
151
+ "type",
152
+ "variadic",
153
+ "normalizeDefault",
154
+ "P&#o!#2\"\"w#.$f2%)2&\"/'"
155
+ ];
156
+ function normalizeStringChoices(input) {
157
+ const source = Array.isArray(input.choices) ? input.choices : input.enum;
158
+ if (!Array.isArray(source)) return;
159
+ return source.filter(isSetString);
160
+ }
161
+ normalizeStringChoices.__type = [
162
+ () => __ΩRecord,
163
+ "input",
164
+ "normalizeStringChoices",
165
+ "P&#o!#2\"\"/#"
166
+ ];
167
+ function normalizeNumberChoices(input) {
168
+ const source = Array.isArray(input.choices) ? input.choices : input.enum;
169
+ if (!Array.isArray(source)) return;
170
+ return source.map(__assignType((item) => typeof item === "bigint" ? Number(item) : item, [
171
+ "item",
172
+ "",
173
+ "P\"2!\"/\""
174
+ ])).filter(isFiniteNumber);
175
+ }
176
+ normalizeNumberChoices.__type = [
177
+ () => __ΩRecord,
178
+ "input",
179
+ "normalizeNumberChoices",
180
+ "P&#o!#2\"\"/#"
181
+ ];
182
+ function resolveCommandParameter(schema, defaults) {
183
+ const input = asRecord(schema);
184
+ const type = inferParameterType(input);
185
+ const variadic = inferVariadic(input);
186
+ const defaultValue = normalizeDefault(input, type, variadic);
187
+ const required = isBoolean(input.required) ? input.required : defaultValue === void 0 ? defaults.fallbackRequired : false;
188
+ const env = isSetString(input.env) ? input.env : false;
189
+ const result = {
190
+ name: isSetString(input.name) ? input.name : "",
191
+ type,
192
+ title: isSetString(input.title) ? input.title : "",
193
+ description: isSetString(input.description) ? input.description : "",
194
+ alias: toAliasList(input.alias),
195
+ default: defaultValue,
196
+ env,
197
+ required,
198
+ variadic
199
+ };
200
+ if (type === "string") {
201
+ const stringChoices = normalizeStringChoices(input);
202
+ if (Array.isArray(stringChoices)) result.choices = stringChoices;
203
+ if (isSetString(input.format)) result.format = input.format;
204
+ }
205
+ if (type === "number") {
206
+ const numberChoices = normalizeNumberChoices(input);
207
+ if (Array.isArray(numberChoices)) result.choices = numberChoices;
208
+ }
209
+ if (defaults.includeBooleanOptionFields && type === "boolean" && !variadic) {
210
+ const optionResult = result;
211
+ if (isSetString(input.isNegativeOf)) optionResult.isNegativeOf = input.isNegativeOf;
212
+ if (isBoolean(input.skipAddingNegative)) optionResult.skipAddingNegative = input.skipAddingNegative;
213
+ }
214
+ return result;
215
+ }
216
+ resolveCommandParameter.__type = [
217
+ "schema",
218
+ "fallbackRequired",
219
+ "includeBooleanOptionFields",
220
+ "defaults",
221
+ "CommandOption",
222
+ "CommandArgument",
223
+ "resolveCommandParameter",
224
+ "P#2!P)4\")4#M2$P\"w%\"w&J/'"
225
+ ];
226
+ /**
227
+ * Resolves a command option from the given schema.
228
+ *
229
+ * @param schema - The command option schema, which can be a command option configuration or a JSON schema input.
230
+ * @returns The resolved command option definition.
231
+ */
232
+ function resolveCommandOption(schema) {
233
+ return resolveCommandParameter(schema, {
234
+ fallbackRequired: false,
235
+ includeBooleanOptionFields: true
236
+ });
237
+ }
238
+ resolveCommandOption.__type = [
239
+ "schema",
240
+ "CommandOption",
241
+ "resolveCommandOption",
242
+ "Resolves a command option from the given schema.",
243
+ "P#2!\"w\"/#?$"
244
+ ];
245
+ /**
246
+ * Resolves a command argument from the given schema.
247
+ *
248
+ * @param schema - The command argument schema, which can be a command argument configuration or a JSON schema input.
249
+ * @returns The resolved command argument definition.
250
+ */
251
+ function resolveCommandArgument(schema) {
252
+ return resolveCommandParameter(schema, {
253
+ fallbackRequired: true,
254
+ includeBooleanOptionFields: false
255
+ });
256
+ }
257
+ resolveCommandArgument.__type = [
258
+ "schema",
259
+ "CommandArgument",
260
+ "resolveCommandArgument",
261
+ "Resolves a command argument from the given schema.",
262
+ "P#2!\"w\"/#?$"
263
+ ];
264
+ async function preprocess(input) {
20
265
  const { context, command, parent } = input;
21
- const title = command.title || `${parent?.title ? `${parent.isVirtual ? parent.title.replace(/(?:c|C)ommands?$/, "").trim() : parent.title} - ` : ""}${titleCase(command.name)}${command.isVirtual ? " Commands" : ""}`;
266
+ const title = command.title || `${parent?.title ? `${parent.virtual ? parent.title.replace(/(?:c|C)ommands?$/, "").trim() : parent.title} - ` : ""}${titleCase(command.name)}${command.virtual ? " Commands" : ""}`;
22
267
  const result = {
23
268
  input,
24
269
  output: {
@@ -34,26 +279,25 @@ async function initialize(input) {
34
279
  children: {}
35
280
  }
36
281
  };
37
- if (!command.isVirtual) {
282
+ if (!command.virtual) {
38
283
  if (!command.entry.input?.file || !context.fs.existsSync(command.entry.input.file)) throw new Error(`${!command.entry.input?.file ? "Missing" : "Non-existent"} command entry file for "${command.name}"`);
39
- context.debug(`Adding reflection for CLI command: ${command.id} (file: ${command.entry.input.file})`);
284
+ context.debug(`Adding reflection for CLI command: ${command.id} (file: ${replacePath(command.entry.input.file, context.config.cwd)})`);
40
285
  result.module = await (resolveModule.Ω = [["CommandModule", "\"w!"]], resolveModule(context, command.entry.input, {
41
- name: command.title || titleCase(command.name),
42
- treeShaking: true,
43
- resolve: { skipNodeModulesBundle: true },
286
+ name: `${command.title || titleCase(command.name)} Command Bundler`,
44
287
  plugins: [esbuildPlugin(context, {
45
288
  reflection: "default",
46
289
  level: "all"
47
- })]
290
+ })],
291
+ resolve: { skipNodeModulesBundle: true }
48
292
  }));
49
293
  }
50
294
  return result;
51
295
  }
52
- initialize.__type = [
296
+ preprocess.__type = [
53
297
  "ResolverInput",
54
298
  "input",
55
299
  "ResolverContext",
56
- "initialize",
300
+ "preprocess",
57
301
  "P\"w!2\"\"w#`/$"
58
302
  ];
59
303
  async function postprocess(ctx) {
@@ -94,26 +338,18 @@ async function postprocess(ctx) {
94
338
  "",
95
339
  "P\"2!\"/\""
96
340
  ])).forEach(__assignType((option) => {
97
- ctx.input.context.env.types.env.addProperty({
341
+ addProperty(ctx.input.context.env.config.schema, option.env, {
342
+ ...option,
98
343
  name: option.env,
99
- optional: option.optional ? true : void 0,
100
- description: option.description,
101
- visibility: ReflectionVisibility.public,
102
- type: extractType(option),
103
- default: option.default,
104
- tags: {
105
- title: option.title,
106
- alias: option.alias.filter(__assignType((alias) => alias.length > 1, [
107
- "alias",
108
- "",
109
- "P\"2!\"/\""
110
- ])).map(__assignType((alias) => constantCase(alias), [
111
- "alias",
112
- "",
113
- "P\"2!\"/\""
114
- ])),
115
- domain: "cli"
116
- }
344
+ alias: option.alias.filter(__assignType((alias) => alias.length > 1, [
345
+ "alias",
346
+ "",
347
+ "P\"2!\"/\""
348
+ ])).map(__assignType((alias) => constantCase(alias), [
349
+ "alias",
350
+ "",
351
+ "P\"2!\"/\""
352
+ ]))
117
353
  });
118
354
  }, [
119
355
  "option",
@@ -124,25 +360,18 @@ async function postprocess(ctx) {
124
360
  "arg",
125
361
  "",
126
362
  "P\"2!\"/\""
127
- ])).forEach(__assignType((arg) => ctx.input.context.env.types.env.addProperty({
363
+ ])).forEach(__assignType((arg) => addProperty(ctx.input.context.env.config.schema, arg.env, {
364
+ ...arg,
128
365
  name: arg.env,
129
- optional: arg.optional ? true : void 0,
130
- description: arg.description,
131
- visibility: ReflectionVisibility.public,
132
- type: extractType(arg),
133
- default: arg.default,
134
- tags: {
135
- alias: arg.alias.filter(__assignType((alias) => alias.length > 1, [
136
- "alias",
137
- "",
138
- "P\"2!\"/\""
139
- ])).map(__assignType((alias) => constantCase(alias), [
140
- "alias",
141
- "",
142
- "P\"2!\"/\""
143
- ])),
144
- domain: "cli"
145
- }
366
+ alias: arg.alias.filter(__assignType((alias) => alias.length > 1, [
367
+ "alias",
368
+ "",
369
+ "P\"2!\"/\""
370
+ ])).map(__assignType((alias) => constantCase(alias), [
371
+ "alias",
372
+ "",
373
+ "P\"2!\"/\""
374
+ ]))
146
375
  }), [
147
376
  "arg",
148
377
  "",
@@ -197,14 +426,43 @@ postprocess.__type = [
197
426
  * @returns A promise that resolves to the resolved command tree.
198
427
  */
199
428
  async function resolve(input) {
200
- const ctx = await (initialize.Ω = [[
429
+ const ctx = await (preprocess.Ω = [[
201
430
  () => input,
202
431
  "ResolverInput",
203
432
  "Pi!\"w\"q\"!j"
204
- ]], initialize(input));
205
- if (!ctx.output.isVirtual) {
206
- await resolveFromExports(ctx);
207
- resolveFromBytecode(ctx);
433
+ ]], preprocess(input));
434
+ if (!ctx.output.virtual) {
435
+ if (!ctx.module) throw new Error(`Command module at path "${ctx.input.command.path}" is undefined or null. Please ensure the module exports a valid command.`);
436
+ else if (!isSetObject(ctx.module)) throw new TypeError(`Command module at path "${ctx.input.command.path}" is not an object. Please ensure the module exports a valid command.`);
437
+ else if (!("default" in ctx.module)) throw new Error(`Command module at path "${ctx.input.command.path}" does not appear to be valid. Please ensure the module's default export is a valid command handler function.`);
438
+ const metadata = ctx.module.metadata ?? {};
439
+ if (isSetString(metadata.title)) ctx.output.title = metadata.title;
440
+ if (isSetString(metadata.description)) ctx.output.description = metadata.description;
441
+ if (isSetString(metadata.alias) || Array.isArray(metadata.alias) && metadata.alias.length > 0) ctx.output.alias = toArray(metadata.alias);
442
+ if (isSetString(metadata.icon)) ctx.output.icon = metadata.icon;
443
+ if (isSetString(metadata.tags)) ctx.output.tags = getUnique(ctx.output.tags.concat(toArray(metadata.tags)));
444
+ if (isSetObject(ctx.module.options)) {
445
+ const options = await extract(ctx.input.context, ctx.module.options);
446
+ if (!isSetObject(options) || !isJsonSchemaObjectType(options.schema)) throw new TypeError(`Command options for command at path "${ctx.input.command.path}" must resolve to an object.`);
447
+ ctx.output.options = getPropertiesList(options).reduce(__assignType((ret, property) => {
448
+ ret[property.name] = resolveCommandOption(property);
449
+ return ret;
450
+ }, [
451
+ "ret",
452
+ "property",
453
+ "",
454
+ "P\"2!\"2\"\"/#"
455
+ ]), {});
456
+ }
457
+ if (ctx.module.args && Array.isArray(ctx.module.args)) {
458
+ const args = await extract(ctx.input.context, ctx.module.args);
459
+ if (!isSetObject(args) || !isJsonSchemaTupleType(args.schema)) throw new TypeError(`Command arguments for command at path "${ctx.input.command.path}" must resolve to a tuple.`);
460
+ ctx.output.args = args.schema.items.map(__assignType((item) => resolveCommandArgument(item), [
461
+ "item",
462
+ "",
463
+ "P\"2!\"/\""
464
+ ]));
465
+ }
208
466
  } else resolveVirtualCommand(ctx);
209
467
  return postprocess(ctx);
210
468
  }
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.mjs","names":[],"sources":["../../src/resolver/resolve.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 { esbuildPlugin } from \"@powerlines/deepkit/esbuild-plugin\";\nimport { ReflectionVisibility } from \"@powerlines/deepkit/vendor/type\";\nimport { resolveModule } from \"@powerlines/plugin-esbuild/helpers/resolve\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { getGlobalOptions } from \"../helpers/utilities\";\nimport {\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"../plugin-utils/context-helpers\";\nimport { extractType } from \"../plugin-utils/deepkit\";\nimport type { CommandModule, CommandTree, Context } from \"../types\";\nimport { resolveFromBytecode } from \"./deepkit\";\nimport {\n applyArgsDefaults,\n applyDefaults,\n applyOptionsDefaults,\n resolveVirtualCommand\n} from \"./helpers\";\nimport { resolveFromExports } from \"./module\";\nimport type { ResolverContext, ResolverInput } from \"./types\";\n\nasync function initialize<TContext extends Context = Context>(\n input: ResolverInput<TContext>\n): Promise<ResolverContext> {\n const { context, command, parent } = input;\n\n const title =\n command.title ||\n `${\n parent?.title\n ? `${\n parent.isVirtual\n ? parent.title.replace(/(?:c|C)ommands?$/, \"\").trim()\n : parent.title\n } - `\n : \"\"\n }${titleCase(command.name)}${command.isVirtual ? \" Commands\" : \"\"}`;\n\n const output = {\n alias: [],\n icon: parent?.icon,\n tags: parent?.tags ?? [],\n source: \"file\",\n ...command,\n title,\n options: parent === null ? getGlobalOptions(context, command) : {},\n args: [],\n parent: parent ?? null,\n children: {}\n } as CommandTree;\n\n const result: ResolverContext = {\n input,\n output\n };\n\n if (!command.isVirtual) {\n if (\n !command.entry.input?.file ||\n !context.fs.existsSync(command.entry.input.file)\n ) {\n throw new Error(\n `${\n !command.entry.input?.file ? \"Missing\" : \"Non-existent\"\n } command entry file for \"${command.name}\"`\n );\n }\n\n context.debug(\n `Adding reflection for CLI command: ${command.id} (file: ${\n command.entry.input.file\n })`\n );\n\n result.module = await resolveModule<CommandModule>(\n context,\n command.entry.input,\n {\n name: command.title || titleCase(command.name),\n treeShaking: true,\n resolve: {\n skipNodeModulesBundle: true\n },\n plugins: [\n esbuildPlugin(context, {\n reflection: \"default\",\n level: \"all\"\n })\n ]\n }\n );\n }\n\n return result;\n}\n\nasync function postprocess<TContext extends Context = Context>(\n ctx: ResolverContext<TContext>\n): Promise<CommandTree> {\n ctx.output.options = applyOptionsDefaults(ctx);\n ctx.output.args = applyArgsDefaults(ctx);\n\n // Ensure unique argument names by appending an index suffix to duplicates\n ctx.output.args.forEach((arg, index) => {\n const found = ctx.output.args.findIndex(a => a.name === arg.name);\n if (\n (found !== -1 && found !== index) ||\n ctx.output.segments.some(\n segment =>\n isDynamicPathSegment(segment) &&\n getDynamicPathSegmentName(segment) === arg.name\n )\n ) {\n arg.name += `_${\n ctx.output.segments.filter(\n segment =>\n isDynamicPathSegment(segment) &&\n getDynamicPathSegmentName(segment).replace(/_\\d+$/, \"\") === arg.name\n ).length +\n ctx.output.args.filter(a => a.name.replace(/_\\d+$/, \"\") === arg.name)\n .length\n }`;\n arg.env = arg.name\n ? arg.env || arg.env === false\n ? arg.env\n : ctx.input.context.config.autoAssignEnv\n ? constantCase(arg.name)\n : false\n : false;\n }\n });\n\n applyDefaults(ctx);\n\n if (ctx.input.context.env) {\n if (isSetObject(ctx.output.options)) {\n Object.values(ctx.output.options)\n .filter(option => Boolean(option.env))\n .forEach(option => {\n ctx.input.context.env.types.env.addProperty({\n name: option.env as string,\n optional: option.optional ? true : undefined,\n description: option.description,\n visibility: ReflectionVisibility.public,\n type: extractType(option),\n default: option.default,\n tags: {\n title: option.title,\n alias: option.alias\n .filter(alias => alias.length > 1)\n .map(alias => constantCase(alias)),\n domain: \"cli\"\n }\n });\n });\n }\n\n ctx.output.args\n .filter(arg => Boolean(arg.env))\n .forEach(arg =>\n ctx.input.context.env.types.env.addProperty({\n name: arg.env as string,\n optional: arg.optional ? true : undefined,\n description: arg.description,\n visibility: ReflectionVisibility.public,\n type: extractType(arg),\n default: arg.default,\n tags: {\n alias: arg.alias\n .filter(alias => alias.length > 1)\n .map(alias => constantCase(alias)),\n domain: \"cli\"\n }\n })\n );\n }\n\n await Promise.all(\n ctx.input.context.inputs\n .filter(\n input =>\n input.segments.filter(segment => !isDynamicPathSegment(segment))\n .length ===\n ctx.input.command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n ).length +\n 1 &&\n input.segments\n .slice(0, ctx.input.command.segments.length)\n .every(\n (value, index) => value === ctx.input.command.segments[index]\n )\n )\n .map(async input => {\n ctx.output.children[input.name] = await resolve<TContext>({\n context: ctx.input.context,\n command: input,\n parent: ctx.output\n });\n })\n );\n\n return ctx.output;\n}\n\n/**\n * Resolves a command tree from the given resolver input.\n *\n * @param input - The resolver input containing the context, command, and optional parent command tree.\n * @returns A promise that resolves to the resolved command tree.\n */\nexport async function resolve<TContext extends Context = Context>(\n input: ResolverInput<TContext>\n): Promise<CommandTree> {\n const ctx = await initialize<TContext>(input);\n\n if (!ctx.output.isVirtual) {\n await resolveFromExports(ctx);\n resolveFromBytecode(ctx);\n } else {\n resolveVirtualCommand(ctx);\n }\n\n return postprocess(ctx);\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,aAAa,IAAI,MAAM;;AAE9B,QAAO;;AA+BT,eAAE,WAAiB,OAAA;CACjB,MAAA,EACA,SACA,SACA,WACI;CACN,MAAO,QAAO,QAAA,SAAiB,GAAA,QAAa,QAAQ,GAAG,OAAM,YAAA,OAAA,MAAA,QAAA,oBAAA,GAAA,CAAA,MAAA,GAAA,OAAA,MAAA,OAAA,KAAA,UAAA,QAAA,KAAA,GAAA,QAAA,YAAA,cAAA;CAa3D,MAAM,SAAQ;EACZ;EACA;GAbJ,OAAM,EAAA;GACJ,MAAO,QAAA;GACN,MAAO,QAAC,QAAe,EAAE;GAC1B,QAAQ;;GAER;GACE,SAAQ,WAAO,OAAA,iBAAA,SAAA,QAAA,GAAA,EAAA;GACf,MAAE,EAAA;GACF,QAAQ,UAAE;GACV,UAAQ,EAAA;GAIF;EACP;AACD,KAAI,CAAC,QAAA,WAAkB;qFAEvB,OAAM,IAAQ,MAAC,GAAA,CAAA,QAAA,MAAA,OAAA,OAAA,YAAA,eAAA,2BAAA,QAAA,KAAA,GAAA;AAEb,UAAM,MAAQ,sCAAI,QAAA,GAAA,UAAA,QAAA,M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