@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
@@ -0,0 +1,136 @@
1
+ import { getFramework } from "./helpers/get-framework.mjs";
2
+ import { createEngine as createEngine$1 } from "@powerlines/engine";
3
+
4
+ //#region src/engine.ts
5
+ /**
6
+ * The Shell Shock Engine class.
7
+ *
8
+ * @remarks
9
+ * This class provides methods to interact with the Shell Shock build system, including cleaning, preparing, linting, building, generating documentation, and finalizing projects.
10
+ */
11
+ var Engine = class Engine {
12
+ #powerlines;
13
+ /**
14
+ * Creates a new instance of the {@link Engine} class using the provided configuration options. This method initializes the underlying Powerlines API with the appropriate plugins and settings for Shell Shock.
15
+ *
16
+ * @param options - The user configuration options.
17
+ * @returns A promise that resolves to a {@link Engine} instance.
18
+ */
19
+ static async from(options) {
20
+ return new Engine(await createEngine$1({
21
+ ...options,
22
+ framework: getFramework()
23
+ }, "@shell-shock/core/api"));
24
+ }
25
+ /**
26
+ * Gets the current build context, which includes information about the project, environment, and configuration. This context is used internally by the Shell Shock API to manage the build process and provide relevant data to plugins and other components.
27
+ *
28
+ * @returns The current build context.
29
+ */
30
+ get context() {
31
+ return this.#powerlines.context;
32
+ }
33
+ constructor(powerlines) {
34
+ this.#powerlines = powerlines;
35
+ }
36
+ /**
37
+ * Executes the clean phase of the build process, which typically involves removing generated files and resetting the build environment. The `inlineConfig` parameter allows users to specify additional options or overrides for the clean operation.
38
+ *
39
+ * @param inlineConfig - The inline configuration options for the clean operation.
40
+ * @returns A promise that resolves when the clean operation is complete.
41
+ */
42
+ async clean(inlineConfig) {
43
+ return this.#powerlines.clean(inlineConfig);
44
+ }
45
+ /**
46
+ * Executes the prepare phase of the build process, which typically involves setting up the build environment and installing dependencies. The `inlineConfig` parameter allows users to specify additional options or overrides for the prepare operation.
47
+ *
48
+ * @param inlineConfig - The inline configuration options for the prepare operation.
49
+ * @returns A promise that resolves when the prepare operation is complete.
50
+ */
51
+ async prepare(inlineConfig) {
52
+ return this.#powerlines.prepare(inlineConfig);
53
+ }
54
+ /**
55
+ * Executes the lint phase of the build process, which typically involves analyzing code for quality and style issues. The `inlineConfig` parameter allows users to specify additional options or overrides for the lint operation.
56
+ *
57
+ * @param inlineConfig - The inline configuration options for the lint operation.
58
+ * @returns A promise that resolves when the lint operation is complete.
59
+ */
60
+ async lint(inlineConfig) {
61
+ return this.#powerlines.lint(inlineConfig);
62
+ }
63
+ /**
64
+ * Executes the build phase of the build process, which typically involves compiling source code and generating output artifacts. The `inlineConfig` parameter allows users to specify additional options or overrides for the build operation.
65
+ *
66
+ * @param inlineConfig - The inline configuration options for the build operation.
67
+ * @returns A promise that resolves when the build operation is complete.
68
+ */
69
+ async build(inlineConfig) {
70
+ return this.#powerlines.build(inlineConfig);
71
+ }
72
+ /**
73
+ * Executes the documentation generation phase of the build process, which typically involves creating API documentation and other project documentation. The `inlineConfig` parameter allows users to specify additional options or overrides for the documentation operation.
74
+ *
75
+ * @param inlineConfig - The inline configuration options for the documentation operation.
76
+ * @returns A promise that resolves when the documentation generation is complete.
77
+ */
78
+ async docs(inlineConfig) {
79
+ return this.#powerlines.docs(inlineConfig);
80
+ }
81
+ /**
82
+ * Executes the finalize phase of the build process, which typically involves cleanup tasks and final reporting. This method should be called after all other build phases have completed.
83
+ *
84
+ * @returns A promise that resolves when the finalize operation is complete.
85
+ */
86
+ async finalize() {
87
+ return this.#powerlines.finalize();
88
+ }
89
+ static __type = [
90
+ "#powerlines",
91
+ "EngineOptions",
92
+ "options",
93
+ () => Engine,
94
+ "from",
95
+ "Creates a new instance of the {@link Engine} class using the provided configuration options. This method initializes the underlying Powerlines API with the appropriate plugins and settings for Shell Shock.",
96
+ "powerlines",
97
+ "constructor",
98
+ "inlineConfig",
99
+ "clean",
100
+ "Executes the clean phase of the build process, which typically involves removing generated files and resetting the build environment. The `inlineConfig` parameter allows users to specify additional options or overrides for the clean operation.",
101
+ "prepare",
102
+ "Executes the prepare phase of the build process, which typically involves setting up the build environment and installing dependencies. The `inlineConfig` parameter allows users to specify additional options or overrides for the prepare operation.",
103
+ "lint",
104
+ "Executes the lint phase of the build process, which typically involves analyzing code for quality and style issues. The `inlineConfig` parameter allows users to specify additional options or overrides for the lint operation.",
105
+ "build",
106
+ "Executes the build phase of the build process, which typically involves compiling source code and generating output artifacts. The `inlineConfig` parameter allows users to specify additional options or overrides for the build operation.",
107
+ "docs",
108
+ "Executes the documentation generation phase of the build process, which typically involves creating API documentation and other project documentation. The `inlineConfig` parameter allows users to specify additional options or overrides for the documentation operation.",
109
+ "finalize",
110
+ "Executes the finalize phase of the build process, which typically involves cleanup tasks and final reporting. This method should be called after all other build phases have completed.",
111
+ "Engine",
112
+ "The Shell Shock Engine class.",
113
+ "!3!P\"w\"2#P7$`0%s?&!P!2'\"0(P!2)$`0*?+P!2)$`0,?-P!2)$`0.?/P!2)$`00?1P!2)$`02?3P$`04?55w6?7"
114
+ ];
115
+ };
116
+ /**
117
+ * Creates a new {@link Engine} instance.
118
+ *
119
+ * @param options - The user configuration options.
120
+ * @returns A promise that resolves to a {@link Engine} instance.
121
+ */
122
+ async function createEngine(options) {
123
+ return Engine.from(options);
124
+ }
125
+ createEngine.__type = [
126
+ "EngineOptions",
127
+ "options",
128
+ () => Engine,
129
+ "createEngine",
130
+ "Creates a new {@link Engine} instance.",
131
+ "P\"w!2\"P7#`/$?%"
132
+ ];
133
+
134
+ //#endregion
135
+ export { Engine, createEngine };
136
+ //# sourceMappingURL=engine.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.mjs","names":[],"sources":[],"mappings":""}
@@ -1,11 +1,9 @@
1
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
1
  const require_context_helpers = require('../plugin-utils/context-helpers.cjs');
