@shell-shock/preset-cli 0.5.1 → 0.6.0

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.
Files changed (31) hide show
  1. package/dist/components/banner-function-declaration.d.cts +2 -2
  2. package/dist/components/banner-function-declaration.d.cts.map +1 -1
  3. package/dist/components/banner-function-declaration.d.mts +2 -2
  4. package/dist/components/command-entry.cjs +96 -45
  5. package/dist/components/command-entry.d.cts +2 -2
  6. package/dist/components/command-entry.d.cts.map +1 -1
  7. package/dist/components/command-entry.d.mts +2 -2
  8. package/dist/components/command-entry.d.mts.map +1 -1
  9. package/dist/components/command-entry.mjs +96 -45
  10. package/dist/components/command-entry.mjs.map +1 -1
  11. package/dist/components/index.cjs +1 -0
  12. package/dist/components/index.d.cts +2 -2
  13. package/dist/components/index.d.mts +2 -2
  14. package/dist/components/index.mjs +2 -2
  15. package/dist/components/prompts-builtin.cjs +451 -48
  16. package/dist/components/prompts-builtin.d.cts +5 -1
  17. package/dist/components/prompts-builtin.d.cts.map +1 -1
  18. package/dist/components/prompts-builtin.d.mts +5 -1
  19. package/dist/components/prompts-builtin.d.mts.map +1 -1
  20. package/dist/components/prompts-builtin.mjs +452 -50
  21. package/dist/components/prompts-builtin.mjs.map +1 -1
  22. package/dist/components/virtual-command-entry.cjs +1 -0
  23. package/dist/components/virtual-command-entry.d.cts +2 -2
  24. package/dist/components/virtual-command-entry.mjs +1 -0
  25. package/dist/components/virtual-command-entry.mjs.map +1 -1
  26. package/dist/index.cjs +1 -0
  27. package/dist/index.d.cts.map +1 -1
  28. package/dist/index.d.mts.map +1 -1
  29. package/dist/index.mjs +1 -0
  30. package/dist/index.mjs.map +1 -1
  31. package/package.json +9 -9
@@ -1,11 +1,11 @@
1
- import * as _alloy_js_core10 from "@alloy-js/core";
1
+ import * as _alloy_js_core0 from "@alloy-js/core";
2
2
  import { BannerFunctionDeclarationProps } from "@shell-shock/preset-script/components/banner-function-declaration";
3
3
 
4
4
  //#region src/components/banner-function-declaration.d.ts
5
5
  /**
6
6
  * A component to generate the `banner` function in the `shell-shock:console` builtin module.
7
7
  */
8
- declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps): _alloy_js_core10.Children;
8
+ declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps): _alloy_js_core0.Children;
9
9
  //#endregion
10
10
  export { BannerFunctionDeclaration };
11
11
  //# sourceMappingURL=banner-function-declaration.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"banner-function-declaration.d.cts","names":[],"sources":["../../src/components/banner-function-declaration.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAkCgB,iBAAA,yBAAA,CACP,KAAA,EAAA,8BAA8B,CAAA,EAAA,gBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"banner-function-declaration.d.cts","names":[],"sources":["../../src/components/banner-function-declaration.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAkCgB,iBAAA,yBAAA,CACP,KAAA,EAAA,8BAA8B,CAAA,EAAA,eAAA,CAAA,QAAA"}
@@ -1,11 +1,11 @@
1
- import * as _alloy_js_core10 from "@alloy-js/core";
1
+ import * as _alloy_js_core11 from "@alloy-js/core";
2
2
  import { BannerFunctionDeclarationProps } from "@shell-shock/preset-script/components/banner-function-declaration";
3
3
 
4
4
  //#region src/components/banner-function-declaration.d.ts
5
5
  /**
6
6
  * A component to generate the `banner` function in the `shell-shock:console` builtin module.
7
7
  */
8
- declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps): _alloy_js_core10.Children;
8
+ declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps): _alloy_js_core11.Children;
9
9
  //#endregion
10
10
  export { BannerFunctionDeclaration };
11
11
  //# sourceMappingURL=banner-function-declaration.d.mts.map
@@ -73,6 +73,7 @@ function CommandEntry(props) {
73
73
  ],
