@shell-shock/preset-script 0.6.77 → 0.6.78
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/command-entry-BlT9_UEL.cjs +367 -0
- package/dist/command-entry-DWSekIys.mjs +339 -0
- package/dist/command-entry-DWSekIys.mjs.map +1 -0
- package/dist/components/bin-entry.cjs +20 -18
- package/dist/components/bin-entry.d.cts +2 -3
- package/dist/components/bin-entry.d.cts.map +1 -1
- package/dist/components/bin-entry.d.mts +2 -3
- package/dist/components/bin-entry.mjs +10 -6
- package/dist/components/command-entry.cjs +4 -204
- package/dist/components/command-entry.d.cts +1 -2
- package/dist/components/command-entry.d.cts.map +1 -1
- package/dist/components/command-entry.d.mts +1 -2
- package/dist/components/command-entry.mjs +2 -201
- package/dist/components/command-router.cjs +7 -7
- package/dist/components/command-router.d.cts +0 -1
- package/dist/components/command-router.d.cts.map +1 -1
- package/dist/components/command-router.d.mts +0 -1
- package/dist/components/command-router.mjs +3 -3
- package/dist/components/exit-function-declaration.cjs +11 -11
- package/dist/components/exit-function-declaration.d.cts.map +1 -1
- package/dist/components/exit-function-declaration.mjs +3 -3
- package/dist/components/index.cjs +6 -7
- package/dist/components/index.mjs +1 -2
- package/dist/components/virtual-command-entry.cjs +3 -154
- package/dist/components/virtual-command-entry.d.cts +1 -2
- package/dist/components/virtual-command-entry.d.cts.map +1 -1
- package/dist/components/virtual-command-entry.d.mts +1 -2
- package/dist/components/virtual-command-entry.mjs +2 -152
- package/dist/generator.cjs +108 -0
- package/dist/generator.d.cts +10 -0
- package/dist/generator.d.cts.map +1 -0
- package/dist/generator.d.mts +10 -0
- package/dist/generator.d.mts.map +1 -0
- package/dist/generator.mjs +107 -0
- package/dist/generator.mjs.map +1 -0
- package/dist/helpers/get-global-options.cjs +0 -1
- package/dist/helpers/get-global-options.d.cts +0 -1
- package/dist/helpers/get-global-options.d.cts.map +1 -1
- package/dist/helpers/get-global-options.d.mts +0 -1
- package/dist/index.cjs +9 -90
- package/dist/index.d.cts +2 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +11 -89
- package/dist/types/index.cjs +1 -0
- package/dist/types/index.mjs +2 -0
- package/dist/types/plugin.d.cts +0 -1
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +0 -1
- package/package.json +32 -18
- package/dist/_virtual/_rolldown/runtime.cjs +0 -29
- package/dist/components/command-entry.mjs.map +0 -1
- package/dist/components/virtual-command-entry.mjs.map +0 -1
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
const require_components_command_router = require('./components/command-router.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 _alloy_js_typescript = require("@alloy-js/typescript");
|
|
5
|
+
let _power_plant_alloy_js_core_components = require("@power-plant/alloy-js/core/components");
|
|
6
|
+
let _power_plant_alloy_js_core_components_spacing = require("@power-plant/alloy-js/core/components/spacing");
|
|
7
|
+
let _power_plant_alloy_js_typescript_components_tsdoc = require("@power-plant/alloy-js/typescript/components/tsdoc");
|
|
8
|
+
let _shell_shock_core_contexts_power_plant = require("@shell-shock/core/contexts/power-plant");
|
|
9
|
+
let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
10
|
+
let _stryke_path_replace = require("@stryke/path/replace");
|
|
11
|
+
let _stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
|
|
12
|
+
let defu = require("defu");
|
|
13
|
+
let _shell_shock_core_components_command_validation_logic = require("@shell-shock/core/components/command-validation-logic");
|
|
14
|
+
let _shell_shock_core_components_helpers = require("@shell-shock/core/components/helpers");
|
|
15
|
+
let _shell_shock_core_components_options_parser_logic = require("@shell-shock/core/components/options-parser-logic");
|
|
16
|
+
let _stryke_path_find = require("@stryke/path/find");
|
|
17
|
+
let _stryke_path_join = require("@stryke/path/join");
|
|
18
|
+
let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
|
|
19
|
+
let _stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
|
|
20
|
+
let _power_plant_alloy_js_typescript_components_typescript_file = require("@power-plant/alloy-js/typescript/components/typescript-file");
|
|
21
|
+
|
|
22
|
+
//#region src/components/virtual-command-entry.tsx
|
|
23
|
+
/**
|
|
24
|
+
* A component that generates the `handler` function declaration for a command.
|
|
25
|
+
*/
|
|
26
|
+
function VirtualCommandHandlerDeclaration(props) {
|
|
27
|
+
const { command, children, banner } = props;
|
|
28
|
+
const context = (0, _shell_shock_core_contexts_power_plant.usePowerlines)();
|
|
29
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, {
|
|
30
|
+
get heading() {
|
|
31
|
+
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.`;
|
|
32
|
+
},
|
|
33
|
+
get children() {
|
|
34
|
+
return [
|
|
35
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocRemarks, { get children() {
|
|
36
|
+
return `${command.description.replace(/\.+$/, "")}.`;
|
|
37
|
+
} }),
|
|
38
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
39
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocTitle, { get children() {
|
|
40
|
+
return command.title;
|
|
41
|
+
} }),
|
|
42
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocParam, {
|
|
43
|
+
name: "args",
|
|
44
|
+
children: `The command-line arguments passed to the command.`
|
|
45
|
+
})
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
49
|
+
"export": true,
|
|
50
|
+
async: true,
|
|
51
|
+
name: "handler",
|
|
52
|
+
parameters: [{
|
|
53
|
+
name: "args",
|
|
54
|
+
type: "string[]",
|
|
55
|
+
default: "useArgs()"
|
|
56
|
+
}],
|
|
57
|
+
get children() {
|
|
58
|
+
return [
|
|
59
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components.Spacing, {}),
|
|
60
|
+
children,
|
|
61
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components.Spacing, {}),
|
|
62
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
63
|
+
get when() {
|
|
64
|
+
return Boolean(banner);
|
|
65
|
+
},
|
|
66
|
+
children: banner
|
|
67
|
+
}),
|
|
68
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components.Spacing, {}),
|
|
69
|
+
_alloy_js_core.code`return showHelp(); `
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
})];
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The virtual command entry point for the Shell Shock project.
|
|
76
|
+
*/
|
|
77
|
+
function VirtualCommandEntry(props) {
|
|
78
|
+
const { command, imports, builtinImports, ...rest } = props;
|
|
79
|
+
const context = (0, _shell_shock_core_contexts_power_plant.usePowerlines)();
|
|
80
|
+
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"));
|
|
81
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_typescript_file.TypescriptFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
82
|
+
get path() {
|
|
83
|
+
return filePath.value;
|
|
84
|
+
},
|
|
85
|
+
get imports() {
|
|
86
|
+
return (0, defu.defu)(imports ?? {}, Object.entries(command.children).filter(([, child]) => child.virtual).reduce((ret, [name, child]) => {
|
|
87
|
+
ret[`./${child.name}`] = [{
|
|
88
|
+
name: "handler",
|
|
89
|
+
alias: `handle${(0, _stryke_string_format_pascal_case.pascalCase)(name)}`
|
|
90
|
+
}];
|
|
91
|
+
return ret;
|
|
92
|
+
}, {}));
|
|
93
|
+
},
|
|
94
|
+
get builtinImports() {
|
|
95
|
+
return (0, defu.defu)(builtinImports ?? {}, {
|
|
96
|
+
env: ["isDevelopment", "isDebug"],
|
|
97
|
+
console: [
|
|
98
|
+
"warn",
|
|
99
|
+
"error",
|
|
100
|
+
"writeLine",
|
|
101
|
+
"textColors"
|
|
102
|
+
],
|
|
103
|
+
utils: [
|
|
104
|
+
"isMinimal",
|
|
105
|
+
"isUnicodeSupported",
|
|
106
|
+
"findSuggestions"
|
|
107
|
+
],
|
|
108
|
+
state: [
|
|
109
|
+
{
|
|
110
|
+
name: "GlobalOptions",
|
|
111
|
+
type: true
|
|
112
|
+
},
|
|
113
|
+
"useGlobal",
|
|
114
|
+
"useGlobalOptions",
|
|
115
|
+
"withCommand",
|
|
116
|
+
"useArgs",
|
|
117
|
+
"hasFlag"
|
|
118
|
+
],
|
|
119
|
+
[(0, _stryke_path_join.joinPaths)("help", ...command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)))]: ["showHelp"],
|
|
120
|
+
[(0, _stryke_path_join.joinPaths)("banner", ...command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)))]: ["showBanner"]
|
|
121
|
+
});
|
|
122
|
+
},
|
|
123
|
+
get children() {
|
|
124
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components.Spacing, {}), (0, _alloy_js_core_jsx_runtime.createComponent)(VirtualCommandHandlerDeclaration, {
|
|
125
|
+
command,
|
|
126
|
+
banner: _alloy_js_core.code`await showBanner(); `,
|
|
127
|
+
get children() {
|
|
128
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_command_router.CommandRouter, {
|
|
129
|
+
get segments() {
|
|
130
|
+
return command.segments;
|
|
131
|
+
},
|
|
132
|
+
get commands() {
|
|
133
|
+
return command.children;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
})];
|
|
138
|
+
}
|
|
139
|
+
})), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
140
|
+
get each() {
|
|
141
|
+
return Object.values(command.children);
|
|
142
|
+
},
|
|
143
|
+
children: (child) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
144
|
+
get when() {
|
|
145
|
+
return child.virtual;
|
|
146
|
+
},
|
|
147
|
+
get fallback() {
|
|
148
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(CommandEntry, { command: child });
|
|
149
|
+
},
|
|
150
|
+
get children() {
|
|
151
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(VirtualCommandEntry, { command: child });
|
|
152
|
+
}
|
|
153
|
+
})
|
|
154
|
+
})];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/components/command-entry.tsx
|
|
159
|
+
function CommandInvocation(props) {
|
|
160
|
+
const { command } = props;
|
|
161
|
+
return [(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code` return withCommand("${command.path}", [${command.segments.map((segment) => (0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? (0, _stryke_string_format_camel_case.camelCase)((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment)) : `"${segment}"`).join(", ")}], [${Object.keys(command.options).length > 0 ? `options` : ""}${command.args.length > 0 ? `${Object.keys(command.options).length > 0 ? ", " : ""}${command.args.map((arg) => (0, _stryke_string_format_camel_case.camelCase)(arg.name)).join(", ")}` : ""}], handle${(0, _stryke_string_format_pascal_case.pascalCase)(command.name)}); `), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* A component that generates the `handler` function declaration for a command.
|
|
165
|
+
*/
|
|
166
|
+
function CommandHandlerDeclaration(props) {
|
|
167
|
+
const { command, banner, children } = props;
|
|
168
|
+
const context = (0, _shell_shock_core_contexts_power_plant.usePowerlines)();
|
|
169
|
+
return [
|
|
170
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_core_components_options_parser_logic.OptionsInterfaceDeclaration, { command }),
|
|
171
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
172
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, {
|
|
173
|
+
get heading() {
|
|
174
|
+
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(" ")}) command.`;
|
|
175
|
+
},
|
|
176
|
+
get children() {
|
|
177
|
+
return [
|
|
178
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocRemarks, { get children() {
|
|
179
|
+
return `${command.description.replace(/\.+$/, "")}.`;
|
|
180
|
+
} }),
|
|
181
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
182
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocTitle, { get children() {
|
|
183
|
+
return command.title;
|
|
184
|
+
} }),
|
|
185
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocParam, {
|
|
186
|
+
name: "args",
|
|
187
|
+
children: `The command-line arguments passed to the command.`
|
|
188
|
+
})
|
|
189
|
+
];
|
|
190
|
+
}
|
|
191
|
+
}),
|
|
192
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
193
|
+
"export": true,
|
|
194
|
+
async: true,
|
|
195
|
+
name: "handler",
|
|
196
|
+
parameters: [{
|
|
197
|
+
name: "args",
|
|
198
|
+
type: "string[]",
|
|
199
|
+
default: "useArgs()"
|
|
200
|
+
}],
|
|
201
|
+
get children() {
|
|
202
|
+
return [
|
|
203
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_core_components_options_parser_logic.CommandParserLogic, {
|
|
204
|
+
command,
|
|
205
|
+
get appSpecificEnvPrefix() {
|
|
206
|
+
return context.config.appSpecificEnvPrefix;
|
|
207
|
+
},
|
|
208
|
+
get isCaseSensitive() {
|
|
209
|
+
return context.config.isCaseSensitive;
|
|
210
|
+
}
|
|
211
|
+
}),
|
|
212
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
213
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
214
|
+
get when() {
|
|
215
|
+
return Boolean(banner);
|
|
216
|
+
},
|
|
217
|
+
children: banner
|
|
218
|
+
}),
|
|
219
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
220
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
221
|
+
condition: _alloy_js_core.code`!isHelp()`,
|
|
222
|
+
get children() {
|
|
223
|
+
return [_alloy_js_core.code`writeLine("");`, (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
224
|
+
get condition() {
|
|
225
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_core_components_helpers.IsDebug, {});
|
|
226
|
+
},
|
|
227
|
+
children: _alloy_js_core.code`writeLine(textColors.body.tertiary("Debug mode is enabled. Additional debug information may be logged to the console.")); `
|
|
228
|
+
})];
|
|
229
|
+
}
|
|
230
|
+
}),
|
|
231
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
232
|
+
children,
|
|
233
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
234
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
235
|
+
condition: _alloy_js_core.code`options.help`,
|
|
236
|
+
children: _alloy_js_core.code`return showHelp(); `
|
|
237
|
+
}),
|
|
238
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseClause, { get children() {
|
|
239
|
+
return [(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}), (0, _alloy_js_core_jsx_runtime.createComponent)(CommandInvocation, { command })];
|
|
240
|
+
} })
|
|
241
|
+
];
|
|
242
|
+
}
|
|
243
|
+
})
|
|
244
|
+
];
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* The command entry point for the Shell Shock project.
|
|
248
|
+
*/
|
|
249
|
+
function CommandEntry(props) {
|
|
250
|
+
const { command, imports, builtinImports, ...rest } = props;
|
|
251
|
+
const context = (0, _shell_shock_core_contexts_power_plant.usePowerlines)();
|
|
252
|
+
const filePath = (0, _alloy_js_core.computed)(() => (0, _stryke_path_join.joinPaths)(command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)).join("/"), "index.ts"));
|
|
253
|
+
const commandSourcePath = (0, _alloy_js_core.computed)(() => (0, _stryke_path_replace.replaceExtension)((0, _stryke_path_find.relativePath)((0, _stryke_path_join.joinPaths)(context.entryPath, (0, _stryke_path_find.findFilePath)(filePath.value)), command.entry.input?.file || command.entry.file)));
|
|
254
|
+
const typeDefinition = (0, _alloy_js_core.computed)(() => ({
|
|
255
|
+
...command.entry,
|
|
256
|
+
output: command.id
|
|
257
|
+
}));
|
|
258
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_core_contexts_power_plant.EntryFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
259
|
+
get path() {
|
|
260
|
+
return filePath.value;
|
|
261
|
+
},
|
|
262
|
+
get typeDefinition() {
|
|
263
|
+
return typeDefinition.value;
|
|
264
|
+
},
|
|
265
|
+
get imports() {
|
|
266
|
+
return (0, defu.defu)(imports ?? {}, { [commandSourcePath.value.startsWith(".") ? commandSourcePath.value : `./${commandSourcePath.value}`]: `handle${(0, _stryke_string_format_pascal_case.pascalCase)(command.name)}` });
|
|
267
|
+
},
|
|
268
|
+
get builtinImports() {
|
|
269
|
+
return (0, defu.defu)(builtinImports ?? {}, {
|
|
270
|
+
env: [
|
|
271
|
+
"env",
|
|
272
|
+
"isDevelopment",
|
|
273
|
+
"isDebug"
|
|
274
|
+
],
|
|
275
|
+
console: [
|
|
276
|
+
"debug",
|
|
277
|
+
"warn",
|
|
278
|
+
"error",
|
|
279
|
+
"writeLine",
|
|
280
|
+
"textColors"
|
|
281
|
+
],
|
|
282
|
+
utils: ["isMinimal", "isUnicodeSupported"],
|
|
283
|
+
state: [
|
|
284
|
+
{
|
|
285
|
+
name: "GlobalOptions",
|
|
286
|
+
type: true
|
|
287
|
+
},
|
|
288
|
+
"useGlobal",
|
|
289
|
+
"useGlobalOptions",
|
|
290
|
+
"useArgs",
|
|
291
|
+
"hasFlag",
|
|
292
|
+
"isHelp",
|
|
293
|
+
"withCommand"
|
|
294
|
+
],
|
|
295
|
+
[(0, _stryke_path_join.joinPaths)("help", ...command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)))]: ["showHelp"],
|
|
296
|
+
[(0, _stryke_path_join.joinPaths)("banner", ...command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)))]: ["showBanner"]
|
|
297
|
+
});
|
|
298
|
+
},
|
|
299
|
+
get children() {
|
|
300
|
+
return [
|
|
301
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
302
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_core_components_options_parser_logic.OptionsInterfaceDeclaration, { command }),
|
|
303
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
304
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(CommandHandlerDeclaration, {
|
|
305
|
+
command,
|
|
306
|
+
banner: _alloy_js_core.code`await showBanner(); `,
|
|
307
|
+
get children() {
|
|
308
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_core_components_command_validation_logic.CommandValidationLogic, { command }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
309
|
+
condition: _alloy_js_core.code`failures.length > 0`,
|
|
310
|
+
get children() {
|
|
311
|
+
return _alloy_js_core.code`error(\`The following validation failures were found while processing the user provided input, and must be corrected before the \${italic("${command.title}")} command can be executed: \\n\\n\${failures.map(failure => " - " + failure).join("\\n")}\`);
|
|
312
|
+
options.help = true; `;
|
|
313
|
+
}
|
|
314
|
+
})];
|
|
315
|
+
}
|
|
316
|
+
})
|
|
317
|
+
];
|
|
318
|
+
}
|
|
319
|
+
})), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
320
|
+
get each() {
|
|
321
|
+
return Object.values(command.children);
|
|
322
|
+
},
|
|
323
|
+
children: (child) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
324
|
+
get when() {
|
|
325
|
+
return child.virtual;
|
|
326
|
+
},
|
|
327
|
+
get fallback() {
|
|
328
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(CommandEntry, { command: child });
|
|
329
|
+
},
|
|
330
|
+
get children() {
|
|
331
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(VirtualCommandEntry, { command: child });
|
|
332
|
+
}
|
|
333
|
+
})
|
|
334
|
+
})];
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
//#endregion
|
|
338
|
+
Object.defineProperty(exports, 'CommandEntry', {
|
|
339
|
+
enumerable: true,
|
|
340
|
+
get: function () {
|
|
341
|
+
return CommandEntry;
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
Object.defineProperty(exports, 'CommandHandlerDeclaration', {
|
|
345
|
+
enumerable: true,
|
|
346
|
+
get: function () {
|
|
347
|
+
return CommandHandlerDeclaration;
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
Object.defineProperty(exports, 'CommandInvocation', {
|
|
351
|
+
enumerable: true,
|
|
352
|
+
get: function () {
|
|
353
|
+
return CommandInvocation;
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
Object.defineProperty(exports, 'VirtualCommandEntry', {
|
|
357
|
+
enumerable: true,
|
|
358
|
+
get: function () {
|
|
359
|
+
return VirtualCommandEntry;
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
Object.defineProperty(exports, 'VirtualCommandHandlerDeclaration', {
|
|
363
|
+
enumerable: true,
|
|
364
|
+
get: function () {
|
|
365
|
+
return VirtualCommandHandlerDeclaration;
|
|
366
|
+
}
|
|
367
|
+
});
|