@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
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
3
|
const require_components_banner_function_declaration = require('./banner-function-declaration.cjs');
|
|
3
|
-
const require_components_help = require('./help.cjs');
|
|
4
4
|
const require_components_command_router = require('./command-router.cjs');
|
|
5
5
|
const require_components_command_entry = require('./command-entry.cjs');
|
|
6
|
-
let
|
|
7
|
-
let
|
|
8
|
-
let
|
|
9
|
-
let
|
|
10
|
-
let
|
|
11
|
-
let
|
|
12
|
-
let __stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
|
|
6
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
7
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
8
|
+
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
9
|
+
let _powerlines_plugin_alloy_core_components = require("@powerlines/plugin-alloy/core/components");
|
|
10
|
+
let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
11
|
+
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
13
12
|
let defu = require("defu");
|
|
14
|
-
defu =
|
|
15
|
-
let
|
|
16
|
-
let
|
|
17
|
-
let
|
|
13
|
+
defu = require_runtime.__toESM(defu);
|
|
14
|
+
let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
15
|
+
let _stryke_path_join = require("@stryke/path/join");
|
|
16
|
+
let _stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
|
|
17
|
+
let _stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
|
|
18
|
+
let _powerlines_plugin_alloy_typescript_components_typescript_file = require("@powerlines/plugin-alloy/typescript/components/typescript-file");
|
|
18
19
|
|
|
19
20
|
//#region src/components/virtual-command-entry.tsx
|
|
20
21
|
/**
|
|
@@ -22,27 +23,27 @@ let __powerlines_plugin_alloy_typescript_components_typescript_file = require("@
|
|
|
22
23
|
*/
|
|
23
24
|
function VirtualCommandHandlerDeclaration(props) {
|
|
24
25
|
const { command, children, banner } = props;
|
|
25
|
-
const context = (0,
|
|
26
|
-
return [(0,
|
|
26
|
+
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
27
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
27
28
|
get heading() {
|
|
28
|
-
return `The ${command.title} (${(0,
|
|
29
|
+
return `The ${command.title} (${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} ${command.segments.map((segment) => (0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? `[${(0, _stryke_string_format_constant_case.constantCase)((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment))}]` : segment).join(" ")}) virtual command.`;
|
|
29
30
|
},
|
|
30
31
|
get children() {
|
|
31
32
|
return [
|
|
32
|
-
(0,
|
|
33
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { get children() {
|
|
33
34
|
return `${command.description.replace(/\.+$/, "")}.`;
|
|
34
35
|
} }),
|
|
35
|
-
(0,
|
|
36
|
-
(0,
|
|
36
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
37
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocTitle, { get children() {
|
|
37
38
|
return command.title;
|
|
38
39
|
} }),
|
|
39
|
-
(0,
|
|
40
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
40
41
|
name: "args",
|
|
41
42
|
children: `The command-line arguments passed to the command.`
|
|
42
43
|
})
|
|
43
44
|
];
|
|
44
45
|
}
|
|
45
|
-
}), (0,
|
|
46
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
46
47
|
"export": true,
|
|
47
48
|
async: true,
|
|
48
49
|
name: "handler",
|
|
@@ -53,30 +54,17 @@ function VirtualCommandHandlerDeclaration(props) {
|
|
|
53
54
|
}],
|
|
54
55
|
get children() {
|
|
55
56
|
return [
|
|
56
|
-
(0,
|
|
57
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
57
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
|
|
58
58
|
children,
|
|
59
|
-
(0,
|
|
60
|
-
(0,
|
|
61
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
59
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
|
|
60
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
62
61
|
get when() {
|
|
63
62
|
return Boolean(banner);
|
|
64
63
|
},
|
|
65
64
|
children: banner
|
|
66
65
|
}),
|
|
67
|
-
(0,
|
|
68
|
-
(
|
|
69
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(require_components_help.VirtualHelp, {
|
|
70
|
-
get segments() {
|
|
71
|
-
return command.segments;
|
|
72
|
-
},
|
|
73
|
-
get options() {
|
|
74
|
-
return Object.values(command.options);
|
|
75
|
-
},
|
|
76
|
-
get commands() {
|
|
77
|
-
return command.children ?? {};
|
|
78
|
-
}
|
|
79
|
-
})
|
|
66
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
|
|
67
|
+
_alloy_js_core.code`return showHelp(); `
|
|
80
68
|
];
|
|
81
69
|
}
|
|
82
70
|
})];
|
|
@@ -86,9 +74,9 @@ function VirtualCommandHandlerDeclaration(props) {
|
|
|
86
74
|
*/
|
|
87
75
|
function VirtualCommandEntry(props) {
|
|
88
76
|
const { command, imports, builtinImports, ...rest } = props;
|
|
89
|
-
const context = (0,
|
|
90
|
-
const filePath = (0,
|
|
91
|
-
return [(0,
|
|
77
|
+
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
78
|
+
const filePath = (0, _alloy_js_core.computed)(() => (0, _stryke_path_join.joinPaths)(context.entryPath, command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)).join("/"), "index.ts"));
|
|
79
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_typescript_file.TypescriptFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
92
80
|
get path() {
|
|
93
81
|
return filePath.value;
|
|
94
82
|
},
|
|
@@ -96,7 +84,7 @@ function VirtualCommandEntry(props) {
|
|
|
96
84
|
return (0, defu.default)(imports ?? {}, Object.entries(command.children).filter(([, child]) => child.isVirtual).reduce((ret, [name, child]) => {
|
|
97
85
|
ret[`./${child.name}`] = [{
|
|
98
86
|
name: "handler",
|
|
99
|
-
alias: `handle${(0,
|
|
87
|
+
alias: `handle${(0, _stryke_string_format_pascal_case.pascalCase)(name)}`
|
|
100
88
|
}];
|
|
101
89
|
return ret;
|
|
102
90
|
}, {}));
|
|
@@ -105,14 +93,10 @@ function VirtualCommandEntry(props) {
|
|
|
105
93
|
return (0, defu.default)(builtinImports ?? {}, {
|
|
106
94
|
env: ["isDevelopment", "isDebug"],
|
|
107
95
|
console: [
|
|
108
|
-
"help",
|
|
109
96
|
"warn",
|
|
110
97
|
"error",
|
|
111
|
-
"table",
|
|
112
98
|
"colors",
|
|
113
|
-
"writeLine"
|
|
114
|
-
"splitText",
|
|
115
|
-
"stripAnsi"
|
|
99
|
+
"writeLine"
|
|
116
100
|
],
|
|
117
101
|
utils: [
|
|
118
102
|
"useApp",
|
|
@@ -121,19 +105,19 @@ function VirtualCommandEntry(props) {
|
|
|
121
105
|
"isMinimal",
|
|
122
106
|
"isUnicodeSupported",
|
|
123
107
|
"findSuggestions"
|
|
124
|
-
]
|
|
108
|
+
],
|
|
109
|
+
[(0, _stryke_path_join.joinPaths)("help", ...command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)))]: ["showHelp"]
|
|
125
110
|
});
|
|
126
111
|
},
|
|
127
112
|
get children() {
|
|
128
113
|
return [
|
|
129
|
-
(0,
|
|
130
|
-
(0,
|
|
131
|
-
(0,
|
|
132
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(VirtualCommandHandlerDeclaration, {
|
|
114
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_banner_function_declaration.BannerFunctionDeclaration, { command }),
|
|
115
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
|
|
116
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(VirtualCommandHandlerDeclaration, {
|
|
133
117
|
command,
|
|
134
|
-
banner:
|
|
118
|
+
banner: _alloy_js_core.code`banner(); `,
|
|
135
119
|
get children() {
|
|
136
|
-
return (0,
|
|
120
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_command_router.CommandRouter, {
|
|
137
121
|
get segments() {
|
|
138
122
|
return command.segments;
|
|
139
123
|
},
|
|
@@ -145,19 +129,19 @@ function VirtualCommandEntry(props) {
|
|
|
145
129
|
})
|
|
146
130
|
];
|
|
147
131
|
}
|
|
148
|
-
})), (0,
|
|
132
|
+
})), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
149
133
|
get each() {
|
|
150
134
|
return Object.values(command.children);
|
|
151
135
|
},
|
|
152
|
-
children: (child) => (0,
|
|
136
|
+
children: (child) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
153
137
|
get when() {
|
|
154
138
|
return child.isVirtual;
|
|
155
139
|
},
|
|
156
140
|
get fallback() {
|
|
157
|
-
return (0,
|
|
141
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_command_entry.CommandEntry, { command: child });
|
|
158
142
|
},
|
|
159
143
|
get children() {
|
|
160
|
-
return (0,
|
|
144
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(VirtualCommandEntry, { command: child });
|
|
161
145
|
}
|
|
162
146
|
})
|
|
163
147
|
})];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-command-entry.cjs","names":[
|
|
1
|
+
{"version":3,"file":"virtual-command-entry.cjs","names":[],"sources":["../../src/components/virtual-command-entry.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 type { Children } from \"@alloy-js/core\";\nimport { code, computed, For, Show } from \"@alloy-js/core\";\nimport { FunctionDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { TypescriptFileImports } from \"@powerlines/plugin-alloy/types/components\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocTitle\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript/components/typescript-file\";\nimport {\n getAppBin,\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\nimport { BannerFunctionDeclaration } from \"./banner-function-declaration\";\nimport { CommandEntry } from \"./command-entry\";\nimport { CommandRouter } from \"./command-router\";\n\nexport interface VirtualCommandHandlerDeclarationProps {\n command: CommandTree;\n banner?: Children;\n children?: Children;\n}\n\n/**\n * A component that generates the `handler` function declaration for a command.\n */\nexport function VirtualCommandHandlerDeclaration(\n props: VirtualCommandHandlerDeclarationProps\n) {\n const { command, children, banner } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <TSDoc\n heading={`The ${command.title} (${getAppBin(context)} ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `[${constantCase(getDynamicPathSegmentName(segment))}]`\n : segment\n )\n .join(\" \")}) virtual command.`}>\n <TSDocRemarks>{`${command.description.replace(/\\.+$/, \"\")}.`}</TSDocRemarks>\n <hbr />\n <TSDocTitle>{command.title}</TSDocTitle>\n <TSDocParam name=\"args\">{`The command-line arguments passed to the command.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"handler\"\n parameters={[{ name: \"args\", type: \"string[]\", default: \"useArgs()\" }]}>\n <Spacing />\n {children}\n <Spacing />\n <Show when={Boolean(banner)}>{banner}</Show>\n <Spacing />\n {code`return showHelp(); `}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface VirtualCommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The virtual command entry point for the Shell Shock project.\n */\nexport function VirtualCommandEntry(props: VirtualCommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n context.entryPath,\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n\n return (\n <>\n <TypescriptFile\n {...rest}\n path={filePath.value}\n imports={defu(\n imports ?? {},\n Object.entries(command.children)\n .filter(([, child]) => child.isVirtual)\n .reduce((ret, [name, child]) => {\n ret[`./${child.name}`] = [\n { name: \"handler\", alias: `handle${pascalCase(name)}` }\n ];\n\n return ret;\n }, {} as TypescriptFileImports)\n )}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"isDevelopment\", \"isDebug\"],\n console: [\"warn\", \"error\", \"colors\", \"writeLine\"],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"hasFlag\",\n \"isMinimal\",\n \"isUnicodeSupported\",\n \"findSuggestions\"\n ],\n [joinPaths(\n \"help\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showHelp\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <Spacing />\n <VirtualCommandHandlerDeclaration\n command={command}\n banner={code`banner(); `}>\n <CommandRouter\n segments={command.segments}\n commands={command.children}\n />\n </VirtualCommandHandlerDeclaration>\n </TypescriptFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA+CA,SAAgB,iCAAC,OAAsC;CACrD,MAAA,EACA,SACA,UACF;CAEE,MAAA,6EAAA;AACA,QAAG,iDAAe,4DAAe;EACjC,IAAA,UAAA;AACI,UAAC,OAAS,QAAA,MAAA,kDAAgC,QAAA,CAAA,GAAA,QAAA,SAAA,KAAA,qEAAA,QAAA,GAAA,wHAAA,QAAA,CAAA,CAAA,KAAA,QAAA,CAAA,KAAA,IAAA,CAAA;;EAE9C,IAAA,WAAA;AACA,UAAQ;oDAAmB,mEAAgB;AAErC,YAAS,GAAC,QAAA,YAAc,QAAA,QAAsB,GAAA,CAAA;OAEpD,CAAM;oDAAC,OAAA,EAAA,CAAA;oDAAA,iEAAA,EACJ,IAAA,WAAA;AACE,YAAA,QAAA;OAEA,CAAC;oDAAgB,iEAAA;KAChB,MAAI;KACJ,UAAU;KACX,CAAC;IAAC;;EAEN,CAAC,kDAAmB,0CAAkB;EACrC,UAAK;EACL,OAAK;EACL,MAAK;EACL,YAAK,CAAA;GACH,MAAE;GACF,MAAC;GACD,SAAE;GACH,CAAC;EACF,IAAI,WAAM;AACR,UAAE;oDAAsB,kDAAW,EAAE,CAAC;IAAA;oDAA8B,kDAAK,EAAA,CAAA;oDAAA,qBAAA;KACvE,IAAC,OAAS;AACT,aAAQ,QAAA,OAAA;;KAET,UAAU;KACX,CAAC;oDAAU,kDAAA,EAAA,CAAA;IAAA,mBAAA;IAAA;;EAEf,CAAC,CAAC;;;;;AASL,SAAW,oBAAW,OAAA;CACtB,MAAA,WAEE,SACC,gBACD,GAAA,SACI;CACJ,MAAM,6EAA8C;;AAEpD,QAAM,iDAAU,0HAAoC,MAAA;EACpD,IAAM,OAAA;AACJ,UAAS,SAAA;;EAET,IAAE,UAAQ;AACR,4BAAU,WAAY,EAAA,EAAA,OAAA,QAAoB,QAAQ,SAAC,CAAA,QAAA,GAAA,WAAA,MAAA,UAAA,CAAA,QAAA,KAAA,CAAA,MAAA,WAAA;AACjD,QAAC,KAAQ,MAAC,UAAA,CAAA;KACX,MAAQ;KACX,OAAA,2DAAA,KAAA;KACD,CAAA;;MAEM,EAAA,CAAA,CAAA;;EAEL,IAAG,iBAAA;AACD,4BAAU,kBAAA,EAAA,EAAA;IACR,KAAK,CAAC,iBAAc,UAAA;IACpB,SAAS;KAAA;KAAI;KAAA;KAAA;KAAA;IACb,OAAE;KAAA;KAAa;KAAA;KAAA;KAAA;KAAA;KAAA;sCACN,QAAQ,GAAA,QAAQ,SAAQ,QAAA,YAAA,0DAAA,QAAA,CAAA,CAAA,GAAA,CAAA,WAAA;IAClC,CAAC;;EAEJ,IAAI,WAAW;AACb,UAAO;oDAAmB,0EAAmB,EACpC;;;KAED;KACN,QAAQ,mBAAI;KACZ,IAAC,WAAA;AACD,6DAAqB,iDAAqB;OACxC,IAAM,WAAC;AACP,eAAW,QAAQ;;OAEjB,IAAC,WAAO;AACP,eAAQ,QAAA;;OAEV,CAAC;;KAEL,CAAC;IAAC;;EAEN,CAAC,CAAC,kDAAe,oBAAA;EAChB,IAAI,OAAK;AACP,UAAO,OAAE,OAAQ,QAAS,SAAM;;EAElC,WAAQ,0DAAA,qBAAA;GACN,IAAI,OAAM;AACR,WAAG,MAAA;;GAEL,IAAG,WAAS;AACV,2DAAC,+CAAA,EACC,SAAS,OACV,CAAC;;GAEJ,IAAI,WAAW;AACb,2DAAsB,qBAAQ,EAC5B,SAAC,OACF,CAAC;;GAEL,CAAC;EACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-command-entry.d.cts","names":[],"sources":["../../src/components/virtual-command-entry.tsx"],"
|
|
1
|
+
{"version":3,"file":"virtual-command-entry.d.cts","names":[],"sources":["../../src/components/virtual-command-entry.tsx"],"mappings":";;;;;UA+CiB,qCAAA;EACf,OAAA,EAAS,WAAA;EACT,MAAA,GAAS,QAAA;EACT,QAAA,GAAW,QAAA;AAAA;;;;iBAMG,gCAAA,CACd,KAAA,EAAO,qCAAA,GAAqC,QAAA;AAAA,UAqC7B,wBAAA,SAAiC,IAAA,CAChD,cAAA;EAGA,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,mBAAA,CAAoB,KAAA,EAAO,wBAAA,GAAwB,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-command-entry.d.mts","names":[],"sources":["../../src/components/virtual-command-entry.tsx"],"
|
|
1
|
+
{"version":3,"file":"virtual-command-entry.d.mts","names":[],"sources":["../../src/components/virtual-command-entry.tsx"],"mappings":";;;;;UA+CiB,qCAAA;EACf,OAAA,EAAS,WAAA;EACT,MAAA,GAAS,QAAA;EACT,QAAA,GAAW,QAAA;AAAA;;;;iBAMG,gCAAA,CACd,KAAA,EAAO,qCAAA,GAAqC,QAAA;AAAA,UAqC7B,wBAAA,SAAiC,IAAA,CAChD,cAAA;EAGA,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,mBAAA,CAAoB,KAAA,EAAO,wBAAA,GAAwB,QAAA"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { BannerFunctionDeclaration } from "./banner-function-declaration.mjs";
|
|
2
|
-
import { VirtualHelp } from "./help.mjs";
|
|
3
2
|
import { CommandRouter } from "./command-router.mjs";
|
|
4
3
|
import { CommandEntry } from "./command-entry.mjs";
|
|
5
|
-
import { createComponent, createIntrinsic,
|
|
4
|
+
import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
6
5
|
import { For, Show, code, computed } from "@alloy-js/core";
|
|
7
6
|
import { FunctionDeclaration } from "@alloy-js/typescript";
|
|
8
|
-
import {
|
|
7
|
+
import { Spacing } from "@powerlines/plugin-alloy/core/components";
|
|
9
8
|
import { getAppBin, getDynamicPathSegmentName, isDynamicPathSegment } from "@shell-shock/core/plugin-utils";
|
|
10
|
-
import {
|
|
11
|
-
import { pascalCase } from "@stryke/string-format/pascal-case";
|
|
9
|
+
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
12
10
|
import defu from "defu";
|
|
11
|
+
import { TSDoc, TSDocParam, TSDocRemarks, TSDocTitle } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
|
|
13
12
|
import { joinPaths } from "@stryke/path/join";
|
|
13
|
+
import { pascalCase } from "@stryke/string-format/pascal-case";
|
|
14
14
|
import { constantCase } from "@stryke/string-format/constant-case";
|
|
15
15
|
import { TypescriptFile } from "@powerlines/plugin-alloy/typescript/components/typescript-file";
|
|
16
16
|
|
|
@@ -51,30 +51,17 @@ function VirtualCommandHandlerDeclaration(props) {
|
|
|
51
51
|
}],
|
|
52
52
|
get children() {
|
|
53
53
|
return [
|
|
54
|
-
|
|
55
|
-
createIntrinsic("hbr", {}),
|
|
54
|
+
createComponent(Spacing, {}),
|
|
56
55
|
children,
|
|
57
|
-
|
|
58
|
-
createIntrinsic("hbr", {}),
|
|
56
|
+
createComponent(Spacing, {}),
|
|
59
57
|
createComponent(Show, {
|
|
60
58
|
get when() {
|
|
61
59
|
return Boolean(banner);
|
|
62
60
|
},
|
|
63
61
|
children: banner
|
|
64
62
|
}),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
createComponent(VirtualHelp, {
|
|
68
|
-
get segments() {
|
|
69
|
-
return command.segments;
|
|
70
|
-
},
|
|
71
|
-
get options() {
|
|
72
|
-
return Object.values(command.options);
|
|
73
|
-
},
|
|
74
|
-
get commands() {
|
|
75
|
-
return command.children ?? {};
|
|
76
|
-
}
|
|
77
|
-
})
|
|
63
|
+
createComponent(Spacing, {}),
|
|
64
|
+
code`return showHelp(); `
|
|
78
65
|
];
|
|
79
66
|
}
|
|
80
67
|
})];
|
|
@@ -103,14 +90,10 @@ function VirtualCommandEntry(props) {
|
|
|
103
90
|
return defu(builtinImports ?? {}, {
|
|
104
91
|
env: ["isDevelopment", "isDebug"],
|
|
105
92
|
console: [
|
|
106
|
-
"help",
|
|
107
93
|
"warn",
|
|
108
94
|
"error",
|
|
109
|
-
"table",
|
|
110
95
|
"colors",
|
|
111
|
-
"writeLine"
|
|
112
|
-
"splitText",
|
|
113
|
-
"stripAnsi"
|
|
96
|
+
"writeLine"
|
|
114
97
|
],
|
|
115
98
|
utils: [
|
|
116
99
|
"useApp",
|
|
@@ -119,14 +102,14 @@ function VirtualCommandEntry(props) {
|
|
|
119
102
|
"isMinimal",
|
|
120
103
|
"isUnicodeSupported",
|
|
121
104
|
"findSuggestions"
|
|
122
|
-
]
|
|
105
|
+
],
|
|
106
|
+
[joinPaths("help", ...command.segments.filter((segment) => !isDynamicPathSegment(segment)))]: ["showHelp"]
|
|
123
107
|
});
|
|
124
108
|
},
|
|
125
109
|
get children() {
|
|
126
110
|
return [
|
|
127
111
|
createComponent(BannerFunctionDeclaration, { command }),
|
|
128
|
-
|
|
129
|
-
createIntrinsic("hbr", {}),
|
|
112
|
+
createComponent(Spacing, {}),
|
|
130
113
|
createComponent(VirtualCommandHandlerDeclaration, {
|
|
131
114
|
command,
|
|
132
115
|
banner: code`banner(); `,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-command-entry.mjs","names":[
|
|
1
|
+
{"version":3,"file":"virtual-command-entry.mjs","names":[],"sources":["../../src/components/virtual-command-entry.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 type { Children } from \"@alloy-js/core\";\nimport { code, computed, For, Show } from \"@alloy-js/core\";\nimport { FunctionDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { TypescriptFileImports } from \"@powerlines/plugin-alloy/types/components\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocTitle\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript/components/typescript-file\";\nimport {\n getAppBin,\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\nimport { BannerFunctionDeclaration } from \"./banner-function-declaration\";\nimport { CommandEntry } from \"./command-entry\";\nimport { CommandRouter } from \"./command-router\";\n\nexport interface VirtualCommandHandlerDeclarationProps {\n command: CommandTree;\n banner?: Children;\n children?: Children;\n}\n\n/**\n * A component that generates the `handler` function declaration for a command.\n */\nexport function VirtualCommandHandlerDeclaration(\n props: VirtualCommandHandlerDeclarationProps\n) {\n const { command, children, banner } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <TSDoc\n heading={`The ${command.title} (${getAppBin(context)} ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `[${constantCase(getDynamicPathSegmentName(segment))}]`\n : segment\n )\n .join(\" \")}) virtual command.`}>\n <TSDocRemarks>{`${command.description.replace(/\\.+$/, \"\")}.`}</TSDocRemarks>\n <hbr />\n <TSDocTitle>{command.title}</TSDocTitle>\n <TSDocParam name=\"args\">{`The command-line arguments passed to the command.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"handler\"\n parameters={[{ name: \"args\", type: \"string[]\", default: \"useArgs()\" }]}>\n <Spacing />\n {children}\n <Spacing />\n <Show when={Boolean(banner)}>{banner}</Show>\n <Spacing />\n {code`return showHelp(); `}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface VirtualCommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The virtual command entry point for the Shell Shock project.\n */\nexport function VirtualCommandEntry(props: VirtualCommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n context.entryPath,\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n\n return (\n <>\n <TypescriptFile\n {...rest}\n path={filePath.value}\n imports={defu(\n imports ?? {},\n Object.entries(command.children)\n .filter(([, child]) => child.isVirtual)\n .reduce((ret, [name, child]) => {\n ret[`./${child.name}`] = [\n { name: \"handler\", alias: `handle${pascalCase(name)}` }\n ];\n\n return ret;\n }, {} as TypescriptFileImports)\n )}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"isDevelopment\", \"isDebug\"],\n console: [\"warn\", \"error\", \"colors\", \"writeLine\"],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"hasFlag\",\n \"isMinimal\",\n \"isUnicodeSupported\",\n \"findSuggestions\"\n ],\n [joinPaths(\n \"help\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showHelp\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <Spacing />\n <VirtualCommandHandlerDeclaration\n command={command}\n banner={code`banner(); `}>\n <CommandRouter\n segments={command.segments}\n commands={command.children}\n />\n </VirtualCommandHandlerDeclaration>\n </TypescriptFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+CA,SAAgB,iCAAC,OAAsC;CACrD,MAAA,EACA,SACA,UACF;CAEE,MAAA,UAAA,eAAA;AACA,QAAG,CAAA,gBAAe,OAAe;EACjC,IAAA,UAAA;AACI,UAAC,OAAS,QAAA,MAAA,IAAA,UAAgC,QAAA,CAAA,GAAA,QAAA,SAAA,KAAA,YAAA,qBAAA,QAAA,GAAA,IAAA,aAAA,0BAAA,QAAA,CAAA,CAAA,KAAA,QAAA,CAAA,KAAA,IAAA,CAAA;;EAE9C,IAAA,WAAA;AACA,UAAQ;IAAA,gBAAmB,cAAgB;AAErC,YAAS,GAAC,QAAA,YAAc,QAAA,QAAsB,GAAA,CAAA;OAEpD,CAAM;IAAC,gBAAA,OAAA,EAAA,CAAA;IAAA,gBAAA,YAAA,EACJ,IAAA,WAAA;AACE,YAAA,QAAA;OAEA,CAAC;IAAE,gBAAc,YAAA;KAChB,MAAI;KACJ,UAAU;KACX,CAAC;IAAC;;EAEN,CAAC,EAAE,gBAAiB,qBAAkB;EACrC,UAAK;EACL,OAAK;EACL,MAAK;EACL,YAAK,CAAA;GACH,MAAE;GACF,MAAC;GACD,SAAE;GACH,CAAC;EACF,IAAI,WAAM;AACR,UAAE;IAAA,gBAAsB,SAAW,EAAE,CAAC;IAAA;IAAW,gBAAmB,SAAK,EAAA,CAAA;IAAA,gBAAA,MAAA;KACvE,IAAC,OAAS;AACT,aAAQ,QAAA,OAAA;;KAET,UAAU;KACX,CAAC;IAAC,gBAAS,SAAA,EAAA,CAAA;IAAA,IAAA;IAAA;;EAEf,CAAC,CAAC;;;;;AASL,SAAW,oBAAW,OAAA;CACtB,MAAA,WAEE,SACC,gBACD,GAAA,SACI;CACJ,MAAM,UAAU,eAAoC;;AAEpD,QAAM,CAAA,gBAAU,gBAAc,WAAsB,MAAA;EACpD,IAAM,OAAA;AACJ,UAAS,SAAA;;EAET,IAAE,UAAQ;AACR,UAAG,KAAO,WAAY,EAAA,EAAA,OAAA,QAAoB,QAAQ,SAAC,CAAA,QAAA,GAAA,WAAA,MAAA,UAAA,CAAA,QAAA,KAAA,CAAA,MAAA,WAAA;AACjD,QAAC,KAAQ,MAAC,UAAA,CAAA;KACX,MAAQ;KACX,OAAA,SAAA,WAAA,KAAA;KACD,CAAA;;MAEM,EAAA,CAAA,CAAA;;EAEL,IAAG,iBAAA;AACD,UAAM,KAAI,kBAAA,EAAA,EAAA;IACR,KAAK,CAAC,iBAAc,UAAA;IACpB,SAAS;KAAA;KAAI;KAAA;KAAA;KAAA;IACb,OAAE;KAAA;KAAa;KAAA;KAAA;KAAA;KAAA;KAAA;KACd,UAAQ,QAAQ,GAAA,QAAQ,SAAQ,QAAA,YAAA,CAAA,qBAAA,QAAA,CAAA,CAAA,GAAA,CAAA,WAAA;IAClC,CAAC;;EAEJ,IAAI,WAAW;AACb,UAAO;IAAC,gBAAkB,2BAAmB,EACpC;;;KAED;KACN,QAAQ,IAAI;KACZ,IAAC,WAAA;AACD,aAAA,gBAAqB,eAAqB;OACxC,IAAM,WAAC;AACP,eAAW,QAAQ;;OAEjB,IAAC,WAAO;AACP,eAAQ,QAAA;;OAEV,CAAC;;KAEL,CAAC;IAAC;;EAEN,CAAC,CAAC,EAAE,gBAAa,KAAA;EAChB,IAAI,OAAK;AACP,UAAO,OAAE,OAAQ,QAAS,SAAM;;EAElC,WAAQ,UAAA,gBAAA,MAAA;GACN,IAAI,OAAM;AACR,WAAG,MAAA;;GAEL,IAAG,WAAS;AACV,WAAC,gBAAA,cAAA,EACC,SAAS,OACV,CAAC;;GAEJ,IAAI,WAAW;AACb,WAAI,gBAAkB,qBAAQ,EAC5B,SAAC,OACF,CAAC;;GAEL,CAAC;EACH,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _shell_shock_core = require("@shell-shock/core");
|
|
3
4
|
|
|
4
5
|
//#region src/helpers/get-default-options.ts
|
|
5
6
|
/**
|
|
@@ -15,7 +16,7 @@ function getDefaultOptions() {
|
|
|
15
16
|
description: "Show help information.",
|
|
16
17
|
env: false,
|
|
17
18
|
alias: ["h", "?"],
|
|
18
|
-
kind:
|
|
19
|
+
kind: _shell_shock_core.CommandParameterKinds.boolean,
|
|
19
20
|
optional: true,
|
|
20
21
|
default: false,
|
|
21
22
|
skipAddingNegative: true
|
|
@@ -26,7 +27,7 @@ function getDefaultOptions() {
|
|
|
26
27
|
description: "Show the version of the application.",
|
|
27
28
|
env: false,
|
|
28
29
|
alias: ["v"],
|
|
29
|
-
kind:
|
|
30
|
+
kind: _shell_shock_core.CommandParameterKinds.boolean,
|
|
30
31
|
optional: true,
|
|
31
32
|
default: false,
|
|
32
33
|
skipAddingNegative: true
|
|
@@ -37,7 +38,7 @@ function getDefaultOptions() {
|
|
|
37
38
|
description: "Enable verbose output.",
|
|
38
39
|
env: "VERBOSE",
|
|
39
40
|
alias: ["V"],
|
|
40
|
-
kind:
|
|
41
|
+
kind: _shell_shock_core.CommandParameterKinds.boolean,
|
|
41
42
|
optional: true,
|
|
42
43
|
default: false,
|
|
43
44
|
skipAddingNegative: true
|
|
@@ -48,7 +49,7 @@ function getDefaultOptions() {
|
|
|
48
49
|
description: "Enable colored terminal output.",
|
|
49
50
|
env: "COLOR",
|
|
50
51
|
alias: ["colors"],
|
|
51
|
-
kind:
|
|
52
|
+
kind: _shell_shock_core.CommandParameterKinds.boolean,
|
|
52
53
|
optional: true,
|
|
53
54
|
skipAddingNegative: false
|
|
54
55
|
},
|
|
@@ -58,7 +59,7 @@ function getDefaultOptions() {
|
|
|
58
59
|
description: "Do not display the application banner displayed while running the CLI - will be set to true if running in a CI pipeline.",
|
|
59
60
|
env: "NO_BANNER",
|
|
60
61
|
alias: ["hide-banner"],
|
|
61
|
-
kind:
|
|
62
|
+
kind: _shell_shock_core.CommandParameterKinds.boolean,
|
|
62
63
|
optional: true,
|
|
63
64
|
default: false
|
|
64
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-default-options.cjs","names":["CommandParameterKinds"
|
|
1
|
+
{"version":3,"file":"get-default-options.cjs","names":["CommandParameterKinds"],"sources":["../../src/helpers/get-default-options.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 { CommandOption } from \"@shell-shock/core\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\n\n/**\n * Get the default command options.\n *\n * @returns The default command options.\n */\nexport function getDefaultOptions(): CommandOption[] {\n return [\n {\n name: \"help\",\n title: \"Help\",\n description: \"Show help information.\",\n env: false,\n alias: [\"h\", \"?\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"version\",\n title: \"Version\",\n description: \"Show the version of the application.\",\n env: false,\n alias: [\"v\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"verbose\",\n title: \"Verbose\",\n description: \"Enable verbose output.\",\n env: \"VERBOSE\",\n alias: [\"V\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"color\",\n title: \"Color\",\n description: \"Enable colored terminal output.\",\n env: \"COLOR\",\n alias: [\"colors\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n skipAddingNegative: false\n },\n {\n name: \"no-banner\",\n title: \"Hide Banner\",\n description:\n \"Do not display the application banner displayed while running the CLI - will be set to true if running in a CI pipeline.\",\n env: \"NO_BANNER\",\n alias: [\"hide-banner\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false\n }\n ];\n}\n"],"mappings":";;;;;;;;;;AA0BA,SAAgB,oBAAqC;AACnD,QAAO;EACL;GACE,MAAM;GACN,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO,CAAC,KAAK,IAAI;GACjB,MAAMA,wCAAsB;GAC5B,UAAU;GACV,SAAS;GACT,oBAAoB;GACrB;EACD;GACE,MAAM;GACN,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO,CAAC,IAAI;GACZ,MAAMA,wCAAsB;GAC5B,UAAU;GACV,SAAS;GACT,oBAAoB;GACrB;EACD;GACE,MAAM;GACN,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO,CAAC,IAAI;GACZ,MAAMA,wCAAsB;GAC5B,UAAU;GACV,SAAS;GACT,oBAAoB;GACrB;EACD;GACE,MAAM;GACN,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO,CAAC,SAAS;GACjB,MAAMA,wCAAsB;GAC5B,UAAU;GACV,oBAAoB;GACrB;EACD;GACE,MAAM;GACN,OAAO;GACP,aACE;GACF,KAAK;GACL,OAAO,CAAC,cAAc;GACtB,MAAMA,wCAAsB;GAC5B,UAAU;GACV,SAAS;GACV;EACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-default-options.d.cts","names":[],"sources":["../../src/helpers/get-default-options.ts"],"
|
|
1
|
+
{"version":3,"file":"get-default-options.d.cts","names":[],"sources":["../../src/helpers/get-default-options.ts"],"mappings":";;;;;AA0BA;;;iBAAgB,iBAAA,CAAA,GAAqB,aAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-default-options.d.mts","names":[],"sources":["../../src/helpers/get-default-options.ts"],"
|
|
1
|
+
{"version":3,"file":"get-default-options.d.mts","names":[],"sources":["../../src/helpers/get-default-options.ts"],"mappings":";;;;;AA0BA;;;iBAAgB,iBAAA,CAAA,GAAqB,aAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-default-options.mjs","names":[
|
|
1
|
+
{"version":3,"file":"get-default-options.mjs","names":[],"sources":["../../src/helpers/get-default-options.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 { CommandOption } from \"@shell-shock/core\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\n\n/**\n * Get the default command options.\n *\n * @returns The default command options.\n */\nexport function getDefaultOptions(): CommandOption[] {\n return [\n {\n name: \"help\",\n title: \"Help\",\n description: \"Show help information.\",\n env: false,\n alias: [\"h\", \"?\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"version\",\n title: \"Version\",\n description: \"Show the version of the application.\",\n env: false,\n alias: [\"v\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"verbose\",\n title: \"Verbose\",\n description: \"Enable verbose output.\",\n env: \"VERBOSE\",\n alias: [\"V\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false,\n skipAddingNegative: true\n },\n {\n name: \"color\",\n title: \"Color\",\n description: \"Enable colored terminal output.\",\n env: \"COLOR\",\n alias: [\"colors\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n skipAddingNegative: false\n },\n {\n name: \"no-banner\",\n title: \"Hide Banner\",\n description:\n \"Do not display the application banner displayed while running the CLI - will be set to true if running in a CI pipeline.\",\n env: \"NO_BANNER\",\n alias: [\"hide-banner\"],\n kind: CommandParameterKinds.boolean,\n optional: true,\n default: false\n }\n ];\n}\n"],"mappings":";;;;;;;;AA0BA,SAAgB,oBAAqC;AACnD,QAAO;EACL;GACE,MAAM;GACN,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO,CAAC,KAAK,IAAI;GACjB,MAAM,sBAAsB;GAC5B,UAAU;GACV,SAAS;GACT,oBAAoB;GACrB;EACD;GACE,MAAM;GACN,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO,CAAC,IAAI;GACZ,MAAM,sBAAsB;GAC5B,UAAU;GACV,SAAS;GACT,oBAAoB;GACrB;EACD;GACE,MAAM;GACN,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO,CAAC,IAAI;GACZ,MAAM,sBAAsB;GAC5B,UAAU;GACV,SAAS;GACT,oBAAoB;GACrB;EACD;GACE,MAAM;GACN,OAAO;GACP,aAAa;GACb,KAAK;GACL,OAAO,CAAC,SAAS;GACjB,MAAM,sBAAsB;GAC5B,UAAU;GACV,oBAAoB;GACrB;EACD;GACE,MAAM;GACN,OAAO;GACP,aACE;GACF,KAAK;GACL,OAAO,CAAC,cAAc;GACtB,MAAM,sBAAsB;GAC5B,UAAU;GACV,SAAS;GACV;EACF"}
|