@shell-shock/core 0.17.8 → 0.17.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +29 -1
  2. package/dist/api.cjs +36 -1
  3. package/dist/api.cjs.map +1 -0
  4. package/dist/api.d.cts +2 -77
  5. package/dist/api.d.cts.map +1 -1
  6. package/dist/api.d.mts +2 -76
  7. package/dist/api.d.mts.map +1 -1
  8. package/dist/api.mjs +35 -1
  9. package/dist/api.mjs.map +1 -1
  10. package/dist/components/command-validation-logic.cjs +291 -1
  11. package/dist/components/command-validation-logic.cjs.map +1 -0
  12. package/dist/components/command-validation-logic.d.cts +1 -3
  13. package/dist/components/command-validation-logic.d.cts.map +1 -1
  14. package/dist/components/command-validation-logic.d.mts +1 -3
  15. package/dist/components/command-validation-logic.d.mts.map +1 -1
  16. package/dist/components/command-validation-logic.mjs +288 -1
  17. package/dist/components/command-validation-logic.mjs.map +1 -1
  18. package/dist/components/docs.cjs +265 -1
  19. package/dist/components/docs.cjs.map +1 -0
  20. package/dist/components/docs.d.cts +4 -5
  21. package/dist/components/docs.d.cts.map +1 -1
  22. package/dist/components/docs.d.mts +4 -5
  23. package/dist/components/docs.d.mts.map +1 -1
  24. package/dist/components/docs.mjs +256 -1
  25. package/dist/components/docs.mjs.map +1 -1
  26. package/dist/components/exec-builtin.cjs +429 -15
  27. package/dist/components/exec-builtin.cjs.map +1 -0
  28. package/dist/components/exec-builtin.d.cts +1 -2
  29. package/dist/components/exec-builtin.d.cts.map +1 -1
  30. package/dist/components/exec-builtin.d.mts +1 -2
  31. package/dist/components/exec-builtin.d.mts.map +1 -1
  32. package/dist/components/exec-builtin.mjs +424 -15
  33. package/dist/components/exec-builtin.mjs.map +1 -1
  34. package/dist/components/helpers.cjs +119 -1
  35. package/dist/components/helpers.cjs.map +1 -0
  36. package/dist/components/helpers.d.cts +6 -8
  37. package/dist/components/helpers.d.cts.map +1 -1
  38. package/dist/components/helpers.d.mts +6 -8
  39. package/dist/components/helpers.d.mts.map +1 -1
  40. package/dist/components/helpers.mjs +111 -1
  41. package/dist/components/helpers.mjs.map +1 -1
  42. package/dist/components/index.cjs +58 -1
  43. package/dist/components/index.mjs +10 -1
  44. package/dist/components/options-parser-logic.cjs +959 -5
  45. package/dist/components/options-parser-logic.cjs.map +1 -0
  46. package/dist/components/options-parser-logic.d.cts +8 -9
  47. package/dist/components/options-parser-logic.d.cts.map +1 -1
  48. package/dist/components/options-parser-logic.d.mts +8 -9
  49. package/dist/components/options-parser-logic.d.mts.map +1 -1
  50. package/dist/components/options-parser-logic.mjs +944 -5
  51. package/dist/components/options-parser-logic.mjs.map +1 -1
  52. package/dist/components/state-builtin.cjs +630 -8
  53. package/dist/components/state-builtin.cjs.map +1 -0
  54. package/dist/components/state-builtin.d.cts +4 -5
  55. package/dist/components/state-builtin.d.cts.map +1 -1
  56. package/dist/components/state-builtin.d.mts +4 -5
  57. package/dist/components/state-builtin.d.mts.map +1 -1
  58. package/dist/components/state-builtin.mjs +622 -8
  59. package/dist/components/state-builtin.mjs.map +1 -1
  60. package/dist/components/usage.cjs +116 -1
  61. package/dist/components/usage.cjs.map +1 -0
  62. package/dist/components/usage.d.cts +1 -2
  63. package/dist/components/usage.d.cts.map +1 -1
  64. package/dist/components/usage.d.mts +1 -2
  65. package/dist/components/usage.d.mts.map +1 -1
  66. package/dist/components/usage.mjs +113 -1
  67. package/dist/components/usage.mjs.map +1 -1
  68. package/dist/components/utils-builtin.cjs +839 -33
  69. package/dist/components/utils-builtin.cjs.map +1 -0
  70. package/dist/components/utils-builtin.d.cts +7 -8
  71. package/dist/components/utils-builtin.d.cts.map +1 -1
  72. package/dist/components/utils-builtin.d.mts +7 -8
  73. package/dist/components/utils-builtin.d.mts.map +1 -1
  74. package/dist/components/utils-builtin.mjs +828 -33
  75. package/dist/components/utils-builtin.mjs.map +1 -1
  76. package/dist/config.cjs +65 -1
  77. package/dist/config.cjs.map +1 -0
  78. package/dist/config.d.cts +29 -8
  79. package/dist/config.d.cts.map +1 -1
  80. package/dist/config.d.mts +29 -8
  81. package/dist/config.d.mts.map +1 -1
  82. package/dist/config.mjs +62 -1
  83. package/dist/config.mjs.map +1 -1
  84. package/dist/contexts/command.cjs +26 -1
  85. package/dist/contexts/command.cjs.map +1 -0
  86. package/dist/contexts/command.d.cts.map +1 -1
  87. package/dist/contexts/command.d.mts.map +1 -1
  88. package/dist/contexts/command.mjs +23 -1
  89. package/dist/contexts/command.mjs.map +1 -1
  90. package/dist/contexts/index.cjs +9 -1
  91. package/dist/contexts/index.mjs +4 -1
  92. package/dist/contexts/options.cjs +63 -1
  93. package/dist/contexts/options.cjs.map +1 -0
  94. package/dist/contexts/options.d.cts.map +1 -1
  95. package/dist/contexts/options.d.mts.map +1 -1
  96. package/dist/contexts/options.mjs +57 -1
  97. package/dist/contexts/options.mjs.map +1 -1
  98. package/dist/engine.cjs +138 -0
  99. package/dist/engine.cjs.map +1 -0
  100. package/dist/engine.d.cts +79 -0
  101. package/dist/engine.d.cts.map +1 -0
  102. package/dist/engine.d.mts +79 -0
  103. package/dist/engine.d.mts.map +1 -0
  104. package/dist/engine.mjs +136 -0
  105. package/dist/engine.mjs.map +1 -0
  106. package/dist/helpers/automd.cjs +70 -1
  107. package/dist/helpers/automd.cjs.map +1 -0
  108. package/dist/helpers/automd.mjs +69 -1
  109. package/dist/helpers/automd.mjs.map +1 -1
  110. package/dist/helpers/docs-helpers.cjs +23 -1
  111. package/dist/helpers/docs-helpers.cjs.map +1 -0
  112. package/dist/helpers/docs-helpers.mjs +22 -1
  113. package/dist/helpers/docs-helpers.mjs.map +1 -1
  114. package/dist/helpers/get-framework.cjs +24 -0
  115. package/dist/helpers/get-framework.cjs.map +1 -0
  116. package/dist/helpers/get-framework.mjs +24 -0
  117. package/dist/helpers/get-framework.mjs.map +1 -0
  118. package/dist/helpers/paths.cjs +137 -1
  119. package/dist/helpers/paths.cjs.map +1 -0
  120. package/dist/helpers/paths.mjs +133 -1
  121. package/dist/helpers/paths.mjs.map +1 -1
  122. package/dist/helpers/persistence.cjs +113 -1
  123. package/dist/helpers/persistence.cjs.map +1 -0
  124. package/dist/helpers/persistence.mjs +112 -1
  125. package/dist/helpers/persistence.mjs.map +1 -1
  126. package/dist/helpers/update-package-json.cjs +65 -1
  127. package/dist/helpers/update-package-json.cjs.map +1 -0
  128. package/dist/helpers/update-package-json.mjs +63 -1
  129. package/dist/helpers/update-package-json.mjs.map +1 -1
  130. package/dist/helpers/utilities.cjs +95 -1
  131. package/dist/helpers/utilities.cjs.map +1 -0
  132. package/dist/helpers/utilities.mjs +93 -1
  133. package/dist/helpers/utilities.mjs.map +1 -1
  134. package/dist/helpers/validations.cjs +71 -1
  135. package/dist/helpers/validations.cjs.map +1 -0
  136. package/dist/helpers/validations.mjs +69 -1
  137. package/dist/helpers/validations.mjs.map +1 -1
  138. package/dist/index.cjs +123 -1
  139. package/dist/index.cjs.map +1 -0
  140. package/dist/index.d.cts +80 -5
  141. package/dist/index.d.cts.map +1 -0
  142. package/dist/index.d.mts +80 -5
  143. package/dist/index.d.mts.map +1 -0
  144. package/dist/index.mjs +119 -1
  145. package/dist/index.mjs.map +1 -0
  146. package/dist/package.cjs +12 -0
  147. package/dist/package.cjs.map +1 -0
  148. package/dist/package.mjs +6 -0
  149. package/dist/package.mjs.map +1 -0
  150. package/dist/plugin-utils/compute-bin.cjs +48 -1
  151. package/dist/plugin-utils/compute-bin.cjs.map +1 -0
  152. package/dist/plugin-utils/compute-bin.d.cts +2 -2
  153. package/dist/plugin-utils/compute-bin.d.cts.map +1 -1
  154. package/dist/plugin-utils/compute-bin.d.mts +2 -2
  155. package/dist/plugin-utils/compute-bin.d.mts.map +1 -1
  156. package/dist/plugin-utils/compute-bin.mjs +47 -1
  157. package/dist/plugin-utils/compute-bin.mjs.map +1 -1
  158. package/dist/plugin-utils/context-helpers.cjs +224 -1
  159. package/dist/plugin-utils/context-helpers.cjs.map +1 -0
  160. package/dist/plugin-utils/context-helpers.d.cts +4 -4
  161. package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
  162. package/dist/plugin-utils/context-helpers.d.mts +4 -4
  163. package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
  164. package/dist/plugin-utils/context-helpers.mjs +214 -1
  165. package/dist/plugin-utils/context-helpers.mjs.map +1 -1
  166. package/dist/plugin-utils/deepkit.cjs +70 -1
  167. package/dist/plugin-utils/deepkit.cjs.map +1 -0
  168. package/dist/plugin-utils/deepkit.d.cts +5 -5
  169. package/dist/plugin-utils/deepkit.d.cts.map +1 -1
  170. package/dist/plugin-utils/deepkit.d.mts +5 -5
  171. package/dist/plugin-utils/deepkit.d.mts.map +1 -1
  172. package/dist/plugin-utils/deepkit.mjs +68 -1
  173. package/dist/plugin-utils/deepkit.mjs.map +1 -1
  174. package/dist/plugin-utils/description-helpers.cjs +112 -2
  175. package/dist/plugin-utils/description-helpers.cjs.map +1 -0
  176. package/dist/plugin-utils/description-helpers.d.cts.map +1 -1
  177. package/dist/plugin-utils/description-helpers.d.mts.map +1 -1
  178. package/dist/plugin-utils/description-helpers.mjs +107 -2
  179. package/dist/plugin-utils/description-helpers.mjs.map +1 -1
  180. package/dist/plugin-utils/get-command-tree.cjs +118 -1
  181. package/dist/plugin-utils/get-command-tree.cjs.map +1 -0
  182. package/dist/plugin-utils/get-command-tree.d.cts.map +1 -1
  183. package/dist/plugin-utils/get-command-tree.d.mts.map +1 -1
  184. package/dist/plugin-utils/get-command-tree.mjs +114 -1
  185. package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
  186. package/dist/plugin-utils/index.cjs +39 -1
  187. package/dist/plugin-utils/index.d.cts +2 -2
  188. package/dist/plugin-utils/index.d.mts +2 -2
  189. package/dist/plugin-utils/index.mjs +10 -1
  190. package/dist/plugin-utils/reflect.cjs +52 -1
  191. package/dist/plugin-utils/reflect.cjs.map +1 -0
  192. package/dist/plugin-utils/reflect.d.cts.map +1 -1
  193. package/dist/plugin-utils/reflect.d.mts.map +1 -1
  194. package/dist/plugin-utils/reflect.mjs +50 -1
  195. package/dist/plugin-utils/reflect.mjs.map +1 -1
  196. package/dist/plugin-utils/traverse-command-tree.cjs +65 -1
  197. package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -0
  198. package/dist/plugin-utils/traverse-command-tree.d.cts.map +1 -1
  199. package/dist/plugin-utils/traverse-command-tree.d.mts.map +1 -1
  200. package/dist/plugin-utils/traverse-command-tree.mjs +62 -1
  201. package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
  202. package/dist/plugin-utils/type-checks.cjs +222 -1
  203. package/dist/plugin-utils/type-checks.cjs.map +1 -0
  204. package/dist/plugin-utils/type-checks.d.cts +5 -5
  205. package/dist/plugin-utils/type-checks.d.cts.map +1 -1
  206. package/dist/plugin-utils/type-checks.d.mts +5 -5
  207. package/dist/plugin-utils/type-checks.d.mts.map +1 -1
  208. package/dist/plugin-utils/type-checks.mjs +217 -1
  209. package/dist/plugin-utils/type-checks.mjs.map +1 -1
  210. package/dist/plugin.cjs +495 -4
  211. package/dist/plugin.cjs.map +1 -0
  212. package/dist/plugin.d.cts.map +1 -1
  213. package/dist/plugin.d.mts.map +1 -1
  214. package/dist/plugin.mjs +488 -4
  215. package/dist/plugin.mjs.map +1 -1
  216. package/dist/resolver/helpers.cjs +182 -1
  217. package/dist/resolver/helpers.cjs.map +1 -0
  218. package/dist/resolver/helpers.mjs +178 -1
  219. package/dist/resolver/helpers.mjs.map +1 -1
  220. package/dist/resolver/resolve.cjs +479 -1
  221. package/dist/resolver/resolve.cjs.map +1 -0
  222. package/dist/resolver/resolve.mjs +478 -1
  223. package/dist/resolver/resolve.mjs.map +1 -1
  224. package/dist/types/command.cjs +402 -1
  225. package/dist/types/command.cjs.map +1 -0
  226. package/dist/types/command.d.cts +61 -119
  227. package/dist/types/command.d.cts.map +1 -1
  228. package/dist/types/command.d.mts +61 -119
  229. package/dist/types/command.d.mts.map +1 -1
  230. package/dist/types/command.mjs +367 -1
  231. package/dist/types/command.mjs.map +1 -1
  232. package/dist/types/config.cjs +175 -1
  233. package/dist/types/config.cjs.map +1 -0
  234. package/dist/types/config.d.cts +19 -12
  235. package/dist/types/config.d.cts.map +1 -1
  236. package/dist/types/config.d.mts +19 -12
  237. package/dist/types/config.d.mts.map +1 -1
  238. package/dist/types/config.mjs +163 -1
  239. package/dist/types/config.mjs.map +1 -1
  240. package/dist/types/context.cjs +45 -1
  241. package/dist/types/context.cjs.map +1 -0
  242. package/dist/types/context.d.cts +3 -2
  243. package/dist/types/context.d.cts.map +1 -1
  244. package/dist/types/context.d.mts +3 -2
  245. package/dist/types/context.d.mts.map +1 -1
  246. package/dist/types/context.mjs +40 -1
  247. package/dist/types/context.mjs.map +1 -1
  248. package/dist/types/env.cjs +53 -1
  249. package/dist/types/env.cjs.map +1 -0
  250. package/dist/types/env.d.cts +1 -1
  251. package/dist/types/env.d.cts.map +1 -1
  252. package/dist/types/env.d.mts +1 -1
  253. package/dist/types/env.d.mts.map +1 -1
  254. package/dist/types/env.mjs +50 -1
  255. package/dist/types/env.mjs.map +1 -1
  256. package/dist/types/index.cjs +53 -1
  257. package/dist/types/index.d.cts +4 -4
  258. package/dist/types/index.d.mts +4 -4
  259. package/dist/types/index.mjs +6 -1
  260. package/dist/types/options.cjs +13 -1
  261. package/dist/types/options.cjs.map +1 -0
  262. package/dist/types/options.d.cts.map +1 -1
  263. package/dist/types/options.d.mts.map +1 -1
  264. package/dist/types/options.mjs +10 -1
  265. package/dist/types/options.mjs.map +1 -1
  266. package/package.json +43 -34
  267. package/dist/resolver/deepkit.cjs +0 -1
  268. package/dist/resolver/deepkit.mjs +0 -2
  269. package/dist/resolver/deepkit.mjs.map +0 -1
  270. package/dist/resolver/module.cjs +0 -1
  271. package/dist/resolver/module.mjs +0 -2
  272. package/dist/resolver/module.mjs.map +0 -1
