@shell-shock/preset-cli 0.7.4 → 0.7.6

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.
@@ -2,6 +2,7 @@ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
3
  let __alloy_js_core = require("@alloy-js/core");
4
4
  let __alloy_js_typescript = require("@alloy-js/typescript");
5
+ let __powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
5
6
  let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
6
7
  let __shell_shock_core_plugin_utils_context_helpers = require("@shell-shock/core/plugin-utils/context-helpers");
7
8
  let __shell_shock_plugin_theme_contexts_theme = require("@shell-shock/plugin-theme/contexts/theme");
@@ -42,33 +43,147 @@ function BannerFunctionDeclaration(props) {
42
43
  get doc() {
43
44
  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
45
  },
45
- parameters: [{
46
- name: "pause",
47
- type: "number",
48
- default: 500
49
- }],
46
+ get parameters() {
47
+ return [{
48
+ name: "pause",
49
+ type: "number",
50
+ default: 500
51
+ }, {
52
+ name: "upgradeCheck",
53
+ default: context.config.upgrade !== false ? "true" : "false"
54
+ }];
55
+ },
50
56
  get children() {
51
- return [(0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_banner_function_declaration.BannerFunctionBodyDeclaration, {
52
- get header() {
53
- return header.value;
54
- },
55
- get description() {
56
- return description.value;
57
- },
58
- get footer() {
59
- return footer.value;
60
- },
61
- variant,
62
- consoleFnName,
63
- command,
64
- get children() {
65
- return __alloy_js_core.code`const titleLines = [${titleLines.value.map((line) => JSON.stringify(line.trim())).join(", ")}];
57
+ return [
58
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_banner_function_declaration.BannerFunctionBodyDeclaration, {
59
+ get header() {
60
+ return header.value;
61
+ },
62
+ get description() {
63
+ return description.value;
64
+ },
65
+ get footer() {
66
+ return footer.value;
67
+ },
68
+ variant,
69
+ consoleFnName,
70
+ command,
71
+ get children() {
72
+ return __alloy_js_core.code`const titleLines = [${titleLines.value.map((line) => JSON.stringify(line.trim())).join(", ")}];
66
73
  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\`; `;
67
- }
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
- })];
74
+ }
75
+ }),
76
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
77
+ condition: __alloy_js_core.code`isInteractive && !isHelp`,
78
+ children: __alloy_js_core.code`await sleep(pause);`
79
+ }),
80
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
81
+ get when() {
82
+ return context.config.upgrade !== false;
83
+ },
84
+ get children() {
85
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
86
+ condition: __alloy_js_core.code`upgradeCheck && (await isCheckForUpdatesRequired())`,
87
+ get children() {
88
+ return [
89
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
90
+ "const": true,
91
+ name: "spinner",
92
+ initializer: __alloy_js_core.code`createSpinner({
93
+ message: "Checking for updates..."
94
+ }).start(); `
95
+ }),
96
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
97
+ "const": true,
98
+ name: "result",
99
+ initializer: __alloy_js_core.code`await checkForUpdates({ force: true }); `
100
+ }),
101
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
102
+ condition: __alloy_js_core.code`!result.isUpToDate`,
103
+ get children() {
104
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
105
+ get when() {
106
+ return context.config.upgrade !== false && (context.config.upgrade.type === "confirm" || context.config.upgrade.type === "manual");
107
+ },
108
+ get fallback() {
109
+ return [(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`spinner.stop();
110
+ info(\`A new version of ${(0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context, true)} is available: \${colors.red(\`v\${result.currentVersion}\`)} \${colors.text.body.tertiary("➜")} \${colors.green(\`v\${result.latestVersion}\`)}\${result.package.date ? colors.text.body.tertiary(\` (updated on \${result.package.date})\`) : ""}\`);
111
+
112
+ try {
113
+ await upgrade();
114
+ spinner.success("Update successful! Please restart the application to apply the update.");
115
+
116
+ writeLine("");
117
+ writeLine("Press any key to exit application...");
118
+
119
+ await waitForKeyPress();
120
+ return;
121
+ } catch (err) {
122
+ spinner.error(\`An error occurred while updating ${(0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context, true)} to v\${result.latestVersion}. Please try again later - if the problem persists, please contact support.\`);
123
+ debug(err);
124
+ } `), (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {})];
125
+ },
126
+ get children() {
127
+ return [
128
+ (0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`spinner.stop();
129
+ warn(\`A new version of ${(0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context, true)} is available: \${colors.red(\`v\${result.currentVersion}\`)} \${colors.text.body.tertiary("➜")} \${colors.green(\`v\${result.latestVersion}\`)}\${result.package.date ? colors.text.body.tertiary(\` (updated on \${result.package.date})\`) : ""}${context.config.upgrade !== false && context.config.upgrade.type === "manual" ? ` \\nPlease run \`${(0, __shell_shock_core_plugin_utils_context_helpers.getAppBin)(context)} update\` to upgrade to the latest version.` : ""}\`); `),
130
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
131
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
132
+ get when() {
133
+ return context.config.upgrade !== false && context.config.upgrade.type === "confirm";
134
+ },
135
+ get children() {
136
+ return __alloy_js_core.code`const willUpgradeNow = await confirm({
137
+ message: \`Would you like to update to v\${result.latestVersion} now?\`,
138
+ initialValue: true
139
+ });
140
+ if (isCancel(willUpgradeNow)) {
141
+ return;
142
+ }
143
+
144
+ if (willUpgradeNow) {
145
+ spinner.text = \`Updating ${(0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context, true)} to v\${result.latestVersion}...\`;
146
+ spinner.start();
147
+
148
+ try {
149
+ await upgrade();
150
+ spinner.success("Update successful! Please restart the application to apply the update.");
151
+
152
+ writeLine("");
153
+ writeLine("Press any key to exit application...");
154
+
155
+ await waitForKeyPress();
156
+ return;
157
+ } catch (err) {
158
+ spinner.error(\`An error occurred while updating ${(0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context, true)} to v\${result.latestVersion}. Please try again later - if the problem persists, please contact support.\`);
159
+ return { error: err };
160
+ }
161
+ } else {
162
+ help("Updates can be performed at any time by running the \`${(0, __shell_shock_core_plugin_utils_context_helpers.getAppBin)(context)} update\` command. Please remember that keeping your application up to date is important for ensuring you have the latest features, performance improvements, and security patches.");
163
+ } `;
164
+ }
165
+ })
166
+ ];
167
+ }
168
+ });
169
+ }
170
+ }),
171
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.ElseIfClause, {
172
+ condition: __alloy_js_core.code`result.isError`,
173
+ get children() {
174
+ return __alloy_js_core.code`spinner.error(\`An error occurred while checking for ${(0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context, true)} application updates. Please try again later - if the problem persists, please contact support.\`);
175
+ debug(result.error); `;
176
+ }
177
+ }),
178
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.ElseClause, { get children() {
179
+ return __alloy_js_core.code`spinner.success("Currently running the latest version of ${(0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context, true)}.");`;
180
+ } })
181
+ ];
182
+ }
183
+ });
184
+ }
185
+ })
186
+ ];
72
187
  }
73
188
  })];
74
189
  }
@@ -1,11 +1,11 @@
1
- import * as _alloy_js_core0 from "@alloy-js/core";
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): _alloy_js_core0.Children;
8
+ declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps): _alloy_js_core3.Children;
9
9
  //#endregion
10
10
  export { BannerFunctionDeclaration };
11
11
  //# sourceMappingURL=banner-function-declaration.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"banner-function-declaration.d.cts","names":[],"sources":["../../src/components/banner-function-declaration.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAkCgB,iBAAA,yBAAA,CACP,KAAA,EAAA,8BAA8B,CAAA,EAAA,eAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"banner-function-declaration.d.cts","names":[],"sources":["../../src/components/banner-function-declaration.tsx"],"sourcesContent":[],"mappings":";;;;;;;AA0CgB,iBAAA,yBAAA,CACP,KAAA,EAAA,8BAA8B,CAAA,EAAA,eAAA,CAAA,QAAA"}
@@ -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,eAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"banner-function-declaration.d.mts","names":[],"sources":["../../src/components/banner-function-declaration.tsx"],"sourcesContent":[],"mappings":";;;;;;;AA0CgB,iBAAA,yBAAA,CACP,KAAA,EAAA,8BAA8B,CAAA,EAAA,eAAA,CAAA,QAAA"}
@@ -1,8 +1,9 @@
1
1
  import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
2
- import { code, computed } from "@alloy-js/core";
3
- import { FunctionDeclaration, IfStatement } from "@alloy-js/typescript";
2
+ import { Show, code, computed } from "@alloy-js/core";
3
+ import { ElseClause, ElseIfClause, FunctionDeclaration, IfStatement, VarDeclaration } from "@alloy-js/typescript";
4
+ import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
4
5
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
5
- import { getAppDescription, getAppTitle } from "@shell-shock/core/plugin-utils/context-helpers";
6
+ import { getAppBin, getAppDescription, getAppTitle } from "@shell-shock/core/plugin-utils/context-helpers";
6
7
  import { useTheme } from "@shell-shock/plugin-theme/contexts/theme";
7
8
  import { BannerFunctionBodyDeclaration } from "@shell-shock/preset-script/components/banner-function-declaration";
8
9
  import { render } from "cfonts";
@@ -41,33 +42,147 @@ function BannerFunctionDeclaration(props) {
41
42
  get doc() {
42
43
  return `Write the ${getAppTitle(context, true)} application banner ${command ? `for the ${command.title} command ` : ""}to the console.`;
43
44
  },
44
- parameters: [{
45
- name: "pause",
46
- type: "number",
47
- default: 500
48
- }],
45
+ get parameters() {
46
+ return [{
47
+ name: "pause",
48
+ type: "number",
49
+ default: 500
50
+ }, {
51
+ name: "upgradeCheck",
52
+ default: context.config.upgrade !== false ? "true" : "false"
53
+ }];
54
+ },
49
55
  get children() {
50
- return [createComponent(BannerFunctionBodyDeclaration, {
51
- get header() {
52
- return header.value;
53
- },
54
- get description() {
55
- return description.value;
56
- },
57
- get footer() {
58
- return footer.value;
59
- },
60
- variant,
61
- consoleFnName,
62
- command,
63
- get children() {
64
- return code`const titleLines = [${titleLines.value.map((line) => JSON.stringify(line.trim())).join(", ")}];
56
+ return [
57
+ createComponent(BannerFunctionBodyDeclaration, {
58
+ get header() {
59
+ return header.value;
60
+ },
61
+ get description() {
62
+ return description.value;
63
+ },
64
+ get footer() {
65
+ return footer.value;
66
+ },
67
+ variant,
68
+ consoleFnName,
69
+ command,
70
+ get children() {
71
+ return code`const titleLines = [${titleLines.value.map((line) => JSON.stringify(line.trim())).join(", ")}];
65
72
  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\`; `;
66
- }
67
- }), createComponent(IfStatement, {
68
- condition: code`isInteractive && !isHelp`,
69
- children: code`await sleep(pause);`
70
- })];
73
+ }
74
+ }),
75
+ createComponent(IfStatement, {
76
+ condition: code`isInteractive && !isHelp`,
77
+ children: code`await sleep(pause);`
78
+ }),
79
+ createComponent(Show, {
80
+ get when() {
81
+ return context.config.upgrade !== false;
82
+ },
83
+ get children() {
84
+ return createComponent(IfStatement, {
85
+ condition: code`upgradeCheck && (await isCheckForUpdatesRequired())`,
86
+ get children() {
87
+ return [
88
+ createComponent(VarDeclaration, {
89
+ "const": true,
90
+ name: "spinner",
91
+ initializer: code`createSpinner({
92
+ message: "Checking for updates..."
93
+ }).start(); `
94
+ }),
95
+ createComponent(VarDeclaration, {
96
+ "const": true,
97
+ name: "result",
98
+ initializer: code`await checkForUpdates({ force: true }); `
99
+ }),
100
+ createComponent(IfStatement, {
101
+ condition: code`!result.isUpToDate`,
102
+ get children() {
103
+ return createComponent(Show, {
104
+ get when() {
105
+ return context.config.upgrade !== false && (context.config.upgrade.type === "confirm" || context.config.upgrade.type === "manual");
106
+ },
107
+ get fallback() {
108
+ return [memo(() => code`spinner.stop();
109
+ info(\`A new version of ${getAppTitle(context, true)} is available: \${colors.red(\`v\${result.currentVersion}\`)} \${colors.text.body.tertiary("➜")} \${colors.green(\`v\${result.latestVersion}\`)}\${result.package.date ? colors.text.body.tertiary(\` (updated on \${result.package.date})\`) : ""}\`);
110
+
111
+ try {
112
+ await upgrade();
113
+ spinner.success("Update successful! Please restart the application to apply the update.");
114
+
115
+ writeLine("");
116
+ writeLine("Press any key to exit application...");
117
+
118
+ await waitForKeyPress();
119
+ return;
120
+ } catch (err) {
121
+ spinner.error(\`An error occurred while updating ${getAppTitle(context, true)} to v\${result.latestVersion}. Please try again later - if the problem persists, please contact support.\`);
122
+ debug(err);
123
+ } `), createComponent(Spacing, {})];
124
+ },
125
+ get children() {
126
+ return [
127
+ memo(() => code`spinner.stop();
128
+ warn(\`A new version of ${getAppTitle(context, true)} is available: \${colors.red(\`v\${result.currentVersion}\`)} \${colors.text.body.tertiary("➜")} \${colors.green(\`v\${result.latestVersion}\`)}\${result.package.date ? colors.text.body.tertiary(\` (updated on \${result.package.date})\`) : ""}${context.config.upgrade !== false && context.config.upgrade.type === "manual" ? ` \\nPlease run \`${getAppBin(context)} update\` to upgrade to the latest version.` : ""}\`); `),
129
+ createComponent(Spacing, {}),
130
+ createComponent(Show, {
131
+ get when() {
132
+ return context.config.upgrade !== false && context.config.upgrade.type === "confirm";
133
+ },
134
+ get children() {
135
+ return code`const willUpgradeNow = await confirm({
136
+ message: \`Would you like to update to v\${result.latestVersion} now?\`,
137
+ initialValue: true
138
+ });
139
+ if (isCancel(willUpgradeNow)) {
140
+ return;
141
+ }
142
+
143
+ if (willUpgradeNow) {
144
+ spinner.text = \`Updating ${getAppTitle(context, true)} to v\${result.latestVersion}...\`;
145
+ spinner.start();
146
+
147
+ try {
148
+ await upgrade();
149
+ spinner.success("Update successful! Please restart the application to apply the update.");
150
+
151
+ writeLine("");
152
+ writeLine("Press any key to exit application...");
153
+
154
+ await waitForKeyPress();
155
+ return;
156
+ } catch (err) {
157
+ spinner.error(\`An error occurred while updating ${getAppTitle(context, true)} to v\${result.latestVersion}. Please try again later - if the problem persists, please contact support.\`);
158
+ return { error: err };
159
+ }
160
+ } else {
161
+ help("Updates can be performed at any time by running the \`${getAppBin(context)} update\` command. Please remember that keeping your application up to date is important for ensuring you have the latest features, performance improvements, and security patches.");
162
+ } `;
163
+ }
164
+ })
165
+ ];
166
+ }
167
+ });
168
+ }
169
+ }),
170
+ createComponent(ElseIfClause, {
171
+ condition: code`result.isError`,
172
+ get children() {
173
+ return code`spinner.error(\`An error occurred while checking for ${getAppTitle(context, true)} application updates. Please try again later - if the problem persists, please contact support.\`);
174
+ debug(result.error); `;
175
+ }
176
+ }),
177
+ createComponent(ElseClause, { get children() {
178
+ return code`spinner.success("Currently running the latest version of ${getAppTitle(context, true)}.");`;
179
+ } })
180
+ ];
181
+ }
182
+ });
183
+ }
184
+ })
185
+ ];
71
186
  }
