@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,6 +1,4 @@
1
1
  import { CommandTree } from "../types/command.mjs";
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.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-validation-logic.d.mts","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.mts","names":[],"sources":["../../src/components/command-validation-logic.tsx"],"mappings":""}
@@ -1,2 +1,289 @@
1
- import{CommandParameterKinds as e}from"../types/command.mjs";import{createComponent as t,createIntrinsic as n}from"@alloy-js/core/jsx-runtime";import{camelCase as r}from"@stryke/string-format/camel-case";import{For as i,Show as a,code as o}from"@alloy-js/core";import{Spacing as s}from"@powerlines/plugin-alloy/core/components/spacing";import{ElseIfClause as c,IfStatement as l,VarDeclaration as u}from"@alloy-js/typescript";import{list as d}from"@stryke/string-format/list";function f(e,t){return e.__type=t,e}const p=[`CommandTree`,`command`,`CommandValidationLogicProps`,`P"w!4"Mw#y`];function m(p){let{command:m}=p;return[t(u,{name:`failures`,type:`string[]`,initializer:o`[];`}),n(`hbr`,{}),t(i,{get each(){return Object.values(m.options??{})},doubleHardline:!0,get children(){return f(n=>[t(a,{get when(){return!n.optional},get children(){return[t(l,{get condition(){return o`!options${n.name.includes(`?`)?`["${n.name}"]`:`.${r(n.name)}`}`},get children(){return o`failures.push("Missing required \\"${n.name}\\" option");`}}),t(a,{get when(){return n.variadic},get children(){return t(c,{get condition(){return o`options${n.name.includes(`?`)?`["${n.name}"]`:`.${r(n.name)}`}.length === 0`},get children(){return o`failures.push("No values were provided to the required \\"${n.name}\\" array option");`}})}})]}}),t(a,{get when(){return n.kind===e.number},get children(){return t(a,{get when(){return n.variadic},get fallback(){return t(l,{get condition(){return o`options${n.name.includes(`?`)?`["${n.name}"]`:`.${r(n.name)}`} && Number.isNaN(options${n.name.includes(`?`)?`["${n.name}"]`:`.${r(n.name)}`})`},get children(){return o`failures.push("Invalid numeric value provided for the \\"${n.name}\\" option");`}})},get children(){return t(l,{get condition(){return o`options${n.name.includes(`?`)?`["${n.name}"]`:`.${r(n.name)}`}.some(value => Number.isNaN(value))`},get children(){return o`failures.push("Invalid numeric value provided in the \\"${n.name}\\" array option");`}})}})}}),t(a,{get when(){return(n.kind===e.string||n.kind===e.number)&&n.choices&&n.choices.length>0},get children(){return t(a,{get when(){return!n.variadic},get fallback(){return t(a,{get when(){return!n.optional},get fallback(){return t(l,{get condition(){return o`!options${n.name.includes(`?`)?`["${n.name}"]`:`.${r(n.name)}`}.every(value => [${n.choices?.map(f(t=>n.kind===e.string?`"${t}"`:t,[`choice`,``,`P"2!"/"`])).join(`, `)}].includes(value))`},get children(){return o`failures.push(\`Invalid value provided for the \\"${n.name}\\" option - valid values include: ${d(n?.choices?.map(f(e=>String(e),[`choice`,``,`P"2!"/"`]))??[])}; provided: \${options${n.name.includes(`?`)?`["${n.name}"]`:`.${r(n.name)}`}}\`);`}})},get children(){return t(c,{get condition(){return o`!options${n.name.includes(`?`)?`["${n.name}"]`:`.${r(n.name)}`}.every(value => [${n.choices?.map(f(t=>n.kind===e.string?`"${t}"`:t,[`choice`,``,`P"2!"/"`])).join(`, `)}].includes(value))`},get children(){return o`failures.push(\`Invalid value provided for the \\"${n.name}\\" option - valid values include: ${d(n?.choices?.map(f(e=>String(e),[`choice`,``,`P"2!"/"`]))??[])}; provided: \${options${n.name.includes(`?`)?`["${n.name}"]`:`.${r(n.name)}`}}\`);`}})}})},get children(){return t(a,{get when(){return!n.optional},get fallback(){return t(l,{get condition(){return o`![${n.choices?.map(f(t=>n.kind===e.string?`"${t}"`:t,[`choice`,``,`P"2!"/"`])).join(`, `)}].includes(options${n.name.includes(`?`)?`["${n.name}"]`:`.${r(n.name)}`})`},get children(){return o`failures.push(\`Invalid value provided for the \\"${n.name}\\" option - valid values include: ${d(n?.choices?.map(f(e=>String(e),[`choice`,``,`P"2!"/"`]))??[])}; provided: \${options${n.name.includes(`?`)?`["${n.name}"]`:`.${r(n.name)}`}}\`);`}})},get children(){return t(c,{get condition(){return o`![${n.choices?.map(f(t=>n.kind===e.string?`"${t}"`:t,[`choice`,``,`P"2!"/"`])).join(`, `)}].includes(options${n.name.includes(`?`)?`["${n.name}"]`:`.${r(n.name)}`})`},get children(){return o`failures.push(\`Invalid value provided for the \\"${n.name}\\" option - valid values include: ${d(n?.choices?.map(f(e=>String(e),[`choice`,``,`P"2!"/"`]))??[])}; provided: \${options${n.name.includes(`?`)?`["${n.name}"]`:`.${r(n.name)}`}}\`);`}})}})}})}})],[`option`,``,`P"2!"/"`])}}),t(s,{}),t(i,{get each(){return m.args},doubleHardline:!0,get children(){return f(n=>[t(a,{get when(){return!n.optional},get children(){return[t(l,{get condition(){return o`!${r(n.name)}`},get children(){return o`failures.push("Missing required \\"${n.name}\\" positional argument");`}}),t(a,{get when(){return n.variadic},get children(){return t(c,{get condition(){return o`${r(n.name)}.length === 0`},get children(){return o`failures.push("No values were provided to the required \\"${n.name}\\" array positional argument");`}})}})]}}),t(a,{get when(){return n.kind===e.number},get children(){return t(a,{get when(){return n.variadic},get fallback(){return t(l,{get condition(){return o`${r(n.name)} && Number.isNaN(${r(n.name)})`},get children(){return o`failures.push("Invalid numeric value provided for the \\"${n.name}\\" positional argument");`}})},get children(){return t(l,{get condition(){return o`${r(n.name)}.some(value => Number.isNaN(value))`},get children(){return o`failures.push("Invalid numeric value provided in the \\"${n.name}\\" array positional argument");`}})}})}})],[`argument`,``,`P"2!"/"`])}})]}m.__type=[()=>p,`props`,`CommandValidationLogic`,`A component that generates command validation logic for required options and arguments.`,`Pn!2""/#?$`];export{m as CommandValidationLogic,p as __ΩCommandValidationLogicProps};
1
+ import { createComponent, createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
+ import { For, Show, code } from "@alloy-js/core";
3
+ import { camelCase } from "@stryke/string-format/camel-case";
4
+ import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
5
+ import { ElseIfClause, IfStatement, VarDeclaration } from "@alloy-js/typescript";
6
+ import { list } from "@stryke/string-format/list";
7
+
8
+ //#region src/components/command-validation-logic.tsx
9
+ function __assignType(fn, args) {
10
+ fn.__type = args;
11
+ return fn;
12
+ }
13
+ const __ΩCommandValidationLogicProps = [
14
+ "CommandTree",
15
+ "command",
16
+ "CommandValidationLogicProps",
17
+ "P\"w!4\"Mw#y"
18
+ ];
19
+ /**
20
+ * A component that generates command validation logic for required options and arguments.
21
+ */
22
+ function CommandValidationLogic(props) {
23
+ const { command } = props;
24
+ return [
25
+ createComponent(VarDeclaration, {
26
+ name: "failures",
27
+ type: "string[]",
28
+ initializer: code`[];`
29
+ }),
30
+ createIntrinsic("hbr", {}),
31
+ createComponent(For, {
32
+ get each() {
33
+ return Object.values(command.options ?? {});
34
+ },
35
+ doubleHardline: true,
36
+ get children() {
37
+ return __assignType((option) => [
38
+ createComponent(Show, {
39
+ get when() {
40
+ return option.required;
41
+ },
42
+ get children() {
43
+ return [createComponent(IfStatement, {
44
+ get condition() {
45
+ return code`!options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}`;
46
+ },
47
+ get children() {
48
+ return code`failures.push("Missing required \\"${option.name}\\" option");`;
49
+ }
50
+ }), createComponent(Show, {
51
+ get when() {
52
+ return option.variadic;
53
+ },
54
+ get children() {
55
+ return createComponent(ElseIfClause, {
56
+ get condition() {
57
+ return code`options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}.length === 0`;
58
+ },
59
+ get children() {
60
+ return code`failures.push("No values were provided to the required \\"${option.name}\\" array option");`;
61
+ }
62
+ });
63
+ }
64
+ })];
65
+ }
66
+ }),
67
+ createComponent(Show, {
68
+ get when() {
69
+ return option.type === "number";
70
+ },
71
+ get children() {
72
+ return createComponent(Show, {
73
+ get when() {
74
+ return option.variadic;
75
+ },
76
+ get fallback() {
77
+ return createComponent(IfStatement, {
78
+ get condition() {
79
+ return code`options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} && Number.isNaN(options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`})`;
80
+ },
81
+ get children() {
82
+ return code`failures.push("Invalid numeric value provided for the \\"${option.name}\\" option");`;
83
+ }
84
+ });
85
+ },
86
+ get children() {
87
+ return createComponent(IfStatement, {
88
+ get condition() {
89
+ return code`options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}.some(value => Number.isNaN(value))`;
90
+ },
91
+ get children() {
92
+ return code`failures.push("Invalid numeric value provided in the \\"${option.name}\\" array option");`;
93
+ }
94
+ });
95
+ }
96
+ });
97
+ }
98
+ }),
99
+ createComponent(Show, {
100
+ get when() {
101
+ return (option.type === "string" || option.type === "number") && option.choices && option.choices.length > 0;
102
+ },
103
+ get children() {
104
+ return createComponent(Show, {
105
+ get when() {
106
+ return !option.variadic;
107
+ },
108
+ get fallback() {
109
+ return createComponent(Show, {
110
+ get when() {
111
+ return option.required;
112
+ },
113
+ get fallback() {
114
+ return createComponent(IfStatement, {
115
+ get condition() {
116
+ return code`!options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}.every(value => [${option.choices?.map(__assignType((choice) => option.type === "string" ? `"${choice}"` : choice, [
117
+ "choice",
118
+ "",
119
+ "P\"2!\"/\""
120
+ ])).join(", ")}].includes(value))`;
121
+ },
122
+ get children() {
123
+ return code`failures.push(\`Invalid value provided for the \\"${option.name}\\" option - valid values include: ${list(option?.choices?.map(__assignType((choice) => String(choice), [
124
+ "choice",
125
+ "",
126
+ "P\"2!\"/\""
127
+ ])) ?? [])}; provided: \${options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}}\`);`;
128
+ }
129
+ });
130
+ },
131
+ get children() {
132
+ return createComponent(ElseIfClause, {
133
+ get condition() {
134
+ return code`!options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}.every(value => [${option.choices?.map(__assignType((choice) => option.type === "string" ? `"${choice}"` : choice, [
135
+ "choice",
136
+ "",
137
+ "P\"2!\"/\""
138
+ ])).join(", ")}].includes(value))`;
139
+ },
140
+ get children() {
141
+ return code`failures.push(\`Invalid value provided for the \\"${option.name}\\" option - valid values include: ${list(option?.choices?.map(__assignType((choice) => String(choice), [
142
+ "choice",
143
+ "",
144
+ "P\"2!\"/\""
145
+ ])) ?? [])}; provided: \${options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}}\`);`;
146
+ }
147
+ });
148
+ }
149
+ });
150
+ },
151
+ get children() {
152
+ return createComponent(Show, {
153
+ get when() {
154
+ return option.required;
155
+ },
156
+ get fallback() {
157
+ return createComponent(IfStatement, {
158
+ get condition() {
159
+ return code`![${option.choices?.map(__assignType((choice) => option.type === "string" ? `"${choice}"` : choice, [
160
+ "choice",
161
+ "",
162
+ "P\"2!\"/\""
163
+ ])).join(", ")}].includes(options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`})`;
164
+ },
165
+ get children() {
166
+ return code`failures.push(\`Invalid value provided for the \\"${option.name}\\" option - valid values include: ${list(option?.choices?.map(__assignType((choice) => String(choice), [
167
+ "choice",
168
+ "",
169
+ "P\"2!\"/\""
170
+ ])) ?? [])}; provided: \${options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}}\`);`;
171
+ }
172
+ });
173
+ },
174
+ get children() {
175
+ return createComponent(ElseIfClause, {
176
+ get condition() {
177
+ return code`![${option.choices?.map(__assignType((choice) => option.type === "string" ? `"${choice}"` : choice, [
178
+ "choice",
179
+ "",
180
+ "P\"2!\"/\""
181
+ ])).join(", ")}].includes(options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`})`;
182
+ },
183
+ get children() {
184
+ return code`failures.push(\`Invalid value provided for the \\"${option.name}\\" option - valid values include: ${list(option?.choices?.map(__assignType((choice) => String(choice), [
185
+ "choice",
186
+ "",
187
+ "P\"2!\"/\""
188
+ ])) ?? [])}; provided: \${options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}}\`);`;
189
+ }
190
+ });
191
+ }
192
+ });
193
+ }
194
+ });
195
+ }
196
+ })
197
+ ], [
198
+ "option",
199
+ "",
200
+ "P\"2!\"/\""
201
+ ]);
202
+ }
203
+ }),
204
+ createComponent(Spacing, {}),
205
+ createComponent(For, {
206
+ get each() {
207
+ return command.args;
208
+ },
209
+ doubleHardline: true,
210
+ get children() {
211
+ return __assignType((argument) => [createComponent(Show, {
212
+ get when() {
213
+ return argument.required;
214
+ },
215
+ get children() {
216
+ return [createComponent(IfStatement, {
217
+ get condition() {
218
+ return code`!${camelCase(argument.name)}`;
219
+ },
220
+ get children() {
221
+ return code`failures.push("Missing required \\"${argument.name}\\" positional argument");`;
222
+ }
223
+ }), createComponent(Show, {
224
+ get when() {
225
+ return argument.variadic;
226
+ },
227
+ get children() {
228
+ return createComponent(ElseIfClause, {
229
+ get condition() {
230
+ return code`${camelCase(argument.name)}.length === 0`;
231
+ },
232
+ get children() {
233
+ return code`failures.push("No values were provided to the required \\"${argument.name}\\" array positional argument");`;
234
+ }
235
+ });
236
+ }
237
+ })];
238
+ }
239
+ }), createComponent(Show, {
240
+ get when() {
241
+ return argument.type === "number";
242
+ },
243
+ get children() {
244
+ return createComponent(Show, {
245
+ get when() {
246
+ return argument.variadic;
247
+ },
248
+ get fallback() {
249
+ return createComponent(IfStatement, {
250
+ get condition() {
251
+ return code`${camelCase(argument.name)} && Number.isNaN(${camelCase(argument.name)})`;
252
+ },
253
+ get children() {
254
+ return code`failures.push("Invalid numeric value provided for the \\"${argument.name}\\" positional argument");`;
255
+ }
256
+ });
257
+ },
258
+ get children() {
259
+ return createComponent(IfStatement, {
260
+ get condition() {
261
+ return code`${camelCase(argument.name)}.some(value => Number.isNaN(value))`;
262
+ },
263
+ get children() {
264
+ return code`failures.push("Invalid numeric value provided in the \\"${argument.name}\\" array positional argument");`;
265
+ }
266
+ });
267
+ }
268
+ });
269
+ }
270
+ })], [
271
+ "argument",
272
+ "",
273
+ "P\"2!\"/\""
274
+ ]);
275
+ }
276
+ })
277
+ ];
278
+ }
279
+ CommandValidationLogic.__type = [
280
+ () => __ΩCommandValidationLogicProps,
281
+ "props",
282
+ "CommandValidationLogic",
283
+ "A component that generates command validation logic for required options and arguments.",
284
+ "Pn!2\"\"/#?$"
285
+ ];
286
+
287
+ //#endregion
288
+ export { CommandValidationLogic, __ΩCommandValidationLogicProps };
2
289
  //# sourceMappingURL=command-validation-logic.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-validation-logic.mjs","names":[],"sources":["../../src/components/command-validation-logic.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, For, Show } from \"@alloy-js/core\";\nimport {\n ElseIfClause,\n IfStatement,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { list } from \"@stryke/string-format/list\";\nimport type {\n CommandTree,\n NumberCommandParameter,\n StringCommandParameter\n} from \"../types\";\nimport { CommandParameterKinds } from \"../types\";\n\nexport interface CommandValidationLogicProps {\n command: CommandTree;\n}\n\n/**\n * A component that generates command validation logic for required options and arguments.\n */\nexport function CommandValidationLogic(props: CommandValidationLogicProps) {\n const { command } = props;\n\n return (\n <>\n <VarDeclaration name=\"failures\" type=\"string[]\" initializer={code`[];`} />\n <hbr />\n <For each={Object.values(command.options ?? {})} doubleHardline>\n {option => (\n <>\n <Show when={!option.optional}>\n <IfStatement\n condition={code`!options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }`}>\n {code`failures.push(\"Missing required \\\\\"${option.name}\\\\\" option\");`}\n </IfStatement>\n <Show when={option.variadic}>\n <ElseIfClause\n condition={code`options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }.length === 0`}>\n {code`failures.push(\"No values were provided to the required \\\\\"${\n option.name\n }\\\\\" array option\");`}\n </ElseIfClause>\n </Show>\n </Show>\n <Show when={option.kind === CommandParameterKinds.number}>\n <Show\n when={option.variadic}\n fallback={\n <IfStatement\n condition={code`options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } && Number.isNaN(options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n })`}>\n {code`failures.push(\"Invalid numeric value provided for the \\\\\"${\n option.name\n }\\\\\" option\");`}\n </IfStatement>\n }>\n <IfStatement\n condition={code`options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }.some(value => Number.isNaN(value))`}>\n {code`failures.push(\"Invalid numeric value provided in the \\\\\"${\n option.name\n }\\\\\" array option\");`}\n </IfStatement>\n </Show>\n </Show>\n <Show\n when={\n (option.kind === CommandParameterKinds.string ||\n option.kind === CommandParameterKinds.number) &&\n option.choices &&\n option.choices.length > 0\n }>\n <Show\n when={!option.variadic}\n fallback={\n <Show\n when={!option.optional}\n fallback={\n <IfStatement\n condition={code`!options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }.every(value => [${(\n option as\n | StringCommandParameter\n | NumberCommandParameter\n ).choices\n ?.map(choice =>\n option.kind === CommandParameterKinds.string\n ? `\"${choice}\"`\n : choice\n )\n .join(\", \")}].includes(value))`}>\n {code`failures.push(\\`Invalid value provided for the \\\\\"${\n option.name\n }\\\\\" option - valid values include: ${list(\n (\n option as\n | StringCommandParameter\n | NumberCommandParameter\n )?.choices?.map(choice => String(choice)) ?? []\n )}; provided: \\${options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }}\\`);`}\n </IfStatement>\n }>\n <ElseIfClause\n condition={code`!options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }.every(value => [${(\n option as\n | StringCommandParameter\n | NumberCommandParameter\n ).choices\n ?.map(choice =>\n option.kind === CommandParameterKinds.string\n ? `\"${choice}\"`\n : choice\n )\n .join(\", \")}].includes(value))`}>\n {code`failures.push(\\`Invalid value provided for the \\\\\"${\n option.name\n }\\\\\" option - valid values include: ${list(\n (\n option as\n | StringCommandParameter\n | NumberCommandParameter\n )?.choices?.map(choice => String(choice)) ?? []\n )}; provided: \\${options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }}\\`);`}\n </ElseIfClause>\n </Show>\n }>\n <Show\n when={!option.optional}\n fallback={\n <IfStatement\n condition={code`![${(\n option as\n | StringCommandParameter\n | NumberCommandParameter\n ).choices\n ?.map(choice =>\n option.kind === CommandParameterKinds.string\n ? `\"${choice}\"`\n : choice\n )\n .join(\", \")}].includes(options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n })`}>\n {code`failures.push(\\`Invalid value provided for the \\\\\"${\n option.name\n }\\\\\" option - valid values include: ${list(\n (\n option as\n | StringCommandParameter\n | NumberCommandParameter\n )?.choices?.map(choice => String(choice)) ?? []\n )}; provided: \\${options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }}\\`);`}\n </IfStatement>\n }>\n <ElseIfClause\n condition={code`![${(\n option as StringCommandParameter | NumberCommandParameter\n ).choices\n ?.map(choice =>\n option.kind === CommandParameterKinds.string\n ? `\"${choice}\"`\n : choice\n )\n .join(\", \")}].includes(options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n })`}>\n {code`failures.push(\\`Invalid value provided for the \\\\\"${\n option.name\n }\\\\\" option - valid values include: ${list(\n (\n option as\n | StringCommandParameter\n | NumberCommandParameter\n )?.choices?.map(choice => String(choice)) ?? []\n )}; provided: \\${options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }}\\`);`}\n </ElseIfClause>\n </Show>\n </Show>\n </Show>\n </>\n )}\n </For>\n <Spacing />\n <For each={command.args} doubleHardline>\n {argument => (\n <>\n <Show when={!argument.optional}>\n <IfStatement condition={code`!${camelCase(argument.name)}`}>\n {code`failures.push(\"Missing required \\\\\"${\n argument.name\n }\\\\\" positional argument\");`}\n </IfStatement>\n <Show when={argument.variadic}>\n <ElseIfClause\n condition={code`${camelCase(argument.name)}.length === 0`}>\n {code`failures.push(\"No values were provided to the required \\\\\"${\n argument.name\n }\\\\\" array positional argument\");`}\n </ElseIfClause>\n </Show>\n </Show>\n <Show when={argument.kind === CommandParameterKinds.number}>\n <Show\n when={(argument as NumberCommandParameter).variadic}\n fallback={\n <IfStatement\n condition={code`${camelCase(\n argument.name\n )} && Number.isNaN(${camelCase(argument.name)})`}>\n {code`failures.push(\"Invalid numeric value provided for the \\\\\"${\n argument.name\n }\\\\\" positional argument\");`}\n </IfStatement>\n }>\n <IfStatement\n condition={code`${camelCase(argument.name)}.some(value => Number.isNaN(value))`}>\n {code`failures.push(\"Invalid numeric value provided in the \\\\\"${\n argument.name\n }\\\\\" array positional argument\");`}\n </IfStatement>\n </Show>\n </Show>\n </>\n )}\n </For>\n </>\n );\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"command-validation-logic.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1,265 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../contexts/command.cjs`),t=require(`../helpers/docs-helpers.cjs`),n=require(`../plugin-utils/context-helpers.cjs`),r=require(`../plugin-utils/reflect.cjs`),i=require(`./usage.cjs`);let a=require(`@alloy-js/core/jsx-runtime`),o=require(`defu`),s=require(`@alloy-js/core`),c=require(`@alloy-js/markdown`),l=require(`@powerlines/plugin-alloy/core/components/spacing`),u=require(`@powerlines/plugin-alloy/core/contexts/context`),d=require(`@powerlines/plugin-alloy/markdown/components/markdown-file`),f=require(`@powerlines/plugin-alloy/markdown/components/markdown-table`),p=require(`@stryke/path/join`);const m=[`T`,`Required`,`l+e#!e"!fRb!Pde"!gN##w"y`],h=[`T`,`Partial`,`l+e#!e"!fRb!Pde"!gN#"w"y`];function g(e,t){return e.__type=t,e}const _=[`CommandTree`,`command`,`The command to generate options documentation for.`,`CommandOptionsDocsProps`,`P"w!4"?#Mw$y`];function v(e){let{command:t}=e;return Object.keys(t.options).length===0?s.code`This command does not have any options.`:(0,a.createComponent)(f.MarkdownTable,{get data(){return r.sortOptions(Object.values(t.options)).map(g(e=>({name:e.name.trim(),description:e.description.trim(),defaultValue:e.default?String(e.default)?.includes(`"`)?e.default:`\`${Array.isArray(e.default)?e.default.join(`, `):e.default}\``:``,required:e.optional||e.default?``:`✔`}),[`option`,``,`P"2!"/"`]))}})}v.__type=[()=>_,`props`,`CommandOptionsDocs`,`Generates the options markdown documentation for a command.`,`Pn!2""/#?$`];const y=[`npm`,`yarn`,`pnpm`,`bun`,`packageManager`,`npm`,`The package manager to generate the usage example for.`,`CommandTree`,`command`,`The command to generate the usage example for.`,`CommandDocsUsageExampleProps`,`PP.!.".#.$J4%8>&?'"w(4)?*Mw+y`];function b(e){let{packageManager:t=`npm`,command:r}=e,o=(u.usePowerlines.Ω=[[`Context`,`"w!`]],(0,u.usePowerlines)());return[(0,a.createIntrinsic)(`hbr`,{}),s.code`\`\`\`bash `,(0,a.createIntrinsic)(`hbr`,{}),(0,a.createComponent)(i.Usage,{command:r,get bin(){return n.getAppBin(o)},packageManager:t}),(0,a.createIntrinsic)(`hbr`,{}),s.code`\`\`\``,(0,a.createIntrinsic)(`hbr`,{})]}b.__type=[()=>y,`props`,`CommandDocsUsageExample`,`Generates the markdown documentation for a command.`,`Pn!2""/#?$`];const x=[`levelOffset`,0,`The heading level offset to apply to the generated documentation.`,`CommandTree`,`command`,`The command to generate options documentation for.`,()=>m,()=>y,`packageManager`,`usageExamples`,'`["npm"]`',`Optional usage examples to include in the documentation.`,`CommandDocsProps`,`P'4!8>"?#"w$4%?&n(o'".)fF4*8>+?,Mw-y`];function S(e){let{levelOffset:t=0,command:n,usageExamples:r}=e;return[(0,a.createComponent)(c.Heading,{level:1+t,get children(){return n.title}}),(0,a.createComponent)(l.Spacing,{}),(0,a.memo)(()=>s.code`${n.description}`),(0,a.createComponent)(l.Spacing,{}),(0,a.createComponent)(c.Heading,{level:2+t,children:`Usage`}),(0,a.createComponent)(l.Spacing,{}),(0,a.memo)(()=>s.code`The ${n.name} command can be executed using the following syntax: `),(0,a.createComponent)(l.Spacing,{}),(0,a.createComponent)(s.Show,{get when(){return r&&r.length>0},get fallback(){return(0,a.createComponent)(b,{packageManager:`npm`,command:n})},get children(){return(0,a.createComponent)(s.For,{each:r,hardline:!0,get children(){return g(e=>(0,a.createComponent)(b,{packageManager:e,command:n}),[`packageManager`,``,`P"2!"/"`])}})}}),(0,a.createComponent)(l.Spacing,{}),(0,a.createComponent)(c.Heading,{level:2+t,children:`Options`}),(0,a.createComponent)(l.Spacing,{}),(0,a.memo)(()=>s.code`The following options are available for the ${n.name} command:`),(0,a.createComponent)(l.Spacing,{}),(0,a.createComponent)(v,{command:n}),(0,a.createComponent)(l.Spacing,{})]}S.__type=[()=>x,`props`,`CommandDocs`,`Generates the markdown documentation for a command.`,`Pn!2""/#?$`];const C=[()=>h,`levelOffset`,0,`The heading level offset to apply to the generated documentation.`,`CommandTree`,`command`,`The command to generate documentation for.`,`CommandDocsFileProps`,`P!o!"'4"8>#?$"w%4&?'Mw(y`];function w(n){let{levelOffset:r=0,command:i,frontMatter:c,...l}=n,f=(u.usePowerlines.Ω=[[`Context`,`"w!`]],(0,u.usePowerlines)()),m=(0,s.memo)(()=>[`npm`,`yarn`,`pnpm`,`bun`]);return(0,a.createComponent)(e.CommandContext.Provider,{value:i,get children(){return(0,a.createComponent)(d.MarkdownFile,(0,a.mergeProps)({get path(){return(0,p.joinPaths)(t.getDocsOutputPath(f),`${i.path}.md`)}},l,{get frontMatter(){return(0,o.defu)(c??{},{id:i.id,name:i.name,path:i.path,reference:i.reference,isVirtual:i.isVirtual,title:i.title,description:i.description,tags:i.tags})},get children(){return(0,a.createComponent)(S,{levelOffset:r,command:i,get usageExamples(){return m()}})}}))}})}w.__type=[()=>C,`props`,`CommandDocsFile`,`Generates the markdown documentation file for a command.`,`Pn!2""/#?$`],exports.CommandDocs=S,exports.CommandDocsFile=w,exports.CommandDocsUsageExample=b,exports.CommandOptionsDocs=v,exports.__ΩCommandDocsFileProps=C,exports.__ΩCommandDocsProps=x,exports.__ΩCommandDocsUsageExampleProps=y,exports.__ΩCommandOptionsDocsProps=_;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_contexts_command = require('../contexts/command.cjs');
