@shell-shock/preset-cli 0.9.20 → 0.9.23

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