3
2
  const require_components_docs = require('../components/docs.cjs');
4
3
  require('../plugin-utils/index.cjs');
5
4
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
6
- let _alloy_js_core_components = require("@alloy-js/core/components");
7
- let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
8
5
  let _alloy_js_core = require("@alloy-js/core");
6
+ let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
9
7
  let _alloy_js_markdown = require("@alloy-js/markdown");
10
8
  let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
11
9
  let automd = require("automd");
@@ -34,15 +32,15 @@ const commands = __assignType((context) => (0, automd.defineGenerator)({
34
32
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
35
33
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`The following commands are available in the ${require_context_helpers.getAppTitle(context, true)} command-line interface application:`),
36
34
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
37
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core_components.For, {
35
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
38
36
  get each() {
39
37
  return Object.values(context.commands);
40
38
  },
41
39
  doubleHardline: true,
42
40
  get children() {
43
- return __assignType((child) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core_components.Show, {
41
+ return __assignType((child) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
44
42
  get when() {
45
- return !child.isVirtual;
43
+ return !child.virtual;
46
44
  },
47
45
  get children() {
48
46
  return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_docs.CommandDocs, {
@@ -68,4 +66,5 @@ const commands = __assignType((context) => (0, automd.defineGenerator)({
68
66
  ]);
69
67
 
70
68
  //#endregion
71
- exports.commands = commands;
69
+ exports.commands = commands;
70
+ //# sourceMappingURL=automd.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"automd.cjs","names":[],"sources":[],"mappings":""}
@@ -2,9 +2,8 @@ import { getAppTitle } from "../plugin-utils/context-helpers.mjs";
2
2
  import { CommandDocs } from "../components/docs.mjs";
3
3
  import "../plugin-utils/index.mjs";
4
4
  import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
5
- import { For, Show } from "@alloy-js/core/components";
5
+ import { For, Show, code } from "@alloy-js/core";
6
6
  import { renderString } from "@powerlines/plugin-alloy/render";
7
- import { code } from "@alloy-js/core";
8
7
  import { Heading } from "@alloy-js/markdown";
9
8
  import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
10
9
  import { defineGenerator } from "automd";
@@ -41,7 +40,7 @@ const commands = __assignType((context) => defineGenerator({
41
40
  get children() {
42
41
  return __assignType((child) => createComponent(Show, {
43
42
  get when() {
44
- return !child.isVirtual;
43
+ return !child.virtual;
45
44
  },
46
45
  get children() {
47
46
  return createComponent(CommandDocs, {
@@ -1 +1 @@
1
- {"version":3,"file":"automd.mjs","names":[],"sources":["../../src/helpers/automd.tsx"],"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 { code } from \"@alloy-js/core\";\nimport { For, Show } from \"@alloy-js/core/components\";\nimport { Heading } from \"@alloy-js/markdown\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { renderString } from \"@powerlines/plugin-alloy/render\";\nimport { defineGenerator } from \"automd\";\nimport { CommandDocs } from \"../components/docs\";\nimport { getAppTitle } from \"../plugin-utils\";\nimport type { Context } from \"../types/context\";\n\n/**\n * AutoMD generator to generate CLI command documentation\n *\n * @see https://automd.unjs.io/\n *\n * @param context - The generator context.\n * @returns The generated documentation content.\n */\nexport const commands = (context: Context) =>\n defineGenerator({\n name: \"commands\",\n async generate() {\n return {\n contents: renderString(\n context,\n <>\n <Heading level={2}>Commands</Heading>\n <Spacing />\n {code`The following commands are available in the ${getAppTitle(\n context,\n true\n )} command-line interface application:`}\n <Spacing />\n <For each={Object.values(context.commands)} doubleHardline>\n {child => (\n <Show when={!child.isVirtual}>\n <CommandDocs command={child} levelOffset={2} />\n </Show>\n )}\n </For>\n <Spacing />\n </>\n )\n };\n }\n });\n"],"mappings":";;;;;;;;;;;;;AAEE,IAAG,SAAS;;;;;;;;;;;AAoCd,MAAW,WAAS,cAAA,YAAA,gBAAA;CAClB,MAAE;CACF,MAAI,WAAO;AACT,SAAI,EACF,UAAI,aAAO,SAAA;GAAA,gBAAA,SAAA;IACT,OAAG;IACH,UAAK;IACN,CAAC;GAAE,gBAAY,SAAA,EAAA,CAAA;GAAA,WAAA,IAAA,+CAAA,YAAA,SAAA,KAAA,CAAA,sCAAA;GAAA,gBAAA,SAAA,EAAA,CAAA;GAAA,gBAAA,KAAA;IACd,IAAI,OAAM;AACR,YAAI,OAAO,OAAA,QAAA,SAAA;;IAEb,gBAAe;IACf,IAAI,WAAU;AACZ,YAAO,cAAa,UAAO,gBAAmB,MAAA;MAC5C,IAAG,OAAQ;AACT,cAAO,CAAC,MAAM;;MAEhB,IAAI,WAAM;AACR,cAAC,gBAAA,aAAA;QACD,SAAG;QACJ,aAAS;QACV,CAAA;;MAEL,CAAA,EAAA;MAAA;MAAA;MAAA;MAAA,CAAA;;IAEH,CAAA;GAAA,gBAAA,SAAA,EAAA,CAAA;GAAA,CAAA"}
1
+ {"version":3,"file":"automd.mjs","names":[],"sources":[],"mappings":""}
@@ -1,4 +1,3 @@
1
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
1
  let _stryke_path_join = require("@stryke/path/join");
3
2
 
4
3
  //#region src/helpers/docs-helpers.ts
@@ -20,4 +19,5 @@ getDocsOutputPath.__type = [
20
19
  ];
21
20
 
22
21
  //#endregion
23
- exports.getDocsOutputPath = getDocsOutputPath;
22
+ exports.getDocsOutputPath = getDocsOutputPath;
23
+ //# sourceMappingURL=docs-helpers.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs-helpers.cjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"docs-helpers.mjs","names":[],"sources":["../../src/helpers/docs-helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join\";\nimport type { Context } from \"../types/context\";\n\n/**\n * Gets the output path for the generated documentation.\n *\n * @param context - The Shell Shock context.\n * @returns The output path for the generated documentation.\n */\nexport function getDocsOutputPath(context: Context): string {\n return joinPaths(context.config.root, \"docs\", \"generated\");\n}\n"],"mappings":";;;;;;;;;AAwBA,SAAU,kBAAoB,SAAa;AACzC,QAAE,UAAY,QAAW,OAAK,MAAI,QAAU,YAAa;;AAE3D,kBAAgB,SAAA;CAAA;CAAkB;CAAgB;CAAU;CAAA;CAAA"}
1
+ {"version":3,"file":"docs-helpers.mjs","names":[],"sources":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ const require_package = require('../package.cjs');
2
+
3
+ //#region src/helpers/get-framework.ts
4
+ /**
5
+ * Retrieves the framework information for Shell Shock.
6
+ *
7
+ * @returns An object containing the name, version, and organization ID of the Shell Shock framework.
8
+ */
9
+ function getFramework() {
10
+ return {
11
+ name: "shell-shock",
12
+ version: require_package.version,
13
+ orgId: "storm-software"
14
+ };
15
+ }
16
+ getFramework.__type = [
17
+ "getFramework",
18
+ "Retrieves the framework information for Shell Shock.",
19
+ "P!/!?\""
20
+ ];
21
+
22
+ //#endregion
23
+ exports.getFramework = getFramework;
24
+ //# sourceMappingURL=get-framework.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-framework.cjs","names":[],"sources":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ import { version } from "../package.mjs";
2
+
3
+ //#region src/helpers/get-framework.ts
4
+ /**
5
+ * Retrieves the framework information for Shell Shock.
6
+ *
7
+ * @returns An object containing the name, version, and organization ID of the Shell Shock framework.
8
+ */
9
+ function getFramework() {
10
+ return {
11
+ name: "shell-shock",
12
+ version,
13
+ orgId: "storm-software"
14
+ };
15
+ }
16
+ getFramework.__type = [
17
+ "getFramework",
18
+ "Retrieves the framework information for Shell Shock.",
19
+ "P!/!?\""
20
+ ];
21
+
22
+ //#endregion
23
+ export { getFramework };
24
+ //# sourceMappingURL=get-framework.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-framework.mjs","names":[],"sources":[],"mappings":""}
@@ -1,15 +1,14 @@
1
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
1
  const require_context_helpers = require('../plugin-utils/context-helpers.cjs');
3
2
  let _stryke_path_append = require("@stryke/path/append");
4
- let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
5
3
  let _stryke_path_join_paths = require("@stryke/path/join-paths");
6
4
  let _stryke_path_replace = require("@stryke/path/replace");
7
5
  let _stryke_path_resolve_parent_path = require("@stryke/path/resolve-parent-path");
6
+ let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
8
7
  let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
9
8
  let powerlines_utils = require("powerlines/utils");
10
- let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
11
9
  let _stryke_fs_list_files = require("@stryke/fs/list-files");
12
10
  let _stryke_path_common = require("@stryke/path/common");
11
+ let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
13
12
  let node_fs = require("node:fs");
14
13
 
15
14
  //#region src/helpers/paths.ts
@@ -87,7 +86,7 @@ resolveCommandDynamicPathSegments.__type = [
87
86
  async function findCommandsRoot(context) {
88
87
  let paths = [];
89
88
  if ((0, _stryke_type_checks_is_set_string.isSetString)(context.config.input)) paths = await (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)(context.config.input, context.config.root), context.config.cwd));
90
- else if ((0, powerlines_utils.isTypeDefinition)(context.config.input)) paths = await (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)(context.config.input.file, context.config.root), context.config.cwd));
89
+ else if ((0, powerlines_utils.isFileReference)(context.config.input)) paths = await (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)(context.config.input.file, context.config.root), context.config.cwd));
91
90
  else if (Array.isArray(context.config.input) && context.config.input.length > 0) paths = (await Promise.all(context.config.input.map(__assignType(async (input) => (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)((0, _stryke_type_checks_is_set_string.isSetString)(input) ? input : input.file, context.config.root), context.config.cwd)), [
92
91
  "input",
93
92
  "",
@@ -134,4 +133,5 @@ findCommandsRoot.__type = [
134
133
  exports.findCommandsRoot = findCommandsRoot;
135
134
  exports.resolveCommandId = resolveCommandId;
136
135
  exports.resolveCommandName = resolveCommandName;
137
- exports.resolveCommandPath = resolveCommandPath;
136
+ exports.resolveCommandPath = resolveCommandPath;
137
+ //# sourceMappingURL=paths.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.cjs","names":[],"sources":[],"mappings":""}
@@ -1,14 +1,14 @@
1
1
  import { getDynamicPathSegmentName, isDynamicPathSegment, isPathSegmentGroup } from "../plugin-utils/context-helpers.mjs";
2
2
  import { appendPath } from "@stryke/path/append";
3
- import { findFilePath, findFolderName } from "@stryke/path/file-path-fns";
4
3
  import { joinPaths } from "@stryke/path/join-paths";
5
4
  import { replacePath } from "@stryke/path/replace";
6
5
  import { resolveParentPath } from "@stryke/path/resolve-parent-path";
7
- import { isSetString } from "@stryke/type-checks/is-set-string";
8
- import { isTypeDefinition } from "powerlines/utils";
9
6
  import { isSetObject } from "@stryke/type-checks/is-set-object";
7
+ import { isSetString } from "@stryke/type-checks/is-set-string";
8
+ import { isFileReference } from "powerlines/utils";
10
9
  import { listFiles } from "@stryke/fs/list-files";
11
10
  import { commonPath } from "@stryke/path/common";
11
+ import { findFilePath, findFolderName } from "@stryke/path/file-path-fns";
12
12
  import { existsSync } from "node:fs";
13
13
 
14
14
  //#region src/helpers/paths.ts
@@ -86,7 +86,7 @@ resolveCommandDynamicPathSegments.__type = [
86
86
  async function findCommandsRoot(context) {
87
87
  let paths = [];
88
88
  if (isSetString(context.config.input)) paths = await listFiles(appendPath(appendPath(context.config.input, context.config.root), context.config.cwd));
89
- else if (isTypeDefinition(context.config.input)) paths = await listFiles(appendPath(appendPath(context.config.input.file, context.config.root), context.config.cwd));
89
+ else if (isFileReference(context.config.input)) paths = await listFiles(appendPath(appendPath(context.config.input.file, context.config.root), context.config.cwd));
90
90
  else if (Array.isArray(context.config.input) && context.config.input.length > 0) paths = (await Promise.all(context.config.input.map(__assignType(async (input) => listFiles(appendPath(appendPath(isSetString(input) ? input : input.file, context.config.root), context.config.cwd)), [
91
91
  "input",
92
92
  "",
@@ -1 +1 @@
1
- {"version":3,"file":"paths.mjs","names":[],"sources":["../../src/helpers/paths.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 { listFiles } from \"@stryke/fs/list-files\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { commonPath } from \"@stryke/path/common\";\nimport { findFilePath, findFolderName } from \"@stryke/path/file-path-fns\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { resolveParentPath } from \"@stryke/path/resolve-parent-path\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { existsSync } from \"node:fs\";\nimport { isTypeDefinition } from \"powerlines/utils\";\nimport {\n getDynamicPathSegmentName,\n isDynamicPathSegment,\n isPathSegmentGroup\n} from \"../plugin-utils/context-helpers\";\nimport type { Context } from \"../types/context\";\n\nexport function resolveCommandId(context: Context, file: string): string {\n return replacePath(findFilePath(file), context.commandsPath)\n .split(\"/\")\n .filter(p => Boolean(p) && !isDynamicPathSegment(p))\n .join(\"/\")\n .replaceAll(/^\\/+/g, \"\")\n .replaceAll(/\\/+$/g, \"\")\n .replaceAll(\"/\", \"-\");\n}\n\n/**\n * Finds the command name from the given file path.\n *\n * @param file - The file path to extract the command name from.\n * @returns The command name.\n */\nexport function resolveCommandName(file: string) {\n let path = findFilePath(file);\n let name = findFolderName(file, {\n requireExtension: true\n });\n\n while (isDynamicPathSegment(name)) {\n path = resolveParentPath(path);\n name = findFolderName(path, {\n requireExtension: true\n });\n }\n\n return name;\n}\n\nexport function resolveCommandPath(context: Context, file: string): string {\n return replacePath(findFilePath(file), context.commandsPath)\n .replaceAll(/^\\/+/g, \"\")\n .replaceAll(/\\/+$/g, \"\")\n .split(\"/\")\n .filter(path => path && !isPathSegmentGroup(path))\n .join(\"/\");\n}\n\nexport function resolveCommandDynamicPathSegments(\n context: Context,\n file: string\n): string[] {\n return replacePath(findFilePath(file), context.commandsPath)\n .split(\"/\")\n .filter(path => Boolean(path) && isDynamicPathSegment(path))\n .map(path => getDynamicPathSegmentName(path));\n}\n\nexport async function findCommandsRoot(context: Context): Promise<string> {\n let paths = [] as string[];\n if (isSetString(context.config.input)) {\n paths = await listFiles(\n appendPath(\n appendPath(context.config.input, context.config.root),\n context.config.cwd\n )\n );\n } else if (isTypeDefinition(context.config.input)) {\n paths = await listFiles(\n appendPath(\n appendPath(context.config.input.file, context.config.root),\n context.config.cwd\n )\n );\n } else if (\n Array.isArray(context.config.input) &&\n context.config.input.length > 0\n ) {\n paths = (\n await Promise.all(\n context.config.input.map(async input =>\n listFiles(\n appendPath(\n appendPath(\n isSetString(input) ? input : input.file,\n context.config.root\n ),\n context.config.cwd\n )\n )\n )\n )\n ).flat();\n } else if (isSetObject(context.config.input)) {\n paths = (\n await Promise.all(\n Object.values(context.config.input).map(async input =>\n Array.isArray(input)\n ? (\n await Promise.all(\n input.map(async i =>\n listFiles(\n appendPath(\n appendPath(\n isSetString(i) ? i : i.file,\n context.config.root\n ),\n context.config.cwd\n )\n )\n )\n )\n ).flat()\n : listFiles(\n appendPath(\n appendPath(\n isSetString(input) ? input : input.file,\n context.config.root\n ),\n context.config.cwd\n )\n )\n )\n )\n ).flat();\n }\n\n if (paths.length > 0) {\n return commonPath(paths.map(p => findFilePath(p)));\n }\n\n let commandsPath = joinPaths(context.config.root, \"src/commands\");\n if (!existsSync(commandsPath)) {\n commandsPath = joinPaths(context.config.root, \"commands\");\n if (!existsSync(commandsPath)) {\n commandsPath = joinPaths(context.config.root, \"src\");\n if (!existsSync(commandsPath)) {\n commandsPath = context.config.root;\n }\n }\n }\n\n paths = (\n await Promise.all([\n listFiles(\n joinPaths(appendPath(commandsPath, context.config.cwd), \"**/command.ts\")\n ),\n listFiles(\n joinPaths(\n appendPath(commandsPath, context.config.cwd),\n \"**/command.tsx\"\n )\n )\n ])\n ).flat();\n if (paths.length > 0) {\n return commonPath(paths.map(p => findFilePath(p)));\n }\n\n return appendPath(commandsPath, context.config.cwd);\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,aAAa,IAAI,MAAM;;AAE9B,QAAO;;AA+BT,SAAW,iBAAqB,SAAQ,MAAA;AACxC,QAAO,YAAc,aAAY,KAAM,EAAA,QAAQ,aAAA,CAAA,MAAA,IAAA,CAAA,OAAA,cAAA,MAAA,QAAA,EAAA,IAAA,CAAA,qBAAA,EAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,KAAA,IAAA,CAAA,WAAA,SAAA,GAAA,CAAA,WAAA,SAAA,GAAA,CAAA,WAAA,KAAA,IAAA;;AAE/C,iBAAgB,SAAA;CAAA;CAAiB;CAAgB;CAAQ;CAAgB;CAAA;;;;;;;AAOzE,SAAgB,mBAAS,MAAA;CACzB,IAAA,OAAA,aAAA,KAAA;mCAEE,kBAAA,MACC,CAAA;AACF,QAAA,qBAAA,KAAA,EAAA;AACG,SAAM,kBAAgB,KAAQ;AAC9B,SAAO,eAAa,MAAI,EAC1B,kBAAA,MACF,CAAM;;AAEJ,QAAI;;AAEN,mBAAI,SAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;AAEF,QAAO,YAAA,aAAyB,KAAG,EAAA,QAAA,aAAA,CAAA,WAAA,SAAA,GAAA,CAAA,WAAA,SAAA,GAAA,CAAA,MAAA,IAAA,CAAA,OAAA,cAAA,SAAA,QAAA,CAAA,mBAAA,KAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,KAAA,IAAA;;AAErC,mBAAW,SAAe;CAAA;CAAM;CAAA;CAAA;CAAA;CAAA;AAChC,SAAM,kCAAkB,SAAA,MAAA;AACtB,QAAI,YAAA,aAAA,KAAA,EAAA,QAAA,aAAA,CAAA,MAAA,IAAA,CAAA,OAAA,cAAA,SAAA,QAAA,KAAA,IAAA,qBAAA,KAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,IAAA,cAAA,SAAA,0BAAA,KAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA;;;;;;;;;AAGN,eAAa,iBAAA,SAAA;CACb,IAAA,QAAA,EAAA;uCAEA,SAAO,MAAS,UAAA,WAAmB,WAAS,QAAc,OAAO,OAAG,QAAO,OAAA,KAAA,EAAA,QAAA,OAAA,IAAA,CAAA;UAClE,iBAAY,QAAiB,OAAG,MAAQ,CAC7C,SAAC,MAAa,UAAS,WAAA,WAAA,QAAA,OAAA,MAAA,MAAA,QAAA,OAAA,KAAA,EAAA,QAAA,OAAA,IAAA,CAAA;UACtB,MAAc,QAAQ,QAAA,OAAA,MAAA,IAAA,QAAA,OAAA,MAAA,SAAA,EACvB,UAAS,MAAC,QAAA,IAAA,QAAA,OAAA,MAAA,IAAA,aAAA,OAAA,UAAA,UAAA,WAAA,WAAA,YAAA,MAAA,GAAA,QAAA,MAAA,MAAA,QAAA,OAAA,KAAA,EAAA,QAAA,OAAA,IAAA,CAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,EAAA,MAAA;UACF,YAAa,QAAI,OAAA,MAAA,CACzB,UAAS,MAAC,QAAA,IAAA,OAAA,OAAA,QAAA,OAAA,MAAA,CAAA,IAAA,aAAA,OAAA,UAAA,MAAA,QAAA,MAAA,IAAA,MAAA,QAAA,IAAA,MAAA,IAAA,aAAA,OAAA,MAAA,UAAA,WAAA,WAAA,YAAA,EAAA,GAAA,IAAA,EAAA,MAAA,QAAA,OAAA,KAAA,EAAA,QAAA,OAAA,IAAA,CAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,EAAA,MAAA,GAAA,UAAA,WAAA,WAAA,YAAA,MAAA,GAAA,QAAA,MAAA,MAAA,QAAA,OAAA,KAAA,EAAA,QAAA,OAAA,IAAA,CAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,EAAA,MAAA;sBAGd,QAAO,WAAS,MAAA,IAAA,cAAA,MAAiC,aAAA,EAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA;CAE/C,IAAI,eAAE,UAAA,QAAA,OAAA,MAAA,eAAA;AACN,KAAC,CAAA,WAAS,aAAA,EAAA;AACV,iBAAO,UAAY,QAAa,OAAO,MAAQ,WAAY;AACzD,MAAC,CAAA,WAAS,aAAA,EAAA;AACT,kBAAe,UAAQ,QAAS,OAAA,MAAA,MAAqB;AACrD,OAAI,CAAA,WAAQ,aAAA,CACjB,gBAAA,QAAA,OAAA;;;AAIE,UAAI,MAAW,QAAQ,IAAC,CAAA,UAAc,UAAC,WAAA,cAAA,QAAA,OAAA,IAAA,EAAA,gBAAA,CAAA,EAAA,UAAA,UAAA,WAAA,cAAA,QAAA,OAAA,IAAA,EAAA,iBAAA,CAAA,CAAA,CAAA,EAAA,MAAA;AACvC,KAAE,MAAQ,SAAM,EACd,QAAE,WAAU,MAAA,IAAA,cAAA,MAAA,aAAA,EAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA;AAEd,QAAM,WAAQ,cAAO,QAAA,OAAA,IAAA;;AAEvB,iBAAK,SAAA;CAAA;CAAA;CAAA;CAAA;CAAA"}
1
+ {"version":3,"file":"paths.mjs","names":[],"sources":[],"mappings":""}
@@ -1,6 +1,5 @@
1
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
- let _powerlines_plugin_env_helpers = require("@powerlines/plugin-env/helpers");
3
1
  let _stryke_path_join_paths = require("@stryke/path/join-paths");
2
+ let _powerlines_plugin_env_helpers = require("@powerlines/plugin-env/helpers");
4
3
 
5
4
  //#region src/helpers/persistence.ts
6
5
  function __assignType(fn, args) {
@@ -94,7 +93,7 @@ readCommandsPersistence.__type = [
94
93
  */
95
94
  async function writeCommandsPersistence(context) {
96
95
  const filePath = getCommandsPersistencePath(context);
97
- await (0, _powerlines_plugin_env_helpers.writeEnvTypeReflection)(context, context.env.types.env, "env");
96
+ await (0, _powerlines_plugin_env_helpers.writeEnv)(context);
98
97
  await context.fs.write(filePath, JSON.stringify(Object.fromEntries(Object.entries(context.commands).map(__assignType(([name, command]) => [name, serialize(command)], [
99
98
  "param0",
100
99
  "",
@@ -110,6 +109,5 @@ writeCommandsPersistence.__type = [
110
109
  ];
111
110
 
112
111
  //#endregion
113
- exports.getCommandsPersistencePath = getCommandsPersistencePath;
114
- exports.readCommandsPersistence = readCommandsPersistence;
115
- exports.writeCommandsPersistence = writeCommandsPersistence;
112
+ exports.writeCommandsPersistence = writeCommandsPersistence;
113
+ //# sourceMappingURL=persistence.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persistence.cjs","names":[],"sources":[],"mappings":""}
@@ -1,5 +1,5 @@
1
- import { writeEnvTypeReflection } from "@powerlines/plugin-env/helpers";
2
1
  import { joinPaths } from "@stryke/path/join-paths";
2
+ import { writeEnv } from "@powerlines/plugin-env/helpers";
3
3
 
4
4
  //#region src/helpers/persistence.ts
5
5
  function __assignType(fn, args) {
@@ -93,7 +93,7 @@ readCommandsPersistence.__type = [
93
93
  */
94
94
  async function writeCommandsPersistence(context) {
95
95
  const filePath = getCommandsPersistencePath(context);
96
- await writeEnvTypeReflection(context, context.env.types.env, "env");
96
+ await writeEnv(context);
97
97
  await context.fs.write(filePath, JSON.stringify(Object.fromEntries(Object.entries(context.commands).map(__assignType(([name, command]) => [name, serialize(command)], [
98
98
  "param0",
99
99
  "",
@@ -109,5 +109,5 @@ writeCommandsPersistence.__type = [
109
109
  ];
110
110
 
111
111
  //#endregion
112
- export { getCommandsPersistencePath, readCommandsPersistence, writeCommandsPersistence };
112
+ export { writeCommandsPersistence };
113
113
  //# sourceMappingURL=persistence.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"persistence.mjs","names":[],"sources":["../../src/helpers/persistence.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 { writeEnvTypeReflection } from \"@powerlines/plugin-env/helpers\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { CommandTree, SerializedCommandTree } from \"../types\";\nimport type { Context } from \"../types/context\";\n\nfunction serialize(command: CommandTree): SerializedCommandTree {\n return {\n ...command,\n parent: command.parent?.name ? command.parent.name : null,\n children: Object.fromEntries(\n Object.entries(command.children || {}).map(([name, child]) => [\n name,\n serialize(child)\n ])\n )\n };\n}\n\nfunction deserialize(\n command: SerializedCommandTree,\n parent: CommandTree | null = null\n): CommandTree {\n const result: CommandTree = {\n ...command,\n parent: parent ?? null,\n children: {}\n };\n\n result.children = Object.fromEntries(\n Object.entries(command.children || {}).map(([name, child]) => [\n name,\n deserialize(child, result)\n ])\n );\n\n return result;\n}\n\n/**\n * Gets the file path for persisting CLI command reflections.\n *\n * @param context - The Shell Shock context.\n * @returns The file path for persisting CLI command reflections.\n */\nexport function getCommandsPersistencePath(context: Context): string {\n return joinPaths(context.dataPath, \"reflections\", \"commands.json\");\n}\n\n/**\n * Reads the persisted CLI command reflections from the file system and populates the context's commands.\n *\n * @param context - The Shell Shock context.\n * @throws Will throw an error if the reflections file is empty or cannot be read.\n */\nexport async function readCommandsPersistence(context: Context) {\n const reflections = await context.fs.read(\n getCommandsPersistencePath(context)\n );\n if (!reflections || !reflections.length) {\n throw new Error(\n `CLI Command reflection file ${getCommandsPersistencePath(context)} is empty`\n );\n }\n\n context.commands = Object.fromEntries(\n Object.entries(\n (JSON.parse(reflections) ?? {}) as Record<string, SerializedCommandTree>\n ).map(([name, command]) => [name, deserialize(command)])\n );\n}\n\n/**\n * Writes the current CLI command reflections from the context to the file system for persistence.\n *\n * @param context - The Shell Shock context.\n * @returns A promise that resolves when the reflections have been successfully written to the file system.\n * @throws Will throw an error if there is an issue writing the reflections to the file system.\n */\nexport async function writeCommandsPersistence(context: Context) {\n const filePath = getCommandsPersistencePath(context);\n\n // Also update the environment type reflections whenever we write the command reflections, to ensure they stay in sync.\n await writeEnvTypeReflection(context, context.env.types.env, \"env\");\n\n await context.fs.write(\n filePath,\n JSON.stringify(\n Object.fromEntries(\n Object.entries(context.commands).map(([name, command]) => [\n name,\n serialize(command)\n ])\n ),\n null,\n context.config.mode === \"production\" ? 0 : 2\n )\n );\n}\n"],"mappings":";;;;AAAA,SAAS,aAAa,IAAI,MAAM;;AAE9B,QAAO;;AAqBT,SAAS,UAAU,SAAS;AAC1B,QAAO;EACL,GAAG;EACH,QAAQ,QAAQ,QAAQ,OAAO,QAAQ,OAAO,OAAO;EACrD,UAAU,OAAO,YAAW,OAAA,QAAA,QAAA,YAAA,EAAA,CAAA,CAAA,IAAA,cAAA,CAAA,MAAA,WAAA,CAAA,MAAA,UAAA,MAAA,CAAA,EAAA;GAAA;GAAA;GAAA;GAAA,CAAA,CAAA,CAAA;EAC7B;;AAEH,UAAQ,SAAU;CAAA;CAAK;CAAA;CAAA;CAAA;CAAA;AACvB,SAAO,YAAA,SAAA,SAAA,MAAA;CACL,MAAE,SAAA;EACD,GAAA;EACH,QAAA,UAAA;;EAEA;AACE,QAAO,WAAE,OAAA,YAAqB,OAAA,QAAA,QAAA,YAAA,EAAA,CAAA,CAAA,IAAA,cAAA,CAAA,MAAA,WAAA,CAAA,MAAA,YAAA,OAAA,OAAA,CAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA;AAC9B,QAAO;;AAET,YAAQ,SAAQ;CAAA;CAAc;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;;;;;;;AAO9B,SAAW,2BAAgC,SAAM;AAC/C,QAAI,UAAI,QAAA,UAAA,eAAA,gBAAA;;AAEV,2BAAK,SAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;AAOL,eAAsB,wBAAmB,SAAQ;CAChD,MAAA,cAAA,MAAA,QAAA,GAAA,KAAA,2BAAA,QAAA,CAAA;AACC,KAAE,CAAA,eAAgB,CAAG,YAAY,OAC/B,OAAA,IAAQ,MAAQ,+BAAyB,2BAAmB,QAAA,CAAA,WAAA;AAEhE,SAAO,WAAS,OAAA,YAAA,OAA2B,QAAS,KAAQ,MAAE,YAAO,IAAA,EAAA,CAAA,CAAA,IAAA,cAAA,CAAA,MAAA,aAAA,CAAA,MAAA,YAAA,QAAA,CAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA;;AAErE,wBAAA,SAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;;;;;;;AAQA,eAAsB,yBAAwB,SAAS;CACrD,MAAM,WAAW,2BAAwB,QAAA;AAEzC,OAAC,uBAAA,SAAA,QAAA,IAAA,MAAA,KAAA,MAAA;AACD,OAAK,QAAA,GAAY,MAAI,UAAY,KAAA,UAAQ,OAAA,YAAA,OAAA,QAAA,QAAA,SAAA,CAAA,IAAA,cAAA,CAAA,MAAA,aAAA,CAAA,MAAA,UAAA,QAAA,CAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,EAAA,MAAA,QAAA,OAAA,SAAA,eAAA,IAAA,EAAA,CAAA;;AAE3C,yBAAmB,SAAe;CAAC;CAAE;CAAA;CAA6C;CAAA;CAAA"}
1
+ {"version":3,"file":"persistence.mjs","names":[],"sources":[],"mappings":""}
@@ -1,4 +1,3 @@
1
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
1
  const require_context_helpers = require('../plugin-utils/context-helpers.cjs');
3
2
  let _stryke_convert_to_array = require("@stryke/convert/to-array");
4
3
  let _stryke_path_join_paths = require("@stryke/path/join-paths");
@@ -62,4 +61,5 @@ updatePackageJsonBinary.__type = [
62
61
 
63
62
  //#endregion
64
63
  exports.formatBinaryPath = formatBinaryPath;
65
- exports.updatePackageJsonBinary = updatePackageJsonBinary;
64
+ exports.updatePackageJsonBinary = updatePackageJsonBinary;
65
+ //# sourceMappingURL=update-package-json.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-package-json.cjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"update-package-json.mjs","names":[],"sources":["../../src/helpers/update-package-json.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 { toArray } from \"@stryke/convert/to-array\";\nimport { getUnique } from \"@stryke/helpers/get-unique\";\nimport { StormJSON } from \"@stryke/json/storm-json\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { getAppName } from \"../plugin-utils/context-helpers\";\nimport type { Context } from \"../types/context\";\n\nexport function formatBinaryPath(\n format: string | string[] | undefined\n): string {\n return `./dist/bin.${\n format === \"cjs\" || (Array.isArray(format) && format.includes(\"cjs\"))\n ? \"cjs\"\n : \"mjs\"\n }`;\n}\n\nexport async function updatePackageJsonBinary(context: Context): Promise<void> {\n const packageJsonPath = joinPaths(\n context.config.cwd,\n context.config.root,\n \"package.json\"\n );\n\n if (!context.packageJson) {\n const packageJson = await context.fs.read(packageJsonPath);\n if (packageJson) {\n context.packageJson ??= JSON.parse(packageJson);\n }\n }\n\n if (context.packageJson) {\n if (\n context.config.bin &&\n Array.isArray(context.config.bin) &&\n context.config.bin.length > 0\n ) {\n context.packageJson.bin = Object.fromEntries(\n getUnique(toArray(context.config.bin)).map(bin => [\n bin,\n formatBinaryPath(context.config.output.format)\n ])\n );\n\n await context.fs.write(\n packageJsonPath,\n StormJSON.stringify(context.packageJson)\n );\n } else {\n if (\n Array.isArray(context.config.output.format) &&\n context.config.output.format.length > 1\n ) {\n context.packageJson.bin = {\n [kebabCase(getAppName(context))]: formatBinaryPath(\n toArray(context.config.output.format)[0]\n )\n };\n context.packageJson.bin = toArray(context.config.output.format).reduce(\n (ret, format) => {\n ret[`${kebabCase(getAppName(context))}-${format}`] =\n formatBinaryPath(format);\n\n return ret;\n },\n context.packageJson.bin\n );\n } else {\n context.packageJson.bin = {\n [kebabCase(getAppName(context))]: formatBinaryPath(\n context.config.output.format\n )\n };\n }\n\n await context.fs.write(\n packageJsonPath,\n StormJSON.stringify(context.packageJson)\n );\n }\n\n if (!isSetObject(context.packageJson.bin)) {\n throw new Error(\n \"Unable to determine the CLI binary name. Please specify the `bin` option in your Shell Shock configuration or ensure that the `name` field is set in your package.json.\"\n );\n }\n\n context.config.bin = context.packageJson.bin;\n }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,aAAa,IAAI,MAAM;;AAE9B,QAAO;;AA0BT,SAAgB,iBAAc,QAAA;AAC5B,QAAO,cAAC,WAAA,SAAA,MAAA,QAAA,OAAA,IAAA,OAAA,SAAA,MAAA,GAAA,QAAA;;AAEV,iBAAgB,SAAS;CAAA;CAAM;CAA0B;CAAe;AACxE,eAAY,wBAAA,SAAA;CACV,MAAM,kBAAI,UAAA,QAAA,OAAA,KAAA,QAAA,OAAA,MAAA,eAAA;AACV,KAAE,CAAA,QAAA,aAAA;EACJ,MAAA,cAAA,MAAA,QAAA,GAAA,KAAA,gBAAA;kBAEM,SAAO,gBAAS,KAAA,MAAA,YAA+B;;AAGnD,KAAE,QAAQ,aAAW;AACnB,MAAC,QAAQ,OAAI,OAAA,MAAA,QAAA,QAAA,OAAA,IAAA,IAAA,QAAA,OAAA,IAAA,SAAA,GAAA;AACd,WAAA,YAAA,MAAA,OAAA,YAAA,UAAA,QAAA,QAAA,OAAA,IAAA,CAAA,CAAA,IAAA,cAAA,QAAA,CAAA,KAAA,iBAAA,QAAA,OAAA,OAAA,OAAA,CAAA,EAAA;IAAA;IAAA;IAAA;IAAA,CAAA,CAAA,CAAA;;SAEI;AACH,OAAM,MAAA,QAAc,QAAM,OAAQ,OAAQ,OAAA,IAAA,QAAgB,OAAA,OAAA,OAAA,SAAA,GAAA;AACtD,YAAA,YAAa,MAAA,GACf,UAAQ,WAAgB,QAAU,CAAC,GAAA,iBAAY,QAAA,QAAA,OAAA,OAAA,OAAA,CAAA,GAAA,EACjD;AACF,YAAA,YAAA,MAAA,QAAA,QAAA,OAAA,OAAA,OAAA,CAAA,OAAA,cAAA,KAAA,WAAA;;AAEI,YAAQ;OACP;KAAA;KAAA;KAAA;KAAA;KAAA,CAAA,EAAA,QAAA,YAAA,IAAA;SAED,SAAM,YAAgB,MAAM,GAC5B,UAAe,WAAW,QAAE,CAAA,GAAA,iBAAA,QAAA,OAAA,OAAA,OAAA,EAC5B;AAEA,SAAE,QAAU,GAAA,MAAQ,iBAAoB,UAAU,UAAE,QAAA,YAAA,CAAA;;AAEtD,MAAI,CAAC,YAAC,QAAiB,YAAc,IAAC,CACpC,OAAG,IAAA,MAAA,0KAAA;;;;AAKT,wBAAkB,SAAU;CAAA;CAAQ;CAAW;CAAA;CAAA"}
1
+ {"version":3,"file":"update-package-json.mjs","names":[],"sources":[],"mappings":""}
@@ -1,4 +1,3 @@
1
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
1
  let _stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
3
2
  let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
4
3
  let _stryke_cli_utils_tree = require("@stryke/cli/utils/tree");
@@ -17,7 +16,7 @@ function __assignType(fn, args) {
17
16
  }
18
17
  function innerFormatCommandTree(command) {
19
18
  return {
20
- name: `${command.name}${command.isVirtual ? " (virtual)" : ""}`,
19
+ name: `${command.name}${command.virtual ? " (virtual)" : ""}`,
21
20
  children: Object.values(command.children ?? {}).map(innerFormatCommandTree)
22
21
  };
23
22
  }
@@ -92,4 +91,5 @@ getGlobalOptions.__type = [
92
91
 
93
92
  //#endregion
94
93
  exports.formatCommandTree = formatCommandTree;
95
- exports.getGlobalOptions = getGlobalOptions;
94
+ exports.getGlobalOptions = getGlobalOptions;
95
+ //# sourceMappingURL=utilities.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utilities.cjs","names":[],"sources":[],"mappings":""}
@@ -16,7 +16,7 @@ function __assignType(fn, args) {
16
16
  }
17
17
  function innerFormatCommandTree(command) {
18
18
  return {
19
- name: `${command.name}${command.isVirtual ? " (virtual)" : ""}`,
19
+ name: `${command.name}${command.virtual ? " (virtual)" : ""}`,
20
20
  children: Object.values(command.children ?? {}).map(innerFormatCommandTree)
21
21
  };
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utilities.mjs","names":[],"sources":["../../src/helpers/utilities.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 { TreeItem } from \"@stryke/cli/utils/tree\";\nimport { formatTree } from \"@stryke/cli/utils/tree\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport type { CommandBase, CommandOption, CommandTree } from \"../types/command\";\nimport type { Context } from \"../types/context\";\n\nfunction innerFormatCommandTree(command: CommandTree): TreeItem {\n return {\n name: `${command.name}${command.isVirtual ? \" (virtual)\" : \"\"}`,\n children: Object.values(command.children ?? {}).map(innerFormatCommandTree)\n };\n}\n\nexport function formatCommandTree(context: Context): string {\n return formatTree({\n name: context.config.name,\n children: Object.values(context.commands ?? {}).map(innerFormatCommandTree)\n });\n}\n\n/**\n * Retrieves the global command options based on the context configuration.\n *\n * @param context - The build context.\n * @param command - The command for which to retrieve global options.\n * @returns A record of global command options.\n */\nexport function getGlobalOptions(\n context: Context,\n command: CommandBase\n): Record<string, CommandOption> {\n let options!: Record<string, CommandOption>;\n if (Array.isArray(context.config.globalOptions)) {\n options = Object.fromEntries(\n getUniqueBy(\n context.config.globalOptions,\n (item: CommandOption) => item.name\n ).map(option => [option.name, option])\n );\n } else if (isFunction(context.config.globalOptions)) {\n options = Object.fromEntries(\n getUniqueBy(\n context.config.globalOptions(context, command),\n (item: CommandOption) => item.name\n ).map(option => [option.name, option])\n );\n } else {\n options = {};\n }\n\n return Object.fromEntries(\n Object.entries(options).map(([key, value]) => [\n key,\n { ...value, env: value.env ?? constantCase(key) }\n ])\n );\n}\n"],"mappings":";;;;;;AAAA,MAAM,YAAY;CAAC;CAAK;CAAK;CAAU;CAAyB;;AAE9D,IAAG,SAAS;;;AAOd,SAAS,uBAAuB,SAAG;AAClC,QAAA;EACA,MAAA,GAAA,QAAoB,OAAM,QAAQ,YAAK,eAAkB;EACzD,UAAa,OAAO,OAAM,QAAQ,YAAa,EAAC,CAAA,CAAG,IAAC,uBAAA;;;;;;;;;AAIrD,SAAgB,kBAAkB,SAAS;;EAE3C,MAAO,QAAO,OAAW;EACzB,UAAS,OAAY,OAAO,QAAQ,YAAU,EAAI,CAAC,CAAA,IAAA,uBAAA;EACnD,CAAA;;AAEA,kBAAS,SAAkB;CAAC;CAAQ;CAAc;CAAU;CAAA;;;;;;;;AAQ5D,SAAG,iBAAA,SAAA,SAAA;CACH,IAAA;iDAEA,WAAO,OAAS,YAAiB,YAAU,QAAU,OAAO,eAAA,cAAA,SAAA,KAAA,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,IAAA,cAAA,WAAA,CAAA,OAAA,MAAA,OAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA;UACnD,WAAW,QAAA,OAAA,cAAA,CAChB,WAAM,OAAQ,YAAW,YAAA,QAAA,OAAA,cAAA,SAAA,QAAA,EAAA,cAAA,SAAA,KAAA,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA,IAAA,cAAA,WAAA,CAAA,OAAA,MAAA,OAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA;KAEzB,WAAA,EAAA;;EAGF,GAAA;EACC,KAAA,MAAU,OAAI,aAAe,IAAO;EACtC,CAAA,EAAA;EAAA;EAAA;EAAA;EAAA,CAAA,CAAA,CAAA;;AAED,iBAAiB,SAAO;CAAA;CAAY;CAAS;CAAgB;OAAO;CAAA;CAAA;CAAA;CAAA;CAAA"}
1
+ {"version":3,"file":"utilities.mjs","names":[],"sources":[],"mappings":""}
@@ -1,4 +1,3 @@
1
- const require_types_command = require('../types/command.cjs');
2
1
 
3
2
  //#region src/helpers/validations.ts
4
3
  const __ΩValidationFailure = [
@@ -10,7 +9,7 @@ const __ΩValidationFailure = [
10
9
  function validateArguments(command) {
11
10
  const failures = [];
12
11
  let sequential = false;
13
- for (const argument of command.args ?? []) if ((argument.kind === require_types_command.CommandParameterKinds.string || argument.kind === require_types_command.CommandParameterKinds.number) && argument.variadic) if (!sequential) sequential = true;
12
+ for (const argument of command.args ?? []) if ((argument.type === "string" || argument.type === "number") && argument.variadic) if (!sequential) sequential = true;
14
13
  else failures.push({
15
14
  code: "SEQUENTIAL_VARIADIC_ARGUMENTS",
16
15
  details: `Sequential variadic arguments are not allowed - since the argument preceding ${argument.name} is variadic, it must not also be variadic.`
@@ -68,4 +67,5 @@ validateCommand.__type = [
68
67
  ];
69
68
 
70
69
  //#endregion
71
- exports.validateCommand = validateCommand;
70
+ exports.validateCommand = validateCommand;
71
+ //# sourceMappingURL=validations.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validations.cjs","names":[],"sources":[],"mappings":""}
@@ -1,5 +1,3 @@
1
- import { CommandParameterKinds } from "../types/command.mjs";
2
-
3
1
  //#region src/helpers/validations.ts
4
2
  const __ΩValidationFailure = [
5
3
  "code",
@@ -10,7 +8,7 @@ const __ΩValidationFailure = [
10
8
  function validateArguments(command) {
11
9
  const failures = [];
12
10
  let sequential = false;
13
- for (const argument of command.args ?? []) if ((argument.kind === CommandParameterKinds.string || argument.kind === CommandParameterKinds.number) && argument.variadic) if (!sequential) sequential = true;
11
+ for (const argument of command.args ?? []) if ((argument.type === "string" || argument.type === "number") && argument.variadic) if (!sequential) sequential = true;
14
12
  else failures.push({
15
13
  code: "SEQUENTIAL_VARIADIC_ARGUMENTS",
16
14
  details: `Sequential variadic arguments are not allowed - since the argument preceding ${argument.name} is variadic, it must not also be variadic.`
@@ -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":";;;AAkBA,MAAM,uBAAsB;CAAA;CAAS;CAAM;CAAA;CAAA;;CAG3C,MAAO,WAAU,EAAA;CACf,IAAI,aAAQ;AACZ,MAAA,MAAS,YAAM,QAAA,QAAA,EAAA,CACjB,MAAA,SAAA,SAAA,sBAAA,UAAA,SAAA,SAAA,sBAAA,WAAA,SAAA,0BAEO,cAAS;;EAGV,MAAU;EACT,SAAM,gFAAgC,SAAA,KAAA;EACtC,CAAA;KAGD,cAAS;AAGb,QAAM;;AAER,kBAAiB,SAAK;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA;AACtB,SAAgB,gBAAC,SAAA;CACf,MAAM,WAAW,EAAC;CAClB,MAAM,eAAE,IAAA,IAAA,CAAA,CAAA,IAAA,CAAA,kBAAA,IAAA,KAAA;AACR,MAAI,MAAA,UAAA,OAAA,OAAA,QAAA,WAAA,EAAA,CAAA,EAAA;AACF,MAAE,YAAK,IAAA,OAAA,KAAA,CACL,UAAA,KAAa;GACf,MAAA;GACF,SAAA,0BAAA,OAAA,KAAA;;AAGF,cAAA,IAAA,OAAA,KAAA;;AAEM,OAAC,YAAS,IAAA,MAAgB,CACxB,UAAS,KAAC;;IAEV,SAAW,0BAAoB,MAAA,kBAAA,OAAA,KAAA;IAChC,CAAA;AAED,eAAS,IAAK,MAAA;;;AAGlB,QAAM;;AAER,gBAAgB,SAAI;CAAM;CAAM;OAAA;CAAA;CAAA;CAAA;;CAE9B,MAAM,UAAO,EAAK;CAClB,IAAI,WAAI,gBAAuB,QAAC;AAChC,KAAI,SAAE,SAAc,EAClB,SAAM,KAAO,GAAA,SAAA;AAEf,YAAU,kBAAO,QAAA;AACjB,KAAI,SAAQ,SAAS,EACnB,SAAM,KAAA,GAAA,SAAA;AAER,QAAI;;AAEN,gBAAE,SAAA;CAAA;CAAA;OAAA;CAAA;CAAA;CAAA"}
1
+ {"version":3,"file":"validations.mjs","names":[],"sources":[],"mappings":""}