@shell-shock/preset-cli 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/banner-function-declaration.cjs +5 -5
- package/dist/components/banner-function-declaration.d.mts +2 -2
- package/dist/components/banner-function-declaration.d.mts.map +1 -1
- package/dist/components/banner-function-declaration.mjs +5 -5
- package/dist/components/banner-function-declaration.mjs.map +1 -1
- package/dist/components/command-entry.cjs +129 -122
- package/dist/components/command-entry.d.cts +2 -2
- package/dist/components/command-entry.d.cts.map +1 -1
- package/dist/components/command-entry.d.mts +2 -2
- package/dist/components/command-entry.d.mts.map +1 -1
- package/dist/components/command-entry.mjs +129 -122
- package/dist/components/command-entry.mjs.map +1 -1
- package/dist/components/command-router.d.cts +3 -3
- package/dist/components/index.cjs +0 -9
- package/dist/components/index.d.cts +1 -2
- package/dist/components/index.d.mts +1 -2
- package/dist/components/index.mjs +1 -2
- package/dist/components/virtual-command-entry.d.cts +2 -2
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +5 -7
- package/dist/index.mjs.map +1 -1
- package/dist/types/plugin.d.cts +6 -10
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +6 -10
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +12 -24
- package/dist/components/prompts-builtin.cjs +0 -2704
- package/dist/components/prompts-builtin.d.cts +0 -40
- package/dist/components/prompts-builtin.d.cts.map +0 -1
- package/dist/components/prompts-builtin.d.mts +0 -40
- package/dist/components/prompts-builtin.d.mts.map +0 -1
- package/dist/components/prompts-builtin.mjs +0 -2696
- package/dist/components/prompts-builtin.mjs.map +0 -1
|
@@ -17,11 +17,11 @@ function BannerFunctionDeclaration(props) {
|
|
|
17
17
|
const theme = (0, __shell_shock_preset_script_contexts_theme.useTheme)();
|
|
18
18
|
const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
19
19
|
const header = (0, __alloy_js_core.computed)(() => `${theme.labels.banner.header[variant] || (0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context)} v${context.packageJson.version || "1.0.0"}`);
|
|
20
|
-
const description = (0, __alloy_js_core.computed)(() => command?.description || (0, __shell_shock_core_plugin_utils_context_helpers.getAppDescription)(context));
|
|
21
20
|
const footer = (0, __alloy_js_core.computed)(() => theme.labels.banner.footer[variant]);
|
|
22
|
-
const title = (0, __alloy_js_core.computed)(() => (0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context
|
|
21
|
+
const title = (0, __alloy_js_core.computed)(() => (0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context, true).replace(`v${context.packageJson.version || "1.0.0"}`, ""));
|
|
22
|
+
const description = (0, __alloy_js_core.computed)(() => command?.description || (0, __shell_shock_core_plugin_utils_context_helpers.getAppDescription)(context));
|
|
23
23
|
const titleLines = (0, __alloy_js_core.computed)(() => {
|
|
24
|
-
const result = (0, cfonts.render)((0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context), {
|
|
24
|
+
const result = (0, cfonts.render)((0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context, true), {
|
|
25
25
|
font: "tiny",
|
|
26
26
|
align: "left",
|
|
27
27
|
background: "transparent",
|
|
@@ -31,7 +31,7 @@ function BannerFunctionDeclaration(props) {
|
|
|
31
31
|
transitionGradient: false,
|
|
32
32
|
env: "node"
|
|
33
33
|
});
|
|
34
|
-
if (!result) return [(0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context)];
|
|
34
|
+
if (!result) return [`${(0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context, true)} Command-Line Interface`];
|
|
35
35
|
return result.array;
|
|
36
36
|
});
|
|
37
37
|
const bannerPadding = (0, __alloy_js_core.computed)(() => Math.max(theme.padding.app, 0) * 2 + theme.borderStyles.banner.outline[variant].left.length + theme.borderStyles.banner.outline[variant].right.length);
|
|
@@ -40,7 +40,7 @@ function BannerFunctionDeclaration(props) {
|
|
|
40
40
|
async: true,
|
|
41
41
|
name: "banner",
|
|
42
42
|
get doc() {
|
|
43
|
-
return `Write the ${(0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context)} application banner ${command ? `for the ${command.title} command ` : ""}to the console.`;
|
|
43
|
+
return `Write the ${(0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context, true)} application banner ${command ? `for the ${command.title} command ` : ""}to the console.`;
|
|
44
44
|
},
|
|
45
45
|
parameters: [{
|
|
46
46
|
name: "pause",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core3 from "@alloy-js/core";
|
|
2
2
|
import { BannerFunctionDeclarationProps } from "@shell-shock/preset-script/components/banner-function-declaration";
|
|
3
3
|
|
|
4
4
|
//#region src/components/banner-function-declaration.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* A component to generate the `banner` function in the `shell-shock:console` builtin module.
|
|
7
7
|
*/
|
|
8
|
-
declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps):
|
|
8
|
+
declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps): _alloy_js_core3.Children;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { BannerFunctionDeclaration };
|
|
11
11
|
//# sourceMappingURL=banner-function-declaration.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner-function-declaration.d.mts","names":[],"sources":["../../src/components/banner-function-declaration.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAkCgB,iBAAA,yBAAA,CACP,KAAA,EAAA,8BAA8B,CAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"banner-function-declaration.d.mts","names":[],"sources":["../../src/components/banner-function-declaration.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAkCgB,iBAAA,yBAAA,CACP,KAAA,EAAA,8BAA8B,CAAA,EAAA,eAAA,CAAA,QAAA"}
|
|
@@ -16,11 +16,11 @@ function BannerFunctionDeclaration(props) {
|
|
|
16
16
|
const theme = useTheme();
|
|
17
17
|
const context = usePowerlines();
|
|
18
18
|
const header = computed(() => `${theme.labels.banner.header[variant] || getAppTitle(context)} v${context.packageJson.version || "1.0.0"}`);
|
|
19
|
-
const description = computed(() => command?.description || getAppDescription(context));
|
|
20
19
|
const footer = computed(() => theme.labels.banner.footer[variant]);
|
|
21
|
-
const title = computed(() => getAppTitle(context
|
|
20
|
+
const title = computed(() => getAppTitle(context, true).replace(`v${context.packageJson.version || "1.0.0"}`, ""));
|
|
21
|
+
const description = computed(() => command?.description || getAppDescription(context));
|
|
22
22
|
const titleLines = computed(() => {
|
|
23
|
-
const result = render(getAppTitle(context), {
|
|
23
|
+
const result = render(getAppTitle(context, true), {
|
|
24
24
|
font: "tiny",
|
|
25
25
|
align: "left",
|
|
26
26
|
background: "transparent",
|
|
@@ -30,7 +30,7 @@ function BannerFunctionDeclaration(props) {
|
|
|
30
30
|
transitionGradient: false,
|
|
31
31
|
env: "node"
|
|
32
32
|
});
|
|
33
|
-
if (!result) return [getAppTitle(context)];
|
|
33
|
+
if (!result) return [`${getAppTitle(context, true)} Command-Line Interface`];
|
|
34
34
|
return result.array;
|
|
35
35
|
});
|
|
36
36
|
const bannerPadding = computed(() => Math.max(theme.padding.app, 0) * 2 + theme.borderStyles.banner.outline[variant].left.length + theme.borderStyles.banner.outline[variant].right.length);
|
|
@@ -39,7 +39,7 @@ function BannerFunctionDeclaration(props) {
|
|
|
39
39
|
async: true,
|
|
40
40
|
name: "banner",
|
|
41
41
|
get doc() {
|
|
42
|
-
return `Write the ${getAppTitle(context)} application banner ${command ? `for the ${command.title} command ` : ""}to the console.`;
|
|
42
|
+
return `Write the ${getAppTitle(context, true)} application banner ${command ? `for the ${command.title} command ` : ""}to the console.`;
|
|
43
43
|
},
|
|
44
44
|
parameters: [{
|
|
45
45
|
name: "pause",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner-function-declaration.mjs","names":["code","computed","FunctionDeclaration","IfStatement","usePowerlines","getAppDescription","getAppTitle","BannerFunctionBodyDeclaration","useTheme","render","BannerFunctionDeclaration","props","consoleFnName","variant","command","theme","context","header","labels","banner","packageJson","version","
|
|
1
|
+
{"version":3,"file":"banner-function-declaration.mjs","names":["code","computed","FunctionDeclaration","IfStatement","usePowerlines","getAppDescription","getAppTitle","BannerFunctionBodyDeclaration","useTheme","render","BannerFunctionDeclaration","props","consoleFnName","variant","command","theme","context","header","labels","banner","packageJson","version","footer","title","replace","description","titleLines","result","font","align","background","letterSpacing","lineHeight","gradient","transitionGradient","env","array","bannerPadding","Math","max","padding","app","borderStyles","outline","left","length","right","totalPadding","value","_$createComponent","async","name","doc","parameters","type","default","children","map","line","JSON","stringify","trim","join","condition"],"sources":["../../src/components/banner-function-declaration.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 } from \"@alloy-js/core\";\nimport { FunctionDeclaration, IfStatement } from \"@alloy-js/typescript\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n getAppDescription,\n getAppTitle\n} from \"@shell-shock/core/plugin-utils/context-helpers\";\nimport type { BannerFunctionDeclarationProps } from \"@shell-shock/preset-script/components/banner-function-declaration\";\nimport { BannerFunctionBodyDeclaration } from \"@shell-shock/preset-script/components/banner-function-declaration\";\nimport { useTheme } from \"@shell-shock/preset-script/contexts/theme\";\nimport { render } from \"cfonts\";\nimport type { CLIPresetContext } from \"../types/plugin\";\n\n/**\n * A component to generate the `banner` function in the `shell-shock:console` builtin module.\n */\nexport function BannerFunctionDeclaration(\n props: BannerFunctionDeclarationProps\n) {\n const { consoleFnName = \"log\", variant = \"primary\", command } = props;\n\n const theme = useTheme();\n\n const context = usePowerlines<CLIPresetContext>();\n\n const header = computed(\n () =>\n `${theme.labels.banner.header[variant] || getAppTitle(context)} v${\n context.packageJson.version || \"1.0.0\"\n }`\n );\n const footer = computed(() => theme.labels.banner.footer[variant]);\n const title = computed(() =>\n getAppTitle(context, true).replace(\n `v${context.packageJson.version || \"1.0.0\"}`,\n \"\"\n )\n );\n const description = computed(\n () => command?.description || getAppDescription(context)\n );\n\n const titleLines = computed(() => {\n const result = render(getAppTitle(context, true), {\n font: \"tiny\",\n align: \"left\",\n background: \"transparent\",\n letterSpacing: 1,\n lineHeight: 1,\n gradient: false,\n transitionGradient: false,\n env: \"node\"\n });\n if (!result) {\n return [`${getAppTitle(context, true)} Command-Line Interface`];\n }\n\n return result.array;\n });\n\n const bannerPadding = computed(\n () =>\n Math.max(theme.padding.app, 0) * 2 +\n theme.borderStyles.banner.outline[variant].left.length +\n theme.borderStyles.banner.outline[variant].right.length\n );\n const totalPadding = computed(\n () => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value\n );\n\n return (\n <>\n <FunctionDeclaration\n async\n name=\"banner\"\n doc={`Write the ${getAppTitle(context, true)} application banner ${\n command ? `for the ${command.title} command ` : \"\"\n }to the console.`}\n parameters={[{ name: \"pause\", type: \"number\", default: 500 }]}>\n <BannerFunctionBodyDeclaration\n header={header.value}\n description={description.value}\n footer={footer.value}\n variant={variant}\n consoleFnName={consoleFnName}\n command={command}>\n {code`const titleLines = [${titleLines.value\n .map(line => JSON.stringify(line.trim()))\n .join(\", \")}];\n const title = Math.max(...titleLines.map(line => stripAnsi(line).length)) > Math.max(process.stdout.columns - ${\n totalPadding.value\n }, 0) ? \"${title.value}\" : \\`\\\\n\\${titleLines.join(\"\\\\n\")}\\\\n\\`; `}\n </BannerFunctionBodyDeclaration>\n <IfStatement condition={code`isInteractive && !isHelp`}>\n {code`await sleep(pause);`}\n </IfStatement>\n </FunctionDeclaration>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAkCA,SAAgBU,0BACdC,OACA;CACA,MAAM,EAAEC,gBAAgB,OAAOC,UAAU,WAAWC,YAAYH;CAEhE,MAAMI,QAAQP,UAAU;CAExB,MAAMQ,UAAUZ,eAAiC;CAEjD,MAAMa,SAAShB,eAEX,GAAGc,MAAMG,OAAOC,OAAOF,OAAOJ,YAAYP,YAAYU,QAAQ,CAAA,IAC5DA,QAAQI,YAAYC,WAAW,UAEpC;CACD,MAAMC,SAASrB,eAAec,MAAMG,OAAOC,OAAOG,OAAOT,SAAS;CAClE,MAAMU,QAAQtB,eACZK,YAAYU,SAAS,KAAK,CAACQ,QACzB,IAAIR,QAAQI,YAAYC,WAAW,WACnC,GAEJ,CAAC;CACD,MAAMI,cAAcxB,eACZa,SAASW,eAAepB,kBAAkBW,QAClD,CAAC;CAED,MAAMU,aAAazB,eAAe;EAChC,MAAM0B,SAASlB,OAAOH,YAAYU,SAAS,KAAK,EAAE;GAChDY,MAAM;GACNC,OAAO;GACPC,YAAY;GACZC,eAAe;GACfC,YAAY;GACZC,UAAU;GACVC,oBAAoB;GACpBC,KAAK;GACN,CAAC;AACF,MAAI,CAACR,OACH,QAAO,CAAC,GAAGrB,YAAYU,SAAS,KAAK,CAAA,yBAA0B;AAGjE,SAAOW,OAAOS;GACd;CAEF,MAAMC,gBAAgBpC,eAElBqC,KAAKC,IAAIxB,MAAMyB,QAAQC,KAAK,EAAE,GAAG,IACjC1B,MAAM2B,aAAavB,OAAOwB,QAAQ9B,SAAS+B,KAAKC,SAChD9B,MAAM2B,aAAavB,OAAOwB,QAAQ9B,SAASiC,MAAMD,OACpD;CACD,MAAME,eAAe9C,eACbqC,KAAKC,IAAIxB,MAAMyB,QAAQrB,QAAQ,EAAE,GAAG,IAAIkB,cAAcW,MAC7D;AAED,QAAA,CAAAC,gBAEK/C,qBAAmB;EAClBgD,OAAK;EACLC,MAAI;EAAA,IACJC,MAAG;AAAA,UAAE,aAAa9C,YAAYU,SAAS,KAAK,CAAA,sBAC1CF,UAAU,WAAWA,QAAQS,MAAK,aAAc,GAAE;;EAEpD8B,YAAY,CAAC;GAAEF,MAAM;GAASG,MAAM;GAAUC,SAAS;GAAK,CAAC;EAAA,IAAAC,WAAA;AAAA,UAAA,CAAAP,gBAC5D1C,+BAA6B;IAAA,IAC5BU,SAAM;AAAA,YAAEA,OAAO+B;;IAAK,IACpBvB,cAAW;AAAA,YAAEA,YAAYuB;;IAAK,IAC9B1B,SAAM;AAAA,YAAEA,OAAO0B;;IACNnC;IACMD;IACNE;IAAO,IAAA0C,WAAA;AAAA,YACfxD,IAAI,uBAAuB0B,WAAWsB,MACpCS,KAAIC,SAAQC,KAAKC,UAAUF,KAAKG,MAAM,CAAC,CAAC,CACxCC,KAAK,KAAK,CAAA;wHAEbf,aAAaC,MAAK,UACTzB,MAAMyB,MAAK;;IAA4C,CAAA,EAAAC,gBAEjE9C,aAAW;IAAC4D,WAAW/D,IAAI;IAA0BwD,UACnDxD,IAAI;IAAqB,CAAA,CAAA;;EAAA,CAAA,CAAA"}
|
|
@@ -95,37 +95,42 @@ function CommandEntry(props) {
|
|
|
95
95
|
get children() {
|
|
96
96
|
return (0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_command_entry.CommandValidationLogic, { command });
|
|
97
97
|
}
|
|
98
|
-
}), (0, __alloy_js_core_jsx_runtime.createComponent)(
|
|
99
|
-
get
|
|
100
|
-
return
|
|
98
|
+
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
99
|
+
get when() {
|
|
100
|
+
return Object.values(command.options ?? {}).filter((option) => !option.optional).length > 0 || Object.values(command.arguments ?? {}).filter((argument) => !argument.optional).length > 0;
|
|
101
101
|
},
|
|
102
102
|
get children() {
|
|
103
|
-
return
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
get
|
|
118
|
-
return
|
|
103
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.ElseIfClause, {
|
|
104
|
+
get condition() {
|
|
105
|
+
return __alloy_js_core.code`!isHelp && (${Object.values(command.options ?? {}).filter((option) => !option.optional).map((option) => (option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string || option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number) && option.variadic ? `(!options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, __stryke_string_format_camel_case.camelCase)(option.name)}`} || options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, __stryke_string_format_camel_case.camelCase)(option.name)}`}.length === 0)` : `options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, __stryke_string_format_camel_case.camelCase)(option.name)}`} === undefined`).join(" || ")}${Object.values(command.options ?? {}).filter((option) => !option.optional).length > 0 && Object.values(command.arguments ?? {}).filter((argument) => !argument.optional).length > 0 ? " || " : ""}${Object.values(command.arguments ?? {}).filter((argument) => !argument.optional).map((argument) => (argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string || argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number) && argument.variadic ? `(!${(0, __stryke_string_format_camel_case.camelCase)(argument.name)} || ${(0, __stryke_string_format_camel_case.camelCase)(argument.name)}.length === 0)` : `${(0, __stryke_string_format_camel_case.camelCase)(argument.name)} === undefined`).join(" || ")}) `;
|
|
106
|
+
},
|
|
107
|
+
get children() {
|
|
108
|
+
return [
|
|
109
|
+
__alloy_js_core.code`writeLine(""); `,
|
|
110
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
111
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
112
|
+
get each() {
|
|
113
|
+
return Object.values(command.options ?? {});
|
|
114
|
+
},
|
|
115
|
+
doubleHardline: true,
|
|
116
|
+
children: (option) => [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
117
|
+
get when() {
|
|
118
|
+
return !option.optional;
|
|
119
119
|
},
|
|
120
120
|
get children() {
|
|
121
|
-
return (0, __alloy_js_core_jsx_runtime.createComponent)(
|
|
122
|
-
|
|
123
|
-
(0,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
121
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
122
|
+
get condition() {
|
|
123
|
+
return __alloy_js_core.code`!options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, __stryke_string_format_camel_case.camelCase)(option.name)}`}`;
|
|
124
|
+
},
|
|
125
|
+
get children() {
|
|
126
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Switch, { get children() {
|
|
127
|
+
return [
|
|
128
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
|
|
129
|
+
get when() {
|
|
130
|
+
return option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string;
|
|
131
|
+
},
|
|
132
|
+
get children() {
|
|
133
|
+
return __alloy_js_core.code`
|
|
129
134
|
const value = await text({
|
|
130
135
|
message: "Please provide a value for the \\"${option.name}\\" option",
|
|
131
136
|
${option.description ? `description: "${option.description}",
|
|
@@ -143,14 +148,14 @@ function CommandEntry(props) {
|
|
|
143
148
|
|
|
144
149
|
options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, __stryke_string_format_camel_case.camelCase)(option.name)}`} = value;
|
|
145
150
|
`;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
}
|
|
152
|
+
}),
|
|
153
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
|
|
154
|
+
get when() {
|
|
155
|
+
return option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number;
|
|
156
|
+
},
|
|
157
|
+
get children() {
|
|
158
|
+
return __alloy_js_core.code`
|
|
154
159
|
const value = await numeric({
|
|
155
160
|
message: "Please provide a numeric value for the \\"${option.name}\\" option",
|
|
156
161
|
${option.description ? `description: "${option.description}",
|
|
@@ -162,14 +167,14 @@ function CommandEntry(props) {
|
|
|
162
167
|
|
|
163
168
|
options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, __stryke_string_format_camel_case.camelCase)(option.name)}`} = value;
|
|
164
169
|
`;
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
}
|
|
171
|
+
}),
|
|
172
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
|
|
173
|
+
get when() {
|
|
174
|
+
return option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.boolean;
|
|
175
|
+
},
|
|
176
|
+
get children() {
|
|
177
|
+
return __alloy_js_core.code`
|
|
173
178
|
const value = await toggle({
|
|
174
179
|
message: "Please select a value for the \\"${option.name}\\" option",
|
|
175
180
|
${option.description ? `description: "${option.description}",
|
|
@@ -181,22 +186,22 @@ function CommandEntry(props) {
|
|
|
181
186
|
|
|
182
187
|
options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, __stryke_string_format_camel_case.camelCase)(option.name)}`} = value;
|
|
183
188
|
`;
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
},
|
|
193
|
-
get children() {
|
|
194
|
-
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.ElseIfClause, {
|
|
195
|
-
get condition() {
|
|
196
|
-
return __alloy_js_core.code`options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, __stryke_string_format_camel_case.camelCase)(option.name)}`}.length === 0`;
|
|
189
|
+
}
|
|
190
|
+
})
|
|
191
|
+
];
|
|
192
|
+
} });
|
|
193
|
+
}
|
|
194
|
+
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
195
|
+
get when() {
|
|
196
|
+
return (option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string || option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number) && option.variadic;
|
|
197
197
|
},
|
|
198
198
|
get children() {
|
|
199
|
-
return
|
|
199
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.ElseIfClause, {
|
|
200
|
+
get condition() {
|
|
201
|
+
return __alloy_js_core.code`options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, __stryke_string_format_camel_case.camelCase)(option.name)}`}.length === 0`;
|
|
202
|
+
},
|
|
203
|
+
get children() {
|
|
204
|
+
return __alloy_js_core.code`
|
|
200
205
|
const value = await text({
|
|
201
206
|
message: "Please provide one or more${option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number ? " numeric" : ""} values for the \\"${option.name}\\" option (values are separated by a \\",\\" character)",
|
|
202
207
|
${option.description ? `description: "${option.description}",
|
|
@@ -220,37 +225,37 @@ function CommandEntry(props) {
|
|
|
220
225
|
|
|
221
226
|
options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, __stryke_string_format_camel_case.camelCase)(option.name)}`} = value.split(",").map(value => value.trim()).filter(Boolean)${option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number ? `.map(Number)` : ""} ;
|
|
222
227
|
`;
|
|
228
|
+
}
|
|
229
|
+
});
|
|
223
230
|
}
|
|
224
|
-
});
|
|
231
|
+
})];
|
|
225
232
|
}
|
|
226
|
-
})]
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
get when() {
|
|
238
|
-
return !argument.optional;
|
|
239
|
-
},
|
|
240
|
-
get children() {
|
|
241
|
-
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
242
|
-
get condition() {
|
|
243
|
-
return __alloy_js_core.code`!${(0, __stryke_string_format_camel_case.camelCase)(argument.name)}`;
|
|
233
|
+
})]
|
|
234
|
+
}),
|
|
235
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
236
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
237
|
+
get each() {
|
|
238
|
+
return command.arguments;
|
|
239
|
+
},
|
|
240
|
+
doubleHardline: true,
|
|
241
|
+
children: (argument) => [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
242
|
+
get when() {
|
|
243
|
+
return !argument.optional;
|
|
244
244
|
},
|
|
245
245
|
get children() {
|
|
246
|
-
return (0, __alloy_js_core_jsx_runtime.createComponent)(
|
|
247
|
-
|
|
248
|
-
(0,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
246
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
247
|
+
get condition() {
|
|
248
|
+
return __alloy_js_core.code`!${(0, __stryke_string_format_camel_case.camelCase)(argument.name)}`;
|
|
249
|
+
},
|
|
250
|
+
get children() {
|
|
251
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Switch, { get children() {
|
|
252
|
+
return [
|
|
253
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
|
|
254
|
+
get when() {
|
|
255
|
+
return argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string;
|
|
256
|
+
},
|
|
257
|
+
get children() {
|
|
258
|
+
return __alloy_js_core.code`
|
|
254
259
|
const value = await text({
|
|
255
260
|
message: "Please provide a value for the \\"${argument.name}\\" argument",
|
|
256
261
|
${argument.description ? `description: "${argument.description}",
|
|
@@ -268,14 +273,14 @@ function CommandEntry(props) {
|
|
|
268
273
|
|
|
269
274
|
${(0, __stryke_string_format_camel_case.camelCase)(argument.name)} = value;
|
|
270
275
|
`;
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
276
|
+
}
|
|
277
|
+
}),
|
|
278
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
|
|
279
|
+
get when() {
|
|
280
|
+
return argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number;
|
|
281
|
+
},
|
|
282
|
+
get children() {
|
|
283
|
+
return __alloy_js_core.code`
|
|
279
284
|
const value = await numeric({
|
|
280
285
|
message: "Please provide a numeric value for the \\"${argument.name}\\" argument",
|
|
281
286
|
${argument.description ? `description: "${argument.description}",
|
|
@@ -287,14 +292,14 @@ function CommandEntry(props) {
|
|
|
287
292
|
|
|
288
293
|
${(0, __stryke_string_format_camel_case.camelCase)(argument.name)} = value;
|
|
289
294
|
`;
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
295
|
+
}
|
|
296
|
+
}),
|
|
297
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Match, {
|
|
298
|
+
get when() {
|
|
299
|
+
return argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.boolean;
|
|
300
|
+
},
|
|
301
|
+
get children() {
|
|
302
|
+
return __alloy_js_core.code`
|
|
298
303
|
const value = await toggle({
|
|
299
304
|
message: "Please select a value for the \\"${argument.name}\\" argument",
|
|
300
305
|
${argument.description ? `description: "${argument.description}",
|
|
@@ -306,22 +311,22 @@ function CommandEntry(props) {
|
|
|
306
311
|
|
|
307
312
|
${(0, __stryke_string_format_camel_case.camelCase)(argument.name)} = value;
|
|
308
313
|
`;
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
},
|
|
318
|
-
get children() {
|
|
319
|
-
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.ElseIfClause, {
|
|
320
|
-
get condition() {
|
|
321
|
-
return __alloy_js_core.code`${(0, __stryke_string_format_camel_case.camelCase)(argument.name)}.length === 0`;
|
|
314
|
+
}
|
|
315
|
+
})
|
|
316
|
+
];
|
|
317
|
+
} });
|
|
318
|
+
}
|
|
319
|
+
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
320
|
+
get when() {
|
|
321
|
+
return (argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string || argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number) && argument.variadic;
|
|
322
322
|
},
|
|
323
323
|
get children() {
|
|
324
|
-
return
|
|
324
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.ElseIfClause, {
|
|
325
|
+
get condition() {
|
|
326
|
+
return __alloy_js_core.code`${(0, __stryke_string_format_camel_case.camelCase)(argument.name)}.length === 0`;
|
|
327
|
+
},
|
|
328
|
+
get children() {
|
|
329
|
+
return __alloy_js_core.code`
|
|
325
330
|
const value = await text({
|
|
326
331
|
message: "Please provide one or more${argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number ? " numeric" : ""} (values are separated by a \\",\\" character)",
|
|
327
332
|
${argument.description ? `description: "${argument.description}",
|
|
@@ -346,16 +351,18 @@ function CommandEntry(props) {
|
|
|
346
351
|
|
|
347
352
|
${(0, __stryke_string_format_camel_case.camelCase)(argument.name)} = value.split(",").map(value => value.trim()).filter(Boolean)${argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number ? `.map(Number)` : ""} ;
|
|
348
353
|
`;
|
|
354
|
+
}
|
|
355
|
+
});
|
|
349
356
|
}
|
|
350
|
-
});
|
|
357
|
+
})];
|
|
351
358
|
}
|
|
352
|
-
})]
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
+
})]
|
|
360
|
+
}),
|
|
361
|
+
__alloy_js_core.code`writeLine(""); `,
|
|
362
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {})
|
|
363
|
+
];
|
|
364
|
+
}
|
|
365
|
+
});
|
|
359
366
|
}
|
|
360
367
|
})];
|
|
361
368
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
2
|
import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
|
|
3
3
|
import { CommandTree } from "@shell-shock/core/types/command";
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ interface CommandEntryProps extends Omit<EntryFileProps, "path" | "typeDefinitio
|
|
|
9
9
|
/**
|
|
10
10
|
* The command entry point for the Shell Shock project.
|
|
11
11
|
*/
|
|
12
|
-
declare function CommandEntry(props: CommandEntryProps):
|
|
12
|
+
declare function CommandEntry(props: CommandEntryProps): _alloy_js_core0.Children;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { CommandEntry, CommandEntryProps };
|
|
15
15
|
//# sourceMappingURL=command-entry.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-entry.d.cts","names":[],"sources":["../../src/components/command-entry.tsx"],"sourcesContent":[],"mappings":";;;;;UAyCiB,iBAAA,SAA0B,KACzC;WAGS;;AAJX;;;AAA2C,iBAU3B,YAAA,CAV2B,KAAA,EAUP,iBAVO,CAAA,EAUU,
|
|
1
|
+
{"version":3,"file":"command-entry.d.cts","names":[],"sources":["../../src/components/command-entry.tsx"],"sourcesContent":[],"mappings":";;;;;UAyCiB,iBAAA,SAA0B,KACzC;WAGS;;AAJX;;;AAA2C,iBAU3B,YAAA,CAV2B,KAAA,EAUP,iBAVO,CAAA,EAUU,eAAA,CAAA,QAVV"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core2 from "@alloy-js/core";
|
|
2
2
|
import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
|
|
3
3
|
import { CommandTree } from "@shell-shock/core/types/command";
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ interface CommandEntryProps extends Omit<EntryFileProps, "path" | "typeDefinitio
|
|
|
9
9
|
/**
|
|
10
10
|
* The command entry point for the Shell Shock project.
|
|
11
11
|
*/
|
|
12
|
-
declare function CommandEntry(props: CommandEntryProps):
|
|
12
|
+
declare function CommandEntry(props: CommandEntryProps): _alloy_js_core2.Children;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { CommandEntry, CommandEntryProps };
|
|
15
15
|
//# sourceMappingURL=command-entry.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-entry.d.mts","names":[],"sources":["../../src/components/command-entry.tsx"],"sourcesContent":[],"mappings":";;;;;UAyCiB,iBAAA,SAA0B,KACzC;WAGS;;AAJX;;;AAA2C,iBAU3B,YAAA,CAV2B,KAAA,EAUP,iBAVO,CAAA,EAUU,
|
|
1
|
+
{"version":3,"file":"command-entry.d.mts","names":[],"sources":["../../src/components/command-entry.tsx"],"sourcesContent":[],"mappings":";;;;;UAyCiB,iBAAA,SAA0B,KACzC;WAGS;;AAJX;;;AAA2C,iBAU3B,YAAA,CAV2B,KAAA,EAUP,iBAVO,CAAA,EAUU,eAAA,CAAA,QAVV"}
|