@shell-shock/preset-cli 0.8.18 → 0.8.20

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 (45) hide show
  1. package/README.md +1 -1
  2. package/dist/components/banner-builtin.cjs +9 -3
  3. package/dist/components/banner-builtin.d.cts.map +1 -1
  4. package/dist/components/banner-builtin.d.mts +1 -1
  5. package/dist/components/banner-builtin.d.mts.map +1 -1
  6. package/dist/components/banner-builtin.mjs +9 -3
  7. package/dist/components/banner-builtin.mjs.map +1 -1
  8. package/dist/components/command-entry.cjs +3 -3
  9. package/dist/components/command-entry.mjs +3 -3
  10. package/dist/components/command-router.cjs +1 -1
  11. package/dist/components/command-router.mjs +1 -1
  12. package/dist/components/upgrade-builtin.cjs +1 -1
  13. package/dist/components/upgrade-builtin.mjs +1 -1
  14. package/dist/index.cjs +3 -6
  15. package/dist/index.d.cts.map +1 -1
  16. package/dist/index.d.mts.map +1 -1
  17. package/dist/index.mjs +4 -7
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/plugin-banner/dist/components/banner-builtin.cjs +2 -2
  20. package/dist/plugin-banner/dist/components/banner-builtin.mjs +1 -1
  21. package/dist/plugin-banner/dist/components/banner-function-declaration.cjs +43 -19
  22. package/dist/plugin-banner/dist/components/banner-function-declaration.mjs +44 -20
  23. package/dist/plugin-banner/dist/components/banner-function-declaration.mjs.map +1 -1
  24. package/dist/plugin-banner/dist/types/plugin.d.mts +1 -1
  25. package/dist/plugin-help/dist/components/display.cjs +11 -10
  26. package/dist/plugin-help/dist/components/display.mjs +11 -10
  27. package/dist/plugin-help/dist/components/display.mjs.map +1 -1
  28. package/dist/plugin-help/dist/components/help-builtin.cjs +5 -4
  29. package/dist/plugin-help/dist/components/help-builtin.mjs +5 -4
  30. package/dist/plugin-help/dist/components/help-builtin.mjs.map +1 -1
  31. package/dist/plugin-help/dist/components/help-command.cjs +1 -1
  32. package/dist/plugin-help/dist/components/help-command.mjs +1 -1
  33. package/dist/plugin-help/dist/index.cjs +3 -3
  34. package/dist/plugin-help/dist/index.mjs +2 -2
  35. package/dist/plugin-help/dist/types/plugin.d.mts +1 -1
  36. package/dist/types/plugin.d.cts +5 -1
  37. package/dist/types/plugin.d.cts.map +1 -1
  38. package/dist/types/plugin.d.mts +5 -1
  39. package/dist/types/plugin.d.mts.map +1 -1
  40. package/package.json +8 -8
  41. package/dist/plugin-banner/dist/components/index.cjs +0 -2
  42. package/dist/plugin-banner/dist/components/index.mjs +0 -4
  43. package/dist/plugin-banner/dist/index.cjs +0 -70
  44. package/dist/plugin-banner/dist/index.mjs +0 -68
  45. package/dist/plugin-banner/dist/index.mjs.map +0 -1
package/README.md CHANGED
@@ -27,7 +27,7 @@ This package is part of the ⚡<b>Shell Shock</b> monorepo. The Shell Shock pack
27
27
 
28
28
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
29
29
 