72
187
  })];
73
188
  }
@@ -1 +1 @@
1
- {"version":3,"file":"banner-function-declaration.mjs","names":["code","computed","FunctionDeclaration","IfStatement","usePowerlines","getAppDescription","getAppTitle","useTheme","BannerFunctionBodyDeclaration","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 { useTheme } from \"@shell-shock/plugin-theme/contexts/theme\";\nimport type { BannerFunctionDeclarationProps } from \"@shell-shock/preset-script/components/banner-function-declaration\";\nimport { BannerFunctionBodyDeclaration } from \"@shell-shock/preset-script/components/banner-function-declaration\";\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,QAAQR,UAAU;CAExB,MAAMS,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,gBAC5DzC,+BAA6B;IAAA,IAC5BS,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"}
1
+ {"version":3,"file":"banner-function-declaration.mjs","names":["code","computed","Show","ElseClause","ElseIfClause","FunctionDeclaration","IfStatement","VarDeclaration","Spacing","usePowerlines","getAppBin","getAppDescription","getAppTitle","useTheme","BannerFunctionBodyDeclaration","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","config","upgrade","children","map","line","JSON","stringify","trim","join","condition","when","initializer","fallback","_$memo"],"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, Show } from \"@alloy-js/core\";\nimport {\n ElseClause,\n ElseIfClause,\n FunctionDeclaration,\n IfStatement,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n getAppBin,\n getAppDescription,\n getAppTitle\n} from \"@shell-shock/core/plugin-utils/context-helpers\";\nimport { useTheme } from \"@shell-shock/plugin-theme/contexts/theme\";\nimport type { BannerFunctionDeclarationProps } from \"@shell-shock/preset-script/components/banner-function-declaration\";\nimport { BannerFunctionBodyDeclaration } from \"@shell-shock/preset-script/components/banner-function-declaration\";\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={[\n { name: \"pause\", type: \"number\", default: 500 },\n {\n name: \"upgradeCheck\",\n default: context.config.upgrade !== false ? \"true\" : \"false\"\n }\n ]}>\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 <Show when={context.config.upgrade !== false}>\n <IfStatement\n condition={code`upgradeCheck && (await isCheckForUpdatesRequired())`}>\n <VarDeclaration\n const\n name=\"spinner\"\n initializer={code`createSpinner({\n message: \"Checking for updates...\"\n }).start(); `}\n />\n <VarDeclaration\n const\n name=\"result\"\n initializer={code`await checkForUpdates({ force: true }); `}\n />\n <IfStatement condition={code`!result.isUpToDate`}>\n <Show\n when={\n context.config.upgrade !== false &&\n (context.config.upgrade.type === \"confirm\" ||\n context.config.upgrade.type === \"manual\")\n }\n fallback={\n <>\n {code`spinner.stop();\n info(\\`A new version of ${getAppTitle(\n context,\n true\n )} is available: \\${colors.red(\\`v\\${result.currentVersion}\\`)} \\${colors.text.body.tertiary(\"➜\")} \\${colors.green(\\`v\\${result.latestVersion}\\`)}\\${result.package.date ? colors.text.body.tertiary(\\` (updated on \\${result.package.date})\\`) : \"\"}\\`);\n\n try {\n await upgrade();\n spinner.success(\"Update successful! Please restart the application to apply the update.\");\n\n writeLine(\"\");\n writeLine(\"Press any key to exit application...\");\n\n await waitForKeyPress();\n return;\n } catch (err) {\n spinner.error(\\`An error occurred while updating ${getAppTitle(\n context,\n true\n )} to v\\${result.latestVersion}. Please try again later - if the problem persists, please contact support.\\`);\n debug(err);\n } `}\n <Spacing />\n </>\n }>\n {code`spinner.stop();\n warn(\\`A new version of ${getAppTitle(\n context,\n true\n )} is available: \\${colors.red(\\`v\\${result.currentVersion}\\`)} \\${colors.text.body.tertiary(\"➜\")} \\${colors.green(\\`v\\${result.latestVersion}\\`)}\\${result.package.date ? colors.text.body.tertiary(\\` (updated on \\${result.package.date})\\`) : \"\"}${\n context.config.upgrade !== false &&\n context.config.upgrade.type === \"manual\"\n ? ` \\\\nPlease run \\`${getAppBin(\n context\n )} update\\` to upgrade to the latest version.`\n : \"\"\n }\\`); `}\n <Spacing />\n <Show\n when={\n context.config.upgrade !== false &&\n context.config.upgrade.type === \"confirm\"\n }>\n {code`const willUpgradeNow = await confirm({\n message: \\`Would you like to update to v\\${result.latestVersion} now?\\`,\n initialValue: true\n });\n if (isCancel(willUpgradeNow)) {\n return;\n }\n\n if (willUpgradeNow) {\n spinner.text = \\`Updating ${getAppTitle(\n context,\n true\n )} to v\\${result.latestVersion}...\\`;\n spinner.start();\n\n try {\n await upgrade();\n spinner.success(\"Update successful! Please restart the application to apply the update.\");\n\n writeLine(\"\");\n writeLine(\"Press any key to exit application...\");\n\n await waitForKeyPress();\n return;\n } catch (err) {\n spinner.error(\\`An error occurred while updating ${getAppTitle(\n context,\n true\n )} to v\\${result.latestVersion}. Please try again later - if the problem persists, please contact support.\\`);\n return { error: err };\n }\n } else {\n help(\"Updates can be performed at any time by running the \\`${getAppBin(\n context\n )} update\\` command. Please remember that keeping your application up to date is important for ensuring you have the latest features, performance improvements, and security patches.\");\n } `}\n </Show>\n </Show>\n </IfStatement>\n <ElseIfClause condition={code`result.isError`}>\n {code`spinner.error(\\`An error occurred while checking for ${getAppTitle(\n context,\n true\n )} application updates. Please try again later - if the problem persists, please contact support.\\`);\n debug(result.error); `}\n </ElseIfClause>\n <ElseClause>{code`spinner.success(\"Currently running the latest version of ${getAppTitle(\n context,\n true\n )}.\");`}</ElseClause>\n </IfStatement>\n </Show>\n </FunctionDeclaration>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AA0CA,SAAgBgB,0BACdC,OACA;CACA,MAAM,EAAEC,gBAAgB,OAAOC,UAAU,WAAWC,YAAYH;CAEhE,MAAMI,QAAQR,UAAU;CAExB,MAAMS,UAAUb,eAAiC;CAEjD,MAAMc,SAAStB,eAEX,GAAGoB,MAAMG,OAAOC,OAAOF,OAAOJ,YAAYP,YAAYU,QAAQ,CAAA,IAC5DA,QAAQI,YAAYC,WAAW,UAEpC;CACD,MAAMC,SAAS3B,eAAeoB,MAAMG,OAAOC,OAAOG,OAAOT,SAAS;CAClE,MAAMU,QAAQ5B,eACZW,YAAYU,SAAS,KAAK,CAACQ,QACzB,IAAIR,QAAQI,YAAYC,WAAW,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QACD,CAAA,+CACD,GAAE,OACD;cAAAiC,gBACN/C,SAAO,EAAA,CAAA;cAAA+C,gBACPrD,MAAI;eAAA,IACHsE,OAAI;AAAA,uBACFlD,QAAQwC,OAAOC,YAAY,SAC3BzC,QAAQwC,OAAOC,QAAQH,SAAS;;eAAS,IAAAI,WAAA;AAAA,uBAE1ChE,IAAI;;;;;;;;;8CASuBY,YAC1BU,SACA,KACD,CAAA;;;;;;;;;;;;;uEAaoDV,YACjDU,SACA,KACD,CAAA;;;;gFAI2DZ,UAC5DY,QACD,CAAA;;;eACA,CAAA;cAAA;;YAAA,CAAA;;UAAA,CAAA;SAAAiC,gBAINnD,cAAY;UAACmE,WAAWvE,IAAI;UAAgB,IAAAgE,WAAA;AAAA,kBAC1ChE,IAAI,wDAAwDY,YAC3DU,SACA,KACD,CAAA;;;UACqB,CAAA;SAAAiC,gBAEvBpD,YAAU,EAAA,IAAA6D,WAAA;AAAA,iBAAEhE,IAAI,4DAA4DY,YAC3EU,SACA,KACD,CAAA;YAAM,CAAA;SAAA;;OAAA,CAAA;;KAAA,CAAA;IAAA;;EAAA,CAAA,CAAA"}
@@ -4,10 +4,10 @@ const require_components_virtual_command_entry = require('./virtual-command-entr
4
4
  let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
5
5
  let __alloy_js_core = require("@alloy-js/core");
6
6
  let __alloy_js_typescript = require("@alloy-js/typescript");
7
+ let __powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
7
8
  let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
8
9
  let __shell_shock_core_plugin_utils_context_helpers = require("@shell-shock/core/plugin-utils/context-helpers");
9
10
  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");
11
11
  let __powerlines_plugin_alloy_typescript_components_entry_file = require("@powerlines/plugin-alloy/typescript/components/entry-file");
12
12
  let __shell_shock_preset_script_components_command_entry = require("@shell-shock/preset-script/components/command-entry");
13
13
  let __stryke_path_find = require("@stryke/path/find");
@@ -53,6 +53,8 @@ function CommandEntry(props) {
53
53
  ],
54
54
  console: [
55
55
  "debug",
56
+ "info",
57
+ "help",
56
58
  "warn",
57
59
  "error",
58
60
  "table",
@@ -76,8 +78,15 @@ function CommandEntry(props) {
76
78
  "numeric",
77
79
  "toggle",
78
80
  "select",
81
+ "confirm",
82
+ "waitForKeyPress",
79
83
  "isCancel",
80
84
  "sleep"
85
+ ],
86
+ upgrade: [
87
+ "checkForUpdates",
88
+ "isCheckForUpdatesRequired",
89
+ "upgrade"
81
90
  ]
82
91
  });
83
92
  },
