@shell-shock/core 0.2.1 → 0.4.0

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 (158) hide show
  1. package/README.md +1 -1
  2. package/dist/api.cjs +15 -3
  3. package/dist/api.cjs.map +1 -0
  4. package/dist/api.d.cts +9 -1
  5. package/dist/api.d.cts.map +1 -0
  6. package/dist/api.d.mts +9 -1
  7. package/dist/api.d.mts.map +1 -0
  8. package/dist/api.mjs +14 -3
  9. package/dist/api.mjs.map +1 -0
  10. package/dist/components/docs.cjs +175 -0
  11. package/dist/components/docs.cjs.map +1 -0
  12. package/dist/components/docs.d.cts +81 -0
  13. package/dist/components/docs.d.cts.map +1 -0
  14. package/dist/components/docs.d.mts +81 -0
  15. package/dist/components/docs.d.mts.map +1 -0
  16. package/dist/components/docs.mjs +171 -0
  17. package/dist/components/docs.mjs.map +1 -0
  18. package/dist/components/index.cjs +5 -6
  19. package/dist/components/index.d.cts +2 -2
  20. package/dist/components/index.d.mts +2 -2
  21. package/dist/components/index.mjs +2 -2
  22. package/dist/config.cjs +2 -1
  23. package/dist/config.cjs.map +1 -0
  24. package/dist/config.d.cts +2 -1
  25. package/dist/config.d.cts.map +1 -0
  26. package/dist/config.d.mts +2 -1
  27. package/dist/config.d.mts.map +1 -0
  28. package/dist/config.mjs +2 -1
  29. package/dist/config.mjs.map +1 -0
  30. package/dist/contexts/command.cjs +21 -0
  31. package/dist/contexts/command.cjs.map +1 -0
  32. package/dist/contexts/command.d.cts +18 -0
  33. package/dist/contexts/command.d.cts.map +1 -0
  34. package/dist/contexts/command.d.mts +18 -0
  35. package/dist/contexts/command.d.mts.map +1 -0
  36. package/dist/contexts/command.mjs +19 -0
  37. package/dist/contexts/command.mjs.map +1 -0
  38. package/dist/contexts/index.cjs +4 -0
  39. package/dist/contexts/index.d.cts +2 -0
  40. package/dist/contexts/index.d.mts +2 -0
  41. package/dist/contexts/index.mjs +3 -0
  42. package/dist/helpers/automd.cjs +59 -0
  43. package/dist/helpers/automd.cjs.map +1 -0
  44. package/dist/helpers/automd.mjs +58 -0
  45. package/dist/helpers/automd.mjs.map +1 -0
  46. package/dist/helpers/docs-helpers.cjs +17 -0
  47. package/dist/helpers/docs-helpers.cjs.map +1 -0
  48. package/dist/helpers/docs-helpers.mjs +16 -0
  49. package/dist/helpers/docs-helpers.mjs.map +1 -0
  50. package/dist/helpers/persistence.cjs +2 -1
  51. package/dist/helpers/persistence.cjs.map +1 -0
  52. package/dist/helpers/persistence.mjs +2 -1
  53. package/dist/helpers/persistence.mjs.map +1 -0
  54. package/dist/helpers/resolve-command.cjs +118 -33
  55. package/dist/helpers/resolve-command.cjs.map +1 -0
  56. package/dist/helpers/resolve-command.mjs +116 -32
  57. package/dist/helpers/resolve-command.mjs.map +1 -0
  58. package/dist/helpers/update-package-json.cjs +18 -10
  59. package/dist/helpers/update-package-json.cjs.map +1 -0
  60. package/dist/helpers/update-package-json.mjs +17 -10
  61. package/dist/helpers/update-package-json.mjs.map +1 -0
  62. package/dist/helpers/utilities.cjs +30 -30
  63. package/dist/helpers/utilities.cjs.map +1 -0
  64. package/dist/helpers/utilities.mjs +29 -28
  65. package/dist/helpers/utilities.mjs.map +1 -0
  66. package/dist/helpers/validations.cjs +97 -0
  67. package/dist/helpers/validations.cjs.map +1 -0
  68. package/dist/helpers/validations.mjs +97 -0
  69. package/dist/helpers/validations.mjs.map +1 -0
  70. package/dist/index.cjs +5 -13
  71. package/dist/index.cjs.map +1 -0
  72. package/dist/index.d.cts +6 -17
  73. package/dist/index.d.mts +6 -17
  74. package/dist/index.mjs +4 -13
  75. package/dist/index.mjs.map +1 -0
  76. package/dist/plugin-utils/context-helpers.cjs +86 -0
  77. package/dist/plugin-utils/context-helpers.cjs.map +1 -0
  78. package/dist/plugin-utils/context-helpers.d.cts +58 -0
  79. package/dist/plugin-utils/context-helpers.d.cts.map +1 -0
  80. package/dist/plugin-utils/context-helpers.d.mts +58 -0
  81. package/dist/plugin-utils/context-helpers.d.mts.map +1 -0
  82. package/dist/plugin-utils/context-helpers.mjs +79 -0
  83. package/dist/plugin-utils/context-helpers.mjs.map +1 -0
  84. package/dist/plugin-utils/get-command-tree.cjs +4 -2
  85. package/dist/plugin-utils/get-command-tree.cjs.map +1 -0
  86. package/dist/plugin-utils/get-command-tree.d.cts +2 -1
  87. package/dist/plugin-utils/get-command-tree.d.cts.map +1 -0
  88. package/dist/plugin-utils/get-command-tree.d.mts +2 -1
  89. package/dist/plugin-utils/get-command-tree.d.mts.map +1 -0
  90. package/dist/plugin-utils/get-command-tree.mjs +5 -2
  91. package/dist/plugin-utils/get-command-tree.mjs.map +1 -0
  92. package/dist/plugin-utils/index.cjs +14 -1
  93. package/dist/plugin-utils/index.d.cts +4 -1
  94. package/dist/plugin-utils/index.d.mts +4 -1
  95. package/dist/plugin-utils/index.mjs +4 -1
  96. package/dist/plugin-utils/reflect.cjs +25 -0
  97. package/dist/plugin-utils/reflect.cjs.map +1 -0
  98. package/dist/plugin-utils/reflect.d.cts +14 -0
  99. package/dist/plugin-utils/reflect.d.cts.map +1 -0
  100. package/dist/plugin-utils/reflect.d.mts +14 -0
  101. package/dist/plugin-utils/reflect.d.mts.map +1 -0
  102. package/dist/plugin-utils/reflect.mjs +24 -0
  103. package/dist/plugin-utils/reflect.mjs.map +1 -0
  104. package/dist/plugin-utils/traverse-command-tree.cjs +33 -0
  105. package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -0
  106. package/dist/plugin-utils/traverse-command-tree.d.cts +23 -0
  107. package/dist/plugin-utils/traverse-command-tree.d.cts.map +1 -0
  108. package/dist/plugin-utils/traverse-command-tree.d.mts +23 -0
  109. package/dist/plugin-utils/traverse-command-tree.d.mts.map +1 -0
  110. package/dist/plugin-utils/traverse-command-tree.mjs +31 -0
  111. package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -0
  112. package/dist/plugin.cjs +284 -0
  113. package/dist/plugin.cjs.map +1 -0
  114. package/dist/plugin.d.cts +13 -0
  115. package/dist/plugin.d.cts.map +1 -0
  116. package/dist/plugin.d.mts +13 -0
  117. package/dist/plugin.d.mts.map +1 -0
  118. package/dist/plugin.mjs +276 -0
  119. package/dist/plugin.mjs.map +1 -0
  120. package/dist/types/command.d.cts +14 -4
  121. package/dist/types/command.d.cts.map +1 -0
  122. package/dist/types/command.d.mts +14 -4
  123. package/dist/types/command.d.mts.map +1 -0
  124. package/dist/types/config.d.cts +74 -10
  125. package/dist/types/config.d.cts.map +1 -0
  126. package/dist/types/config.d.mts +74 -10
  127. package/dist/types/config.d.mts.map +1 -0
  128. package/dist/types/context.d.cts +7 -4
  129. package/dist/types/context.d.cts.map +1 -0
  130. package/dist/types/context.d.mts +7 -4
  131. package/dist/types/context.d.mts.map +1 -0
  132. package/dist/types/index.d.cts +4 -4
  133. package/dist/types/index.d.mts +4 -4
  134. package/dist/types/internal.cjs +0 -0
  135. package/dist/types/internal.d.cts +24 -0
  136. package/dist/types/internal.d.cts.map +1 -0
  137. package/dist/types/internal.d.mts +24 -0
  138. package/dist/types/internal.d.mts.map +1 -0
  139. package/dist/types/internal.mjs +1 -0
  140. package/dist/types/options.d.cts +2 -1
  141. package/dist/types/options.d.cts.map +1 -0
  142. package/dist/types/options.d.mts +2 -1
  143. package/dist/types/options.d.mts.map +1 -0
  144. package/dist/types/runtime.cjs +0 -0
  145. package/dist/types/runtime.d.cts +24 -0
  146. package/dist/types/runtime.d.cts.map +1 -0
  147. package/dist/types/runtime.d.mts +24 -0
  148. package/dist/types/runtime.d.mts.map +1 -0
  149. package/dist/types/runtime.mjs +1 -0
  150. package/package.json +223 -91
  151. package/dist/components/utils-builtin.cjs +0 -453
  152. package/dist/components/utils-builtin.d.cts +0 -27
  153. package/dist/components/utils-builtin.d.mts +0 -27
  154. package/dist/components/utils-builtin.mjs +0 -447
  155. package/dist/powerlines.cjs +0 -172
  156. package/dist/powerlines.d.cts +0 -12
  157. package/dist/powerlines.d.mts +0 -12
  158. package/dist/powerlines.mjs +0 -168
