@shell-shock/preset-cli 0.9.20 → 0.9.23
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 +29 -1
- package/dist/components/banner-builtin.cjs +92 -5
- package/dist/components/banner-builtin.d.cts +2 -3
- package/dist/components/banner-builtin.d.cts.map +1 -1
- package/dist/components/banner-builtin.d.mts +3 -4
- package/dist/components/banner-builtin.d.mts.map +1 -1
- package/dist/components/banner-builtin.mjs +90 -5
- package/dist/components/banner-builtin.mjs.map +1 -1
- package/dist/components/command-entry.cjs +358 -56
- 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.d.mts.map +1 -1
- package/dist/components/command-entry.mjs +355 -56
- package/dist/components/command-entry.mjs.map +1 -1
- package/dist/components/command-router.cjs +59 -4
- package/dist/components/command-router.d.cts +2 -3
- package/dist/components/command-router.d.cts.map +1 -1
- package/dist/components/command-router.d.mts +3 -4
- package/dist/components/command-router.d.mts.map +1 -1
- package/dist/components/command-router.mjs +57 -4
- package/dist/components/command-router.mjs.map +1 -1
- package/dist/components/index.cjs +15 -1
- package/dist/components/index.mjs +7 -1
- package/dist/components/upgrade-builtin.cjs +134 -14
- package/dist/components/upgrade-builtin.d.cts +2 -3
- package/dist/components/upgrade-builtin.d.cts.map +1 -1
- package/dist/components/upgrade-builtin.d.mts +2 -3
- package/dist/components/upgrade-builtin.d.mts.map +1 -1
- package/dist/components/upgrade-builtin.mjs +132 -14
- package/dist/components/upgrade-builtin.mjs.map +1 -1
- package/dist/components/virtual-command-entry.cjs +116 -1
- 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.d.mts.map +1 -1
- package/dist/components/virtual-command-entry.mjs +113 -1
- package/dist/components/virtual-command-entry.mjs.map +1 -1
- package/dist/helpers/get-global-options.cjs +37 -1
- package/dist/helpers/get-global-options.mjs +37 -1
- package/dist/helpers/get-global-options.mjs.map +1 -1
- package/dist/index.cjs +185 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +175 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/plugin.d.cts +11 -3
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +12 -4
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/types/plugin.mjs +1 -1
- package/package.json +24 -23
|
@@ -1,18 +1,166 @@
|
|
|
1
|
-
import{VirtualCommandEntry
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { VirtualCommandEntry } from "./virtual-command-entry.mjs";
|
|
2
|
+
import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
3
|
+
import { For, Match, Show, Switch, code, computed } from "@alloy-js/core";
|
|
4
|
+
import { ElseIfClause, IfStatement } from "@alloy-js/typescript";
|
|
5
|
+
import { formatDescription, formatShortDescription, isDynamicPathSegment } from "@shell-shock/core/plugin-utils";
|
|
6
|
+
import { joinPaths } from "@stryke/path/join";
|
|
7
|
+
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
8
|
+
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
9
|
+
import { EntryFile } from "@powerlines/plugin-alloy/typescript/components/entry-file";
|
|
10
|
+
import { CommandValidationLogic } from "@shell-shock/core/components/command-validation-logic";
|
|
11
|
+
import { CommandHandlerDeclaration } from "@shell-shock/preset-script/components/command-entry";
|
|
12
|
+
import { findFilePath, relativePath } from "@stryke/path/find";
|
|
13
|
+
import { replaceExtension } from "@stryke/path/replace";
|
|
14
|
+
import { camelCase } from "@stryke/string-format/camel-case";
|
|
15
|
+
import { pascalCase } from "@stryke/string-format/pascal-case";
|
|
16
|
+
import defu from "defu";
|
|
17
|
+
|
|
18
|
+
//#region src/components/command-entry.tsx
|
|
19
|
+
/**
|
|
20
|
+
* The command entry point for the Shell Shock project.
|
|
21
|
+
*/
|
|
22
|
+
function CommandEntry(props) {
|
|
23
|
+
const { command, imports, builtinImports, ...rest } = props;
|
|
24
|
+
const context = usePowerlines();
|
|
25
|
+
const filePath = computed(() => joinPaths(command.segments.filter((segment) => !isDynamicPathSegment(segment)).join("/"), "index.ts"));
|
|
26
|
+
const commandSourcePath = computed(() => replaceExtension(relativePath(joinPaths(context.entryPath, findFilePath(filePath.value)), command.entry.input?.file || command.entry.file)));
|
|
27
|
+
const typeDefinition = computed(() => ({
|
|
28
|
+
...command.entry,
|
|
29
|
+
output: command.id
|
|
30
|
+
}));
|
|
31
|
+
return [createComponent(EntryFile, mergeProps(rest, {
|
|
32
|
+
get path() {
|
|
33
|
+
return filePath.value;
|
|
34
|
+
},
|
|
35
|
+
get typeDefinition() {
|
|
36
|
+
return typeDefinition.value;
|
|
37
|
+
},
|
|
38
|
+
get imports() {
|
|
39
|
+
return defu(imports ?? {}, { [commandSourcePath.value.startsWith(".") ? commandSourcePath.value : `./${commandSourcePath.value}`]: `handle${pascalCase(command.name)}` });
|
|
40
|
+
},
|
|
41
|
+
get builtinImports() {
|
|
42
|
+
return defu(builtinImports ?? {}, {
|
|
43
|
+
env: [
|
|
44
|
+
"env",
|
|
45
|
+
"isDevelopment",
|
|
46
|
+
"isDebug",
|
|
47
|
+
"paths"
|
|
48
|
+
],
|
|
49
|
+
console: [
|
|
50
|
+
"debug",
|
|
51
|
+
"info",
|
|
52
|
+
"help",
|
|
53
|
+
"warn",
|
|
54
|
+
"error",
|
|
55
|
+
"table",
|
|
56
|
+
"italic",
|
|
57
|
+
"cursor",
|
|
58
|
+
"stripAnsi",
|
|
59
|
+
"writeLine",
|
|
60
|
+
"splitText",
|
|
61
|
+
"textColors",
|
|
62
|
+
"createSpinner"
|
|
63
|
+
],
|
|
64
|
+
utils: [
|
|
65
|
+
"sleep",
|
|
66
|
+
"isMinimal",
|
|
67
|
+
"isInteractive",
|
|
68
|
+
"isUnicodeSupported"
|
|
69
|
+
],
|
|
70
|
+
state: [
|
|
71
|
+
{
|
|
72
|
+
name: "GlobalOptions",
|
|
73
|
+
type: true
|
|
74
|
+
},
|
|
75
|
+
"useGlobal",
|
|
76
|
+
"useGlobalOptions",
|
|
77
|
+
"withCommand",
|
|
78
|
+
"useArgs",
|
|
79
|
+
"hasFlag",
|
|
80
|
+
"isHelp"
|
|
81
|
+
],
|
|
82
|
+
prompts: [
|
|
83
|
+
"text",
|
|
84
|
+
"numeric",
|
|
85
|
+
"toggle",
|
|
86
|
+
"select",
|
|
87
|
+
"confirm",
|
|
88
|
+
"waitForKeyPress",
|
|
89
|
+
"isCancel"
|
|
90
|
+
],
|
|
91
|
+
[joinPaths("help", ...command.segments.filter((segment) => !isDynamicPathSegment(segment)))]: ["showHelp"],
|
|
92
|
+
[joinPaths("banner", ...command.segments.filter((segment) => !isDynamicPathSegment(segment)))]: ["showBanner"],
|
|
93
|
+
upgrade: ["executeUpgrade"]
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
get children() {
|
|
97
|
+
return [createComponent(Spacing, {}), createComponent(CommandHandlerDeclaration, {
|
|
98
|
+
command,
|
|
99
|
+
banner: code`await showBanner();
|
|
100
|
+
await executeUpgrade(); `,
|
|
101
|
+
get children() {
|
|
102
|
+
return [createComponent(IfStatement, {
|
|
103
|
+
condition: code`!isInteractive`,
|
|
104
|
+
get children() {
|
|
105
|
+
return createComponent(CommandValidationLogic, { command });
|
|
106
|
+
}
|
|
107
|
+
}), createComponent(Show, {
|
|
108
|
+
get when() {
|
|
109
|
+
return Object.values(command.options ?? {}).filter((option) => option.required).length > 0 || Object.values(command.args ?? {}).filter((arg) => arg.required).length > 0;
|
|
110
|
+
},
|
|
111
|
+
get children() {
|
|
112
|
+
return createComponent(ElseIfClause, {
|
|
113
|
+
get condition() {
|
|
114
|
+
return code`!isHelp() && (${Object.values(command.options ?? {}).filter((option) => option.required).map((option) => (option.type === "string" || option.type === "number") && option.variadic ? `(!options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} || options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}.length === 0)` : `options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} === undefined`).join(" || ")}${Object.values(command.options ?? {}).filter((option) => option.required).length > 0 && Object.values(command.args ?? {}).filter((arg) => arg.required).length > 0 ? " || " : ""}${Object.values(command.args ?? {}).filter((arg) => arg.required).map((arg) => (arg.type === "string" || arg.type === "number") && arg.variadic ? `(!${camelCase(arg.name)} || ${camelCase(arg.name)}.length === 0)` : `${camelCase(arg.name)} === undefined`).join(" || ")}) `;
|
|
115
|
+
},
|
|
116
|
+
get children() {
|
|
117
|
+
return [
|
|
118
|
+
code`writeLine(""); `,
|
|
119
|
+
createComponent(Spacing, {}),
|
|
120
|
+
createComponent(For, {
|
|
121
|
+
get each() {
|
|
122
|
+
return Object.values(command.options ?? {});
|
|
123
|
+
},
|
|
124
|
+
doubleHardline: true,
|
|
125
|
+
children: (option) => [createComponent(Show, {
|
|
126
|
+
get when() {
|
|
127
|
+
return option.required;
|
|
128
|
+
},
|
|
129
|
+
get children() {
|
|
130
|
+
return [createComponent(IfStatement, {
|
|
131
|
+
get condition() {
|
|
132
|
+
return code`!options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}`;
|
|
133
|
+
},
|
|
134
|
+
get children() {
|
|
135
|
+
return createComponent(Show, {
|
|
136
|
+
get when() {
|
|
137
|
+
return option.type === "boolean" || !option.choices || option.choices.length === 0;
|
|
138
|
+
},
|
|
139
|
+
get fallback() {
|
|
140
|
+
return code`const value = await select({
|
|
141
|
+
message: \`Please select a value for the \${italic("${option.name}")} option\`, ${option.description ? `description: \`${formatDescription(option.description)}\`,
|
|
142
|
+
` : ""}options: [ ${option.choices?.map((choice) => `{ value: ${JSON.stringify(choice)}, label: "${choice}", ${option.description ? `description: \`${formatShortDescription(option.description)}\`` : ""} }`).join(", ")} ]
|
|
5
143
|
});
|
|
6
144
|
if (isCancel(value)) {
|
|
7
145
|
return;
|
|
8
146
|
}
|
|
9
147
|
|
|
10
|
-
options${
|
|
11
|
-
|
|
148
|
+
options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = value;
|
|
149
|
+
`;
|
|
150
|
+
},
|
|
151
|
+
get children() {
|
|
152
|
+
return createComponent(Switch, { get children() {
|
|
153
|
+
return [
|
|
154
|
+
createComponent(Match, {
|
|
155
|
+
get when() {
|
|
156
|
+
return option.type === "string";
|
|
157
|
+
},
|
|
158
|
+
get children() {
|
|
159
|
+
return code`
|
|
12
160
|
const value = await text({
|
|
13
|
-
message: \`Please provide a value for the \${italic("${
|
|
14
|
-
${
|
|
15
|
-
|
|
161
|
+
message: \`Please provide a value for the \${italic("${option.name}")} option\`,
|
|
162
|
+
${option.description ? `description: \`${formatDescription(option.description)}\`,
|
|
163
|
+
` : ""}validate(val) {
|
|
16
164
|
if (!val || val.trim() === "") {
|
|
17
165
|
return "A value must be provided for this option";
|
|
18
166
|
}
|
|
@@ -24,44 +172,78 @@ import{VirtualCommandEntry as e}from"./virtual-command-entry.mjs";import{createC
|
|
|
24
172
|
return;
|
|
25
173
|
}
|
|
26
174
|
|
|
27
|
-
options${
|
|
28
|
-
|
|
175
|
+
options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = value;
|
|
176
|
+
`;
|
|
177
|
+
}
|
|
178
|
+
}),
|
|
179
|
+
createComponent(Match, {
|
|
180
|
+
get when() {
|
|
181
|
+
return option.type === "number";
|
|
182
|
+
},
|
|
183
|
+
get children() {
|
|
184
|
+
return code`
|
|
29
185
|
const value = await numeric({
|
|
30
|
-
message: \`Please provide a numeric value for the \${italic("${
|
|
31
|
-
${
|
|
32
|
-
|
|
186
|
+
message: \`Please provide a numeric value for the \${italic("${option.name}")} option\`,
|
|
187
|
+
${option.description ? `description: \`${formatDescription(option.description)}\`,
|
|
188
|
+
` : ""}
|
|
33
189
|
});
|
|
34
190
|
if (isCancel(value)) {
|
|
35
191
|
return;
|
|
36
192
|
}
|
|
37
193
|
|
|
38
|
-
options${
|
|
39
|
-
|
|
194
|
+
options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = value;
|
|
195
|
+
`;
|
|
196
|
+
}
|
|
197
|
+
}),
|
|
198
|
+
createComponent(Match, {
|
|
199
|
+
get when() {
|
|
200
|
+
return option.type === "boolean";
|
|
201
|
+
},
|
|
202
|
+
get children() {
|
|
203
|
+
return code`
|
|
40
204
|
const value = await toggle({
|
|
41
|
-
message: \`Please select a value for the \${italic("${
|
|
42
|
-
${
|
|
43
|
-
|
|
205
|
+
message: \`Please select a value for the \${italic("${option.name}")} option\`,
|
|
206
|
+
${option.description ? `description: \`${formatDescription(option.description)}\`,
|
|
207
|
+
` : ""}
|
|
44
208
|
});
|
|
45
209
|
if (isCancel(value)) {
|
|
46
210
|
return;
|
|
47
211
|
}
|
|
48
212
|
|
|
49
|
-
options${
|
|
50
|
-
|
|
213
|
+
options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = value;
|
|
214
|
+
`;
|
|
215
|
+
}
|
|
216
|
+
})
|
|
217
|
+
];
|
|
218
|
+
} });
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}), createComponent(Show, {
|
|
223
|
+
get when() {
|
|
224
|
+
return (option.type === "string" || option.type === "number") && option.variadic;
|
|
225
|
+
},
|
|
226
|
+
get children() {
|
|
227
|
+
return createComponent(ElseIfClause, {
|
|
228
|
+
get condition() {
|
|
229
|
+
return code`options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`}.length === 0`;
|
|
230
|
+
},
|
|
231
|
+
get children() {
|
|
232
|
+
return code`
|
|
51
233
|
const value = await text({
|
|
52
|
-
message: \`Please provide one or more${
|
|
53
|
-
${
|
|
54
|
-
|
|
234
|
+
message: \`Please provide one or more${option.type === "number" ? " numeric" : ""} values for the \${italic("${option.name}")} option (values are separated by a \\",\\" character)\`,
|
|
235
|
+
${option.description ? `description: \`${formatDescription(option.description)}\`,
|
|
236
|
+
` : ""}validate(val) {
|
|
55
237
|
if (!val || val.trim() === "") {
|
|
56
238
|
return "A value must be provided for this option";
|
|
57
239
|
}
|
|
58
240
|
if (val.split(",").map(v => v.trim()).filter(Boolean).length === 0) {
|
|
59
241
|
return "At least one value must be provided for this option";
|
|
60
242
|
}
|
|
61
|
-
${
|
|
243
|
+
${option.type === "number" ? `const invalidIndex = val.split(",").map(v => v.trim()).filter(Boolean).findIndex(v => Number.isNaN(Number(v));
|
|
62
244
|
if (invalidIndex !== -1) {
|
|
63
245
|
return \`Invalid numeric value provided for item #\${invalidIndex + 1} - all provided items must be a valid number\`;
|
|
64
|
-
}
|
|
246
|
+
} ` : ""}
|
|
65
247
|
return undefined;
|
|
66
248
|
}
|
|
67
249
|
});
|
|
@@ -69,22 +251,61 @@ import{VirtualCommandEntry as e}from"./virtual-command-entry.mjs";import{createC
|
|
|
69
251
|
return;
|
|
70
252
|
}
|
|
71
253
|
|
|
72
|
-
options${
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
254
|
+
options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = value.split(",").map(value => value.trim()).filter(Boolean)${option.type === "number" ? `.map(Number)` : ""} ;
|
|
255
|
+
`;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
})];
|
|
260
|
+
}
|
|
261
|
+
})]
|
|
262
|
+
}),
|
|
263
|
+
createComponent(Spacing, {}),
|
|
264
|
+
createComponent(For, {
|
|
265
|
+
get each() {
|
|
266
|
+
return command.args;
|
|
267
|
+
},
|
|
268
|
+
doubleHardline: true,
|
|
269
|
+
children: (arg) => [createComponent(Show, {
|
|
270
|
+
get when() {
|
|
271
|
+
return arg.required;
|
|
272
|
+
},
|
|
273
|
+
get children() {
|
|
274
|
+
return [createComponent(IfStatement, {
|
|
275
|
+
get condition() {
|
|
276
|
+
return code`!${camelCase(arg.name)}`;
|
|
277
|
+
},
|
|
278
|
+
get children() {
|
|
279
|
+
return createComponent(Show, {
|
|
280
|
+
get when() {
|
|
281
|
+
return arg.type === "boolean" || !arg.choices || arg.choices.length === 0;
|
|
282
|
+
},
|
|
283
|
+
get fallback() {
|
|
284
|
+
return code`const value = await select({
|
|
285
|
+
message: \`Please select a value for the \${italic("${arg.name}")} argument\`,${arg.description ? `description: \`${formatDescription(arg.description)}\`,
|
|
286
|
+
` : ""}
|
|
287
|
+
options: [ ${arg.choices?.map((choice) => `{ value: ${JSON.stringify(choice)}, label: "${choice}", ${arg.description ? `description: \`${formatShortDescription(arg.description)}\`` : ""} }`).join(", ")} ]
|
|
77
288
|
});
|
|
78
289
|
if (isCancel(value)) {
|
|
79
290
|
return;
|
|
80
291
|
}
|
|
81
292
|
|
|
82
|
-
${
|
|
83
|
-
|
|
293
|
+
${camelCase(arg.name)} = value;
|
|
294
|
+
`;
|
|
295
|
+
},
|
|
296
|
+
get children() {
|
|
297
|
+
return createComponent(Switch, { get children() {
|
|
298
|
+
return [
|
|
299
|
+
createComponent(Match, {
|
|
300
|
+
get when() {
|
|
301
|
+
return arg.type === "string";
|
|
302
|
+
},
|
|
303
|
+
get children() {
|
|
304
|
+
return code`
|
|
84
305
|
const value = await text({
|
|
85
|
-
message: \`Please provide a value for the \${italic("${
|
|
86
|
-
${
|
|
87
|
-
|
|
306
|
+
message: \`Please provide a value for the \${italic("${arg.name}")} argument\`,
|
|
307
|
+
${arg.description ? `description: \`${formatShortDescription(arg.description)}\`,
|
|
308
|
+
` : ""}validate(val) {
|
|
88
309
|
if (!val || val.trim() === "") {
|
|
89
310
|
return "A value must be provided for this argument";
|
|
90
311
|
}
|
|
@@ -96,44 +317,78 @@ import{VirtualCommandEntry as e}from"./virtual-command-entry.mjs";import{createC
|
|
|
96
317
|
return;
|
|
97
318
|
}
|
|
98
319
|
|
|
99
|
-
${
|
|
100
|
-
|
|
320
|
+
${camelCase(arg.name)} = value;
|
|
321
|
+
`;
|
|
322
|
+
}
|
|
323
|
+
}),
|
|
324
|
+
createComponent(Match, {
|
|
325
|
+
get when() {
|
|
326
|
+
return arg.type === "number";
|
|
327
|
+
},
|
|
328
|
+
get children() {
|
|
329
|
+
return code`
|
|
101
330
|
const value = await numeric({
|
|
102
|
-
message: \`Please provide a numeric value for the \${italic("${
|
|
103
|
-
${
|
|
104
|
-
|
|
331
|
+
message: \`Please provide a numeric value for the \${italic("${arg.name}")} argument\`,
|
|
332
|
+
${arg.description ? `description: \`${formatShortDescription(arg.description)}\`,
|
|
333
|
+
` : ""}
|
|
105
334
|
});
|
|
106
335
|
if (isCancel(value)) {
|
|
107
336
|
return;
|
|
108
337
|
}
|
|
109
338
|
|
|
110
|
-
${
|
|
111
|
-
|
|
339
|
+
${camelCase(arg.name)} = value;
|
|
340
|
+
`;
|
|
341
|
+
}
|
|
342
|
+
}),
|
|
343
|
+
createComponent(Match, {
|
|
344
|
+
get when() {
|
|
345
|
+
return arg.type === "boolean";
|
|
346
|
+
},
|
|
347
|
+
get children() {
|
|
348
|
+
return code`
|
|
112
349
|
const value = await toggle({
|
|
113
|
-
message: \`Please select a value for the \${italic("${
|
|
114
|
-
${
|
|
115
|
-
|
|
350
|
+
message: \`Please select a value for the \${italic("${arg.name}")} argument\`,
|
|
351
|
+
${arg.description ? `description: \`${formatShortDescription(arg.description)}\`,
|
|
352
|
+
` : ""}
|
|
116
353
|
});
|
|
117
354
|
if (isCancel(value)) {
|
|
118
355
|
return;
|
|
119
356
|
}
|
|
120
357
|
|
|
121
|
-
${
|
|
122
|
-
|
|
358
|
+
${camelCase(arg.name)} = value;
|
|
359
|
+
`;
|
|
360
|
+
}
|
|
361
|
+
})
|
|
362
|
+
];
|
|
363
|
+
} });
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
}), createComponent(Show, {
|
|
368
|
+
get when() {
|
|
369
|
+
return arg.variadic;
|
|
370
|
+
},
|
|
371
|
+
get children() {
|
|
372
|
+
return createComponent(ElseIfClause, {
|
|
373
|
+
get condition() {
|
|
374
|
+
return code`${camelCase(arg.name)}.length === 0`;
|
|
375
|
+
},
|
|
376
|
+
get children() {
|
|
377
|
+
return code`
|
|
123
378
|
const value = await text({
|
|
124
|
-
message: \`Please provide one or more${
|
|
125
|
-
${
|
|
126
|
-
|
|
379
|
+
message: \`Please provide one or more${arg.type === "number" ? " numeric" : ""} values for the \${italic("${arg.name}")} argument (values are separated by a \\",\\" character)\`,
|
|
380
|
+
${arg.description ? `description: \`${formatShortDescription(arg.description)}\`,
|
|
381
|
+
` : ""}validate(val) {
|
|
127
382
|
if (!val || val.trim() === "") {
|
|
128
383
|
return "A value must be provided for this argument";
|
|
129
384
|
}
|
|
130
385
|
if (val.split(",").map(v => v.trim()).filter(Boolean).length === 0) {
|
|
131
386
|
return "At least one value must be provided for this argument";
|
|
132
387
|
}
|
|
133
|
-
${
|
|
388
|
+
${arg.type === "number" ? `const invalidIndex = val.split(",").map(v => v.trim()).filter(Boolean).findIndex(v => Number.isNaN(Number(v));
|
|
134
389
|
if (invalidIndex !== -1) {
|
|
135
390
|
return \`Invalid numeric value provided for item #\${invalidIndex + 1} - all provided items must be a valid number\`;
|
|
136
|
-
}
|
|
391
|
+
} ` : ""}
|
|
137
392
|
|
|
138
393
|
return undefined;
|
|
139
394
|
}
|
|
@@ -142,7 +397,51 @@ import{VirtualCommandEntry as e}from"./virtual-command-entry.mjs";import{createC
|
|
|
142
397
|
return;
|
|
143
398
|
}
|
|
144
399
|
|
|
145
|
-
${
|
|
146
|
-
|
|
147
|
-
|
|
400
|
+
${camelCase(arg.name)} = value.split(",").map(value => value.trim()).filter(Boolean)${arg.type === "number" ? `.map(Number)` : arg.type === "boolean" ? `.map(Boolean)` : ""} ;
|
|
401
|
+
`;
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
})];
|
|
406
|
+
}
|
|
407
|
+
})]
|
|
408
|
+
}),
|
|
409
|
+
code`writeLine(""); `,
|
|
410
|
+
createComponent(Spacing, {}),
|
|
411
|
+
createComponent(CommandValidationLogic, { command }),
|
|
412
|
+
createComponent(IfStatement, {
|
|
413
|
+
condition: code`failures.length > 0`,
|
|
414
|
+
get children() {
|
|
415
|
+
return 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")}\`);
|
|
416
|
+
options.help = true; `;
|
|
417
|
+
}
|
|
418
|
+
})
|
|
419
|
+
];
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
})];
|
|
424
|
+
}
|
|
425
|
+
})];
|
|
426
|
+
}
|
|
427
|
+
})), createComponent(For, {
|
|
428
|
+
get each() {
|
|
429
|
+
return Object.values(command.children);
|
|
430
|
+
},
|
|
431
|
+
children: (child) => createComponent(Show, {
|
|
432
|
+
get when() {
|
|
433
|
+
return child.virtual;
|
|
434
|
+
},
|
|
435
|
+
get fallback() {
|
|
436
|
+
return createComponent(CommandEntry, { command: child });
|
|
437
|
+
},
|
|
438
|
+
get children() {
|
|
439
|
+
return createComponent(VirtualCommandEntry, { command: child });
|
|
440
|
+
}
|
|
441
|
+
})
|
|
442
|
+
})];
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
//#endregion
|
|
446
|
+
export { CommandEntry };
|
|
148
447
|
//# sourceMappingURL=command-entry.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-entry.mjs","names":[],"sources":["../../src/components/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 { code, computed, For, Match, Show, Switch } from \"@alloy-js/core\";\nimport { ElseIfClause, IfStatement } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { EntryFile } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport type {\n CommandTree,\n NumberCommandParameter,\n StringCommandParameter\n} from \"@shell-shock/core\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\nimport { CommandValidationLogic } from \"@shell-shock/core/components/command-validation-logic\";\nimport {\n formatDescription,\n formatShortDescription,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport { CommandHandlerDeclaration } from \"@shell-shock/preset-script/components/command-entry\";\nimport { findFilePath, relativePath } from \"@stryke/path/find\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replaceExtension } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { CLIPresetContext } from \"../types/plugin\";\nimport { VirtualCommandEntry } from \"./virtual-command-entry\";\n\nexport interface CommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The command entry point for the Shell Shock project.\n */\nexport function CommandEntry(props: CommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<CLIPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n const commandSourcePath = computed(() =>\n replaceExtension(\n relativePath(\n joinPaths(context.entryPath, findFilePath(filePath.value)),\n command.entry.input?.file || command.entry.file\n )\n )\n );\n const typeDefinition = computed(() => ({\n ...command.entry,\n output: command.id\n }));\n\n return (\n <>\n <EntryFile\n {...rest}\n path={filePath.value}\n typeDefinition={typeDefinition.value}\n imports={defu(imports ?? {}, {\n [commandSourcePath.value.startsWith(\".\")\n ? commandSourcePath.value\n : `./${commandSourcePath.value}`]:\n `handle${pascalCase(command.name)}`\n })}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"env\", \"isDevelopment\", \"isDebug\", \"paths\"],\n console: [\n \"debug\",\n \"info\",\n \"help\",\n \"warn\",\n \"error\",\n \"table\",\n \"italic\",\n \"cursor\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\",\n \"textColors\",\n \"createSpinner\"\n ],\n utils: [\"sleep\", \"isMinimal\", \"isInteractive\", \"isUnicodeSupported\"],\n state: [\n { name: \"GlobalOptions\", type: true },\n \"useGlobal\",\n \"useGlobalOptions\",\n \"withCommand\",\n \"useArgs\",\n \"hasFlag\",\n \"isHelp\"\n ],\n prompts: [\n \"text\",\n \"numeric\",\n \"toggle\",\n \"select\",\n \"confirm\",\n \"waitForKeyPress\",\n \"isCancel\"\n ],\n [joinPaths(\n \"help\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showHelp\"],\n [joinPaths(\n \"banner\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showBanner\"],\n upgrade: [\"executeUpgrade\"]\n })}>\n <Spacing />\n <CommandHandlerDeclaration\n command={command}\n banner={code`await showBanner();\n await executeUpgrade(); `}>\n <IfStatement condition={code`!isInteractive`}>\n <CommandValidationLogic command={command} />\n </IfStatement>\n <Show\n when={\n Object.values(command.options ?? {}).filter(\n option => !option.optional\n ).length > 0 ||\n Object.values(command.args ?? {}).filter(arg => !arg.optional)\n .length > 0\n }>\n <ElseIfClause\n condition={code`!isHelp() && (${Object.values(\n command.options ?? {}\n )\n .filter(option => !option.optional)\n .map(option =>\n (option.kind === CommandParameterKinds.string ||\n option.kind === CommandParameterKinds.number) &&\n option.variadic\n ? `(!options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } || options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }.length === 0)`\n : `options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } === undefined`\n )\n .join(\" || \")}${\n Object.values(command.options ?? {}).filter(\n option => !option.optional\n ).length > 0 &&\n Object.values(command.args ?? {}).filter(arg => !arg.optional)\n .length > 0\n ? \" || \"\n : \"\"\n }${Object.values(command.args ?? {})\n .filter(arg => !arg.optional)\n .map(arg =>\n (arg.kind === CommandParameterKinds.string ||\n arg.kind === CommandParameterKinds.number) &&\n arg.variadic\n ? `(!${camelCase(\n arg.name\n )} || ${camelCase(arg.name)}.length === 0)`\n : `${camelCase(arg.name)} === undefined`\n )\n .join(\" || \")}) `}>\n {code`writeLine(\"\"); `}\n <Spacing />\n <For each={Object.values(command.options ?? {})} doubleHardline>\n {option => (\n <>\n <Show when={!option.optional}>\n <IfStatement\n condition={code`!options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }`}>\n <Show\n when={\n option.kind === CommandParameterKinds.boolean ||\n !option.choices ||\n option.choices.length === 0\n }\n fallback={code`const value = await select({\n message: \\`Please select a value for the \\${italic(\"${\n option.name\n }\")} option\\`, ${\n option.description\n ? `description: \\`${formatDescription(\n option.description\n )}\\`,\n `\n : \"\"\n }options: [ ${(\n option as\n | StringCommandParameter\n | NumberCommandParameter\n ).choices\n ?.map(\n choice =>\n `{ value: ${JSON.stringify(\n choice\n )}, label: \"${choice}\", ${\n option.description\n ? `description: \\`${formatShortDescription(\n option.description\n )}\\``\n : \"\"\n } }`\n )\n .join(\", \")} ]\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value;\n `}>\n <Switch>\n <Match\n when={\n option.kind === CommandParameterKinds.string\n }>{code`\n const value = await text({\n message: \\`Please provide a value for the \\${italic(\"${\n option.name\n }\")} option\\`,\n ${\n option.description\n ? `description: \\`${formatDescription(\n option.description\n )}\\`,\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this option\";\n }\n\n return null;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value;\n `}</Match>\n <Match\n when={\n option.kind === CommandParameterKinds.number\n }>{code`\n const value = await numeric({\n message: \\`Please provide a numeric value for the \\${italic(\"${option.name}\")} option\\`,\n ${\n option.description\n ? `description: \\`${formatDescription(\n option.description\n )}\\`,\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value;\n `}</Match>\n <Match\n when={\n option.kind === CommandParameterKinds.boolean\n }>{code`\n const value = await toggle({\n message: \\`Please select a value for the \\${italic(\"${option.name}\")} option\\`,\n ${\n option.description\n ? `description: \\`${formatDescription(\n option.description\n )}\\`,\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value;\n `}</Match>\n </Switch>\n </Show>\n </IfStatement>\n <Show\n when={\n (option.kind === CommandParameterKinds.string ||\n option.kind === CommandParameterKinds.number) &&\n option.variadic\n }>\n <ElseIfClause\n condition={code`options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }.length === 0`}>\n {code`\n const value = await text({\n message: \\`Please provide one or more${\n option.kind === CommandParameterKinds.number\n ? \" numeric\"\n : \"\"\n } values for the \\${italic(\"${\n option.name\n }\")} option (values are separated by a \\\\\",\\\\\" character)\\`,\n ${\n option.description\n ? `description: \\`${formatDescription(\n option.description\n )}\\`,\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this option\";\n }\n if (val.split(\",\").map(v => v.trim()).filter(Boolean).length === 0) {\n return \"At least one value must be provided for this option\";\n }\n ${\n option.kind === CommandParameterKinds.number\n ? `const invalidIndex = val.split(\",\").map(v => v.trim()).filter(Boolean).findIndex(v => Number.isNaN(Number(v));\n if (invalidIndex !== -1) {\n return \\`Invalid numeric value provided for item #\\${invalidIndex + 1} - all provided items must be a valid number\\`;\n } `\n : \"\"\n }\n return undefined;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value.split(\",\").map(value => value.trim()).filter(Boolean)${\n option.kind === CommandParameterKinds.number\n ? `.map(Number)`\n : \"\"\n } ;\n `}\n </ElseIfClause>\n </Show>\n </Show>\n </>\n )}\n </For>\n <Spacing />\n <For each={command.args} doubleHardline>\n {arg => (\n <>\n <Show when={!arg.optional}>\n <IfStatement condition={code`!${camelCase(arg.name)}`}>\n <Show\n when={\n arg.kind === CommandParameterKinds.boolean ||\n !arg.choices ||\n arg.choices.length === 0\n }\n fallback={code`const value = await select({\n message: \\`Please select a value for the \\${italic(\"${\n arg.name\n }\")} argument\\`,${\n arg.description\n ? `description: \\`${formatDescription(\n arg.description\n )}\\`,\n `\n : \"\"\n }\n options: [ ${(\n arg as\n | StringCommandParameter\n | NumberCommandParameter\n ).choices\n ?.map(\n choice =>\n `{ value: ${JSON.stringify(\n choice\n )}, label: \"${choice}\", ${\n arg.description\n ? `description: \\`${formatShortDescription(\n arg.description\n )}\\``\n : \"\"\n } }`\n )\n .join(\", \")} ]\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(arg.name)} = value;\n `}>\n <Switch>\n <Match\n when={\n arg.kind === CommandParameterKinds.string\n }>{code`\n const value = await text({\n message: \\`Please provide a value for the \\${italic(\"${arg.name}\")} argument\\`,\n ${\n arg.description\n ? `description: \\`${formatShortDescription(\n arg.description\n )}\\`,\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this argument\";\n }\n\n return null;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(arg.name)} = value;\n `}</Match>\n <Match\n when={\n arg.kind === CommandParameterKinds.number\n }>{code`\n const value = await numeric({\n message: \\`Please provide a numeric value for the \\${italic(\"${arg.name}\")} argument\\`,\n ${\n arg.description\n ? `description: \\`${formatShortDescription(\n arg.description\n )}\\`,\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(arg.name)} = value;\n `}</Match>\n <Match\n when={\n arg.kind === CommandParameterKinds.boolean\n }>{code`\n const value = await toggle({\n message: \\`Please select a value for the \\${italic(\"${arg.name}\")} argument\\`,\n ${\n arg.description\n ? `description: \\`${formatShortDescription(\n arg.description\n )}\\`,\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(arg.name)} = value;\n `}</Match>\n </Switch>\n </Show>\n </IfStatement>\n <Show when={arg.variadic}>\n <ElseIfClause\n condition={code`${camelCase(arg.name)}.length === 0`}>\n {code`\n const value = await text({\n message: \\`Please provide one or more${\n arg.kind === CommandParameterKinds.number\n ? \" numeric\"\n : \"\"\n } values for the \\${italic(\"${arg.name}\")} argument (values are separated by a \\\\\",\\\\\" character)\\`,\n ${\n arg.description\n ? `description: \\`${formatShortDescription(\n arg.description\n )}\\`,\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this argument\";\n }\n if (val.split(\",\").map(v => v.trim()).filter(Boolean).length === 0) {\n return \"At least one value must be provided for this argument\";\n }\n ${\n arg.kind === CommandParameterKinds.number\n ? `const invalidIndex = val.split(\",\").map(v => v.trim()).filter(Boolean).findIndex(v => Number.isNaN(Number(v));\n if (invalidIndex !== -1) {\n return \\`Invalid numeric value provided for item #\\${invalidIndex + 1} - all provided items must be a valid number\\`;\n } `\n : \"\"\n }\n\n return undefined;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(arg.name)} = value.split(\",\").map(value => value.trim()).filter(Boolean)${\n arg.kind === CommandParameterKinds.number\n ? `.map(Number)`\n : arg.kind === CommandParameterKinds.boolean\n ? `.map(Boolean)`\n : \"\"\n } ;\n `}\n </ElseIfClause>\n </Show>\n </Show>\n </>\n )}\n </For>\n {code`writeLine(\"\"); `}\n <Spacing />\n <CommandValidationLogic command={command} />\n <IfStatement condition={code`failures.length > 0`}>\n {code`error(\\`The following validation failures were found while processing the user provided input, and must be corrected before the \\${italic(\"${\n command.title\n }\")} command can be executed: \\\\n\\\\n\\${failures.map(failure => \" - \" + failure).join(\"\\\\n\")}\\`);\n options.help = true; `}\n </IfStatement>\n </ElseIfClause>\n </Show>\n </CommandHandlerDeclaration>\n </EntryFile>\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":"6sCAsCA,SAAS,EAAmB,EAAO,CACnC,GAAQ,CACR,UACA,UACA,iBACA,GAAO,GACD,QAEC,EAAU,MAAiB,EAAS,EAAI,SAAA,OAAA,GAAA,CAAA,EAAA,EAAA,CAAA,CAAA,KAAA,IAAA,CAAA,WAAA,CAAA,CAC7C,EAAc,MAAA,EAAA,EAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,CAAA,CAAA,EAAA,MAAA,OAAA,MAAA,EAAA,MAAA,KAAA,CAAA,CAAA,CACR,EAAI,OAAc,CACxB,GAAA,EAAA,MACA,OAAS,EAAA,GACX,EAAA,i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