@@ -1,4 +1,4 @@
1
- import * as _alloy_js_core1 from "@alloy-js/core";
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): _alloy_js_core1.Children;
12
+ declare function CommandEntry(props: CommandEntryProps): _alloy_js_core2.Children;
13
13
  //#endregion
14
14
  export { CommandEntry, CommandEntryProps };
15
15
  //# sourceMappingURL=command-entry.d.cts.map
@@ -3,10 +3,10 @@ import { VirtualCommandEntry } from "./virtual-command-entry.mjs";
3
3
  import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
4
4
  import { For, Match, Show, Switch, code, computed } from "@alloy-js/core";
5
5
  import { ElseIfClause, IfStatement } from "@alloy-js/typescript";
6
+ import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
6
7
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
7
8
  import { isDynamicPathSegment } from "@shell-shock/core/plugin-utils/context-helpers";
8
9
  import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
9
- import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
10
10
  import { EntryFile } from "@powerlines/plugin-alloy/typescript/components/entry-file";
11
11
  import { CommandHandlerDeclaration, CommandValidationLogic } from "@shell-shock/preset-script/components/command-entry";
12
12
  import { findFilePath, relativePath } from "@stryke/path/find";
@@ -51,6 +51,8 @@ function CommandEntry(props) {
51
51
  ],
52
52
  console: [
53
53
  "debug",
54
+ "info",
55
+ "help",
54
56
  "warn",
55
57
  "error",
56
58
  "table",
@@ -74,8 +76,15 @@ function CommandEntry(props) {
74
76
  "numeric",
75
77
  "toggle",
76
78
  "select",
79
+ "confirm",
80
+ "waitForKeyPress",
77
81
  "isCancel",
78
82
  "sleep"
83
+ ],
84
+ upgrade: [
85
+ "checkForUpdates",
86
+ "isCheckForUpdatesRequired",
87
+ "upgrade"
79
88
  ]
80
89
  });
81
90
  },
