@shell-shock/preset-script 0.6.23 → 0.6.27
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.
- package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -1
- package/dist/_virtual/_rolldown/runtime.mjs +3 -0
- package/dist/components/banner-function-declaration.cjs +28 -27
- package/dist/components/banner-function-declaration.cjs.map +1 -1
- package/dist/components/banner-function-declaration.d.cts.map +1 -1
- package/dist/components/banner-function-declaration.d.mts.map +1 -1
- package/dist/components/banner-function-declaration.mjs +2 -2
- package/dist/components/banner-function-declaration.mjs.map +1 -1
- package/dist/components/bin-entry.cjs +54 -45
- package/dist/components/bin-entry.cjs.map +1 -1
- package/dist/components/bin-entry.d.cts +0 -1
- package/dist/components/bin-entry.d.cts.map +1 -1
- package/dist/components/bin-entry.d.mts +0 -1
- package/dist/components/bin-entry.d.mts.map +1 -1
- package/dist/components/bin-entry.mjs +17 -9
- package/dist/components/bin-entry.mjs.map +1 -1
- package/dist/components/command-entry.cjs +76 -235
- package/dist/components/command-entry.cjs.map +1 -1
- package/dist/components/command-entry.d.cts +1 -8
- package/dist/components/command-entry.d.cts.map +1 -1
- package/dist/components/command-entry.d.mts +2 -9
- package/dist/components/command-entry.d.mts.map +1 -1
- package/dist/components/command-entry.mjs +24 -183
- package/dist/components/command-entry.mjs.map +1 -1
- package/dist/components/command-router.cjs +85 -83
- package/dist/components/command-router.cjs.map +1 -1
- package/dist/components/command-router.d.cts.map +1 -1
- package/dist/components/command-router.d.mts.map +1 -1
- package/dist/components/command-router.mjs +59 -58
- package/dist/components/command-router.mjs.map +1 -1
- package/dist/components/exit-function-declaration.cjs +38 -37
- package/dist/components/exit-function-declaration.cjs.map +1 -1
- package/dist/components/exit-function-declaration.d.cts +2 -2
- package/dist/components/exit-function-declaration.d.cts.map +1 -1
- package/dist/components/exit-function-declaration.d.mts +2 -2
- package/dist/components/exit-function-declaration.d.mts.map +1 -1
- package/dist/components/exit-function-declaration.mjs +3 -3
- package/dist/components/exit-function-declaration.mjs.map +1 -1
- package/dist/components/index.cjs +2 -9
- package/dist/components/index.d.cts +2 -3
- package/dist/components/index.d.mts +2 -3
- package/dist/components/index.mjs +2 -3
- package/dist/components/virtual-command-entry.cjs +43 -59
- package/dist/components/virtual-command-entry.cjs.map +1 -1
- package/dist/components/virtual-command-entry.d.cts.map +1 -1
- package/dist/components/virtual-command-entry.d.mts.map +1 -1
- package/dist/components/virtual-command-entry.mjs +13 -30
- package/dist/components/virtual-command-entry.mjs.map +1 -1
- package/dist/helpers/get-default-options.cjs +8 -7
- package/dist/helpers/get-default-options.cjs.map +1 -1
- package/dist/helpers/get-default-options.d.cts +0 -1
- package/dist/helpers/get-default-options.d.cts.map +1 -1
- package/dist/helpers/get-default-options.d.mts +0 -1
- package/dist/helpers/get-default-options.d.mts.map +1 -1
- package/dist/helpers/get-default-options.mjs.map +1 -1
- package/dist/index.cjs +30 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +8 -20
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-help/dist/components/display.cjs +260 -0
- package/dist/plugin-help/dist/components/display.cjs.map +1 -0
- package/dist/{components/help.mjs → plugin-help/dist/components/display.mjs} +26 -30
- package/dist/plugin-help/dist/components/display.mjs.map +1 -0
- package/dist/plugin-help/dist/components/help-builtin.cjs +86 -0
- package/dist/plugin-help/dist/components/help-builtin.cjs.map +1 -0
- package/dist/plugin-help/dist/components/help-builtin.mjs +84 -0
- package/dist/plugin-help/dist/components/help-builtin.mjs.map +1 -0
- package/dist/plugin-help/dist/components/help-command.cjs +97 -0
- package/dist/plugin-help/dist/components/help-command.cjs.map +1 -0
- package/dist/plugin-help/dist/components/help-command.mjs +96 -0
- package/dist/plugin-help/dist/components/help-command.mjs.map +1 -0
- package/dist/plugin-help/dist/components/index.cjs +3 -0
- package/dist/plugin-help/dist/components/index.mjs +5 -0
- package/dist/plugin-help/dist/index.cjs +104 -0
- package/dist/plugin-help/dist/index.cjs.map +1 -0
- package/dist/plugin-help/dist/index.d.cts +2 -0
- package/dist/plugin-help/dist/index.d.mts +2 -0
- package/dist/plugin-help/dist/index.mjs +100 -0
- package/dist/plugin-help/dist/index.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.cjs +18 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.mjs +17 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.cjs +39 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.mjs +38 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.cjs +34 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs +34 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.cjs +41 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs +41 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.cjs +18 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.mjs +17 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.cjs +21 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.mjs +21 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-null.cjs +13 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-null.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-null.mjs +12 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-null.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.cjs +21 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.mjs +21 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set.cjs +20 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set.mjs +20 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-string.cjs +13 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-string.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-string.mjs +12 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-string.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-undefined.cjs +9 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-undefined.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-undefined.mjs +8 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-undefined.mjs.map +1 -0
- package/dist/plugin-help/dist/types/plugin.d.cts +62 -0
- package/dist/plugin-help/dist/types/plugin.d.cts.map +1 -0
- package/dist/plugin-help/dist/types/plugin.d.mts +62 -0
- package/dist/plugin-help/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.d.cts +9 -9
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +9 -9
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +15 -29
- package/dist/components/help.cjs +0 -264
- package/dist/components/help.cjs.map +0 -1
- package/dist/components/help.d.cts +0 -105
- package/dist/components/help.d.cts.map +0 -1
- package/dist/components/help.d.mts +0 -105
- package/dist/components/help.d.mts.map +0 -1
- package/dist/components/help.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shell-shock/preset-script",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.27",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Shell Shock preset that generates a fully-featured script application.",
|
|
6
6
|
"keywords": [
|
|
@@ -59,7 +59,6 @@
|
|
|
59
59
|
"default": "./dist/index.mjs"
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
-
"./*": "./*",
|
|
63
62
|
"./components": {
|
|
64
63
|
"require": {
|
|
65
64
|
"types": "./dist/components/index.d.cts",
|
|
@@ -144,20 +143,6 @@
|
|
|
144
143
|
"default": "./dist/components/exit-function-declaration.mjs"
|
|
145
144
|
}
|
|
146
145
|
},
|
|
147
|
-
"./components/help": {
|
|
148
|
-
"require": {
|
|
149
|
-
"types": "./dist/components/help.d.cts",
|
|
150
|
-
"default": "./dist/components/help.cjs"
|
|
151
|
-
},
|
|
152
|
-
"import": {
|
|
153
|
-
"types": "./dist/components/help.d.mts",
|
|
154
|
-
"default": "./dist/components/help.mjs"
|
|
155
|
-
},
|
|
156
|
-
"default": {
|
|
157
|
-
"types": "./dist/components/help.d.mts",
|
|
158
|
-
"default": "./dist/components/help.mjs"
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
146
|
"./components/virtual-command-entry": {
|
|
162
147
|
"require": {
|
|
163
148
|
"types": "./dist/components/virtual-command-entry.d.cts",
|
|
@@ -186,6 +171,7 @@
|
|
|
186
171
|
"default": "./dist/helpers/get-default-options.mjs"
|
|
187
172
|
}
|
|
188
173
|
},
|
|
174
|
+
"./package.json": "./package.json",
|
|
189
175
|
"./types": {
|
|
190
176
|
"require": {
|
|
191
177
|
"types": "./dist/types/index.d.cts",
|
|
@@ -223,23 +209,23 @@
|
|
|
223
209
|
"dependencies": {
|
|
224
210
|
"@alloy-js/core": "0.23.0-dev.8",
|
|
225
211
|
"@alloy-js/typescript": "0.23.0-dev.4",
|
|
226
|
-
"@powerlines/deepkit": "^0.6.
|
|
227
|
-
"@powerlines/plugin-alloy": "^0.
|
|
228
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
229
|
-
"@shell-shock/core": "^0.
|
|
230
|
-
"@shell-shock/plugin-console": "^0.1.
|
|
231
|
-
"@shell-shock/plugin-theme": "^0.3.
|
|
232
|
-
"@stryke/helpers": "^0.
|
|
233
|
-
"@stryke/path": "^0.
|
|
234
|
-
"@stryke/string-format": "^0.
|
|
212
|
+
"@powerlines/deepkit": "^0.6.134",
|
|
213
|
+
"@powerlines/plugin-alloy": "^0.25.41",
|
|
214
|
+
"@powerlines/plugin-plugin": "^0.12.306",
|
|
215
|
+
"@shell-shock/core": "^0.13.1",
|
|
216
|
+
"@shell-shock/plugin-console": "^0.1.12",
|
|
217
|
+
"@shell-shock/plugin-theme": "^0.3.16",
|
|
218
|
+
"@stryke/helpers": "^0.10.6",
|
|
219
|
+
"@stryke/path": "^0.27.2",
|
|
220
|
+
"@stryke/string-format": "^0.17.6",
|
|
235
221
|
"defu": "^6.1.4",
|
|
236
|
-
"powerlines": "^0.
|
|
222
|
+
"powerlines": "^0.41.20"
|
|
237
223
|
},
|
|
238
224
|
"devDependencies": {
|
|
239
225
|
"@babel/core": "^7.29.0",
|
|
240
|
-
"@powerlines/plugin-alloy": "^0.
|
|
241
|
-
"@types/node": "^25.
|
|
226
|
+
"@powerlines/plugin-alloy": "^0.25.41",
|
|
227
|
+
"@types/node": "^25.5.0"
|
|
242
228
|
},
|
|
243
229
|
"publishConfig": { "access": "public" },
|
|
244
|
-
"gitHead": "
|
|
230
|
+
"gitHead": "86c55189ed02d126fb583cf6d2555266f00d0f3a"
|
|
245
231
|
}
|
package/dist/components/help.cjs
DELETED
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
3
|
-
let __alloy_js_core = require("@alloy-js/core");
|
|
4
|
-
let __powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
5
|
-
let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
6
|
-
let __shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
7
|
-
let __shell_shock_plugin_theme_contexts_theme = require("@shell-shock/plugin-theme/contexts/theme");
|
|
8
|
-
let __shell_shock_core = require("@shell-shock/core");
|
|
9
|
-
let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
10
|
-
let __stryke_string_format_snake_case = require("@stryke/string-format/snake-case");
|
|
11
|
-
|
|
12
|
-
//#region src/components/help.tsx
|
|
13
|
-
/**
|
|
14
|
-
* A component that generates the usage display for a command.
|
|
15
|
-
*/
|
|
16
|
-
function HelpUsage(props) {
|
|
17
|
-
const { command, indent = 2 } = props;
|
|
18
|
-
const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
19
|
-
const theme = (0, __shell_shock_plugin_theme_contexts_theme.useTheme)();
|
|
20
|
-
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
21
|
-
get each() {
|
|
22
|
-
return Object.keys(context.config.bin);
|
|
23
|
-
},
|
|
24
|
-
hardline: true,
|
|
25
|
-
children: (bin) => [(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`
|
|
26
|
-
writeLine(
|
|
27
|
-
colors.text.body.secondary(\`\$ \${colors.text.usage.bin("${bin}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${colors.text.usage.${(0, __shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? "dynamic" : "command"}("${(0, __shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? `[${(0, __stryke_string_format_snake_case.snakeCase)((0, __shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment))}]` : segment}")}`).join(" ")}` : ""}${Object.values(command.children).length > 0 ? ` \${colors.text.usage.dynamic("[command]")}` : ""}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${colors.text.usage.args("<${(0, __stryke_string_format_snake_case.snakeCase)((arg.kind === __shell_shock_core.CommandParameterKinds.string || arg.kind === __shell_shock_core.CommandParameterKinds.number) && arg.choices && arg.choices.length > 0 ? arg.choices.join("|") : arg.kind === __shell_shock_core.CommandParameterKinds.string && arg.format ? arg.format : arg.name)}${(arg.kind === __shell_shock_core.CommandParameterKinds.string || arg.kind === __shell_shock_core.CommandParameterKinds.number) && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""} \${colors.text.usage.options("[options]")}\`), { padding: ${theme.padding.app * indent} }
|
|
28
|
-
);`), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})]
|
|
29
|
-
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
30
|
-
get when() {
|
|
31
|
-
return command.args.length > 0;
|
|
32
|
-
},
|
|
33
|
-
get children() {
|
|
34
|
-
return [(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
35
|
-
get each() {
|
|
36
|
-
return Object.keys(context.config.bin);
|
|
37
|
-
},
|
|
38
|
-
hardline: true,
|
|
39
|
-
children: (bin) => [(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`
|
|
40
|
-
writeLine(
|
|
41
|
-
colors.text.body.secondary(\`\$ \${colors.text.usage.bin("${bin}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${colors.text.usage.${(0, __shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? "dynamic" : "command"}("${(0, __shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? `[${(0, __stryke_string_format_snake_case.snakeCase)((0, __shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment))}]` : segment}")}`).join(" ")}` : ""}${Object.values(command.children).length > 0 ? ` \${colors.text.usage.dynamic("[command]")}` : ""} \${colors.text.usage.options("[options]")}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${colors.text.usage.args("<${(0, __stryke_string_format_snake_case.snakeCase)((arg.kind === __shell_shock_core.CommandParameterKinds.string || arg.kind === __shell_shock_core.CommandParameterKinds.number) && arg.choices && arg.choices.length > 0 ? arg.choices.join("|") : arg.kind === __shell_shock_core.CommandParameterKinds.string && arg.format ? arg.format : arg.name)}${(arg.kind === __shell_shock_core.CommandParameterKinds.string || arg.kind === __shell_shock_core.CommandParameterKinds.number) && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""}\`), { padding: ${theme.padding.app * indent} }
|
|
42
|
-
);`), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})]
|
|
43
|
-
})];
|
|
44
|
-
}
|
|
45
|
-
})];
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* A component that generates the options table display for a command.
|
|
49
|
-
*/
|
|
50
|
-
function HelpOptions(props) {
|
|
51
|
-
const { options } = props;
|
|
52
|
-
const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
53
|
-
return [
|
|
54
|
-
__alloy_js_core.code`table([ `,
|
|
55
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
56
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
57
|
-
get each() {
|
|
58
|
-
return (0, __shell_shock_core_plugin_utils.sortOptions)(options);
|
|
59
|
-
},
|
|
60
|
-
hardline: true,
|
|
61
|
-
children: (option) => {
|
|
62
|
-
const flags = [];
|
|
63
|
-
const names = [];
|
|
64
|
-
if (option.name.length === 1) flags.push(`-${option.name}`);
|
|
65
|
-
else names.push(`--${(0, __stryke_string_format_kebab_case.kebabCase)(option.name)}`);
|
|
66
|
-
option.alias.forEach((alias) => {
|
|
67
|
-
if (alias.length === 1) flags.push(`-${alias}`);
|
|
68
|
-
else names.push(`--${(0, __stryke_string_format_kebab_case.kebabCase)(alias)}`);
|
|
69
|
-
});
|
|
70
|
-
return __alloy_js_core.code`[{ value: colors.text.body.primary("${flags.length > 0 ? `${flags.sort().join(", ")}${names.length > 0 ? ", " : ""}` : ""}${names.length > 0 ? names.sort().join(", ") : ""}${option.kind === __shell_shock_core.CommandParameterKinds.string ? ` <${(0, __stryke_string_format_snake_case.snakeCase)(option.choices && option.choices.length > 0 ? option.choices.join("|") : option.format ? option.format : option.name)}${option.variadic ? "..." : ""}>` : option.kind === __shell_shock_core.CommandParameterKinds.number ? ` <${(0, __stryke_string_format_snake_case.snakeCase)(option.choices && option.choices.length > 0 ? option.choices.join("|") : option.name)}${option.variadic ? "..." : ""}>` : ""}"), align: "right", border: "none", maxWidth: "1/3" }, { value: colors.text.body.tertiary(\`${(0, __shell_shock_core_plugin_utils.formatShortDescription)(option.description).replace(/\.+$/, "").trim()}${option.env || option.default !== void 0 ? ` (${option.env ? `env: ${context.config.appSpecificEnvPrefix}_${option.env}${option.default !== void 0 ? ", " : ""}` : ""}${option.default !== void 0 ? `default: ${JSON.stringify(option.default).replace(/"/g, "\\\"")}` : ""})` : ""}.\`), align: "left", border: "none" }], `;
|
|
71
|
-
}
|
|
72
|
-
}),
|
|
73
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
74
|
-
__alloy_js_core.code` ]); `
|
|
75
|
-
];
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* A component that generates the commands table display for a command.
|
|
79
|
-
*/
|
|
80
|
-
function HelpCommands(props) {
|
|
81
|
-
const { commands } = props;
|
|
82
|
-
return [
|
|
83
|
-
__alloy_js_core.code`table([ `,
|
|
84
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
85
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
86
|
-
get each() {
|
|
87
|
-
return Object.values(commands);
|
|
88
|
-
},
|
|
89
|
-
hardline: true,
|
|
90
|
-
children: (child) => __alloy_js_core.code`[{ value: colors.text.body.primary("${child.name}"), align: "right", border: "none" }, { value: colors.text.body.tertiary(\`${(0, __shell_shock_core_plugin_utils.formatShortDescription)(child.description).replace(/\.+$/, "").trim()}.\`), align: "left", border: "none" }], `
|
|
91
|
-
}),
|
|
92
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
93
|
-
__alloy_js_core.code` ]); `
|
|
94
|
-
];
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* A component that generates the `help` function declaration for a command.
|
|
98
|
-
*/
|
|
99
|
-
function BaseHelp(props) {
|
|
100
|
-
const { command, indent = 1, filterGlobalOptions = false } = props;
|
|
101
|
-
const theme = (0, __shell_shock_plugin_theme_contexts_theme.useTheme)();
|
|
102
|
-
const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
103
|
-
const options = (0, __alloy_js_core.computed)(() => filterGlobalOptions ? Object.values(command.options).filter((option) => !context.options.some((globalOption) => globalOption.name === option.name || option.alias.includes(globalOption.name) || globalOption.alias?.includes(option.name) || globalOption.alias?.some((alias) => option.alias.includes(alias)))) : Object.values(command.options));
|
|
104
|
-
return [
|
|
105
|
-
(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`writeLine(colors.bold(colors.text.heading.secondary("Usage:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
|
|
106
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
107
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(HelpUsage, {
|
|
108
|
-
command,
|
|
109
|
-
indent
|
|
110
|
-
}),
|
|
111
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
112
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
113
|
-
get when() {
|
|
114
|
-
return options.value.length > 0;
|
|
115
|
-
},
|
|
116
|
-
get children() {
|
|
117
|
-
return [
|
|
118
|
-
(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`writeLine("");
|
|
119
|
-
writeLine(colors.bold(colors.text.heading.secondary("Options:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
|
|
120
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
121
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(HelpOptions, { get options() {
|
|
122
|
-
return options.value;
|
|
123
|
-
} }),
|
|
124
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
125
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
126
|
-
];
|
|
127
|
-
}
|
|
128
|
-
}),
|
|
129
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
130
|
-
get when() {
|
|
131
|
-
return Object.keys(command.children).length > 0;
|
|
132
|
-
},
|
|
133
|
-
get children() {
|
|
134
|
-
return [
|
|
135
|
-
(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`writeLine("");
|
|
136
|
-
writeLine(colors.bold(colors.text.heading.secondary("Commands:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
|
|
137
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
138
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(HelpCommands, { get commands() {
|
|
139
|
-
return command.children;
|
|
140
|
-
} }),
|
|
141
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
142
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
143
|
-
];
|
|
144
|
-
}
|
|
145
|
-
})
|
|
146
|
-
];
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* A component that generates the invocation of the `help` function for a command.
|
|
150
|
-
*/
|
|
151
|
-
function VirtualHelp(props) {
|
|
152
|
-
const { options, segments, commands } = props;
|
|
153
|
-
const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
154
|
-
return [
|
|
155
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
156
|
-
__alloy_js_core.code`writeLine(colors.bold(colors.text.heading.secondary("Global Options:")));`,
|
|
157
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
158
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(HelpOptions, { options }),
|
|
159
|
-
__alloy_js_core.code`writeLine(""); `,
|
|
160
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
161
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
162
|
-
get when() {
|
|
163
|
-
return Object.keys(commands).length > 0;
|
|
164
|
-
},
|
|
165
|
-
get children() {
|
|
166
|
-
return [
|
|
167
|
-
__alloy_js_core.code`writeLine(colors.text.body.secondary("The following commands are available:"));
|
|
168
|
-
writeLine(""); `,
|
|
169
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
170
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
171
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
172
|
-
get each() {
|
|
173
|
-
return Object.values(commands);
|
|
174
|
-
},
|
|
175
|
-
doubleHardline: true,
|
|
176
|
-
joiner: __alloy_js_core.code`writeLine(""); `,
|
|
177
|
-
ender: __alloy_js_core.code`writeLine(""); `,
|
|
178
|
-
children: (child) => [
|
|
179
|
-
(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`
|
|
180
|
-
writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}"${child.title} ${child.isVirtual ? "" : "Command"}"));
|
|
181
|
-
writeLine("");
|
|
182
|
-
writeLine(colors.text.body.secondary(splitText(\`${(0, __shell_shock_core_plugin_utils.formatDescription)(child.description).replace(/\.+$/, "").trim()}.\`)));
|
|
183
|
-
writeLine("");
|
|
184
|
-
`),
|
|
185
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
186
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(BaseHelp, {
|
|
187
|
-
command: child,
|
|
188
|
-
indent: 2,
|
|
189
|
-
filterGlobalOptions: true
|
|
190
|
-
}),
|
|
191
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
192
|
-
]
|
|
193
|
-
}),
|
|
194
|
-
(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`help("Running a specific command with the help flag (via: '${(0, __shell_shock_core_plugin_utils.getAppBin)(context)}${segments && segments.length > 0 ? ` ${segments.join(" ")}` : ""} <specific command> --help') will provide additional information that is specific to that command.");
|
|
195
|
-
writeLine("");`)
|
|
196
|
-
];
|
|
197
|
-
}
|
|
198
|
-
})
|
|
199
|
-
];
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* A component that generates the invocation of the `help` function for a command.
|
|
203
|
-
*/
|
|
204
|
-
function CommandHelp(props) {
|
|
205
|
-
const { command } = props;
|
|
206
|
-
const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
207
|
-
return [
|
|
208
|
-
__alloy_js_core.code`writeLine(""); `,
|
|
209
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
210
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(BaseHelp, {
|
|
211
|
-
command,
|
|
212
|
-
filterGlobalOptions: false
|
|
213
|
-
}),
|
|
214
|
-
__alloy_js_core.code`writeLine(""); `,
|
|
215
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
216
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
217
|
-
get when() {
|
|
218
|
-
return Object.keys(command.children).length > 0;
|
|
219
|
-
},
|
|
220
|
-
get children() {
|
|
221
|
-
return [
|
|
222
|
-
__alloy_js_core.code`writeLine(colors.text.body.secondary("The following sub-commands are available:"));
|
|
223
|
-
writeLine(""); `,
|
|
224
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
225
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
226
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
227
|
-
get each() {
|
|
228
|
-
return Object.values(command.children);
|
|
229
|
-
},
|
|
230
|
-
doubleHardline: true,
|
|
231
|
-
joiner: __alloy_js_core.code`writeLine(""); `,
|
|
232
|
-
ender: __alloy_js_core.code`writeLine(""); `,
|
|
233
|
-
children: (child) => [
|
|
234
|
-
(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`
|
|
235
|
-
writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}"${child.title} ${child.isVirtual ? "" : "Command"}"));
|
|
236
|
-
writeLine("");
|
|
237
|
-
writeLine(colors.text.body.secondary(splitText(\`${(0, __shell_shock_core_plugin_utils.formatDescription)(child.description).replace(/\.+$/, "").trim()}.\`)));
|
|
238
|
-
writeLine("");
|
|
239
|
-
`),
|
|
240
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
241
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(BaseHelp, {
|
|
242
|
-
command: child,
|
|
243
|
-
indent: 2,
|
|
244
|
-
filterGlobalOptions: true
|
|
245
|
-
}),
|
|
246
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
247
|
-
]
|
|
248
|
-
}),
|
|
249
|
-
(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`help("Running a specific command with the help flag (via: '${(0, __shell_shock_core_plugin_utils.getAppBin)(context)} ${command.segments.join(" ")} <specific command> --help') will provide additional information that is specific to that command.");
|
|
250
|
-
writeLine("");`)
|
|
251
|
-
];
|
|
252
|
-
}
|
|
253
|
-
})
|
|
254
|
-
];
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
//#endregion
|
|
258
|
-
exports.BaseHelp = BaseHelp;
|
|
259
|
-
exports.CommandHelp = CommandHelp;
|
|
260
|
-
exports.HelpCommands = HelpCommands;
|
|
261
|
-
exports.HelpOptions = HelpOptions;
|
|
262
|
-
exports.HelpUsage = HelpUsage;
|
|
263
|
-
exports.VirtualHelp = VirtualHelp;
|
|
264
|
-
//# sourceMappingURL=help.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"help.cjs","names":["code","computed","For","Show","Spacing","usePowerlines","CommandParameterKinds","formatDescription","formatShortDescription","getAppBin","getDynamicPathSegmentName","isDynamicPathSegment","sortOptions","useTheme","kebabCase","snakeCase","HelpUsage","props","command","indent","context","theme","_$createComponent","each","Object","keys","config","bin","hardline","children","_$memo","segments","length","map","segment","join","values","args","arg","kind","string","number","choices","format","name","variadic","padding","app","_$createIntrinsic","when","HelpOptions","options","option","flags","names","push","alias","forEach","sort","description","replace","trim","env","default","undefined","appSpecificEnvPrefix","JSON","stringify","HelpCommands","commands","child","BaseHelp","filterGlobalOptions","filter","some","globalOption","includes","value","VirtualHelp","doubleHardline","joiner","ender","icon","title","isVirtual","CommandHelp"],"sources":["../../src/components/help.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, computed, For, Show } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { CommandOption, CommandTree } from \"@shell-shock/core\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\nimport {\n formatDescription,\n formatShortDescription,\n getAppBin,\n getDynamicPathSegmentName,\n isDynamicPathSegment,\n sortOptions\n} from \"@shell-shock/core/plugin-utils\";\nimport { useTheme } from \"@shell-shock/plugin-theme/contexts/theme\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { snakeCase } from \"@stryke/string-format/snake-case\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\n\nexport interface HelpUsageProps {\n /**\n * The command to generate help for.\n */\n command: CommandTree;\n\n /**\n * The padding scale to apply to the help display headings.\n *\n * @remarks\n * This value is multiplied by the theme's app padding to determine the final padding.\n *\n * @defaultValue 2\n */\n indent?: number;\n}\n\n/**\n * A component that generates the usage display for a command.\n */\nexport function HelpUsage(props: HelpUsageProps) {\n const { command, indent = 2 } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n const theme = useTheme();\n\n return (\n <>\n <For each={Object.keys(context.config.bin)} hardline>\n {bin => (\n <>\n {code`\n writeLine(\n colors.text.body.secondary(\\`\\$ \\${colors.text.usage.bin(\"${bin}\")}${\n command.segments.length > 0\n ? ` ${command.segments\n .map(\n segment =>\n `\\${colors.text.usage.${isDynamicPathSegment(segment) ? \"dynamic\" : \"command\"}(\"${\n isDynamicPathSegment(segment)\n ? `[${snakeCase(getDynamicPathSegmentName(segment))}]`\n : segment\n }\")}`\n )\n .join(\" \")}`\n : \"\"\n }${Object.values(command.children).length > 0 ? ` \\${colors.text.usage.dynamic(\"[command]\")}` : \"\"}${\n command.args.length > 0\n ? ` ${command.args\n .map(\n arg =>\n `\\${colors.text.usage.args(\"<${snakeCase(\n (arg.kind === CommandParameterKinds.string ||\n arg.kind === CommandParameterKinds.number) &&\n arg.choices &&\n arg.choices.length > 0\n ? arg.choices.join(\"|\")\n : arg.kind === CommandParameterKinds.string &&\n arg.format\n ? arg.format\n : arg.name\n )}${\n (arg.kind === CommandParameterKinds.string ||\n arg.kind === CommandParameterKinds.number) &&\n arg.variadic\n ? \"...\"\n : \"\"\n }>\")}`\n )\n .join(\" \")}`\n : \"\"\n } \\${colors.text.usage.options(\"[options]\")}\\`), { padding: ${theme.padding.app * indent} }\n );`}\n <hbr />\n </>\n )}\n </For>\n <Show when={command.args.length > 0}>\n <hbr />\n <For each={Object.keys(context.config.bin)} hardline>\n {bin => (\n <>\n {code`\n writeLine(\n colors.text.body.secondary(\\`\\$ \\${colors.text.usage.bin(\"${bin}\")}${\n command.segments.length > 0\n ? ` ${command.segments\n .map(\n segment =>\n `\\${colors.text.usage.${isDynamicPathSegment(segment) ? \"dynamic\" : \"command\"}(\"${\n isDynamicPathSegment(segment)\n ? `[${snakeCase(getDynamicPathSegmentName(segment))}]`\n : segment\n }\")}`\n )\n .join(\" \")}`\n : \"\"\n }${Object.values(command.children).length > 0 ? ` \\${colors.text.usage.dynamic(\"[command]\")}` : \"\"} \\${colors.text.usage.options(\"[options]\")}${\n command.args.length > 0\n ? ` ${command.args\n .map(\n arg =>\n `\\${colors.text.usage.args(\"<${snakeCase(\n (arg.kind === CommandParameterKinds.string ||\n arg.kind === CommandParameterKinds.number) &&\n arg.choices &&\n arg.choices.length > 0\n ? arg.choices.join(\"|\")\n : arg.kind === CommandParameterKinds.string &&\n arg.format\n ? arg.format\n : arg.name\n )}${\n (arg.kind === CommandParameterKinds.string ||\n arg.kind === CommandParameterKinds.number) &&\n arg.variadic\n ? \"...\"\n : \"\"\n }>\")}`\n )\n .join(\" \")}`\n : \"\"\n }\\`), { padding: ${theme.padding.app * indent} }\n );`}\n <hbr />\n </>\n )}\n </For>\n </Show>\n </>\n );\n}\n\nexport interface HelpOptionsProps {\n /**\n * The options to display help for.\n */\n options: CommandOption[];\n}\n\n/**\n * A component that generates the options table display for a command.\n */\nexport function HelpOptions(props: HelpOptionsProps) {\n const { options } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n {code`table([ `}\n <hbr />\n <For each={sortOptions(options)} hardline>\n {option => {\n const flags = [] as string[];\n const names = [] as string[];\n if (option.name.length === 1) {\n flags.push(`-${option.name}`);\n } else {\n names.push(`--${kebabCase(option.name)}`);\n }\n\n option.alias.forEach((alias: string) => {\n if (alias.length === 1) {\n flags.push(`-${alias}`);\n } else {\n names.push(`--${kebabCase(alias)}`);\n }\n });\n\n return code`[{ value: colors.text.body.primary(\"${\n flags.length > 0\n ? `${flags.sort().join(\", \")}${names.length > 0 ? \", \" : \"\"}`\n : \"\"\n }${names.length > 0 ? names.sort().join(\", \") : \"\"}${\n option.kind === CommandParameterKinds.string\n ? ` <${snakeCase(\n option.choices && option.choices.length > 0\n ? option.choices.join(\"|\")\n : option.format\n ? option.format\n : option.name\n )}${option.variadic ? \"...\" : \"\"}>`\n : option.kind === CommandParameterKinds.number\n ? ` <${snakeCase(\n option.choices && option.choices.length > 0\n ? option.choices.join(\"|\")\n : option.name\n )}${option.variadic ? \"...\" : \"\"}>`\n : \"\"\n }\"), align: \"right\", border: \"none\", maxWidth: \"1/3\" }, { value: colors.text.body.tertiary(\\`${formatShortDescription(\n option.description\n )\n .replace(/\\.+$/, \"\")\n .trim()}${\n option.env || option.default !== undefined\n ? ` (${\n option.env\n ? `env: ${context.config.appSpecificEnvPrefix}_${option.env}${\n option.default !== undefined ? \", \" : \"\"\n }`\n : \"\"\n }${\n option.default !== undefined\n ? `default: ${JSON.stringify(option.default).replace(/\"/g, '\\\\\"')}`\n : \"\"\n })`\n : \"\"\n }.\\`), align: \"left\", border: \"none\" }], `;\n }}\n </For>\n <hbr />\n {code` ]); `}\n </>\n );\n}\n\nexport interface HelpCommandsProps {\n /**\n * A mapping of command names to their command definitions.\n */\n commands: Record<string, CommandTree>;\n}\n\n/**\n * A component that generates the commands table display for a command.\n */\nexport function HelpCommands(props: HelpCommandsProps) {\n const { commands } = props;\n\n return (\n <>\n {code`table([ `}\n <hbr />\n <For each={Object.values(commands)} hardline>\n {child =>\n code`[{ value: colors.text.body.primary(\"${\n child.name\n }\"), align: \"right\", border: \"none\" }, { value: colors.text.body.tertiary(\\`${formatShortDescription(\n child.description\n )\n .replace(/\\.+$/, \"\")\n .trim()}.\\`), align: \"left\", border: \"none\" }], `\n }\n </For>\n <hbr />\n {code` ]); `}\n </>\n );\n}\n\nexport interface BaseHelpProps {\n /**\n * The command to generate help for.\n */\n command: CommandTree;\n\n /**\n * Whether to filter out global options from the help display.\n *\n * @remarks\n * When enabled, any options that are present in the global options context will be filtered out from the help display. This is useful for sub-commands to avoid displaying global options that are not relevant to the specific command.\n *\n * @defaultValue false\n */\n filterGlobalOptions?: boolean;\n\n /**\n * The padding scale to apply to the help display headings.\n *\n * @remarks\n * This value is multiplied by the theme's app padding to determine the final padding.\n *\n * @defaultValue 1\n */\n indent?: number;\n}\n\n/**\n * A component that generates the `help` function declaration for a command.\n */\nexport function BaseHelp(props: BaseHelpProps) {\n const { command, indent = 1, filterGlobalOptions = false } = props;\n\n const theme = useTheme();\n const context = usePowerlines<ScriptPresetContext>();\n\n const options = computed(() =>\n filterGlobalOptions\n ? Object.values(command.options).filter(\n option =>\n !context.options.some(\n globalOption =>\n globalOption.name === option.name ||\n option.alias.includes(globalOption.name) ||\n globalOption.alias?.includes(option.name) ||\n globalOption.alias?.some(alias => option.alias.includes(alias))\n )\n )\n : Object.values(command.options)\n );\n\n return (\n <>\n {code`writeLine(colors.bold(colors.text.heading.secondary(\"Usage:\"))${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <HelpUsage command={command} indent={indent} />\n <Spacing />\n <Show when={options.value.length > 0}>\n {code`writeLine(\"\");\n writeLine(colors.bold(colors.text.heading.secondary(\"Options:\"))${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <HelpOptions options={options.value} />\n <hbr />\n <hbr />\n </Show>\n <Show when={Object.keys(command.children).length > 0}>\n {code`writeLine(\"\");\n writeLine(colors.bold(colors.text.heading.secondary(\"Commands:\"))${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <HelpCommands commands={command.children} />\n <hbr />\n <hbr />\n </Show>\n </>\n );\n}\n\nexport interface VirtualHelpProps {\n /**\n * The options to display help for.\n */\n options: CommandOption[];\n\n /**\n * A mapping of command names to their command definitions.\n */\n commands: Record<string, CommandTree>;\n\n /**\n * The command path to generate help for, used for generating the help invocation instructions.\n *\n * @remarks\n * This is optional since the virtual command entry component can be used for both the global binary executable and virtual commands (there will be no command definition for the binary executable).\n */\n segments?: string[];\n}\n\n/**\n * A component that generates the invocation of the `help` function for a command.\n */\nexport function VirtualHelp(props: VirtualHelpProps) {\n const { options, segments, commands } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <hbr />\n {code`writeLine(colors.bold(colors.text.heading.secondary(\"Global Options:\")));`}\n <hbr />\n <HelpOptions options={options} />\n {code`writeLine(\"\"); `}\n <Spacing />\n <Show when={Object.keys(commands).length > 0}>\n {code`writeLine(colors.text.body.secondary(\"The following commands are available:\"));\n writeLine(\"\"); `}\n <hbr />\n <hbr />\n <For\n each={Object.values(commands)}\n doubleHardline\n joiner={code`writeLine(\"\"); `}\n ender={code`writeLine(\"\"); `}>\n {child => (\n <>\n {code`\n writeLine(colors.text.heading.primary(${\n child.icon\n ? `(isUnicodeSupported ? \" ${child.icon} \" : \"\") + `\n : \"\"\n }\"${child.title} ${child.isVirtual ? \"\" : \"Command\"}\"));\n writeLine(\"\");\n writeLine(colors.text.body.secondary(splitText(\\`${formatDescription(\n child.description\n )\n .replace(/\\.+$/, \"\")\n .trim()}.\\`)));\n writeLine(\"\");\n `}\n <hbr />\n <BaseHelp command={child} indent={2} filterGlobalOptions />\n <hbr />\n </>\n )}\n </For>\n {code`help(\"Running a specific command with the help flag (via: '${getAppBin(\n context\n )}${\n segments && segments.length > 0 ? ` ${segments.join(\" \")}` : \"\"\n } <specific command> --help') will provide additional information that is specific to that command.\");\n writeLine(\"\");`}\n </Show>\n </>\n );\n}\n\nexport interface CommandHelpProps {\n /**\n * A mapping of command names to their command definitions.\n */\n command: CommandTree;\n}\n\n/**\n * A component that generates the invocation of the `help` function for a command.\n */\nexport function CommandHelp(props: CommandHelpProps) {\n const { command } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n {code`writeLine(\"\"); `}\n <Spacing />\n <BaseHelp command={command} filterGlobalOptions={false} />\n {code`writeLine(\"\"); `}\n <Spacing />\n <Show when={Object.keys(command.children).length > 0}>\n {code`writeLine(colors.text.body.secondary(\"The following sub-commands are available:\"));\n writeLine(\"\"); `}\n <hbr />\n <hbr />\n <For\n each={Object.values(command.children)}\n doubleHardline\n joiner={code`writeLine(\"\"); `}\n ender={code`writeLine(\"\"); `}>\n {child => (\n <>\n {code`\n writeLine(colors.text.heading.primary(${\n child.icon\n ? `(isUnicodeSupported ? \" ${child.icon} \" : \"\") + `\n : \"\"\n }\"${child.title} ${child.isVirtual ? \"\" : \"Command\"}\"));\n writeLine(\"\");\n writeLine(colors.text.body.secondary(splitText(\\`${formatDescription(\n child.description\n )\n .replace(/\\.+$/, \"\")\n .trim()}.\\`)));\n writeLine(\"\");\n `}\n <hbr />\n <BaseHelp command={child} indent={2} filterGlobalOptions />\n <hbr />\n </>\n )}\n </For>\n {code`help(\"Running a specific command with the help flag (via: '${getAppBin(\n context\n )} ${command.segments.join(\n \" \"\n )} <specific command> --help') will provide additional information that is specific to that command.\");\n writeLine(\"\");`}\n </Show>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAwDA,SAAgBgB,UAAUC,OAAuB;CAC/C,MAAM,EAAEC,SAASC,SAAS,MAAMF;CAEhC,MAAMG,8EAA8C;CACpD,MAAMC,iEAAkB;AAExB,QAAA,kDAEKnB,qBAAG;EAAA,IAACqB,OAAI;AAAA,UAAEC,OAAOC,KAAKL,QAAQM,OAAOC,IAAI;;EAAEC,UAAQ;EAAAC,WACjDF,QAAG,6CAEC3B,oBAAI;;oEAEmD2B,IAAG,KAC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@alloy-js/core";
|
|
2
|
-
import { CommandOption, CommandTree } from "@shell-shock/core";
|
|
3
|
-
|
|
4
|
-
//#region src/components/help.d.ts
|
|
5
|
-
interface HelpUsageProps {
|
|
6
|
-
/**
|
|
7
|
-
* The command to generate help for.
|
|
8
|
-
*/
|
|
9
|
-
command: CommandTree;
|
|
10
|
-
/**
|
|
11
|
-
* The padding scale to apply to the help display headings.
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
* This value is multiplied by the theme's app padding to determine the final padding.
|
|
15
|
-
*
|
|
16
|
-
* @defaultValue 2
|
|
17
|
-
*/
|
|
18
|
-
indent?: number;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* A component that generates the usage display for a command.
|
|
22
|
-
*/
|
|
23
|
-
declare function HelpUsage(props: HelpUsageProps): _alloy_js_core0.Children;
|
|
24
|
-
interface HelpOptionsProps {
|
|
25
|
-
/**
|
|
26
|
-
* The options to display help for.
|
|
27
|
-
*/
|
|
28
|
-
options: CommandOption[];
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* A component that generates the options table display for a command.
|
|
32
|
-
*/
|
|
33
|
-
declare function HelpOptions(props: HelpOptionsProps): _alloy_js_core0.Children;
|
|
34
|
-
interface HelpCommandsProps {
|
|
35
|
-
/**
|
|
36
|
-
* A mapping of command names to their command definitions.
|
|
37
|
-
*/
|
|
38
|
-
commands: Record<string, CommandTree>;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* A component that generates the commands table display for a command.
|
|
42
|
-
*/
|
|
43
|
-
declare function HelpCommands(props: HelpCommandsProps): _alloy_js_core0.Children;
|
|
44
|
-
interface BaseHelpProps {
|
|
45
|
-
/**
|
|
46
|
-
* The command to generate help for.
|
|
47
|
-
*/
|
|
48
|
-
command: CommandTree;
|
|
49
|
-
/**
|
|
50
|
-
* Whether to filter out global options from the help display.
|
|
51
|
-
*
|
|
52
|
-
* @remarks
|
|
53
|
-
* When enabled, any options that are present in the global options context will be filtered out from the help display. This is useful for sub-commands to avoid displaying global options that are not relevant to the specific command.
|
|
54
|
-
*
|
|
55
|
-
* @defaultValue false
|
|
56
|
-
*/
|
|
57
|
-
filterGlobalOptions?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* The padding scale to apply to the help display headings.
|
|
60
|
-
*
|
|
61
|
-
* @remarks
|
|
62
|
-
* This value is multiplied by the theme's app padding to determine the final padding.
|
|
63
|
-
*
|
|
64
|
-
* @defaultValue 1
|
|
65
|
-
*/
|
|
66
|
-
indent?: number;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* A component that generates the `help` function declaration for a command.
|
|
70
|
-
*/
|
|
71
|
-
declare function BaseHelp(props: BaseHelpProps): _alloy_js_core0.Children;
|
|
72
|
-
interface VirtualHelpProps {
|
|
73
|
-
/**
|
|
74
|
-
* The options to display help for.
|
|
75
|
-
*/
|
|
76
|
-
options: CommandOption[];
|
|
77
|
-
/**
|
|
78
|
-
* A mapping of command names to their command definitions.
|
|
79
|
-
*/
|
|
80
|
-
commands: Record<string, CommandTree>;
|
|
81
|
-
/**
|
|
82
|
-
* The command path to generate help for, used for generating the help invocation instructions.
|
|
83
|
-
*
|
|
84
|
-
* @remarks
|
|
85
|
-
* This is optional since the virtual command entry component can be used for both the global binary executable and virtual commands (there will be no command definition for the binary executable).
|
|
86
|
-
*/
|
|
87
|
-
segments?: string[];
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* A component that generates the invocation of the `help` function for a command.
|
|
91
|
-
*/
|
|
92
|
-
declare function VirtualHelp(props: VirtualHelpProps): _alloy_js_core0.Children;
|
|
93
|
-
interface CommandHelpProps {
|
|
94
|
-
/**
|
|
95
|
-
* A mapping of command names to their command definitions.
|
|
96
|
-
*/
|
|
97
|
-
command: CommandTree;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* A component that generates the invocation of the `help` function for a command.
|
|
101
|
-
*/
|
|
102
|
-
declare function CommandHelp(props: CommandHelpProps): _alloy_js_core0.Children;
|
|
103
|
-
//#endregion
|
|
104
|
-
export { BaseHelp, BaseHelpProps, CommandHelp, CommandHelpProps, HelpCommands, HelpCommandsProps, HelpOptions, HelpOptionsProps, HelpUsage, HelpUsageProps, VirtualHelp, VirtualHelpProps };
|
|
105
|
-
//# sourceMappingURL=help.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.cts","names":[],"sources":["../../src/components/help.tsx"],"sourcesContent":[],"mappings":";;;;UAoCiB,cAAA;;;AAAjB;EAoBgB,OAAA,EAhBL,WAgBc;EAiHR;AAUjB;AA0EA;AAUA;AAwBA;AA8BA;AAqDA;;EAS2B,MAAA,CAAA,EAAA,MAAA;;;AAc3B;AAwDA;AAUgB,iBAnZA,SAAA,CAmZmB,KAAA,EAnZF,cAmZkB,CAAA,EAnZJ,eAAA,CAAA,QAmZI;UAlSlC,gBAAA;;;;WAIN;;;;;iBAMK,WAAA,QAAmB,mBAAgB,eAAA,CAAA;UA0ElC,iBAAA;;;;YAIL,eAAe;;;;;iBAMX,YAAA,QAAoB,oBAAiB,eAAA,CAAA;UAwBpC,aAAA;;;;WAIN;;;;;;;;;;;;;;;;;;;;;;;iBA0BK,QAAA,QAAgB,gBAAa,eAAA,CAAA;UAqD5B,gBAAA;;;;WAIN;;;;YAKC,eAAe;;;;;;;;;;;;iBAcX,WAAA,QAAmB,mBAAgB,eAAA,CAAA;UAwDlC,gBAAA;;;;WAIN;;;;;iBAMK,WAAA,QAAmB,mBAAgB,eAAA,CAAA"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
-
import { CommandOption, CommandTree } from "@shell-shock/core";
|
|
3
|
-
|
|
4
|
-
//#region src/components/help.d.ts
|
|
5
|
-
interface HelpUsageProps {
|
|
6
|
-
/**
|
|
7
|
-
* The command to generate help for.
|
|
8
|
-
*/
|
|
9
|
-
command: CommandTree;
|
|
10
|
-
/**
|
|
11
|
-
* The padding scale to apply to the help display headings.
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
* This value is multiplied by the theme's app padding to determine the final padding.
|
|
15
|
-
*
|
|
16
|
-
* @defaultValue 2
|
|
17
|
-
*/
|
|
18
|
-
indent?: number;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* A component that generates the usage display for a command.
|
|
22
|
-
*/
|
|
23
|
-
declare function HelpUsage(props: HelpUsageProps): _alloy_js_core0.Children;
|
|
24
|
-
interface HelpOptionsProps {
|
|
25
|
-
/**
|
|
26
|
-
* The options to display help for.
|
|
27
|
-
*/
|
|
28
|
-
options: CommandOption[];
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* A component that generates the options table display for a command.
|
|
32
|
-
*/
|
|
33
|
-
declare function HelpOptions(props: HelpOptionsProps): _alloy_js_core0.Children;
|
|
34
|
-
interface HelpCommandsProps {
|
|
35
|
-
/**
|
|
36
|
-
* A mapping of command names to their command definitions.
|
|
37
|
-
*/
|
|
38
|
-
commands: Record<string, CommandTree>;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* A component that generates the commands table display for a command.
|
|
42
|
-
*/
|
|
43
|
-
declare function HelpCommands(props: HelpCommandsProps): _alloy_js_core0.Children;
|
|
44
|
-
interface BaseHelpProps {
|
|
45
|
-
/**
|
|
46
|
-
* The command to generate help for.
|
|
47
|
-
*/
|
|
48
|
-
command: CommandTree;
|
|
49
|
-
/**
|
|
50
|
-
* Whether to filter out global options from the help display.
|
|
51
|
-
*
|
|
52
|
-
* @remarks
|
|
53
|
-
* When enabled, any options that are present in the global options context will be filtered out from the help display. This is useful for sub-commands to avoid displaying global options that are not relevant to the specific command.
|
|
54
|
-
*
|
|
55
|
-
* @defaultValue false
|
|
56
|
-
*/
|
|
57
|
-
filterGlobalOptions?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* The padding scale to apply to the help display headings.
|
|
60
|
-
*
|
|
61
|
-
* @remarks
|
|
62
|
-
* This value is multiplied by the theme's app padding to determine the final padding.
|
|
63
|
-
*
|
|
64
|
-
* @defaultValue 1
|
|
65
|
-
*/
|
|
66
|
-
indent?: number;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* A component that generates the `help` function declaration for a command.
|
|
70
|
-
*/
|
|
71
|
-
declare function BaseHelp(props: BaseHelpProps): _alloy_js_core0.Children;
|
|
72
|
-
interface VirtualHelpProps {
|
|
73
|
-
/**
|
|
74
|
-
* The options to display help for.
|
|
75
|
-
*/
|
|
76
|
-
options: CommandOption[];
|
|
77
|
-
/**
|
|
78
|
-
* A mapping of command names to their command definitions.
|
|
79
|
-
*/
|
|
80
|
-
commands: Record<string, CommandTree>;
|
|
81
|
-
/**
|
|
82
|
-
* The command path to generate help for, used for generating the help invocation instructions.
|
|
83
|
-
*
|
|
84
|
-
* @remarks
|
|
85
|
-
* This is optional since the virtual command entry component can be used for both the global binary executable and virtual commands (there will be no command definition for the binary executable).
|
|
86
|
-
*/
|
|
87
|
-
segments?: string[];
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* A component that generates the invocation of the `help` function for a command.
|
|
91
|
-
*/
|
|
92
|
-
declare function VirtualHelp(props: VirtualHelpProps): _alloy_js_core0.Children;
|
|
93
|
-
interface CommandHelpProps {
|
|
94
|
-
/**
|
|
95
|
-
* A mapping of command names to their command definitions.
|
|
96
|
-
*/
|
|
97
|
-
command: CommandTree;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* A component that generates the invocation of the `help` function for a command.
|
|
101
|
-
*/
|
|
102
|
-
declare function CommandHelp(props: CommandHelpProps): _alloy_js_core0.Children;
|
|
103
|
-
//#endregion
|
|
104
|
-
export { BaseHelp, BaseHelpProps, CommandHelp, CommandHelpProps, HelpCommands, HelpCommandsProps, HelpOptions, HelpOptionsProps, HelpUsage, HelpUsageProps, VirtualHelp, VirtualHelpProps };
|
|
105
|
-
//# sourceMappingURL=help.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.mts","names":[],"sources":["../../src/components/help.tsx"],"sourcesContent":[],"mappings":";;;;UAoCiB,cAAA;;;AAAjB;EAoBgB,OAAA,EAhBL,WAgBc;EAiHR;AAUjB;AA0EA;AAUA;AAwBA;AA8BA;AAqDA;;EAS2B,MAAA,CAAA,EAAA,MAAA;;;AAc3B;AAwDA;AAUgB,iBAnZA,SAAA,CAmZmB,KAAA,EAnZF,cAmZkB,CAAA,EAnZJ,eAAA,CAAA,QAmZI;UAlSlC,gBAAA;;;;WAIN;;;;;iBAMK,WAAA,QAAmB,mBAAgB,eAAA,CAAA;UA0ElC,iBAAA;;;;YAIL,eAAe;;;;;iBAMX,YAAA,QAAoB,oBAAiB,eAAA,CAAA;UAwBpC,aAAA;;;;WAIN;;;;;;;;;;;;;;;;;;;;;;;iBA0BK,QAAA,QAAgB,gBAAa,eAAA,CAAA;UAqD5B,gBAAA;;;;WAIN;;;;YAKC,eAAe;;;;;;;;;;;;iBAcX,WAAA,QAAmB,mBAAgB,eAAA,CAAA;UAwDlC,gBAAA;;;;WAIN;;;;;iBAMK,WAAA,QAAmB,mBAAgB,eAAA,CAAA"}
|