@shell-shock/preset-cli 0.7.11 → 0.7.13

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 (34) hide show
  1. package/dist/components/banner-function-declaration.cjs +15 -15
  2. package/dist/components/banner-function-declaration.d.cts +2 -2
  3. package/dist/components/banner-function-declaration.mjs +1 -1
  4. package/dist/components/banner-function-declaration.mjs.map +1 -1
  5. package/dist/components/command-entry.cjs +35 -35
  6. package/dist/components/command-entry.d.cts +3 -3
  7. package/dist/components/command-entry.d.mts +1 -1
  8. package/dist/components/command-entry.mjs +34 -34
  9. package/dist/components/command-entry.mjs.map +1 -1
  10. package/dist/components/command-router.cjs +3 -3
  11. package/dist/components/command-router.d.cts +2 -2
  12. package/dist/components/command-router.d.mts +2 -2
  13. package/dist/components/command-router.mjs +1 -1
  14. package/dist/components/command-router.mjs.map +1 -1
  15. package/dist/components/virtual-command-entry.cjs +5 -11
  16. package/dist/components/virtual-command-entry.d.cts +3 -3
  17. package/dist/components/virtual-command-entry.d.mts +1 -1
  18. package/dist/components/virtual-command-entry.mjs +4 -10
  19. package/dist/components/virtual-command-entry.mjs.map +1 -1
  20. package/dist/helpers/get-default-options.cjs +3 -3
  21. package/dist/helpers/get-default-options.mjs +3 -3
  22. package/dist/helpers/get-default-options.mjs.map +1 -1
  23. package/dist/index.cjs +0 -3
  24. package/dist/index.d.cts +1 -1
  25. package/dist/index.d.cts.map +1 -1
  26. package/dist/index.d.mts +1 -1
  27. package/dist/index.d.mts.map +1 -1
  28. package/dist/index.mjs +0 -3
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/types/plugin.d.cts +1 -2
  31. package/dist/types/plugin.d.cts.map +1 -1
  32. package/dist/types/plugin.d.mts +1 -2
  33. package/dist/types/plugin.d.mts.map +1 -1
  34. package/package.json +36 -36
@@ -5,9 +5,9 @@ import { For, Match, Show, Switch, code, computed } from "@alloy-js/core";
5
5
  import { ElseIfClause, IfStatement } from "@alloy-js/typescript";
6
6
  import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
7
7
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
8
- import { isDynamicPathSegment } from "@shell-shock/core/plugin-utils/context-helpers";
9
- import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
8
+ import { isDynamicPathSegment } from "@shell-shock/core/plugin-utils";
10
9
  import { EntryFile } from "@powerlines/plugin-alloy/typescript/components/entry-file";
10
+ import { CommandParameterKinds } from "@shell-shock/core";
11
11
  import { CommandHandlerDeclaration, CommandValidationLogic } from "@shell-shock/preset-script/components/command-entry";
12
12
  import { findFilePath, relativePath } from "@stryke/path/find";
13
13
  import { joinPaths } from "@stryke/path/join";
