@shell-shock/core 0.17.21 → 0.17.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. package/README.md +16 -7
  2. package/dist/api.cjs +4 -5
  3. package/dist/api.d.cts +1 -1
  4. package/dist/api.d.mts +1 -1
  5. package/dist/api.mjs +2 -2
  6. package/dist/command-B6KYexlV.d.mts +308 -0
  7. package/dist/command-B6KYexlV.d.mts.map +1 -0
  8. package/dist/command-CtfR7hKM.d.cts +308 -0
  9. package/dist/command-CtfR7hKM.d.cts.map +1 -0
  10. package/dist/components/command-validation-logic.cjs +153 -216
  11. package/dist/components/command-validation-logic.d.cts +2 -1
  12. package/dist/components/command-validation-logic.d.cts.map +1 -1
  13. package/dist/components/command-validation-logic.d.mts +2 -1
  14. package/dist/components/command-validation-logic.mjs +153 -214
  15. package/dist/components/docs.cjs +6 -364
  16. package/dist/components/docs.d.cts +2 -3
  17. package/dist/components/docs.d.cts.map +1 -1
  18. package/dist/components/docs.d.mts +2 -3
  19. package/dist/components/docs.mjs +2 -356
  20. package/dist/components/exec-builtin.cjs +63 -100
  21. package/dist/components/exec-builtin.d.cts +1 -2
  22. package/dist/components/exec-builtin.d.cts.map +1 -1
  23. package/dist/components/exec-builtin.d.mts +1 -2
  24. package/dist/components/exec-builtin.mjs +7 -41
  25. package/dist/components/helpers.cjs +2 -52
  26. package/dist/components/helpers.d.cts +2 -1
  27. package/dist/components/helpers.d.cts.map +1 -1
  28. package/dist/components/helpers.d.mts +2 -1
  29. package/dist/components/helpers.mjs +2 -50
  30. package/dist/components/index.cjs +7 -23
  31. package/dist/components/index.mjs +9 -9
  32. package/dist/components/options-parser-logic.cjs +198 -420
  33. package/dist/components/options-parser-logic.d.cts +2 -5
  34. package/dist/components/options-parser-logic.d.cts.map +1 -1
  35. package/dist/components/options-parser-logic.d.mts +2 -5
  36. package/dist/components/options-parser-logic.mjs +192 -407
  37. package/dist/components/state-builtin.cjs +106 -164
  38. package/dist/components/state-builtin.d.cts +1 -2
  39. package/dist/components/state-builtin.d.cts.map +1 -1
  40. package/dist/components/state-builtin.d.mts +1 -2
  41. package/dist/components/state-builtin.mjs +12 -68
  42. package/dist/components/usage.cjs +4 -48
  43. package/dist/components/usage.d.cts +1 -2
  44. package/dist/components/usage.d.cts.map +1 -1
  45. package/dist/components/usage.d.mts +1 -2
  46. package/dist/components/usage.mjs +4 -46
  47. package/dist/components/utils-builtin.cjs +77 -144
  48. package/dist/components/utils-builtin.d.cts +1 -2
  49. package/dist/components/utils-builtin.d.cts.map +1 -1
  50. package/dist/components/utils-builtin.d.mts +1 -2
  51. package/dist/components/utils-builtin.mjs +9 -74
  52. package/dist/config-BIF9mEz0.d.cts +157 -0
  53. package/dist/config-BIF9mEz0.d.cts.map +1 -0
  54. package/dist/config-CnNYdfsL.d.mts +157 -0
  55. package/dist/config-CnNYdfsL.d.mts.map +1 -0
  56. package/dist/config.cjs +24 -58
  57. package/dist/config.d.cts +1 -2
  58. package/dist/config.d.cts.map +1 -1
  59. package/dist/config.d.mts +1 -2
  60. package/dist/config.mjs +23 -55
  61. package/dist/{plugin-utils/context-helpers.mjs → context-helpers-D3EJxwbq.mjs} +5 -83
  62. package/dist/context-helpers-D3EJxwbq.mjs.map +1 -0
  63. package/dist/{plugin-utils/context-helpers.cjs → context-helpers-_wUuFRB8.cjs} +63 -92
  64. package/dist/contexts/command.cjs +3 -9
  65. package/dist/contexts/command.d.cts +1 -2
  66. package/dist/contexts/command.d.cts.map +1 -1
  67. package/dist/contexts/command.d.mts +1 -2
  68. package/dist/contexts/command.mjs +2 -7
  69. package/dist/contexts/index.cjs +19 -1
  70. package/dist/contexts/index.d.cts +2 -1
  71. package/dist/contexts/index.d.mts +2 -1
  72. package/dist/contexts/index.mjs +2 -1
  73. package/dist/contexts/options.cjs +7 -30
  74. package/dist/contexts/options.d.cts +1 -2
  75. package/dist/contexts/options.d.cts.map +1 -1
  76. package/dist/contexts/options.d.mts +1 -2
  77. package/dist/contexts/options.mjs +7 -27
  78. package/dist/contexts/power-plant.cjs +19 -0
  79. package/dist/contexts/power-plant.d.cts +2 -0
  80. package/dist/contexts/power-plant.d.mts +2 -0
  81. package/dist/contexts/power-plant.mjs +5 -0
  82. package/dist/docs-C6ZvsVMu.cjs +278 -0
  83. package/dist/docs-CGQ2HtEY.mjs +249 -0
  84. package/dist/docs-CGQ2HtEY.mjs.map +1 -0
  85. package/dist/engine.cjs +5 -39
  86. package/dist/engine.d.cts +1 -2
  87. package/dist/engine.d.cts.map +1 -1
  88. package/dist/engine.d.mts +1 -2
  89. package/dist/engine.mjs +4 -37
  90. package/dist/generator.cjs +68 -0
  91. package/dist/generator.d.cts +15 -0
  92. package/dist/generator.d.cts.map +1 -0
  93. package/dist/generator.d.mts +15 -0
  94. package/dist/generator.d.mts.map +1 -0
  95. package/dist/generator.mjs +66 -0
  96. package/dist/generator.mjs.map +1 -0
  97. package/dist/{helpers/get-framework.cjs → get-framework-CxZc2krd.cjs} +7 -8
  98. package/dist/{helpers/get-framework.mjs → get-framework-Dlqz2hVZ.mjs} +3 -8
  99. package/dist/get-framework-Dlqz2hVZ.mjs.map +1 -0
  100. package/dist/helpers/power-plant.cjs +102 -0
  101. package/dist/helpers/power-plant.d.cts +61 -0
  102. package/dist/helpers/power-plant.d.cts.map +1 -0
  103. package/dist/helpers/power-plant.d.mts +61 -0
  104. package/dist/helpers/power-plant.d.mts.map +1 -0
  105. package/dist/helpers/power-plant.mjs +99 -0
  106. package/dist/helpers/power-plant.mjs.map +1 -0
  107. package/dist/index-D4klH_pj.d.mts +2 -0
  108. package/dist/index-DYOBadKY.d.cts +2 -0
  109. package/dist/index.cjs +1 -37
  110. package/dist/index.d.cts +4 -6
  111. package/dist/index.d.cts.map +1 -1
  112. package/dist/index.d.mts +4 -6
  113. package/dist/index.mjs +0 -35
  114. package/dist/package-B7Vu265G.mjs +6 -0
  115. package/dist/package-B7Vu265G.mjs.map +1 -0
  116. package/dist/{package.cjs → package-BLC4qc8t.cjs} +2 -4
  117. package/dist/plugin-B-hM2twc.mjs +1458 -0
  118. package/dist/plugin-B-hM2twc.mjs.map +1 -0
  119. package/dist/plugin-Bhfq0DMC.cjs +1490 -0
  120. package/dist/plugin-utils/index.cjs +359 -26
  121. package/dist/plugin-utils/index.d.cts +273 -9
  122. package/dist/plugin-utils/index.d.cts.map +1 -0
  123. package/dist/plugin-utils/index.d.mts +273 -9
  124. package/dist/plugin-utils/index.d.mts.map +1 -0
  125. package/dist/plugin-utils/index.mjs +346 -10
  126. package/dist/plugin-utils/index.mjs.map +1 -0
  127. package/dist/plugin.cjs +3 -496
  128. package/dist/plugin.d.cts +1 -3
  129. package/dist/plugin.d.cts.map +1 -1
  130. package/dist/plugin.d.mts +1 -3
  131. package/dist/plugin.mjs +2 -491
  132. package/dist/power-plant-LgxcvlMN.d.cts +4 -0
  133. package/dist/power-plant-LgxcvlMN.d.mts +4 -0
  134. package/dist/reflect-CSiffeL9.cjs +27 -0
  135. package/dist/reflect-DXKSFgvS.mjs +23 -0
  136. package/dist/reflect-DXKSFgvS.mjs.map +1 -0
  137. package/dist/schemas/env.cjs +91 -0
  138. package/dist/schemas/env.d.cts +145 -0
  139. package/dist/schemas/env.d.cts.map +1 -0
  140. package/dist/schemas/env.d.mts +145 -0
  141. package/dist/{types → schemas}/env.d.mts.map +1 -1
  142. package/dist/schemas/env.mjs +91 -0
  143. package/dist/schemas/index.cjs +4 -0
  144. package/dist/schemas/index.d.cts +2 -0
  145. package/dist/schemas/index.d.mts +2 -0
  146. package/dist/schemas/index.mjs +3 -0
  147. package/dist/types/command.cjs +0 -402
  148. package/dist/types/command.d.cts +2 -309
  149. package/dist/types/command.d.mts +2 -309
  150. package/dist/types/command.mjs +1 -368
  151. package/dist/types/config.cjs +0 -175
  152. package/dist/types/config.d.cts +2 -126
  153. package/dist/types/config.d.mts +2 -126
  154. package/dist/types/config.mjs +1 -164
  155. package/dist/types/context.cjs +0 -45
  156. package/dist/types/context.d.cts +2 -31
  157. package/dist/types/context.d.mts +2 -31
  158. package/dist/types/context.mjs +1 -41
  159. package/dist/types/index.cjs +3 -53
  160. package/dist/types/index.d.cts +4 -5
  161. package/dist/types/index.d.mts +4 -5
  162. package/dist/types/index.mjs +4 -5
  163. package/package.json +106 -42
  164. package/dist/_virtual/_rolldown/runtime.cjs +0 -29
  165. package/dist/api.cjs.map +0 -1
  166. package/dist/components/command-validation-logic.cjs.map +0 -1
  167. package/dist/components/docs.cjs.map +0 -1
  168. package/dist/components/docs.mjs.map +0 -1
  169. package/dist/components/exec-builtin.cjs.map +0 -1
  170. package/dist/components/helpers.cjs.map +0 -1
  171. package/dist/components/options-parser-logic.cjs.map +0 -1
  172. package/dist/components/state-builtin.cjs.map +0 -1
  173. package/dist/components/usage.cjs.map +0 -1
  174. package/dist/components/utils-builtin.cjs.map +0 -1
  175. package/dist/config.cjs.map +0 -1
  176. package/dist/contexts/command.cjs.map +0 -1
  177. package/dist/contexts/options.cjs.map +0 -1
  178. package/dist/engine.cjs.map +0 -1
  179. package/dist/helpers/automd.cjs +0 -193
  180. package/dist/helpers/automd.cjs.map +0 -1
  181. package/dist/helpers/automd.mjs +0 -190
  182. package/dist/helpers/automd.mjs.map +0 -1
  183. package/dist/helpers/docs-helpers.cjs +0 -24
  184. package/dist/helpers/docs-helpers.cjs.map +0 -1
  185. package/dist/helpers/docs-helpers.mjs +0 -24
  186. package/dist/helpers/docs-helpers.mjs.map +0 -1
  187. package/dist/helpers/get-framework.cjs.map +0 -1
  188. package/dist/helpers/get-framework.mjs.map +0 -1
  189. package/dist/helpers/paths.cjs +0 -137
  190. package/dist/helpers/paths.cjs.map +0 -1
  191. package/dist/helpers/paths.mjs +0 -134
  192. package/dist/helpers/paths.mjs.map +0 -1
  193. package/dist/helpers/persistence.cjs +0 -114
  194. package/dist/helpers/persistence.cjs.map +0 -1
  195. package/dist/helpers/persistence.mjs +0 -113
  196. package/dist/helpers/persistence.mjs.map +0 -1
  197. package/dist/helpers/update-package-json.cjs +0 -65
  198. package/dist/helpers/update-package-json.cjs.map +0 -1
  199. package/dist/helpers/update-package-json.mjs +0 -64
  200. package/dist/helpers/update-package-json.mjs.map +0 -1
  201. package/dist/helpers/utilities.cjs +0 -95
  202. package/dist/helpers/utilities.cjs.map +0 -1
  203. package/dist/helpers/utilities.mjs +0 -94
  204. package/dist/helpers/utilities.mjs.map +0 -1
  205. package/dist/helpers/validations.cjs +0 -71
  206. package/dist/helpers/validations.cjs.map +0 -1
  207. package/dist/helpers/validations.mjs +0 -70
  208. package/dist/helpers/validations.mjs.map +0 -1
  209. package/dist/index.cjs.map +0 -1
  210. package/dist/package.cjs.map +0 -1
  211. package/dist/package.mjs +0 -6
  212. package/dist/package.mjs.map +0 -1
  213. package/dist/plugin-utils/compute-bin.cjs +0 -49
  214. package/dist/plugin-utils/compute-bin.cjs.map +0 -1
  215. package/dist/plugin-utils/compute-bin.d.cts +0 -13
  216. package/dist/plugin-utils/compute-bin.d.cts.map +0 -1
  217. package/dist/plugin-utils/compute-bin.d.mts +0 -13
  218. package/dist/plugin-utils/compute-bin.d.mts.map +0 -1
  219. package/dist/plugin-utils/compute-bin.mjs +0 -49
  220. package/dist/plugin-utils/compute-bin.mjs.map +0 -1
  221. package/dist/plugin-utils/context-helpers.cjs.map +0 -1
  222. package/dist/plugin-utils/context-helpers.d.cts +0 -106
  223. package/dist/plugin-utils/context-helpers.d.cts.map +0 -1
  224. package/dist/plugin-utils/context-helpers.d.mts +0 -106
  225. package/dist/plugin-utils/context-helpers.d.mts.map +0 -1
  226. package/dist/plugin-utils/context-helpers.mjs.map +0 -1
  227. package/dist/plugin-utils/deepkit.cjs +0 -70
  228. package/dist/plugin-utils/deepkit.cjs.map +0 -1
  229. package/dist/plugin-utils/deepkit.d.cts +0 -23
  230. package/dist/plugin-utils/deepkit.d.cts.map +0 -1
  231. package/dist/plugin-utils/deepkit.d.mts +0 -23
  232. package/dist/plugin-utils/deepkit.d.mts.map +0 -1
  233. package/dist/plugin-utils/deepkit.mjs +0 -69
  234. package/dist/plugin-utils/deepkit.mjs.map +0 -1
  235. package/dist/plugin-utils/description-helpers.cjs +0 -112
  236. package/dist/plugin-utils/description-helpers.cjs.map +0 -1
  237. package/dist/plugin-utils/description-helpers.d.cts +0 -44
  238. package/dist/plugin-utils/description-helpers.d.cts.map +0 -1
  239. package/dist/plugin-utils/description-helpers.d.mts +0 -44
  240. package/dist/plugin-utils/description-helpers.d.mts.map +0 -1
  241. package/dist/plugin-utils/description-helpers.mjs +0 -108
  242. package/dist/plugin-utils/description-helpers.mjs.map +0 -1
  243. package/dist/plugin-utils/get-command-tree.cjs +0 -118
  244. package/dist/plugin-utils/get-command-tree.cjs.map +0 -1
  245. package/dist/plugin-utils/get-command-tree.d.cts +0 -36
  246. package/dist/plugin-utils/get-command-tree.d.cts.map +0 -1
  247. package/dist/plugin-utils/get-command-tree.d.mts +0 -36
  248. package/dist/plugin-utils/get-command-tree.d.mts.map +0 -1
  249. package/dist/plugin-utils/get-command-tree.mjs +0 -115
  250. package/dist/plugin-utils/get-command-tree.mjs.map +0 -1
  251. package/dist/plugin-utils/reflect.cjs +0 -54
  252. package/dist/plugin-utils/reflect.cjs.map +0 -1
  253. package/dist/plugin-utils/reflect.d.cts +0 -14
  254. package/dist/plugin-utils/reflect.d.cts.map +0 -1
  255. package/dist/plugin-utils/reflect.d.mts +0 -14
  256. package/dist/plugin-utils/reflect.d.mts.map +0 -1
  257. package/dist/plugin-utils/reflect.mjs +0 -53
  258. package/dist/plugin-utils/reflect.mjs.map +0 -1
  259. package/dist/plugin-utils/traverse-command-tree.cjs +0 -65
  260. package/dist/plugin-utils/traverse-command-tree.cjs.map +0 -1
  261. package/dist/plugin-utils/traverse-command-tree.d.cts +0 -22
  262. package/dist/plugin-utils/traverse-command-tree.d.cts.map +0 -1
  263. package/dist/plugin-utils/traverse-command-tree.d.mts +0 -22
  264. package/dist/plugin-utils/traverse-command-tree.d.mts.map +0 -1
  265. package/dist/plugin-utils/traverse-command-tree.mjs +0 -63
  266. package/dist/plugin-utils/traverse-command-tree.mjs.map +0 -1
  267. package/dist/plugin-utils/type-checks.cjs +0 -222
  268. package/dist/plugin-utils/type-checks.cjs.map +0 -1
  269. package/dist/plugin-utils/type-checks.d.cts +0 -41
  270. package/dist/plugin-utils/type-checks.d.cts.map +0 -1
  271. package/dist/plugin-utils/type-checks.d.mts +0 -41
  272. package/dist/plugin-utils/type-checks.d.mts.map +0 -1
  273. package/dist/plugin-utils/type-checks.mjs +0 -218
  274. package/dist/plugin-utils/type-checks.mjs.map +0 -1
  275. package/dist/plugin.cjs.map +0 -1
  276. package/dist/plugin.mjs.map +0 -1
  277. package/dist/resolver/deepkit.cjs +0 -110
  278. package/dist/resolver/deepkit.cjs.map +0 -1
  279. package/dist/resolver/deepkit.mjs +0 -109
  280. package/dist/resolver/deepkit.mjs.map +0 -1
  281. package/dist/resolver/helpers.cjs +0 -184
  282. package/dist/resolver/helpers.cjs.map +0 -1
  283. package/dist/resolver/helpers.mjs +0 -180
  284. package/dist/resolver/helpers.mjs.map +0 -1
  285. package/dist/resolver/resolve.cjs +0 -473
  286. package/dist/resolver/resolve.cjs.map +0 -1
  287. package/dist/resolver/resolve.mjs +0 -473
  288. package/dist/resolver/resolve.mjs.map +0 -1
  289. package/dist/types/command.cjs.map +0 -1
  290. package/dist/types/command.d.cts.map +0 -1
  291. package/dist/types/command.d.mts.map +0 -1
  292. package/dist/types/command.mjs.map +0 -1
  293. package/dist/types/config.cjs.map +0 -1
  294. package/dist/types/config.d.cts.map +0 -1
  295. package/dist/types/config.d.mts.map +0 -1
  296. package/dist/types/config.mjs.map +0 -1
  297. package/dist/types/context.cjs.map +0 -1
  298. package/dist/types/context.d.cts.map +0 -1
  299. package/dist/types/context.d.mts.map +0 -1
  300. package/dist/types/context.mjs.map +0 -1
  301. package/dist/types/env.cjs +0 -53
  302. package/dist/types/env.cjs.map +0 -1
  303. package/dist/types/env.d.cts +0 -71
  304. package/dist/types/env.d.cts.map +0 -1
  305. package/dist/types/env.d.mts +0 -71
  306. package/dist/types/env.mjs +0 -51
  307. /package/dist/{types → schemas}/env.mjs.map +0 -0