74
74
  prompts: [
75
75
  "text",
76
+ "numeric",
76
77
  "toggle",
77
78
  "select",
78
79
  "isCancel",
@@ -118,46 +119,71 @@ function CommandEntry(props) {
118
119
  },
119
120
  get children() {
120
121
  return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Switch, { get children() {
121
- return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
122
- get when() {
123
- return option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string || option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number;
124
- },
125
- get children() {
126
- return __alloy_js_core.code`
122
+ return [
123
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
124
+ get when() {
125
+ return option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string;
126
+ },
127
+ get children() {
128
+ return __alloy_js_core.code`
127
129
  const value = await text({
128
- message: "Please provide a${option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number ? " numeric" : ""} value for the \\"${option.name}\\" option",
130
+ message: "Please provide a value for the \\"${option.name}\\" option",
129
131
  ${option.description ? `description: "${option.description}",
130
132
  ` : ""}validate(val) {
131
133
  if (!val || val.trim() === "") {
132
134
  return "A value must be provided for this option";
133
135
  }
134
- ${option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number ? `if (Number.isNaN(Number(val))) {
135
- return "The value provided must be a valid number";
136
- }` : ""}
137
- return undefined;
136
+
137
+ return null;
138
138
  }
139
139
  });
140
140
  if (isCancel(value)) {
141
141
  return;
142
142
  }
143
143
 
144
- options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, __stryke_string_format_camel_case.camelCase)(option.name)}`} = ${option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number ? `Number(value)` : "value"};
144
+ options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, __stryke_string_format_camel_case.camelCase)(option.name)}`} = value;
145
+ `;
146
+ }
147
+ }),
148
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
149
+ get when() {
150
+ return option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number;
151
+ },
152
+ get children() {
153
+ return __alloy_js_core.code`
154
+ const value = await numeric({
155
+ message: "Please provide a numeric value for the \\"${option.name}\\" option",
156
+ ${option.description ? `description: "${option.description}",
157
+ ` : ""}
158
+ });
159
+ if (isCancel(value)) {
160
+ return;
161
+ }
162
+
163
+ options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, __stryke_string_format_camel_case.camelCase)(option.name)}`} = value;
145
164
  `;
