@shell-shock/preset-cli 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/components/banner-function-declaration.cjs +1 -1
  2. package/dist/components/banner-function-declaration.mjs +1 -1
  3. package/dist/components/banner-function-declaration.mjs.map +1 -1
  4. package/dist/components/command-entry.cjs +5 -5
  5. package/dist/components/command-entry.mjs +4 -4
  6. package/dist/components/command-router.d.cts +3 -3
  7. package/dist/components/command-router.d.cts.map +1 -1
  8. package/dist/components/index.cjs +0 -9
  9. package/dist/components/index.d.cts +1 -2
  10. package/dist/components/index.d.mts +1 -2
  11. package/dist/components/index.mjs +1 -2
  12. package/dist/components/virtual-command-entry.cjs +3 -3
  13. package/dist/components/virtual-command-entry.d.cts +2 -2
  14. package/dist/components/virtual-command-entry.mjs +2 -2
  15. package/dist/index.cjs +7 -9
  16. package/dist/index.mjs +5 -9
  17. package/dist/index.mjs.map +1 -1
  18. package/package.json +11 -23
  19. package/dist/components/prompts-builtin.cjs +0 -2729
  20. package/dist/components/prompts-builtin.d.cts +0 -40
  21. package/dist/components/prompts-builtin.d.cts.map +0 -1
  22. package/dist/components/prompts-builtin.d.mts +0 -40
  23. package/dist/components/prompts-builtin.d.mts.map +0 -1
  24. package/dist/components/prompts-builtin.mjs +0 -2721
  25. package/dist/components/prompts-builtin.mjs.map +0 -1
  26. package/dist/plugin-upgrade/dist/components/index.cjs +0 -2
  27. package/dist/plugin-upgrade/dist/components/index.mjs +0 -4
  28. package/dist/plugin-upgrade/dist/components/upgrade-builtin.cjs +0 -661
  29. package/dist/plugin-upgrade/dist/components/upgrade-builtin.mjs +0 -655
  30. package/dist/plugin-upgrade/dist/components/upgrade-builtin.mjs.map +0 -1
  31. package/dist/plugin-upgrade/dist/components/upgrade-command.cjs +0 -96
  32. package/dist/plugin-upgrade/dist/components/upgrade-command.mjs +0 -96
  33. package/dist/plugin-upgrade/dist/components/upgrade-command.mjs.map +0 -1
  34. package/dist/plugin-upgrade/dist/index.cjs +0 -49
  35. package/dist/plugin-upgrade/dist/index.mjs +0 -49
  36. package/dist/plugin-upgrade/dist/index.mjs.map +0 -1