@@ -1,357 +1,3 @@
1
- import { CommandContext } from "../contexts/command.mjs";
2
- import { getDocsOutputPath } from "../helpers/docs-helpers.mjs";
3
- import { getAppBin } from "../plugin-utils/context-helpers.mjs";
4
- import { sortOptions } from "../plugin-utils/reflect.mjs";
5
- import { Usage } from "./usage.mjs";
6
- import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
7
- import { For, Show, code, memo as memo$1 } from "@alloy-js/core";
8
- import { defu } from "defu";
9
- import { Heading } from "@alloy-js/markdown";
10
- import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
11
- import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
12
- import { MarkdownFile } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
13
- import { MarkdownTable } from "@powerlines/plugin-alloy/markdown/components/markdown-table";
14
- import { joinPaths } from "@stryke/path/join";
15
- import { list } from "@stryke/string-format/list";
16
- import { isUndefined } from "@stryke/type-checks/is-undefined";
1
+ import { a as CommandOptionsDocs, i as CommandDocsUsageExample, n as CommandDocs, r as CommandDocsFile, t as CommandArgumentDocs } from "../docs-CGQ2HtEY.mjs";
17
2
 
18
- //#region src/components/docs.tsx
19
- const __ΩRequired = [
20
- "T",
21
- "Required",
22
- "l+e#!e\"!fRb!Pde\"!gN##w\"y"
23
- ];
24
- const __ΩPartial = [
25
- "T",
26
- "Partial",
27
- "l+e#!e\"!fRb!Pde\"!gN#\"w\"y"
28
- ];
29
- function __assignType(fn, args) {
30
- fn.__type = args;
31
- return fn;
32
- }
33
- const __ΩCommandParametersDocsProps = [
34
- "CommandTree",
35
- "command",
36
- "The command to generate options documentation for.",
37
- "CommandParametersDocsProps",
38
- "P\"w!4\"?#Mw$y"
39
- ];
40
- /**
41
- * Generates the arguments markdown documentation for a command.
42
- */
43
- function CommandArgumentDocs(props) {
44
- const { command } = props;
45
- if (Object.keys(command.options).length === 0) return code`This command does not have any arguments.`;
46
- return createComponent(MarkdownTable, { get data() {
47
- return sortOptions(Object.values(command.options)).reduce(__assignType((ret, option) => {
48
- ret.push({
49
- name: option.name.trim(),
50
- description: option.description.trim(),
51
- defaultValue: isUndefined(option.default) ? "" : JSON.stringify(option.default),
52
- required: !option.required || option.default ? "" : "✔"
53
- });
54
- return ret;
55
- }, [
56
- "ret",
57
- "option",
58
- "",
59
- "P\"2!\"2\"\"/#"
60
- ]), []);
61
- } });
62
- }
63
- CommandArgumentDocs.__type = [
64
- () => __ΩCommandParametersDocsProps,
65
- "props",
66
- "CommandArgumentDocs",
67
- "Generates the arguments markdown documentation for a command.",
68
- "Pn!2\"\"/#?$"
69
- ];
70
- /**
71
- * Generates the options markdown documentation for a command.
72
- */
73
- function CommandOptionsDocs(props) {
74
- const { command } = props;
75
- if (Object.keys(command.options).length === 0) return code`This command does not have any options.`;
76
- return createComponent(MarkdownTable, { get data() {
77
- return sortOptions(Object.values(command.options)).reduce(__assignType((ret, option) => {
78
- ret.push({
79
- name: option.name.trim(),
80
- description: option.description.trim(),
81
- defaultValue: isUndefined(option.default) ? "" : JSON.stringify(option.default),
82
- required: !option.required || option.default ? "" : "✔"
83
- });
84
- return ret;
85
- }, [
86
- "ret",
87
- "option",
88
- "",
89
- "P\"2!\"2\"\"/#"
90
- ]), []);
91
- } });
92
- }
93
- CommandOptionsDocs.__type = [
94
- () => __ΩCommandParametersDocsProps,
95
- "props",
96
- "CommandOptionsDocs",
97
- "Generates the options markdown documentation for a command.",
98
- "Pn!2\"\"/#?$"
99
- ];
100
- const __ΩCommandDocsUsageExampleProps = [
101
- "npm",
102
- "yarn",
103
- "pnpm",
104
- "bun",
105
- "packageManager",
106
- "npm",
107
- "The package manager to generate the usage example for.",
108
- "CommandTree",
109
- "command",
110
- "The command to generate the usage example for.",
111
- "expand",
112
- true,
113
- "Whether to add expand/collapse details tags around the usage example. This is useful for hiding long usage examples by default.",
114
- "CommandDocsUsageExampleProps",
115
- "PP.!.\".#.$J4%8>&?'\"w(4)?*)4+8>,?-Mw.y"
116
- ];
117
- /**
118
- * Generates the markdown documentation for a command.
119
- */
120
- function CommandDocsUsageExample(props) {
121
- const { packageManager = "npm", command, expand = false } = props;
122
- const context = (usePowerlines.Ω = [["Context", "\"w!"]], usePowerlines());
123
- return [
124
- createComponent(Show, {
125
- when: expand,
126
- fallback: code`\`\`\`sh `,
127
- get children() {
128
- return [
129
- code`<details>
130
- <summary>Using ${packageManager}:</summary>`,
131
- createComponent(Spacing, {}),
132
- code`\`\`\`sh `
133
- ];
134
- }
135
- }),
136
- createIntrinsic("hbr", {}),
137
- createComponent(Usage, {
138
- command,
139
- get bin() {
140
- return getAppBin(context);
141
- },
142
- packageManager
143
- }),
144
- createIntrinsic("hbr", {}),
145
- createComponent(Show, {
146
- when: expand,
147
- fallback: code`\`\`\` `,
148
- get children() {
149
- return [
150
- code`\`\`\``,
151
- createComponent(Spacing, {}),
152
- code`</details>`
153
- ];
154
- }
155
- })
156
- ];
157
- }
158
- CommandDocsUsageExample.__type = [
159
- () => __ΩCommandDocsUsageExampleProps,
160
- "props",
161
- "CommandDocsUsageExample",
162
- "Generates the markdown documentation for a command.",
163
- "Pn!2\"\"/#?$"
164
- ];
165
- const __ΩCommandDocsProps = [
166
- "levelOffset",
167
- 0,
168
- "The heading level offset to apply to the generated documentation.",
169
- "CommandTree",
170
- "command",
171
- "The command to generate options documentation for.",
172
- () => __ΩRequired,
173
- () => __ΩCommandDocsUsageExampleProps,
174
- "packageManager",
175
- "usageExamples",
176
- "`[\"npm\"]`",
177
- "Optional usage examples to include in the documentation.",
178
- "CommandDocsProps",
179
- "P'4!8>\"?#\"w$4%?&n(o'\".)fF4*8>+?,Mw-y"
180
- ];
181
- /**
182
- * Generates the markdown documentation for a command.
183
- */
184
- function CommandDocs(props) {
185
- const { levelOffset = 0, command, usageExamples } = props;
186
- return [
187
- createComponent(Heading, {
188
- level: 1 + levelOffset,
189
- get children() {
190
- return `${command.title}${command.tags.includes("deprecated") ? " (Deprecated)" : command.tags.includes("beta") ? " (Beta)" : command.tags.includes("alpha") ? " (Alpha)" : command.tags.includes("experimental") ? " (Experimental)" : ""}`;
191
- }
192
- }),
193
- createComponent(Spacing, {}),
194
- memo(() => code`${command.description}`),
195
- createComponent(Show, {
196
- get when() {
197
- return command.alias && command.alias.length > 0;
198
- },
199
- get children() {
200
- return [createComponent(Spacing, {}), createComponent(Show, {
201
- get when() {
202
- return command.alias.length > 1;
203
- },
204
- get fallback() {
205
- return code`The \`${command.name}\` command can also be invoked using the alias \`${command.alias[0]}\`.`;
206
- },
207
- get children() {
208
- return code`The \`${command.name}\` command can also be invoked using the following aliases: ${list(command.alias.map(__assignType((alias) => `\`${alias}\``, [
209
- "alias",
210
- "",
211
- "P\"2!\"/\""
212
- ])), { conjunction: "or" })}.`;
213
- }
214
- })];
215
- }
216
- }),
217
- createComponent(Spacing, {}),
218
- createComponent(Heading, {
219
- level: 2 + levelOffset,
220
- children: "Usage"
221
- }),
222
- createComponent(Spacing, {}),
223
- memo(() => code`The \`${command.name}\` command can be executed using the following syntax: `),
224
- createComponent(Spacing, {}),
225
- createComponent(Show, {
226
- get when() {
227
- return usageExamples && usageExamples.length > 0;
228
- },
229
- get fallback() {
230
- return createComponent(CommandDocsUsageExample, {
231
- packageManager: "npm",
232
- command
233
- });
234
- },
235
- get children() {
236
- return createComponent(For, {
237
- each: usageExamples,
238
- doubleHardline: true,
239
- get children() {
240
- return __assignType((packageManager) => createComponent(CommandDocsUsageExample, {
241
- packageManager,
242
- command,
243
- get expand() {
244
- return usageExamples && usageExamples.length > 1;
245
- }
246
- }), [
247
- "packageManager",
248
- "",
249
- "P\"2!\"/\""
250
- ]);
251
- }
252
- });
253
- }
254
- }),
255
- createComponent(Spacing, {}),
256
- createComponent(Show, {
257
- get when() {
258
- return command.args.length > 0;
259
- },
260
- get children() {
261
- return [
262
- createComponent(Spacing, {}),
263
- createComponent(Heading, {
264
- level: 2 + levelOffset,
265
- children: "Positional Arguments"
266
- }),
267
- createComponent(Spacing, {}),
268
- memo(() => code`The following positional arguments are available for the \`${command.name}\` command:`),
269
- createComponent(Spacing, {}),
270
- createComponent(CommandArgumentDocs, { command }),
271
- createComponent(Spacing, {})
272
- ];
273
- }
274
- }),
275
- createComponent(Heading, {
276
- level: 2 + levelOffset,
277
- children: "Options"
278
- }),
279
- createComponent(Spacing, {}),
280
- memo(() => code`The following options are available for the \`${command.name}\` command:`),
281
- createComponent(Spacing, {}),
282
- createComponent(CommandOptionsDocs, { command }),
283
- createComponent(Spacing, {})
284
- ];
285
- }
286
- CommandDocs.__type = [
287
- () => __ΩCommandDocsProps,
288
- "props",
289
- "CommandDocs",
290
- "Generates the markdown documentation for a command.",
291
- "Pn!2\"\"/#?$"
292
- ];
293
- const __ΩCommandDocsFileProps = [
294
- () => __ΩPartial,
295
- "levelOffset",
296
- 0,
297
- "The heading level offset to apply to the generated documentation.",
298
- "CommandTree",
299
- "command",
300
- "The command to generate documentation for.",
301
- "CommandDocsFileProps",
302
- "P!o!\"'4\"8>#?$\"w%4&?'Mw(y"
303
- ];
304
- /**
305
- * Generates the markdown documentation file for a command.
306
- */
307
- function CommandDocsFile(props) {
308
- const { levelOffset = 0, command, frontMatter, ...rest } = props;
309
- const context = (usePowerlines.Ω = [["Context", "\"w!"]], usePowerlines());
310
- const usageExamples = memo$1(() => [
311
- "npm",
312
- "yarn",
313
- "pnpm",
314
- "bun"
315
- ]);
316
- return createComponent(CommandContext.Provider, {
317
- value: command,
318
- get children() {
319
- return createComponent(MarkdownFile, mergeProps({ get path() {
320
- return joinPaths(getDocsOutputPath(context), `${command.path}.md`);
321
- } }, rest, {
322
- get frontMatter() {
323
- return defu(frontMatter ?? {}, {
324
- id: command.id,
325
- name: command.name,
326
- path: command.path,
327
- reference: command.docs,
328
- virtual: command.virtual,
329
- title: command.title,
330
- description: command.description,
331
- tags: command.tags
332
- });
333
- },
334
- get children() {
335
- return createComponent(CommandDocs, {
336
- levelOffset,
337
- command,
338
- get usageExamples() {
339
- return usageExamples();
340
- }
341
- });
342
- }
343
- }));
344
- }
345
- });
346
- }
347
- CommandDocsFile.__type = [
348
- () => __ΩCommandDocsFileProps,
349
- "props",
350
- "CommandDocsFile",
351
- "Generates the markdown documentation file for a command.",
352
- "Pn!2\"\"/#?$"
353
- ];
354
-
355
- //#endregion
356
- export { CommandArgumentDocs, CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs, __ΩCommandDocsFileProps, __ΩCommandDocsProps, __ΩCommandDocsUsageExampleProps, __ΩCommandParametersDocsProps };
357
- //# sourceMappingURL=docs.mjs.map
3
+ export { CommandArgumentDocs, CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs };