@shell-shock/preset-cli 0.3.1 → 0.4.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/README.md +1 -1
- package/dist/components/banner-function-declaration.cjs +11 -2
- 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 +12 -3
- package/dist/components/banner-function-declaration.mjs.map +1 -1
- package/dist/components/command-entry.cjs +22 -37
- 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 +22 -37
- package/dist/components/command-entry.mjs.map +1 -1
- package/dist/components/command-router.cjs +6 -12
- package/dist/components/command-router.d.cts +3 -3
- package/dist/components/command-router.d.cts.map +1 -1
- package/dist/components/command-router.d.mts +3 -3
- package/dist/components/command-router.d.mts.map +1 -1
- package/dist/components/command-router.mjs +7 -13
- package/dist/components/command-router.mjs.map +1 -1
- package/dist/components/index.cjs +11 -0
- package/dist/components/index.d.cts +3 -1
- package/dist/components/index.d.mts +3 -1
- package/dist/components/index.mjs +3 -1
- package/dist/components/prompts-builtin.cjs +2283 -0
- package/dist/components/prompts-builtin.d.cts +36 -0
- package/dist/components/prompts-builtin.d.cts.map +1 -0
- package/dist/components/prompts-builtin.d.mts +36 -0
- package/dist/components/prompts-builtin.d.mts.map +1 -0
- package/dist/components/prompts-builtin.mjs +2276 -0
- package/dist/components/prompts-builtin.mjs.map +1 -0
- package/dist/components/virtual-command-entry.cjs +8 -6
- package/dist/components/virtual-command-entry.d.cts.map +1 -1
- package/dist/components/virtual-command-entry.d.mts.map +1 -1
- package/dist/components/virtual-command-entry.mjs +8 -6
- package/dist/components/virtual-command-entry.mjs.map +1 -1
- package/dist/helpers/get-default-options.cjs +2 -2
- package/dist/helpers/get-default-options.mjs +2 -2
- package/dist/helpers/get-default-options.mjs.map +1 -1
- package/dist/index.cjs +16 -25
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +16 -25
- package/dist/index.mjs.map +1 -1
- package/package.json +26 -12
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ This package is part of the ⚡<b>Shell Shock</b> monorepo. The Shell Shock pack
|
|
|
27
27
|
|
|
28
28
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
29
29
|
|
|
30
|
-
[](https://stormsoftware.com/projects/shell-shock/) [](http://commitizen.github.io/cz-cli/)  
|
|
31
31
|
|
|
32
32
|
<!-- prettier-ignore-start -->
|
|
33
33
|
<!-- markdownlint-disable -->
|
|
@@ -37,12 +37,18 @@ function BannerFunctionDeclaration(props) {
|
|
|
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);
|
|
38
38
|
const totalPadding = (0, __alloy_js_core.computed)(() => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value);
|
|
39
39
|
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
|
|
40
|
+
async: true,
|
|
40
41
|
name: "banner",
|
|
41
42
|
get doc() {
|
|
42
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
44
|
},
|
|
45
|
+
parameters: [{
|
|
46
|
+
name: "pause",
|
|
47
|
+
type: "number",
|
|
48
|
+
default: 250
|
|
49
|
+
}],
|
|
44
50
|
get children() {
|
|
45
|
-
return (0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_banner_function_declaration.BannerFunctionBodyDeclaration, {
|
|
51
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_banner_function_declaration.BannerFunctionBodyDeclaration, {
|
|
46
52
|
get header() {
|
|
47
53
|
return header.value;
|
|
48
54
|
},
|
|
@@ -59,7 +65,10 @@ function BannerFunctionDeclaration(props) {
|
|
|
59
65
|
return __alloy_js_core.code`const titleLines = [${titleLines.value.map((line) => JSON.stringify(line.trim())).join(", ")}];
|
|
60
66
|
const title = Math.max(...titleLines.map(line => stripAnsi(line).length)) > Math.max(process.stdout.columns - ${totalPadding.value}, 0) ? "${title.value}" : \`\\n\${titleLines.join("\\n")}\\n\`; `;
|
|
61
67
|
}
|
|
62
|
-
})
|
|
68
|
+
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
69
|
+
condition: __alloy_js_core.code`isInteractive && !isHelp`,
|
|
70
|
+
children: __alloy_js_core.code`await sleep(pause);`
|
|
71
|
+
})];
|
|
63
72
|
}
|
|
64
73
|
})];
|
|
65
74
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core10 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_core10.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,gBAAA,CAAA,QAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
|
|
2
2
|
import { code, computed } from "@alloy-js/core";
|
|
3
|
-
import { FunctionDeclaration } from "@alloy-js/typescript";
|
|
3
|
+
import { FunctionDeclaration, IfStatement } from "@alloy-js/typescript";
|
|
4
4
|
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
5
5
|
import { getAppDescription, getAppTitle } from "@shell-shock/core/plugin-utils/context-helpers";
|
|
6
6
|
import { BannerFunctionBodyDeclaration } from "@shell-shock/preset-script/components/banner-function-declaration";
|
|
@@ -36,12 +36,18 @@ function BannerFunctionDeclaration(props) {
|
|
|
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);
|
|
37
37
|
const totalPadding = computed(() => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value);
|
|
38
38
|
return [createComponent(FunctionDeclaration, {
|
|
39
|
+
async: true,
|
|
39
40
|
name: "banner",
|
|
40
41
|
get doc() {
|
|
41
42
|
return `Write the ${getAppTitle(context)} application banner ${command ? `for the ${command.title} command ` : ""}to the console.`;
|
|
42
43
|
},
|
|
44
|
+
parameters: [{
|
|
45
|
+
name: "pause",
|
|
46
|
+
type: "number",
|
|
47
|
+
default: 250
|
|
48
|
+
}],
|
|
43
49
|
get children() {
|
|
44
|
-
return createComponent(BannerFunctionBodyDeclaration, {
|
|
50
|
+
return [createComponent(BannerFunctionBodyDeclaration, {
|
|
45
51
|
get header() {
|
|
46
52
|
return header.value;
|
|
47
53
|
},
|
|
@@ -58,7 +64,10 @@ function BannerFunctionDeclaration(props) {
|
|
|
58
64
|
return code`const titleLines = [${titleLines.value.map((line) => JSON.stringify(line.trim())).join(", ")}];
|
|
59
65
|
const title = Math.max(...titleLines.map(line => stripAnsi(line).length)) > Math.max(process.stdout.columns - ${totalPadding.value}, 0) ? "${title.value}" : \`\\n\${titleLines.join("\\n")}\\n\`; `;
|
|
60
66
|
}
|
|
61
|
-
})
|
|
67
|
+
}), createComponent(IfStatement, {
|
|
68
|
+
condition: code`isInteractive && !isHelp`,
|
|
69
|
+
children: code`await sleep(pause);`
|
|
70
|
+
})];
|
|
62
71
|
}
|
|
63
72
|
})];
|
|
64
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner-function-declaration.mjs","names":["code","computed","FunctionDeclaration","usePowerlines","getAppDescription","getAppTitle","BannerFunctionBodyDeclaration","useTheme","render","BannerFunctionDeclaration","props","consoleFnName","variant","command","theme","context","header","labels","banner","packageJson","version","description","footer","title","test","value","toLowerCase","replace","trim","titleLines","result","font","align","background","letterSpacing","lineHeight","gradient","transitionGradient","env","array","bannerPadding","Math","max","padding","app","borderStyles","outline","left","length","right","totalPadding","_$createComponent","name","doc","children","map","line","JSON","stringify","join"],"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 } 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${context.packageJson.version || \"1.0.0\"}`\n );\n const description = computed(\n () => command?.description || getAppDescription(context)\n );\n const footer = computed(() => theme.labels.banner.footer[variant]);\n\n const title = computed(() =>\n getAppTitle(context) ||\n /(?:cli|command-line|command line)\\s+(?:application|app)?$/.test(\n header.value.toLowerCase()\n )\n ? header.value\n .replace(`v${context.packageJson.version || \"1.0.0\"}`, \"\")\n .trim()\n : `${header.value\n .replace(`v${context.packageJson.version || \"1.0.0\"}`, \"\")\n .trim()} Command-Line Application`\n );\n\n const titleLines = computed(() => {\n const result = render(getAppTitle(context), {\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)];\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 name=\"banner\"\n doc={`Write the ${getAppTitle(context)} application banner ${\n command ? `for the ${command.title} command ` : \"\"\n }to the console.`}>\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 </FunctionDeclaration>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAkCA,
|
|
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","description","footer","title","test","value","toLowerCase","replace","trim","titleLines","result","font","align","background","letterSpacing","lineHeight","gradient","transitionGradient","env","array","bannerPadding","Math","max","padding","app","borderStyles","outline","left","length","right","totalPadding","_$createComponent","async","name","doc","parameters","type","default","children","map","line","JSON","stringify","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${context.packageJson.version || \"1.0.0\"}`\n );\n const description = computed(\n () => command?.description || getAppDescription(context)\n );\n const footer = computed(() => theme.labels.banner.footer[variant]);\n\n const title = computed(() =>\n getAppTitle(context) ||\n /(?:cli|command-line|command line)\\s+(?:application|app)?$/.test(\n header.value.toLowerCase()\n )\n ? header.value\n .replace(`v${context.packageJson.version || \"1.0.0\"}`, \"\")\n .trim()\n : `${header.value\n .replace(`v${context.packageJson.version || \"1.0.0\"}`, \"\")\n .trim()} Command-Line Application`\n );\n\n const titleLines = computed(() => {\n const result = render(getAppTitle(context), {\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)];\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)} application banner ${\n command ? `for the ${command.title} command ` : \"\"\n }to the console.`}\n parameters={[{ name: \"pause\", type: \"number\", default: 250 }]}>\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,IAAKA,QAAQI,YAAYC,WAAW,UACrG;CACD,MAAMC,cAAcrB,eACZa,SAASQ,eAAejB,kBAAkBW,QAClD,CAAC;CACD,MAAMO,SAAStB,eAAec,MAAMG,OAAOC,OAAOI,OAAOV,SAAS;CAElE,MAAMW,QAAQvB,eACZK,YAAYU,QAAQ,IACpB,4DAA4DS,KAC1DR,OAAOS,MAAMC,aACf,CAAC,GACGV,OAAOS,MACJE,QAAQ,IAAIZ,QAAQI,YAAYC,WAAW,WAAW,GAAG,CACzDQ,MAAM,GACT,GAAGZ,OAAOS,MACPE,QAAQ,IAAIZ,QAAQI,YAAYC,WAAW,WAAW,GAAG,CACzDQ,MAAM,CAAA,2BACd;CAED,MAAMC,aAAa7B,eAAe;EAChC,MAAM8B,SAAStB,OAAOH,YAAYU,QAAQ,EAAE;GAC1CgB,MAAM;GACNC,OAAO;GACPC,YAAY;GACZC,eAAe;GACfC,YAAY;GACZC,UAAU;GACVC,oBAAoB;GACpBC,KAAK;GACN,CAAC;AACF,MAAI,CAACR,OACH,QAAO,CAACzB,YAAYU,QAAQ,CAAC;AAG/B,SAAOe,OAAOS;GACd;CAEF,MAAMC,gBAAgBxC,eAElByC,KAAKC,IAAI5B,MAAM6B,QAAQC,KAAK,EAAE,GAAG,IACjC9B,MAAM+B,aAAa3B,OAAO4B,QAAQlC,SAASmC,KAAKC,SAChDlC,MAAM+B,aAAa3B,OAAO4B,QAAQlC,SAASqC,MAAMD,OACpD;CACD,MAAME,eAAelD,eACbyC,KAAKC,IAAI5B,MAAM6B,QAAQzB,QAAQ,EAAE,GAAG,IAAIsB,cAAcf,MAC7D;AAED,QAAA,CAAA0B,gBAEKlD,qBAAmB;EAClBmD,OAAK;EACLC,MAAI;EAAA,IACJC,MAAG;AAAA,UAAE,aAAajD,YAAYU,QAAQ,CAAA,sBACpCF,UAAU,WAAWA,QAAQU,MAAK,aAAc,GAAE;;EAEpDgC,YAAY,CAAC;GAAEF,MAAM;GAASG,MAAM;GAAUC,SAAS;GAAK,CAAC;EAAA,IAAAC,WAAA;AAAA,UAAA,CAAAP,gBAC5D7C,+BAA6B;IAAA,IAC5BU,SAAM;AAAA,YAAEA,OAAOS;;IAAK,IACpBJ,cAAW;AAAA,YAAEA,YAAYI;;IAAK,IAC9BH,SAAM;AAAA,YAAEA,OAAOG;;IACNb;IACMD;IACNE;IAAO,IAAA6C,WAAA;AAAA,YACf3D,IAAI,uBAAuB8B,WAAWJ,MACpCkC,KAAIC,SAAQC,KAAKC,UAAUF,KAAKhC,MAAM,CAAC,CAAC,CACxCmC,KAAK,KAAK,CAAA;wHAEbb,aAAazB,MAAK,UACTF,MAAME,MAAK;;IAA4C,CAAA,EAAA0B,gBAEjEjD,aAAW;IAAC8D,WAAWjE,IAAI;IAA0B2D,UACnD3D,IAAI;IAAqB,CAAA,CAAA;;EAAA,CAAA,CAAA"}
|
|
@@ -7,6 +7,7 @@ let __alloy_js_typescript = require("@alloy-js/typescript");
|
|
|
7
7
|
let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
8
8
|
let __shell_shock_core_plugin_utils_context_helpers = require("@shell-shock/core/plugin-utils/context-helpers");
|
|
9
9
|
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
10
|
+
let __powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
10
11
|
let __powerlines_plugin_alloy_typescript_components_entry_file = require("@powerlines/plugin-alloy/typescript/components/entry-file");
|
|
11
12
|
let __shell_shock_preset_script_components_command_entry = require("@shell-shock/preset-script/components/command-entry");
|
|
12
13
|
let __stryke_path_find = require("@stryke/path/find");
|
|
@@ -59,12 +60,7 @@ function CommandEntry(props) {
|
|
|
59
60
|
"colors",
|
|
60
61
|
"stripAnsi",
|
|
61
62
|
"writeLine",
|
|
62
|
-
"splitText"
|
|
63
|
-
"text",
|
|
64
|
-
"confirm",
|
|
65
|
-
"isCancel",
|
|
66
|
-
"intro",
|
|
67
|
-
"outro"
|
|
63
|
+
"splitText"
|
|
68
64
|
],
|
|
69
65
|
utils: [
|
|
70
66
|
"useApp",
|
|
@@ -75,6 +71,13 @@ function CommandEntry(props) {
|
|
|
75
71
|
"isHelp",
|
|
76
72
|
"isUnicodeSupported",
|
|
77
73
|
"internal_commandContext"
|
|
74
|
+
],
|
|
75
|
+
prompts: [
|
|
76
|
+
"text",
|
|
77
|
+
"toggle",
|
|
78
|
+
"select",
|
|
79
|
+
"isCancel",
|
|
80
|
+
"sleep"
|
|
78
81
|
]
|
|
79
82
|
});
|
|
80
83
|
},
|
|
@@ -85,6 +88,7 @@ function CommandEntry(props) {
|
|
|
85
88
|
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
86
89
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_command_entry.CommandHandlerDeclaration, {
|
|
87
90
|
command,
|
|
91
|
+
banner: __alloy_js_core.code`await banner(); `,
|
|
88
92
|
get children() {
|
|
89
93
|
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
90
94
|
condition: __alloy_js_core.code`!isInteractive`,
|
|
@@ -97,11 +101,8 @@ function CommandEntry(props) {
|
|
|
97
101
|
},
|
|
98
102
|
get children() {
|
|
99
103
|
return [
|
|
100
|
-
__alloy_js_core.code`writeLine("");
|
|
101
|
-
|
|
102
|
-
intro("Select required input parameters"); `,
|
|
103
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
104
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
104
|
+
__alloy_js_core.code`writeLine(""); `,
|
|
105
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
105
106
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
106
107
|
get each() {
|
|
107
108
|
return Object.values(command.options ?? {});
|
|
@@ -125,11 +126,8 @@ function CommandEntry(props) {
|
|
|
125
126
|
get children() {
|
|
126
127
|
return __alloy_js_core.code`
|
|
127
128
|
const value = await text({
|
|
128
|
-
message:
|
|
129
|
+
message: "Please provide a${option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number ? " numeric" : ""} value for the \\"${option.name}\\" option${option.description ? ` (${(0, __stryke_string_format_lower_case_first.lowerCaseFirst)(option.description).replace(/\.+$/, "")})` : ""}",
|
|
129
130
|
validate(val) {
|
|
130
|
-
if (isCancel(val)) {
|
|
131
|
-
return true;
|
|
132
|
-
}
|
|
133
131
|
if (!val || val.trim() === "") {
|
|
134
132
|
return "A value must be provided for this option";
|
|
135
133
|
}
|
|
@@ -152,8 +150,8 @@ function CommandEntry(props) {
|
|
|
152
150
|
},
|
|
153
151
|
get children() {
|
|
154
152
|
return __alloy_js_core.code`
|
|
155
|
-
options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, __stryke_string_format_camel_case.camelCase)(option.name)}`} = await
|
|
156
|
-
message:
|
|
153
|
+
options${option.name.includes("?") ? `["${option.name}"]` : `.${(0, __stryke_string_format_camel_case.camelCase)(option.name)}`} = await toggle({
|
|
154
|
+
message: "Please select a value for the "${option.name}" option${option.description ? ` (${(0, __stryke_string_format_lower_case_first.lowerCaseFirst)(option.description).replace(/\.+$/, "")})` : ""}"
|
|
157
155
|
});
|
|
158
156
|
`;
|
|
159
157
|
}
|
|
@@ -172,11 +170,8 @@ function CommandEntry(props) {
|
|
|
172
170
|
get children() {
|
|
173
171
|
return __alloy_js_core.code`
|
|
174
172
|
const value = await text({
|
|
175
|
-
message:
|
|
173
|
+
message: "Please provide one or more${option.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number ? " numeric" : ""} values for the \\"${option.name}\\" option${option.description ? ` (${(0, __stryke_string_format_lower_case_first.lowerCaseFirst)(option.description).replace(/\.+$/, "")})` : ""} - values are separated by a \\",\\" character",
|
|
176
174
|
validate(val) {
|
|
177
|
-
if (isCancel(val)) {
|
|
178
|
-
return true;
|
|
179
|
-
}
|
|
180
175
|
if (!val || val.trim() === "") {
|
|
181
176
|
return "A value must be provided for this option";
|
|
182
177
|
}
|
|
@@ -203,8 +198,7 @@ function CommandEntry(props) {
|
|
|
203
198
|
}
|
|
204
199
|
})]
|
|
205
200
|
}),
|
|
206
|
-
(0, __alloy_js_core_jsx_runtime.
|
|
207
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
201
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
208
202
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
209
203
|
get each() {
|
|
210
204
|
return command.arguments;
|
|
@@ -228,11 +222,8 @@ function CommandEntry(props) {
|
|
|
228
222
|
get children() {
|
|
229
223
|
return __alloy_js_core.code`
|
|
230
224
|
const value = await text({
|
|
231
|
-
message:
|
|
225
|
+
message: "Please provide a${argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number ? " numeric" : ""} value for the \\"${argument.name}\\" argument${argument.description ? ` (${(0, __stryke_string_format_lower_case_first.lowerCaseFirst)(argument.description).replace(/\.+$/, "")})` : ""}",
|
|
232
226
|
validate(val) {
|
|
233
|
-
if (isCancel(val)) {
|
|
234
|
-
return true;
|
|
235
|
-
}
|
|
236
227
|
if (!val || val.trim() === "") {
|
|
237
228
|
return "A value must be provided for this argument";
|
|
238
229
|
}
|
|
@@ -255,7 +246,7 @@ function CommandEntry(props) {
|
|
|
255
246
|
},
|
|
256
247
|
get children() {
|
|
257
248
|
return __alloy_js_core.code`
|
|
258
|
-
${(0, __stryke_string_format_camel_case.camelCase)(argument.name)} = await
|
|
249
|
+
${(0, __stryke_string_format_camel_case.camelCase)(argument.name)} = await toggle({
|
|
259
250
|
message: 'Please select a value for the "${argument.name}" argument${argument.description ? ` (${(0, __stryke_string_format_lower_case_first.lowerCaseFirst)(argument.description).replace(/\.+$/, "")})` : ""}:'
|
|
260
251
|
});
|
|
261
252
|
`;
|
|
@@ -275,11 +266,8 @@ function CommandEntry(props) {
|
|
|
275
266
|
get children() {
|
|
276
267
|
return __alloy_js_core.code`
|
|
277
268
|
const value = await text({
|
|
278
|
-
message:
|
|
269
|
+
message: "Please provide one or more${argument.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number ? " numeric" : ""} values for the \\"${argument.name}\\" argument${argument.description ? ` (${(0, __stryke_string_format_lower_case_first.lowerCaseFirst)(argument.description).replace(/\.+$/, "")})` : ""} - values are separated by a \\",\\" character",
|
|
279
270
|
validate(val) {
|
|
280
|
-
if (isCancel(val)) {
|
|
281
|
-
return true;
|
|
282
|
-
}
|
|
283
271
|
if (!val || val.trim() === "") {
|
|
284
272
|
return "A value must be provided for this argument";
|
|
285
273
|
}
|
|
@@ -307,11 +295,8 @@ function CommandEntry(props) {
|
|
|
307
295
|
}
|
|
308
296
|
})]
|
|
309
297
|
}),
|
|
310
|
-
__alloy_js_core.code`
|
|
311
|
-
|
|
312
|
-
writeLine(""); `,
|
|
313
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
314
|
-
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
298
|
+
__alloy_js_core.code`writeLine(""); `,
|
|
299
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {})
|
|
315
300
|
];
|
|
316
301
|
}
|
|
317
302
|
})];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-entry.d.cts","names":[],"sources":["../../src/components/command-entry.tsx"],"sourcesContent":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"command-entry.d.cts","names":[],"sources":["../../src/components/command-entry.tsx"],"sourcesContent":[],"mappings":";;;;;UA0CiB,iBAAA,SACP,KAAK;WACJ;;AAFX;;;AACU,iBAOM,YAAA,CAPN,KAAA,EAO0B,iBAP1B,CAAA,EAO2C,eAAA,CAAA,QAP3C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core9 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_core9.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":";;;;;
|
|
1
|
+
{"version":3,"file":"command-entry.d.mts","names":[],"sources":["../../src/components/command-entry.tsx"],"sourcesContent":[],"mappings":";;;;;UA0CiB,iBAAA,SACP,KAAK;WACJ;;AAFX;;;AACU,iBAOM,YAAA,CAPN,KAAA,EAO0B,iBAP1B,CAAA,EAO2C,eAAA,CAAA,QAP3C"}
|
|
@@ -6,6 +6,7 @@ import { ElseIfClause, IfStatement } from "@alloy-js/typescript";
|
|
|
6
6
|
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
7
7
|
import { isDynamicPathSegment } from "@shell-shock/core/plugin-utils/context-helpers";
|
|
8
8
|
import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
|
|
9
|
+
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
9
10
|
import { EntryFile } from "@powerlines/plugin-alloy/typescript/components/entry-file";
|
|
10
11
|
import { CommandHandlerDeclaration, CommandValidationLogic } from "@shell-shock/preset-script/components/command-entry";
|
|
11
12
|
import { findFilePath, relativePath } from "@stryke/path/find";
|
|
@@ -57,12 +58,7 @@ function CommandEntry(props) {
|
|
|
57
58
|
"colors",
|
|
58
59
|
"stripAnsi",
|
|
59
60
|
"writeLine",
|
|
60
|
-
"splitText"
|
|
61
|
-
"text",
|
|
62
|
-
"confirm",
|
|
63
|
-
"isCancel",
|
|
64
|
-
"intro",
|
|
65
|
-
"outro"
|
|
61
|
+
"splitText"
|
|
66
62
|
],
|
|
67
63
|
utils: [
|
|
68
64
|
"useApp",
|
|
@@ -73,6 +69,13 @@ function CommandEntry(props) {
|
|
|
73
69
|
"isHelp",
|
|
74
70
|
"isUnicodeSupported",
|
|
75
71
|
"internal_commandContext"
|
|
72
|
+
],
|
|
73
|
+
prompts: [
|
|
74
|
+
"text",
|
|
75
|
+
"toggle",
|
|
76
|
+
"select",
|
|
77
|
+
"isCancel",
|
|
78
|
+
"sleep"
|
|
76
79
|
]
|
|
77
80
|
});
|
|
78
81
|
},
|
|
@@ -83,6 +86,7 @@ function CommandEntry(props) {
|
|
|
83
86
|
createIntrinsic("hbr", {}),
|
|
84
87
|
createComponent(CommandHandlerDeclaration, {
|
|
85
88
|
command,
|
|
89
|
+
banner: code`await banner(); `,
|
|
86
90
|
get children() {
|
|
87
91
|
return [createComponent(IfStatement, {
|
|
88
92
|
condition: code`!isInteractive`,
|
|
@@ -95,11 +99,8 @@ function CommandEntry(props) {
|
|
|
95
99
|
},
|
|
96
100
|
get children() {
|
|
97
101
|
return [
|
|
98
|
-
code`writeLine("");
|
|
99
|
-
|
|
100
|
-
intro("Select required input parameters"); `,
|
|
101
|
-
createIntrinsic("hbr", {}),
|
|
102
|
-
createIntrinsic("hbr", {}),
|
|
102
|
+
code`writeLine(""); `,
|
|
103
|
+
createComponent(Spacing, {}),
|
|
103
104
|
createComponent(For, {
|
|
104
105
|
get each() {
|
|
105
106
|
return Object.values(command.options ?? {});
|
|
@@ -123,11 +124,8 @@ function CommandEntry(props) {
|
|
|
123
124
|
get children() {
|
|
124
125
|
return code`
|
|
125
126
|
const value = await text({
|
|
126
|
-
message:
|
|
127
|
+
message: "Please provide a${option.kind === ReflectionKind.number ? " numeric" : ""} value for the \\"${option.name}\\" option${option.description ? ` (${lowerCaseFirst(option.description).replace(/\.+$/, "")})` : ""}",
|
|
127
128
|
validate(val) {
|
|
128
|
-
if (isCancel(val)) {
|
|
129
|
-
return true;
|
|
130
|
-
}
|
|
131
129
|
if (!val || val.trim() === "") {
|
|
132
130
|
return "A value must be provided for this option";
|
|
133
131
|
}
|
|
@@ -150,8 +148,8 @@ function CommandEntry(props) {
|
|
|
150
148
|
},
|
|
151
149
|
get children() {
|
|
152
150
|
return code`
|
|
153
|
-
options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = await
|
|
154
|
-
message:
|
|
151
|
+
options${option.name.includes("?") ? `["${option.name}"]` : `.${camelCase(option.name)}`} = await toggle({
|
|
152
|
+
message: "Please select a value for the "${option.name}" option${option.description ? ` (${lowerCaseFirst(option.description).replace(/\.+$/, "")})` : ""}"
|
|
155
153
|
});
|
|
156
154
|
`;
|
|
157
155
|
}
|
|
@@ -170,11 +168,8 @@ function CommandEntry(props) {
|
|
|
170
168
|
get children() {
|
|
171
169
|
return code`
|
|
172
170
|
const value = await text({
|
|
173
|
-
message:
|
|
171
|
+
message: "Please provide one or more${option.kind === ReflectionKind.number ? " numeric" : ""} values for the \\"${option.name}\\" option${option.description ? ` (${lowerCaseFirst(option.description).replace(/\.+$/, "")})` : ""} - values are separated by a \\",\\" character",
|
|
174
172
|
validate(val) {
|
|
175
|
-
if (isCancel(val)) {
|
|
176
|
-
return true;
|
|
177
|
-
}
|
|
178
173
|
if (!val || val.trim() === "") {
|
|
179
174
|
return "A value must be provided for this option";
|
|
180
175
|
}
|
|
@@ -201,8 +196,7 @@ function CommandEntry(props) {
|
|
|
201
196
|
}
|
|
202
197
|
})]
|
|
203
198
|
}),
|
|
204
|
-
|
|
205
|
-
createIntrinsic("hbr", {}),
|
|
199
|
+
createComponent(Spacing, {}),
|
|
206
200
|
createComponent(For, {
|
|
207
201
|
get each() {
|
|
208
202
|
return command.arguments;
|
|
@@ -226,11 +220,8 @@ function CommandEntry(props) {
|
|
|
226
220
|
get children() {
|
|
227
221
|
return code`
|
|
228
222
|
const value = await text({
|
|
229
|
-
message:
|
|
223
|
+
message: "Please provide a${argument.kind === ReflectionKind.number ? " numeric" : ""} value for the \\"${argument.name}\\" argument${argument.description ? ` (${lowerCaseFirst(argument.description).replace(/\.+$/, "")})` : ""}",
|
|
230
224
|
validate(val) {
|
|
231
|
-
if (isCancel(val)) {
|
|
232
|
-
return true;
|
|
233
|
-
}
|
|
234
225
|
if (!val || val.trim() === "") {
|
|
235
226
|
return "A value must be provided for this argument";
|
|
236
227
|
}
|
|
@@ -253,7 +244,7 @@ function CommandEntry(props) {
|
|
|
253
244
|
},
|
|
254
245
|
get children() {
|
|
255
246
|
return code`
|
|
256
|
-
${camelCase(argument.name)} = await
|
|
247
|
+
${camelCase(argument.name)} = await toggle({
|
|
257
248
|
message: 'Please select a value for the "${argument.name}" argument${argument.description ? ` (${lowerCaseFirst(argument.description).replace(/\.+$/, "")})` : ""}:'
|
|
258
249
|
});
|
|
259
250
|
`;
|
|
@@ -273,11 +264,8 @@ function CommandEntry(props) {
|
|
|
273
264
|
get children() {
|
|
274
265
|
return code`
|
|
275
266
|
const value = await text({
|
|
276
|
-
message:
|
|
267
|
+
message: "Please provide one or more${argument.kind === ReflectionKind.number ? " numeric" : ""} values for the \\"${argument.name}\\" argument${argument.description ? ` (${lowerCaseFirst(argument.description).replace(/\.+$/, "")})` : ""} - values are separated by a \\",\\" character",
|
|
277
268
|
validate(val) {
|
|
278
|
-
if (isCancel(val)) {
|
|
279
|
-
return true;
|
|
280
|
-
}
|
|
281
269
|
if (!val || val.trim() === "") {
|
|
282
270
|
return "A value must be provided for this argument";
|
|
283
271
|
}
|
|
@@ -305,11 +293,8 @@ function CommandEntry(props) {
|
|
|
305
293
|
}
|
|
306
294
|
})]
|
|
307
295
|
}),
|
|
308
|
-
code`
|
|
309
|
-
|
|
310
|
-
writeLine(""); `,
|
|
311
|
-
createIntrinsic("hbr", {}),
|
|
312
|
-
createIntrinsic("hbr", {})
|
|
296
|
+
code`writeLine(""); `,
|
|
297
|
+
createComponent(Spacing, {})
|
|
313
298
|
];
|
|
314
299
|
}
|
|
315
300
|
})];
|