@shell-shock/preset-cli 0.7.0 → 0.7.2

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 (41) hide show
  1. package/dist/components/banner-function-declaration.cjs +3 -3
  2. package/dist/components/banner-function-declaration.d.cts +2 -2
  3. package/dist/components/banner-function-declaration.mjs +2 -2
  4. package/dist/components/banner-function-declaration.mjs.map +1 -1
  5. package/dist/components/command-entry.cjs +5 -5
  6. package/dist/components/command-entry.d.cts +2 -2
  7. package/dist/components/command-entry.mjs +4 -4
  8. package/dist/components/command-router.d.cts +3 -3
  9. package/dist/components/command-router.d.cts.map +1 -1
  10. package/dist/components/index.cjs +0 -9
  11. package/dist/components/index.d.cts +1 -2
  12. package/dist/components/index.d.mts +1 -2
  13. package/dist/components/index.mjs +1 -2
  14. package/dist/components/virtual-command-entry.cjs +3 -3
  15. package/dist/components/virtual-command-entry.mjs +2 -2
  16. package/dist/index.cjs +13 -18
  17. package/dist/index.d.cts +4 -1
  18. package/dist/index.d.cts.map +1 -1
  19. package/dist/index.d.mts +4 -1
  20. package/dist/index.d.mts.map +1 -1
  21. package/dist/index.mjs +10 -17
  22. package/dist/index.mjs.map +1 -1
  23. package/package.json +13 -24
  24. package/dist/components/prompts-builtin.cjs +0 -2729
  25. package/dist/components/prompts-builtin.d.cts +0 -40
  26. package/dist/components/prompts-builtin.d.cts.map +0 -1
  27. package/dist/components/prompts-builtin.d.mts +0 -40
  28. package/dist/components/prompts-builtin.d.mts.map +0 -1
  29. package/dist/components/prompts-builtin.mjs +0 -2721
  30. package/dist/components/prompts-builtin.mjs.map +0 -1
  31. package/dist/plugin-upgrade/dist/components/index.cjs +0 -2
  32. package/dist/plugin-upgrade/dist/components/index.mjs +0 -4
  33. package/dist/plugin-upgrade/dist/components/upgrade-builtin.cjs +0 -661
  34. package/dist/plugin-upgrade/dist/components/upgrade-builtin.mjs +0 -655
  35. package/dist/plugin-upgrade/dist/components/upgrade-builtin.mjs.map +0 -1
  36. package/dist/plugin-upgrade/dist/components/upgrade-command.cjs +0 -96
  37. package/dist/plugin-upgrade/dist/components/upgrade-command.mjs +0 -96
  38. package/dist/plugin-upgrade/dist/components/upgrade-command.mjs.map +0 -1
  39. package/dist/plugin-upgrade/dist/index.cjs +0 -49
  40. package/dist/plugin-upgrade/dist/index.mjs +0 -49
  41. package/dist/plugin-upgrade/dist/index.mjs.map +0 -1
@@ -4,8 +4,8 @@ let __alloy_js_core = require("@alloy-js/core");
4
4
  let __alloy_js_typescript = require("@alloy-js/typescript");
5
5
  let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
6
6
  let __shell_shock_core_plugin_utils_context_helpers = require("@shell-shock/core/plugin-utils/context-helpers");
7
+ let __shell_shock_plugin_theme_contexts_theme = require("@shell-shock/plugin-theme/contexts/theme");
7
8
  let __shell_shock_preset_script_components_banner_function_declaration = require("@shell-shock/preset-script/components/banner-function-declaration");
8
- let __shell_shock_preset_script_contexts_theme = require("@shell-shock/preset-script/contexts/theme");
9
9
  let cfonts = require("cfonts");
10
10
 
11
11
  //#region src/components/banner-function-declaration.tsx
@@ -14,9 +14,9 @@ let cfonts = require("cfonts");
14
14
  */
15
15
  function BannerFunctionDeclaration(props) {
16
16
  const { consoleFnName = "log", variant = "primary", command } = props;
17
- const theme = (0, __shell_shock_preset_script_contexts_theme.useTheme)();
17
+ const theme = (0, __shell_shock_plugin_theme_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));
@@ -1,11 +1,11 @@
1
- import * as _alloy_js_core0 from "@alloy-js/core";
1
+ import * as _alloy_js_core2 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_core2.Children;
9
9
  //#endregion