@@ -1 +1,29 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ exports.__toESM = __toESM;
package/dist/api.cjs CHANGED
@@ -1 +1,36 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);const e=require(`./plugin.cjs`);let t=require(`powerlines`);var n=class n{#e;static async fromOptions(r){return new n(await(0,t.createAPI)({...r,framework:`shell-shock`},{plugins:[e.default()]}))}get context(){return this.#e.context}constructor(e){this.#e=e}async clean(e){return this.#e.clean(e)}async prepare(e){return this.#e.prepare(e)}async lint(e){return this.#e.lint(e)}async build(e){return this.#e.build(e)}async docs(e){return this.#e.docs(e)}async finalize(){return this.#e.finalize()}static __type=[`#powerlines`,`options`,()=>n,`fromOptions`,`Creates a new instance of the {@link ShellShockAPI} class using the provided configuration options. This method initializes the underlying Powerlines API with the appropriate plugins and settings for Shell Shock.`,`powerlines`,`constructor`,`inlineConfig`,`clean`,"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.",`prepare`,"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.",`lint`,"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.",`build`,"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.",`docs`,"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.",`finalize`,`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.`,`ShellShockAPI`,`The Shell Shock API class.`,'!3!P!2"P7#`0$s?%!P!2&"0\'P!2($`0)?*P!2($`0+?,P!2($`0-?.P!2($`0/?0P!2($`01?2P$`03?45w5?6']};async function r(e){return n.fromOptions({framework:`shell-shock`,cwd:process.cwd(),...e})}r.__type=[`options`,()=>n,`createShellShock`,`Creates a new {@link ShellShockAPI} instance.`,'P!2!P7"`/#?$'],exports.ShellShockAPI=n,exports.createShellShock=r;
1
+ const require_package = require('./package.cjs');
2
+ const require_plugin = require('./plugin.cjs');
3
+ let powerlines_api_build = require("powerlines/api/build");
4
+ let powerlines_api_clean = require("powerlines/api/clean");
5
+ let powerlines_api_create = require("powerlines/api/create");
6
+ let powerlines_api_deploy = require("powerlines/api/deploy");
7
+ let powerlines_api_docs = require("powerlines/api/docs");
8
+ let powerlines_api_lint = require("powerlines/api/lint");
9
+ let powerlines_api_prepare = require("powerlines/api/prepare");
10
+ let powerlines_api_test = require("powerlines/api/test");
11
+ let powerlines_api_types = require("powerlines/api/types");
12
+ let powerlines_helpers = require("powerlines/helpers");
13
+
14
+ //#region src/api.ts
15
+ var api_default = (0, powerlines_helpers.createApi)({
16
+ types: powerlines_api_types.types,
17
+ prepare: powerlines_api_prepare.prepare,
18
+ create: powerlines_api_create.create,
19
+ clean: powerlines_api_clean.clean,
20
+ lint: powerlines_api_lint.lint,
21
+ test: powerlines_api_test.test,
22
+ build: powerlines_api_build.build,
23
+ docs: powerlines_api_docs.docs,
24
+ deploy: powerlines_api_deploy.deploy
25
+ }, {
26
+ plugins: [require_plugin.default()],
27
+ framework: {
28
+ name: "shell-shock",
29
+ version: require_package.version,
30
+ orgId: "storm-software"
31
+ }
32
+ });
33
+
34
+ //#endregion
35
+ module.exports = api_default;
36
+ //# sourceMappingURL=api.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.cjs","names":[],"sources":[],"mappings":""}
package/dist/api.d.cts CHANGED
@@ -1,79 +1,4 @@
1
- import * as _$powerlines from "powerlines";
2
- import { BuildInlineConfig, CleanInlineConfig, DocsInlineConfig, EngineOptions, LintInlineConfig, PrepareInlineConfig } from "powerlines";
3
- import { PartialKeys } from "@stryke/types";
4
-
5
1
  //#region src/api.d.ts
6
- /**
7
- * The Shell Shock API class.
8
- *
9
- * @remarks
10
- * This class provides methods to interact with the Shell Shock build system, including cleaning, preparing, linting, building, generating documentation, and finalizing projects.
11
- */
12
- declare class ShellShockAPI {
13
- #private;
14
- /**
15
- * Creates a new instance of the {@link ShellShockAPI} class using the provided configuration options. This method initializes the underlying Powerlines API with the appropriate plugins and settings for Shell Shock.
16
- *
17
- * @param options - The user configuration options.
18
- * @returns A promise that resolves to a {@link ShellShockAPI} instance.
19
- */
20
- static fromOptions(options: EngineOptions): Promise<ShellShockAPI>;
21
- /**
22
- * 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.
23
- *
24
- * @returns The current build context.
25
- */
26
- get context(): _$powerlines.ExecutionContext<_$powerlines.ResolvedConfig>;
27
- private constructor();
28
- /**
29
- * 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.
30
- *
31
- * @param inlineConfig - The inline configuration options for the clean operation.
32
- * @returns A promise that resolves when the clean operation is complete.
33
- */
34
- clean(inlineConfig: CleanInlineConfig): Promise<void>;
35
- /**
36
- * 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.
37
- *
38
- * @param inlineConfig - The inline configuration options for the prepare operation.
39
- * @returns A promise that resolves when the prepare operation is complete.
40
- */
41
- prepare(inlineConfig: PrepareInlineConfig): Promise<void>;
42
- /**
43
- * 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.
44
- *
45
- * @param inlineConfig - The inline configuration options for the lint operation.
46
- * @returns A promise that resolves when the lint operation is complete.
47
- */
48
- lint(inlineConfig: LintInlineConfig): Promise<void>;
49
- /**
50
- * 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.
51
- *
52
- * @param inlineConfig - The inline configuration options for the build operation.
53
- * @returns A promise that resolves when the build operation is complete.
54
- */
55
- build(inlineConfig: BuildInlineConfig): Promise<void>;
56
- /**
57
- * 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.
58
- *
59
- * @param inlineConfig - The inline configuration options for the documentation operation.
60
- * @returns A promise that resolves when the documentation generation is complete.
61
- */
62
- docs(inlineConfig: DocsInlineConfig): Promise<void>;
63
- /**
64
- * 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.
65
- *
66
- * @returns A promise that resolves when the finalize operation is complete.
67
- */
68
- finalize(): Promise<void>;
69
- }
70
- /**
71
- * Creates a new {@link ShellShockAPI} instance.
72
- *
73
- * @param options - The user configuration options.
74
- * @returns A promise that resolves to a {@link ShellShockAPI} instance.
75
- */
76
- declare function createShellShock(options: PartialKeys<EngineOptions, "cwd" | "framework">): Promise<ShellShockAPI>;
77
- //#endregion
78
- export { ShellShockAPI, createShellShock };
2
+ declare const _default: (params: import("@powerlines/engine").ExecutionApiParams<import("powerlines").ExecutionOptions, "types" | "docs" | "create" | "clean" | "prepare" | "lint" | "test" | "build" | "deploy">) => Promise<void>;
3
+ export = _default;
79
4
  //# sourceMappingURL=api.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.cts","names":[],"sources":["../src/api.ts"],"mappings":";;;;;;;;AAqCA;;;cAAa,aAAA;EAAA;EAWR;;;;;;EAAA,OAFiB,WAAA,CAClB,OAAA,EAAS,aAAA,GACR,OAAA,CAAQ,aAAA;EAkDqB;;;;;EAAA,IAlCrB,OAAA,CAAA,GAAO,YAAA,CAAA,gBAAA,CAhBR,YAAA,CAgBQ,cAAA;EAAA,QAIX,WAAA,CAAA;EA2DyB;;;;;;EAjDnB,KAAA,CAAM,YAAA,EAAc,iBAAA,GAAoB,OAAA;EA9B1C;;;;;;EAwCE,OAAA,CAAQ,YAAA,EAAc,mBAAA,GAAsB,OAAA;EAVtC;;;;;;EAoBN,IAAA,CAAK,YAAA,EAAc,gBAAA,GAAmB,OAAA;EAAnB;;;;;;EAUnB,KAAA,CAAM,YAAA,EAAc,iBAAA,GAAoB,OAAA;EAUxC;;;;;;EAAA,IAAA,CAAK,YAAA,EAAc,gBAAA,GAAmB,OAAA;EASnB;AAWlC;;;;EAXe,QAAA,CAAA,GAAY,OAAA;AAAA;;;;;;;iBAWL,gBAAA,CACpB,OAAA,EAAS,WAAA,CAAY,aAAA,yBACpB,OAAA,CAAQ,aAAA"}
1
+ {"version":3,"file":"api.d.cts","names":[],"sources":["../src/api.ts"],"mappings":""}
package/dist/api.d.mts CHANGED
@@ -1,79 +1,5 @@
1
- import * as _$powerlines from "powerlines";
2
- import { BuildInlineConfig, CleanInlineConfig, DocsInlineConfig, EngineOptions, LintInlineConfig, PrepareInlineConfig } from "powerlines";
3
- import { PartialKeys } from "@stryke/types";
4
-
5
1
  //#region src/api.d.ts
6
- /**
7
- * The Shell Shock API class.
8
- *
9
- * @remarks
10
- * This class provides methods to interact with the Shell Shock build system, including cleaning, preparing, linting, building, generating documentation, and finalizing projects.
11
- */
12
- declare class ShellShockAPI {
13
- #private;
14
- /**
15
- * Creates a new instance of the {@link ShellShockAPI} class using the provided configuration options. This method initializes the underlying Powerlines API with the appropriate plugins and settings for Shell Shock.
16
- *
17
- * @param options - The user configuration options.
18
- * @returns A promise that resolves to a {@link ShellShockAPI} instance.
19
- */
20
- static fromOptions(options: EngineOptions): Promise<ShellShockAPI>;
21
- /**
22
- * 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.
23
- *
24
- * @returns The current build context.
25
- */
26
- get context(): _$powerlines.ExecutionContext<_$powerlines.ResolvedConfig>;
27
- private constructor();
28
- /**
29
- * 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.
30
- *
31
- * @param inlineConfig - The inline configuration options for the clean operation.
32
- * @returns A promise that resolves when the clean operation is complete.
33
- */
34
- clean(inlineConfig: CleanInlineConfig): Promise<void>;
35
- /**
36
- * 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.
37
- *
38
- * @param inlineConfig - The inline configuration options for the prepare operation.
39
- * @returns A promise that resolves when the prepare operation is complete.
40
- */
41
- prepare(inlineConfig: PrepareInlineConfig): Promise<void>;
42
- /**
43
- * 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.
44
- *
45
- * @param inlineConfig - The inline configuration options for the lint operation.
46
- * @returns A promise that resolves when the lint operation is complete.
47
- */
48
- lint(inlineConfig: LintInlineConfig): Promise<void>;
49
- /**
50
- * 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.
51
- *
52
- * @param inlineConfig - The inline configuration options for the build operation.
53
- * @returns A promise that resolves when the build operation is complete.
54
- */
55
- build(inlineConfig: BuildInlineConfig): Promise<void>;
56
- /**
57
- * 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.
58
- *
59
- * @param inlineConfig - The inline configuration options for the documentation operation.
60
- * @returns A promise that resolves when the documentation generation is complete.
61
- */
62
- docs(inlineConfig: DocsInlineConfig): Promise<void>;
63
- /**
64
- * 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.
65
- *
66
- * @returns A promise that resolves when the finalize operation is complete.
67
- */
68
- finalize(): Promise<void>;
69
- }
70
- /**
71
- * Creates a new {@link ShellShockAPI} instance.
72
- *
73
- * @param options - The user configuration options.
74
- * @returns A promise that resolves to a {@link ShellShockAPI} instance.
75
- */
76
- declare function createShellShock(options: PartialKeys<EngineOptions, "cwd" | "framework">): Promise<ShellShockAPI>;
2
+ declare const _default: (params: import("@powerlines/engine").ExecutionApiParams<import("powerlines").ExecutionOptions, "types" | "docs" | "create" | "clean" | "prepare" | "lint" | "test" | "build" | "deploy">) => Promise<void>;
77
3
  //#endregion
78
- export { ShellShockAPI, createShellShock };
4
+ export { _default as default };
79
5
  //# sourceMappingURL=api.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.mts","names":[],"sources":["../src/api.ts"],"mappings":";;;;;;;;AAqCA;;;cAAa,aAAA;EAAA;EAWR;;;;;;EAAA,OAFiB,WAAA,CAClB,OAAA,EAAS,aAAA,GACR,OAAA,CAAQ,aAAA;EAkDqB;;;;;EAAA,IAlCrB,OAAA,CAAA,GAAO,YAAA,CAAA,gBAAA,CAhBR,YAAA,CAgBQ,cAAA;EAAA,QAIX,WAAA,CAAA;EA2DyB;;;;;;EAjDnB,KAAA,CAAM,YAAA,EAAc,iBAAA,GAAoB,OAAA;EA9B1C;;;;;;EAwCE,OAAA,CAAQ,YAAA,EAAc,mBAAA,GAAsB,OAAA;EAVtC;;;;;;EAoBN,IAAA,CAAK,YAAA,EAAc,gBAAA,GAAmB,OAAA;EAAnB;;;;;;EAUnB,KAAA,CAAM,YAAA,EAAc,iBAAA,GAAoB,OAAA;EAUxC;;;;;;EAAA,IAAA,CAAK,YAAA,EAAc,gBAAA,GAAmB,OAAA;EASnB;AAWlC;;;;EAXe,QAAA,CAAA,GAAY,OAAA;AAAA;;;;;;;iBAWL,gBAAA,CACpB,OAAA,EAAS,WAAA,CAAY,aAAA,yBACpB,OAAA,CAAQ,aAAA"}
1
+ {"version":3,"file":"api.d.mts","names":[],"sources":["../src/api.ts"],"mappings":""}
package/dist/api.mjs CHANGED
@@ -1,2 +1,36 @@
1
- import e from"./plugin.mjs";import{createAPI as t}from"powerlines";var n=class n{#e;static async fromOptions(r){return new n(await t({...r,framework:`shell-shock`},{plugins:[e()]}))}get context(){return this.#e.context}constructor(e){this.#e=e}async clean(e){return this.#e.clean(e)}async prepare(e){return this.#e.prepare(e)}async lint(e){return this.#e.lint(e)}async build(e){return this.#e.build(e)}async docs(e){return this.#e.docs(e)}async finalize(){return this.#e.finalize()}static __type=[`#powerlines`,`options`,()=>n,`fromOptions`,`Creates a new instance of the {@link ShellShockAPI} class using the provided configuration options. This method initializes the underlying Powerlines API with the appropriate plugins and settings for Shell Shock.`,`powerlines`,`constructor`,`inlineConfig`,`clean`,"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.",`prepare`,"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.",`lint`,"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.",`build`,"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.",`docs`,"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.",`finalize`,`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.`,`ShellShockAPI`,`The Shell Shock API class.`,'!3!P!2"P7#`0$s?%!P!2&"0\'P!2($`0)?*P!2($`0+?,P!2($`0-?.P!2($`0/?0P!2($`01?2P$`03?45w5?6']};async function r(e){return n.fromOptions({framework:`shell-shock`,cwd:process.cwd(),...e})}r.__type=[`options`,()=>n,`createShellShock`,`Creates a new {@link ShellShockAPI} instance.`,'P!2!P7"`/#?$'];export{n as ShellShockAPI,r as createShellShock};
1
+ import { version } from "./package.mjs";
2
+ import plugin from "./plugin.mjs";
3
+ import { build } from "powerlines/api/build";
4
+ import { clean } from "powerlines/api/clean";
5
+ import { create } from "powerlines/api/create";
6
+ import { deploy } from "powerlines/api/deploy";
7
+ import { docs } from "powerlines/api/docs";
8
+ import { lint } from "powerlines/api/lint";
9
+ import { prepare } from "powerlines/api/prepare";
10
+ import { test } from "powerlines/api/test";
11
+ import { types } from "powerlines/api/types";
12
+ import { createApi } from "powerlines/helpers";
13
+
14
+ //#region src/api.ts
15
+ var api_default = createApi({
16
+ types,
17
+ prepare,
18
+ create,
19
+ clean,
20
+ lint,
21
+ test,
22
+ build,
23
+ docs,
24
+ deploy
25
+ }, {
26
+ plugins: [plugin()],
27
+ framework: {
28
+ name: "shell-shock",
29
+ version,
30
+ orgId: "storm-software"
31
+ }
32
+ });
33
+
34
+ //#endregion
35
+ export { api_default as default };
2
36
  //# sourceMappingURL=api.mjs.map
package/dist/api.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.mjs","names":[],"sources":["../src/api.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 { PartialKeys } from \"@stryke/types\";\nimport type {\n BuildInlineConfig,\n CleanInlineConfig,\n DocsInlineConfig,\n EngineOptions,\n LintInlineConfig,\n PowerlinesAPI,\n PrepareInlineConfig\n} from \"powerlines\";\nimport { createAPI } from \"powerlines\";\nimport { plugin } from \"./plugin\";\n\n/**\n * The Shell Shock API class.\n *\n * @remarks\n * This class provides methods to interact with the Shell Shock build system, including cleaning, preparing, linting, building, generating documentation, and finalizing projects.\n */\nexport class ShellShockAPI {\n #powerlines: PowerlinesAPI;\n\n /**\n * Creates a new instance of the {@link ShellShockAPI} class using the provided configuration options. This method initializes the underlying Powerlines API with the appropriate plugins and settings for Shell Shock.\n *\n * @param options - The user configuration options.\n * @returns A promise that resolves to a {@link ShellShockAPI} instance.\n */\n public static async fromOptions(\n options: EngineOptions\n ): Promise<ShellShockAPI> {\n const powerlines = await createAPI(\n { ...options, framework: \"shell-shock\" },\n {\n plugins: [plugin()]\n }\n );\n\n return new ShellShockAPI(powerlines);\n }\n\n /**\n * 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.\n *\n * @returns The current build context.\n */\n public get context() {\n return this.#powerlines.context;\n }\n\n private constructor(powerlines: PowerlinesAPI) {\n this.#powerlines = powerlines;\n }\n\n /**\n * 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.\n *\n * @param inlineConfig - The inline configuration options for the clean operation.\n * @returns A promise that resolves when the clean operation is complete.\n */\n public async clean(inlineConfig: CleanInlineConfig): Promise<void> {\n return this.#powerlines.clean(inlineConfig);\n }\n\n /**\n * 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.\n *\n * @param inlineConfig - The inline configuration options for the prepare operation.\n * @returns A promise that resolves when the prepare operation is complete.\n */\n public async prepare(inlineConfig: PrepareInlineConfig): Promise<void> {\n return this.#powerlines.prepare(inlineConfig);\n }\n\n /**\n * 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.\n *\n * @param inlineConfig - The inline configuration options for the lint operation.\n * @returns A promise that resolves when the lint operation is complete.\n */\n public async lint(inlineConfig: LintInlineConfig): Promise<void> {\n return this.#powerlines.lint(inlineConfig);\n }\n\n /**\n * 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.\n *\n * @param inlineConfig - The inline configuration options for the build operation.\n * @returns A promise that resolves when the build operation is complete.\n */\n public async build(inlineConfig: BuildInlineConfig): Promise<void> {\n return this.#powerlines.build(inlineConfig);\n }\n\n /**\n * 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.\n *\n * @param inlineConfig - The inline configuration options for the documentation operation.\n * @returns A promise that resolves when the documentation generation is complete.\n */\n public async docs(inlineConfig: DocsInlineConfig): Promise<void> {\n return this.#powerlines.docs(inlineConfig);\n }\n\n /**\n * 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.\n *\n * @returns A promise that resolves when the finalize operation is complete.\n */\n public async finalize(): Promise<void> {\n return this.#powerlines.finalize();\n }\n}\n\n/**\n * Creates a new {@link ShellShockAPI} instance.\n *\n * @param options - The user configuration options.\n * @returns A promise that resolves to a {@link ShellShockAPI} instance.\n */\nexport async function createShellShock(\n options: PartialKeys<EngineOptions, \"cwd\" | \"framework\">\n): Promise<ShellShockAPI> {\n return ShellShockAPI.fromOptions({\n framework: \"shell-shock\",\n cwd: process.cwd(),\n ...options\n });\n}\n"],"mappings":"mEAyBA,IAAE,EAAF,MAAE,CAAa,CACb,GAOD,aAAA,YAAA,EAAA,CAOG,OAAA,IAAA,EAAA,MANA,EAAA,CACD,GAAK,EACN,UAAA,cACF,CAAO,CACJ,QAAY,CAAA,GAAA,CAAA,CAAA,CAAA,CAEX,CAOF,IAAE,SAAS,CACT,OAAC,MAAA,EAAuB,QAE1B,YAAS,EAAS,CAChB,MAAA,EAAE,EAQJ,MAAE,MAAA,EAAA,CACA,OAAM,MAAA,EAAkB,MAAA,EAAe,CAQzC,MAAA,QAAQ,EAAY,CAClB,OAAM,MAAA,EAAa,QAAU,EAAA,CAQ/B,MAAE,KAAA,EAAA,CACF,OAAO,MAAA,EAAY,KAAY,EAAE,CAQjC,MAAI,MAAQ,EAAc,CACxB,OAAA,MAAA,EAAA,MAAA,EAAA,CAQF,MAAI,KAAM,EAAe,CACvB,OAAE,MAAA,EAAsB,KAAC,EAAiB,CAO5C,MAAG,UAAa,CACf,OAAA,MAAA,EAAA,UAAA,CAED,OAAI,OAAU,CAAA,cAAa,cAAkB,EAAmB,cAAQ,uNAAA,aAAA,cAAA,eAAA,QAAA,sPAAA,UAAA,0PAAA,OAAA,mOAAA,QAAA,+OAAA,OAAA,+QAAA,WAAA,0LAAA,gBAAA,6BAAA,0FAAA,EAQ1E,eAAG,EAAA,EAAA,CACD,OAAI,EAAM,YAAmB,CAC3B,UAAW,cACX,IAAA,QAAA,KAAA,CACF,GAAA,EACC,CAAC"}
1
+ {"version":3,"file":"api.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1,291 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../types/command.cjs`);let t=require(`@alloy-js/core/jsx-runtime`),n=require(`@stryke/string-format/camel-case`),r=require(`@alloy-js/core`),i=require(`@powerlines/plugin-alloy/core/components/spacing`),a=require(`@alloy-js/typescript`),o=require(`@stryke/string-format/list`);function s(e,t){return e.__type=t,e}const c=[`CommandTree`,`command`,`CommandValidationLogicProps`,`P"w!4"Mw#y`];function l(c){let{command:l}=c;return[(0,t.createComponent)(a.VarDeclaration,{name:`failures`,type:`string[]`,initializer:r.code`[];`}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(r.For,{get each(){return Object.values(l.options??{})},doubleHardline:!0,get children(){return s(i=>[(0,t.createComponent)(r.Show,{get when(){return!i.optional},get children(){return[(0,t.createComponent)(a.IfStatement,{get condition(){return r.code`!options${i.name.includes(`?`)?`["${i.name}"]`:`.${(0,n.camelCase)(i.name)}`}`},get children(){return r.code`failures.push("Missing required \\"${i.name}\\" option");`}}),(0,t.createComponent)(r.Show,{get when(){return i.variadic},get children(){return(0,t.createComponent)(a.ElseIfClause,{get condition(){return r.code`options${i.name.includes(`?`)?`["${i.name}"]`:`.${(0,n.camelCase)(i.name)}`}.length === 0`},get children(){return r.code`failures.push("No values were provided to the required \\"${i.name}\\" array option");`}})}})]}}),(0,t.createComponent)(r.Show,{get when(){return i.kind===e.CommandParameterKinds.number},get children(){return(0,t.createComponent)(r.Show,{get when(){return i.variadic},get fallback(){return(0,t.createComponent)(a.IfStatement,{get condition(){return r.code`options${i.name.includes(`?`)?`["${i.name}"]`:`.${(0,n.camelCase)(i.name)}`} && Number.isNaN(options${i.name.includes(`?`)?`["${i.name}"]`:`.${(0,n.camelCase)(i.name)}`})`},get children(){return r.code`failures.push("Invalid numeric value provided for the \\"${i.name}\\" option");`}})},get children(){return(0,t.createComponent)(a.IfStatement,{get condition(){return r.code`options${i.name.includes(`?`)?`["${i.name}"]`:`.${(0,n.camelCase)(i.name)}`}.some(value => Number.isNaN(value))`},get children(){return r.code`failures.push("Invalid numeric value provided in the \\"${i.name}\\" array option");`}})}})}}),(0,t.createComponent)(r.Show,{get when(){return(i.kind===e.CommandParameterKinds.string||i.kind===e.CommandParameterKinds.number)&&i.choices&&i.choices.length>0},get children(){return(0,t.createComponent)(r.Show,{get when(){return!i.variadic},get fallback(){return(0,t.createComponent)(r.Show,{get when(){return!i.optional},get fallback(){return(0,t.createComponent)(a.IfStatement,{get condition(){return r.code`!options${i.name.includes(`?`)?`["${i.name}"]`:`.${(0,n.camelCase)(i.name)}`}.every(value => [${i.choices?.map(s(t=>i.kind===e.CommandParameterKinds.string?`"${t}"`:t,[`choice`,``,`P"2!"/"`])).join(`, `)}].includes(value))`},get children(){return r.code`failures.push(\`Invalid value provided for the \\"${i.name}\\" option - valid values include: ${(0,o.list)(i?.choices?.map(s(e=>String(e),[`choice`,``,`P"2!"/"`]))??[])}; provided: \${options${i.name.includes(`?`)?`["${i.name}"]`:`.${(0,n.camelCase)(i.name)}`}}\`);`}})},get children(){return(0,t.createComponent)(a.ElseIfClause,{get condition(){return r.code`!options${i.name.includes(`?`)?`["${i.name}"]`:`.${(0,n.camelCase)(i.name)}`}.every(value => [${i.choices?.map(s(t=>i.kind===e.CommandParameterKinds.string?`"${t}"`:t,[`choice`,``,`P"2!"/"`])).join(`, `)}].includes(value))`},get children(){return r.code`failures.push(\`Invalid value provided for the \\"${i.name}\\" option - valid values include: ${(0,o.list)(i?.choices?.map(s(e=>String(e),[`choice`,``,`P"2!"/"`]))??[])}; provided: \${options${i.name.includes(`?`)?`["${i.name}"]`:`.${(0,n.camelCase)(i.name)}`}}\`);`}})}})},get children(){return(0,t.createComponent)(r.Show,{get when(){return!i.optional},get fallback(){return(0,t.createComponent)(a.IfStatement,{get condition(){return r.code`![${i.choices?.map(s(t=>i.kind===e.CommandParameterKinds.string?`"${t}"`:t,[`choice`,``,`P"2!"/"`])).join(`, `)}].includes(options${i.name.includes(`?`)?`["${i.name}"]`:`.${(0,n.camelCase)(i.name)}`})`},get children(){return r.code`failures.push(\`Invalid value provided for the \\"${i.name}\\" option - valid values include: ${(0,o.list)(i?.choices?.map(s(e=>String(e),[`choice`,``,`P"2!"/"`]))??[])}; provided: \${options${i.name.includes(`?`)?`["${i.name}"]`:`.${(0,n.camelCase)(i.name)}`}}\`);`}})},get children(){return(0,t.createComponent)(a.ElseIfClause,{get condition(){return r.code`![${i.choices?.map(s(t=>i.kind===e.CommandParameterKinds.string?`"${t}"`:t,[`choice`,``,`P"2!"/"`])).join(`, `)}].includes(options${i.name.includes(`?`)?`["${i.name}"]`:`.${(0,n.camelCase)(i.name)}`})`},get children(){return r.code`failures.push(\`Invalid value provided for the \\"${i.name}\\" option - valid values include: ${(0,o.list)(i?.choices?.map(s(e=>String(e),[`choice`,``,`P"2!"/"`]))??[])}; provided: \${options${i.name.includes(`?`)?`["${i.name}"]`:`.${(0,n.camelCase)(i.name)}`}}\`);`}})}})}})}})],[`option`,``,`P"2!"/"`])}}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(r.For,{get each(){return l.args},doubleHardline:!0,get children(){return s(i=>[(0,t.createComponent)(r.Show,{get when(){return!i.optional},get children(){return[(0,t.createComponent)(a.IfStatement,{get condition(){return r.code`!${(0,n.camelCase)(i.name)}`},get children(){return r.code`failures.push("Missing required \\"${i.name}\\" positional argument");`}}),(0,t.createComponent)(r.Show,{get when(){return i.variadic},get children(){return(0,t.createComponent)(a.ElseIfClause,{get condition(){return r.code`${(0,n.camelCase)(i.name)}.length === 0`},get children(){return r.code`failures.push("No values were provided to the required \\"${i.name}\\" array positional argument");`}})}})]}}),(0,t.createComponent)(r.Show,{get when(){return i.kind===e.CommandParameterKinds.number},get children(){return(0,t.createComponent)(r.Show,{get when(){return i.variadic},get fallback(){return(0,t.createComponent)(a.IfStatement,{get condition(){return r.code`${(0,n.camelCase)(i.name)} && Number.isNaN(${(0,n.camelCase)(i.name)})`},get children(){return r.code`failures.push("Invalid numeric value provided for the \\"${i.name}\\" positional argument");`}})},get children(){return(0,t.createComponent)(a.IfStatement,{get condition(){return r.code`${(0,n.camelCase)(i.name)}.some(value => Number.isNaN(value))`},get children(){return r.code`failures.push("Invalid numeric value provided in the \\"${i.name}\\" array positional argument");`}})}})}})],[`argument`,``,`P"2!"/"`])}})]}l.__type=[()=>c,`props`,`CommandValidationLogic`,`A component that generates command validation logic for required options and arguments.`,`Pn!2""/#?$`],exports.CommandValidationLogic=l,exports.__ΩCommandValidationLogicProps=c;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
+ let _alloy_js_core = require("@alloy-js/core");
4
+ let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
5
+ let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
6
+ let _alloy_js_typescript = require("@alloy-js/typescript");
7
+ let _stryke_string_format_list = require("@stryke/string-format/list");
8
+
9
+ //#region src/components/command-validation-logic.tsx
10
+ function __assignType(fn, args) {
11
+ fn.__type = args;
12
+ return fn;
13
+ }
14
+ const __ΩCommandValidationLogicProps = [
15
+ "CommandTree",
16
+ "command",
17
+ "CommandValidationLogicProps",
18
+ "P\"w!4\"Mw#y"
19
+ ];
20
+ /**
21
+ * A component that generates command validation logic for required options and arguments.
22
+ */
23
+ function CommandValidationLogic(props) {
24
+ const { command } = props;
25
+ return [
26
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
27
+ name: "failures",
28
+ type: "string[]",
29
+ initializer: _alloy_js_core.code`[];`
30
+ }),
31
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
32
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
33
+ get each() {
34
+ return Object.values(command.options ?? {});
35
+ },
36
+ doubleHardline: true,
37
+ get children() {
38
+ return __assignType((option) => [
39
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
40
+ get when() {
41
+ return option.required;
42
+ },
43
+ get children() {
44
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
45
+ get condition() {
46
+ return _alloy_js_core.code`!options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`}`;
47
+ },
48
+ get children() {
49
+ return _alloy_js_core.code`failures.push("Missing required \\"${option.name}\\" option");`;
50
+ }
51
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
52
+ get when() {
53
+ return option.variadic;
54
+ },
55
+ get children() {
56
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseIfClause, {
57
+ get condition() {
58
+ return _alloy_js_core.code`options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`}.length === 0`;
59
+ },
60
+ get children() {
61
+ return _alloy_js_core.code`failures.push("No values were provided to the required \\"${option.name}\\" array option");`;
62
+ }
63
+ });
64
+ }
65
+ })];
66
+ }
67
+ }),
68
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
69
+ get when() {
70
+ return option.type === "number";
71
+ },
72
+ get children() {
73
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
74
+ get when() {
75
+ return option.variadic;
76
+ },
77
+ get fallback() {
78
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
79
+ get condition() {
80
+ return _alloy_js_core.code`options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`} && Number.isNaN(options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`})`;
81
+ },
82
+ get children() {
83
+ return _alloy_js_core.code`failures.push("Invalid numeric value provided for the \\"${option.name}\\" option");`;
84
+ }
85
+ });
86
+ },
87
+ get children() {
88
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
89
+ get condition() {
90
+ return _alloy_js_core.code`options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`}.some(value => Number.isNaN(value))`;
91
+ },
92
+ get children() {
93
+ return _alloy_js_core.code`failures.push("Invalid numeric value provided in the \\"${option.name}\\" array option");`;
94
+ }
95
+ });
96
+ }
97
+ });
98
+ }
99
+ }),
100
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
101
+ get when() {
102
+ return (option.type === "string" || option.type === "number") && option.choices && option.choices.length > 0;
103
+ },
104
+ get children() {
105
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
106
+ get when() {
107
+ return !option.variadic;
108
+ },
109
+ get fallback() {
110
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
111
+ get when() {
112
+ return option.required;
113
+ },
114
+ get fallback() {
115
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
116
+ get condition() {
117
+ return _alloy_js_core.code`!options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`}.every(value => [${option.choices?.map(__assignType((choice) => option.type === "string" ? `"${choice}"` : choice, [
118
+ "choice",
119
+ "",
120
+ "P\"2!\"/\""
121
+ ])).join(", ")}].includes(value))`;
122
+ },
123
+ get children() {
124
+ return _alloy_js_core.code`failures.push(\`Invalid value provided for the \\"${option.name}\\" option - valid values include: ${(0, _stryke_string_format_list.list)(option?.choices?.map(__assignType((choice) => String(choice), [
125
+ "choice",
126
+ "",
127
+ "P\"2!\"/\""
128
+ ])) ?? [])}; provided: \${options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`}}\`);`;
129
+ }
130
+ });
131
+ },
132
+ get children() {
133
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseIfClause, {
134
+ get condition() {
135
+ return _alloy_js_core.code`!options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`}.every(value => [${option.choices?.map(__assignType((choice) => option.type === "string" ? `"${choice}"` : choice, [
136
+ "choice",
137
+ "",
138
+ "P\"2!\"/\""
139
+ ])).join(", ")}].includes(value))`;
140
+ },
141
+ get children() {
142
+ return _alloy_js_core.code`failures.push(\`Invalid value provided for the \\"${option.name}\\" option - valid values include: ${(0, _stryke_string_format_list.list)(option?.choices?.map(__assignType((choice) => String(choice), [
143
+ "choice",
144
+ "",
145
+ "P\"2!\"/\""
146
+ ])) ?? [])}; provided: \${options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`}}\`);`;
147
+ }
148
+ });
149
+ }
150
+ });
151
+ },
152
+ get children() {
153
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
154
+ get when() {
155
+ return option.required;
156
+ },
157
+ get fallback() {
158
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
159
+ get condition() {
160
+ return _alloy_js_core.code`![${option.choices?.map(__assignType((choice) => option.type === "string" ? `"${choice}"` : choice, [
161
+ "choice",
162
+ "",
163
+ "P\"2!\"/\""
164
+ ])).join(", ")}].includes(options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`})`;
165
+ },
166
+ get children() {
167
+ return _alloy_js_core.code`failures.push(\`Invalid value provided for the \\"${option.name}\\" option - valid values include: ${(0, _stryke_string_format_list.list)(option?.choices?.map(__assignType((choice) => String(choice), [
168
+ "choice",
169
+ "",
170
+ "P\"2!\"/\""
171
+ ])) ?? [])}; provided: \${options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`}}\`);`;
172
+ }
173
+ });
174
+ },
175
+ get children() {
176
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseIfClause, {
177
+ get condition() {
178
+ return _alloy_js_core.code`![${option.choices?.map(__assignType((choice) => option.type === "string" ? `"${choice}"` : choice, [
179
+ "choice",
180
+ "",
181
+ "P\"2!\"/\""
182
+ ])).join(", ")}].includes(options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`})`;
183
+ },
184
+ get children() {
185
+ return _alloy_js_core.code`failures.push(\`Invalid value provided for the \\"${option.name}\\" option - valid values include: ${(0, _stryke_string_format_list.list)(option?.choices?.map(__assignType((choice) => String(choice), [
186
+ "choice",
187
+ "",
188
+ "P\"2!\"/\""
189
+ ])) ?? [])}; provided: \${options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`}}\`);`;
190
+ }
191
+ });
192
+ }
193
+ });
194
+ }
195
+ });
196
+ }
197
+ })
198
+ ], [
199
+ "option",
200
+ "",
201
+ "P\"2!\"/\""
202
+ ]);
203
+ }
204
+ }),
205
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
206
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
207
+ get each() {
208
+ return command.args;
209
+ },
210
+ doubleHardline: true,
211
+ get children() {
212
+ return __assignType((argument) => [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
213
+ get when() {
214
+ return argument.required;
215
+ },
216
+ get children() {
217
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
218
+ get condition() {
219
+ return _alloy_js_core.code`!${(0, _stryke_string_format_camel_case.camelCase)(argument.name)}`;
220
+ },
221
+ get children() {
222
+ return _alloy_js_core.code`failures.push("Missing required \\"${argument.name}\\" positional argument");`;
223
+ }
224
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
225
+ get when() {
226
+ return argument.variadic;
227
+ },
228
+ get children() {
229
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseIfClause, {
230
+ get condition() {
231
+ return _alloy_js_core.code`${(0, _stryke_string_format_camel_case.camelCase)(argument.name)}.length === 0`;
232
+ },
233
+ get children() {
234
+ return _alloy_js_core.code`failures.push("No values were provided to the required \\"${argument.name}\\" array positional argument");`;
235
+ }
236
+ });
237
+ }
238
+ })];
239
+ }
240
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
241
+ get when() {
242
+ return argument.type === "number";
243
+ },
244
+ get children() {
245
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
246
+ get when() {
247
+ return argument.variadic;
248
+ },
249
+ get fallback() {
250
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
251
+ get condition() {
252
+ return _alloy_js_core.code`${(0, _stryke_string_format_camel_case.camelCase)(argument.name)} && Number.isNaN(${(0, _stryke_string_format_camel_case.camelCase)(argument.name)})`;
253
+ },
254
+ get children() {
255
+ return _alloy_js_core.code`failures.push("Invalid numeric value provided for the \\"${argument.name}\\" positional argument");`;
256
+ }
257
+ });
258
+ },
259
+ get children() {
260
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
261
+ get condition() {
262
+ return _alloy_js_core.code`${(0, _stryke_string_format_camel_case.camelCase)(argument.name)}.some(value => Number.isNaN(value))`;
263
+ },
264
+ get children() {
265
+ return _alloy_js_core.code`failures.push("Invalid numeric value provided in the \\"${argument.name}\\" array positional argument");`;
266
+ }
267
+ });
268
+ }
269
+ });
270
+ }
271
+ })], [
272
+ "argument",
273
+ "",
274
+ "P\"2!\"/\""
275
+ ]);
276
+ }
277
+ })
278
+ ];
279
+ }
280
+ CommandValidationLogic.__type = [
281
+ () => __ΩCommandValidationLogicProps,
282
+ "props",
283
+ "CommandValidationLogic",
284
+ "A component that generates command validation logic for required options and arguments.",
285
+ "Pn!2\"\"/#?$"
286
+ ];
287
+
288
+ //#endregion
289
+ exports.CommandValidationLogic = CommandValidationLogic;
290
+ exports.__ΩCommandValidationLogicProps = __ΩCommandValidationLogicProps;
291
+ //# sourceMappingURL=command-validation-logic.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-validation-logic.cjs","names":[],"sources":[],"mappings":""}
@@ -1,6 +1,4 @@
1
1
  import { CommandTree } from "../types/command.cjs";
