@shell-shock/preset-cli 0.8.4 → 0.8.5
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/README.md +1 -1
- package/dist/components/{banner-function-declaration.cjs → banner-builtin.cjs} +47 -36
- package/dist/components/banner-builtin.d.cts +23 -0
- package/dist/components/banner-builtin.d.cts.map +1 -0
- package/dist/components/banner-builtin.d.mts +23 -0
- package/dist/components/banner-builtin.d.mts.map +1 -0
- package/dist/components/banner-builtin.mjs +88 -0
- package/dist/components/banner-builtin.mjs.map +1 -0
- package/dist/components/command-entry.cjs +182 -186
- package/dist/components/command-entry.d.cts +1 -1
- package/dist/components/command-entry.d.cts.map +1 -1
- package/dist/components/command-entry.d.mts.map +1 -1
- package/dist/components/command-entry.mjs +182 -186
- package/dist/components/command-entry.mjs.map +1 -1
- package/dist/components/command-router.cjs +1 -1
- package/dist/components/command-router.mjs +1 -1
- package/dist/components/command-router.mjs.map +1 -1
- package/dist/components/index.cjs +3 -2
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs +2 -2
- package/dist/components/virtual-command-entry.cjs +18 -22
- package/dist/components/virtual-command-entry.d.cts +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 +18 -22
- package/dist/components/virtual-command-entry.mjs.map +1 -1
- package/dist/index.cjs +37 -7
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +38 -8
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-banner/dist/components/banner-builtin.cjs +63 -0
- package/dist/plugin-banner/dist/components/banner-builtin.mjs +62 -0
- package/dist/plugin-banner/dist/components/banner-builtin.mjs.map +1 -0
- package/dist/plugin-banner/dist/components/banner-function-declaration.cjs +135 -0
- package/dist/plugin-banner/dist/components/banner-function-declaration.d.cts +45 -0
- package/dist/plugin-banner/dist/components/banner-function-declaration.d.cts.map +1 -0
- package/dist/plugin-banner/dist/components/banner-function-declaration.d.mts +45 -0
- package/dist/plugin-banner/dist/components/banner-function-declaration.d.mts.map +1 -0
- package/dist/plugin-banner/dist/components/banner-function-declaration.mjs +133 -0
- package/dist/plugin-banner/dist/components/banner-function-declaration.mjs.map +1 -0
- package/dist/plugin-help/dist/components/display.cjs +14 -0
- package/dist/plugin-help/dist/components/display.mjs +14 -0
- package/dist/plugin-help/dist/components/display.mjs.map +1 -1
- package/dist/plugin-help/dist/index.cjs +1 -1
- package/dist/plugin-help/dist/index.mjs +1 -1
- package/package.json +19 -19
- package/dist/components/banner-function-declaration.d.cts +0 -11
- package/dist/components/banner-function-declaration.d.cts.map +0 -1
- package/dist/components/banner-function-declaration.d.mts +0 -11
- package/dist/components/banner-function-declaration.d.mts.map +0 -1
- package/dist/components/banner-function-declaration.mjs +0 -78
- package/dist/components/banner-function-declaration.mjs.map +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_components_banner_function_declaration = require('./banner-function-declaration.cjs');
|
|
4
3
|
const require_components_virtual_command_entry = require('./virtual-command-entry.cjs');
|
|
5
4
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
6
5
|
let _alloy_js_core = require("@alloy-js/core");
|
|
@@ -66,6 +65,7 @@ function CommandEntry(props) {
|
|
|
66
65
|
"createSpinner"
|
|
67
66
|
],
|
|
68
67
|
utils: [
|
|
68
|
+
"sleep",
|
|
69
69
|
"useApp",
|
|
70
70
|
"useArgs",
|
|
71
71
|
"hasFlag",
|
|
@@ -82,61 +82,58 @@ function CommandEntry(props) {
|
|
|
82
82
|
"select",
|
|
83
83
|
"confirm",
|
|
84
84
|
"waitForKeyPress",
|
|
85
|
-
"isCancel"
|
|
86
|
-
"sleep"
|
|
85
|
+
"isCancel"
|
|
87
86
|
],
|
|
88
87
|
[(0, _stryke_path_join.joinPaths)("help", ...command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)))]: ["showHelp"],
|
|
88
|
+
[(0, _stryke_path_join.joinPaths)("banner", ...command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)))]: ["showBanner"],
|
|
89
89
|
upgrade: ["executeUpgrade"]
|
|
90
90
|
});
|
|
91
91
|
},
|
|
92
92
|
get children() {
|
|
93
|
-
return [
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_preset_script_components_command_entry.CommandHandlerDeclaration, {
|
|
97
|
-
command,
|
|
98
|
-
banner: _alloy_js_core.code`await banner();
|
|
93
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}), (0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_preset_script_components_command_entry.CommandHandlerDeclaration, {
|
|
94
|
+
command,
|
|
95
|
+
banner: _alloy_js_core.code`await showBanner();
|
|
99
96
|
await executeUpgrade(); `,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
97
|
+
get children() {
|
|
98
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
99
|
+
condition: _alloy_js_core.code`!isInteractive`,
|
|
100
|
+
get children() {
|
|
101
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_core_components_command_validation_logic.CommandValidationLogic, { command });
|
|
102
|
+
}
|
|
103
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
104
|
+
get when() {
|
|
105
|
+
return Object.values(command.options ?? {}).filter((option) => !option.optional).length > 0 || Object.values(command.args ?? {}).filter((arg) => !arg.optional).length > 0;
|
|
106
|
+
},
|
|
107
|
+
get children() {
|
|
108
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseIfClause, {
|
|
109
|
+
get condition() {
|
|
110
|
+
return _alloy_js_core.code`!isHelp && (${Object.values(command.options ?? {}).filter((option) => !option.optional).map((option) => (option.kind === _shell_shock_core.CommandParameterKinds.string || option.kind === _shell_shock_core.CommandParameterKinds.number) && option.variadic ? `(!options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`} || options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`}.length === 0)` : `options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`} === undefined`).join(" || ")}${Object.values(command.options ?? {}).filter((option) => !option.optional).length > 0 && Object.values(command.args ?? {}).filter((arg) => !arg.optional).length > 0 ? " || " : ""}${Object.values(command.args ?? {}).filter((arg) => !arg.optional).map((arg) => (arg.kind === _shell_shock_core.CommandParameterKinds.string || arg.kind === _shell_shock_core.CommandParameterKinds.number) && arg.variadic ? `(!${(0, _stryke_string_format_camel_case.camelCase)(arg.name)} || ${(0, _stryke_string_format_camel_case.camelCase)(arg.name)}.length === 0)` : `${(0, _stryke_string_format_camel_case.camelCase)(arg.name)} === undefined`).join(" || ")}) `;
|
|
111
|
+
},
|
|
112
|
+
get children() {
|
|
113
|
+
return [
|
|
114
|
+
_alloy_js_core.code`writeLine(""); `,
|
|
115
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
116
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
117
|
+
get each() {
|
|
118
|
+
return Object.values(command.options ?? {});
|
|
119
|
+
},
|
|
120
|
+
doubleHardline: true,
|
|
121
|
+
children: (option) => [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
122
|
+
get when() {
|
|
123
|
+
return !option.optional;
|
|
122
124
|
},
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
get when() {
|
|
136
|
-
return option.kind === _shell_shock_core.CommandParameterKinds.boolean || !option.choices || option.choices.length === 0;
|
|
137
|
-
},
|
|
138
|
-
get fallback() {
|
|
139
|
-
return _alloy_js_core.code`const value = await select({
|
|
125
|
+
get children() {
|
|
126
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
127
|
+
get condition() {
|
|
128
|
+
return _alloy_js_core.code`!options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`}`;
|
|
129
|
+
},
|
|
130
|
+
get children() {
|
|
131
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
132
|
+
get when() {
|
|
133
|
+
return option.kind === _shell_shock_core.CommandParameterKinds.boolean || !option.choices || option.choices.length === 0;
|
|
134
|
+
},
|
|
135
|
+
get fallback() {
|
|
136
|
+
return _alloy_js_core.code`const value = await select({
|
|
140
137
|
message: \`Please select a value for the \${colors.italic("${option.name}")} option\`, ${option.description ? `description: \`${(0, _shell_shock_core_plugin_utils.formatDescription)(option.description)}\`,
|
|
141
138
|
` : ""}options: [ ${option.choices?.map((choice) => `{ value: ${JSON.stringify(choice)}, label: "${choice}", ${option.description ? `description: \`${(0, _shell_shock_core_plugin_utils.formatShortDescription)(option.description)}\`` : ""} }`).join(", ")} ]
|
|
142
139
|
});
|
|
@@ -146,16 +143,16 @@ function CommandEntry(props) {
|
|
|
146
143
|
|
|
147
144
|
options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`} = value;
|
|
148
145
|
`;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
146
|
+
},
|
|
147
|
+
get children() {
|
|
148
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Switch, { get children() {
|
|
149
|
+
return [
|
|
150
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Match, {
|
|
151
|
+
get when() {
|
|
152
|
+
return option.kind === _shell_shock_core.CommandParameterKinds.string;
|
|
153
|
+
},
|
|
154
|
+
get children() {
|
|
155
|
+
return _alloy_js_core.code`
|
|
159
156
|
const value = await text({
|
|
160
157
|
message: \`Please provide a value for the \${colors.italic("${option.name}")} option\`,
|
|
161
158
|
${option.description ? `description: \`${(0, _shell_shock_core_plugin_utils.formatDescription)(option.description)}\`,
|
|
@@ -173,14 +170,14 @@ function CommandEntry(props) {
|
|
|
173
170
|
|
|
174
171
|
options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`} = value;
|
|
175
172
|
`;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
173
|
+
}
|
|
174
|
+
}),
|
|
175
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Match, {
|
|
176
|
+
get when() {
|
|
177
|
+
return option.kind === _shell_shock_core.CommandParameterKinds.number;
|
|
178
|
+
},
|
|
179
|
+
get children() {
|
|
180
|
+
return _alloy_js_core.code`
|
|
184
181
|
const value = await numeric({
|
|
185
182
|
message: \`Please provide a numeric value for the \${colors.italic("${option.name}")} option\`,
|
|
186
183
|
${option.description ? `description: \`${(0, _shell_shock_core_plugin_utils.formatDescription)(option.description)}\`,
|
|
@@ -192,14 +189,14 @@ function CommandEntry(props) {
|
|
|
192
189
|
|
|
193
190
|
options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`} = value;
|
|
194
191
|
`;
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
192
|
+
}
|
|
193
|
+
}),
|
|
194
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Match, {
|
|
195
|
+
get when() {
|
|
196
|
+
return option.kind === _shell_shock_core.CommandParameterKinds.boolean;
|
|
197
|
+
},
|
|
198
|
+
get children() {
|
|
199
|
+
return _alloy_js_core.code`
|
|
203
200
|
const value = await toggle({
|
|
204
201
|
message: \`Please select a value for the \${colors.italic("${option.name}")} option\`,
|
|
205
202
|
${option.description ? `description: \`${(0, _shell_shock_core_plugin_utils.formatDescription)(option.description)}\`,
|
|
@@ -211,24 +208,24 @@ function CommandEntry(props) {
|
|
|
211
208
|
|
|
212
209
|
options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`} = value;
|
|
213
210
|
`;
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
211
|
+
}
|
|
212
|
+
})
|
|
213
|
+
];
|
|
214
|
+
} });
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
219
|
+
get when() {
|
|
220
|
+
return (option.kind === _shell_shock_core.CommandParameterKinds.string || option.kind === _shell_shock_core.CommandParameterKinds.number) && option.variadic;
|
|
221
|
+
},
|
|
222
|
+
get children() {
|
|
223
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseIfClause, {
|
|
224
|
+
get condition() {
|
|
225
|
+
return _alloy_js_core.code`options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`}.length === 0`;
|
|
226
|
+
},
|
|
227
|
+
get children() {
|
|
228
|
+
return _alloy_js_core.code`
|
|
232
229
|
const value = await text({
|
|
233
230
|
message: \`Please provide one or more${option.kind === _shell_shock_core.CommandParameterKinds.number ? " numeric" : ""} values for the \${colors.italic("${option.name}")} option (values are separated by a \\",\\" character)\`,
|
|
234
231
|
${option.description ? `description: \`${(0, _shell_shock_core_plugin_utils.formatDescription)(option.description)}\`,
|
|
@@ -252,35 +249,35 @@ function CommandEntry(props) {
|
|
|
252
249
|
|
|
253
250
|
options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, _stryke_string_format_camel_case.camelCase)(option.name)}`} = value.split(",").map(value => value.trim()).filter(Boolean)${option.kind === _shell_shock_core.CommandParameterKinds.number ? `.map(Number)` : ""} ;
|
|
254
251
|
`;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
})];
|
|
256
|
+
}
|
|
257
|
+
})]
|
|
258
|
+
}),
|
|
259
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
260
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
261
|
+
get each() {
|
|
262
|
+
return command.args;
|
|
263
|
+
},
|
|
264
|
+
doubleHardline: true,
|
|
265
|
+
children: (arg) => [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
266
|
+
get when() {
|
|
267
|
+
return !arg.optional;
|
|
266
268
|
},
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
get when() {
|
|
280
|
-
return arg.kind === _shell_shock_core.CommandParameterKinds.boolean || !arg.choices || arg.choices.length === 0;
|
|
281
|
-
},
|
|
282
|
-
get fallback() {
|
|
283
|
-
return _alloy_js_core.code`const value = await select({
|
|
269
|
+
get children() {
|
|
270
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
271
|
+
get condition() {
|
|
272
|
+
return _alloy_js_core.code`!${(0, _stryke_string_format_camel_case.camelCase)(arg.name)}`;
|
|
273
|
+
},
|
|
274
|
+
get children() {
|
|
275
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
276
|
+
get when() {
|
|
277
|
+
return arg.kind === _shell_shock_core.CommandParameterKinds.boolean || !arg.choices || arg.choices.length === 0;
|
|
278
|
+
},
|
|
279
|
+
get fallback() {
|
|
280
|
+
return _alloy_js_core.code`const value = await select({
|
|
284
281
|
message: \`Please select a value for the \${colors.italic("${arg.name}")} argument\`,${arg.description ? `description: \`${(0, _shell_shock_core_plugin_utils.formatDescription)(arg.description)}\`,
|
|
285
282
|
` : ""}
|
|
286
283
|
options: [ ${arg.choices?.map((choice) => `{ value: ${JSON.stringify(choice)}, label: "${choice}", ${arg.description ? `description: \`${(0, _shell_shock_core_plugin_utils.formatShortDescription)(arg.description)}\`` : ""} }`).join(", ")} ]
|
|
@@ -291,16 +288,16 @@ function CommandEntry(props) {
|
|
|
291
288
|
|
|
292
289
|
${(0, _stryke_string_format_camel_case.camelCase)(arg.name)} = value;
|
|
293
290
|
`;
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
291
|
+
},
|
|
292
|
+
get children() {
|
|
293
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Switch, { get children() {
|
|
294
|
+
return [
|
|
295
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Match, {
|
|
296
|
+
get when() {
|
|
297
|
+
return arg.kind === _shell_shock_core.CommandParameterKinds.string;
|
|
298
|
+
},
|
|
299
|
+
get children() {
|
|
300
|
+
return _alloy_js_core.code`
|
|
304
301
|
const value = await text({
|
|
305
302
|
message: \`Please provide a value for the \${colors.italic("${arg.name}")} argument\`,
|
|
306
303
|
${arg.description ? `description: \`${(0, _shell_shock_core_plugin_utils.formatShortDescription)(arg.description)}\`,
|
|
@@ -318,14 +315,14 @@ function CommandEntry(props) {
|
|
|
318
315
|
|
|
319
316
|
${(0, _stryke_string_format_camel_case.camelCase)(arg.name)} = value;
|
|
320
317
|
`;
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
318
|
+
}
|
|
319
|
+
}),
|
|
320
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Match, {
|
|
321
|
+
get when() {
|
|
322
|
+
return arg.kind === _shell_shock_core.CommandParameterKinds.number;
|
|
323
|
+
},
|
|
324
|
+
get children() {
|
|
325
|
+
return _alloy_js_core.code`
|
|
329
326
|
const value = await numeric({
|
|
330
327
|
message: \`Please provide a numeric value for the \${colors.italic("${arg.name}")} argument\`,
|
|
331
328
|
${arg.description ? `description: \`${(0, _shell_shock_core_plugin_utils.formatShortDescription)(arg.description)}\`,
|
|
@@ -337,14 +334,14 @@ function CommandEntry(props) {
|
|
|
337
334
|
|
|
338
335
|
${(0, _stryke_string_format_camel_case.camelCase)(arg.name)} = value;
|
|
339
336
|
`;
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
337
|
+
}
|
|
338
|
+
}),
|
|
339
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Match, {
|
|
340
|
+
get when() {
|
|
341
|
+
return arg.kind === _shell_shock_core.CommandParameterKinds.boolean;
|
|
342
|
+
},
|
|
343
|
+
get children() {
|
|
344
|
+
return _alloy_js_core.code`
|
|
348
345
|
const value = await toggle({
|
|
349
346
|
message: \`Please select a value for the \${colors.italic("${arg.name}")} argument\`,
|
|
350
347
|
${arg.description ? `description: \`${(0, _shell_shock_core_plugin_utils.formatShortDescription)(arg.description)}\`,
|
|
@@ -356,24 +353,24 @@ function CommandEntry(props) {
|
|
|
356
353
|
|
|
357
354
|
${(0, _stryke_string_format_camel_case.camelCase)(arg.name)} = value;
|
|
358
355
|
`;
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
356
|
+
}
|
|
357
|
+
})
|
|
358
|
+
];
|
|
359
|
+
} });
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
364
|
+
get when() {
|
|
365
|
+
return (arg.kind === _shell_shock_core.CommandParameterKinds.string || arg.kind === _shell_shock_core.CommandParameterKinds.number) && arg.variadic;
|
|
366
|
+
},
|
|
367
|
+
get children() {
|
|
368
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseIfClause, {
|
|
369
|
+
get condition() {
|
|
370
|
+
return _alloy_js_core.code`${(0, _stryke_string_format_camel_case.camelCase)(arg.name)}.length === 0`;
|
|
371
|
+
},
|
|
372
|
+
get children() {
|
|
373
|
+
return _alloy_js_core.code`
|
|
377
374
|
const value = await text({
|
|
378
375
|
message: \`Please provide one or more${arg.kind === _shell_shock_core.CommandParameterKinds.number ? " numeric" : ""} values for the \${colors.italic("${arg.name}")} argument (values are separated by a \\",\\" character)\`,
|
|
379
376
|
${arg.description ? `description: \`${(0, _shell_shock_core_plugin_utils.formatShortDescription)(arg.description)}\`,
|
|
@@ -398,29 +395,28 @@ function CommandEntry(props) {
|
|
|
398
395
|
|
|
399
396
|
${(0, _stryke_string_format_camel_case.camelCase)(arg.name)} = value.split(",").map(value => value.trim()).filter(Boolean)${arg.kind === _shell_shock_core.CommandParameterKinds.number ? `.map(Number)` : ""} ;
|
|
400
397
|
`;
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
398
|
+
}
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
})];
|
|
402
|
+
}
|
|
403
|
+
})]
|
|
404
|
+
}),
|
|
405
|
+
_alloy_js_core.code`writeLine(""); `,
|
|
406
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
407
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_core_components_command_validation_logic.CommandValidationLogic, { command }),
|
|
408
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
409
|
+
condition: _alloy_js_core.code`failures.length > 0`,
|
|
410
|
+
children: _alloy_js_core.code`error("The following validation failures were found while processing the user provided input, and must be corrected before the command-line process can be executed: \\n\\n" + failures.map(failure => " - " + failure).join("\\n"));
|
|
414
411
|
options.help = true; `
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
];
|
|
412
|
+
})
|
|
413
|
+
];
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
})];
|
|
418
|
+
}
|
|
419
|
+
})];
|
|
424
420
|
}
|
|
425
421
|
})), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
426
422
|
get each() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
-
import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
|
|
3
2
|
import { CommandTree } from "@shell-shock/core";
|
|
3
|
+
import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
|
|
4
4
|
|
|
5
5
|
//#region src/components/command-entry.d.ts
|
|
6
6
|
interface CommandEntryProps extends Omit<EntryFileProps, "path" | "typeDefinition"> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-entry.d.cts","names":[],"sources":["../../src/components/command-entry.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"command-entry.d.cts","names":[],"sources":["../../src/components/command-entry.tsx"],"mappings":";;;;;UA8CiB,iBAAA,SAA0B,IAAA,CACzC,cAAA;EAGA,OAAA,EAAS,WAAA;AAAA;AAJX;;;AAAA,iBAUgB,YAAA,CAAa,KAAA,EAAO,iBAAA,GAAiB,eAAA,CAAA,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-entry.d.mts","names":[],"sources":["../../src/components/command-entry.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"command-entry.d.mts","names":[],"sources":["../../src/components/command-entry.tsx"],"mappings":";;;;;UA8CiB,iBAAA,SAA0B,IAAA,CACzC,cAAA;EAGA,OAAA,EAAS,WAAA;AAAA;AAJX;;;AAAA,iBAUgB,YAAA,CAAa,KAAA,EAAO,iBAAA,GAAiB,eAAA,CAAA,QAAA"}
|