10
10
  export { BannerFunctionDeclaration };
11
11
  //# sourceMappingURL=banner-function-declaration.d.cts.map
@@ -3,8 +3,8 @@ import { code, computed } from "@alloy-js/core";
3
3
  import { FunctionDeclaration, IfStatement } from "@alloy-js/typescript";
4
4
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
5
5
  import { getAppDescription, getAppTitle } from "@shell-shock/core/plugin-utils/context-helpers";
6
+ import { useTheme } from "@shell-shock/plugin-theme/contexts/theme";
6
7
  import { BannerFunctionBodyDeclaration } from "@shell-shock/preset-script/components/banner-function-declaration";
7
- import { useTheme } from "@shell-shock/preset-script/contexts/theme";
8
8
  import { render } from "cfonts";
9
9
 
10
10
  //#region src/components/banner-function-declaration.tsx
@@ -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,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,SAAS,MAAM,CAAA,IACnEA,QAAQI,YAAYC,WAAW,UAEpC;CACD,MAAMC,SAASrB,eAAec,MAAMG,OAAOC,OAAOG,OAAOT,SAAS;CAClE,MAAMU,QAAQtB,eACZK,YAAYU,SAAS,KAAK,CAACQ,QACzB,IAAIR,QAAQI,YAAYC,WAAW,WACnC,GAEJ,CAAC;CACD,MAAMI,cAAcxB,eACZa,SAASW,eAAepB,kBAAkBW,QAClD,CAAC;CAED,MAAMU,aAAazB,eAAe;EAChC,MAAM0B,SAASlB,OAAOH,YAAYU,SAAS,KAAK,EAAE;GAChDY,MAAM;GACNC,OAAO;GACPC,YAAY;GACZC,eAAe;GACfC,YAAY;GACZC,UAAU;GACVC,oBAAoB;GACpBC,KAAK;GACN,CAAC;AACF,MAAI,CAACR,OACH,QAAO,CAAC,GAAGrB,YAAYU,SAAS,KAAK,CAAA,yBAA0B;AAGjE,SAAOW,OAAOS;GACd;CAEF,MAAMC,gBAAgBpC,eAElBqC,KAAKC,IAAIxB,MAAMyB,QAAQC,KAAK,EAAE,GAAG,IACjC1B,MAAM2B,aAAavB,OAAOwB,QAAQ9B,SAAS+B,KAAKC,SAChD9B,MAAM2B,aAAavB,OAAOwB,QAAQ9B,SAASiC,MAAMD,OACpD;CACD,MAAME,eAAe9C,eACbqC,KAAKC,IAAIxB,MAAMyB,QAAQrB,QAAQ,EAAE,GAAG,IAAIkB,cAAcW,MAC7D;AAED,QAAA,CAAAC,gBAEK/C,qBAAmB;EAClBgD,OAAK;EACLC,MAAI;EAAA,IACJC,MAAG;AAAA,UAAE,aAAa9C,YAAYU,SAAS,KAAK,CAAA,sBAC1CF,UAAU,WAAWA,QAAQS,MAAK,aAAc,GAAE;;EAEpD8B,YAAY,CAAC;GAAEF,MAAM;GAASG,MAAM;GAAUC,SAAS;GAAK,CAAC;EAAA,IAAAC,WAAA;AAAA,UAAA,CAAAP,gBAC5D1C,+BAA6B;IAAA,IAC5BU,SAAM;AAAA,YAAEA,OAAO+B;;IAAK,IACpBvB,cAAW;AAAA,YAAEA,YAAYuB;;IAAK,IAC9B1B,SAAM;AAAA,YAAEA,OAAO0B;;IACNnC;IACMD;IACNE;IAAO,IAAA0C,WAAA;AAAA,YACfxD,IAAI,uBAAuB0B,WAAWsB,MACpCS,KAAIC,SAAQC,KAAKC,UAAUF,KAAKG,MAAM,CAAC,CAAC,CACxCC,KAAK,KAAK,CAAA;wHAEbf,aAAaC,MAAK,UACTzB,MAAMyB,MAAK;;IAA4C,CAAA,EAAAC,gBAEjE9C,aAAW;IAAC4D,WAAW/D,IAAI;IAA0BwD,UACnDxD,IAAI;IAAqB,CAAA,CAAA;;EAAA,CAAA,CAAA"}
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,QA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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"}
@@ -4,19 +4,19 @@ 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");
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
  /**
@@ -1,4 +1,4 @@
1
- import * as _alloy_js_core0 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 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_core0.Children;
12
+ declare function CommandEntry(props: CommandEntryProps): _alloy_js_core3.Children;
13
13
  //#endregion
14
14
  export { CommandEntry, CommandEntryProps };
15
15
  //# sourceMappingURL=command-entry.d.cts.map
@@ -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_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_core10.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_core10.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
@@ -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
 
@@ -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,32 +1,35 @@
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");
15
- let __shell_shock_plugin_theme = require("@shell-shock/plugin-theme");
16
- __shell_shock_plugin_theme = require_rolldown_runtime.__toESM(__shell_shock_plugin_theme);
12
+ let __shell_shock_plugin_console = require("@shell-shock/plugin-console");
13
+ __shell_shock_plugin_console = require_rolldown_runtime.__toESM(__shell_shock_plugin_console);
14
+ let __shell_shock_plugin_prompts = require("@shell-shock/plugin-prompts");
15
+ __shell_shock_plugin_prompts = require_rolldown_runtime.__toESM(__shell_shock_plugin_prompts);
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
- let __shell_shock_preset_script_components_console_builtin = require("@shell-shock/preset-script/components/console-builtin");
19
19
  let __shell_shock_preset_script_components_help = require("@shell-shock/preset-script/components/help");
20
- let __shell_shock_preset_script_components_utils_builtin = require("@shell-shock/preset-script/components/utils-builtin");
21
20
 
22
21
  //#region src/index.tsx
23
22
  /**
24
- * The Shell Shock base plugin.
23
+ * The Shell Shock CLI Preset plugin.
24
+ *
25
+ * @remarks
26
+ * 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.
25
27
  */
26
28
  const plugin = (options = {}) => {
27
29
  return [
28
- (0, __shell_shock_plugin_theme.default)({ theme: options.theme }),
29
- require_index.src_default({ packageName: options.packageName }),
30
+ (0, __shell_shock_plugin_console.default)(options),
31
+ (0, __shell_shock_plugin_prompts.default)(options),
32
+ (0, __shell_shock_plugin_upgrade.default)({ packageName: options.packageName }),
30
33
  {
31
34
  name: "shell-shock:cli-preset",
32
35
  config() {
@@ -39,14 +42,6 @@ const plugin = (options = {}) => {
39
42
  },
40
43
  configResolved() {
41
44
  this.dependencies.didyoumean2 = "^7.0.4";
42
- },
43
- async prepare() {
44
- 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
- ]);
50
45
  }
51
46
  },
52
47
  {
package/dist/index.d.cts CHANGED
@@ -4,7 +4,10 @@ import { Plugin } from "powerlines/types/plugin";
4
4
  //#region src/index.d.ts
5
5
 
6
6
  /**
7
- * The Shell Shock base plugin.
7
+ * The Shell Shock CLI Preset plugin.
8
+ *
9
+ * @remarks
10
+ * 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.
8
11
  */
9
12
  declare const plugin: <TContext extends CLIPresetContext = CLIPresetContext>(options?: CLIPresetOptions) => Plugin<TContext>[];
10
13
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAuCA;AAAwC,cAA3B,MAA2B,EAAA,CAAA,iBAAA,gBAAA,GAAmB,gBAAnB,CAAA,CAAA,OAAA,CAAA,EAC7B,gBAD6B,EAAA,GA6HjC,MA7HiC,CA6H1B,QA7H0B,CAAA,EAAA"}
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"}
package/dist/index.d.mts CHANGED
@@ -4,7 +4,10 @@ import { Plugin } from "powerlines/types/plugin";
4
4
  //#region src/index.d.ts
5
5
 
6
6
  /**
7
- * The Shell Shock base plugin.
7
+ * The Shell Shock CLI Preset plugin.
8
+ *
9
+ * @remarks
10
+ * 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.
8
11
  */
9
12
  declare const plugin: <TContext extends CLIPresetContext = CLIPresetContext>(options?: CLIPresetOptions) => Plugin<TContext>[];
10
13
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAuCA;AAAwC,cAA3B,MAA2B,EAAA,CAAA,iBAAA,gBAAA,GAAmB,gBAAnB,CAAA,CAAA,OAAA,CAAA,EAC7B,gBAD6B,EAAA,GA6HjC,MA7HiC,CA6H1B,QA7H0B,CAAA,EAAA"}
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"}
package/dist/index.mjs CHANGED
@@ -1,29 +1,30 @@
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";
13
- import theme from "@shell-shock/plugin-theme";
10
+ import console from "@shell-shock/plugin-console";
11
+ import prompts from "@shell-shock/plugin-prompts";
12
+ import upgrade from "@shell-shock/plugin-upgrade";
14
13
  import { BinEntry } from "@shell-shock/preset-script/components/bin-entry";
15
- import { ConsoleBuiltin } from "@shell-shock/preset-script/components/console-builtin";
16
14
  import { VirtualHelp } from "@shell-shock/preset-script/components/help";
17
- import { UtilsBuiltin } from "@shell-shock/preset-script/components/utils-builtin";
18
15
 
19
16
  //#region src/index.tsx
20
17
  /**
21
- * The Shell Shock base plugin.
18
+ * The Shell Shock CLI Preset plugin.
19
+ *
20
+ * @remarks
21
+ * 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.
22
22
  */
23
23
  const plugin = (options = {}) => {
24
24
  return [
25
- theme({ theme: options.theme }),
26
- src_default$1({ packageName: options.packageName }),
25
+ console(options),
26
+ prompts(options),
27
+ upgrade({ packageName: options.packageName }),
27
28
  {
28
29
  name: "shell-shock:cli-preset",
29
30
  config() {
@@ -36,14 +37,6 @@ const plugin = (options = {}) => {
36
37
  },
37
38
  configResolved() {
38
39
  this.dependencies.didyoumean2 = "^7.0.4";
39
- },
40
- async prepare() {
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
- ]);
47
40
  }
48
41
  },
49
42
  {
@@ -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":";;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAaiB,UACXC,UAA4B,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AG9Bf,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","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,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BrB,aAAW;SAAA,IACVO,UAAO;AAAA,iBAAEa,OAAKb;;SAAO,IACrBuB,WAAQ;AAAA,iBAAEV,OAAKU,YAAY,EAAE;;SAAA,CAAA;QAAA;;MAAA,CAAA,EAAAT,gBAGhC5B,MAAI;MAAA,IAACkC,OAAI;AAAA,cAAEC,OAAOO,OAAOf,OAAKU,SAAS,CAACC,SAAS;;MAAC,IAAAL,WAAA;AAAA,cAAAL,gBAChD7B,KAAG;QAAA,IAAC4C,OAAI;AAAA,gBAAER,OAAOO,OAAOf,OAAKU,SAAS;;QAAEO,gBAAc;QAAAX,WACpDY,UAAKjB,gBACH5B,MAAI;SAAA,IACHkC,OAAI;AAAA,iBAAEW,MAAMC;;SAAS,IACrBC,WAAQ;AAAA,iBAAAnB,gBAAGnB,cAAY,EAACuC,SAASH,OAAK,CAAA;;SAAA,IAAAZ,WAAA;AAAA,iBAAAL,gBACrCjB,qBAAmB,EAACqC,SAASH,OAAK,CAAA;;SAAA,CAAA;QAEtC,CAAA;;MAAA,CAAA,CAIT,CAAC;;IAEL;GACD;EACF;;AAGH,kBAAehC"}
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.2",
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,20 @@
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.12",
174
+ "@shell-shock/plugin-console": "^0.0.2",
175
+ "@shell-shock/plugin-prompts": "^0.2.1",
176
+ "@shell-shock/plugin-theme": "^0.3.0",
177
+ "@shell-shock/plugin-upgrade": "^0.1.2",
178
+ "@shell-shock/preset-script": "^0.6.11",
190
179
  "@stryke/path": "0.26.6",
191
- "@stryke/string-format": "^0.14.2",
180
+ "@stryke/string-format": "0.14.2",
192
181
  "cfonts": "^3.3.1",
193
182
  "defu": "6.1.4",
194
- "powerlines": "^0.38.52"
183
+ "powerlines": "^0.38.53"
195
184
  },
196
185
  "devDependencies": {
197
186
  "@babel/core": "^7.29.0",
@@ -221,5 +210,5 @@
221
210
  "./package.json": "./package.json"
222
211
  }
223
212
  },
224
- "gitHead": "ba4e6ba921fb77de5be8950f02ea798752b61450"
213
+ "gitHead": "a802bf947afd12ce5c0f29aae1d4039c9e4f40f7"
225
214
  }