2
- import * as _$_alloy_js_core0 from "@alloy-js/core";
3
-
4
2
  //#region src/components/command-validation-logic.d.ts
5
3
  interface CommandValidationLogicProps {
6
4
  command: CommandTree;
@@ -8,7 +6,7 @@ interface CommandValidationLogicProps {
8
6
  /**
9
7
  * A component that generates command validation logic for required options and arguments.
10
8
  */
11
- declare function CommandValidationLogic(props: CommandValidationLogicProps): _$_alloy_js_core0.Children;
9
+ declare function CommandValidationLogic(props: CommandValidationLogicProps): import("@alloy-js/core").Children;
12
10
  //#endregion
13
11
  export { CommandValidationLogic, CommandValidationLogicProps };
14
12
  //# sourceMappingURL=command-validation-logic.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-validation-logic.d.cts","names":[],"sources":["../../src/components/command-validation-logic.tsx"],"mappings":";;;;UAkCiB,2BAAA;EACf,OAAA,EAAS,WAAA;AAAA;;AADX;;iBAOgB,sBAAA,CAAuB,KAAA,EAAO,2BAAA,GAA2B,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"command-validation-logic.d.cts","names":[],"sources":["../../src/components/command-validation-logic.tsx"],"mappings":";;UAiCiB,2BAAA;EACf,OAAA,EAAS,WAAW;AAAA;AADtB;;;AAAA,iBAOgB,sBAAA,CAAuB,KAAA,EAAO,2BAA2B,4BAAA,QAAA"}