30
- [![Version](https://img.shields.io/badge/version-0.8.13-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/shell-shock/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/shell-shock/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
30
+ [![Version](https://img.shields.io/badge/version-0.8.19-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/shell-shock/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/shell-shock/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
31
31
 
32
32
  <!-- prettier-ignore-start -->
33
33
  <!-- markdownlint-disable -->
@@ -5,8 +5,8 @@ const require_banner_builtin = require('../plugin-banner/dist/components/banner-
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
7
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
8
- let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
9
8
  let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
9
+ let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
10
10
  let _shell_shock_plugin_theme_contexts_theme = require("@shell-shock/plugin-theme/contexts/theme");
11
11
  let cfonts = require("cfonts");
12
12
 
@@ -23,7 +23,7 @@ function BannerFunctionBodyDeclaration(props) {
23
23
  const title = (0, _alloy_js_core.computed)(() => (0, _shell_shock_core_plugin_utils.getAppTitle)(context, true).replace(`v${context.packageJson.version || "1.0.0"}`, ""));
24
24
  const description = (0, _alloy_js_core.computed)(() => command?.description || (0, _shell_shock_core_plugin_utils.getAppDescription)(context));
25
25
  const titleLines = (0, _alloy_js_core.computed)(() => {
26
- const result = context.config.banner.title ? { array: context.config.banner.title.split("\n") } : (0, cfonts.render)((0, _shell_shock_core_plugin_utils.getAppTitle)(context, true), {
26
+ const result = (0, cfonts.render)((0, _shell_shock_core_plugin_utils.getAppTitle)(context, true), {
27
27
  font: "tiny",
28
28
  align: "left",
29
29
  background: "transparent",
@@ -54,7 +54,13 @@ function BannerFunctionBodyDeclaration(props) {
54
54
  insertNewlineAfterDescription: true,
55
55
  get children() {
56
56
  return _alloy_js_core.code`const titleLines = [${titleLines.value.map((line) => JSON.stringify(line.trim())).join(", ")}];
57
- const title = Math.max(...titleLines.map(line => stripAnsi(line).length)) > Math.max(process.stdout.columns - ${totalPadding.value}, 0) ? "${title.value}" : \`\\n\${titleLines.join("\\n")}\\n\`; `;
57
+ const title = Math.max(...titleLines.map(line => stripAnsi(line).length)) > Math.max(process.stdout.columns + ${totalPadding.value}, 20) ? "${title.value}" : \`\\n\${titleLines.join("\\n")}\\n\`;
58
+
59
+ splitText(title,
60
+ Math.max(process.stdout.columns - ${totalPadding.value}, 20)
61
+ ).forEach((line) => {
62
+ writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.bold(colors.text.banner.title.${variant}(line)) + " ".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} });
63
+ }); `;
58
64
  }
59
65
  });
60
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"banner-builtin.d.cts","names":[],"sources":["../../src/components/banner-builtin.tsx"],"mappings":";;;;;;;;;iBAqCgB,6BAAA,CACd,KAAA,EAAO,IAAA,CACL,kCAAA,yCADS,iBAAA,CAGV,QAAA;AAAA,KAyES,kBAAA,GAAqB,IAAA,CAC/B,gBAAA;;;;EAMA,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,aAAA,CAAc,KAAA,EAAO,kBAAA,GAAkB,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"banner-builtin.d.cts","names":[],"sources":["../../src/components/banner-builtin.tsx"],"mappings":";;;;;;;;;iBAqCgB,6BAAA,CACd,KAAA,EAAO,IAAA,CACL,kCAAA,yCADS,iBAAA,CAGV,QAAA;AAAA,KAyFS,kBAAA,GAAqB,IAAA,CAC/B,gBAAA;;;;EAMA,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,aAAA,CAAc,KAAA,EAAO,kBAAA,GAAkB,iBAAA,CAAA,QAAA"}
@@ -1,7 +1,7 @@
1
1
  import { BannerFunctionBodyDeclarationProps } from "../plugin-banner/dist/components/banner-function-declaration.mjs";
2
2
  import * as _$_alloy_js_core0 from "@alloy-js/core";
3
- import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
4
3
  import { CommandTree } from "@shell-shock/core";
4
+ import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
5
5
 
6
6
  //#region src/components/banner-builtin.d.ts
7
7
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"banner-builtin.d.mts","names":[],"sources":["../../src/components/banner-builtin.tsx"],"mappings":";;;;;;;;;iBAqCgB,6BAAA,CACd,KAAA,EAAO,IAAA,CACL,kCAAA,yCADS,iBAAA,CAGV,QAAA;AAAA,KAyES,kBAAA,GAAqB,IAAA,CAC/B,gBAAA;;;;EAMA,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,aAAA,CAAc,KAAA,EAAO,kBAAA,GAAkB,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"banner-builtin.d.mts","names":[],"sources":["../../src/components/banner-builtin.tsx"],"mappings":";;;;;;;;;iBAqCgB,6BAAA,CACd,KAAA,EAAO,IAAA,CACL,kCAAA,yCADS,iBAAA,CAGV,QAAA;AAAA,KAyFS,kBAAA,GAAqB,IAAA,CAC/B,gBAAA;;;;EAMA,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,aAAA,CAAc,KAAA,EAAO,kBAAA,GAAkB,iBAAA,CAAA,QAAA"}
@@ -3,8 +3,8 @@ import { BannerBuiltin as BannerBuiltin$1 } from "../plugin-banner/dist/componen
3
3
  import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
4
4
  import { Show, code, computed, splitProps } from "@alloy-js/core";
5
5
  import { getAppDescription, getAppTitle } from "@shell-shock/core/plugin-utils";
6
- import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
7
6
  import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
7
+ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
8
8
  import { useTheme } from "@shell-shock/plugin-theme/contexts/theme";
9
9
  import { render } from "cfonts";
10
10
 
@@ -21,7 +21,7 @@ function BannerFunctionBodyDeclaration(props) {
21
21
  const title = computed(() => getAppTitle(context, true).replace(`v${context.packageJson.version || "1.0.0"}`, ""));
22
22
  const description = computed(() => command?.description || getAppDescription(context));
23
23
  const titleLines = computed(() => {
24
- const result = context.config.banner.title ? { array: context.config.banner.title.split("\n") } : render(getAppTitle(context, true), {
24
+ const result = render(getAppTitle(context, true), {
25
25
  font: "tiny",
26
26
  align: "left",
27
27
  background: "transparent",
@@ -52,7 +52,13 @@ function BannerFunctionBodyDeclaration(props) {
52
52
  insertNewlineAfterDescription: true,
53
53
  get children() {
54
54
  return code`const titleLines = [${titleLines.value.map((line) => JSON.stringify(line.trim())).join(", ")}];
55
- const title = Math.max(...titleLines.map(line => stripAnsi(line).length)) > Math.max(process.stdout.columns - ${totalPadding.value}, 0) ? "${title.value}" : \`\\n\${titleLines.join("\\n")}\\n\`; `;
55
+ const title = Math.max(...titleLines.map(line => stripAnsi(line).length)) > Math.max(process.stdout.columns + ${totalPadding.value}, 20) ? "${title.value}" : \`\\n\${titleLines.join("\\n")}\\n\`;
56
+
57
+ splitText(title,
58
+ Math.max(process.stdout.columns - ${totalPadding.value}, 20)
59
+ ).forEach((line) => {
60
+ writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.bold(colors.text.banner.title.${variant}(line)) + " ".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} });
61
+ }); `;
56
62
  }
57
63
  });
58
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"banner-builtin.mjs","names":[],"sources":["../../src/components/banner-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed, Show, splitProps } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { BuiltinFileProps } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport type { CommandTree } from \"@shell-shock/core\";\nimport { getAppDescription, getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { BannerBuiltin as BaseBannerBuiltin } from \"@shell-shock/plugin-banner/components/banner-builtin\";\nimport type { BannerFunctionBodyDeclarationProps } from \"@shell-shock/plugin-banner/components/banner-function-declaration\";\nimport {\n BannerFunctionDeclarationWrapper,\n BannerFunctionBodyDeclaration as BaseBannerFunctionBodyDeclaration\n} from \"@shell-shock/plugin-banner/components/banner-function-declaration\";\nimport { useTheme } from \"@shell-shock/plugin-theme/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 BannerFunctionBodyDeclaration(\n props: Omit<\n BannerFunctionBodyDeclarationProps,\n \"header\" | \"description\" | \"footer\"\n >\n) {\n const { consoleFnName = \"log\", variant = \"primary\", command } = props;\n\n const theme = useTheme();\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 = context.config.banner.title\n ? { array: context.config.banner.title.split(\"\\n\") }\n : 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 ?? 0) +\n (theme.borderStyles.banner.outline[variant]?.right.length ?? 0)\n );\n const totalPadding = computed(\n () => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value\n );\n\n return (\n <BaseBannerFunctionBodyDeclaration\n header={header.value}\n description={description.value}\n footer={footer.value}\n variant={variant}\n consoleFnName={consoleFnName}\n command={command}\n insertNewlineAfterDescription>\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 </BaseBannerFunctionBodyDeclaration>\n );\n}\n\nexport type BannerBuiltinProps = Omit<\n BuiltinFileProps,\n \"id\" | \"description\"\n> & {\n /**\n * The command to generate the `banner` function declaration for.\n */\n command: CommandTree;\n};\n\n/**\n * A built-in banner module for Shell Shock.\n */\nexport function BannerBuiltin(props: BannerBuiltinProps) {\n const [{ command, children }, rest] = splitProps(props, [\n \"command\",\n \"children\"\n ]);\n\n return (\n <BaseBannerBuiltin {...rest} command={command}>\n <BannerFunctionDeclarationWrapper command={command}>\n <BannerFunctionBodyDeclaration command={command} />\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BannerFunctionDeclarationWrapper>\n </BaseBannerBuiltin>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAmCA,SAAe,8BAAyB,OAAoD;CAC1F,MAAA,EACF,gBAAgB,OACd,UAAW,WACT,YACC;CACH,MAAA,QAAA,UAAA;CACA,MAAA,UAAA,eAAA;CACA,MAAM,SAAE,eAAsB,GAAC,MAAQ,OAAG,OAAU,OAAQ,YAAS,YAAA,QAAA,CAAA,IAAA,QAAA,YAAA,WAAA,UAAA;;CAErE,MAAM,QAAQ,eAAU,YAAA,SAAA,KAAA,CAAA,QAAA,IAAA,QAAA,YAAA,WAAA,WAAA,GAAA,CAAA;CACxB,MAAM,cAAU,eAAc,SAAA,eAAmB,kBAAA,QAAA,CAAA;;EAEjD,MAAM,SAAS,QAAQ,OAAA,OAAA,QAAA,EACnB,OAAE,QAAA,OAAA,OAAA,MAAA,MAAA,KAAA,EACH,GAAG,OAAO,YAAO,SAAc,KAAA,EAAO;GACrC,MAAE;GACF,OAAC;GACJ,YAAA;GACD,eAAe;GACf,YAAc;GACZ,UAAY;GACV,oBAAY;GACZ,KAAC;GACH,CAAA;AACD,MAAA,CAAA,OACD,QAAM,CAAA,GAAA,YAAc,SAAQ,KAAA,CAAA,yBAAA;AAE3B,SAAA,OAAA;;CAED,MAAM,gBAAa,eAAe,KAAA,IAAA,MAAA,QAAA,KAAA,EAAA,GAAA,KAAA,MAAA,aAAA,OAAA,QAAA,UAAA,KAAA,UAAA,MAAA,MAAA,aAAA,OAAA,QAAA,UAAA,MAAA,UAAA,GAAA;CAClC,MAAE,eAAe,eAAe,KAAO,IAAA,MAAA,QAAA,QAAA,EAAA,GAAA,IAAA,cAAA,MAAA;AACvC,QAAO,gBAAgB,iCAAgC;EACrD,IAAI,SAAO;AACT,UAAI,OAAO;;EAEb,IAAI,cAAc;AAChB,UAAI,YAAe;;EAErB,IAAI,SAAE;AACJ,UAAI,OAAA;;EAEA;EACO;EACJ;EACT,+BAAA;;AAEA,UAAO,IAAM,uBAAM,WAAA,MAAA,KAAA,SAAA,KAAA,UAAA,KAAA,MAAA,CAAA,CAAA,CAAA,KAAA,KAAA,CAAA;wHACnB,aAAA,MAAA,UAAA,MAAA,MAAA;;EAEF,CAAA;;;;;AAYF,SAAc,cAAY,OAAA;CACxB,MAAI,CAAA,EACF,SACA,YACC,QAAC,WAAe,OAAA,CAAA,WAAa,WAAA,CAAA;AAChC,QAAI,gBAAgB,iBAAA,WAAA,MAAA;EAChB;EACF,IAAG,WAAW;AACZ,UAAO,gBAAa,kCAAsB;IAC/B;IACT,IAAA,WAAc;AACZ,YAAA;MAAA,gBAAa,+BAAA,EACJ,SACb,CAAA;MAAA,gBAAA,SAAiC,EAAA,CAAA;MAAA,gBAAA,MAAA;OACpC,IAAA,OAAA;AACH,eAAA,QAAA,SAAA;;OAEY;OACV,CAAA;MAAA;;IAEE,CAAA;;EAED,CAAC,CAAC"}
1
+ {"version":3,"file":"banner-builtin.mjs","names":[],"sources":["../../src/components/banner-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed, Show, splitProps } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { BuiltinFileProps } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport type { CommandTree } from \"@shell-shock/core\";\nimport { getAppDescription, getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { BannerBuiltin as BaseBannerBuiltin } from \"@shell-shock/plugin-banner/components/banner-builtin\";\nimport type { BannerFunctionBodyDeclarationProps } from \"@shell-shock/plugin-banner/components/banner-function-declaration\";\nimport {\n BannerFunctionDeclarationWrapper,\n BannerFunctionBodyDeclaration as BaseBannerFunctionBodyDeclaration\n} from \"@shell-shock/plugin-banner/components/banner-function-declaration\";\nimport { useTheme } from \"@shell-shock/plugin-theme/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 BannerFunctionBodyDeclaration(\n props: Omit<\n BannerFunctionBodyDeclarationProps,\n \"header\" | \"description\" | \"footer\"\n >\n) {\n const { consoleFnName = \"log\", variant = \"primary\", command } = props;\n\n const theme = useTheme();\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 // if (isSetString(context.config.banner.title)) {\n // return context.config.banner.title.split(\"\\n\");\n // }\n\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 ?? 0) +\n (theme.borderStyles.banner.outline[variant]?.right.length ?? 0)\n );\n const totalPadding = computed(\n () => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value\n );\n\n return (\n <BaseBannerFunctionBodyDeclaration\n header={header.value}\n description={description.value}\n footer={footer.value}\n variant={variant}\n consoleFnName={consoleFnName}\n command={command}\n insertNewlineAfterDescription>\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 }, 20) ? \"${title.value}\" : \\`\\\\n\\${titleLines.join(\"\\\\n\")}\\\\n\\`;\n\n splitText(title,\n Math.max(process.stdout.columns - ${totalPadding.value}, 20)\n ).forEach((line) => {\n writeLine(colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].left\n }\") + \" \".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi(line).length + ${\n bannerPadding.value\n })) / 2), 0)) + colors.bold(colors.text.banner.title.${variant}(line)) + \" \".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi(line).length + ${\n bannerPadding.value\n })) / 2), 0)) + colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].right\n }\"), { consoleFn: console.${consoleFnName} });\n }); `}\n </BaseBannerFunctionBodyDeclaration>\n );\n}\n\nexport type BannerBuiltinProps = Omit<\n BuiltinFileProps,\n \"id\" | \"description\"\n> & {\n /**\n * The command to generate the `banner` function declaration for.\n */\n command: CommandTree;\n};\n\n/**\n * A built-in banner module for Shell Shock.\n */\nexport function BannerBuiltin(props: BannerBuiltinProps) {\n const [{ command, children }, rest] = splitProps(props, [\n \"command\",\n \"children\"\n ]);\n\n return (\n <BaseBannerBuiltin {...rest} command={command}>\n <BannerFunctionDeclarationWrapper command={command}>\n <BannerFunctionBodyDeclaration command={command} />\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BannerFunctionDeclarationWrapper>\n </BaseBannerBuiltin>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAmCA,SAAe,8BAAyB,OAAoD;CAC1F,MAAA,EACF,gBAAgB,OACd,UAAW,WACT,YACC;CACH,MAAA,QAAA,UAAA;CACA,MAAA,UAAA,eAAA;CACA,MAAM,SAAE,eAAsB,GAAC,MAAQ,OAAG,OAAU,OAAQ,YAAS,YAAA,QAAA,CAAA,IAAA,QAAA,YAAA,WAAA,UAAA;;CAErE,MAAM,QAAQ,eAAU,YAAA,SAAA,KAAA,CAAA,QAAA,IAAA,QAAA,YAAA,WAAA,WAAA,GAAA,CAAA;CACxB,MAAM,cAAU,eAAc,SAAA,eAAmB,kBAAA,QAAA,CAAA;;EAM/C,MAAG,SAAA,OAAA,YAAA,SAAA,KAAA,EAAA;GACJ,MAAA;GACD,OAAM;GACN,YAAc;GACZ,eAAY;GACV,YAAY;GACZ,UAAC;GACH,oBAAA;GACD,KAAA;GACD,CAAA;AACE,MAAI,CAAC,OACN,QAAA,CAAA,GAAA,YAAA,SAAA,KAAA,CAAA,yBAAA;AAED,SAAM,OAAU;GACd;CACF,MAAM,gBAAgB,eAAc,KAAM,IAAA,MAAU,QAAC,KAAA,EAAA,GAAA,KAAA,MAAA,aAAA,OAAA,QAAA,UAAA,KAAA,UAAA,MAAA,MAAA,aAAA,OAAA,QAAA,UAAA,MAAA,UAAA,GAAA;CACrD,MAAK,eAAA,eAAA,KAAA,IAAA,MAAA,QAAA,QAAA,EAAA,GAAA,IAAA,cAAA,MAAA;;EAEH,IAAA,SAAa;AACX,UAAO,OAAK;;EAEd,IAAE,cAAa;AACb,UAAA,YAAgB;;EAElB,IAAE,SAAU;AACV,UAAA,OAAA;;EAEA;EACW;EACJ;EACT,+BAAA;;AAEA,UAAO,IAAM,uBAAM,WAAA,MAAA,KAAA,SAAA,KAAA,UAAA,KAAA,MAAA,CAAA,CAAA,CAAA,KAAA,KAAA,CAAA;sHACnB,aAAA,MAAA,WAAA,MAAA,MAAA;;;4CAGI,aAAA,MAAA;;iDAEyC,QAAO,IAAA,MAAW,aAAE,OAAA,QAAA,SAAA,KAAA,0FAAA,cAAA,MAAA,sDAAA,QAAA,8FAAA,cAAA,MAAA,8CAAA,QAAA,IAAA,MAAA,aAAA,OAAA,QAAA,SAAA,MAAA,2BAAA,cAAA;;;EAGnE,CAAA;;;;;AAYF,SAAM,cAAA,OAA6B;CACjC,MAAK,CAAA,EACH,SACA,YACC,QAAO,WAAY,OAAO,CAAC,WAAW,WAAW,CAAC;AACrD,QAAM,gBAAa,iBAAA,WAAA,MAAA;EACR;;AAEP,UAAA,gBAAe,kCAAA;IACJ;IACT,IAAA,WAAe;AACf,YAAS;MAAC,gBAAc,+BAA4B,EAC5C,SACL,CAAC;MAAE,gBAAgB,SAAS,EAAA,CAAK;MAAE,gBAAe,MAAS;OAC5D,IAAA,OAAa;AACT,eAAO,QAAG,SAAY;;OAEd;OACZ,CAAA;MAAA;;IAEH,CAAC;;EAEL,CAAA,CAAA"}
@@ -5,18 +5,18 @@ 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
7
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
8
- let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
9
8
  let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
9
+ let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
10
+ let _shell_shock_core = require("@shell-shock/core");
11
+ let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
10
12
  let defu = require("defu");
11
13
  defu = require_runtime.__toESM(defu);
12
14
  let _stryke_path_join = require("@stryke/path/join");
13
- let _shell_shock_core = require("@shell-shock/core");
14
15
  let _powerlines_plugin_alloy_typescript_components_entry_file = require("@powerlines/plugin-alloy/typescript/components/entry-file");
15
16
  let _shell_shock_core_components_command_validation_logic = require("@shell-shock/core/components/command-validation-logic");
16
17
  let _shell_shock_preset_script_components_command_entry = require("@shell-shock/preset-script/components/command-entry");
17
18
  let _stryke_path_find = require("@stryke/path/find");
18
19
  let _stryke_path_replace = require("@stryke/path/replace");
19
- let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
20
20
  let _stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
21
21
 
22
22
  //#region src/components/command-entry.tsx
@@ -3,17 +3,17 @@ import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
3
3
  import { For, Match, Show, Switch, code, computed } from "@alloy-js/core";
4
4
  import { ElseIfClause, IfStatement } from "@alloy-js/typescript";
5
5
  import { formatDescription, formatShortDescription, isDynamicPathSegment } from "@shell-shock/core/plugin-utils";
6
- import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
7
6
  import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
7
+ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
8
+ import { CommandParameterKinds } from "@shell-shock/core";
9
+ import { camelCase } from "@stryke/string-format/camel-case";
8
10
  import defu from "defu";
9
11
  import { joinPaths } from "@stryke/path/join";
10
- import { CommandParameterKinds } from "@shell-shock/core";
11
12
  import { EntryFile } from "@powerlines/plugin-alloy/typescript/components/entry-file";
12
13
  import { CommandValidationLogic } from "@shell-shock/core/components/command-validation-logic";
13
14
  import { CommandHandlerDeclaration } from "@shell-shock/preset-script/components/command-entry";
14
15
  import { findFilePath, relativePath } from "@stryke/path/find";
15
16
  import { replaceExtension } from "@stryke/path/replace";
16
- import { camelCase } from "@stryke/string-format/camel-case";
17
17
  import { pascalCase } from "@stryke/string-format/pascal-case";
18
18
 
19
19
  //#region src/components/command-entry.tsx
@@ -4,8 +4,8 @@ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
4
  let _alloy_js_core = require("@alloy-js/core");
5
5
  let _alloy_js_typescript = require("@alloy-js/typescript");
6
6
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
7
- let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
8
7
  let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
8
+ let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
9
9
  let _shell_shock_preset_script_components = require("@shell-shock/preset-script/components");
10
10
 
11
11
  //#region src/components/command-router.tsx
@@ -2,8 +2,8 @@ import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
2
2
  import { For, code } from "@alloy-js/core";
3
3
  import { IfStatement } from "@alloy-js/typescript";
4
4
  import { getAppBin } from "@shell-shock/core/plugin-utils";
5
- import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
6
5
  import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
6
+ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
7
7
  import { CommandRouter as CommandRouter$1, CommandRouterBody } from "@shell-shock/preset-script/components";
8
8
 
9
9
  //#region src/components/command-router.tsx
@@ -4,8 +4,8 @@ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
4
  let _alloy_js_core = require("@alloy-js/core");
5
5
  let _alloy_js_typescript = require("@alloy-js/typescript");
6
6
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
7
- let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
8
7
  let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
8
+ let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
9
9
  let defu = require("defu");
10
10
  let _shell_shock_plugin_upgrade_components_upgrade_builtin = require("@shell-shock/plugin-upgrade/components/upgrade-builtin");
11
11
 
@@ -2,8 +2,8 @@ import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
2
2
  import { Show, code, splitProps } from "@alloy-js/core";
3
3
  import { ElseClause, ElseIfClause, FunctionDeclaration, IfStatement, VarDeclaration } from "@alloy-js/typescript";
4
4
  import { getAppBin, getAppTitle } from "@shell-shock/core/plugin-utils";
5
- import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
6
5
  import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
6
+ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
7
7
  import { defu as defu$1 } from "defu";
8
8
  import { UpgradeBuiltin as UpgradeBuiltin$1 } from "@shell-shock/plugin-upgrade/components/upgrade-builtin";
9
9
 
package/dist/index.cjs CHANGED
@@ -1,13 +1,11 @@
1
1
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
2
  const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- const require_index = require('./plugin-banner/dist/index.cjs');
4
- const require_index$1 = require('./plugin-help/dist/index.cjs');
3
+ const require_index = require('./plugin-help/dist/index.cjs');
5
4
  const require_components_banner_builtin = require('./components/banner-builtin.cjs');
6
5
  const require_components_command_router = require('./components/command-router.cjs');
7
6
  const require_components_virtual_command_entry = require('./components/virtual-command-entry.cjs');
8
7
  const require_components_command_entry = require('./components/command-entry.cjs');
9
8
  const require_components_upgrade_builtin = require('./components/upgrade-builtin.cjs');
10
- require('./components/index.cjs');
11
9
  const require_get_default_options = require('./helpers/get-default-options.cjs');
12
10
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
13
11
  let _alloy_js_core = require("@alloy-js/core");
@@ -15,9 +13,9 @@ let _alloy_js_typescript = require("@alloy-js/typescript");
15
13
  let _powerlines_plugin_alloy_core_components = require("@powerlines/plugin-alloy/core/components");
16
14
  let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
17
15
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
18
- let _stryke_path = require("@stryke/path");
19
16
  let _shell_shock_plugin_console = require("@shell-shock/plugin-console");
20
17
  _shell_shock_plugin_console = require_runtime.__toESM(_shell_shock_plugin_console);
18
+ let _stryke_path = require("@stryke/path");
21
19
  let _shell_shock_plugin_prompts = require("@shell-shock/plugin-prompts");
22
20
  _shell_shock_plugin_prompts = require_runtime.__toESM(_shell_shock_plugin_prompts);
23
21
  let _shell_shock_plugin_upgrade = require("@shell-shock/plugin-upgrade");
@@ -34,7 +32,6 @@ let _shell_shock_preset_script_components_bin_entry = require("@shell-shock/pres
34
32
  const plugin = (options = {}) => {
35
33
  return [
36
34
  ...(0, _shell_shock_plugin_console.default)(options),
37
- ...require_index$1.plugin(options),
38
35
  ...require_index.plugin(options),
39
36
  ...(0, _shell_shock_plugin_prompts.default)(options),
40
37
  (0, _shell_shock_plugin_upgrade.default)(options),
@@ -57,7 +54,7 @@ const plugin = (options = {}) => {
57
54
  const bin = (0, _alloy_js_core.computed)(() => ({
58
55
  id: "",
59
56
  name: (0, _shell_shock_core_plugin_utils.getAppName)(this),
60
- title: (0, _shell_shock_core_plugin_utils.getAppTitle)(this),
57
+ title: "",
61
58
  description: (0, _shell_shock_core_plugin_utils.getAppDescription)(this),
62
59
  isVirtual: true,
63
60
  path: null,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AAkDA;;;;cAAa,MAAA,oBAA2B,gBAAA,GAAmB,gBAAA,EACzD,OAAA,GAAS,gBAAA,KACR,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AAgDA;;;;cAAa,MAAA,oBAA2B,gBAAA,GAAmB,gBAAA,EACzD,OAAA,GAAS,gBAAA,KACR,MAAA,CAAO,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AAkDA;;;;cAAa,MAAA,oBAA2B,gBAAA,GAAmB,gBAAA,EACzD,OAAA,GAAS,gBAAA,KACR,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AAgDA;;;;cAAa,MAAA,oBAA2B,gBAAA,GAAmB,gBAAA,EACzD,OAAA,GAAS,gBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.mjs CHANGED
@@ -1,20 +1,18 @@
1
- import { plugin as plugin$1 } from "./plugin-banner/dist/index.mjs";
2
- import { plugin as plugin$2 } from "./plugin-help/dist/index.mjs";
1
+ import { plugin as plugin$1 } from "./plugin-help/dist/index.mjs";
3
2
  import { BannerBuiltin } from "./components/banner-builtin.mjs";
4
3
  import { CommandRouter } from "./components/command-router.mjs";
5
4
  import { VirtualCommandEntry } from "./components/virtual-command-entry.mjs";
6
5
  import { CommandEntry } from "./components/command-entry.mjs";
7
6
  import { UpgradeBuiltin } from "./components/upgrade-builtin.mjs";
8
- import "./components/index.mjs";
9
7
  import { getDefaultOptions } from "./helpers/get-default-options.mjs";
10
8
  import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
11
9
  import { For, Show, code, computed } from "@alloy-js/core";
12
10
  import { VarDeclaration } from "@alloy-js/typescript";
13
11
  import { Spacing } from "@powerlines/plugin-alloy/core/components";
14
12
  import { render } from "@powerlines/plugin-alloy/render";
15
- import { getAppDescription, getAppName, getAppTitle, getCommandList } from "@shell-shock/core/plugin-utils";
16
- import { joinPaths } from "@stryke/path";
13
+ import { getAppDescription, getAppName, getCommandList } from "@shell-shock/core/plugin-utils";
17
14
  import console from "@shell-shock/plugin-console";
15
+ import { joinPaths } from "@stryke/path";
18
16
  import prompts from "@shell-shock/plugin-prompts";
19
17
  import upgrade from "@shell-shock/plugin-upgrade";
20
18
  import { BinEntry } from "@shell-shock/preset-script/components/bin-entry";
@@ -29,7 +27,6 @@ import { BinEntry } from "@shell-shock/preset-script/components/bin-entry";
29
27
  const plugin = (options = {}) => {
30
28
  return [
31
29
  ...console(options),
32
- ...plugin$2(options),
33
30
  ...plugin$1(options),
34
31
  ...prompts(options),
35
32
  upgrade(options),
@@ -52,7 +49,7 @@ const plugin = (options = {}) => {
52
49
  const bin = computed(() => ({
53
50
  id: "",
54
51
  name: getAppName(this),
55
- title: getAppTitle(this),
52
+ title: "",
56
53
  description: getAppDescription(this),
57
54
  isVirtual: true,
58
55
  path: null,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"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, computed, For, Show } from \"@alloy-js/core\";\nimport { VarDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport {\n getAppDescription,\n getAppName,\n getAppTitle,\n getCommandList\n} from \"@shell-shock/core/plugin-utils\";\nimport banner from \"@shell-shock/plugin-banner\";\nimport console from \"@shell-shock/plugin-console\";\nimport help from \"@shell-shock/plugin-help\";\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 { joinPaths } from \"@stryke/path\";\nimport type { Plugin } from \"powerlines\";\nimport { BannerBuiltin } from \"./components\";\nimport { CommandEntry } from \"./components/command-entry\";\nimport { CommandRouter } from \"./components/command-router\";\nimport { UpgradeBuiltin } from \"./components/upgrade-builtin\";\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): Plugin<TContext>[] => {\n return [\n ...console<TContext>(options),\n ...help<TContext>(options),\n ...banner<TContext>(options),\n ...prompts<TContext>(options),\n upgrade<TContext>(options),\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 prepare: {\n order: \"post\",\n async handler() {\n this.debug(\"Rendering built-in modules.\");\n\n const commands = await getCommandList(this);\n this.debug(\n `Rendering \\`banner\\` built-ins for each of the ${\n commands.length\n } command modules.`\n );\n\n const bin = computed(() => ({\n id: \"\",\n name: getAppName(this),\n title: getAppTitle(this),\n description: getAppDescription(this),\n isVirtual: true,\n path: null,\n segments: [],\n alias: [],\n tags: [],\n options: Object.fromEntries(\n this.options.map(option => [option.name, option])\n ),\n entry: {\n file: joinPaths(this.entryPath, \"bin.ts\")\n },\n args: [],\n parent: null,\n children: this.commands\n }));\n\n return render(\n this,\n <>\n <UpgradeBuiltin />\n <BannerBuiltin command={bin.value} />\n <Spacing />\n <For\n each={commands.sort((a, b) => a.name.localeCompare(b.name))}\n doubleHardline>\n {command => <BannerBuiltin command={command} />}\n </For>\n </>\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 \"info\",\n \"debug\",\n \"warn\",\n \"help\",\n \"error\",\n \"cursor\",\n \"divider\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\",\n \"colors\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"isMinimal\",\n \"isInteractive\",\n \"isHelp\"\n ],\n prompts: [\n \"text\",\n \"numeric\",\n \"toggle\",\n \"select\",\n \"confirm\",\n \"isCancel\"\n ],\n env: [\"env\", \"paths\"],\n upgrade: [\"executeUpgrade\"]\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 showBanner(0);`}\n <Spacing />\n {code`return showHelp(); `}\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 ];\n};\n\nexport default plugin;\n"],"mappings":"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"}
1
+ {"version":3,"file":"index.mjs","names":[],"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, computed, For, Show } from \"@alloy-js/core\";\nimport { VarDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport {\n getAppDescription,\n getAppName,\n getCommandList\n} from \"@shell-shock/core/plugin-utils\";\nimport console from \"@shell-shock/plugin-console\";\nimport help from \"@shell-shock/plugin-help\";\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 { joinPaths } from \"@stryke/path\";\nimport type { Plugin } from \"powerlines\";\nimport { BannerBuiltin } from \"./components/banner-builtin\";\nimport { CommandEntry } from \"./components/command-entry\";\nimport { CommandRouter } from \"./components/command-router\";\nimport { UpgradeBuiltin } from \"./components/upgrade-builtin\";\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): Plugin<TContext>[] => {\n return [\n ...console<TContext>(options),\n ...help<TContext>(options),\n ...prompts<TContext>(options),\n upgrade<TContext>(options),\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 prepare: {\n order: \"post\",\n async handler() {\n this.debug(\"Rendering built-in modules.\");\n\n const commands = await getCommandList(this);\n this.debug(\n `Rendering \\`banner\\` built-ins for each of the ${\n commands.length\n } command modules.`\n );\n\n const bin = computed(() => ({\n id: \"\",\n name: getAppName(this),\n title: \"\",\n description: getAppDescription(this),\n isVirtual: true,\n path: null,\n segments: [],\n alias: [],\n tags: [],\n options: Object.fromEntries(\n this.options.map(option => [option.name, option])\n ),\n entry: {\n file: joinPaths(this.entryPath, \"bin.ts\")\n },\n args: [],\n parent: null,\n children: this.commands\n }));\n\n return render(\n this,\n <>\n <UpgradeBuiltin />\n <BannerBuiltin command={bin.value} />\n <Spacing />\n <For\n each={commands.sort((a, b) => a.name.localeCompare(b.name))}\n doubleHardline>\n {command => <BannerBuiltin command={command} />}\n </For>\n </>\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 \"info\",\n \"debug\",\n \"warn\",\n \"help\",\n \"error\",\n \"cursor\",\n \"divider\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\",\n \"colors\"\n ],\n utils: [\n \"useApp\",\n \"useArgs\",\n \"isMinimal\",\n \"isInteractive\",\n \"isHelp\"\n ],\n prompts: [\n \"text\",\n \"numeric\",\n \"toggle\",\n \"select\",\n \"confirm\",\n \"isCancel\"\n ],\n env: [\"env\", \"paths\"],\n upgrade: [\"executeUpgrade\"]\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 showBanner(0);`}\n <Spacing />\n {code`return showHelp(); `}\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 ];\n};\n\nexport default plugin;\n"],"mappings":"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"}
@@ -4,10 +4,10 @@ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
4
  let _alloy_js_core = require("@alloy-js/core");
5
5
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
6
6
  let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
7
- let _powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
8
- let _stryke_path = require("@stryke/path");
9
7
  let defu = require("defu");
10
8
  defu = require_runtime.__toESM(defu);
9
+ let _powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
10
+ let _stryke_path = require("@stryke/path");
11
11
 
12
12
  //#region ../plugin-banner/dist/components/banner-builtin.mjs
13
13
  /**
@@ -3,9 +3,9 @@ import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
3
3
  import { Show, splitProps } from "@alloy-js/core";
4
4
  import { getAppTitle, isDynamicPathSegment } from "@shell-shock/core/plugin-utils";
5
5
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
6
+ import defu from "defu";
6
7
  import { BuiltinFile } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
7
8
  import { joinPaths } from "@stryke/path";
8
- import defu from "defu";
9
9
 
10
10
  //#region ../plugin-banner/dist/components/banner-builtin.mjs
11
11
  /**
@@ -3,8 +3,9 @@ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
3
  let _alloy_js_core = require("@alloy-js/core");
4
4
  let _alloy_js_typescript = require("@alloy-js/typescript");
5
5
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
6
- let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
6
+ let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
7
7
  let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
8
+ let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
8
9
  let _shell_shock_plugin_theme_contexts_theme = require("@shell-shock/plugin-theme/contexts/theme");
9
10
 
10
11
  //#region ../plugin-banner/dist/components/banner-function-declaration.mjs
@@ -55,8 +56,6 @@ function BannerFunctionBodyDeclaration(props) {
55
56
  }
56
57
 
57
58
  useApp().set("banner", true); `,
58
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
59
- children,
60
59
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
61
60
  (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
62
61
  when: insertNewlineBeforeBanner,
@@ -64,24 +63,49 @@ function BannerFunctionBodyDeclaration(props) {
64
63
  }),
65
64
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
66
65
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
67
- writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].topLeft}") + ${theme.icons.banner.header[variant] ? `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}".repeat(6)) + " " + ${theme.icons.banner.header[variant] ? `colors.text.banner.header.${variant}("${theme.icons.banner.header[variant]}") + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}") + " " +` : ""} colors.bold(colors.text.banner.header.${variant}("${header}")) + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}".repeat(Math.max(process.stdout.columns - ${6 + (theme.icons.banner.header[variant] ? theme.icons.banner.header[variant].length + 3 : 0) + (header ? header.length + 2 : 0) + bannerPadding.value}, 0)))` : `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}".repeat(Math.max(process.stdout.columns - ${bannerPadding.value}, 0)))`} + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].topRight}"), { consoleFn: console.${consoleFnName} });
68
-
69
- ${title ? title.split("\n").map((line) => `splitText("${line}",
70
- Math.max(process.stdout.columns - ${totalPadding.value}, 0)
71
- ).forEach((line) => {
72
- writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.bold(colors.text.banner.title.${variant}(line)) + " ".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} });
73
- }); `) : `splitText(title,
74
- Math.max(process.stdout.columns - ${totalPadding.value}, 0)
66
+ writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].topLeft}") + ${theme.icons.banner.header[variant] ? `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}".repeat(6)) + " " + ${theme.icons.banner.header[variant] ? `colors.text.banner.header.${variant}("${theme.icons.banner.header[variant]}") + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}") + " " +` : ""} colors.bold(colors.text.banner.header.${variant}("${header}")) + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}".repeat(Math.max(process.stdout.columns - ${6 + (theme.icons.banner.header[variant] ? theme.icons.banner.header[variant].length + 3 : 0) + (header ? header.length + 2 : 0) + bannerPadding.value}, 0)))` : `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}".repeat(Math.max(process.stdout.columns - ${bannerPadding.value}, 0)))`} + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].topRight}"), { consoleFn: console.${consoleFnName} }); `),
67
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
68
+ when: !!children,
69
+ get fallback() {
70
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
71
+ get when() {
72
+ return (0, _stryke_type_checks_is_set_string.isSetString)(title);
73
+ },
74
+ get children() {
75
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
76
+ get each() {
77
+ return title ? title.split("\n") : [];
78
+ },
79
+ hardline: true,
80
+ children: (line) => _alloy_js_core.code`splitText("${line}",
81
+ Math.max(process.stdout.columns - ${totalPadding.value}, 20)
75
82
  ).forEach((line) => {
76
83
  writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.bold(colors.text.banner.title.${variant}(line)) + " ".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} });
77
- });`}
78
-
79
- ${command?.title ? `${insertNewlineBeforeCommand ? `writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(process.stdout.columns - ${bannerPadding.value})) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} }); ` : ""}
80
- ${`writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi("${command.title}").length ${command.icon ? " + 3" : ""} + ${bannerPadding.value})) / 2), 0)) + colors.bold(colors.text.banner.command.${variant}("${command.icon ? `${command.icon} ` : ""}${command.title}")) + " ".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi("${command.title}").length ${command.icon ? " + 3" : ""} + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} }); `} ` : ""}
81
-
82
- splitText(
84
+ }); `
85
+ });
86
+ }
87
+ });
88
+ },
89
+ children
90
+ }),
91
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
92
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
93
+ get when() {
94
+ return (0, _stryke_type_checks_is_set_string.isSetString)(command?.title) && !!command?.path;
95
+ },
96
+ get children() {
97
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
98
+ when: insertNewlineBeforeCommand,
99
+ get children() {
100
+ return _alloy_js_core.code`writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(process.stdout.columns - ${bannerPadding.value})) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} }); `;
101
+ }
102
+ }), (0, _alloy_js_core_jsx_runtime.memo)(() => `writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi("${command?.title}").length ${command?.icon ? " + 3" : ""} + ${bannerPadding.value})) / 2), 0)) + colors.bold(colors.text.banner.command.${variant}("${command?.icon ? `${command.icon} ` : ""}${command?.title}")) + " ".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi("${command?.title}").length ${command?.icon ? " + 3" : ""} + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} }); `)];
103
+ }
104
+ }),
105
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
106
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`splitText(
83
107
  colors.bold(${command?.title ? "colors.text.banner.description" : "colors.text.banner.command"}.${variant}(\`${(0, _shell_shock_core_plugin_utils.formatDescription)(description)}\`)),
84
- Math.max(${command?.title ? `${totalPadding.value} * 2 > process.stdout.columns / 2 ? process.stdout.columns - 6 : process.stdout.columns - ${totalPadding.value}` : `process.stdout.columns - ${totalPadding.value}`} , 0)
108
+ Math.max(${command?.title ? `${totalPadding.value} * 2 > process.stdout.columns / 2 ? process.stdout.columns - 6 : process.stdout.columns - ${totalPadding.value}` : `process.stdout.columns - ${totalPadding.value}`} , 20)
85
109
  ).forEach((line) => {
86
110
  writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.text.banner.description.${variant}(line) + " ".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} });
87
111
  });
@@ -110,7 +134,7 @@ function BannerFunctionDeclaration(props) {
110
134
  get children() {
111
135
  return (0, _alloy_js_core_jsx_runtime.createComponent)(BannerFunctionBodyDeclaration, {
112
136
  get title() {
113
- return title.value;
137
+ return !children ? title.value : void 0;
114
138
  },
115
139
  get header() {
116
140
  return header.value;