146
- }
147
- }), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
148
- get when() {
149
- return option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.boolean;
150
- },
151
- get children() {
152
- return __alloy_js_core.code`
153
- options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, __stryke_string_format_camel_case.camelCase)(option.name)}`} = await toggle({
154
- message: "Please select a value for the "${option.name}" option",
165
+ }
166
+ }),
167
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
168
+ get when() {
169
+ return option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.boolean;
170
+ },
171
+ get children() {
172
+ return __alloy_js_core.code`
173
+ const value = await toggle({
174
+ message: "Please select a value for the \\"${option.name}\\" option",
155
175
  ${option.description ? `description: "${option.description}",
156
176
  ` : ""}
157
177
  });
178
+ if (isCancel(value)) {
179
+ return;
180
+ }
181
+
182
+ options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, __stryke_string_format_camel_case.camelCase)(option.name)}`} = value;
158
183
  `;
159
- }
160
- })];
184
+ }
185
+ })
186
+ ];
161
187
  } });
162
188
  }
163
189
  }), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
@@ -218,46 +244,71 @@ function CommandEntry(props) {
218
244
  },
219
245
  get children() {
220
246
  return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Switch, { get children() {
221
- return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
222
- get when() {
223
- return argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string || argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number;
224
- },
225
- get children() {
226
- return __alloy_js_core.code`
247
+ return [
248
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
249
+ get when() {
250
+ return argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string;
251
+ },
252
+ get children() {
253
+ return __alloy_js_core.code`
227
254
  const value = await text({
228
- message: "Please provide a${argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number ? " numeric" : ""} value for the \\"${argument.name}\\" argument",
255
+ message: "Please provide a value for the \\"${argument.name}\\" argument",
229
256
  ${argument.description ? `description: "${argument.description}",
230
257
  ` : ""}validate(val) {
231
258
  if (!val || val.trim() === "") {
232
259
  return "A value must be provided for this argument";
233
260
  }
234
- ${argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number ? `if (Number.isNaN(Number(val))) {
235
- return "The provided value must be a valid number";
236
- }` : ""}
237
- return undefined;
261
+
262
+ return null;
238
263
  }
239
264
  });
240
265
  if (isCancel(value)) {
241
266
  return;
242
267
  }
243
268
 
244
- ${(0, __stryke_string_format_camel_case.camelCase)(argument.name)} = ${argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number ? `Number(value)` : "value"};
269
+ ${(0, __stryke_string_format_camel_case.camelCase)(argument.name)} = value;
270
+ `;
271
+ }
272
+ }),
273
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
274
+ get when() {
275
+ return argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number;
276
+ },
277
+ get children() {
278
+ return __alloy_js_core.code`
279
+ const value = await numeric({
280
+ message: "Please provide a numeric value for the \\"${argument.name}\\" argument",
281
+ ${argument.description ? `description: "${argument.description}",
282
+ ` : ""}
283
+ });
284
+ if (isCancel(value)) {
285
+ return;
286
+ }
287
+
288
+ ${(0, __stryke_string_format_camel_case.camelCase)(argument.name)} = value;
245
289
  `;
246
- }
247
- }), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
248
- get when() {
249
- return argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.boolean;
250
- },
251
- get children() {
252
- return __alloy_js_core.code`
253
- ${(0, __stryke_string_format_camel_case.camelCase)(argument.name)} = await toggle({
290
+ }
291
+ }),
292
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
293
+ get when() {
294
+ return argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.boolean;
295
+ },
296
+ get children() {
297
+ return __alloy_js_core.code`
298
+ const value = await toggle({
254
299
  message: "Please select a value for the \\"${argument.name}\\" argument",
255
300
  ${argument.description ? `description: "${argument.description}",
256
301
  ` : ""}
257
302
  });
303
+ if (isCancel(value)) {
304
+ return;
305
+ }
306
+
307
+ ${(0, __stryke_string_format_camel_case.camelCase)(argument.name)} = value;
258
308
  `;
259
- }
260
- })];
309
+ }
310
+ })
311
+ ];
261
312
  } });
262
313
  }
263
314
  }), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
@@ -1,4 +1,4 @@
1
- import * as _alloy_js_core2 from "@alloy-js/core";
1
+ import * as _alloy_js_core11 from "@alloy-js/core";
2
2
  import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
3
3
  import { CommandTree } from "@shell-shock/core/types/command";
4
4
 
@@ -9,7 +9,7 @@ interface CommandEntryProps extends Omit<EntryFileProps, "path" | "typeDefinitio
9
9
  /**
10
10
  * The command entry point for the Shell Shock project.
11
11
  */
12
- declare function CommandEntry(props: CommandEntryProps): _alloy_js_core2.Children;
12
+ declare function CommandEntry(props: CommandEntryProps): _alloy_js_core11.Children;
13
13
  //#endregion
14
14
  export { CommandEntry, CommandEntryProps };
15
15
  //# sourceMappingURL=command-entry.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-entry.d.cts","names":[],"sources":["../../src/components/command-entry.tsx"],"sourcesContent":[],"mappings":";;;;;UAyCiB,iBAAA,SAA0B,KACzC;WAGS;;AAJX;;;AAA2C,iBAU3B,YAAA,CAV2B,KAAA,EAUP,iBAVO,CAAA,EAUU,eAAA,CAAA,QAVV"}
1
+ {"version":3,"file":"command-entry.d.cts","names":[],"sources":["../../src/components/command-entry.tsx"],"sourcesContent":[],"mappings":";;;;;UAyCiB,iBAAA,SAA0B,KACzC;WAGS;;AAJX;;;AAA2C,iBAU3B,YAAA,CAV2B,KAAA,EAUP,iBAVO,CAAA,EAUU,gBAAA,CAAA,QAVV"}
@@ -1,4 +1,4 @@
1
- import * as _alloy_js_core9 from "@alloy-js/core";
1
+ import * as _alloy_js_core10 from "@alloy-js/core";
2
2
  import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
3
3
  import { CommandTree } from "@shell-shock/core/types/command";
4
4
 
@@ -9,7 +9,7 @@ interface CommandEntryProps extends Omit<EntryFileProps, "path" | "typeDefinitio
9
9
  /**
10
10
  * The command entry point for the Shell Shock project.
11
11
  */
12
- declare function CommandEntry(props: CommandEntryProps): _alloy_js_core9.Children;
12
+ declare function CommandEntry(props: CommandEntryProps): _alloy_js_core10.Children;
13
13
  //#endregion
14
14
  export { CommandEntry, CommandEntryProps };
15
15
  //# sourceMappingURL=command-entry.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-entry.d.mts","names":[],"sources":["../../src/components/command-entry.tsx"],"sourcesContent":[],"mappings":";;;;;UAyCiB,iBAAA,SAA0B,KACzC;WAGS;;AAJX;;;AAA2C,iBAU3B,YAAA,CAV2B,KAAA,EAUP,iBAVO,CAAA,EAUU,eAAA,CAAA,QAVV"}
1
+ {"version":3,"file":"command-entry.d.mts","names":[],"sources":["../../src/components/command-entry.tsx"],"sourcesContent":[],"mappings":";;;;;UAyCiB,iBAAA,SAA0B,KACzC;WAGS;;AAJX;;;AAA2C,iBAU3B,YAAA,CAV2B,KAAA,EAUP,iBAVO,CAAA,EAUU,gBAAA,CAAA,QAVV"}
@@ -71,6 +71,7 @@ function CommandEntry(props) {
71
71
  ],
72
72
  prompts: [
73
73
  "text",
74
+ "numeric",
74
75
  "toggle",
75
76
  "select",
76
77
  "isCancel",
@@ -116,46 +117,71 @@ function CommandEntry(props) {
116
117
  },
117
118
  get children() {
118
119
  return createComponent(Switch, { get children() {
119
- return [createComponent(Match, {
120
- get when() {
121
- return option.kind === ReflectionKind.string || option.kind === ReflectionKind.number;
122
- },
123
- get children() {
124
- return code`
120
+ return [
121
+ createComponent(Match, {
122
+ get when() {
123
+ return option.kind === ReflectionKind.string;
124
+ },
125
+ get children() {
126
+ return code`
125
127
  const value = await text({
126
- message: "Please provide a${option.kind === ReflectionKind.number ? " numeric" : ""} value for the \\"${option.name}\\" option",
128
+ message: "Please provide a value for the \\"${option.name}\\" option",
127
129
  ${option.description ? `description: "${option.description}",
128
130
  ` : ""}validate(val) {
129
131
  if (!val || val.trim() === "") {
130
132
  return "A value must be provided for this option";
131
133
  }
132
- ${option.kind === ReflectionKind.number ? `if (Number.isNaN(Number(val))) {
133
- return "The value provided must be a valid number";
134
- }` : ""}
135
- return undefined;
134
+
135
+ return null;
136
136
  }
137
137
  });
138
138
  if (isCancel(value)) {
139
139
  return;
140
140
  }
141
141
 
142
- options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = ${option.kind === ReflectionKind.number ? `Number(value)` : "value"};
142
+ options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = value;
143
+ `;
144
+ }
145
+ }),
146
+ createComponent(Match, {
147
+ get when() {
148
+ return option.kind === ReflectionKind.number;
149
+ },
150
+ get children() {
151
+ return code`
152
+ const value = await numeric({
153
+ message: "Please provide a numeric value for the \\"${option.name}\\" option",
154
+ ${option.description ? `description: "${option.description}",
155
+ ` : ""}
156
+ });
157
+ if (isCancel(value)) {
158
+ return;
159
+ }
160
+
161
+ options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = value;
143
162
  `;
144
- }
145
- }), createComponent(Match, {
146
- get when() {
147
- return option.kind === ReflectionKind.boolean;
148
- },
149
- get children() {
150
- return code`
151
- options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = await toggle({
152
- message: "Please select a value for the "${option.name}" option",
163
+ }
164
+ }),
165
+ createComponent(Match, {
166
+ get when() {
167
+ return option.kind === ReflectionKind.boolean;
168
+ },
169
+ get children() {
170
+ return code`
171
+ const value = await toggle({
172
+ message: "Please select a value for the \\"${option.name}\\" option",
153
173
  ${option.description ? `description: "${option.description}",
154
174
  ` : ""}
155
175
  });
176
+ if (isCancel(value)) {
177
+ return;
178
+ }
179
+
180
+ options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = value;
156
181
  `;
157
- }
158
- })];
182
+ }
183
+ })
184
+ ];
159
185
  } });
160
186
  }
161
187
  }), createComponent(Show, {
@@ -216,46 +242,71 @@ function CommandEntry(props) {
216
242
  },
217
243
  get children() {
218
244
  return createComponent(Switch, { get children() {
219
- return [createComponent(Match, {
220
- get when() {
221
- return argument.kind === ReflectionKind.string || argument.kind === ReflectionKind.number;
222
- },
223
- get children() {
224
- return code`
245
+ return [
246
+ createComponent(Match, {
247
+ get when() {
248
+ return argument.kind === ReflectionKind.string;
249
+ },
250
+ get children() {
251
+ return code`
225
252
  const value = await text({
226
- message: "Please provide a${argument.kind === ReflectionKind.number ? " numeric" : ""} value for the \\"${argument.name}\\" argument",
253
+ message: "Please provide a value for the \\"${argument.name}\\" argument",
227
254
  ${argument.description ? `description: "${argument.description}",
228
255
  ` : ""}validate(val) {
229
256
  if (!val || val.trim() === "") {
230
257
  return "A value must be provided for this argument";
231
258
  }
232
- ${argument.kind === ReflectionKind.number ? `if (Number.isNaN(Number(val))) {
233
- return "The provided value must be a valid number";
234
- }` : ""}
235
- return undefined;
259
+
260
+ return null;
236
261
  }
237
262
  });
238
263
  if (isCancel(value)) {
239
264
  return;
240
265
  }
241
266
 
242
- ${camelCase(argument.name)} = ${argument.kind === ReflectionKind.number ? `Number(value)` : "value"};
267
+ ${camelCase(argument.name)} = value;
268
+ `;
269
+ }
270
+ }),
271
+ createComponent(Match, {
272
+ get when() {
273
+ return argument.kind === ReflectionKind.number;
274
+ },
275
+ get children() {
276
+ return code`
277
+ const value = await numeric({
278
+ message: "Please provide a numeric value for the \\"${argument.name}\\" argument",
279
+ ${argument.description ? `description: "${argument.description}",
280
+ ` : ""}
281
+ });
282
+ if (isCancel(value)) {
283
+ return;
284
+ }
285
+
286
+ ${camelCase(argument.name)} = value;
243
287
  `;
244
- }
245
- }), createComponent(Match, {
246
- get when() {
247
- return argument.kind === ReflectionKind.boolean;
248
- },
249
- get children() {
250
- return code`
251
- ${camelCase(argument.name)} = await toggle({
288
+ }
289
+ }),
290
+ createComponent(Match, {
291
+ get when() {
292
+ return argument.kind === ReflectionKind.boolean;
293
+ },
294
+ get children() {
295
+ return code`
296
+ const value = await toggle({
252
297
  message: "Please select a value for the \\"${argument.name}\\" argument",
253
298
  ${argument.description ? `description: "${argument.description}",
254
299
  ` : ""}
255
300
  });
301
+ if (isCancel(value)) {
302
+ return;
303
+ }
304
+
305
+ ${camelCase(argument.name)} = value;
256
306
  `;
257
- }
258
- })];
307
+ }
308
+ })
309
+ ];
259
310
  } });
260
311
  }
261
312
  }), createComponent(Show, {
@@ -1 +1 @@
1
- {"version":3,"file":"command-entry.mjs","names":["code","computed","For","Match","Show","Switch","ElseIfClause","IfStatement","ReflectionKind","Spacing","usePowerlines","EntryFile","isDynamicPathSegment","CommandHandlerDeclaration","CommandValidationLogic","findFilePath","relativePath","joinPaths","replaceExtension","camelCase","pascalCase","defu","BannerFunctionDeclaration","VirtualCommandEntry","CommandEntry","props","command","imports","builtinImports","rest","context","filePath","segments","filter","segment","join","commandSourcePath","entryPath","value","entry","input","file","typeDefinition","output","id","_$createComponent","_$mergeProps","path","name","prompts","env","console","utils","children","_$createIntrinsic","banner","condition","Object","values","options","option","optional","map","kind","string","number","variadic","includes","length","arguments","argument","each","doubleHardline","when","description","boolean","child","isVirtual","fallback"],"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 { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\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 { isDynamicPathSegment } from \"@shell-shock/core/plugin-utils/context-helpers\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport {\n CommandHandlerDeclaration,\n CommandValidationLogic\n} 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 { BannerFunctionDeclaration } from \"./banner-function-declaration\";\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]: `handle${pascalCase(command.name)}`,\n prompts: \"prompts\"\n })}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"env\", \"isDevelopment\", \"isDebug\"],\n console: [\n \"debug\",\n \"warn\",\n \"error\",\n \"table\",\n \"colors\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"hasFlag\",\n \"isMinimal\",\n \"isInteractive\",\n \"isHelp\",\n \"isUnicodeSupported\",\n \"internal_commandContext\"\n ],\n prompts: [\"text\", \"toggle\", \"select\", \"isCancel\", \"sleep\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <hbr />\n <hbr />\n <CommandHandlerDeclaration\n command={command}\n banner={code`await banner(); `}>\n <IfStatement condition={code`!isInteractive`}>\n <CommandValidationLogic command={command} />\n </IfStatement>\n <ElseIfClause\n condition={code`!isHelp && (${Object.values(command.options ?? {})\n .filter(option => !option.optional)\n .map(option =>\n (option.kind === ReflectionKind.string ||\n option.kind === ReflectionKind.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.arguments ?? {}).filter(\n argument => !argument.optional\n ).length > 0\n ? \" || \"\n : \"\"\n }${Object.values(command.arguments ?? {})\n .filter(argument => !argument.optional)\n .map(argument =>\n (argument.kind === ReflectionKind.string ||\n argument.kind === ReflectionKind.number) &&\n argument.variadic\n ? `(!${camelCase(\n argument.name\n )} || ${camelCase(argument.name)}.length === 0)`\n : `${camelCase(argument.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 <Switch>\n <Match\n when={\n option.kind === ReflectionKind.string ||\n option.kind === ReflectionKind.number\n }>{code`\n const value = await text({\n message: \"Please provide a${\n option.kind === ReflectionKind.number\n ? \" numeric\"\n : \"\"\n } value for the \\\\\"${option.name}\\\\\" option\",\n ${\n option.description\n ? `description: \"${option.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this option\";\n }\n ${\n option.kind === ReflectionKind.number\n ? `if (Number.isNaN(Number(val))) {\n return \"The value provided 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 } = ${\n option.kind === ReflectionKind.number\n ? `Number(value)`\n : \"value\"\n };\n `}</Match>\n <Match\n when={option.kind === ReflectionKind.boolean}>{code`\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = await toggle({\n message: \"Please select a value for the \"${\n option.name\n }\" option\",\n ${\n option.description\n ? `description: \"${option.description}\",\n `\n : \"\"\n }\n });\n `}</Match>\n </Switch>\n </IfStatement>\n <Show\n when={\n (option.kind === ReflectionKind.string ||\n option.kind === ReflectionKind.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 === ReflectionKind.number\n ? \" numeric\"\n : \"\"\n } values for the \\\\\"${option.name}\\\\\" option (values are separated by a \\\\\",\\\\\" character)\",\n ${\n option.description\n ? `description: \"${option.description}\",\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 === ReflectionKind.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 === ReflectionKind.number\n ? `.map(Number)`\n : \"\"\n } ;\n `}\n </ElseIfClause>\n </Show>\n </Show>\n </>\n )}\n </For>\n <Spacing />\n <For each={command.arguments} doubleHardline>\n {argument => (\n <>\n <Show when={!argument.optional}>\n <IfStatement condition={code`!${camelCase(argument.name)}`}>\n <Switch>\n <Match\n when={\n argument.kind === ReflectionKind.string ||\n argument.kind === ReflectionKind.number\n }>{code`\n const value = await text({\n message: \"Please provide a${\n argument.kind === ReflectionKind.number\n ? \" numeric\"\n : \"\"\n } value for the \\\\\"${argument.name}\\\\\" argument\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this argument\";\n }\n ${\n argument.kind === ReflectionKind.number\n ? `if (Number.isNaN(Number(val))) {\n return \"The provided value must be a valid number\";\n }`\n : \"\"\n }\n return undefined;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(argument.name)} = ${\n argument.kind === ReflectionKind.number\n ? `Number(value)`\n : \"value\"\n };\n `}</Match>\n <Match\n when={argument.kind === ReflectionKind.boolean}>{code`\n ${camelCase(argument.name)} = await toggle({\n message: \"Please select a value for the \\\\\"${argument.name}\\\\\" argument\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }\n });\n `}</Match>\n </Switch>\n </IfStatement>\n <Show\n when={\n (argument.kind === ReflectionKind.string ||\n argument.kind === ReflectionKind.number) &&\n argument.variadic\n }>\n <ElseIfClause\n condition={code`${camelCase(argument.name)}.length === 0`}>\n {code`\n const value = await text({\n message: \"Please provide one or more${\n argument.kind === ReflectionKind.number\n ? \" numeric\"\n : \"\"\n } (values are separated by a \\\\\",\\\\\" character)\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\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 argument.kind === ReflectionKind.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(argument.name)} = value.split(\",\").map(value => value.trim()).filter(Boolean)${\n argument.kind === ReflectionKind.number\n ? `.map(Number)`\n : \"\"\n } ;\n `}\n </ElseIfClause>\n </Show>\n </Show>\n </>\n )}\n </For>\n {code`writeLine(\"\"); `}\n <Spacing />\n </ElseIfClause>\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":";;;;;;;;;;;;;;;;;;;;;;AAmDA,SAAgBwB,aAAaC,OAA0B;CACrD,MAAM,EAAEC,SAASC,SAASC,gBAAgB,GAAGC,SAASJ;CAEtD,MAAMK,UAAUpB,eAAiC;CACjD,MAAMqB,WAAW9B,eACfgB,UACES,QAAQM,SACLC,QAAOC,YAAW,CAACtB,qBAAqBsB,QAAQ,CAAC,CACjDC,KAAK,IAAI,EACZ,WAEJ,CAAC;CACD,MAAMC,oBAAoBnC,eACxBiB,iBACEF,aACEC,UAAUa,QAAQO,WAAWtB,aAAagB,SAASO,MAAM,CAAC,EAC1DZ,QAAQa,MAAMC,OAAOC,QAAQf,QAAQa,MAAME,KAE/C,CACF,CAAC;CACD,MAAMC,iBAAiBzC,gBAAgB;EACrC,GAAGyB,QAAQa;EACXI,QAAQjB,QAAQkB;EACjB,EAAE;AAEH,QAAA,CAAAC,gBAEKlC,WAASmC,WACJjB,MAAI;EAAA,IACRkB,OAAI;AAAA,UAAEhB,SAASO;;EAAK,IACpBI,iBAAc;AAAA,UAAEA,eAAeJ;;EAAK,IACpCX,UAAO;AAAA,UAAEN,KAAKM,WAAW,EAAE,EAAE;KAC1BS,kBAAkBE,QAAQ,SAASlB,WAAWM,QAAQsB,KAAK;IAC5DC,SAAS;IACV,CAAC;;EAAA,IACFrB,iBAAc;AAAA,UAAEP,KAAKO,kBAAkB,EAAE,EAAE;IACzCsB,KAAK;KAAC;KAAO;KAAiB;KAAU;IACxCC,SAAS;KACP;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD;IACDC,OAAO;KACL;KACA;KACA;KACA;KACA;KACA;KACA;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AErC,GAAE;;;;gBAGX,CAAA,CAAA;iBAAA,CAAA;;aAAA,CAAA,EAAA7B,gBAGNzC,MAAI;aAAA,IACHqE,OAAI;AAAA,sBACDH,SAASP,SAASvD,eAAewD,UAChCM,SAASP,SAASvD,eAAeyD,WACnCK,SAASJ;;aAAQ,IAAAb,WAAA;AAAA,qBAAAR,gBAElBvC,cAAY;eAAA,IACXkD,YAAS;AAAA,uBAAExD,IAAI,GAAGmB,UAAUmD,SAAStB,KAAK,CAAA;;eAAe,IAAAK,WAAA;AAAA,uBACxDrD,IAAI;;oEAGGsE,SAASP,SAASvD,eAAeyD,SAC7B,aACA,GAAE;gCAGNK,SAASI,cACL,iBAAiBJ,SAASI,YAAW;kCAErC,GAAE;;;;;;;kCASJJ,SAASP,SAASvD,eAAeyD,SAC7B;;;0CAIA,GAAE;;;;;;;;;8BAUV9C,UAAUmD,SAAStB,KAAK,CAAA,gEACxBsB,SAASP,SAASvD,eAAeyD,SAC7B,iBACA,GAAE;;;eAET,CAAA;;aAAA,CAAA,CAAA;;WAAA,CAAA,CAAA;UAKZ,CAAA;SAEFjE,IAAI;SAAiB6C,gBACrBpC,SAAO,EAAA,CAAA;SAAA;;OAAA,CAAA,CAAA;;KAAA,CAAA;IAAA;;EAAA,CAAA,CAAA,EAAAoC,gBAIb3C,KAAG;EAAA,IAACqE,OAAI;AAAA,UAAEd,OAAOC,OAAOhC,QAAQ2B,SAAS;;EAAAA,WACvCuB,UAAK/B,gBACHzC,MAAI;GAAA,IACHqE,OAAI;AAAA,WAAEG,MAAMC;;GAAS,IACrBC,WAAQ;AAAA,WAAAjC,gBAAGrB,cAAY,EAACE,SAASkD,OAAK,CAAA;;GAAA,IAAAvB,WAAA;AAAA,WAAAR,gBACrCtB,qBAAmB,EAACG,SAASkD,OAAK,CAAA;;GAAA,CAAA;EAEtC,CAAA,CAAA"}
1
+ {"version":3,"file":"command-entry.mjs","names":["code","computed","For","Match","Show","Switch","ElseIfClause","IfStatement","ReflectionKind","Spacing","usePowerlines","EntryFile","isDynamicPathSegment","CommandHandlerDeclaration","CommandValidationLogic","findFilePath","relativePath","joinPaths","replaceExtension","camelCase","pascalCase","defu","BannerFunctionDeclaration","VirtualCommandEntry","CommandEntry","props","command","imports","builtinImports","rest","context","filePath","segments","filter","segment","join","commandSourcePath","entryPath","value","entry","input","file","typeDefinition","output","id","_$createComponent","_$mergeProps","path","name","prompts","env","console","utils","children","_$createIntrinsic","banner","condition","Object","values","options","option","optional","map","kind","string","number","variadic","includes","length","arguments","argument","each","doubleHardline","when","description","boolean","child","isVirtual","fallback"],"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 { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\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 { isDynamicPathSegment } from \"@shell-shock/core/plugin-utils/context-helpers\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport {\n CommandHandlerDeclaration,\n CommandValidationLogic\n} 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 { BannerFunctionDeclaration } from \"./banner-function-declaration\";\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]: `handle${pascalCase(command.name)}`,\n prompts: \"prompts\"\n })}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"env\", \"isDevelopment\", \"isDebug\"],\n console: [\n \"debug\",\n \"warn\",\n \"error\",\n \"table\",\n \"colors\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"hasFlag\",\n \"isMinimal\",\n \"isInteractive\",\n \"isHelp\",\n \"isUnicodeSupported\",\n \"internal_commandContext\"\n ],\n prompts: [\"text\", \"numeric\", \"toggle\", \"select\", \"isCancel\", \"sleep\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <hbr />\n <hbr />\n <CommandHandlerDeclaration\n command={command}\n banner={code`await banner(); `}>\n <IfStatement condition={code`!isInteractive`}>\n <CommandValidationLogic command={command} />\n </IfStatement>\n <ElseIfClause\n condition={code`!isHelp && (${Object.values(command.options ?? {})\n .filter(option => !option.optional)\n .map(option =>\n (option.kind === ReflectionKind.string ||\n option.kind === ReflectionKind.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.arguments ?? {}).filter(\n argument => !argument.optional\n ).length > 0\n ? \" || \"\n : \"\"\n }${Object.values(command.arguments ?? {})\n .filter(argument => !argument.optional)\n .map(argument =>\n (argument.kind === ReflectionKind.string ||\n argument.kind === ReflectionKind.number) &&\n argument.variadic\n ? `(!${camelCase(\n argument.name\n )} || ${camelCase(argument.name)}.length === 0)`\n : `${camelCase(argument.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 <Switch>\n <Match\n when={option.kind === ReflectionKind.string}>{code`\n const value = await text({\n message: \"Please provide a value for the \\\\\"${option.name}\\\\\" option\",\n ${\n option.description\n ? `description: \"${option.description}\",\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={option.kind === ReflectionKind.number}>{code`\n const value = await numeric({\n message: \"Please provide a numeric value for the \\\\\"${option.name}\\\\\" option\",\n ${\n option.description\n ? `description: \"${option.description}\",\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={option.kind === ReflectionKind.boolean}>{code`\n const value = await toggle({\n message: \"Please select a value for the \\\\\"${\n option.name\n }\\\\\" option\",\n ${\n option.description\n ? `description: \"${option.description}\",\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 </IfStatement>\n <Show\n when={\n (option.kind === ReflectionKind.string ||\n option.kind === ReflectionKind.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 === ReflectionKind.number\n ? \" numeric\"\n : \"\"\n } values for the \\\\\"${option.name}\\\\\" option (values are separated by a \\\\\",\\\\\" character)\",\n ${\n option.description\n ? `description: \"${option.description}\",\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 === ReflectionKind.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 === ReflectionKind.number\n ? `.map(Number)`\n : \"\"\n } ;\n `}\n </ElseIfClause>\n </Show>\n </Show>\n </>\n )}\n </For>\n <Spacing />\n <For each={command.arguments} doubleHardline>\n {argument => (\n <>\n <Show when={!argument.optional}>\n <IfStatement condition={code`!${camelCase(argument.name)}`}>\n <Switch>\n <Match\n when={argument.kind === ReflectionKind.string}>{code`\n const value = await text({\n message: \"Please provide a value for the \\\\\"${argument.name}\\\\\" argument\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\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(argument.name)} = value;\n `}</Match>\n <Match\n when={argument.kind === ReflectionKind.number}>{code`\n const value = await numeric({\n message: \"Please provide a numeric value for the \\\\\"${argument.name}\\\\\" argument\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(argument.name)} = value;\n `}</Match>\n <Match\n when={argument.kind === ReflectionKind.boolean}>{code`\n const value = await toggle({\n message: \"Please select a value for the \\\\\"${argument.name}\\\\\" argument\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(argument.name)} = value;\n `}</Match>\n </Switch>\n </IfStatement>\n <Show\n when={\n (argument.kind === ReflectionKind.string ||\n argument.kind === ReflectionKind.number) &&\n argument.variadic\n }>\n <ElseIfClause\n condition={code`${camelCase(argument.name)}.length === 0`}>\n {code`\n const value = await text({\n message: \"Please provide one or more${\n argument.kind === ReflectionKind.number\n ? \" numeric\"\n : \"\"\n } (values are separated by a \\\\\",\\\\\" character)\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\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 argument.kind === ReflectionKind.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(argument.name)} = value.split(\",\").map(value => value.trim()).filter(Boolean)${\n argument.kind === ReflectionKind.number\n ? `.map(Number)`\n : \"\"\n } ;\n `}\n </ElseIfClause>\n </Show>\n </Show>\n </>\n )}\n </For>\n {code`writeLine(\"\"); `}\n <Spacing />\n </ElseIfClause>\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":";;;;;;;;;;;;;;;;;;;;;;AAmDA,SAAgBwB,aAAaC,OAA0B;CACrD,MAAM,EAAEC,SAASC,SAASC,gBAAgB,GAAGC,SAASJ;CAEtD,MAAMK,UAAUpB,eAAiC;CACjD,MAAMqB,WAAW9B,eACfgB,UACES,QAAQM,SACLC,QAAOC,YAAW,CAACtB,qBAAqBsB,QAAQ,CAAC,CACjDC,KAAK,IAAI,EACZ,WAEJ,CAAC;CACD,MAAMC,oBAAoBnC,eACxBiB,iBACEF,aACEC,UAAUa,QAAQO,WAAWtB,aAAagB,SAASO,MAAM,CAAC,EAC1DZ,QAAQa,MAAMC,OAAOC,QAAQf,QAAQa,MAAME,KAE/C,CACF,CAAC;CACD,MAAMC,iBAAiBzC,gBAAgB;EACrC,GAAGyB,QAAQa;EACXI,QAAQ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;;kCASJJ,SAASP,SAASvD,eAAeyD,SAC7B;;;0CAIA,GAAE;;;;;;;;;8BAUV9C,UAAUmD,SAAStB,KAAK,CAAA,gEACxBsB,SAASP,SAASvD,eAAeyD,SAC7B,iBACA,GAAE;;;eAET,CAAA;;aAAA,CAAA,CAAA;;WAAA,CAAA,CAAA;UAKZ,CAAA;SAEFjE,IAAI;SAAiB6C,gBACrBpC,SAAO,EAAA,CAAA;SAAA;;OAAA,CAAA,CAAA;;KAAA,CAAA;IAAA;;EAAA,CAAA,CAAA,EAAAoC,gBAIb3C,KAAG;EAAA,IAACqE,OAAI;AAAA,UAAEd,OAAOC,OAAOhC,QAAQ2B,SAAS;;EAAAA,WACvCuB,UAAK/B,gBACHzC,MAAI;GAAA,IACHqE,OAAI;AAAA,WAAEG,MAAMC;;GAAS,IACrBC,WAAQ;AAAA,WAAAjC,gBAAGrB,cAAY,EAACE,SAASkD,OAAK,CAAA;;GAAA,IAAAvB,WAAA;AAAA,WAAAR,gBACrCtB,qBAAmB,EAACG,SAASkD,OAAK,CAAA;;GAAA,CAAA;EAEtC,CAAA,CAAA"}
@@ -9,6 +9,7 @@ exports.BasePromptDeclarations = require_components_prompts_builtin.BasePromptDe
9
9
  exports.CommandEntry = require_components_command_entry.CommandEntry;
10
10
  exports.CommandRouter = require_components_command_router.CommandRouter;
11
11
  exports.CommandRouterSelectOptions = require_components_command_router.CommandRouterSelectOptions;
12
+ exports.ConfirmPromptDeclarations = require_components_prompts_builtin.ConfirmPromptDeclarations;
12
13
  exports.NumericPromptDeclarations = require_components_prompts_builtin.NumericPromptDeclarations;
13
14
  exports.PasswordPromptDeclaration = require_components_prompts_builtin.PasswordPromptDeclaration;
14
15
  exports.PromptsBuiltin = require_components_prompts_builtin.PromptsBuiltin;