@@ -0,0 +1,171 @@
1
+ import { CommandContext } from "../contexts/command.mjs";
2
+ import { getDocsOutputPath } from "../helpers/docs-helpers.mjs";
3
+ import { getAppBin, getVariableCommandPathName, isVariableCommandPath } from "../plugin-utils/context-helpers.mjs";
4
+ import { sortOptions } from "../plugin-utils/reflect.mjs";
5
+ import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
6
+ import { kebabCase } from "@stryke/string-format/kebab-case";
7
+ import { For, Match, Show, Switch, code, memo as memo$1 } from "@alloy-js/core";
8
+ import { Heading } from "@alloy-js/markdown";
9
+ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
10
+ import { MarkdownFile } from "@powerlines/plugin-alloy/markdown/components/markdown-file";
11
+ import { MarkdownTable } from "@powerlines/plugin-alloy/markdown/components/markdown-table";
12
+ import { joinPaths } from "@stryke/path/join";
13
+
14
+ //#region src/components/docs.tsx
15
+ /**
16
+ * Generates the options markdown documentation for a command.
17
+ */
18
+ function CommandOptionsDocs(props) {
19
+ const { command } = props;
20
+ if (Object.keys(command.options).length === 0) return code`This command does not have any options.`;
21
+ return createComponent(MarkdownTable, { get data() {
22
+ return sortOptions(Object.values(command.options)).map((option) => {
23
+ return {
24
+ name: option.name.trim(),
25
+ description: option.description.trim(),
26
+ defaultValue: option.default ? String(option.default)?.includes("\"") ? option.default : `\`${option.default}\`` : "",
27
+ required: option.optional || option.default ? "" : "✔"
28
+ };
29
+ });
30
+ } });
31
+ }
32
+ /**
33
+ * Generates the markdown documentation for a command.
34
+ */
35
+ function CommandDocsUsageExample(props) {
36
+ const { packageManager = "npm", command } = props;
37
+ const context = usePowerlines();
38
+ return [
39
+ createIntrinsic("hbr", {}),
40
+ code`\`\`\`bash `,
41
+ createIntrinsic("hbr", {}),
42
+ createComponent(Switch, { get children() {
43
+ return [
44
+ createComponent(Match, {
45
+ when: packageManager === "yarn",
46
+ children: `yarn exec `
47
+ }),
48
+ createComponent(Match, {
49
+ when: packageManager === "pnpm",
50
+ children: `pnpm exec `
51
+ }),
52
+ createComponent(Match, {
53
+ when: packageManager === "bun",
54
+ children: `bun x `
55
+ }),
56
+ createComponent(Match, {
57
+ "else": true,
58
+ children: `npx `
59
+ })
60
+ ];
61
+ } }),
62
+ memo(() => `${getAppBin(context)} `),
63
+ createComponent(For, {
64
+ get each() {
65
+ return command.path.segments;
66
+ },
67
+ joiner: " ",
68
+ children: (segment) => isVariableCommandPath(segment) ? `<${command.path.variables[segment]?.variadic ? "..." : ""}${kebabCase(getVariableCommandPathName(segment))}>` : segment
69
+ }),
70
+ code` [options] `,
71
+ createIntrinsic("hbr", {}),
72
+ code`\`\`\``,
73
+ createIntrinsic("hbr", {})
74
+ ];
75
+ }
76
+ /**
77
+ * Generates the markdown documentation for a command.
78
+ */
79
+ function CommandDocs(props) {
80
+ const { levelOffset = 0, command, usageExamples } = props;
81
+ return [
82
+ createComponent(Heading, {
83
+ level: 1 + levelOffset,
84
+ get children() {
85
+ return command.title;
86
+ }
87
+ }),
88
+ createIntrinsic("hbr", {}),
89
+ createIntrinsic("hbr", {}),
90
+ memo(() => code`${command.description}`),
91
+ createIntrinsic("hbr", {}),
92
+ createIntrinsic("hbr", {}),
93
+ createComponent(Heading, {
94
+ level: 2 + levelOffset,
95
+ children: "Usage"
96
+ }),
97
+ createIntrinsic("hbr", {}),
98
+ createIntrinsic("hbr", {}),
99
+ memo(() => code`The ${command.name} command can be executed using the following syntax: `),
100
+ createIntrinsic("hbr", {}),
101
+ createIntrinsic("hbr", {}),
102
+ createComponent(Show, {
103
+ get when() {
104
+ return usageExamples && usageExamples.length > 0;
105
+ },
106
+ get fallback() {
107
+ return createComponent(CommandDocsUsageExample, {
108
+ packageManager: "npm",
109
+ command
110
+ });
111
+ },
112
+ get children() {
113
+ return createComponent(For, {
114
+ each: usageExamples,
115
+ hardline: true,
116
+ children: (packageManager) => createComponent(CommandDocsUsageExample, {
117
+ packageManager,
118
+ command
119
+ })
120
+ });
121
+ }
122
+ }),
123
+ createIntrinsic("hbr", {}),
124
+ createIntrinsic("hbr", {}),
125
+ createComponent(Heading, {
126
+ level: 2 + levelOffset,
127
+ children: "Options"
128
+ }),
129
+ createIntrinsic("hbr", {}),
130
+ createIntrinsic("hbr", {}),
131
+ memo(() => code`The following options are available for the ${command.name} command:`),
132
+ createIntrinsic("hbr", {}),
133
+ createIntrinsic("hbr", {}),
134
+ createComponent(CommandOptionsDocs, { command }),
135
+ createIntrinsic("hbr", {}),
136
+ createIntrinsic("hbr", {})
137
+ ];
138
+ }
139
+ /**
140
+ * Generates the markdown documentation file for a command.
141
+ */
142
+ function CommandDocsFile(props) {
143
+ const { levelOffset = 0, command, ...rest } = props;
144
+ const context = usePowerlines();
145
+ const usageExamples = memo$1(() => [
146
+ "npm",
147
+ "yarn",
148
+ "pnpm",
149
+ "bun"
150
+ ]);
151
+ return createComponent(CommandContext.Provider, {
152
+ value: command,
153
+ get children() {
154
+ return createComponent(MarkdownFile, mergeProps({ get path() {
155
+ return joinPaths(getDocsOutputPath(context), `${command.path.value}.md`);
156
+ } }, rest, { get children() {
157
+ return createComponent(CommandDocs, {
158
+ levelOffset,
159
+ command,
160
+ get usageExamples() {
161
+ return usageExamples();
162
+ }
163
+ });
164
+ } }));
165
+ }
166
+ });
167
+ }
168
+
169
+ //#endregion
170
+ export { CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs };
171
+ //# sourceMappingURL=docs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.mjs","names":["code","For","Match","memo","Show","Switch","Heading","usePowerlines","MarkdownFile","MarkdownTable","joinPaths","kebabCase","CommandContext","getDocsOutputPath","getAppBin","getVariableCommandPathName","isVariableCommandPath","sortOptions","CommandOptionsDocs","props","command","Object","keys","options","length","_$createComponent","data","values","map","option","name","trim","description","defaultValue","default","String","includes","required","optional","CommandDocsUsageExample","packageManager","context","_$createIntrinsic","children","when","_$memo","each","path","segments","joiner","segment","variables","variadic","CommandDocs","levelOffset","usageExamples","level","title","fallback","hardline","CommandDocsFile","rest","Provider","value","_$mergeProps"],"sources":["../../src/components/docs.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, Match, memo, Show, Switch } from \"@alloy-js/core\";\nimport { Heading } from \"@alloy-js/markdown\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { MarkdownFileProps } from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownFile } from \"@powerlines/plugin-alloy/markdown/components/markdown-file\";\nimport { MarkdownTable } from \"@powerlines/plugin-alloy/markdown/components/markdown-table\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { CommandContext } from \"../contexts/command\";\nimport { getDocsOutputPath } from \"../helpers/docs-helpers\";\nimport {\n getAppBin,\n getVariableCommandPathName,\n isVariableCommandPath\n} from \"../plugin-utils/context-helpers\";\nimport { sortOptions } from \"../plugin-utils/reflect\";\nimport type { CommandTree } from \"../types/command\";\nimport type { Context } from \"../types/context\";\n\nexport interface CommandOptionsDocsProps {\n /**\n * The command to generate options documentation for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the options markdown documentation for a command.\n */\nexport function CommandOptionsDocs(props: CommandOptionsDocsProps) {\n const { command } = props;\n if (Object.keys(command.options).length === 0) {\n return code`This command does not have any options.`;\n }\n\n return (\n <MarkdownTable\n data={sortOptions(Object.values(command.options)).map(option => {\n return {\n name: option.name.trim(),\n description: option.description.trim(),\n defaultValue: option.default\n ? String(option.default)?.includes('\"')\n ? option.default\n : `\\`${option.default}\\``\n : \"\",\n required: option.optional || option.default ? \"\" : \"✔\"\n };\n })}\n />\n );\n}\n\nexport interface CommandDocsUsageExampleProps {\n /**\n * The package manager to generate the usage example for.\n *\n * @remarks\n * If not specified, examples for all supported package managers will be generated.\n *\n * @defaultValue \"npm\"\n */\n packageManager?: \"npm\" | \"yarn\" | \"pnpm\" | \"bun\";\n\n /**\n * The command to generate the usage example for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the markdown documentation for a command.\n */\nexport function CommandDocsUsageExample(props: CommandDocsUsageExampleProps) {\n const { packageManager = \"npm\", command } = props;\n\n const context = usePowerlines<Context>();\n\n return (\n <>\n <hbr />\n {code`\\`\\`\\`bash `}\n <hbr />\n <Switch>\n <Match when={packageManager === \"yarn\"}>{`yarn exec `}</Match>\n <Match when={packageManager === \"pnpm\"}>{`pnpm exec `}</Match>\n <Match when={packageManager === \"bun\"}>{`bun x `}</Match>\n <Match else>{`npx `}</Match>\n </Switch>\n {`${getAppBin(context)} `}\n <For each={command.path.segments} joiner=\" \">\n {segment =>\n isVariableCommandPath(segment)\n ? `<${command.path.variables[segment]?.variadic ? \"...\" : \"\"}${kebabCase(\n getVariableCommandPathName(segment)\n )}>`\n : segment\n }\n </For>\n {code` [options] `}\n <hbr />\n {code`\\`\\`\\``}\n <hbr />\n </>\n );\n}\n\nexport interface CommandDocsProps {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n\n /**\n * The command to generate options documentation for.\n */\n command: CommandTree;\n\n /**\n * Optional usage examples to include in the documentation.\n *\n * @defaultValue `[\"npm\"]`\n */\n usageExamples?: Required<CommandDocsUsageExampleProps>[\"packageManager\"][];\n}\n\n/**\n * Generates the markdown documentation for a command.\n */\nexport function CommandDocs(props: CommandDocsProps) {\n const { levelOffset = 0, command, usageExamples } = props;\n\n return (\n <>\n <Heading level={1 + levelOffset}>{command.title}</Heading>\n <hbr />\n <hbr />\n {code`${command.description}`}\n <hbr />\n <hbr />\n <Heading level={2 + levelOffset}>Usage</Heading>\n <hbr />\n <hbr />\n {code`The ${command.name} command can be executed using the following syntax: `}\n <hbr />\n <hbr />\n <Show\n when={usageExamples && usageExamples.length > 0}\n fallback={\n <CommandDocsUsageExample packageManager=\"npm\" command={command} />\n }>\n <For each={usageExamples!} hardline>\n {packageManager => (\n <CommandDocsUsageExample\n packageManager={packageManager}\n command={command}\n />\n )}\n </For>\n </Show>\n <hbr />\n <hbr />\n <Heading level={2 + levelOffset}>Options</Heading>\n <hbr />\n <hbr />\n {code`The following options are available for the ${\n command.name\n } command:`}\n <hbr />\n <hbr />\n <CommandOptionsDocs command={command} />\n <hbr />\n <hbr />\n </>\n );\n}\n\nexport interface CommandDocsFileProps extends Partial<MarkdownFileProps> {\n /**\n * The heading level offset to apply to the generated documentation.\n *\n * @remarks\n * This is useful when nesting the documentation within other markdown files.\n *\n * @defaultValue 0\n */\n levelOffset?: number;\n\n /**\n * The command to generate documentation for.\n */\n command: CommandTree;\n}\n\n/**\n * Generates the markdown documentation file for a command.\n */\nexport function CommandDocsFile(props: CommandDocsFileProps) {\n const { levelOffset = 0, command, ...rest } = props;\n\n const context = usePowerlines<Context>();\n const usageExamples = memo(\n () => [\"npm\", \"yarn\", \"pnpm\", \"bun\"] as CommandDocsProps[\"usageExamples\"]\n );\n\n return (\n <CommandContext.Provider value={command}>\n <MarkdownFile\n path={joinPaths(getDocsOutputPath(context), `${command.path.value}.md`)}\n {...rest}>\n <CommandDocs\n levelOffset={levelOffset}\n command={command}\n usageExamples={usageExamples()}\n />\n </MarkdownFile>\n </CommandContext.Provider>\n );\n}\n"],"mappings":"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"}
@@ -1,7 +1,6 @@
1
- const require_components_utils_builtin = require('./utils-builtin.cjs');
1
+ const require_components_docs = require('./docs.cjs');
2
2
 
3
- exports.ArgsUtilities = require_components_utils_builtin.ArgsUtilities;
4
- exports.ColorSupportUtilities = require_components_utils_builtin.ColorSupportUtilities;
5
- exports.EnvSupportUtilities = require_components_utils_builtin.EnvSupportUtilities;
6
- exports.HyperlinkSupportUtilities = require_components_utils_builtin.HyperlinkSupportUtilities;
7
- exports.UtilsBuiltin = require_components_utils_builtin.UtilsBuiltin;
3
+ exports.CommandDocs = require_components_docs.CommandDocs;
4
+ exports.CommandDocsFile = require_components_docs.CommandDocsFile;
5
+ exports.CommandDocsUsageExample = require_components_docs.CommandDocsUsageExample;
6
+ exports.CommandOptionsDocs = require_components_docs.CommandOptionsDocs;
@@ -1,2 +1,2 @@
1
- import { ArgsUtilities, ColorSupportUtilities, EnvSupportUtilities, HyperlinkSupportUtilities, UtilsBuiltin, UtilsBuiltinProps } from "./utils-builtin.cjs";
2
- export { ArgsUtilities, ColorSupportUtilities, EnvSupportUtilities, HyperlinkSupportUtilities, UtilsBuiltin, UtilsBuiltinProps };
1
+ import { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps } from "./docs.cjs";
2
+ export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps };
@@ -1,2 +1,2 @@
1
- import { ArgsUtilities, ColorSupportUtilities, EnvSupportUtilities, HyperlinkSupportUtilities, UtilsBuiltin, UtilsBuiltinProps } from "./utils-builtin.mjs";
2
- export { ArgsUtilities, ColorSupportUtilities, EnvSupportUtilities, HyperlinkSupportUtilities, UtilsBuiltin, UtilsBuiltinProps };
1
+ import { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps } from "./docs.mjs";
2
+ export { CommandDocs, CommandDocsFile, CommandDocsFileProps, CommandDocsProps, CommandDocsUsageExample, CommandDocsUsageExampleProps, CommandOptionsDocs, CommandOptionsDocsProps };
@@ -1,3 +1,3 @@
1
- import { ArgsUtilities, ColorSupportUtilities, EnvSupportUtilities, HyperlinkSupportUtilities, UtilsBuiltin } from "./utils-builtin.mjs";
1
+ import { CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs } from "./docs.mjs";
2
2
 
3
- export { ArgsUtilities, ColorSupportUtilities, EnvSupportUtilities, HyperlinkSupportUtilities, UtilsBuiltin };
3
+ export { CommandDocs, CommandDocsFile, CommandDocsUsageExample, CommandOptionsDocs };
package/dist/config.cjs CHANGED
@@ -14,4 +14,5 @@ function defineConfig(config) {
14
14
  }
15
15
 
16
16
  //#endregion
17
- exports.defineConfig = defineConfig;
17
+ exports.defineConfig = defineConfig;
18
+ //# sourceMappingURL=config.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.cjs","names":["defineConfig","config"],"sources":["../src/config.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 { UserConfig } from \"./types/config\";\n\n/**\n * A utility function to define a Shell Shock user configuration.\n *\n * @remarks\n * This function is used to create a user configuration object for Shell Shock projects. It ensures that the configuration adheres to the expected structure.\n *\n * @param config - A partial user configuration object.\n * @returns A complete user configuration object.\n */\nexport function defineConfig(config: Partial<UserConfig>): UserConfig {\n return config;\n}\n"],"mappings":";;;;;;;;;;;AA6BA,SAAgBA,aAAaC,QAAyC;AACpE,QAAOA"}
package/dist/config.d.cts CHANGED
@@ -13,4 +13,5 @@ import { UserConfig } from "./types/config.cjs";
13
13
  */
14
14
  declare function defineConfig(config: Partial<UserConfig>): UserConfig;
15
15
  //#endregion
16
- export { defineConfig };
16
+ export { defineConfig };
17
+ //# sourceMappingURL=config.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.cts","names":[],"sources":["../src/config.ts"],"sourcesContent":[],"mappings":";;;;;;AA6BA;;;;;;;iBAAgB,YAAA,SAAqB,QAAQ,cAAc"}
package/dist/config.d.mts CHANGED
@@ -13,4 +13,5 @@ import { UserConfig } from "./types/config.mjs";
13
13
  */
14
14
  declare function defineConfig(config: Partial<UserConfig>): UserConfig;
15
15
  //#endregion
16
- export { defineConfig };
16
+ export { defineConfig };
17
+ //# sourceMappingURL=config.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.mts","names":[],"sources":["../src/config.ts"],"sourcesContent":[],"mappings":";;;;;;AA6BA;;;;;;;iBAAgB,YAAA,SAAqB,QAAQ,cAAc"}
package/dist/config.mjs CHANGED
@@ -13,4 +13,5 @@ function defineConfig(config) {
13
13
  }
14
14
 
15
15
  //#endregion
16
- export { defineConfig };
16
+ export { defineConfig };
17
+ //# sourceMappingURL=config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.mjs","names":["defineConfig","config"],"sources":["../src/config.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 { UserConfig } from \"./types/config\";\n\n/**\n * A utility function to define a Shell Shock user configuration.\n *\n * @remarks\n * This function is used to create a user configuration object for Shell Shock projects. It ensures that the configuration adheres to the expected structure.\n *\n * @param config - A partial user configuration object.\n * @returns A complete user configuration object.\n */\nexport function defineConfig(config: Partial<UserConfig>): UserConfig {\n return config;\n}\n"],"mappings":";;;;;;;;;;AA6BA,SAAgBA,aAAaC,QAAyC;AACpE,QAAOA"}
@@ -0,0 +1,21 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ let __alloy_js_core = require("@alloy-js/core");
3
+
4
+ //#region src/contexts/command.ts
5
+ /**
6
+ * The reflection parameter context used in template rendering.
7
+ */
8
+ const CommandContext = (0, __alloy_js_core.createNamedContext)("Command");
9
+ /**
10
+ * Hook to access the Command context.
11
+ *
12
+ * @returns A reactive version of the current reflection.
13
+ */
14
+ function useCommand() {
15
+ return (0, __alloy_js_core.useContext)(CommandContext);
16
+ }
17
+
18
+ //#endregion
19
+ exports.CommandContext = CommandContext;
20
+ exports.useCommand = useCommand;
21
+ //# sourceMappingURL=command.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.cjs","names":["createNamedContext","useContext","CommandContext","useCommand"],"sources":["../../src/contexts/command.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 { ComponentContext } from \"@alloy-js/core\";\nimport { createNamedContext, useContext } from \"@alloy-js/core\";\nimport type { CommandTree } from \"../types/command\";\n\n/**\n * The reflection parameter context used in template rendering.\n */\nexport const CommandContext: ComponentContext<CommandTree | undefined> =\n createNamedContext<CommandTree | undefined>(\"Command\");\n\n/**\n * Hook to access the Command context.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useCommand() {\n return useContext<CommandTree | undefined>(CommandContext)!;\n}\n"],"mappings":";;;;;;;AAyBA,MAAaE,yDACiC,UAAU;;;;;;AAOxD,SAAgBC,aAAa;AAC3B,wCAA2CD,eAAe"}
@@ -0,0 +1,18 @@
1
+ import { CommandTree } from "../types/command.cjs";
2
+ import { ComponentContext } from "@alloy-js/core";
3
+
4
+ //#region src/contexts/command.d.ts
5
+
6
+ /**
7
+ * The reflection parameter context used in template rendering.
8
+ */
9
+ declare const CommandContext: ComponentContext<CommandTree | undefined>;
10
+ /**
11
+ * Hook to access the Command context.
12
+ *
13
+ * @returns A reactive version of the current reflection.
14
+ */
15
+ declare function useCommand(): CommandTree;
16
+ //#endregion
17
+ export { CommandContext, useCommand };
18
+ //# sourceMappingURL=command.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.cts","names":[],"sources":["../../src/contexts/command.ts"],"sourcesContent":[],"mappings":";;;;;;;AAyBA;AAQgB,cARH,cAQa,EARG,gBAQH,CARoB,WAQpB,GAAA,SAAA,CAAA;;;;;;iBAAV,UAAA,CAAA,GAAU"}
@@ -0,0 +1,18 @@
1
+ import { CommandTree } from "../types/command.mjs";
2
+ import { ComponentContext } from "@alloy-js/core";
3
+
4
+ //#region src/contexts/command.d.ts
5
+
6
+ /**
7
+ * The reflection parameter context used in template rendering.
8
+ */
9
+ declare const CommandContext: ComponentContext<CommandTree | undefined>;
10
+ /**
11
+ * Hook to access the Command context.
12
+ *
13
+ * @returns A reactive version of the current reflection.
14
+ */
15
+ declare function useCommand(): CommandTree;
16
+ //#endregion
17
+ export { CommandContext, useCommand };
18
+ //# sourceMappingURL=command.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.mts","names":[],"sources":["../../src/contexts/command.ts"],"sourcesContent":[],"mappings":";;;;;;;AAyBA;AAQgB,cARH,cAQa,EARG,gBAQH,CARoB,WAQpB,GAAA,SAAA,CAAA;;;;;;iBAAV,UAAA,CAAA,GAAU"}
@@ -0,0 +1,19 @@
1
+ import { createNamedContext, useContext } from "@alloy-js/core";
2
+
3
+ //#region src/contexts/command.ts
4
+ /**
5
+ * The reflection parameter context used in template rendering.
6
+ */
7
+ const CommandContext = createNamedContext("Command");
8
+ /**
9
+ * Hook to access the Command context.
10
+ *
11
+ * @returns A reactive version of the current reflection.
12
+ */
13
+ function useCommand() {
14
+ return useContext(CommandContext);
15
+ }
16
+
17
+ //#endregion
18
+ export { CommandContext, useCommand };
19
+ //# sourceMappingURL=command.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.mjs","names":["createNamedContext","useContext","CommandContext","useCommand"],"sources":["../../src/contexts/command.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 { ComponentContext } from \"@alloy-js/core\";\nimport { createNamedContext, useContext } from \"@alloy-js/core\";\nimport type { CommandTree } from \"../types/command\";\n\n/**\n * The reflection parameter context used in template rendering.\n */\nexport const CommandContext: ComponentContext<CommandTree | undefined> =\n createNamedContext<CommandTree | undefined>(\"Command\");\n\n/**\n * Hook to access the Command context.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useCommand() {\n return useContext<CommandTree | undefined>(CommandContext)!;\n}\n"],"mappings":";;;;;;AAyBA,MAAaE,iBACXF,mBAA4C,UAAU;;;;;;AAOxD,SAAgBG,aAAa;AAC3B,QAAOF,WAAoCC,eAAe"}
@@ -0,0 +1,4 @@
1
+ const require_contexts_command = require('./command.cjs');
2
+
3
+ exports.CommandContext = require_contexts_command.CommandContext;
4
+ exports.useCommand = require_contexts_command.useCommand;
@@ -0,0 +1,2 @@
1
+ import { CommandContext, useCommand } from "./command.cjs";
2
+ export { CommandContext, useCommand };
@@ -0,0 +1,2 @@
1
+ import { CommandContext, useCommand } from "./command.mjs";
2
+ export { CommandContext, useCommand };
@@ -0,0 +1,3 @@
1
+ import { CommandContext, useCommand } from "./command.mjs";
2
+
3
+ export { CommandContext, useCommand };
@@ -0,0 +1,59 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ const require_plugin_utils_context_helpers = require('../plugin-utils/context-helpers.cjs');
3
+ const require_components_docs = require('../components/docs.cjs');
4
+ require('../plugin-utils/index.cjs');
5
+ let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
6
+ let __alloy_js_core_components = require("@alloy-js/core/components");
7
+ let __powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
8
+ let __alloy_js_core = require("@alloy-js/core");
9
+ let __alloy_js_markdown = require("@alloy-js/markdown");
10
+ let automd = require("automd");
11
+
12
+ //#region src/helpers/automd.tsx
13
+ /**
14
+ * AutoMD generator to generate CLI command documentation
15
+ *
16
+ * @see https://automd.unjs.io/
17
+ *
18
+ * @param context - The generator context.
19
+ * @returns The generated documentation content.
20
+ */
21
+ const commands = (context) => (0, automd.defineGenerator)({
22
+ name: "commands",
23
+ async generate() {
24
+ return { contents: (0, __powerlines_plugin_alloy_render.renderString)(context, [
25
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_markdown.Heading, {
26
+ level: 2,
27
+ children: "Commands"
28
+ }),
29
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
30
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
31
+ (0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`The following commands are available in the ${require_plugin_utils_context_helpers.getAppTitle(context)} CLI application:`),
32
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
33
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
34
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core_components.For, {
35
+ get each() {
36
+ return Object.values(context.commands);
37
+ },
38
+ doubleHardline: true,
39
+ children: (child) => (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core_components.Show, {
40
+ get when() {
41
+ return !child.isVirtual;
42
+ },
43
+ get children() {
44
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_docs.CommandDocs, {
45
+ command: child,
46
+ levelOffset: 2
47
+ });
48
+ }
49
+ })
50
+ }),
51
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
52
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
53
+ ]) };
54
+ }
55
+ });
56
+
57
+ //#endregion
58
+ exports.commands = commands;
59
+ //# sourceMappingURL=automd.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"automd.cjs","names":["code","For","Show","Heading","renderString","defineGenerator","CommandDocs","getAppTitle","commands","context","name","generate","contents","_$createComponent","level","children","_$createIntrinsic","_$memo","each","Object","values","doubleHardline","child","when","isVirtual","command","levelOffset"],"sources":["../../src/helpers/automd.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code } from \"@alloy-js/core\";\nimport { For, Show } from \"@alloy-js/core/components\";\nimport { Heading } from \"@alloy-js/markdown\";\nimport { renderString } from \"@powerlines/plugin-alloy/render\";\nimport { defineGenerator } from \"automd\";\nimport { CommandDocs } from \"../components/docs\";\nimport { getAppTitle } from \"../plugin-utils\";\nimport type { Context } from \"../types/context\";\n\n/**\n * AutoMD generator to generate CLI command documentation\n *\n * @see https://automd.unjs.io/\n *\n * @param context - The generator context.\n * @returns The generated documentation content.\n */\nexport const commands = (context: Context) =>\n defineGenerator({\n name: \"commands\",\n async generate() {\n return {\n contents: renderString(\n context,\n <>\n <Heading level={2}>Commands</Heading>\n <hbr />\n <hbr />\n {code`The following commands are available in the ${getAppTitle(\n context\n )} CLI application:`}\n <hbr />\n <hbr />\n <For each={Object.values(context.commands)} doubleHardline>\n {child => (\n <Show when={!child.isVirtual}>\n <CommandDocs command={child} levelOffset={2} />\n </Show>\n )}\n </For>\n <hbr />\n <hbr />\n </>\n )\n };\n }\n });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmCA,MAAaQ,YAAYC,wCACP;CACdC,MAAM;CACN,MAAMC,WAAW;AACf,SAAO,EACLC,6DACEH,SAAO;oDAEJN,6BAAO;IAACW,OAAO;IAACC,UAAA;IAAA,CAAA;oDAAA,OAAA,EAAA,CAAA;oDAAA,OAAA,EAAA,CAAA;+CAGhBf,oBAAI,+CAA+CO,iDAClDE,QACD,CAAA,mBAAmB;oDAAA,OAAA,EAAA,CAAA;oDAAA,OAAA,EAAA,CAAA;oDAGnBR,gCAAG;IAAA,IAACiB,OAAI;AAAA,YAAEC,OAAOC,OAAOX,QAAQD,SAAS;;IAAEa,gBAAc;IAAAN,WACvDO,2DACEpB,iCAAI;KAAA,IAACqB,OAAI;AAAA,aAAE,CAACD,MAAME;;KAAS,IAAAT,WAAA;AAAA,8DACzBT,qCAAW;OAACmB,SAASH;OAAOI,aAAa;OAAC,CAAA;;KAAA,CAAA;IAE9C,CAAA;oDAAA,OAAA,EAAA,CAAA;oDAAA,OAAA,EAAA,CAAA;GAKP,CAAA,EACD;;CAEJ,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { getAppTitle } from "../plugin-utils/context-helpers.mjs";
2
+ import { CommandDocs } from "../components/docs.mjs";
3
+ import "../plugin-utils/index.mjs";
4
+ import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
5
+ import { For, Show } from "@alloy-js/core/components";
6
+ import { renderString } from "@powerlines/plugin-alloy/render";
7
+ import { code } from "@alloy-js/core";
8
+ import { Heading } from "@alloy-js/markdown";
9
+ import { defineGenerator } from "automd";
10
+
11
+ //#region src/helpers/automd.tsx
12
+ /**
13
+ * AutoMD generator to generate CLI command documentation
14
+ *
15
+ * @see https://automd.unjs.io/
16
+ *
17
+ * @param context - The generator context.
18
+ * @returns The generated documentation content.
19
+ */
20
+ const commands = (context) => defineGenerator({
21
+ name: "commands",
22
+ async generate() {
23
+ return { contents: renderString(context, [
24
+ createComponent(Heading, {
25
+ level: 2,
26
+ children: "Commands"
27
+ }),
28
+ createIntrinsic("hbr", {}),
29
+ createIntrinsic("hbr", {}),
30
+ memo(() => code`The following commands are available in the ${getAppTitle(context)} CLI application:`),
31
+ createIntrinsic("hbr", {}),
32
+ createIntrinsic("hbr", {}),
33
+ createComponent(For, {
34
+ get each() {
35
+ return Object.values(context.commands);
36
+ },
37
+ doubleHardline: true,
38
+ children: (child) => createComponent(Show, {
39
+ get when() {
40
+ return !child.isVirtual;
41
+ },
42
+ get children() {
43
+ return createComponent(CommandDocs, {
44
+ command: child,
45
+ levelOffset: 2
46
+ });
47
+ }
48
+ })
49
+ }),
50
+ createIntrinsic("hbr", {}),
51
+ createIntrinsic("hbr", {})
52
+ ]) };
53
+ }
54
+ });
55
+
56
+ //#endregion
57
+ export { commands };
58
+ //# sourceMappingURL=automd.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"automd.mjs","names":["code","For","Show","Heading","renderString","defineGenerator","CommandDocs","getAppTitle","commands","context","name","generate","contents","_$createComponent","level","children","_$createIntrinsic","_$memo","each","Object","values","doubleHardline","child","when","isVirtual","command","levelOffset"],"sources":["../../src/helpers/automd.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code } from \"@alloy-js/core\";\nimport { For, Show } from \"@alloy-js/core/components\";\nimport { Heading } from \"@alloy-js/markdown\";\nimport { renderString } from \"@powerlines/plugin-alloy/render\";\nimport { defineGenerator } from \"automd\";\nimport { CommandDocs } from \"../components/docs\";\nimport { getAppTitle } from \"../plugin-utils\";\nimport type { Context } from \"../types/context\";\n\n/**\n * AutoMD generator to generate CLI command documentation\n *\n * @see https://automd.unjs.io/\n *\n * @param context - The generator context.\n * @returns The generated documentation content.\n */\nexport const commands = (context: Context) =>\n defineGenerator({\n name: \"commands\",\n async generate() {\n return {\n contents: renderString(\n context,\n <>\n <Heading level={2}>Commands</Heading>\n <hbr />\n <hbr />\n {code`The following commands are available in the ${getAppTitle(\n context\n )} CLI application:`}\n <hbr />\n <hbr />\n <For each={Object.values(context.commands)} doubleHardline>\n {child => (\n <Show when={!child.isVirtual}>\n <CommandDocs command={child} levelOffset={2} />\n </Show>\n )}\n </For>\n <hbr />\n <hbr />\n </>\n )\n };\n }\n });\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmCA,MAAaQ,YAAYC,YACvBJ,gBAAgB;CACdK,MAAM;CACN,MAAMC,WAAW;AACf,SAAO,EACLC,UAAUR,aACRK,SAAO;GAAAI,gBAEJV,SAAO;IAACW,OAAO;IAACC,UAAA;IAAA,CAAA;GAAAC,gBAAA,OAAA,EAAA,CAAA;GAAAA,gBAAA,OAAA,EAAA,CAAA;GAAAC,WAGhBjB,IAAI,+CAA+CO,YAClDE,QACD,CAAA,mBAAmB;GAAAO,gBAAA,OAAA,EAAA,CAAA;GAAAA,gBAAA,OAAA,EAAA,CAAA;GAAAH,gBAGnBZ,KAAG;IAAA,IAACiB,OAAI;AAAA,YAAEC,OAAOC,OAAOX,QAAQD,SAAS;;IAAEa,gBAAc;IAAAN,WACvDO,UAAKT,gBACHX,MAAI;KAAA,IAACqB,OAAI;AAAA,aAAE,CAACD,MAAME;;KAAS,IAAAT,WAAA;AAAA,aAAAF,gBACzBP,aAAW;OAACmB,SAASH;OAAOI,aAAa;OAAC,CAAA;;KAAA,CAAA;IAE9C,CAAA;GAAAV,gBAAA,OAAA,EAAA,CAAA;GAAAA,gBAAA,OAAA,EAAA,CAAA;GAKP,CAAA,EACD;;CAEJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ let __stryke_path_join = require("@stryke/path/join");
3
+
4
+ //#region src/helpers/docs-helpers.ts
5
+ /**
6
+ * Gets the output path for the generated documentation.
7
+ *
8
+ * @param context - The Shell Shock context.
9
+ * @returns The output path for the generated documentation.
10
+ */
11
+ function getDocsOutputPath(context) {
12
+ return (0, __stryke_path_join.joinPaths)(context.config.projectRoot, "docs", "generated");
13
+ }
14
+
15
+ //#endregion
16
+ exports.getDocsOutputPath = getDocsOutputPath;
17
+ //# sourceMappingURL=docs-helpers.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs-helpers.cjs","names":["joinPaths","getDocsOutputPath","context","config","projectRoot"],"sources":["../../src/helpers/docs-helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join\";\nimport type { Context } from \"../types/context\";\n\n/**\n * Gets the output path for the generated documentation.\n *\n * @param context - The Shell Shock context.\n * @returns The output path for the generated documentation.\n */\nexport function getDocsOutputPath(context: Context): string {\n return joinPaths(context.config.projectRoot, \"docs\", \"generated\");\n}\n"],"mappings":";;;;;;;;;;AA2BA,SAAgBC,kBAAkBC,SAA0B;AAC1D,0CAAiBA,QAAQC,OAAOC,aAAa,QAAQ,YAAY"}
@@ -0,0 +1,16 @@
1
+ import { joinPaths } from "@stryke/path/join";
2
+
3
+ //#region src/helpers/docs-helpers.ts
4
+ /**
5
+ * Gets the output path for the generated documentation.
6
+ *
7
+ * @param context - The Shell Shock context.
8
+ * @returns The output path for the generated documentation.
9
+ */
10
+ function getDocsOutputPath(context) {
11
+ return joinPaths(context.config.projectRoot, "docs", "generated");
12
+ }
13
+
14
+ //#endregion
15
+ export { getDocsOutputPath };
16
+ //# sourceMappingURL=docs-helpers.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs-helpers.mjs","names":["joinPaths","getDocsOutputPath","context","config","projectRoot"],"sources":["../../src/helpers/docs-helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join\";\nimport type { Context } from \"../types/context\";\n\n/**\n * Gets the output path for the generated documentation.\n *\n * @param context - The Shell Shock context.\n * @returns The output path for the generated documentation.\n */\nexport function getDocsOutputPath(context: Context): string {\n return joinPaths(context.config.projectRoot, \"docs\", \"generated\");\n}\n"],"mappings":";;;;;;;;;AA2BA,SAAgBC,kBAAkBC,SAA0B;AAC1D,QAAOF,UAAUE,QAAQC,OAAOC,aAAa,QAAQ,YAAY"}
@@ -46,4 +46,5 @@ async function writeCommandsPersistence(context) {
46
46
  //#endregion
47
47
  exports.getCommandsPersistencePath = getCommandsPersistencePath;
48
48
  exports.readCommandsPersistence = readCommandsPersistence;
49
- exports.writeCommandsPersistence = writeCommandsPersistence;
49
+ exports.writeCommandsPersistence = writeCommandsPersistence;
50
+ //# sourceMappingURL=persistence.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persistence.cjs","names":["joinPaths","getCommandsPersistencePath","context","dataPath","serializedCommandTree","commands","serialize","node","parent","serializedNode","children","key","child","Object","entries","id","result","deserializeCommandTree","serializedCommands","deserialize","deserializedNode","readCommandsPersistence","reflections","fs","read","length","Error","JSON","parse","writeCommandsPersistence","filePath","write","stringify","config","mode"],"sources":["../../src/helpers/persistence.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { CommandTree, SerializedCommandTree } from \"../types\";\nimport type { Context } from \"../types/context\";\n\nexport function getCommandsPersistencePath(context: Context): string {\n return joinPaths(context.dataPath, `commands.json`);\n}\n\nfunction serializedCommandTree(\n commands: Record<string, CommandTree>\n): Record<string, SerializedCommandTree> {\n const serialize = (\n node: CommandTree,\n parent: string | null = null\n ): SerializedCommandTree => {\n const serializedNode: SerializedCommandTree = {\n ...node,\n parent,\n children: {}\n };\n\n for (const [key, child] of Object.entries(node.children || {})) {\n serializedNode.children[key] = serialize(child, node.id);\n }\n\n return serializedNode;\n };\n\n const result: Record<string, SerializedCommandTree> = {};\n for (const [key, child] of Object.entries(commands)) {\n result[key] = serialize(child, null);\n }\n\n return result;\n}\n\nfunction deserializeCommandTree(\n serializedCommands: Record<string, SerializedCommandTree>\n): Record<string, CommandTree> {\n const deserialize = (\n node: SerializedCommandTree,\n parent: CommandTree | null = null\n ): CommandTree => {\n const deserializedNode: CommandTree = {\n ...node,\n parent,\n children: {}\n };\n\n for (const [key, child] of Object.entries(node.children || {})) {\n deserializedNode.children[key] = deserialize(child, deserializedNode);\n }\n\n return deserializedNode;\n };\n\n const result: Record<string, CommandTree> = {};\n for (const [key, child] of Object.entries(serializedCommands)) {\n result[key] = deserialize(child, null);\n }\n\n return result;\n}\n\nexport async function readCommandsPersistence(context: Context) {\n const reflections = await context.fs.read(\n getCommandsPersistencePath(context)\n );\n if (!reflections || !reflections.length) {\n throw new Error(\n `CLI Command reflection file ${getCommandsPersistencePath(context)} is empty`\n );\n }\n\n context.commands = deserializeCommandTree(JSON.parse(reflections));\n}\n\nexport async function writeCommandsPersistence(context: Context) {\n const filePath = getCommandsPersistencePath(context);\n\n await context.fs.write(\n filePath,\n JSON.stringify(\n serializedCommandTree(context.commands),\n null,\n context.config.mode === \"development\" ? 2 : 0\n )\n );\n}\n"],"mappings":";;;;AAsBA,SAAgBC,2BAA2BC,SAA0B;AACnE,gDAAiBA,QAAQC,UAAU,gBAAgB;;AAGrD,SAASC,sBACPC,UACuC;CACvC,MAAMC,aACJC,MACAC,SAAwB,SACE;EAC1B,MAAMC,iBAAwC;GAC5C,GAAGF;GACHC;GACAE,UAAU,EAAC;GACZ;AAED,OAAK,MAAM,CAACC,KAAKC,UAAUC,OAAOC,QAAQP,KAAKG,YAAY,EAAE,CAAC,CAC5DD,gBAAeC,SAASC,OAAOL,UAAUM,OAAOL,KAAKQ,GAAG;AAG1D,SAAON;;CAGT,MAAMO,SAAgD,EAAE;AACxD,MAAK,MAAM,CAACL,KAAKC,UAAUC,OAAOC,QAAQT,SAAS,CACjDW,QAAOL,OAAOL,UAAUM,OAAO,KAAK;AAGtC,QAAOI;;AAGT,SAASC,uBACPC,oBAC6B;CAC7B,MAAMC,eACJZ,MACAC,SAA6B,SACb;EAChB,MAAMY,mBAAgC;GACpC,GAAGb;GACHC;GACAE,UAAU,EAAC;GACZ;AAED,OAAK,MAAM,CAACC,KAAKC,UAAUC,OAAOC,QAAQP,KAAKG,YAAY,EAAE,CAAC,CAC5DU,kBAAiBV,SAASC,OAAOQ,YAAYP,OAAOQ,iBAAiB;AAGvE,SAAOA;;CAGT,MAAMJ,SAAsC,EAAE;AAC9C,MAAK,MAAM,CAACL,KAAKC,UAAUC,OAAOC,QAAQI,mBAAmB,CAC3DF,QAAOL,OAAOQ,YAAYP,OAAO,KAAK;AAGxC,QAAOI;;AAGT,eAAsBK,wBAAwBnB,SAAkB;CAC9D,MAAMoB,cAAc,MAAMpB,QAAQqB,GAAGC,KACnCvB,2BAA2BC,QAC7B,CAAC;AACD,KAAI,CAACoB,eAAe,CAACA,YAAYG,OAC/B,OAAM,IAAIC,MACR,+BAA+BzB,2BAA2BC,QAAQ,CAAA,WACnE;AAGHA,SAAQG,WAAWY,uBAAuBU,KAAKC,MAAMN,YAAY,CAAC;;AAGpE,eAAsBO,yBAAyB3B,SAAkB;CAC/D,MAAM4B,WAAW7B,2BAA2BC,QAAQ;AAEpD,OAAMA,QAAQqB,GAAGQ,MACfD,UACAH,KAAKK,UACH5B,sBAAsBF,QAAQG,SAAS,EACvC,MACAH,QAAQ+B,OAAOC,SAAS,gBAAgB,IAAI,EAEhD,CAAC"}
@@ -43,4 +43,5 @@ async function writeCommandsPersistence(context) {
43
43
  }
44
44
 
45
45
  //#endregion
46
- export { getCommandsPersistencePath, readCommandsPersistence, writeCommandsPersistence };
46
+ export { getCommandsPersistencePath, readCommandsPersistence, writeCommandsPersistence };
47
+ //# sourceMappingURL=persistence.mjs.map