3
+ const require_docs_helpers = require('../helpers/docs-helpers.cjs');
4
+ const require_context_helpers = require('../plugin-utils/context-helpers.cjs');
5
+ const require_reflect = require('../plugin-utils/reflect.cjs');
6
+ const require_components_usage = require('./usage.cjs');
7
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
8
+ let _alloy_js_core = require("@alloy-js/core");
9
+ let defu = require("defu");
10
+ let _alloy_js_markdown = require("@alloy-js/markdown");
11
+ let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
12
+ let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
13
+ let _powerlines_plugin_alloy_markdown_components_markdown_file = require("@powerlines/plugin-alloy/markdown/components/markdown-file");
14
+ let _powerlines_plugin_alloy_markdown_components_markdown_table = require("@powerlines/plugin-alloy/markdown/components/markdown-table");
15
+ let _stryke_path_join = require("@stryke/path/join");
16
+
17
+ //#region src/components/docs.tsx
18
+ const __ΩRequired = [
19
+ "T",
20
+ "Required",
21
+ "l+e#!e\"!fRb!Pde\"!gN##w\"y"
22
+ ];
23
+ const __ΩPartial = [
24
+ "T",
25
+ "Partial",
26
+ "l+e#!e\"!fRb!Pde\"!gN#\"w\"y"
27
+ ];
28
+ function __assignType(fn, args) {
29
+ fn.__type = args;
30
+ return fn;
31
+ }
32
+ const __ΩCommandOptionsDocsProps = [
33
+ "CommandTree",
34
+ "command",
35
+ "The command to generate options documentation for.",
36
+ "CommandOptionsDocsProps",
37
+ "P\"w!4\"?#Mw$y"
38
+ ];
39
+ /**
40
+ * Generates the options markdown documentation for a command.
41
+ */
42
+ function CommandOptionsDocs(props) {
43
+ const { command } = props;
44
+ if (Object.keys(command.options).length === 0) return _alloy_js_core.code`This command does not have any options.`;
45
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_markdown_components_markdown_table.MarkdownTable, { get data() {
46
+ return require_reflect.sortOptions(Object.values(command.options)).map(__assignType((option) => {
47
+ return {
48
+ name: option.name.trim(),
49
+ description: option.description.trim(),
50
+ defaultValue: option.default ? String(option.default)?.includes("\"") ? option.default : `\`${Array.isArray(option.default) ? option.default.join(", ") : option.default}\`` : "",
51
+ required: !option.required || option.default ? "" : "✔"
52
+ };
53
+ }, [
54
+ "option",
55
+ "",
56
+ "P\"2!\"/\""
57
+ ]));
58
+ } });
59
+ }
60
+ CommandOptionsDocs.__type = [
61
+ () => __ΩCommandOptionsDocsProps,
62
+ "props",
63
+ "CommandOptionsDocs",
64
+ "Generates the options markdown documentation for a command.",
65
+ "Pn!2\"\"/#?$"
66
+ ];
67
+ const __ΩCommandDocsUsageExampleProps = [
68
+ "npm",
69
+ "yarn",
70
+ "pnpm",
71
+ "bun",
72
+ "packageManager",
73
+ "npm",
74
+ "The package manager to generate the usage example for.",
75
+ "CommandTree",
76
+ "command",
77
+ "The command to generate the usage example for.",
78
+ "CommandDocsUsageExampleProps",
79
+ "PP.!.\".#.$J4%8>&?'\"w(4)?*Mw+y"
80
+ ];
81
+ /**
82
+ * Generates the markdown documentation for a command.
83
+ */
84
+ function CommandDocsUsageExample(props) {
85
+ const { packageManager = "npm", command } = props;
86
+ const context = (_powerlines_plugin_alloy_core_contexts_context.usePowerlines.Ω = [["Context", "\"w!"]], (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)());
87
+ return [
88
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
89
+ _alloy_js_core.code`\`\`\`bash `,
90
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
91
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_usage.Usage, {
92
+ command,
93
+ get bin() {
94
+ return require_context_helpers.getAppBin(context);
95
+ },
96
+ packageManager
97
+ }),
98
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
99
+ _alloy_js_core.code`\`\`\``,
100
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
101
+ ];
102
+ }
103
+ CommandDocsUsageExample.__type = [
104
+ () => __ΩCommandDocsUsageExampleProps,
105
+ "props",
106
+ "CommandDocsUsageExample",
107
+ "Generates the markdown documentation for a command.",
108
+ "Pn!2\"\"/#?$"
109
+ ];
110
+ const __ΩCommandDocsProps = [
111
+ "levelOffset",
112
+ 0,
113
+ "The heading level offset to apply to the generated documentation.",
114
+ "CommandTree",
115
+ "command",
116
+ "The command to generate options documentation for.",
117
+ () => __ΩRequired,
118
+ () => __ΩCommandDocsUsageExampleProps,
119
+ "packageManager",
120
+ "usageExamples",
121
+ "`[\"npm\"]`",
122
+ "Optional usage examples to include in the documentation.",
123
+ "CommandDocsProps",
124
+ "P'4!8>\"?#\"w$4%?&n(o'\".)fF4*8>+?,Mw-y"
125
+ ];
126
+ /**
127
+ * Generates the markdown documentation for a command.
128
+ */
129
+ function CommandDocs(props) {
130
+ const { levelOffset = 0, command, usageExamples } = props;
131
+ return [
132
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Heading, {
133
+ level: 1 + levelOffset,
134
+ get children() {
135
+ return command.title;
136
+ }
137
+ }),
138
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
139
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`${command.description}`),
140
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
141
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Heading, {
142
+ level: 2 + levelOffset,
143
+ children: "Usage"
144
+ }),
145
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
146
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`The ${command.name} command can be executed using the following syntax: `),
147
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
148
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
149
+ get when() {
150
+ return usageExamples && usageExamples.length > 0;
151
+ },
152
+ get fallback() {
153
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(CommandDocsUsageExample, {
154
+ packageManager: "npm",
155
+ command
156
+ });
157
+ },
158
+ get children() {
159
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
160
+ each: usageExamples,
161
+ hardline: true,
162
+ get children() {
163
+ return __assignType((packageManager) => (0, _alloy_js_core_jsx_runtime.createComponent)(CommandDocsUsageExample, {
164
+ packageManager,
165
+ command
166
+ }), [
167
+ "packageManager",
168
+ "",
169
+ "P\"2!\"/\""
170
+ ]);
171
+ }
172
+ });
173
+ }
174
+ }),
175
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
176
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Heading, {
177
+ level: 2 + levelOffset,
178
+ children: "Options"
179
+ }),
180
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
181
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`The following options are available for the ${command.name} command:`),
182
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
183
+ (0, _alloy_js_core_jsx_runtime.createComponent)(CommandOptionsDocs, { command }),
184
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
185
+ ];
186
+ }
187
+ CommandDocs.__type = [
188
+ () => __ΩCommandDocsProps,
189
+ "props",
190
+ "CommandDocs",
191
+ "Generates the markdown documentation for a command.",
192
+ "Pn!2\"\"/#?$"
193
+ ];
194
+ const __ΩCommandDocsFileProps = [
195
+ () => __ΩPartial,
196
+ "levelOffset",
197
+ 0,
198
+ "The heading level offset to apply to the generated documentation.",
199
+ "CommandTree",
200
+ "command",
201
+ "The command to generate documentation for.",
202
+ "CommandDocsFileProps",
203
+ "P!o!\"'4\"8>#?$\"w%4&?'Mw(y"
204
+ ];
205
+ /**
206
+ * Generates the markdown documentation file for a command.
207
+ */
208
+ function CommandDocsFile(props) {
209
+ const { levelOffset = 0, command, frontMatter, ...rest } = props;
210
+ const context = (_powerlines_plugin_alloy_core_contexts_context.usePowerlines.Ω = [["Context", "\"w!"]], (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)());
211
+ const usageExamples = (0, _alloy_js_core.memo)(() => [
212
+ "npm",
213
+ "yarn",
214
+ "pnpm",
215
+ "bun"
216
+ ]);
217
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_contexts_command.CommandContext.Provider, {
218
+ value: command,
219
+ get children() {
220
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_markdown_components_markdown_file.MarkdownFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({ get path() {
221
+ return (0, _stryke_path_join.joinPaths)(require_docs_helpers.getDocsOutputPath(context), `${command.path}.md`);
222
+ } }, rest, {
223
+ get frontMatter() {
224
+ return (0, defu.defu)(frontMatter ?? {}, {
225
+ id: command.id,
226
+ name: command.name,
227
+ path: command.path,
228
+ reference: command.docs,
229
+ virtual: command.virtual,
230
+ title: command.title,
231
+ description: command.description,
232
+ tags: command.tags
233
+ });
234
+ },
235
+ get children() {
236
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(CommandDocs, {
237
+ levelOffset,
238
+ command,
239
+ get usageExamples() {
240
+ return usageExamples();
241
+ }
242
+ });
243
+ }
244
+ }));
245
+ }
246
+ });
247
+ }
248
+ CommandDocsFile.__type = [
249
+ () => __ΩCommandDocsFileProps,
250
+ "props",
251
+ "CommandDocsFile",
252
+ "Generates the markdown documentation file for a command.",
253
+ "Pn!2\"\"/#?$"
254
+ ];
255
+
256
+ //#endregion
257
+ exports.CommandDocs = CommandDocs;
258
+ exports.CommandDocsFile = CommandDocsFile;
259
+ exports.CommandDocsUsageExample = CommandDocsUsageExample;
260
+ exports.CommandOptionsDocs = CommandOptionsDocs;
261
+ exports.__ΩCommandDocsFileProps = __ΩCommandDocsFileProps;
262
+ exports.__ΩCommandDocsProps = __ΩCommandDocsProps;
263
+ exports.__ΩCommandDocsUsageExampleProps = __ΩCommandDocsUsageExampleProps;
264
+ exports.__ΩCommandOptionsDocsProps = __ΩCommandOptionsDocsProps;
265
+ //# sourceMappingURL=docs.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.cjs","names":[],"sources":[],"mappings":""}