@@ -16,7 +16,7 @@ function BannerFunctionDeclaration(props) {
16
16
  const { consoleFnName = "log", variant = "primary", command } = props;
17
17
  const theme = (0, __shell_shock_preset_script_contexts_theme.useTheme)();
18
18
  const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
19
- const header = (0, __alloy_js_core.computed)(() => `${theme.labels.banner.header[variant] || (0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context, false)} v${context.packageJson.version || "1.0.0"}`);
19
+ const header = (0, __alloy_js_core.computed)(() => `${theme.labels.banner.header[variant] || (0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context)} v${context.packageJson.version || "1.0.0"}`);
20
20
  const footer = (0, __alloy_js_core.computed)(() => theme.labels.banner.footer[variant]);
21
21
  const title = (0, __alloy_js_core.computed)(() => (0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context, true).replace(`v${context.packageJson.version || "1.0.0"}`, ""));
22
22
  const description = (0, __alloy_js_core.computed)(() => command?.description || (0, __shell_shock_core_plugin_utils_context_helpers.getAppDescription)(context));
@@ -15,7 +15,7 @@ function BannerFunctionDeclaration(props) {
15
15
  const { consoleFnName = "log", variant = "primary", command } = props;
16
16
  const theme = useTheme();
17
17
  const context = usePowerlines();
18
- const header = computed(() => `${theme.labels.banner.header[variant] || getAppTitle(context, false)} v${context.packageJson.version || "1.0.0"}`);
18
+ const header = computed(() => `${theme.labels.banner.header[variant] || getAppTitle(context)} v${context.packageJson.version || "1.0.0"}`);
19
19
  const footer = computed(() => theme.labels.banner.footer[variant]);
20
20
  const title = computed(() => getAppTitle(context, true).replace(`v${context.packageJson.version || "1.0.0"}`, ""));
21
21
  const description = computed(() => command?.description || getAppDescription(context));
@@ -1 +1 @@
1
- {"version":3,"file":"banner-function-declaration.mjs","names":["code","computed","FunctionDeclaration","IfStatement","usePowerlines","getAppDescription","getAppTitle","BannerFunctionBodyDeclaration","useTheme","render","BannerFunctionDeclaration","props","consoleFnName","variant","command","theme","context","header","labels","banner","packageJson","version","footer","title","replace","description","titleLines","result","font","align","background","letterSpacing","lineHeight","gradient","transitionGradient","env","array","bannerPadding","Math","max","padding","app","borderStyles","outline","left","length","right","totalPadding","value","_$createComponent","async","name","doc","parameters","type","default","children","map","line","JSON","stringify","trim","join","condition"],"sources":["../../src/components/banner-function-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed } from \"@alloy-js/core\";\nimport { FunctionDeclaration, IfStatement } from \"@alloy-js/typescript\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n getAppDescription,\n getAppTitle\n} from \"@shell-shock/core/plugin-utils/context-helpers\";\nimport type { BannerFunctionDeclarationProps } from \"@shell-shock/preset-script/components/banner-function-declaration\";\nimport { BannerFunctionBodyDeclaration } from \"@shell-shock/preset-script/components/banner-function-declaration\";\nimport { useTheme } from \"@shell-shock/preset-script/contexts/theme\";\nimport { render } from \"cfonts\";\nimport type { CLIPresetContext } from \"../types/plugin\";\n\n/**\n * A component to generate the `banner` function in the `shell-shock:console` builtin module.\n */\nexport function BannerFunctionDeclaration(\n props: BannerFunctionDeclarationProps\n) {\n const { consoleFnName = \"log\", variant = \"primary\", command } = props;\n\n const theme = useTheme();\n\n const context = usePowerlines<CLIPresetContext>();\n\n const header = computed(\n () =>\n `${theme.labels.banner.header[variant] || getAppTitle(context, false)} 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,EAA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AEpD8B,YAAY,CAAC;GAAEF,MAAM;GAASG,MAAM;GAAUC,SAAS;GAAK,CAAC;EAAA,IAAAC,WAAA;AAAA,UAAA,CAAAP,gBAC5D1C,+BAA6B;IAAA,IAC5BU,SAAM;AAAA,YAAEA,OAAO+B;;IAAK,IACpBvB,cAAW;AAAA,YAAEA,YAAYuB;;IAAK,IAC9B1B,SAAM;AAAA,YAAEA,OAAO0B;;IACNnC;IACMD;IACNE;IAAO,IAAA0C,WAAA;AAAA,YACfxD,IAAI,uBAAuB0B,WAAWsB,MACpCS,KAAIC,SAAQC,KAAKC,UAAUF,KAAKG,MAAM,CAAC,CAAC,CACxCC,KAAK,KAAK,CAAA;wHAEbf,aAAaC,MAAK,UACTzB,MAAMyB,MAAK;;IAA4C,CAAA,EAAAC,gBAEjE9C,aAAW;IAAC4D,WAAW/D,IAAI;IAA0BwD,UACnDxD,IAAI;IAAqB,CAAA,CAAA;;EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"banner-function-declaration.mjs","names":["code","computed","FunctionDeclaration","IfStatement","usePowerlines","getAppDescription","getAppTitle","BannerFunctionBodyDeclaration","useTheme","render","BannerFunctionDeclaration","props","consoleFnName","variant","command","theme","context","header","labels","banner","packageJson","version","footer","title","replace","description","titleLines","result","font","align","background","letterSpacing","lineHeight","gradient","transitionGradient","env","array","bannerPadding","Math","max","padding","app","borderStyles","outline","left","length","right","totalPadding","value","_$createComponent","async","name","doc","parameters","type","default","children","map","line","JSON","stringify","trim","join","condition"],"sources":["../../src/components/banner-function-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed } from \"@alloy-js/core\";\nimport { FunctionDeclaration, IfStatement } from \"@alloy-js/typescript\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n getAppDescription,\n getAppTitle\n} from \"@shell-shock/core/plugin-utils/context-helpers\";\nimport type { BannerFunctionDeclarationProps } from \"@shell-shock/preset-script/components/banner-function-declaration\";\nimport { BannerFunctionBodyDeclaration } from \"@shell-shock/preset-script/components/banner-function-declaration\";\nimport { useTheme } from \"@shell-shock/preset-script/contexts/theme\";\nimport { render } from \"cfonts\";\nimport type { CLIPresetContext } from \"../types/plugin\";\n\n/**\n * A component to generate the `banner` function in the `shell-shock:console` builtin module.\n */\nexport function BannerFunctionDeclaration(\n props: BannerFunctionDeclarationProps\n) {\n const { consoleFnName = \"log\", variant = \"primary\", command } = props;\n\n const theme = useTheme();\n\n const context = usePowerlines<CLIPresetContext>();\n\n const header = computed(\n () =>\n `${theme.labels.banner.header[variant] || getAppTitle(context)} v${\n context.packageJson.version || \"1.0.0\"\n }`\n );\n const footer = computed(() => theme.labels.banner.footer[variant]);\n const title = computed(() =>\n getAppTitle(context, true).replace(\n `v${context.packageJson.version || \"1.0.0\"}`,\n \"\"\n )\n );\n const description = computed(\n () => command?.description || getAppDescription(context)\n );\n\n const titleLines = computed(() => {\n const result = render(getAppTitle(context, true), {\n font: \"tiny\",\n align: \"left\",\n background: \"transparent\",\n letterSpacing: 1,\n lineHeight: 1,\n gradient: false,\n transitionGradient: false,\n env: \"node\"\n });\n if (!result) {\n return [`${getAppTitle(context, true)} Command-Line Interface`];\n }\n\n return result.array;\n });\n\n const bannerPadding = computed(\n () =>\n Math.max(theme.padding.app, 0) * 2 +\n theme.borderStyles.banner.outline[variant].left.length +\n theme.borderStyles.banner.outline[variant].right.length\n );\n const totalPadding = computed(\n () => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value\n );\n\n return (\n <>\n <FunctionDeclaration\n async\n name=\"banner\"\n doc={`Write the ${getAppTitle(context, true)} application banner ${\n command ? `for the ${command.title} command ` : \"\"\n }to the console.`}\n parameters={[{ name: \"pause\", type: \"number\", default: 500 }]}>\n <BannerFunctionBodyDeclaration\n header={header.value}\n description={description.value}\n footer={footer.value}\n variant={variant}\n consoleFnName={consoleFnName}\n command={command}>\n {code`const titleLines = [${titleLines.value\n .map(line => JSON.stringify(line.trim()))\n .join(\", \")}];\n const title = Math.max(...titleLines.map(line => stripAnsi(line).length)) > Math.max(process.stdout.columns - ${\n totalPadding.value\n }, 0) ? \"${title.value}\" : \\`\\\\n\\${titleLines.join(\"\\\\n\")}\\\\n\\`; `}\n </BannerFunctionBodyDeclaration>\n <IfStatement condition={code`isInteractive && !isHelp`}>\n {code`await sleep(pause);`}\n </IfStatement>\n </FunctionDeclaration>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAkCA,SAAgBU,0BACdC,OACA;CACA,MAAM,EAAEC,gBAAgB,OAAOC,UAAU,WAAWC,YAAYH;CAEhE,MAAMI,QAAQP,UAAU;CAExB,MAAMQ,UAAUZ,eAAiC;CAEjD,MAAMa,SAAShB,eAEX,GAAGc,MAAMG,OAAOC,OAAOF,OAAOJ,YAAYP,YAAYU,QAAQ,CAAA,IAC5DA,QAAQI,YAAYC,WAAW,UAEpC;CACD,MAAMC,SAASrB,eAAec,MAAMG,OAAOC,OAAOG,OAAOT,SAAS;CAClE,MAAMU,QAAQtB,eACZK,YAAYU,SAAS,KAAK,CAACQ,QACzB,IAAIR,QAAQI,YAAYC,WAAW,WACnC,GAEJ,CAAC;CACD,MAAMI,cAAcxB,eACZa,SAASW,eAAepB,kBAAkBW,QAClD,CAAC;CAED,MAAMU,aAAazB,eAAe;EAChC,MAAM0B,SAASlB,OAAOH,YAAYU,SAAS,KAAK,EAAE;GAChDY,MAAM;GACNC,OAAO;GACPC,YAAY;GACZC,eAAe;GACfC,YAAY;GACZC,UAAU;GACV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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");
8
- let defu = require("defu");
9
- defu = require_rolldown_runtime.__toESM(defu);
10
- let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
11
7
  let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
12
- let __stryke_path_join = require("@stryke/path/join");
13
8
  let __shell_shock_core_plugin_utils_context_helpers = require("@shell-shock/core/plugin-utils/context-helpers");
9
+ let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
10
+ let __powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
14
11
  let __powerlines_plugin_alloy_typescript_components_entry_file = require("@powerlines/plugin-alloy/typescript/components/entry-file");
15
12
  let __shell_shock_preset_script_components_command_entry = require("@shell-shock/preset-script/components/command-entry");
16
13
  let __stryke_path_find = require("@stryke/path/find");
14
+ let __stryke_path_join = require("@stryke/path/join");
17
15
  let __stryke_path_replace = require("@stryke/path/replace");
18
16
  let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
19
17
  let __stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
18
+ let defu = require("defu");
19
+ defu = require_rolldown_runtime.__toESM(defu);
20
20
 
21
21
  //#region src/components/command-entry.tsx
22
22
  /**
@@ -3,18 +3,18 @@ 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";
7
- import defu from "defu";
8
- import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
9
6
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
10
- import { joinPaths } from "@stryke/path/join";
11
7
  import { isDynamicPathSegment } from "@shell-shock/core/plugin-utils/context-helpers";
8
+ import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
9
+ import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
12
10
  import { EntryFile } from "@powerlines/plugin-alloy/typescript/components/entry-file";
13
11
  import { CommandHandlerDeclaration, CommandValidationLogic } from "@shell-shock/preset-script/components/command-entry";
14
12
  import { findFilePath, relativePath } from "@stryke/path/find";
13
+ import { joinPaths } from "@stryke/path/join";
15
14
  import { replaceExtension } from "@stryke/path/replace";
16
15
  import { camelCase } from "@stryke/string-format/camel-case";
17
16
  import { pascalCase } from "@stryke/string-format/pascal-case";
17
+ import defu from "defu";
18
18
 
19
19
  //#region src/components/command-entry.tsx
20
20
  /**
@@ -1,4 +1,4 @@
1
- import * as _alloy_js_core10 from "@alloy-js/core";
1
+ import * as _alloy_js_core1 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_core10.Children;
9
+ declare function CommandRouterSelectOptions(props: CommandRouterSelectOptionsProps): _alloy_js_core1.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_core10.Children;
13
+ declare function CommandRouter(props: CommandRouterProps): _alloy_js_core1.Children;
14
14
  //#endregion
15
15
  export { CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps };
16
16
  //# sourceMappingURL=command-router.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-router.d.cts","names":[],"sources":["../../src/components/command-router.tsx"],"sourcesContent":[],"mappings":";;;;;UA4BiB,+BAAA;aACJ,eAAe;;AADX,iBAID,0BAAA,CAHY,KAAA,EAInB,+BAJU,CAAA,EAIqB,gBAAA,CAAA,QAJrB;AAGnB;AAyBA;;iBAAgB,aAAA,QAAqB,qBAAkB,gBAAA,CAAA"}
1
+ {"version":3,"file":"command-router.d.cts","names":[],"sources":["../../src/components/command-router.tsx"],"sourcesContent":[],"mappings":";;;;;UA4BiB,+BAAA;aACJ,eAAe;;AADX,iBAID,0BAAA,CAHY,KAAA,EAInB,+BAJU,CAAA,EAIqB,eAAA,CAAA,QAJrB;AAGnB;AAyBA;;iBAAgB,aAAA,QAAqB,qBAAkB,eAAA,CAAA"}
@@ -2,18 +2,9 @@ const require_components_banner_function_declaration = require('./banner-functio
2
2
  const require_components_command_router = require('./command-router.cjs');
3
3
  const require_components_virtual_command_entry = require('./virtual-command-entry.cjs');
4
4
  const require_components_command_entry = require('./command-entry.cjs');
5
- const require_components_prompts_builtin = require('./prompts-builtin.cjs');
6
5
 
7
6
  exports.BannerFunctionDeclaration = require_components_banner_function_declaration.BannerFunctionDeclaration;
8
- exports.BasePromptDeclarations = require_components_prompts_builtin.BasePromptDeclarations;
9
7
  exports.CommandEntry = require_components_command_entry.CommandEntry;
10
8
  exports.CommandRouter = require_components_command_router.CommandRouter;
11
9
  exports.CommandRouterSelectOptions = require_components_command_router.CommandRouterSelectOptions;
12
- exports.ConfirmPromptDeclarations = require_components_prompts_builtin.ConfirmPromptDeclarations;
13
- exports.NumericPromptDeclarations = require_components_prompts_builtin.NumericPromptDeclarations;
14
- exports.PasswordPromptDeclaration = require_components_prompts_builtin.PasswordPromptDeclaration;
15
- exports.PromptsBuiltin = require_components_prompts_builtin.PromptsBuiltin;
16
- exports.SelectPromptDeclarations = require_components_prompts_builtin.SelectPromptDeclarations;
17
- exports.TextPromptDeclarations = require_components_prompts_builtin.TextPromptDeclarations;
18
- exports.TogglePromptDeclarations = require_components_prompts_builtin.TogglePromptDeclarations;
19
10
  exports.VirtualCommandEntry = require_components_virtual_command_entry.VirtualCommandEntry;
@@ -1,6 +1,5 @@
1
1
  import { BannerFunctionDeclaration } from "./banner-function-declaration.cjs";
2
2
  import { CommandEntry, CommandEntryProps } from "./command-entry.cjs";
3
3
  import { CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps } from "./command-router.cjs";
4
- import { BasePromptDeclarations, ConfirmPromptDeclarations, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, PromptsBuiltinProps, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations } from "./prompts-builtin.cjs";
5
4
  import { VirtualCommandEntry, VirtualCommandEntryProps } from "./virtual-command-entry.cjs";
6
- export { BannerFunctionDeclaration, BasePromptDeclarations, CommandEntry, CommandEntryProps, CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps, ConfirmPromptDeclarations, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, PromptsBuiltinProps, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations, VirtualCommandEntry, VirtualCommandEntryProps };
5
+ export { BannerFunctionDeclaration, CommandEntry, CommandEntryProps, CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps, VirtualCommandEntry, VirtualCommandEntryProps };
@@ -1,6 +1,5 @@
1
1
  import { BannerFunctionDeclaration } from "./banner-function-declaration.mjs";
2
2
  import { CommandEntry, CommandEntryProps } from "./command-entry.mjs";
3
3
  import { CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps } from "./command-router.mjs";
4
- import { BasePromptDeclarations, ConfirmPromptDeclarations, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, PromptsBuiltinProps, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations } from "./prompts-builtin.mjs";
5
4
  import { VirtualCommandEntry, VirtualCommandEntryProps } from "./virtual-command-entry.mjs";
6
- export { BannerFunctionDeclaration, BasePromptDeclarations, CommandEntry, CommandEntryProps, CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps, ConfirmPromptDeclarations, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, PromptsBuiltinProps, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations, VirtualCommandEntry, VirtualCommandEntryProps };
5
+ export { BannerFunctionDeclaration, CommandEntry, CommandEntryProps, CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps, VirtualCommandEntry, VirtualCommandEntryProps };
@@ -2,6 +2,5 @@ import { BannerFunctionDeclaration } from "./banner-function-declaration.mjs";
2
2
  import { CommandRouter, CommandRouterSelectOptions } from "./command-router.mjs";
3
3
  import { VirtualCommandEntry } from "./virtual-command-entry.mjs";
4
4
  import { CommandEntry } from "./command-entry.mjs";
5
- import { BasePromptDeclarations, ConfirmPromptDeclarations, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations } from "./prompts-builtin.mjs";
6
5
 
7
- export { BannerFunctionDeclaration, BasePromptDeclarations, CommandEntry, CommandRouter, CommandRouterSelectOptions, ConfirmPromptDeclarations, NumericPromptDeclarations, PasswordPromptDeclaration, PromptsBuiltin, SelectPromptDeclarations, TextPromptDeclarations, TogglePromptDeclarations, VirtualCommandEntry };
6
+ export { BannerFunctionDeclaration, CommandEntry, CommandRouter, CommandRouterSelectOptions, VirtualCommandEntry };
@@ -4,12 +4,12 @@ const require_components_command_router = require('./command-router.cjs');
4
4
  const require_components_command_entry = require('./command-entry.cjs');
5
5
  let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
6
6
  let __alloy_js_core = require("@alloy-js/core");
7
- let defu = require("defu");
8
- defu = require_rolldown_runtime.__toESM(defu);
9
7
  let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
10
- let __stryke_path_join = require("@stryke/path/join");
11
8
  let __shell_shock_core_plugin_utils_context_helpers = require("@shell-shock/core/plugin-utils/context-helpers");
9
+ let __stryke_path_join = require("@stryke/path/join");
12
10
  let __stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
11
+ let defu = require("defu");
12
+ defu = require_rolldown_runtime.__toESM(defu);
13
13
  let __powerlines_plugin_alloy_typescript_components_typescript_file = require("@powerlines/plugin-alloy/typescript/components/typescript-file");
14
14
  let __shell_shock_preset_script_components_virtual_command_entry = require("@shell-shock/preset-script/components/virtual-command-entry");
15
15
 
@@ -1,4 +1,4 @@
1
- import * as _alloy_js_core1 from "@alloy-js/core";
1
+ import * as _alloy_js_core3 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_core1.Children;
12
+ declare function VirtualCommandEntry(props: VirtualCommandEntryProps): _alloy_js_core3.Children;
13
13
  //#endregion
14
14
  export { VirtualCommandEntry, VirtualCommandEntryProps };
15
15
  //# sourceMappingURL=virtual-command-entry.d.cts.map
@@ -3,11 +3,11 @@ import { CommandRouter } from "./command-router.mjs";
3
3
  import { CommandEntry } from "./command-entry.mjs";
4
4
  import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
5
5
  import { For, Show, computed } from "@alloy-js/core";
6
- import defu from "defu";
7
6
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
8
- import { joinPaths } from "@stryke/path/join";
9
7
  import { isDynamicPathSegment } from "@shell-shock/core/plugin-utils/context-helpers";
8
+ import { joinPaths } from "@stryke/path/join";
10
9
  import { pascalCase } from "@stryke/string-format/pascal-case";
10
+ import defu from "defu";
11
11
  import { TypescriptFile } from "@powerlines/plugin-alloy/typescript/components/typescript-file";
12
12
  import { VirtualCommandHandlerDeclaration } from "@shell-shock/preset-script/components/virtual-command-entry";
13
13
 
package/dist/index.cjs CHANGED
@@ -1,19 +1,20 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
- const require_index = require('./plugin-upgrade/dist/index.cjs');
4
3
  const require_components_banner_function_declaration = require('./components/banner-function-declaration.cjs');
5
4
  const require_components_command_router = require('./components/command-router.cjs');
6
5
  const require_components_virtual_command_entry = require('./components/virtual-command-entry.cjs');
7
6
  const require_components_command_entry = require('./components/command-entry.cjs');
8
- const require_components_prompts_builtin = require('./components/prompts-builtin.cjs');
9
- require('./components/index.cjs');
10
7
  const require_get_default_options = require('./helpers/get-default-options.cjs');
11
8
  let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
12
9
  let __alloy_js_core = require("@alloy-js/core");
13
10
  let __alloy_js_typescript = require("@alloy-js/typescript");
14
11
  let __powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
12
+ let __shell_shock_plugin_prompts = require("@shell-shock/plugin-prompts");
13
+ __shell_shock_plugin_prompts = require_rolldown_runtime.__toESM(__shell_shock_plugin_prompts);
15
14
  let __shell_shock_plugin_theme = require("@shell-shock/plugin-theme");
16
15
  __shell_shock_plugin_theme = require_rolldown_runtime.__toESM(__shell_shock_plugin_theme);
16
+ let __shell_shock_plugin_upgrade = require("@shell-shock/plugin-upgrade");
17
+ __shell_shock_plugin_upgrade = require_rolldown_runtime.__toESM(__shell_shock_plugin_upgrade);
17
18
  let __shell_shock_preset_script_components_bin_entry = require("@shell-shock/preset-script/components/bin-entry");
18
19
  let __shell_shock_preset_script_components_console_builtin = require("@shell-shock/preset-script/components/console-builtin");
19
20
  let __shell_shock_preset_script_components_help = require("@shell-shock/preset-script/components/help");
@@ -26,7 +27,8 @@ let __shell_shock_preset_script_components_utils_builtin = require("@shell-shock
26
27
  const plugin = (options = {}) => {
27
28
  return [
28
29
  (0, __shell_shock_plugin_theme.default)({ theme: options.theme }),
29
- require_index.src_default({ packageName: options.packageName }),
30
+ (0, __shell_shock_plugin_prompts.default)(options),
31
+ (0, __shell_shock_plugin_upgrade.default)({ packageName: options.packageName }),
30
32
  {
31
33
  name: "shell-shock:cli-preset",
32
34
  config() {
@@ -42,11 +44,7 @@ const plugin = (options = {}) => {
42
44
  },
43
45
  async prepare() {
44
46
  this.debug("Rendering built-in modules for the Shell Shock `cli` preset.");
45
- return (0, __powerlines_plugin_alloy_render.render)(this, [
46
- (0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_utils_builtin.UtilsBuiltin, {}),
47
- (0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_console_builtin.ConsoleBuiltin, {}),
48
- (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_prompts_builtin.PromptsBuiltin, {})
49
- ]);
47
+ return (0, __powerlines_plugin_alloy_render.render)(this, [(0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_utils_builtin.UtilsBuiltin, {}), (0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_console_builtin.ConsoleBuiltin, {})]);
50
48
  }
51
49
  },
52
50
  {
package/dist/index.mjs CHANGED
@@ -1,16 +1,15 @@
1
- import { src_default as src_default$1 } from "./plugin-upgrade/dist/index.mjs";
2
1
  import { BannerFunctionDeclaration } from "./components/banner-function-declaration.mjs";
3
2
  import { CommandRouter } from "./components/command-router.mjs";
4
3
  import { VirtualCommandEntry } from "./components/virtual-command-entry.mjs";
5
4
  import { CommandEntry } from "./components/command-entry.mjs";
6
- import { PromptsBuiltin } from "./components/prompts-builtin.mjs";
7
- import "./components/index.mjs";
8
5
  import { getDefaultOptions } from "./helpers/get-default-options.mjs";
9
6
  import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
10
7
  import { For, Show, code } from "@alloy-js/core";
11
8
  import { VarDeclaration } from "@alloy-js/typescript";
12
9
  import { render } from "@powerlines/plugin-alloy/render";
10
+ import prompts from "@shell-shock/plugin-prompts";
13
11
  import theme from "@shell-shock/plugin-theme";
12
+ import upgrade from "@shell-shock/plugin-upgrade";
14
13
  import { BinEntry } from "@shell-shock/preset-script/components/bin-entry";
15
14
  import { ConsoleBuiltin } from "@shell-shock/preset-script/components/console-builtin";
16
15
  import { VirtualHelp } from "@shell-shock/preset-script/components/help";
@@ -23,7 +22,8 @@ import { UtilsBuiltin } from "@shell-shock/preset-script/components/utils-builti
23
22
  const plugin = (options = {}) => {
24
23
  return [
25
24
  theme({ theme: options.theme }),
26
- src_default$1({ packageName: options.packageName }),
25
+ prompts(options),
26
+ upgrade({ packageName: options.packageName }),
27
27
  {
28
28
  name: "shell-shock:cli-preset",
29
29
  config() {
@@ -39,11 +39,7 @@ const plugin = (options = {}) => {
39
39
  },
40
40
  async prepare() {
41
41
  this.debug("Rendering built-in modules for the Shell Shock `cli` preset.");
42
- return render(this, [
43
- createComponent(UtilsBuiltin, {}),
44
- createComponent(ConsoleBuiltin, {}),
45
- createComponent(PromptsBuiltin, {})
46
- ]);
42
+ return render(this, [createComponent(UtilsBuiltin, {}), createComponent(ConsoleBuiltin, {})]);
47
43
  }
48
44
  },
49
45
  {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["code","For","Show","VarDeclaration","render","theme","upgrade","BinEntry","ConsoleBuiltin","VirtualHelp","UtilsBuiltin","PromptsBuiltin","BannerFunctionDeclaration","CommandEntry","CommandRouter","VirtualCommandEntry","getDefaultOptions","plugin","options","packageName","name","config","debug","defaultOptions","isCaseSensitive","configResolved","dependencies","didyoumean2","prepare","_$createComponent","order","handler","_self$","builtinImports","console","utils","prompts","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 theme from \"@shell-shock/plugin-theme\";\nimport upgrade from \"@shell-shock/plugin-upgrade\";\nimport { BinEntry } from \"@shell-shock/preset-script/components/bin-entry\";\nimport { ConsoleBuiltin } from \"@shell-shock/preset-script/components/console-builtin\";\nimport { VirtualHelp } from \"@shell-shock/preset-script/components/help\";\nimport { UtilsBuiltin } from \"@shell-shock/preset-script/components/utils-builtin\";\nimport type { Plugin } from \"powerlines/types/plugin\";\nimport { PromptsBuiltin } from \"./components\";\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 base plugin.\n */\nexport const plugin = <TContext extends CLIPresetContext = CLIPresetContext>(\n options: CLIPresetOptions = {}\n) => {\n return [\n theme({\n theme: options.theme\n }),\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 async prepare() {\n this.debug(\n \"Rendering built-in modules for the Shell Shock `cli` preset.\"\n );\n\n return render(\n this,\n <>\n <UtilsBuiltin />\n <ConsoleBuiltin />\n <PromptsBuiltin />\n </>\n );\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":";;;;;;;;;;;;;;;;;;;;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AA,OAAA,EAAA,CAAA;WAAAT,gBAG9Bf,eAAa;YAACiC,UAAU,EAAE;YAAA,IAAEJ,WAAQ;AAAA,oBAAEX,OAAKW,YAAY,EAAE;;YAAA,CAAA;WAAAL,gBAAA,OAAA,EAAA,CAAA;WAAA;;SAAA,CAAA;QAAAA,gBAAA,OAAA,EAAA,CAAA;QAI3DtC,IAAI;QAAkBsC,gBAAA,OAAA,EAAA,CAAA;QAAAA,gBAAA,OAAA,EAAA,CAAA;QAAAT,gBAGtBpB,aAAW;SAAA,IACVS,UAAO;AAAA,iBAAEc,OAAKd;;SAAO,IACrByB,WAAQ;AAAA,iBAAEX,OAAKW,YAAY,EAAE;;SAAA,CAAA;QAAA;;MAAA,CAAA,EAAAd,gBAGhC3B,MAAI;MAAA,IAACsC,OAAI;AAAA,cAAEC,OAAOO,OAAOhB,OAAKW,SAAS,CAACC,SAAS;;MAAC,IAAAL,WAAA;AAAA,cAAAV,gBAChD5B,KAAG;QAAA,IAACgD,OAAI;AAAA,gBAAER,OAAOO,OAAOhB,OAAKW,SAAS;;QAAEO,gBAAc;QAAAX,WACpDY,UAAKtB,gBACH3B,MAAI;SAAA,IACHsC,OAAI;AAAA,iBAAEW,MAAMC;;SAAS,IACrBC,WAAQ;AAAA,iBAAAxB,gBAAGhB,cAAY,EAACyC,SAASH,OAAK,CAAA;;SAAA,IAAAZ,WAAA;AAAA,iBAAAV,gBACrCd,qBAAmB,EAACuC,SAASH,OAAK,CAAA;;SAAA,CAAA;QAEtC,CAAA;;MAAA,CAAA,CAIT,CAAC;;IAEL;GACD;EACF;;AAGH,kBAAelC"}
1
+ {"version":3,"file":"index.mjs","names":["code","For","Show","VarDeclaration","render","prompts","theme","upgrade","BinEntry","ConsoleBuiltin","VirtualHelp","UtilsBuiltin","BannerFunctionDeclaration","CommandEntry","CommandRouter","VirtualCommandEntry","getDefaultOptions","plugin","options","packageName","name","config","debug","defaultOptions","isCaseSensitive","configResolved","dependencies","didyoumean2","prepare","_$createComponent","order","handler","_self$","builtinImports","console","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 prompts from \"@shell-shock/plugin-prompts\";\nimport theme from \"@shell-shock/plugin-theme\";\nimport upgrade from \"@shell-shock/plugin-upgrade\";\nimport { BinEntry } from \"@shell-shock/preset-script/components/bin-entry\";\nimport { ConsoleBuiltin } from \"@shell-shock/preset-script/components/console-builtin\";\nimport { VirtualHelp } from \"@shell-shock/preset-script/components/help\";\nimport { UtilsBuiltin } from \"@shell-shock/preset-script/components/utils-builtin\";\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 base plugin.\n */\nexport const plugin = <TContext extends CLIPresetContext = CLIPresetContext>(\n options: CLIPresetOptions = {}\n) => {\n return [\n theme({\n theme: options.theme\n }),\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 async prepare() {\n this.debug(\n \"Rendering built-in modules for the Shell Shock `cli` preset.\"\n );\n\n return render(\n this,\n <>\n <UtilsBuiltin />\n <ConsoleBuiltin />\n </>\n );\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"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AY,CAAA;WAAAqC,gBAAA,OAAA,EAAA,CAAA;WAAAR,gBAG9Bf,eAAa;YAACgC,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;QAI3DrC,IAAI;QAAkBqC,gBAAA,OAAA,EAAA,CAAA;QAAAA,gBAAA,OAAA,EAAA,CAAA;QAAAR,gBAGtBnB,aAAW;SAAA,IACVQ,UAAO;AAAA,iBAAEc,OAAKd;;SAAO,IACrBwB,WAAQ;AAAA,iBAAEV,OAAKU,YAAY,EAAE;;SAAA,CAAA;QAAA;;MAAA,CAAA,EAAAb,gBAGhC3B,MAAI;MAAA,IAACqC,OAAI;AAAA,cAAEC,OAAOO,OAAOf,OAAKU,SAAS,CAACC,SAAS;;MAAC,IAAAL,WAAA;AAAA,cAAAT,gBAChD5B,KAAG;QAAA,IAAC+C,OAAI;AAAA,gBAAER,OAAOO,OAAOf,OAAKU,SAAS;;QAAEO,gBAAc;QAAAX,WACpDY,UAAKrB,gBACH3B,MAAI;SAAA,IACHqC,OAAI;AAAA,iBAAEW,MAAMC;;SAAS,IACrBC,WAAQ;AAAA,iBAAAvB,gBAAGhB,cAAY,EAACwC,SAASH,OAAK,CAAA;;SAAA,IAAAZ,WAAA;AAAA,iBAAAT,gBACrCd,qBAAmB,EAACsC,SAASH,OAAK,CAAA;;SAAA,CAAA;QAEtC,CAAA;;MAAA,CAAA,CAIT,CAAC;;IAEL;GACD;EACF;;AAGH,kBAAejC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/preset-cli",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
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": {
@@ -111,20 +111,6 @@
111
111
  "default": "./dist/components/command-router.mjs"
112
112
  }
113
113
  },
114
- "./components/prompts-builtin": {
115
- "require": {
116
- "types": "./dist/components/prompts-builtin.d.cts",
117
- "default": "./dist/components/prompts-builtin.cjs"
118
- },
119
- "import": {
120
- "types": "./dist/components/prompts-builtin.d.mts",
121
- "default": "./dist/components/prompts-builtin.mjs"
122
- },
123
- "default": {
124
- "types": "./dist/components/prompts-builtin.d.mts",
125
- "default": "./dist/components/prompts-builtin.mjs"
126
- }
127
- },
128
114
  "./components/virtual-command-entry": {
129
115
  "require": {
130
116
  "types": "./dist/components/virtual-command-entry.d.cts",
@@ -181,17 +167,19 @@
181
167
  "dependencies": {
182
168
  "@alloy-js/core": "0.23.0-dev.8",
183
169
  "@alloy-js/typescript": "0.23.0-dev.4",
184
- "@powerlines/deepkit": "^0.6.65",
185
- "@powerlines/plugin-alloy": "^0.23.15",
186
- "@powerlines/plugin-plugin": "^0.12.236",
187
- "@shell-shock/core": "^0.8.10",
188
- "@shell-shock/plugin-theme": "^0.2.1",
189
- "@shell-shock/preset-script": "^0.6.9",
170
+ "@powerlines/deepkit": "^0.6.66",
171
+ "@powerlines/plugin-alloy": "^0.23.16",
172
+ "@powerlines/plugin-plugin": "^0.12.237",
173
+ "@shell-shock/core": "^0.8.11",
174
+ "@shell-shock/plugin-prompts": "^0.2.0",
175
+ "@shell-shock/plugin-theme": "^0.2.2",
176
+ "@shell-shock/plugin-upgrade": "^0.1.1",
177
+ "@shell-shock/preset-script": "^0.6.10",
190
178
  "@stryke/path": "0.26.6",
191
179
  "@stryke/string-format": "^0.14.2",
192
180
  "cfonts": "^3.3.1",
193
181
  "defu": "6.1.4",
194
- "powerlines": "^0.38.52"
182
+ "powerlines": "^0.38.53"
195
183
  },
196
184
  "devDependencies": {
197
185
  "@babel/core": "^7.29.0",
@@ -221,5 +209,5 @@
221
209
  "./package.json": "./package.json"
222
210
  }
223
211
  },
224
- "gitHead": "ba4e6ba921fb77de5be8950f02ea798752b61450"
212
+ "gitHead": "1137a1ee3be5bb927dc9b15e118f804fd09a24b4"
225
213
  }