@@ -1 +1 @@
1
- {"version":3,"file":"command-entry.mjs","names":["code","computed","For","Match","Show","Switch","ElseIfClause","IfStatement","ReflectionKind","Spacing","usePowerlines","EntryFile","isDynamicPathSegment","CommandHandlerDeclaration","CommandValidationLogic","findFilePath","relativePath","joinPaths","replaceExtension","camelCase","pascalCase","defu","BannerFunctionDeclaration","VirtualCommandEntry","CommandEntry","props","command","imports","builtinImports","rest","context","filePath","segments","filter","segment","join","commandSourcePath","entryPath","value","entry","input","file","typeDefinition","output","id","_$createComponent","_$mergeProps","path","name","prompts","env","console","utils","children","_$createIntrinsic","banner","condition","when","Object","values","options","option","optional","length","arguments","argument","map","kind","string","number","variadic","includes","each","doubleHardline","description","boolean","child","isVirtual","fallback"],"sources":["../../src/components/command-entry.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed, For, Match, Show, Switch } from \"@alloy-js/core\";\nimport { ElseIfClause, IfStatement } from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { EntryFile } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { isDynamicPathSegment } from \"@shell-shock/core/plugin-utils/context-helpers\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport {\n CommandHandlerDeclaration,\n CommandValidationLogic\n} from \"@shell-shock/preset-script/components/command-entry\";\nimport { findFilePath, relativePath } from \"@stryke/path/find\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replaceExtension } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { CLIPresetContext } from \"../types/plugin\";\nimport { BannerFunctionDeclaration } from \"./banner-function-declaration\";\nimport { VirtualCommandEntry } from \"./virtual-command-entry\";\n\nexport interface CommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The command entry point for the Shell Shock project.\n */\nexport function CommandEntry(props: CommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<CLIPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n const commandSourcePath = computed(() =>\n replaceExtension(\n relativePath(\n joinPaths(context.entryPath, findFilePath(filePath.value)),\n command.entry.input?.file || command.entry.file\n )\n )\n );\n const typeDefinition = computed(() => ({\n ...command.entry,\n output: command.id\n }));\n\n return (\n <>\n <EntryFile\n {...rest}\n path={filePath.value}\n typeDefinition={typeDefinition.value}\n imports={defu(imports ?? {}, {\n [commandSourcePath.value]: `handle${pascalCase(command.name)}`,\n prompts: \"prompts\"\n })}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"env\", \"isDevelopment\", \"isDebug\"],\n console: [\n \"debug\",\n \"warn\",\n \"error\",\n \"table\",\n \"colors\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"hasFlag\",\n \"isMinimal\",\n \"isInteractive\",\n \"isHelp\",\n \"isUnicodeSupported\",\n \"internal_commandContext\"\n ],\n prompts: [\"text\", \"numeric\", \"toggle\", \"select\", \"isCancel\", \"sleep\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <hbr />\n <hbr />\n <CommandHandlerDeclaration\n command={command}\n banner={code`await banner(); `}>\n <IfStatement condition={code`!isInteractive`}>\n <CommandValidationLogic command={command} />\n </IfStatement>\n <Show\n when={\n Object.values(command.options ?? {}).filter(\n option => !option.optional\n ).length > 0 ||\n Object.values(command.arguments ?? {}).filter(\n argument => !argument.optional\n ).length > 0\n }>\n <ElseIfClause\n condition={code`!isHelp && (${Object.values(command.options ?? {})\n .filter(option => !option.optional)\n .map(option =>\n (option.kind === ReflectionKind.string ||\n option.kind === ReflectionKind.number) &&\n option.variadic\n ? `(!options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } || options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }.length === 0)`\n : `options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } === undefined`\n )\n .join(\" || \")}${\n Object.values(command.options ?? {}).filter(\n option => !option.optional\n ).length > 0 &&\n Object.values(command.arguments ?? {}).filter(\n argument => !argument.optional\n ).length > 0\n ? \" || \"\n : \"\"\n }${Object.values(command.arguments ?? {})\n .filter(argument => !argument.optional)\n .map(argument =>\n (argument.kind === ReflectionKind.string ||\n argument.kind === ReflectionKind.number) &&\n argument.variadic\n ? `(!${camelCase(\n argument.name\n )} || ${camelCase(argument.name)}.length === 0)`\n : `${camelCase(argument.name)} === undefined`\n )\n .join(\" || \")}) `}>\n {code`writeLine(\"\"); `}\n <Spacing />\n <For each={Object.values(command.options ?? {})} doubleHardline>\n {option => (\n <>\n <Show when={!option.optional}>\n <IfStatement\n condition={code`!options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }`}>\n <Switch>\n <Match\n when={option.kind === ReflectionKind.string}>{code`\n const value = await text({\n message: \"Please provide a value for the \\\\\"${option.name}\\\\\" option\",\n ${\n option.description\n ? `description: \"${option.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this option\";\n }\n\n return null;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value;\n `}</Match>\n <Match\n when={option.kind === ReflectionKind.number}>{code`\n const value = await numeric({\n message: \"Please provide a numeric value for the \\\\\"${option.name}\\\\\" option\",\n ${\n option.description\n ? `description: \"${option.description}\",\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value;\n `}</Match>\n <Match\n when={option.kind === ReflectionKind.boolean}>{code`\n const value = await toggle({\n message: \"Please select a value for the \\\\\"${\n option.name\n }\\\\\" option\",\n ${\n option.description\n ? `description: \"${option.description}\",\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value;\n `}</Match>\n </Switch>\n </IfStatement>\n <Show\n when={\n (option.kind === ReflectionKind.string ||\n option.kind === ReflectionKind.number) &&\n option.variadic\n }>\n <ElseIfClause\n condition={code`options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }.length === 0`}>\n {code`\n const value = await text({\n message: \"Please provide one or more${\n option.kind === ReflectionKind.number\n ? \" numeric\"\n : \"\"\n } values for the \\\\\"${option.name}\\\\\" option (values are separated by a \\\\\",\\\\\" character)\",\n ${\n option.description\n ? `description: \"${option.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this option\";\n }\n if (val.split(\",\").map(v => v.trim()).filter(Boolean).length === 0) {\n return \"At least one value must be provided for this option\";\n }\n ${\n option.kind === ReflectionKind.number\n ? `const invalidIndex = val.split(\",\").map(v => v.trim()).filter(Boolean).findIndex(v => Number.isNaN(Number(v));\n if (invalidIndex !== -1) {\n return \\`Invalid numeric value provided for item #\\${invalidIndex + 1} - all provided items must be a valid number\\`;\n } `\n : \"\"\n }\n return undefined;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value.split(\",\").map(value => value.trim()).filter(Boolean)${\n option.kind === ReflectionKind.number\n ? `.map(Number)`\n : \"\"\n } ;\n `}\n </ElseIfClause>\n </Show>\n </Show>\n </>\n )}\n </For>\n <Spacing />\n <For each={command.arguments} doubleHardline>\n {argument => (\n <>\n <Show when={!argument.optional}>\n <IfStatement\n condition={code`!${camelCase(argument.name)}`}>\n <Switch>\n <Match\n when={\n argument.kind === ReflectionKind.string\n }>{code`\n const value = await text({\n message: \"Please provide a value for the \\\\\"${argument.name}\\\\\" argument\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this argument\";\n }\n\n return null;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(argument.name)} = value;\n `}</Match>\n <Match\n when={\n argument.kind === ReflectionKind.number\n }>{code`\n const value = await numeric({\n message: \"Please provide a numeric value for the \\\\\"${argument.name}\\\\\" argument\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(argument.name)} = value;\n `}</Match>\n <Match\n when={\n argument.kind === ReflectionKind.boolean\n }>{code`\n const value = await toggle({\n message: \"Please select a value for the \\\\\"${argument.name}\\\\\" argument\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(argument.name)} = value;\n `}</Match>\n </Switch>\n </IfStatement>\n <Show\n when={\n (argument.kind === ReflectionKind.string ||\n argument.kind === ReflectionKind.number) &&\n argument.variadic\n }>\n <ElseIfClause\n condition={code`${camelCase(argument.name)}.length === 0`}>\n {code`\n const value = await text({\n message: \"Please provide one or more${\n argument.kind === ReflectionKind.number\n ? \" numeric\"\n : \"\"\n } (values are separated by a \\\\\",\\\\\" character)\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this argument\";\n }\n if (val.split(\",\").map(v => v.trim()).filter(Boolean).length === 0) {\n return \"At least one value must be provided for this argument\";\n }\n ${\n argument.kind === ReflectionKind.number\n ? `const invalidIndex = val.split(\",\").map(v => v.trim()).filter(Boolean).findIndex(v => Number.isNaN(Number(v));\n if (invalidIndex !== -1) {\n return \\`Invalid numeric value provided for item #\\${invalidIndex + 1} - all provided items must be a valid number\\`;\n } `\n : \"\"\n }\n\n return undefined;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(argument.name)} = value.split(\",\").map(value => value.trim()).filter(Boolean)${\n argument.kind === ReflectionKind.number\n ? `.map(Number)`\n : \"\"\n } ;\n `}\n </ElseIfClause>\n </Show>\n </Show>\n </>\n )}\n </For>\n {code`writeLine(\"\"); `}\n <Spacing />\n </ElseIfClause>\n </Show>\n </CommandHandlerDeclaration>\n </EntryFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmDA,SAAgBwB,aAAaC,OAA0B;CACrD,MAAM,EAAEC,SAASC,SAASC,gBAAgB,GAAGC,SAASJ;CAEtD,MAAMK,UAAUpB,eAAiC;CACjD,MAAMqB,WAAW9B,eACfgB,UACES,QAAQM,SACLC,QAAOC,YAAW,CAACtB,qBAAqBsB,QAAQ,CAAC,CACjDC,KAAK,IAAI,EACZ,WAEJ,CAAC;CACD,MAAMC,oBAAoBnC,eACxBiB,iBACEF,aACEC,UAAUa,QAAQO,WAAWtB,aAAagB,SAASO,MAAM,CAAC,EAC1DZ,QAAQa,MAAMC,OAAOC,QAAQf,QAAQa,MAAME,KAE/C,CACF,CAAC;CACD,MAAMC,iBAAiBzC,gBAAgB;EACrC,GAAGyB,QAAQa;EACXI,QAAQjB,QAAQkB;EACjB,EAAE;AAEH,QAAA,CAAAC,gBAEKlC,WAASmC,WACJjB,MAAI;EAAA,IACRkB,OAAI;AAAA,UAAEhB,SAASO;;EAAK,IACpBI,iBAAc;AAAA,UAAEA,eAAeJ;;EAAK,IACpCX,UAAO;AAAA,UAAEN,KAAKM,WAAW,EAAE,EAAE;KAC1BS,kBAAkBE,QAAQ,SAASlB,WAAWM,QAAQsB,KAAK;IAC5DC,SAAS;IACV,CAAC;;EAAA,IACFrB,iBAAc;AAAA,UAAEP,KAAKO,kBAAkB,EAAE,EAAE;IACzCsB,KAAK;KAAC;KAAO;KAAiB;KAAU;I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AAe6D,SAC7B,iBACA,GAAE;;;iBAET,CAAA;;eAAA,CAAA,CAAA;;aAAA,CAAA,CAAA;YAKV,CAAA;WAEFrE,IAAI;WAAiB6C,gBACrBpC,SAAO,EAAA,CAAA;WAAA;;SAAA,CAAA;;OAAA,CAAA,CAAA;;KAAA,CAAA;IAAA;;EAAA,CAAA,CAAA,EAAAoC,gBAKf3C,KAAG;EAAA,IAACsE,OAAI;AAAA,UAAEd,OAAOC,OAAOjC,QAAQ2B,SAAS;;EAAAA,WACvCuB,UAAK/B,gBACHzC,MAAI;GAAA,IACHqD,OAAI;AAAA,WAAEmB,MAAMC;;GAAS,IACrBC,WAAQ;AAAA,WAAAjC,gBAAGrB,cAAY,EAACE,SAASkD,OAAK,CAAA;;GAAA,IAAAvB,WAAA;AAAA,WAAAR,gBACrCtB,qBAAmB,EAACG,SAASkD,OAAK,CAAA;;GAAA,CAAA;EAEtC,CAAA,CAAA"}
1
+ {"version":3,"file":"command-entry.mjs","names":["code","computed","For","Match","Show","Switch","ElseIfClause","IfStatement","ReflectionKind","Spacing","usePowerlines","EntryFile","isDynamicPathSegment","CommandHandlerDeclaration","CommandValidationLogic","findFilePath","relativePath","joinPaths","replaceExtension","camelCase","pascalCase","defu","BannerFunctionDeclaration","VirtualCommandEntry","CommandEntry","props","command","imports","builtinImports","rest","context","filePath","segments","filter","segment","join","commandSourcePath","entryPath","value","entry","input","file","typeDefinition","output","id","_$createComponent","_$mergeProps","path","name","prompts","env","console","utils","upgrade","children","_$createIntrinsic","banner","condition","when","Object","values","options","option","optional","length","arguments","argument","map","kind","string","number","variadic","includes","each","doubleHardline","description","boolean","child","isVirtual","fallback"],"sources":["../../src/components/command-entry.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed, For, Match, Show, Switch } from \"@alloy-js/core\";\nimport { ElseIfClause, IfStatement } from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { EntryFile } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { isDynamicPathSegment } from \"@shell-shock/core/plugin-utils/context-helpers\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport {\n CommandHandlerDeclaration,\n CommandValidationLogic\n} from \"@shell-shock/preset-script/components/command-entry\";\nimport { findFilePath, relativePath } from \"@stryke/path/find\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replaceExtension } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { CLIPresetContext } from \"../types/plugin\";\nimport { BannerFunctionDeclaration } from \"./banner-function-declaration\";\nimport { VirtualCommandEntry } from \"./virtual-command-entry\";\n\nexport interface CommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The command entry point for the Shell Shock project.\n */\nexport function CommandEntry(props: CommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<CLIPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n const commandSourcePath = computed(() =>\n replaceExtension(\n relativePath(\n joinPaths(context.entryPath, findFilePath(filePath.value)),\n command.entry.input?.file || command.entry.file\n )\n )\n );\n const typeDefinition = computed(() => ({\n ...command.entry,\n output: command.id\n }));\n\n return (\n <>\n <EntryFile\n {...rest}\n path={filePath.value}\n typeDefinition={typeDefinition.value}\n imports={defu(imports ?? {}, {\n [commandSourcePath.value]: `handle${pascalCase(command.name)}`,\n prompts: \"prompts\"\n })}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"env\", \"isDevelopment\", \"isDebug\"],\n console: [\n \"debug\",\n \"info\",\n \"help\",\n \"warn\",\n \"error\",\n \"table\",\n \"colors\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"hasFlag\",\n \"isMinimal\",\n \"isInteractive\",\n \"isHelp\",\n \"isUnicodeSupported\",\n \"internal_commandContext\"\n ],\n prompts: [\n \"text\",\n \"numeric\",\n \"toggle\",\n \"select\",\n \"confirm\",\n \"waitForKeyPress\",\n \"isCancel\",\n \"sleep\"\n ],\n upgrade: [\"checkForUpdates\", \"isCheckForUpdatesRequired\", \"upgrade\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <hbr />\n <hbr />\n <CommandHandlerDeclaration\n command={command}\n banner={code`await banner(); `}>\n <IfStatement condition={code`!isInteractive`}>\n <CommandValidationLogic command={command} />\n </IfStatement>\n <Show\n when={\n Object.values(command.options ?? {}).filter(\n option => !option.optional\n ).length > 0 ||\n Object.values(command.arguments ?? {}).filter(\n argument => !argument.optional\n ).length > 0\n }>\n <ElseIfClause\n condition={code`!isHelp && (${Object.values(command.options ?? {})\n .filter(option => !option.optional)\n .map(option =>\n (option.kind === ReflectionKind.string ||\n option.kind === ReflectionKind.number) &&\n option.variadic\n ? `(!options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } || options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }.length === 0)`\n : `options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } === undefined`\n )\n .join(\" || \")}${\n Object.values(command.options ?? {}).filter(\n option => !option.optional\n ).length > 0 &&\n Object.values(command.arguments ?? {}).filter(\n argument => !argument.optional\n ).length > 0\n ? \" || \"\n : \"\"\n }${Object.values(command.arguments ?? {})\n .filter(argument => !argument.optional)\n .map(argument =>\n (argument.kind === ReflectionKind.string ||\n argument.kind === ReflectionKind.number) &&\n argument.variadic\n ? `(!${camelCase(\n argument.name\n )} || ${camelCase(argument.name)}.length === 0)`\n : `${camelCase(argument.name)} === undefined`\n )\n .join(\" || \")}) `}>\n {code`writeLine(\"\"); `}\n <Spacing />\n <For each={Object.values(command.options ?? {})} doubleHardline>\n {option => (\n <>\n <Show when={!option.optional}>\n <IfStatement\n condition={code`!options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }`}>\n <Switch>\n <Match\n when={option.kind === ReflectionKind.string}>{code`\n const value = await text({\n message: \"Please provide a value for the \\\\\"${option.name}\\\\\" option\",\n ${\n option.description\n ? `description: \"${option.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this option\";\n }\n\n return null;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value;\n `}</Match>\n <Match\n when={option.kind === ReflectionKind.number}>{code`\n const value = await numeric({\n message: \"Please provide a numeric value for the \\\\\"${option.name}\\\\\" option\",\n ${\n option.description\n ? `description: \"${option.description}\",\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value;\n `}</Match>\n <Match\n when={option.kind === ReflectionKind.boolean}>{code`\n const value = await toggle({\n message: \"Please select a value for the \\\\\"${\n option.name\n }\\\\\" option\",\n ${\n option.description\n ? `description: \"${option.description}\",\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value;\n `}</Match>\n </Switch>\n </IfStatement>\n <Show\n when={\n (option.kind === ReflectionKind.string ||\n option.kind === ReflectionKind.number) &&\n option.variadic\n }>\n <ElseIfClause\n condition={code`options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n }.length === 0`}>\n {code`\n const value = await text({\n message: \"Please provide one or more${\n option.kind === ReflectionKind.number\n ? \" numeric\"\n : \"\"\n } values for the \\\\\"${option.name}\\\\\" option (values are separated by a \\\\\",\\\\\" character)\",\n ${\n option.description\n ? `description: \"${option.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this option\";\n }\n if (val.split(\",\").map(v => v.trim()).filter(Boolean).length === 0) {\n return \"At least one value must be provided for this option\";\n }\n ${\n option.kind === ReflectionKind.number\n ? `const invalidIndex = val.split(\",\").map(v => v.trim()).filter(Boolean).findIndex(v => Number.isNaN(Number(v));\n if (invalidIndex !== -1) {\n return \\`Invalid numeric value provided for item #\\${invalidIndex + 1} - all provided items must be a valid number\\`;\n } `\n : \"\"\n }\n return undefined;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n options${\n option.name.includes(\"?\")\n ? `[\"${option.name}\"]`\n : `.${camelCase(option.name)}`\n } = value.split(\",\").map(value => value.trim()).filter(Boolean)${\n option.kind === ReflectionKind.number\n ? `.map(Number)`\n : \"\"\n } ;\n `}\n </ElseIfClause>\n </Show>\n </Show>\n </>\n )}\n </For>\n <Spacing />\n <For each={command.arguments} doubleHardline>\n {argument => (\n <>\n <Show when={!argument.optional}>\n <IfStatement\n condition={code`!${camelCase(argument.name)}`}>\n <Switch>\n <Match\n when={\n argument.kind === ReflectionKind.string\n }>{code`\n const value = await text({\n message: \"Please provide a value for the \\\\\"${argument.name}\\\\\" argument\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this argument\";\n }\n\n return null;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(argument.name)} = value;\n `}</Match>\n <Match\n when={\n argument.kind === ReflectionKind.number\n }>{code`\n const value = await numeric({\n message: \"Please provide a numeric value for the \\\\\"${argument.name}\\\\\" argument\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(argument.name)} = value;\n `}</Match>\n <Match\n when={\n argument.kind === ReflectionKind.boolean\n }>{code`\n const value = await toggle({\n message: \"Please select a value for the \\\\\"${argument.name}\\\\\" argument\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(argument.name)} = value;\n `}</Match>\n </Switch>\n </IfStatement>\n <Show\n when={\n (argument.kind === ReflectionKind.string ||\n argument.kind === ReflectionKind.number) &&\n argument.variadic\n }>\n <ElseIfClause\n condition={code`${camelCase(argument.name)}.length === 0`}>\n {code`\n const value = await text({\n message: \"Please provide one or more${\n argument.kind === ReflectionKind.number\n ? \" numeric\"\n : \"\"\n } (values are separated by a \\\\\",\\\\\" character)\",\n ${\n argument.description\n ? `description: \"${argument.description}\",\n `\n : \"\"\n }validate(val) {\n if (!val || val.trim() === \"\") {\n return \"A value must be provided for this argument\";\n }\n if (val.split(\",\").map(v => v.trim()).filter(Boolean).length === 0) {\n return \"At least one value must be provided for this argument\";\n }\n ${\n argument.kind === ReflectionKind.number\n ? `const invalidIndex = val.split(\",\").map(v => v.trim()).filter(Boolean).findIndex(v => Number.isNaN(Number(v));\n if (invalidIndex !== -1) {\n return \\`Invalid numeric value provided for item #\\${invalidIndex + 1} - all provided items must be a valid number\\`;\n } `\n : \"\"\n }\n\n return undefined;\n }\n });\n if (isCancel(value)) {\n return;\n }\n\n ${camelCase(argument.name)} = value.split(\",\").map(value => value.trim()).filter(Boolean)${\n argument.kind === ReflectionKind.number\n ? `.map(Number)`\n : \"\"\n } ;\n `}\n </ElseIfClause>\n </Show>\n </Show>\n </>\n )}\n </For>\n {code`writeLine(\"\"); `}\n <Spacing />\n </ElseIfClause>\n </Show>\n </CommandHandlerDeclaration>\n </EntryFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmDA,SAAgBwB,aAAaC,OAA0B;CACrD,MAAM,EAAEC,SAASC,SAASC,gBAAgB,GAAGC,SAASJ;CAEtD,MAAMK,UAAUpB,eAAiC;CACjD,MAAMqB,WAAW9B,eACfgB,UACES,QAAQM,SACLC,QAAOC,YAAW,CAACtB,qBAAqBsB,QAAQ,CAAC,CACjDC,KAAK,IAAI,EACZ,WAEJ,CAAC;CACD,MAAMC,oBAAoBnC,eACxBiB,iBACEF,aACEC,UAAUa,QAAQO,WAAWtB,aAAagB,SAASO,MAAM,CAAC,EAC1DZ,QAAQa,MAAMC,OAAOC,QAAQf,QAAQa,MAAME,KAE/C,CACF,CAAC;CACD,MAAMC,iBAAiBzC,gBAAgB;EACrC,GAAGyB,QAAQa;EACXI,QAAQjB,QAAQkB;EACjB,EAAE;AAEH,QAAA,CAAAC,gBAEKlC,WAASmC,WACJjB,MAAI;EAAA,IACRkB,OAAI;AAAA,UAAEhB,SAASO;;EAAK,IACpBI,iBAAc;AAAA,UAAEA,eAAeJ;;EAAK,IACpCX,UAAO;AAAA,UAAEN,KAAKM,WAAW,EAAE,EAAE;KAC1BS,kBAAkBE,QAAQ,SAASlB,WAAWM,QAAQsB,KAAK;IAC5DC,SAAS;IACV,CAAC;;EAAA,IACFrB,iBAAc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C,GAAE;;;;;;;kCASJT,SAASE,SAAS5D,eAAe8D,SAC7B;;;0CAIA,GAAE;;;;;;;;;8BAUVnD,UAAU+C,SAASlB,KAAK,CAAA,gEACxBkB,SAASE,SAAS5D,eAAe8D,SAC7B,iBACA,GAAE;;;iBAET,CAAA;;eAAA,CAAA,CAAA;;aAAA,CAAA,CAAA;YAKV,CAAA;WAEFtE,IAAI;WAAiB6C,gBACrBpC,SAAO,EAAA,CAAA;WAAA;;SAAA,CAAA;;OAAA,CAAA,CAAA;;KAAA,CAAA;IAAA;;EAAA,CAAA,CAAA,EAAAoC,gBAKf3C,KAAG;EAAA,IAACuE,OAAI;AAAA,UAAEd,OAAOC,OAAOlC,QAAQ4B,SAAS;;EAAAA,WACvCuB,UAAKhC,gBACHzC,MAAI;GAAA,IACHsD,OAAI;AAAA,WAAEmB,MAAMC;;GAAS,IACrBC,WAAQ;AAAA,WAAAlC,gBAAGrB,cAAY,EAACE,SAASmD,OAAK,CAAA;;GAAA,IAAAvB,WAAA;AAAA,WAAAT,gBACrCtB,qBAAmB,EAACG,SAASmD,OAAK,CAAA;;GAAA,CAAA;EAEtC,CAAA,CAAA"}
@@ -1,4 +1,4 @@
1
- import * as _alloy_js_core2 from "@alloy-js/core";
1
+ import * as _alloy_js_core0 from "@alloy-js/core";
2
2
  import { CommandTree } from "@shell-shock/core/types/command";
3
3
  import { CommandRouterProps } from "@shell-shock/preset-script/components/command-router";
4
4
 
@@ -6,11 +6,11 @@ import { CommandRouterProps } from "@shell-shock/preset-script/components/comman
6
6
  interface CommandRouterSelectOptionsProps {
7
7
  commands?: Record<string, CommandTree>;
8
8
  }
9
- declare function CommandRouterSelectOptions(props: CommandRouterSelectOptionsProps): _alloy_js_core2.Children;
9
+ declare function CommandRouterSelectOptions(props: CommandRouterSelectOptionsProps): _alloy_js_core0.Children;
10
10
  /**
11
11
  * A component that renders a command router interface, allowing users to select and execute commands from a provided list of commands and segments. This component serves as a wrapper around the base CommandRouter, adding additional UI elements and logic for command selection.
12
12
  */
13
- declare function CommandRouter(props: CommandRouterProps): _alloy_js_core2.Children;
13
+ declare function CommandRouter(props: CommandRouterProps): _alloy_js_core0.Children;
14
14
  //#endregion
15
15
  export { CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps };
16
16
  //# sourceMappingURL=command-router.d.cts.map
@@ -47,6 +47,7 @@ function VirtualCommandEntry(props) {
47
47
  console: [
48
48
  "warn",
49
49
  "error",
50
+ "info",
50
51
  "help",
51
52
  "table",
52
53
  "colors",
@@ -1,4 +1,4 @@
1
- import * as _alloy_js_core0 from "@alloy-js/core";
1
+ import * as _alloy_js_core1 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 VirtualCommandEntryProps extends Omit<EntryFileProps, "path" | "typeDe
9
9
  /**
10
10
  * The virtual command entry point for the Shell Shock project.
11
11
  */
12
- declare function VirtualCommandEntry(props: VirtualCommandEntryProps): _alloy_js_core0.Children;
12
+ declare function VirtualCommandEntry(props: VirtualCommandEntryProps): _alloy_js_core1.Children;
13
13
  //#endregion
14
14
  export { VirtualCommandEntry, VirtualCommandEntryProps };
15
15
  //# sourceMappingURL=virtual-command-entry.d.cts.map
@@ -45,6 +45,7 @@ function VirtualCommandEntry(props) {
45
45
  console: [
46
46
  "warn",
47
47
  "error",
48
+ "info",
48
49
  "help",
49
50
  "table",
50
51
  "colors",
@@ -1 +1 @@
1
- {"version":3,"file":"virtual-command-entry.mjs","names":["computed","For","Show","usePowerlines","TypescriptFile","isDynamicPathSegment","VirtualCommandHandlerDeclaration","joinPaths","pascalCase","defu","BannerFunctionDeclaration","CommandEntry","CommandRouter","VirtualCommandEntry","props","command","imports","builtinImports","rest","context","filePath","entryPath","segments","filter","segment","join","_$createComponent","_$mergeProps","path","value","didyoumean2","name","default","Object","entries","children","child","isVirtual","reduce","ret","alias","env","console","utils","prompts","_$createIntrinsic","commands","each","values","when","fallback"],"sources":["../../src/components/virtual-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 { computed, For, Show } from \"@alloy-js/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { TypescriptFileImports } from \"@powerlines/plugin-alloy/types/components\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript/components/typescript-file\";\nimport { isDynamicPathSegment } from \"@shell-shock/core/plugin-utils/context-helpers\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport { VirtualCommandHandlerDeclaration } from \"@shell-shock/preset-script/components/virtual-command-entry\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { CLIPresetContext } from \"../types/plugin\";\nimport { BannerFunctionDeclaration } from \"./banner-function-declaration\";\nimport { CommandEntry } from \"./command-entry\";\nimport { CommandRouter } from \"./command-router\";\n\nexport interface VirtualCommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The virtual command entry point for the Shell Shock project.\n */\nexport function VirtualCommandEntry(props: VirtualCommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<CLIPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n context.entryPath,\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n\n return (\n <>\n <TypescriptFile\n {...rest}\n path={filePath.value}\n imports={defu(\n {\n didyoumean2: [\n { name: \"didYouMean\", default: true },\n { name: \"ReturnTypeEnums\" },\n { name: \"ThresholdTypeEnums\" }\n ]\n },\n imports ?? {},\n Object.entries(command.children)\n .filter(([, child]) => child.isVirtual)\n .reduce((ret, [name, child]) => {\n ret[`./${child.name}`] = [\n { name: \"handler\", alias: `handle${pascalCase(name)}` }\n ];\n\n return ret;\n }, {} as TypescriptFileImports)\n )}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"isDevelopment\", \"isDebug\"],\n console: [\n \"warn\",\n \"error\",\n \"help\",\n \"table\",\n \"colors\",\n \"writeLine\",\n \"splitText\",\n \"stripAnsi\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"hasFlag\",\n \"isMinimal\",\n \"isUnicodeSupported\",\n \"isInteractive\",\n \"isHelp\"\n ],\n prompts: [\"text\", \"numeric\", \"toggle\", \"select\", \"isCancel\", \"sleep\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <hbr />\n <hbr />\n <VirtualCommandHandlerDeclaration command={command}>\n <CommandRouter\n segments={command.segments}\n commands={command.children}\n />\n </VirtualCommandHandlerDeclaration>\n </TypescriptFile>\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":";;;;;;;;;;;;;;;;;AA4CA,SAAgBa,oBAAoBC,OAAiC;CACnE,MAAM,EAAEC,SAASC,SAASC,gBAAgB,GAAGC,SAASJ;CAEtD,MAAMK,UAAUhB,eAAiC;CACjD,MAAMiB,WAAWpB,eACfO,UACEY,QAAQE,WACRN,QAAQO,SACLC,QAAOC,YAAW,CAACnB,qBAAqBmB,QAAQ,CAAC,CACjDC,KAAK,IAAI,EACZ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,OAAOe,OAAOjC,QAAQoB,SAAS;;EAAAA,WACvCC,UAAKV,gBACHxB,MAAI;GAAA,IACH+C,OAAI;AAAA,WAAEb,MAAMC;;GAAS,IACrBa,WAAQ;AAAA,WAAAxB,gBAAGf,cAAY,EAACI,SAASqB,OAAK,CAAA;;GAAA,IAAAD,WAAA;AAAA,WAAAT,gBACrCb,qBAAmB,EAACE,SAASqB,OAAK,CAAA;;GAAA,CAAA;EAEtC,CAAA,CAAA"}
1
+ {"version":3,"file":"virtual-command-entry.mjs","names":["computed","For","Show","usePowerlines","TypescriptFile","isDynamicPathSegment","VirtualCommandHandlerDeclaration","joinPaths","pascalCase","defu","BannerFunctionDeclaration","CommandEntry","CommandRouter","VirtualCommandEntry","props","command","imports","builtinImports","rest","context","filePath","entryPath","segments","filter","segment","join","_$createComponent","_$mergeProps","path","value","didyoumean2","name","default","Object","entries","children","child","isVirtual","reduce","ret","alias","env","console","utils","prompts","_$createIntrinsic","commands","each","values","when","fallback"],"sources":["../../src/components/virtual-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 { computed, For, Show } from \"@alloy-js/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { TypescriptFileImports } from \"@powerlines/plugin-alloy/types/components\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript/components/typescript-file\";\nimport { isDynamicPathSegment } from \"@shell-shock/core/plugin-utils/context-helpers\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport { VirtualCommandHandlerDeclaration } from \"@shell-shock/preset-script/components/virtual-command-entry\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { CLIPresetContext } from \"../types/plugin\";\nimport { BannerFunctionDeclaration } from \"./banner-function-declaration\";\nimport { CommandEntry } from \"./command-entry\";\nimport { CommandRouter } from \"./command-router\";\n\nexport interface VirtualCommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The virtual command entry point for the Shell Shock project.\n */\nexport function VirtualCommandEntry(props: VirtualCommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<CLIPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n context.entryPath,\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n\n return (\n <>\n <TypescriptFile\n {...rest}\n path={filePath.value}\n imports={defu(\n {\n didyoumean2: [\n { name: \"didYouMean\", default: true },\n { name: \"ReturnTypeEnums\" },\n { name: \"ThresholdTypeEnums\" }\n ]\n },\n imports ?? {},\n Object.entries(command.children)\n .filter(([, child]) => child.isVirtual)\n .reduce((ret, [name, child]) => {\n ret[`./${child.name}`] = [\n { name: \"handler\", alias: `handle${pascalCase(name)}` }\n ];\n\n return ret;\n }, {} as TypescriptFileImports)\n )}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"isDevelopment\", \"isDebug\"],\n console: [\n \"warn\",\n \"error\",\n \"info\",\n \"help\",\n \"table\",\n \"colors\",\n \"writeLine\",\n \"splitText\",\n \"stripAnsi\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"hasFlag\",\n \"isMinimal\",\n \"isUnicodeSupported\",\n \"isInteractive\",\n \"isHelp\"\n ],\n prompts: [\"text\", \"numeric\", \"toggle\", \"select\", \"isCancel\", \"sleep\"]\n })}>\n <BannerFunctionDeclaration command={command} />\n <hbr />\n <hbr />\n <VirtualCommandHandlerDeclaration command={command}>\n <CommandRouter\n segments={command.segments}\n commands={command.children}\n />\n </VirtualCommandHandlerDeclaration>\n </TypescriptFile>\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":";;;;;;;;;;;;;;;;;AA4CA,SAAgBa,oBAAoBC,OAAiC;CACnE,MAAM,EAAEC,SAASC,SAASC,gBAAgB,GAAGC,SAASJ;CAEtD,MAAMK,UAAUhB,eAAiC;CACjD,MAAMiB,WAAWpB,eACfO,UACEY,QAAQE,WACRN,QAAQO,SACLC,QAAOC,YAAW,CAACnB,qBAAqBmB,QAAQ,CAAC,CACjDC,KAAK,IAAI,EACZ,WAEJ,CAAC;AAED,QAAA,CAAAC,gBAEKtB,gBAAcuB,WACTT,MAAI;EAAA,IACRU,OAAI;AAAA,UAAER,SAASS;;EAAK,IACpBb,UAAO;AAAA,UAAEP,KACP,EACEqB,aAAa;IACX;KAAEC,MAAM;KAAcC,SAAS;KAAM;IACrC,EAAED,MAAM,mBAAmB;IAC3B,EAAEA,MAAM,sBAAsB;IAAA,EAEjC,EACDf,WAAW,EAAE,EACbiB,OAAOC,QAAQnB,QAAQoB,SAAS,CAC7BZ,QAAQ,GAAGa,WAAWA,MAAMC,UAAU,CACtCC,QAAQC,KAAK,CAACR,MAAMK,WAAW;AAC9BG,QAAI,KAAKH,MAAML,UAAU,CACvB;KAAEA,MAAM;KAAWS,OAAO,SAAShC,WAAWuB,KAAK;KAAI,CACxD;AAED,WAAOQ;MACN,EAA2B,CAClC,CAAC;;EAAA,IACDtB,iBAAc;AAAA,UAAER,KAAKQ,kBAAkB,EAAE,EAAE;IACzCwB,KAAK,CAAC,iBAAiB,UAAU;IACjCC,SAAS;KACP;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD;IACDC,OAAO;KACL;KACA;KACA;KACA;KACA;KACA;KACA;KACD;IACDC,SAAS;KAAC;KAAQ;KAAW;KAAU;KAAU;KAAY;KAAO;IACrE,CAAC;;EAAA,IAAAT,WAAA;AAAA,UAAA;IAAAT,gBACDhB,2BAAyB,EAAUK,SAAO,CAAA;IAAA8B,gBAAA,OAAA,EAAA,CAAA;IAAAA,gBAAA,OAAA,EAAA,CAAA;IAAAnB,gBAG1CpB,kCAAgC;KAAUS;KAAO,IAAAoB,WAAA;AAAA,aAAAT,gBAC/Cd,eAAa;OAAA,IACZU,WAAQ;AAAA,eAAEP,QAAQO;;OAAQ,IAC1BwB,WAAQ;AAAA,eAAE/B,QAAQoB;;OAAQ,CAAA;;KAAA,CAAA;IAAA;;EAAA,CAAA,CAAA,EAAAT,gBAI/BzB,KAAG;EAAA,IAAC8C,OAAI;AAAA,UAAEd,OAAOe,OAAOjC,QAAQoB,SAAS;;EAAAA,WACvCC,UAAKV,gBACHxB,MAAI;GAAA,IACH+C,OAAI;AAAA,WAAEb,MAAMC;;GAAS,IACrBa,WAAQ;AAAA,WAAAxB,gBAAGf,cAAY,EAACI,SAASqB,OAAK,CAAA;;GAAA,IAAAD,WAAA;AAAA,WAAAT,gBACrCb,qBAAmB,EAACE,SAASqB,OAAK,CAAA;;GAAA,CAAA;EAEtC,CAAA,CAAA"}
package/dist/index.cjs CHANGED
@@ -29,7 +29,7 @@ const plugin = (options = {}) => {
29
29
  return [
30
30
  (0, __shell_shock_plugin_console.default)(options),
31
31
  (0, __shell_shock_plugin_prompts.default)(options),
32
- (0, __shell_shock_plugin_upgrade.default)({ packageName: options.packageName }),
32
+ options.upgrade !== false && (0, __shell_shock_plugin_upgrade.default)(options.upgrade),
33
33
  {
34
34
  name: "shell-shock:cli-preset",
35
35
  config() {
@@ -54,12 +54,15 @@ const plugin = (options = {}) => {
54
54
  return (0, __powerlines_plugin_alloy_render.render)(this, [(0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_bin_entry.BinEntry, {
55
55
  builtinImports: {
56
56
  console: [
57
+ "info",
58
+ "warn",
59
+ "help",
60
+ "error",
57
61
  "divider",
58
62
  "stripAnsi",
59
63
  "writeLine",
60
64
  "splitText",
61
65
  "colors",
62
- "help",
63
66
  "writeLine",
64
67
  "splitText",
65
68
  "stripAnsi"
@@ -76,8 +79,15 @@ const plugin = (options = {}) => {
76
79
  "numeric",
77
80
  "toggle",
78
81
  "select",
82
+ "confirm",
83
+ "waitForKeyPress",
79
84
  "isCancel",
80
85
  "sleep"
86
+ ],
87
+ upgrade: [
88
+ "checkForUpdates",
89
+ "isCheckForUpdatesRequired",
90
+ "upgrade"
81
91
  ]
82
92
  },
83
93
  get prefix() {
@@ -113,7 +123,7 @@ const plugin = (options = {}) => {
113
123
  }
114
124
  }),
115
125
  (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
116
- __alloy_js_core.code`await banner(0);`,
126
+ __alloy_js_core.code`await banner(0, false);`,
117
127
  (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
118
128
  (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
119
129
  (0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_help.VirtualHelp, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAwCA;;;;AA8Gc,cA9GD,MA8GC,EAAA,CAAA,iBA9G0B,gBA8G1B,GA9G6C,gBA8G7C,CAAA,CAAA,OAAA,CAAA,EA7GH,gBA6GG,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA,EAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAwCA;;;;AAsHc,cAtHD,MAsHC,EAAA,CAAA,iBAtH0B,gBAsH1B,GAtH6C,gBAsH7C,CAAA,CAAA,OAAA,CAAA,EArHH,gBAqHG,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAwCA;;;;AA8Gc,cA9GD,MA8GC,EAAA,CAAA,iBA9G0B,gBA8G1B,GA9G6C,gBA8G7C,CAAA,CAAA,OAAA,CAAA,EA7GH,gBA6GG,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA,EAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAwCA;;;;AAsHc,cAtHD,MAsHC,EAAA,CAAA,iBAtH0B,gBAsH1B,GAtH6C,gBAsH7C,CAAA,CAAA,OAAA,CAAA,EArHH,gBAqHG,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA,EAAA"}
package/dist/index.mjs CHANGED
@@ -24,7 +24,7 @@ const plugin = (options = {}) => {
24
24
  return [
25
25
  console(options),
26
26
  prompts(options),
27
- upgrade({ packageName: options.packageName }),
27
+ options.upgrade !== false && upgrade(options.upgrade),
28
28
  {
29
29
  name: "shell-shock:cli-preset",
30
30
  config() {
@@ -49,12 +49,15 @@ const plugin = (options = {}) => {
49
49
  return render(this, [createComponent(BinEntry, {
50
50
  builtinImports: {
51
51
  console: [
52
+ "info",
53
+ "warn",
54
+ "help",
55
+ "error",
52
56
  "divider",
53
57
  "stripAnsi",
54
58
  "writeLine",
55
59
  "splitText",
56
60
  "colors",
57
- "help",
58
61
  "writeLine",
59
62
  "splitText",
60
63
  "stripAnsi"
@@ -71,8 +74,15 @@ const plugin = (options = {}) => {
71
74
  "numeric",
72
75
  "toggle",
73
76
  "select",
77
+ "confirm",
78
+ "waitForKeyPress",
74
79
  "isCancel",
75
80
  "sleep"
81
+ ],
82
+ upgrade: [
83
+ "checkForUpdates",
84
+ "isCheckForUpdatesRequired",
85
+ "upgrade"
76
86
  ]
77
87
  },
78
88
  get prefix() {
@@ -108,7 +118,7 @@ const plugin = (options = {}) => {
108
118
  }
109
119
  }),
110
120
  createIntrinsic("hbr", {}),
111
- code`await banner(0);`,
121
+ code`await banner(0, false);`,
112
122
  createIntrinsic("hbr", {}),
113
123
  createIntrinsic("hbr", {}),
114
124
  createComponent(VirtualHelp, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["code","For","Show","VarDeclaration","render","console","prompts","upgrade","BinEntry","VirtualHelp","BannerFunctionDeclaration","CommandEntry","CommandRouter","VirtualCommandEntry","getDefaultOptions","plugin","options","packageName","name","config","debug","defaultOptions","isCaseSensitive","configResolved","dependencies","didyoumean2","prepare","order","handler","_self$","_$createComponent","builtinImports","utils","prefix","_$createIntrinsic","children","when","Object","keys","commands","length","type","initializer","segments","values","each","doubleHardline","child","isVirtual","fallback","command"],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, For, Show } from \"@alloy-js/core\";\nimport { VarDeclaration } from \"@alloy-js/typescript\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport console from \"@shell-shock/plugin-console\";\nimport prompts from \"@shell-shock/plugin-prompts\";\nimport upgrade from \"@shell-shock/plugin-upgrade\";\nimport { BinEntry } from \"@shell-shock/preset-script/components/bin-entry\";\nimport { VirtualHelp } from \"@shell-shock/preset-script/components/help\";\nimport type { Plugin } from \"powerlines/types/plugin\";\nimport { BannerFunctionDeclaration } from \"./components/banner-function-declaration\";\nimport { CommandEntry } from \"./components/command-entry\";\nimport { CommandRouter } from \"./components/command-router\";\nimport { VirtualCommandEntry } from \"./components/virtual-command-entry\";\nimport { getDefaultOptions } from \"./helpers/get-default-options\";\nimport type { CLIPresetContext, CLIPresetOptions } from \"./types/plugin\";\n\n/**\n * The Shell Shock CLI Preset plugin.\n *\n * @remarks\n * This preset includes a set of built-in modules and commands to create a CLI application, as well as configuration options to customize the generated code. It also includes the `prompts` plugin to provide interactive prompts in the CLI application, and the `upgrade` plugin to manage upgrading the local application's version.\n */\nexport const plugin = <TContext extends CLIPresetContext = CLIPresetContext>(\n options: CLIPresetOptions = {}\n) => {\n return [\n console(options),\n prompts(options),\n upgrade({\n packageName: options.packageName\n }),\n {\n name: \"shell-shock:cli-preset\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `cli` preset.\"\n );\n\n return {\n defaultOptions: getDefaultOptions,\n isCaseSensitive: false,\n ...options\n };\n },\n configResolved() {\n this.dependencies.didyoumean2 = \"^7.0.4\";\n }\n },\n {\n name: \"shell-shock:cli-preset:generate-entrypoint\",\n prepare: {\n order: \"post\",\n async handler() {\n this.debug(\n \"Rendering entrypoint modules for the Shell Shock `cli` preset.\"\n );\n\n return render(\n this,\n <>\n <BinEntry\n builtinImports={{\n console: [\n \"divider\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\",\n \"colors\",\n \"help\",\n \"writeLine\",\n \"splitText\",\n \"stripAnsi\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"isMinimal\",\n \"isInteractive\",\n \"isHelp\"\n ],\n prompts: [\n \"text\",\n \"numeric\",\n \"toggle\",\n \"select\",\n \"isCancel\",\n \"sleep\"\n ]\n }}\n prefix={\n <>\n <BannerFunctionDeclaration />\n <hbr />\n <hbr />\n </>\n }>\n <Show when={Object.keys(this.commands).length > 0}>\n <VarDeclaration\n let\n name=\"args\"\n type=\"string[]\"\n initializer={code`useArgs();`}\n />\n <hbr />\n <CommandRouter segments={[]} commands={this.commands ?? {}} />\n <hbr />\n </Show>\n <hbr />\n {code`await banner(0);`}\n <hbr />\n <hbr />\n <VirtualHelp\n options={this.options}\n commands={this.commands ?? {}}\n />\n </BinEntry>\n <Show when={Object.values(this.commands).length > 0}>\n <For each={Object.values(this.commands)} doubleHardline>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </Show>\n </>\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAae,UACXC,UAA4B,EAAE,KAC3B;AACH,QAAO;EACLX,QAAQW,QAAQ;EAChBV,QAAQU,QAAQ;EAChBT,QAAQ,EACNU,aAAaD,QAAQC,aACtB,CAAC;EACF;GACEC,MAAM;GACNC,SAAS;AACP,SAAKC,MACH,oEACD;AAED,WAAO;KACLC,gBAAgBP;KAChBQ,iBAAiB;KACjB,GAAGN;KACJ;;GAEHO,iBAAiB;AACf,SAAKC,aAAaC,cAAc;;GAEnC;EACD;GACEP,MAAM;GACNQ,SAAS;IACPC,OAAO;IACP,MAAMC,UAAU;KAAA,MAAAC,SAAA;AACd,UAAKT,MACH,iEACD;AAED,YAAOhB,OACL,MAAI,CAAA0B,gBAEDtB,UAAQ;MACPuB,gBAAgB;OACd1B,SAAS;QACP;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACD;OACD2B,OAAO;QACL;QACA;QACA;QACA;QACA;QACD;OACD1B,SAAS;QACP;QACA;QACA;QACA;QACA;QACA;QAAO;OAEV;MAAA,IACD2B,SAAM;AAAA,cAAA;QAAAH,gBAEDpB,2BAAyB,EAAA,CAAA;QAAAwB,gBAAA,OAAA,EAAA,CAAA;QAAAA,gBAAA,OAAA,EAAA,CAAA;QAAA;;MAAA,IAAAC,WAAA;AAAA,cAAA;QAAAL,gBAK7B5B,MAAI;SAAA,IAACkC,OAAI;AAA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arDeclaration","render","console","prompts","upgrade","BinEntry","VirtualHelp","BannerFunctionDeclaration","CommandEntry","CommandRouter","VirtualCommandEntry","getDefaultOptions","plugin","options","name","config","debug","defaultOptions","isCaseSensitive","configResolved","dependencies","didyoumean2","prepare","order","handler","_self$","_$createComponent","builtinImports","utils","prefix","_$createIntrinsic","children","when","Object","keys","commands","length","type","initializer","segments","values","each","doubleHardline","child","isVirtual","fallback","command"],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, For, Show } from \"@alloy-js/core\";\nimport { VarDeclaration } from \"@alloy-js/typescript\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport console from \"@shell-shock/plugin-console\";\nimport prompts from \"@shell-shock/plugin-prompts\";\nimport upgrade from \"@shell-shock/plugin-upgrade\";\nimport { BinEntry } from \"@shell-shock/preset-script/components/bin-entry\";\nimport { VirtualHelp } from \"@shell-shock/preset-script/components/help\";\nimport type { Plugin } from \"powerlines/types/plugin\";\nimport { BannerFunctionDeclaration } from \"./components/banner-function-declaration\";\nimport { CommandEntry } from \"./components/command-entry\";\nimport { CommandRouter } from \"./components/command-router\";\nimport { VirtualCommandEntry } from \"./components/virtual-command-entry\";\nimport { getDefaultOptions } from \"./helpers/get-default-options\";\nimport type { CLIPresetContext, CLIPresetOptions } from \"./types/plugin\";\n\n/**\n * The Shell Shock CLI Preset plugin.\n *\n * @remarks\n * This preset includes a set of built-in modules and commands to create a CLI application, as well as configuration options to customize the generated code. It also includes the `prompts` plugin to provide interactive prompts in the CLI application, and the `upgrade` plugin to manage upgrading the local application's version.\n */\nexport const plugin = <TContext extends CLIPresetContext = CLIPresetContext>(\n options: CLIPresetOptions = {}\n) => {\n return [\n console(options),\n prompts(options),\n options.upgrade !== false && upgrade(options.upgrade),\n {\n name: \"shell-shock:cli-preset\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `cli` preset.\"\n );\n\n return {\n defaultOptions: getDefaultOptions,\n isCaseSensitive: false,\n ...options\n };\n },\n configResolved() {\n this.dependencies.didyoumean2 = \"^7.0.4\";\n }\n },\n {\n name: \"shell-shock:cli-preset:generate-entrypoint\",\n prepare: {\n order: \"post\",\n async handler() {\n this.debug(\n \"Rendering entrypoint modules for the Shell Shock `cli` preset.\"\n );\n\n return render(\n this,\n <>\n <BinEntry\n builtinImports={{\n console: [\n \"info\",\n \"warn\",\n \"help\",\n \"error\",\n \"divider\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\",\n \"colors\",\n \"writeLine\",\n \"splitText\",\n \"stripAnsi\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"isMinimal\",\n \"isInteractive\",\n \"isHelp\"\n ],\n prompts: [\n \"text\",\n \"numeric\",\n \"toggle\",\n \"select\",\n \"confirm\",\n \"waitForKeyPress\",\n \"isCancel\",\n \"sleep\"\n ],\n upgrade: [\n \"checkForUpdates\",\n \"isCheckForUpdatesRequired\",\n \"upgrade\"\n ]\n }}\n prefix={\n <>\n <BannerFunctionDeclaration />\n <hbr />\n <hbr />\n </>\n }>\n <Show when={Object.keys(this.commands).length > 0}>\n <VarDeclaration\n let\n name=\"args\"\n type=\"string[]\"\n initializer={code`useArgs();`}\n />\n <hbr />\n <CommandRouter segments={[]} commands={this.commands ?? {}} />\n <hbr />\n </Show>\n <hbr />\n {code`await banner(0, false);`}\n <hbr />\n <hbr />\n <VirtualHelp\n options={this.options}\n commands={this.commands ?? {}}\n />\n </BinEntry>\n <Show when={Object.values(this.commands).length > 0}>\n <For each={Object.values(this.commands)} doubleHardline>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </Show>\n </>\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAae,UACXC,UAA4B,EAAE,KAC3B;AACH,QAAO;EACLX,QAAQW,QAAQ;EAChBV,QAAQU,QAAQ;EAChBA,QAAQT,YAAY,SAASA,QAAQS,QAAQT,QAAQ;EACrD;GACEU,MAAM;GACNC,SAAS;AACP,SAAKC,MACH,oEACD;AAED,WAAO;KACLC,gBAAgBN;KAChBO,iBAAiB;KACjB,GAAGL;KACJ;;GAEHM,iBAAiB;AACf,SAAKC,aAAaC,cAAc;;GAEnC;EACD;GACEP,MAAM;GACNQ,SAAS;IACPC,OAAO;IACP,MAAMC,UAAU;KAAA,MAAAC,SAAA;AACd,UAAKT,MACH,iEACD;AAED,YAAOf,OACL,MAAI,CAAAyB,gBAEDrB,UAAQ;MACPsB,gBAAgB;OACdzB,SAAS;QACP;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACD;OACD0B,OAAO;QACL;QACA;QACA;QACA;QACA;QACD;OACDzB,SAAS;QACP;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACD;OACDC,SAAS;QACP;QACA;QACA;QAAS;OAEZ;MAAA,IACDyB,SAAM;AAAA,cAAA;QAAAH,gBAEDnB,2BAAyB,EAAA,CAAA;QAAAuB,gBAAA,OAAA,EAAA,CAAA;QAAAA,gBAAA,OAAA,EAAA,CAAA;QAAA;;MAAA,IAAAC,WAAA;AAAA,cAAA;QAAAL,gBAK7B3B,MAAI;SAAA,IAACiC,OAAI;AAAA,iBAAEC,OAAOC,KAAKT,OAAKU,SAAS,CAACC,SAAS;;SAAC,IAAAL,WAAA;AAAA,iBAAA;WAAAL,gBAC9C1B,gBAAc;YAAA,OAAA;YAEbc,MAAI;YACJuB,MAAI;YACJC,aAAazC,IAAI;YAAY,CAAA;WAAAiC,gBAAA,OAAA,EAAA,CAAA;WAAAJ,gBAG9BjB,eAAa;YAAC8B,UAAU,EAAE;YAAA,IAAEJ,WAAQ;AAAA,oBAAEV,OAAKU,YAAY,EAAE;;YAAA,CAAA;WAAAL,gBAAA,OAAA,EAAA,CAAA;WAAA;;SAAA,CAAA;QAAAA,gBAAA,OAAA,EAAA,CAAA;QAI3DjC,IAAI;QAAyBiC,gBAAA,OAAA,EAAA,CAAA;QAAAA,gBAAA,OAAA,EAAA,CAAA;QAAAJ,gBAG7BpB,aAAW;SAAA,IACVO,UAAO;AAAA,iBAAEY,OAAKZ;;SAAO,IACrBsB,WAAQ;AAAA,iBAAEV,OAAKU,YAAY,EAAE;;SAAA,CAAA;QAAA;;MAAA,CAAA,EAAAT,gBAGhC3B,MAAI;MAAA,IAACiC,OAAI;AAAA,cAAEC,OAAOO,OAAOf,OAAKU,SAAS,CAACC,SAAS;;MAAC,IAAAL,WAAA;AAAA,cAAAL,gBAChD5B,KAAG;QAAA,IAAC2C,OAAI;AAAA,gBAAER,OAAOO,OAAOf,OAAKU,SAAS;;QAAEO,gBAAc;QAAAX,WACpDY,UAAKjB,gBACH3B,MAAI;SAAA,IACHiC,OAAI;AAAA,iBAAEW,MAAMC;;SAAS,IACrBC,WAAQ;AAAA,iBAAAnB,gBAAGlB,cAAY,EAACsC,SAASH,OAAK,CAAA;;SAAA,IAAAZ,WAAA;AAAA,iBAAAL,gBACrChB,qBAAmB,EAACoC,SAASH,OAAK,CAAA;;SAAA,CAAA;QAEtC,CAAA;;MAAA,CAAA,CAIT,CAAC;;IAEL;GACD;EACF;;AAGH,kBAAe/B"}
@@ -1,2 +1,2 @@
1
- import { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig } from "./plugin.cjs";
2
- export { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig };
1
+ import { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUpgradeOptions, CLIPresetUserConfig, UpgradeType } from "./plugin.cjs";
2
+ export { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUpgradeOptions, CLIPresetUserConfig, UpgradeType };
@@ -1,2 +1,2 @@
1
- import { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig } from "./plugin.mjs";
2
- export { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig };
1
+ import { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUpgradeOptions, CLIPresetUserConfig, UpgradeType } from "./plugin.mjs";
2
+ export { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUpgradeOptions, CLIPresetUserConfig, UpgradeType };
@@ -1,11 +1,27 @@
1
1
  import { CommandBase, CommandOption } from "@shell-shock/core/types/command";
2
2
  import { Context } from "@shell-shock/core/types/context";
3
- import { ThemePluginResolvedConfig } from "@shell-shock/plugin-theme/types/plugin";
4
- import { UpgradePluginContext, UpgradePluginOptions, UpgradePluginResolvedConfig, UpgradePluginUserConfig } from "@shell-shock/plugin-upgrade/types/plugin";
3
+ import { PromptsPluginContext } from "@shell-shock/plugin-prompts/types/plugin";
4
+ import { ThemePluginResolvedConfig, ThemePluginUserConfig } from "@shell-shock/plugin-theme/types/plugin";
5
+ import { UpgradePluginOptions } from "@shell-shock/plugin-upgrade/types/plugin";
5
6
  import { ScriptPresetContext, ScriptPresetOptions, ScriptPresetResolvedConfig, ScriptPresetUserConfig } from "@shell-shock/preset-script/types/plugin";
6
7
 
7
8
  //#region src/types/plugin.d.ts
8
- type CLIPresetOptions = Omit<ScriptPresetOptions, "defaultOptions"> & UpgradePluginOptions & {
9
+ type UpgradeType = "confirm" | "auto" | "manual";
10
+ interface CLIPresetUpgradeOptions extends UpgradePluginOptions {
11
+ /**
12
+ * The type of upgrade to perform. This option determines how the upgrade process will be handled.
13
+ *
14
+ * @remarks
15
+ * The upgrade logic will behave differently based on the value of this field:
16
+ * - `"confirm"` - the user will be prompted to confirm the upgrade before it is performed. This is the default behavior and is recommended for most users, as it provides an extra layer of safety against unintended upgrades.
17
+ * - `"auto"` - the upgrade will be performed automatically without any user confirmation. This option is suitable for advanced users who want a seamless upgrade experience and are confident in the stability of new versions.
18
+ * - `"manual"` - the command will only display the latest available version without performing any upgrade. This option is useful for users who want to check for updates without making any changes to their system.
19
+ *
20
+ * @defaultValue "confirm"
21
+ */
22
+ type?: UpgradeType;
23
+ }
24
+ type CLIPresetOptions = Omit<ScriptPresetOptions, "defaultOptions"> & {
9
25
  /**
10
26
  * The default interactive mode to apply to commands.
11
27
  *
@@ -33,10 +49,25 @@ type CLIPresetOptions = Omit<ScriptPresetOptions, "defaultOptions"> & UpgradePlu
33
49
  * To disable the addition of these default options, set this property to `false`, or provide a custom set of options/a function that returns them.
34
50
  */
35
51
  defaultOptions?: CommandOption[] | ((context: Context, input: CommandBase) => CommandOption[]) | false;
52
+ /**
53
+ * Whether to include the upgrade process provided by the `@shell-shock/plugin-upgrade` package. If set to `true`, the upgrade command will be included with default options. If set to an object, the provided options will be used to configure the upgrade command. If set to `false`, the upgrade command will not be included.
54
+ *
55
+ * @remarks
56
+ * The upgrade command allows users to check for and perform upgrades to the latest version of the application. If you would like to include the upgrade command in your CLI application, but manage its configuration separately, you can set this field to `true` and configure the upgrade plugin directly in your application's configuration.
57
+ */
58
+ upgrade?: CLIPresetUpgradeOptions | false;
59
+ };
60
+ type CLIPresetUserConfig = ScriptPresetUserConfig & ThemePluginUserConfig & CLIPresetOptions;
61
+ type CLIPresetResolvedConfig = ScriptPresetResolvedConfig & ThemePluginResolvedConfig & Required<Pick<CLIPresetOptions, "interactive" | "defaultOptions">> & {
62
+ /**
63
+ * Whether to include the upgrade process provided by the `@shell-shock/plugin-upgrade` package. If not set to `false`, the upgrade command will be included with default options. If set to an object, the provided options will be used to configure the upgrade command. If set to `false`, the upgrade command will not be included.
64
+ *
65
+ * @remarks
66
+ * The upgrade command allows users to check for and perform upgrades to the latest version of the application. If you would like to include the upgrade command in your CLI application, but manage its configuration separately, you can set this field to `true` and configure the upgrade plugin directly in your application's configuration.
67
+ */
68
+ upgrade: Required<CLIPresetUpgradeOptions> | false;
36
69
  };
37
- type CLIPresetUserConfig = ScriptPresetUserConfig & UpgradePluginUserConfig & CLIPresetOptions;
38
- type CLIPresetResolvedConfig = ScriptPresetResolvedConfig & UpgradePluginResolvedConfig & Required<Omit<CLIPresetOptions, "theme">> & Pick<ThemePluginResolvedConfig, "theme">;
39
- type CLIPresetContext<TResolvedConfig extends CLIPresetResolvedConfig = CLIPresetResolvedConfig> = ScriptPresetContext<TResolvedConfig> & UpgradePluginContext<TResolvedConfig>;
70
+ type CLIPresetContext<TResolvedConfig extends CLIPresetResolvedConfig = CLIPresetResolvedConfig> = PromptsPluginContext & ScriptPresetContext<TResolvedConfig>;
40
71
  //#endregion
41
- export { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig };
72
+ export { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUpgradeOptions, CLIPresetUserConfig, UpgradeType };
42
73
  //# sourceMappingURL=plugin.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;KAqCY,gBAAA,GAAmB,KAAK,yCAClC;;AADF;;;;;;;;;AAmCA;EAAkC,WAAA,CAAA,EAAA,OAAA,GAAA,OAAA;EAChC;;;AAGF;;;;;;;;;AAKA;;EACoD,cAAA,CAAA,EAf5C,aAe4C,EAAA,GAAA,CAAA,CAAA,OAAA,EAdjC,OAciC,EAAA,KAAA,EAdjB,WAciB,EAAA,GAdD,aAcC,EAAA,CAAA,GAAA,KAAA;CAC5B;AAApB,KAXQ,mBAAA,GAAsB,sBAW9B,GAVF,uBAUE,GATF,gBASE;AACmB,KARX,uBAAA,GAA0B,0BAQf,GAPrB,2BAOqB,GANrB,QAMqB,CANZ,IAMY,CANP,gBAMO,EAAA,OAAA,CAAA,CAAA,GALrB,IAKqB,CALhB,yBAKgB,EAAA,OAAA,CAAA;AAArB,KAHU,gBAGV,CAAA,wBAFwB,uBAExB,GAFkD,uBAElD,CAAA,GADE,mBACF,CADsB,eACtB,CAAA,GAAA,oBAAA,CAAqB,eAArB,CAAA"}
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;;KAoCY,WAAA;UAEK,uBAAA,SAAgC;EAFrC;AAEZ;AAeA;;;;;;;;;EA0CY,IAAA,CAAA,EA7CH,WA6CG;;AACV,KA3CU,gBAAA,GAAmB,IA2C7B,CA3CkC,mBA2ClC,EAAA,gBAAA,CAAA,GAAA;EACA;;AAEF;;;;;;;;;EAYY,WAAA,CAAA,EAAA,OAAgB,GAAA,OAAA;EACF;;;;;;;;;;;;;;mBA9BpB,6BACW,gBAAgB,gBAAgB;;;;;;;YASrC;;KAGA,mBAAA,GAAsB,yBAChC,wBACA;KAEU,uBAAA,GAA0B,6BACpC,4BACA,SAAS,KAAK;;;;;;;WAOH,SAAS;;KAGV,yCACc,0BAA0B,2BAChD,uBAAuB,oBAAoB"}
@@ -1,11 +1,27 @@
1
1
  import { CommandBase, CommandOption } from "@shell-shock/core/types/command";
2
2
  import { Context } from "@shell-shock/core/types/context";
3
- import { ThemePluginResolvedConfig } from "@shell-shock/plugin-theme/types/plugin";
4
- import { UpgradePluginContext, UpgradePluginOptions, UpgradePluginResolvedConfig, UpgradePluginUserConfig } from "@shell-shock/plugin-upgrade/types/plugin";
3
+ import { PromptsPluginContext } from "@shell-shock/plugin-prompts/types/plugin";
4
+ import { ThemePluginResolvedConfig, ThemePluginUserConfig } from "@shell-shock/plugin-theme/types/plugin";
5
+ import { UpgradePluginOptions } from "@shell-shock/plugin-upgrade/types/plugin";
5
6
  import { ScriptPresetContext, ScriptPresetOptions, ScriptPresetResolvedConfig, ScriptPresetUserConfig } from "@shell-shock/preset-script/types/plugin";
6
7
 
7
8
  //#region src/types/plugin.d.ts
8
- type CLIPresetOptions = Omit<ScriptPresetOptions, "defaultOptions"> & UpgradePluginOptions & {
9
+ type UpgradeType = "confirm" | "auto" | "manual";
10
+ interface CLIPresetUpgradeOptions extends UpgradePluginOptions {
11
+ /**
12
+ * The type of upgrade to perform. This option determines how the upgrade process will be handled.
13
+ *
14
+ * @remarks
15
+ * The upgrade logic will behave differently based on the value of this field:
16
+ * - `"confirm"` - the user will be prompted to confirm the upgrade before it is performed. This is the default behavior and is recommended for most users, as it provides an extra layer of safety against unintended upgrades.
17
+ * - `"auto"` - the upgrade will be performed automatically without any user confirmation. This option is suitable for advanced users who want a seamless upgrade experience and are confident in the stability of new versions.
18
+ * - `"manual"` - the command will only display the latest available version without performing any upgrade. This option is useful for users who want to check for updates without making any changes to their system.
19
+ *
20
+ * @defaultValue "confirm"
21
+ */
22
+ type?: UpgradeType;
23
+ }
24
+ type CLIPresetOptions = Omit<ScriptPresetOptions, "defaultOptions"> & {
9
25
  /**
10
26
  * The default interactive mode to apply to commands.
11
27
  *
@@ -33,10 +49,25 @@ type CLIPresetOptions = Omit<ScriptPresetOptions, "defaultOptions"> & UpgradePlu
33
49
  * To disable the addition of these default options, set this property to `false`, or provide a custom set of options/a function that returns them.
34
50
  */
35
51
  defaultOptions?: CommandOption[] | ((context: Context, input: CommandBase) => CommandOption[]) | false;
52
+ /**
53
+ * Whether to include the upgrade process provided by the `@shell-shock/plugin-upgrade` package. If set to `true`, the upgrade command will be included with default options. If set to an object, the provided options will be used to configure the upgrade command. If set to `false`, the upgrade command will not be included.
54
+ *
55
+ * @remarks
56
+ * The upgrade command allows users to check for and perform upgrades to the latest version of the application. If you would like to include the upgrade command in your CLI application, but manage its configuration separately, you can set this field to `true` and configure the upgrade plugin directly in your application's configuration.
57
+ */
58
+ upgrade?: CLIPresetUpgradeOptions | false;
59
+ };
60
+ type CLIPresetUserConfig = ScriptPresetUserConfig & ThemePluginUserConfig & CLIPresetOptions;
61
+ type CLIPresetResolvedConfig = ScriptPresetResolvedConfig & ThemePluginResolvedConfig & Required<Pick<CLIPresetOptions, "interactive" | "defaultOptions">> & {
62
+ /**
63
+ * Whether to include the upgrade process provided by the `@shell-shock/plugin-upgrade` package. If not set to `false`, the upgrade command will be included with default options. If set to an object, the provided options will be used to configure the upgrade command. If set to `false`, the upgrade command will not be included.
64
+ *
65
+ * @remarks
66
+ * The upgrade command allows users to check for and perform upgrades to the latest version of the application. If you would like to include the upgrade command in your CLI application, but manage its configuration separately, you can set this field to `true` and configure the upgrade plugin directly in your application's configuration.
67
+ */
68
+ upgrade: Required<CLIPresetUpgradeOptions> | false;
36
69
  };
37
- type CLIPresetUserConfig = ScriptPresetUserConfig & UpgradePluginUserConfig & CLIPresetOptions;
38
- type CLIPresetResolvedConfig = ScriptPresetResolvedConfig & UpgradePluginResolvedConfig & Required<Omit<CLIPresetOptions, "theme">> & Pick<ThemePluginResolvedConfig, "theme">;
39
- type CLIPresetContext<TResolvedConfig extends CLIPresetResolvedConfig = CLIPresetResolvedConfig> = ScriptPresetContext<TResolvedConfig> & UpgradePluginContext<TResolvedConfig>;
70
+ type CLIPresetContext<TResolvedConfig extends CLIPresetResolvedConfig = CLIPresetResolvedConfig> = PromptsPluginContext & ScriptPresetContext<TResolvedConfig>;
40
71
  //#endregion
41
- export { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig };
72
+ export { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUpgradeOptions, CLIPresetUserConfig, UpgradeType };
42
73
  //# sourceMappingURL=plugin.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;KAqCY,gBAAA,GAAmB,KAAK,yCAClC;;AADF;;;;;;;;;AAmCA;EAAkC,WAAA,CAAA,EAAA,OAAA,GAAA,OAAA;EAChC;;;AAGF;;;;;;;;;AAKA;;EACoD,cAAA,CAAA,EAf5C,aAe4C,EAAA,GAAA,CAAA,CAAA,OAAA,EAdjC,OAciC,EAAA,KAAA,EAdjB,WAciB,EAAA,GAdD,aAcC,EAAA,CAAA,GAAA,KAAA;CAC5B;AAApB,KAXQ,mBAAA,GAAsB,sBAW9B,GAVF,uBAUE,GATF,gBASE;AACmB,KARX,uBAAA,GAA0B,0BAQf,GAPrB,2BAOqB,GANrB,QAMqB,CANZ,IAMY,CANP,gBAMO,EAAA,OAAA,CAAA,CAAA,GALrB,IAKqB,CALhB,yBAKgB,EAAA,OAAA,CAAA;AAArB,KAHU,gBAGV,CAAA,wBAFwB,uBAExB,GAFkD,uBAElD,CAAA,GADE,mBACF,CADsB,eACtB,CAAA,GAAA,oBAAA,CAAqB,eAArB,CAAA"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;;KAoCY,WAAA;UAEK,uBAAA,SAAgC;EAFrC;AAEZ;AAeA;;;;;;;;;EA0CY,IAAA,CAAA,EA7CH,WA6CG;;AACV,KA3CU,gBAAA,GAAmB,IA2C7B,CA3CkC,mBA2ClC,EAAA,gBAAA,CAAA,GAAA;EACA;;AAEF;;;;;;;;;EAYY,WAAA,CAAA,EAAA,OAAgB,GAAA,OAAA;EACF;;;;;;;;;;;;;;mBA9BpB,6BACW,gBAAgB,gBAAgB;;;;;;;YASrC;;KAGA,mBAAA,GAAsB,yBAChC,wBACA;KAEU,uBAAA,GAA0B,6BACpC,4BACA,SAAS,KAAK;;;;;;;WAOH,SAAS;;KAGV,yCACc,0BAA0B,2BAChD,uBAAuB,oBAAoB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/preset-cli",
3
- "version": "0.7.4",
3
+ "version": "0.7.6",
4
4
  "type": "module",
5
5
  "description": "A package containing a Shell Shock plugin to generate source code given a list design tokens.",
6
6
  "repository": {
@@ -167,20 +167,20 @@
167
167
  "dependencies": {
168
168
  "@alloy-js/core": "0.23.0-dev.8",
169
169
  "@alloy-js/typescript": "0.23.0-dev.4",
170
- "@powerlines/deepkit": "^0.6.67",
171
- "@powerlines/plugin-alloy": "^0.23.17",
172
- "@powerlines/plugin-plugin": "^0.12.238",
173
- "@shell-shock/core": "^0.9.0",
174
- "@shell-shock/plugin-console": "^0.0.4",
175
- "@shell-shock/plugin-prompts": "^0.2.3",
176
- "@shell-shock/plugin-theme": "^0.3.2",
177
- "@shell-shock/plugin-upgrade": "^0.1.4",
178
- "@shell-shock/preset-script": "^0.6.13",
170
+ "@powerlines/deepkit": "^0.6.68",
171
+ "@powerlines/plugin-alloy": "^0.23.18",
172
+ "@powerlines/plugin-plugin": "^0.12.239",
173
+ "@shell-shock/core": "^0.9.2",
174
+ "@shell-shock/plugin-console": "^0.1.0",
175
+ "@shell-shock/plugin-prompts": "^0.3.1",
176
+ "@shell-shock/plugin-theme": "^0.3.4",
177
+ "@shell-shock/plugin-upgrade": "^0.1.6",
178
+ "@shell-shock/preset-script": "^0.6.15",
179
179
  "@stryke/path": "0.26.6",
180
180
  "@stryke/string-format": "0.14.2",
181
181
  "cfonts": "^3.3.1",
182
182
  "defu": "6.1.4",
183
- "powerlines": "^0.38.54"
183
+ "powerlines": "^0.38.55"
184
184
  },
185
185
  "devDependencies": {
186
186
  "@babel/core": "^7.29.0",
@@ -210,5 +210,5 @@
210
210
  "./package.json": "./package.json"
211
211
  }
212
212
  },
213
- "gitHead": "cfda8730b7dac0e89647907af8bdf83635eee335"
213
+ "gitHead": "a31a7a7e812f31a59f19cf31f8175d9c15a50e82"
214
214
  }