@@ -24,7 +24,7 @@ function CommandEntry(props) {
24
24
  const { command, imports, builtinImports, ...rest } = props;
25
25
  const context = usePowerlines();
26
26
  const filePath = computed(() => joinPaths(command.segments.filter((segment) => !isDynamicPathSegment(segment)).join("/"), "index.ts"));
27
- const commandSourcePath = computed(() => replaceExtension(relativePath(joinPaths(context.entryPath, findFilePath(filePath.value)), command.entry.input?.file || command.entry.file)));
27
+ const commandSourcePath = computed(() => `./${replaceExtension(relativePath(joinPaths(context.entryPath, findFilePath(filePath.value)), command.entry.input?.file || command.entry.file))}`);
28
28
  const typeDefinition = computed(() => ({
29
29
  ...command.entry,
30
30
  output: command.id
@@ -107,12 +107,12 @@ function CommandEntry(props) {
107
107
  }
108
108
  }), createComponent(Show, {
109
109
  get when() {
110
- return Object.values(command.options ?? {}).filter((option) => !option.optional).length > 0 || Object.values(command.arguments ?? {}).filter((argument) => !argument.optional).length > 0;
110
+ return Object.values(command.options ?? {}).filter((option) => !option.optional).length > 0 || Object.values(command.args ?? {}).filter((arg) => !arg.optional).length > 0;
111
111
  },
112
112
  get children() {
113
113
  return createComponent(ElseIfClause, {
114
114
  get condition() {
115
- return code`!isHelp && (${Object.values(command.options ?? {}).filter((option) => !option.optional).map((option) => (option.kind === ReflectionKind.string || option.kind === ReflectionKind.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.optional).length > 0 && Object.values(command.arguments ?? {}).filter((argument) => !argument.optional).length > 0 ? " || " : ""}${Object.values(command.arguments ?? {}).filter((argument) => !argument.optional).map((argument) => (argument.kind === ReflectionKind.string || argument.kind === ReflectionKind.number) && argument.variadic ? `(!${camelCase(argument.name)} || ${camelCase(argument.name)}.length === 0)` : `${camelCase(argument.name)} === undefined`).join(" || ")}) `;
115
+ return code`!isHelp && (${Object.values(command.options ?? {}).filter((option) => !option.optional).map((option) => (option.kind === CommandParameterKinds.string || option.kind === CommandParameterKinds.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.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 === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.variadic ? `(!${camelCase(arg.name)} || ${camelCase(arg.name)}.length === 0)` : `${camelCase(arg.name)} === undefined`).join(" || ")}) `;
116
116
  },
117
117
  get children() {
118
118
  return [
@@ -137,7 +137,7 @@ function CommandEntry(props) {
137
137
  return [
138
138
  createComponent(Match, {
139
139
  get when() {
140
- return option.kind === ReflectionKind.string;
140
+ return option.kind === CommandParameterKinds.string;
141
141
  },
142
142
  get children() {
143
143
  return code`
@@ -162,7 +162,7 @@ function CommandEntry(props) {
162
162
  }),
163
163
  createComponent(Match, {
164
164
  get when() {
165
- return option.kind === ReflectionKind.number;
165
+ return option.kind === CommandParameterKinds.number;
166
166
  },
167
167
  get children() {
168
168
  return code`
@@ -181,7 +181,7 @@ function CommandEntry(props) {
181
181
  }),
182
182
  createComponent(Match, {
183
183
  get when() {
184
- return option.kind === ReflectionKind.boolean;
184
+ return option.kind === CommandParameterKinds.boolean;
185
185
  },
186
186
  get children() {
187
187
  return code`
@@ -203,7 +203,7 @@ function CommandEntry(props) {
203
203
  }
204
204
  }), createComponent(Show, {
205
205
  get when() {
206
- return (option.kind === ReflectionKind.string || option.kind === ReflectionKind.number) && option.variadic;
206
+ return (option.kind === CommandParameterKinds.string || option.kind === CommandParameterKinds.number) && option.variadic;
207
207
  },
208
208
  get children() {
209
209
  return createComponent(ElseIfClause, {
@@ -213,7 +213,7 @@ function CommandEntry(props) {
213
213
  get children() {
214
214
  return code`
215
215
  const value = await text({
216
- message: \`Please provide one or more${option.kind === ReflectionKind.number ? " numeric" : ""} values for the \${colors.italic("${option.name}")} option (values are separated by a \\",\\" character)\`,
216
+ message: \`Please provide one or more${option.kind === CommandParameterKinds.number ? " numeric" : ""} values for the \${colors.italic("${option.name}")} option (values are separated by a \\",\\" character)\`,
217
217
  ${option.description ? `description: "${option.description}",
218
218
  ` : ""}validate(val) {
219
219
  if (!val || val.trim() === "") {
@@ -222,7 +222,7 @@ function CommandEntry(props) {
222
222
  if (val.split(",").map(v => v.trim()).filter(Boolean).length === 0) {
223
223
  return "At least one value must be provided for this option";
224
224
  }
225
- ${option.kind === ReflectionKind.number ? `const invalidIndex = val.split(",").map(v => v.trim()).filter(Boolean).findIndex(v => Number.isNaN(Number(v));
225
+ ${option.kind === CommandParameterKinds.number ? `const invalidIndex = val.split(",").map(v => v.trim()).filter(Boolean).findIndex(v => Number.isNaN(Number(v));
226
226
  if (invalidIndex !== -1) {
227
227
  return \`Invalid numeric value provided for item #\${invalidIndex + 1} - all provided items must be a valid number\`;
228
228
  } ` : ""}
@@ -233,7 +233,7 @@ function CommandEntry(props) {
233
233
  return;
234
234
  }
235
235
 
236
- options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = value.split(",").map(value => value.trim()).filter(Boolean)${option.kind === ReflectionKind.number ? `.map(Number)` : ""} ;
236
+ options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = value.split(",").map(value => value.trim()).filter(Boolean)${option.kind === CommandParameterKinds.number ? `.map(Number)` : ""} ;
237
237
  `;
238
238
  }
239
239
  });
@@ -245,30 +245,30 @@ function CommandEntry(props) {
245
245
  createComponent(Spacing, {}),
246
246
  createComponent(For, {
247
247
  get each() {
248
- return command.arguments;
248
+ return command.args;
249
249
  },
250
250
  doubleHardline: true,
251
- children: (argument) => [createComponent(Show, {
251
+ children: (arg) => [createComponent(Show, {
252
252
  get when() {
253
- return !argument.optional;
253
+ return !arg.optional;
254
254
  },
255
255
  get children() {
256
256
  return [createComponent(IfStatement, {
257
257
  get condition() {
258
- return code`!${camelCase(argument.name)}`;
258
+ return code`!${camelCase(arg.name)}`;
259
259
  },
260
260
  get children() {
261
261
  return createComponent(Switch, { get children() {
262
262
  return [
263
263
  createComponent(Match, {
264
264
  get when() {
265
- return argument.kind === ReflectionKind.string;
265
+ return arg.kind === CommandParameterKinds.string;
266
266
  },
267
267
  get children() {
268
268
  return code`
269
269
  const value = await text({
270
- message: \`Please provide a value for the \${colors.italic("${argument.name}")} argument\`,
271
- ${argument.description ? `description: "${argument.description}",
270
+ message: \`Please provide a value for the \${colors.italic("${arg.name}")} argument\`,
271
+ ${arg.description ? `description: "${arg.description}",
272
272
  ` : ""}validate(val) {
273
273
  if (!val || val.trim() === "") {
274
274
  return "A value must be provided for this argument";
@@ -281,45 +281,45 @@ function CommandEntry(props) {
281
281
  return;
282
282
  }
283
283
 
284
- ${camelCase(argument.name)} = value;
284
+ ${camelCase(arg.name)} = value;
285
285
  `;
286
286
  }
287
287
  }),
288
288
  createComponent(Match, {
289
289
  get when() {
290
- return argument.kind === ReflectionKind.number;
290
+ return arg.kind === CommandParameterKinds.number;
291
291
  },
292
292
  get children() {
293
293
  return code`
294
294
  const value = await numeric({
295
- message: \`Please provide a numeric value for the \${colors.italic("${argument.name}")} argument\`,
296
- ${argument.description ? `description: "${argument.description}",
295
+ message: \`Please provide a numeric value for the \${colors.italic("${arg.name}")} argument\`,
296
+ ${arg.description ? `description: "${arg.description}",
297
297
  ` : ""}
298
298
  });
299
299
  if (isCancel(value)) {
300
300
  return;
301
301
  }
302
302
 
303
- ${camelCase(argument.name)} = value;
303
+ ${camelCase(arg.name)} = value;
304
304
  `;
305
305
  }
306
306
  }),
307
307
  createComponent(Match, {
308
308
  get when() {
309
- return argument.kind === ReflectionKind.boolean;
309
+ return arg.kind === CommandParameterKinds.boolean;
310
310
  },
311
311
  get children() {
312
312
  return code`
313
313
  const value = await toggle({
314
- message: \`Please select a value for the \${colors.italic("${argument.name}")} argument\`,
315
- ${argument.description ? `description: "${argument.description}",
314
+ message: \`Please select a value for the \${colors.italic("${arg.name}")} argument\`,
315
+ ${arg.description ? `description: "${arg.description}",
316
316
  ` : ""}
317
317
  });
318
318
  if (isCancel(value)) {
319
319
  return;
320
320
  }
321
321
 
322
- ${camelCase(argument.name)} = value;
322
+ ${camelCase(arg.name)} = value;
323
323
  `;
324
324
  }
325
325
  })
@@ -328,18 +328,18 @@ function CommandEntry(props) {
328
328
  }
329
329
  }), createComponent(Show, {
330
330
  get when() {
331
- return (argument.kind === ReflectionKind.string || argument.kind === ReflectionKind.number) && argument.variadic;
331
+ return (arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.variadic;
332
332
  },
333
333
  get children() {
334
334
  return createComponent(ElseIfClause, {
335
335
  get condition() {
336
- return code`${camelCase(argument.name)}.length === 0`;
336
+ return code`${camelCase(arg.name)}.length === 0`;
337
337
  },
338
338
  get children() {
339
339
  return code`
340
340
  const value = await text({
341
- message: \`Please provide one or more${argument.kind === ReflectionKind.number ? " numeric" : ""} values for the \${colors.italic("${argument.name}")} argument (values are separated by a \\",\\" character)\`,
342
- ${argument.description ? `description: "${argument.description}",
341
+ message: \`Please provide one or more${arg.kind === CommandParameterKinds.number ? " numeric" : ""} values for the \${colors.italic("${arg.name}")} argument (values are separated by a \\",\\" character)\`,
342
+ ${arg.description ? `description: "${arg.description}",
343
343
  ` : ""}validate(val) {
344
344
  if (!val || val.trim() === "") {
345
345
  return "A value must be provided for this argument";
@@ -347,7 +347,7 @@ function CommandEntry(props) {
347
347
  if (val.split(",").map(v => v.trim()).filter(Boolean).length === 0) {
348
348
  return "At least one value must be provided for this argument";
349
349
  }
350
- ${argument.kind === ReflectionKind.number ? `const invalidIndex = val.split(",").map(v => v.trim()).filter(Boolean).findIndex(v => Number.isNaN(Number(v));
350
+ ${arg.kind === CommandParameterKinds.number ? `const invalidIndex = val.split(",").map(v => v.trim()).filter(Boolean).findIndex(v => Number.isNaN(Number(v));
351
351
  if (invalidIndex !== -1) {
352
352
  return \`Invalid numeric value provided for item #\${invalidIndex + 1} - all provided items must be a valid number\`;
353
353
  } ` : ""}
@@ -359,7 +359,7 @@ function CommandEntry(props) {
359
359
  return;
360
360
  }
361
361
 
362
- ${camelCase(argument.name)} = value.split(",").map(value => value.trim()).filter(Boolean)${argument.kind === ReflectionKind.number ? `.map(Number)` : ""} ;
362
+ ${camelCase(arg.name)} = value.split(",").map(value => value.trim()).filter(Boolean)${arg.kind === CommandParameterKinds.number ? `.map(Number)` : ""} ;
363
363
  `;
364
364
  }
365
365
  });
@@ -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","upgrade","children","_$createIntrinsic","banner","condition","when","Object","values","options","option","optional","length","arguments","argument","map","kind","string","number","variadic","includes","each","doubleHardline","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\", \"paths\"],\n console: [\n \"debug\",\n \"info\",\n \"help\",\n \"warn\",\n \"error\",\n \"table\",\n \"colors\",\n \"cursor\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\",\n \"createSpinner\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"hasFlag\",\n \"isMinimal\",\n \"isInteractive\",\n \"isHelp\",\n \"isUnicodeSupported\",\n \"internal_commandContext\"\n ],\n prompts: [\n \"text\",\n \"numeric\",\n \"toggle\",\n \"select\",\n \"confirm\",\n \"waitForKeyPress\",\n \"isCancel\",\n \"sleep\"\n ],\n upgrade: [\"checkForUpdates\", \"isCheckForUpdatesRequired\", \"upgrade\"]\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 <Show\n when={\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 <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 \\${colors.italic(\"${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 \\${colors.italic(\"${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 \\${colors.italic(\"${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 </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 \\${colors.italic(\"${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\n condition={code`!${camelCase(argument.name)}`}>\n <Switch>\n <Match\n when={\n argument.kind === ReflectionKind.string\n }>{code`\n const value = await text({\n message: \\`Please provide a value for the \\${colors.italic(\"${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={\n argument.kind === ReflectionKind.number\n }>{code`\n const value = await numeric({\n message: \\`Please provide a numeric value for the \\${colors.italic(\"${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={\n argument.kind === ReflectionKind.boolean\n }>{code`\n const value = await toggle({\n message: \\`Please select a value for the \\${colors.italic(\"${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 for the \\${colors.italic(\"${argument.name}\")} argument (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 </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":";;;;;;;;;;;;;;;;;;;;;;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,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EAEtC,CAAA,CAAA"}
1
+ {"version":3,"file":"command-entry.mjs","names":["code","computed","For","Match","Show","Switch","ElseIfClause","IfStatement","Spacing","usePowerlines","EntryFile","CommandParameterKinds","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","upgrade","children","_$createIntrinsic","banner","condition","when","Object","values","options","option","optional","length","args","arg","map","kind","string","number","variadic","includes","each","doubleHardline","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 { 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 { CommandTree } from \"@shell-shock/core\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\nimport { isDynamicPathSegment } from \"@shell-shock/core/plugin-utils\";\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 () =>\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\", \"paths\"],\n console: [\n \"debug\",\n \"info\",\n \"help\",\n \"warn\",\n \"error\",\n \"table\",\n \"colors\",\n \"cursor\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\",\n \"createSpinner\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"hasFlag\",\n \"isMinimal\",\n \"isInteractive\",\n \"isHelp\",\n \"isUnicodeSupported\",\n \"internal_commandContext\"\n ],\n prompts: [\n \"text\",\n \"numeric\",\n \"toggle\",\n \"select\",\n \"confirm\",\n \"waitForKeyPress\",\n \"isCancel\",\n \"sleep\"\n ],\n upgrade: [\"checkForUpdates\", \"isCheckForUpdatesRequired\", \"upgrade\"]\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 <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(command.options ?? {})\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 <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 \\${colors.italic(\"${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={\n option.kind === CommandParameterKinds.number\n }>{code`\n const value = await numeric({\n message: \\`Please provide a numeric value for the \\${colors.italic(\"${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={\n option.kind === CommandParameterKinds.boolean\n }>{code`\n const value = await toggle({\n message: \\`Please select a value for the \\${colors.italic(\"${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 </Switch>\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 \\${colors.italic(\"${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 === 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 <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 \\${colors.italic(\"${arg.name}\")} argument\\`,\n ${\n arg.description\n ? `description: \"${arg.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(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 \\${colors.italic(\"${arg.name}\")} argument\\`,\n ${\n arg.description\n ? `description: \"${arg.description}\",\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 \\${colors.italic(\"${arg.name}\")} argument\\`,\n ${\n arg.description\n ? `description: \"${arg.description}\",\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(arg.name)} = value;\n `}</Match>\n </Switch>\n </IfStatement>\n <Show\n when={\n (arg.kind === CommandParameterKinds.string ||\n arg.kind === CommandParameterKinds.number) &&\n arg.variadic\n }>\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 \\${colors.italic(\"${arg.name}\")} argument (values are separated by a \\\\\",\\\\\" character)\\`,\n ${\n arg.description\n ? `description: \"${arg.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 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 : \"\"\n } ;\n `}\n </ElseIfClause>\n </Show>\n </Show>\n </>\n )}\n </For>\n {code`writeLine(\"\"); `}\n <Spacing />\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":";;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AAA,CAAA;;OAAA,CAAA,CAAA;;KAAA,CAAA;IAAA;;EAAA,CAAA,CAAA,EAAAqC,gBAKf3C,KAAG;EAAA,IAACuE,OAAI;AAAA,UAAEd,OAAOC,OAAOlC,QAAQ4B,SAAS;;EAAAA,WACvCuB,UAAKhC,gBACHzC,MAAI;GAAA,IACHsD,OAAI;AAAA,WAAEmB,MAAMC;;GAAS,IACrBC,WAAQ;AAAA,WAAAlC,gBAAGrB,cAAY,EAACE,SAASmD,OAAK,CAAA;;GAAA,IAAAvB,WAAA;AAAA,WAAAT,gBACrCtB,qBAAmB,EAACG,SAASmD,OAAK,CAAA;;GAAA,CAAA;EAEtC,CAAA,CAAA"}
@@ -3,7 +3,7 @@ let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
3
  let __alloy_js_core = require("@alloy-js/core");
4
4
  let __alloy_js_typescript = require("@alloy-js/typescript");
5
5
  let __powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
6
- let __shell_shock_preset_script_components_command_router = require("@shell-shock/preset-script/components/command-router");
6
+ let __shell_shock_preset_script_components = require("@shell-shock/preset-script/components");
7
7
 
8
8
  //#region src/components/command-router.tsx
9
9
  function CommandRouterSelectOptions(props) {
@@ -25,7 +25,7 @@ function CommandRouterSelectOptions(props) {
25
25
  function CommandRouter(props) {
26
26
  const { segments, commands } = props;
27
27
  return [
28
- (0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_command_router.CommandRouter, (0, __alloy_js_core_jsx_runtime.mergeProps)(props, {
28
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components.CommandRouter, (0, __alloy_js_core_jsx_runtime.mergeProps)(props, {
29
29
  segments,
30
30
  commands
31
31
  })),
@@ -63,7 +63,7 @@ function CommandRouter(props) {
63
63
 
64
64
  command = segments[0];
65
65
  args = context.get("args"); `),
66
- (0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_command_router.CommandRouterBody, (0, __alloy_js_core_jsx_runtime.mergeProps)(props, {
66
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components.CommandRouterBody, (0, __alloy_js_core_jsx_runtime.mergeProps)(props, {
67
67
  segments,
68
68
  commands
69
69
  }))
@@ -1,6 +1,6 @@
1
1
  import * as _alloy_js_core0 from "@alloy-js/core";
2
- import { CommandTree } from "@shell-shock/core/types/command";
3
- import { CommandRouterProps } from "@shell-shock/preset-script/components/command-router";
2
+ import { CommandTree } from "@shell-shock/core";
3
+ import { CommandRouterProps } from "@shell-shock/preset-script/components";
4
4
 
5
5
  //#region src/components/command-router.d.ts
6
6
  interface CommandRouterSelectOptionsProps {
@@ -1,6 +1,6 @@
1
1
  import * as _alloy_js_core0 from "@alloy-js/core";
2
- import { CommandRouterProps } from "@shell-shock/preset-script/components/command-router";
3
- import { CommandTree } from "@shell-shock/core/types/command";
2
+ import { CommandTree } from "@shell-shock/core";
3
+ import { CommandRouterProps } from "@shell-shock/preset-script/components";
4
4
 
5
5
  //#region src/components/command-router.d.ts
6
6
  interface CommandRouterSelectOptionsProps {
@@ -2,7 +2,7 @@ import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
2
2
  import { For, code } from "@alloy-js/core";
3
3
  import { IfStatement } from "@alloy-js/typescript";
4
4
  import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
5
- import { CommandRouter as CommandRouter$1, CommandRouterBody } from "@shell-shock/preset-script/components/command-router";
5
+ import { CommandRouter as CommandRouter$1, CommandRouterBody } from "@shell-shock/preset-script/components";
6
6
 
7
7
  //#region src/components/command-router.tsx
8
8
  function CommandRouterSelectOptions(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"command-router.mjs","names":["code","For","IfStatement","Spacing","CommandRouter","BaseCommandRouter","CommandRouterBody","CommandRouterSelectOptions","props","commands","_$createComponent","each","Object","values","joiner","hardline","children","command","isVirtual","segments","map","segment","join","title","description","icon","_$mergeProps","condition","_$memo","length"],"sources":["../../src/components/command-router.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, For } from \"@alloy-js/core\";\nimport { IfStatement } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport type { CommandRouterProps } from \"@shell-shock/preset-script/components/command-router\";\nimport {\n CommandRouter as BaseCommandRouter,\n CommandRouterBody\n} from \"@shell-shock/preset-script/components/command-router\";\n\nexport interface CommandRouterSelectOptionsProps {\n commands?: Record<string, CommandTree>;\n}\n\nexport function CommandRouterSelectOptions(\n props: CommandRouterSelectOptionsProps\n) {\n const { commands } = props;\n\n return (\n <For each={Object.values(commands ?? {})} joiner=\",\" hardline>\n {command =>\n command.isVirtual ? (\n <CommandRouterSelectOptions commands={command.children ?? {}} />\n ) : (\n code`{ value: [${command.segments\n .map(segment => `\"${segment}\"`)\n .join(\", \")}], label: \"${command.title}\", description: \"${\n command.description\n }\"${command.icon ? `, icon: \"${command.icon}\"` : \"\"} }`\n )\n }\n </For>\n );\n}\n\n/**\n * A component that renders a command router interface, allowing users to select and execute commands from a provided list of commands and segments. This component serves as a wrapper around the base CommandRouter, adding additional UI elements and logic for command selection.\n */\nexport function CommandRouter(props: CommandRouterProps) {\n const { segments, commands } = props;\n\n return (\n <>\n <BaseCommandRouter {...props} segments={segments} commands={commands} />\n <Spacing />\n <IfStatement condition={code`isInteractive && !isHelp`}>\n {code`await banner();\n\n let segments = await select({\n message: \"Which command would you like to execute?\",\n options: [ `}\n <CommandRouterSelectOptions commands={commands} />\n {` ],\n });\n if (isCancel(segments)) {\n return;\n }\n\n let dynamics = {} as Record<string, string>;\n for (const dynamic of segments.filter(segment => segment.startsWith(\"[\") && segment.endsWith(\"]\"))) {\n const value = await text({\n message: \\`Please provide a value for \\${dynamic.replace(/^\\[+/, \"\").replace(/\\]+$/, \"\")}:\\`,\n });\n if (isCancel(value)) {\n return;\n }\n dynamics[dynamic] = value;\n }\n\n segments = segments.map(segment => dynamics[segment] || segment);\n const context = useApp();\n context.set(\"args\", [args.length > 0 ? args[0] : undefined, args.length > 1 ? args[1] : undefined, ...segments, ...args.slice(${\n segments.length + 2\n })].filter(Boolean) as string[]);\n\n command = segments[0];\n args = context.get(\"args\"); `}\n <CommandRouterBody {...props} segments={segments} commands={commands} />\n </IfStatement>\n <Spacing />\n </>\n );\n}\n"],"mappings":";;;;;;;AAgCA,SAAgBO,2BACdC,OACA;CACA,MAAM,EAAEC,aAAaD;AAErB,QAAAE,gBACGT,KAAG;EAAA,IAACU,OAAI;AAAA,UAAEC,OAAOC,OAAOJ,YAAY,EAAE,CAAC;;EAAEK,QAAM;EAAKC,UAAQ;EAAAC,WAC1DC,YACCA,QAAQC,YAASR,gBACdH,4BAA0B,EAAA,IAACE,WAAQ;AAAA,UAAEQ,QAAQD,YAAY,EAAE;KAAA,CAAA,GAE5DhB,IAAI,aAAaiB,QAAQE,SACtBC,KAAIC,YAAW,IAAIA,QAAO,GAAI,CAC9BC,KAAK,KAAK,CAAA,aAAcL,QAAQM,MAAK,mBACtCN,QAAQO,YAAW,GACjBP,QAAQQ,OAAO,YAAYR,QAAQQ,KAAI,KAAM,GAAE;EACpD,CAAA;;;;;AAST,SAAgBrB,cAAcI,OAA2B;CACvD,MAAM,EAAEW,UAAUV,aAAaD;AAE/B,QAAA;EAAAE,gBAEKL,iBAAiBqB,WAAKlB,OAAK;GAAYW;GAAoBV;GAAQ,CAAA,CAAA;EAAAC,gBACnEP,SAAO,EAAA,CAAA;EAAAO,gBACPR,aAAW;GAACyB,WAAW3B,IAAI;GAA0B,IAAAgB,WAAA;AAAA,WAAA;KACnDhB,IAAI;;;;;KAISU,gBACbH,4BAA0B,EAAWE,UAAQ,CAAA;KAAAmB,WAC7C;;;;;;;;;;;;;;;;;;;wIAoBCT,SAASU,SAAS,EAAC;;;sCAIQ;KAAAnB,gBAC5BJ,mBAAiBoB,WAAKlB,OAAK;MAAYW;MAAoBV;MAAQ,CAAA,CAAA;KAAA;;GAAA,CAAA;EAAAC,gBAErEP,SAAO,EAAA,CAAA;EAAA"}
1
+ {"version":3,"file":"command-router.mjs","names":["code","For","IfStatement","Spacing","CommandRouter","BaseCommandRouter","CommandRouterBody","CommandRouterSelectOptions","props","commands","_$createComponent","each","Object","values","joiner","hardline","children","command","isVirtual","segments","map","segment","join","title","description","icon","_$mergeProps","condition","_$memo","length"],"sources":["../../src/components/command-router.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, For } from \"@alloy-js/core\";\nimport { IfStatement } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport type { CommandTree } from \"@shell-shock/core\";\nimport type { CommandRouterProps } from \"@shell-shock/preset-script/components\";\nimport {\n CommandRouter as BaseCommandRouter,\n CommandRouterBody\n} from \"@shell-shock/preset-script/components\";\n\nexport interface CommandRouterSelectOptionsProps {\n commands?: Record<string, CommandTree>;\n}\n\nexport function CommandRouterSelectOptions(\n props: CommandRouterSelectOptionsProps\n) {\n const { commands } = props;\n\n return (\n <For each={Object.values(commands ?? {})} joiner=\",\" hardline>\n {command =>\n command.isVirtual ? (\n <CommandRouterSelectOptions commands={command.children ?? {}} />\n ) : (\n code`{ value: [${command.segments\n .map(segment => `\"${segment}\"`)\n .join(\", \")}], label: \"${command.title}\", description: \"${\n command.description\n }\"${command.icon ? `, icon: \"${command.icon}\"` : \"\"} }`\n )\n }\n </For>\n );\n}\n\n/**\n * A component that renders a command router interface, allowing users to select and execute commands from a provided list of commands and segments. This component serves as a wrapper around the base CommandRouter, adding additional UI elements and logic for command selection.\n */\nexport function CommandRouter(props: CommandRouterProps) {\n const { segments, commands } = props;\n\n return (\n <>\n <BaseCommandRouter {...props} segments={segments} commands={commands} />\n <Spacing />\n <IfStatement condition={code`isInteractive && !isHelp`}>\n {code`await banner();\n\n let segments = await select({\n message: \"Which command would you like to execute?\",\n options: [ `}\n <CommandRouterSelectOptions commands={commands} />\n {` ],\n });\n if (isCancel(segments)) {\n return;\n }\n\n let dynamics = {} as Record<string, string>;\n for (const dynamic of segments.filter(segment => segment.startsWith(\"[\") && segment.endsWith(\"]\"))) {\n const value = await text({\n message: \\`Please provide a value for \\${dynamic.replace(/^\\[+/, \"\").replace(/\\]+$/, \"\")}:\\`,\n });\n if (isCancel(value)) {\n return;\n }\n dynamics[dynamic] = value;\n }\n\n segments = segments.map(segment => dynamics[segment] || segment);\n const context = useApp();\n context.set(\"args\", [args.length > 0 ? args[0] : undefined, args.length > 1 ? args[1] : undefined, ...segments, ...args.slice(${\n segments.length + 2\n })].filter(Boolean) as string[]);\n\n command = segments[0];\n args = context.get(\"args\"); `}\n <CommandRouterBody {...props} segments={segments} commands={commands} />\n </IfStatement>\n <Spacing />\n </>\n );\n}\n"],"mappings":";;;;;;;AAgCA,SAAgBO,2BACdC,OACA;CACA,MAAM,EAAEC,aAAaD;AAErB,QAAAE,gBACGT,KAAG;EAAA,IAACU,OAAI;AAAA,UAAEC,OAAOC,OAAOJ,YAAY,EAAE,CAAC;;EAAEK,QAAM;EAAKC,UAAQ;EAAAC,WAC1DC,YACCA,QAAQC,YAASR,gBACdH,4BAA0B,EAAA,IAACE,WAAQ;AAAA,UAAEQ,QAAQD,YAAY,EAAE;KAAA,CAAA,GAE5DhB,IAAI,aAAaiB,QAAQE,SACtBC,KAAIC,YAAW,IAAIA,QAAO,GAAI,CAC9BC,KAAK,KAAK,CAAA,aAAcL,QAAQM,MAAK,mBACtCN,QAAQO,YAAW,GACjBP,QAAQQ,OAAO,YAAYR,QAAQQ,KAAI,KAAM,GAAE;EACpD,CAAA;;;;;AAST,SAAgBrB,cAAcI,OAA2B;CACvD,MAAM,EAAEW,UAAUV,aAAaD;AAE/B,QAAA;EAAAE,gBAEKL,iBAAiBqB,WAAKlB,OAAK;GAAYW;GAAoBV;GAAQ,CAAA,CAAA;EAAAC,gBACnEP,SAAO,EAAA,CAAA;EAAAO,gBACPR,aAAW;GAACyB,WAAW3B,IAAI;GAA0B,IAAAgB,WAAA;AAAA,WAAA;KACnDhB,IAAI;;;;;KAISU,gBACbH,4BAA0B,EAAWE,UAAQ,CAAA;KAAAmB,WAC7C;;;;;;;;;;;;;;;;;;;wIAoBCT,SAASU,SAAS,EAAC;;;sCAIQ;KAAAnB,gBAC5BJ,mBAAiBoB,WAAKlB,OAAK;MAAYW;MAAoBV;MAAQ,CAAA,CAAA;KAAA;;GAAA,CAAA;EAAAC,gBAErEP,SAAO,EAAA,CAAA;EAAA"}
@@ -5,7 +5,7 @@ const require_components_command_entry = require('./command-entry.cjs');
5
5
  let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
6
6
  let __alloy_js_core = require("@alloy-js/core");
7
7
  let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
8
- let __shell_shock_core_plugin_utils_context_helpers = require("@shell-shock/core/plugin-utils/context-helpers");
8
+ let __shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
9
9
  let __stryke_path_join = require("@stryke/path/join");
10
10
  let __stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
11
11
  let defu = require("defu");
@@ -20,20 +20,13 @@ let __shell_shock_preset_script_components_virtual_command_entry = require("@she
20
20
  function VirtualCommandEntry(props) {
21
21
  const { command, imports, builtinImports, ...rest } = props;
22
22
  const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
23
- const filePath = (0, __alloy_js_core.computed)(() => (0, __stryke_path_join.joinPaths)(context.entryPath, command.segments.filter((segment) => !(0, __shell_shock_core_plugin_utils_context_helpers.isDynamicPathSegment)(segment)).join("/"), "index.ts"));
23
+ const filePath = (0, __alloy_js_core.computed)(() => (0, __stryke_path_join.joinPaths)(context.entryPath, command.segments.filter((segment) => !(0, __shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)).join("/"), "index.ts"));
24
24
  return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_typescript_file.TypescriptFile, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, {
25
25
  get path() {
26
26
  return filePath.value;
27
27
  },
28
28
  get imports() {
29
- return (0, defu.default)({ didyoumean2: [
30
- {
31
- name: "didYouMean",
32
- default: true
33
- },
34
- { name: "ReturnTypeEnums" },
35
- { name: "ThresholdTypeEnums" }
36
- ] }, imports ?? {}, Object.entries(command.children).filter(([, child]) => child.isVirtual).reduce((ret, [name, child]) => {
29
+ return (0, defu.default)(imports ?? {}, Object.entries(command.children).filter(([, child]) => child.isVirtual).reduce((ret, [name, child]) => {
37
30
  ret[`./${child.name}`] = [{
38
31
  name: "handler",
39
32
  alias: `handle${(0, __stryke_string_format_pascal_case.pascalCase)(name)}`
@@ -62,7 +55,8 @@ function VirtualCommandEntry(props) {
62
55
  "isMinimal",
63
56
  "isUnicodeSupported",
64
57
  "isInteractive",
65
- "isHelp"
58
+ "isHelp",
59
+ "findSuggestions"
66
60
  ],
67
61
  prompts: [
68
62
  "text",
@@ -1,6 +1,6 @@
1
- import * as _alloy_js_core2 from "@alloy-js/core";
1
+ import * as _alloy_js_core0 from "@alloy-js/core";
2
2
  import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
3
- import { CommandTree } from "@shell-shock/core/types/command";
3
+ import { CommandTree } from "@shell-shock/core";
4
4
 
5
5
  //#region src/components/virtual-command-entry.d.ts
6
6
  interface VirtualCommandEntryProps extends Omit<EntryFileProps, "path" | "typeDefinition"> {
@@ -9,7 +9,7 @@ interface VirtualCommandEntryProps extends Omit<EntryFileProps, "path" | "typeDe
9
9
  /**
10
10
  * The virtual command entry point for the Shell Shock project.
11
11
  */
12
- declare function VirtualCommandEntry(props: VirtualCommandEntryProps): _alloy_js_core2.Children;
12
+ declare function VirtualCommandEntry(props: VirtualCommandEntryProps): _alloy_js_core0.Children;
13
13
  //#endregion
14
14
  export { VirtualCommandEntry, VirtualCommandEntryProps };
15
15
  //# sourceMappingURL=virtual-command-entry.d.cts.map
@@ -1,6 +1,6 @@
1
1
  import * as _alloy_js_core0 from "@alloy-js/core";
2
2
  import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
3
- import { CommandTree } from "@shell-shock/core/types/command";
3
+ import { CommandTree } from "@shell-shock/core";
4
4
 
5
5
  //#region src/components/virtual-command-entry.d.ts
6
6
  interface VirtualCommandEntryProps extends Omit<EntryFileProps, "path" | "typeDefinition"> {
@@ -4,7 +4,7 @@ import { CommandEntry } from "./command-entry.mjs";
4
4
  import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
5
5
  import { For, Show, computed } from "@alloy-js/core";
6
6
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
7
- import { isDynamicPathSegment } from "@shell-shock/core/plugin-utils/context-helpers";
7
+ import { isDynamicPathSegment } from "@shell-shock/core/plugin-utils";
8
8
  import { joinPaths } from "@stryke/path/join";
9
9
  import { pascalCase } from "@stryke/string-format/pascal-case";
10
10
  import defu from "defu";
@@ -24,14 +24,7 @@ function VirtualCommandEntry(props) {
24
24
  return filePath.value;
25
25
  },
26
26
  get imports() {
27
- return defu({ didyoumean2: [
28
- {
29
- name: "didYouMean",
30
- default: true
31
- },
32
- { name: "ReturnTypeEnums" },
33
- { name: "ThresholdTypeEnums" }
34
- ] }, imports ?? {}, Object.entries(command.children).filter(([, child]) => child.isVirtual).reduce((ret, [name, child]) => {
27
+ return defu(imports ?? {}, Object.entries(command.children).filter(([, child]) => child.isVirtual).reduce((ret, [name, child]) => {
35
28
  ret[`./${child.name}`] = [{
36
29
  name: "handler",
37
30
  alias: `handle${pascalCase(name)}`
@@ -60,7 +53,8 @@ function VirtualCommandEntry(props) {
60
53
  "isMinimal",
61
54
  "isUnicodeSupported",
62
55
  "isInteractive",
63
- "isHelp"
56
+ "isHelp",
57
+ "findSuggestions"
64
58
  ],
65
59
  prompts: [
66
60
  "text",