@shell-shock/preset-cli 0.8.4 → 0.8.5

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 (54) hide show
  1. package/README.md +1 -1
  2. package/dist/components/{banner-function-declaration.cjs → banner-builtin.cjs} +47 -36
  3. package/dist/components/banner-builtin.d.cts +23 -0
  4. package/dist/components/banner-builtin.d.cts.map +1 -0
  5. package/dist/components/banner-builtin.d.mts +23 -0
  6. package/dist/components/banner-builtin.d.mts.map +1 -0
  7. package/dist/components/banner-builtin.mjs +88 -0
  8. package/dist/components/banner-builtin.mjs.map +1 -0
  9. package/dist/components/command-entry.cjs +182 -186
  10. package/dist/components/command-entry.d.cts +1 -1
  11. package/dist/components/command-entry.d.cts.map +1 -1
  12. package/dist/components/command-entry.d.mts.map +1 -1
  13. package/dist/components/command-entry.mjs +182 -186
  14. package/dist/components/command-entry.mjs.map +1 -1
  15. package/dist/components/command-router.cjs +1 -1
  16. package/dist/components/command-router.mjs +1 -1
  17. package/dist/components/command-router.mjs.map +1 -1
  18. package/dist/components/index.cjs +3 -2
  19. package/dist/components/index.d.cts +2 -2
  20. package/dist/components/index.d.mts +2 -2
  21. package/dist/components/index.mjs +2 -2
  22. package/dist/components/virtual-command-entry.cjs +18 -22
  23. package/dist/components/virtual-command-entry.d.cts +1 -1
  24. package/dist/components/virtual-command-entry.d.cts.map +1 -1
  25. package/dist/components/virtual-command-entry.d.mts.map +1 -1
  26. package/dist/components/virtual-command-entry.mjs +18 -22
  27. package/dist/components/virtual-command-entry.mjs.map +1 -1
  28. package/dist/index.cjs +37 -7
  29. package/dist/index.d.cts.map +1 -1
  30. package/dist/index.d.mts.map +1 -1
  31. package/dist/index.mjs +38 -8
  32. package/dist/index.mjs.map +1 -1
  33. package/dist/plugin-banner/dist/components/banner-builtin.cjs +63 -0
  34. package/dist/plugin-banner/dist/components/banner-builtin.mjs +62 -0
  35. package/dist/plugin-banner/dist/components/banner-builtin.mjs.map +1 -0
  36. package/dist/plugin-banner/dist/components/banner-function-declaration.cjs +135 -0
  37. package/dist/plugin-banner/dist/components/banner-function-declaration.d.cts +45 -0
  38. package/dist/plugin-banner/dist/components/banner-function-declaration.d.cts.map +1 -0
  39. package/dist/plugin-banner/dist/components/banner-function-declaration.d.mts +45 -0
  40. package/dist/plugin-banner/dist/components/banner-function-declaration.d.mts.map +1 -0
  41. package/dist/plugin-banner/dist/components/banner-function-declaration.mjs +133 -0
  42. package/dist/plugin-banner/dist/components/banner-function-declaration.mjs.map +1 -0
  43. package/dist/plugin-help/dist/components/display.cjs +14 -0
  44. package/dist/plugin-help/dist/components/display.mjs +14 -0
  45. package/dist/plugin-help/dist/components/display.mjs.map +1 -1
  46. package/dist/plugin-help/dist/index.cjs +1 -1
  47. package/dist/plugin-help/dist/index.mjs +1 -1
  48. package/package.json +19 -19
  49. package/dist/components/banner-function-declaration.d.cts +0 -11
  50. package/dist/components/banner-function-declaration.d.cts.map +0 -1
  51. package/dist/components/banner-function-declaration.d.mts +0 -11
  52. package/dist/components/banner-function-declaration.d.mts.map +0 -1
  53. package/dist/components/banner-function-declaration.mjs +0 -78
  54. package/dist/components/banner-function-declaration.mjs.map +0 -1
package/dist/index.mjs CHANGED
@@ -1,16 +1,19 @@
1
1
  import { plugin as plugin$1 } from "./plugin-help/dist/index.mjs";
2
- import { BannerFunctionDeclaration } from "./components/banner-function-declaration.mjs";
2
+ import { BannerBuiltin } from "./components/banner-builtin.mjs";
3
3
  import { CommandRouter } from "./components/command-router.mjs";
4
4
  import { VirtualCommandEntry } from "./components/virtual-command-entry.mjs";
5
5
  import { CommandEntry } from "./components/command-entry.mjs";
6
6
  import { UpgradeBuiltin } from "./components/upgrade-builtin.mjs";
7
+ import "./components/index.mjs";
7
8
  import { getDefaultOptions } from "./helpers/get-default-options.mjs";
8
9
  import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
9
- import { For, Show, code } from "@alloy-js/core";
10
+ import { For, Show, code, computed } from "@alloy-js/core";
10
11
  import { VarDeclaration } from "@alloy-js/typescript";
11
12
  import { Spacing } from "@powerlines/plugin-alloy/core/components";
12
13
  import { render } from "@powerlines/plugin-alloy/render";
14
+ import { getAppDescription, getAppName, getAppTitle, getCommandList } from "@shell-shock/core/plugin-utils";
13
15
  import console from "@shell-shock/plugin-console";
16
+ import { joinPaths } from "@stryke/path";
14
17
  import prompts from "@shell-shock/plugin-prompts";
15
18
  import upgrade from "@shell-shock/plugin-upgrade";
16
19
  import { BinEntry } from "@shell-shock/preset-script/components/bin-entry";
@@ -41,8 +44,38 @@ const plugin = (options = {}) => {
41
44
  prepare: {
42
45
  order: "post",
43
46
  async handler() {
44
- this.debug("Rendering upgrade built-in module.");
45
- return render(this, createComponent(UpgradeBuiltin, {}));
47
+ this.debug("Rendering built-in modules.");
48
+ const commands = await getCommandList(this);
49
+ this.debug(`Rendering \`banner\` built-ins for each of the ${commands.length} command modules.`);
50
+ const bin = computed(() => ({
51
+ id: "",
52
+ name: getAppName(this),
53
+ title: getAppTitle(this),
54
+ description: getAppDescription(this),
55
+ isVirtual: true,
56
+ path: null,
57
+ segments: [],
58
+ alias: [],
59
+ options: Object.fromEntries(this.options.map((option) => [option.name, option])),
60
+ entry: { file: joinPaths(this.entryPath, "bin.ts") },
61
+ args: [],
62
+ parent: null,
63
+ children: this.commands
64
+ }));
65
+ return render(this, [
66
+ createComponent(UpgradeBuiltin, {}),
67
+ createComponent(BannerBuiltin, { get command() {
68
+ return bin.value;
69
+ } }),
70
+ createComponent(Spacing, {}),
71
+ createComponent(For, {
72
+ get each() {
73
+ return commands.sort((a, b) => a.name.localeCompare(b.name));
74
+ },
75
+ doubleHardline: true,
76
+ children: (command) => createComponent(BannerBuiltin, { command })
77
+ })
78
+ ]);
46
79
  }
47
80
  }
48
81
  },
@@ -86,9 +119,6 @@ const plugin = (options = {}) => {
86
119
  env: ["env", "paths"],
87
120
  upgrade: ["executeUpgrade"]
88
121
  },
89
- get prefix() {
90
- return [createComponent(BannerFunctionDeclaration, {}), createComponent(Spacing, {})];
91
- },
92
122
  get children() {
93
123
  return [
94
124
  createComponent(Show, {
@@ -115,7 +145,7 @@ const plugin = (options = {}) => {
115
145
  }
116
146
  }),
117
147
  createIntrinsic("hbr", {}),
118
- code`await banner(0);`,
148
+ code`await showBanner(0);`,
119
149
  createComponent(Spacing, {}),
120
150
  code`return showHelp(); `
121
151
  ];
@@ -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, 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 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 type { Plugin } from \"powerlines\";\nimport { BannerFunctionDeclaration } from \"./components/banner-function-declaration\";\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 upgrade built-in module.\");\n\n return render(this, <UpgradeBuiltin />);\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 prefix={\n <>\n <BannerFunctionDeclaration />\n <Spacing />\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 <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":";;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAW,UAAoB,UAAA,EAAA,KAAA;AAC7B,QAAO;EAAC,GAAA,QAAe,QAAA;EAAA,GAAA,SAAA,QAAA;EAAA,GAAA,QAAA,QAAA;EAAA,QAAA,QAAA;EAAA;GACvB,MAAO;GACL,SAAG;AACD,SAAK,MAAC,oEAAkB;AACxB,WAAC;KACH,gBAAkB;KAClB,iBAAA;KACE,GAAK;KACL;;GAEF,SAAO;IACL,OAAG;;AAED,UAAA,MAAO,qCAAA;AACP,YAAE,OAAA,MAAgB,gBAAiB,gBAAA,EAAA,CAAA,CAAA;;IAEtC;GACF;EAAE;GACD,MAAG;GACH,SAAS;IACP,OAAO;IACP,MAAE,UAAc;KACd,MAAM,SAAQ;;AAEd,YAAE,OAAO,MAAW,CAAC,gBAAkB,UAAE;MACzC,gBAAA;OACF,SAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;OACD,OAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;OACD,SAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;OACQ,KAAC,CAAK,OAAO,QAAI;OACvB,SAAS,CAAA,iBAAA;OACP;MACA,IAAM,SAAS;AACb,cAAK,CAAK,gBAAA,2BAAA,EAAA,CAAA,EAAA,gBAAA,SAAA,EAAA,CAAA,CAAA;;MAEV,IAAC,WAAA;;;SAED,IAAO,OAAM;AACP,iBAAA,OAAA,KAAA,OAAA,SAAA,CAAA,SAAA;;SAEF,IAAC,WAAA;AACC,iBAAA;WAAA,gBAAgB,gBAAA;YACd,OAAO;YACP,MAAG;YACH,MAAG;YACH,aAAQ,IAAA;YACT,CAAC;WAAE,gBAAM,OAAA,EAAA,CAAA;WAAA,gBAAA,eAAA;YACR,UAAS,EAAA;YACT,IAAG,WAAO;AACR,oBAAC,OAAQ,YAAA,EAAA;;YAEZ,CAAC;WAAE,gBAAW,OAAA,EAAA,CAAA;WAAA;;SAElB,CAAC;QAAE,gBAAW,OAAA,EAAA,CAAA;QAAA,IAAA;QAAA,gBAAA,SAAA,EAAA,CAAA;QAAA,IAAA;QAAA;;MAElB,CAAC,EAAE,gBAAa,MAAA;MACf,IAAI,OAAO;AACT,cAAO,OAAE,OAAQ,OAAA,SAAA,CAAA,SAAA;;MAEnB,IAAI,WAAO;AACT,cAAO,gBAAQ,KAAA;QACb,IAAI,OAAC;AACH,gBAAE,OAAS,OAAA,OAAA,SAAA;;QAEb,gBAAe;QACf,WAAO,UAAO,gBAAA,MAAA;SACZ,IAAI,OAAO;AACT,iBAAG,MAAQ;;SAEb,IAAG,WAAA;AACD,iBAAO,gBAAc,cAAA,EACrB,SAAW,OACZ,CAAA;;SAED,IAAG,WAAA;AACD,iBAAG,gBAAA,qBAA2B,EAC5B,SAAS,OACV,CAAC;;SAEL,CAAC;QACH,CAAC;;MAEL,CAAC,CAAC,CAAC;;IAEP;GACF;EAAC"}
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 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 ...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 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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"}
@@ -0,0 +1,63 @@
1
+ const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
2
+ const require_banner_function_declaration = require('./banner-function-declaration.cjs');
3
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
+ let _alloy_js_core = require("@alloy-js/core");
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");
7
+ let defu = require("defu");
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
+
12
+ //#region ../plugin-banner/dist/components/banner-builtin.mjs
13
+ /**
14
+ * A built-in banner module for Shell Shock.
15
+ */
16
+ function BannerBuiltin(props) {
17
+ const [{ command, children }, rest] = (0, _alloy_js_core.splitProps)(props, ["command", "children"]);
18
+ const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
19
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({
20
+ get id() {
21
+ return (0, _stryke_path.joinPaths)("banner", ...command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)));
22
+ },
23
+ get description() {
24
+ return (0, _alloy_js_core_jsx_runtime.memo)(() => !!command.path)() ? `A collection of utility functions that assist in displaying banner information for the ${command.title} command.` : `A collection of utility functions that assist in displaying banner information for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} command-line interface application.`;
25
+ }
26
+ }, rest, {
27
+ get builtinImports() {
28
+ return (0, defu.default)(rest.builtinImports ?? {}, {
29
+ utils: [
30
+ "isUnicodeSupported",
31
+ "useApp",
32
+ "hasFlag",
33
+ "isMinimal",
34
+ "sleep",
35
+ "isInteractive",
36
+ "isHelp"
37
+ ],
38
+ console: [
39
+ "splitText",
40
+ "writeLine",
41
+ "colors",
42
+ "help",
43
+ "table",
44
+ "stripAnsi"
45
+ ]
46
+ });
47
+ },
48
+ get children() {
49
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
50
+ get when() {
51
+ return Boolean(children);
52
+ },
53
+ get fallback() {
54
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_banner_function_declaration.BannerFunctionDeclaration, { command });
55
+ },
56
+ children
57
+ });
58
+ }
59
+ }));
60
+ }
61
+
62
+ //#endregion
63
+ exports.BannerBuiltin = BannerBuiltin;
@@ -0,0 +1,62 @@
1
+ import { BannerFunctionDeclaration } from "./banner-function-declaration.mjs";
2
+ import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
3
+ import { Show, splitProps } from "@alloy-js/core";
4
+ import { getAppTitle, isDynamicPathSegment } from "@shell-shock/core/plugin-utils";
5
+ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
6
+ import defu from "defu";
7
+ import { BuiltinFile } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
8
+ import { joinPaths } from "@stryke/path";
9
+
10
+ //#region ../plugin-banner/dist/components/banner-builtin.mjs
11
+ /**
12
+ * A built-in banner module for Shell Shock.
13
+ */
14
+ function BannerBuiltin(props) {
15
+ const [{ command, children }, rest] = splitProps(props, ["command", "children"]);
16
+ const context = usePowerlines();
17
+ return createComponent(BuiltinFile, mergeProps({
18
+ get id() {
19
+ return joinPaths("banner", ...command.segments.filter((segment) => !isDynamicPathSegment(segment)));
20
+ },
21
+ get description() {
22
+ return memo(() => !!command.path)() ? `A collection of utility functions that assist in displaying banner information for the ${command.title} command.` : `A collection of utility functions that assist in displaying banner information for the ${getAppTitle(context, true)} command-line interface application.`;
23
+ }
24
+ }, rest, {
25
+ get builtinImports() {
26
+ return defu(rest.builtinImports ?? {}, {
27
+ utils: [
28
+ "isUnicodeSupported",
29
+ "useApp",
30
+ "hasFlag",
31
+ "isMinimal",
32
+ "sleep",
33
+ "isInteractive",
34
+ "isHelp"
35
+ ],
36
+ console: [
37
+ "splitText",
38
+ "writeLine",
39
+ "colors",
40
+ "help",
41
+ "table",
42
+ "stripAnsi"
43
+ ]
44
+ });
45
+ },
46
+ get children() {
47
+ return createComponent(Show, {
48
+ get when() {
49
+ return Boolean(children);
50
+ },
51
+ get fallback() {
52
+ return createComponent(BannerFunctionDeclaration, { command });
53
+ },
54
+ children
55
+ });
56
+ }
57
+ }));
58
+ }
59
+
60
+ //#endregion
61
+ export { BannerBuiltin };
62
+ //# sourceMappingURL=banner-builtin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"banner-builtin.mjs","names":[],"sources":["../../../../../plugin-banner/dist/components/banner-builtin.mjs"],"sourcesContent":["import { BannerFunctionDeclaration } from \"./banner-function-declaration.mjs\";\nimport { createComponent, memo, mergeProps } from \"@alloy-js/core/jsx-runtime\";\nimport { Show, splitProps } from \"@alloy-js/core\";\nimport { getAppTitle, isDynamicPathSegment } from \"@shell-shock/core/plugin-utils\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { BuiltinFile } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport { joinPaths } from \"@stryke/path\";\nimport defu from \"defu\";\n\n//#region src/components/banner-builtin.tsx\n/**\n* A built-in banner module for Shell Shock.\n*/\nfunction BannerBuiltin(props) {\n\tconst [{ command, children }, rest] = splitProps(props, [\"command\", \"children\"]);\n\tconst context = usePowerlines();\n\treturn createComponent(BuiltinFile, mergeProps({\n\t\tget id() {\n\t\t\treturn joinPaths(\"banner\", ...command.segments.filter((segment) => !isDynamicPathSegment(segment)));\n\t\t},\n\t\tget description() {\n\t\t\treturn memo(() => !!command.path)() ? `A collection of utility functions that assist in displaying banner information for the ${command.title} command.` : `A collection of utility functions that assist in displaying banner information for the ${getAppTitle(context, true)} command-line interface application.`;\n\t\t}\n\t}, rest, {\n\t\tget builtinImports() {\n\t\t\treturn defu(rest.builtinImports ?? {}, {\n\t\t\t\tutils: [\n\t\t\t\t\t\"isUnicodeSupported\",\n\t\t\t\t\t\"useApp\",\n\t\t\t\t\t\"hasFlag\",\n\t\t\t\t\t\"isMinimal\",\n\t\t\t\t\t\"sleep\",\n\t\t\t\t\t\"isInteractive\",\n\t\t\t\t\t\"isHelp\"\n\t\t\t\t],\n\t\t\t\tconsole: [\n\t\t\t\t\t\"splitText\",\n\t\t\t\t\t\"writeLine\",\n\t\t\t\t\t\"colors\",\n\t\t\t\t\t\"help\",\n\t\t\t\t\t\"table\",\n\t\t\t\t\t\"stripAnsi\"\n\t\t\t\t]\n\t\t\t});\n\t\t},\n\t\tget children() {\n\t\t\treturn createComponent(Show, {\n\t\t\t\tget when() {\n\t\t\t\t\treturn Boolean(children);\n\t\t\t\t},\n\t\t\t\tget fallback() {\n\t\t\t\t\treturn createComponent(BannerFunctionDeclaration, { command });\n\t\t\t\t},\n\t\t\t\tchildren\n\t\t\t});\n\t\t}\n\t}));\n}\n\n//#endregion\nexport { BannerBuiltin };\n//# sourceMappingURL=banner-builtin.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,cAAc,OAAO;CAC7B,MAAM,CAAC,EAAE,SAAS,YAAY,QAAQ,WAAW,OAAO,CAAC,WAAW,WAAW,CAAC;CAChF,MAAM,UAAU,eAAe;AAC/B,QAAO,gBAAgB,aAAa,WAAW;EAC9C,IAAI,KAAK;AACR,UAAO,UAAU,UAAU,GAAG,QAAQ,SAAS,QAAQ,YAAY,CAAC,qBAAqB,QAAQ,CAAC,CAAC;;EAEpG,IAAI,cAAc;AACjB,UAAO,WAAW,CAAC,CAAC,QAAQ,KAAK,EAAE,GAAG,0FAA0F,QAAQ,MAAM,aAAa,0FAA0F,YAAY,SAAS,KAAK,CAAC;;EAEjR,EAAE,MAAM;EACR,IAAI,iBAAiB;AACpB,UAAO,KAAK,KAAK,kBAAkB,EAAE,EAAE;IACtC,OAAO;KACN;KACA;KACA;KACA;KACA;KACA;KACA;KACA;IACD,SAAS;KACR;KACA;KACA;KACA;KACA;KACA;KACA;IACD,CAAC;;EAEH,IAAI,WAAW;AACd,UAAO,gBAAgB,MAAM;IAC5B,IAAI,OAAO;AACV,YAAO,QAAQ,SAAS;;IAEzB,IAAI,WAAW;AACd,YAAO,gBAAgB,2BAA2B,EAAE,SAAS,CAAC;;IAE/D;IACA,CAAC;;EAEH,CAAC,CAAC"}
@@ -0,0 +1,135 @@
1
+ const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
2
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
+ let _alloy_js_core = require("@alloy-js/core");
4
+ let _alloy_js_typescript = require("@alloy-js/typescript");
5
+ let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
6
+ let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
7
+ let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
8
+ let _shell_shock_plugin_theme_contexts_theme = require("@shell-shock/plugin-theme/contexts/theme");
9
+
10
+ //#region ../plugin-banner/dist/components/banner-function-declaration.mjs
11
+ /**
12
+ * A component to generate the `banner` function for a specific command or application.
13
+ *
14
+ * @remarks
15
+ * This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
16
+ */
17
+ function BannerFunctionDeclarationWrapper(props) {
18
+ const { command, children } = props;
19
+ const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
20
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
21
+ "export": true,
22
+ async: true,
23
+ name: "showBanner",
24
+ get doc() {
25
+ return `Write the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} command-line interface application banner ${command ? `for the ${command.title} command ` : ""}to the console.`;
26
+ },
27
+ parameters: [{
28
+ name: "sleepTimeoutMs",
29
+ type: "number",
30
+ default: 500
31
+ }],
32
+ get children() {
33
+ return [children, (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
34
+ condition: _alloy_js_core.code`isInteractive && !isHelp`,
35
+ children: _alloy_js_core.code`await sleep(sleepTimeoutMs);`
36
+ })];
37
+ }
38
+ });
39
+ }
40
+ /**
41
+ * A component to generate the `banner` function's body for a specific command or application.
42
+ *
43
+ * @remarks
44
+ * This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
45
+ */
46
+ function BannerFunctionBodyDeclaration(props) {
47
+ const { consoleFnName = "log", variant = "primary", title, header, footer, description, command, children, insertNewlineBeforeCommand = false, insertNewlineBeforeBanner = true, insertNewlineAfterDescription = false } = props;
48
+ const theme = (0, _shell_shock_plugin_theme_contexts_theme.useTheme)();
49
+ const bannerPadding = (0, _alloy_js_core.computed)(() => Math.max(theme.padding.app, 0) * 2 + theme.borderStyles.banner.outline[variant].left.length + theme.borderStyles.banner.outline[variant].right.length);
50
+ const totalPadding = (0, _alloy_js_core.computed)(() => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value);
51
+ return [
52
+ _alloy_js_core.code`
53
+ if (useApp().get("banner") || hasFlag("no-banner") || hasFlag("hide-banner") || isMinimal) {
54
+ return;
55
+ }
56
+
57
+ useApp().set("banner", true); `,
58
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
59
+ children,
60
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
61
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
62
+ when: insertNewlineBeforeBanner,
63
+ children: _alloy_js_core.code`writeLine(""); `
64
+ }),
65
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
66
+ (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
+ splitText(
70
+ ${title ? `"${title}"` : "title"},
71
+ Math.max(process.stdout.columns - ${totalPadding.value}, 0)
72
+ ).forEach((line) => {
73
+ 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} });
74
+ });
75
+
76
+ ${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} }); ` : ""}
77
+ ${`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} }); `} ` : ""}
78
+
79
+ splitText(
80
+ colors.bold(${command?.title ? "colors.text.banner.description" : "colors.text.banner.command"}.${variant}("${description.replace(/"/g, "\\\"")}")),
81
+ Math.max(process.stdout.columns - ${totalPadding.value}, 0)
82
+ ).forEach((line) => {
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.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} });
84
+ });
85
+ ${insertNewlineAfterDescription ? `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} });` : ""}
86
+ writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottomLeft}") + ${footer ? `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottom}".repeat(Math.max(process.stdout.columns - ${8 + (footer ? footer.length : 0) + bannerPadding.value}, 0))) + " " + ${footer ? `colors.bold(colors.text.banner.footer.${variant}("${footer}"))` : ""} + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottom}".repeat(6))` : `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottom}".repeat(Math.max(process.stdout.columns - ${bannerPadding.value}, 0)))`} + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottomRight}"), { consoleFn: console.${consoleFnName} });
87
+
88
+ writeLine(""); `)
89
+ ];
90
+ }
91
+ /**
92
+ * A component to generate the `banner` function for a specific command or application.
93
+ *
94
+ * @remarks
95
+ * This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
96
+ */
97
+ function BannerFunctionDeclaration(props) {
98
+ const { consoleFnName = "log", variant = "primary", command, children, insertNewlineBeforeBanner = true } = props;
99
+ const theme = (0, _shell_shock_plugin_theme_contexts_theme.useTheme)();
100
+ const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
101
+ const header = (0, _alloy_js_core.computed)(() => `${theme.labels.banner.header[variant] || (0, _shell_shock_core_plugin_utils.getAppTitle)(context, false)} v${context.packageJson.version || "1.0.0"}`);
102
+ const footer = (0, _alloy_js_core.computed)(() => theme.labels.banner.footer[variant]);
103
+ const title = (0, _alloy_js_core.computed)(() => (0, _shell_shock_core_plugin_utils.getAppTitle)(context, true).replace(`v${context.packageJson.version || "1.0.0"}`, ""));
104
+ const description = (0, _alloy_js_core.computed)(() => command?.description || (0, _shell_shock_core_plugin_utils.getAppDescription)(context));
105
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(BannerFunctionDeclarationWrapper, {
106
+ command,
107
+ get children() {
108
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(BannerFunctionBodyDeclaration, {
109
+ get title() {
110
+ return title.value;
111
+ },
112
+ get header() {
113
+ return header.value;
114
+ },
115
+ get description() {
116
+ return description.value;
117
+ },
118
+ get footer() {
119
+ return footer.value;
120
+ },
121
+ variant,
122
+ consoleFnName,
123
+ command,
124
+ insertNewlineBeforeCommand: true,
125
+ insertNewlineBeforeBanner,
126
+ children
127
+ });
128
+ }
129
+ });
130
+ }
131
+
132
+ //#endregion
133
+ exports.BannerFunctionBodyDeclaration = BannerFunctionBodyDeclaration;
134
+ exports.BannerFunctionDeclaration = BannerFunctionDeclaration;
135
+ exports.BannerFunctionDeclarationWrapper = BannerFunctionDeclarationWrapper;
@@ -0,0 +1,45 @@
1
+ import { Children } from "@alloy-js/core";
2
+ import { CommandTree } from "@shell-shock/core/types/command";
3
+ import { ThemeColorVariant } from "@shell-shock/plugin-theme/types/theme";
4
+
5
+ //#region ../plugin-banner/dist/components/banner-function-declaration.d.cts
6
+ //#region src/components/banner-function-declaration.d.ts
7
+ interface BannerFunctionDeclarationWrapperProps {
8
+ command?: CommandTree;
9
+ children?: Children;
10
+ }
11
+ /**
12
+ * A component to generate the `banner` function for a specific command or application.
13
+ *
14
+ * @remarks
15
+ * This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
16
+ */
17
+ interface BannerFunctionBodyDeclarationProps extends BannerFunctionDeclarationProps {
18
+ title?: string;
19
+ header?: string;
20
+ footer?: string;
21
+ description: string;
22
+ insertNewlineBeforeCommand?: boolean;
23
+ insertNewlineBeforeBanner?: boolean;
24
+ insertNewlineAfterDescription?: boolean;
25
+ }
26
+ /**
27
+ * A component to generate the `banner` function's body for a specific command or application.
28
+ *
29
+ * @remarks
30
+ * This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
31
+ */
32
+ interface BannerFunctionDeclarationProps extends BannerFunctionDeclarationWrapperProps {
33
+ variant?: ThemeColorVariant;
34
+ consoleFnName?: "log" | "info" | "warn" | "error" | "debug";
35
+ insertNewlineBeforeBanner?: boolean;
36
+ }
37
+ /**
38
+ * A component to generate the `banner` function for a specific command or application.
39
+ *
40
+ * @remarks
41
+ * This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
42
+ */
43
+ //#endregion
44
+ export { BannerFunctionBodyDeclarationProps };
45
+ //# sourceMappingURL=banner-function-declaration.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"banner-function-declaration.d.cts","names":["Children","CommandTree","ThemeColorVariant","BannerFunctionDeclarationWrapperProps","command","children","BannerFunctionDeclarationWrapper","props","BannerFunctionBodyDeclarationProps","BannerFunctionDeclarationProps","title","header","footer","description","insertNewlineBeforeCommand","insertNewlineBeforeBanner","insertNewlineAfterDescription","BannerFunctionBodyDeclaration","variant","consoleFnName","BannerFunctionDeclaration"],"sources":["../../../../../plugin-banner/dist/components/banner-function-declaration.d.cts"],"mappings":";;;;;;UAKUG,qCAAAA;EACRC,OAAAA,GAAUH,WAAAA;EACVI,QAAAA,GAAWL,QAAAA;AAAAA;;;;;;;UASHQ,kCAAAA,SAA2CC,8BAAAA;EACnDC,KAAAA;EACAC,MAAAA;EACAC,MAAAA;EACAC,WAAAA;EACAC,0BAAAA;EACAC,yBAAAA;EACAC,6BAAAA;AAAAA;;;;;AAQiG;;UACzFP,8BAAAA,SAAuCN,qCAAAA;EAC/Ce,OAAAA,GAAUhB,iBAAAA;EACViB,aAAAA;EACAJ,yBAAAA;AAAAA"}
@@ -0,0 +1,45 @@
1
+ import { Children } from "@alloy-js/core";
2
+ import { CommandTree } from "@shell-shock/core/types/command";
3
+ import { ThemeColorVariant } from "@shell-shock/plugin-theme/types/theme";
4
+
5
+ //#region ../plugin-banner/dist/components/banner-function-declaration.d.cts
6
+ //#region src/components/banner-function-declaration.d.ts
7
+ interface BannerFunctionDeclarationWrapperProps {
8
+ command?: CommandTree;
9
+ children?: Children;
10
+ }
11
+ /**
12
+ * A component to generate the `banner` function for a specific command or application.
13
+ *
14
+ * @remarks
15
+ * This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
16
+ */
17
+ interface BannerFunctionBodyDeclarationProps extends BannerFunctionDeclarationProps {
18
+ title?: string;
19
+ header?: string;
20
+ footer?: string;
21
+ description: string;
22
+ insertNewlineBeforeCommand?: boolean;
23
+ insertNewlineBeforeBanner?: boolean;
24
+ insertNewlineAfterDescription?: boolean;
25
+ }
26
+ /**
27
+ * A component to generate the `banner` function's body for a specific command or application.
28
+ *
29
+ * @remarks
30
+ * This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
31
+ */
32
+ interface BannerFunctionDeclarationProps extends BannerFunctionDeclarationWrapperProps {
33
+ variant?: ThemeColorVariant;
34
+ consoleFnName?: "log" | "info" | "warn" | "error" | "debug";
35
+ insertNewlineBeforeBanner?: boolean;
36
+ }
37
+ /**
38
+ * A component to generate the `banner` function for a specific command or application.
39
+ *
40
+ * @remarks
41
+ * This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
42
+ */
43
+ //#endregion
44
+ export { BannerFunctionBodyDeclarationProps };
45
+ //# sourceMappingURL=banner-function-declaration.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"banner-function-declaration.d.mts","names":["Children","CommandTree","ThemeColorVariant","BannerFunctionDeclarationWrapperProps","command","children","BannerFunctionDeclarationWrapper","props","BannerFunctionBodyDeclarationProps","BannerFunctionDeclarationProps","title","header","footer","description","insertNewlineBeforeCommand","insertNewlineBeforeBanner","insertNewlineAfterDescription","BannerFunctionBodyDeclaration","variant","consoleFnName","BannerFunctionDeclaration"],"sources":["../../../../../plugin-banner/dist/components/banner-function-declaration.d.cts"],"mappings":";;;;;;UAKUG,qCAAAA;EACRC,OAAAA,GAAUH,WAAAA;EACVI,QAAAA,GAAWL,QAAAA;AAAAA;;;;;;;UASHQ,kCAAAA,SAA2CC,8BAAAA;EACnDC,KAAAA;EACAC,MAAAA;EACAC,MAAAA;EACAC,WAAAA;EACAC,0BAAAA;EACAC,yBAAAA;EACAC,6BAAAA;AAAAA;;;;;AAQiG;;UACzFP,8BAAAA,SAAuCN,qCAAAA;EAC/Ce,OAAAA,GAAUhB,iBAAAA;EACViB,aAAAA;EACAJ,yBAAAA;AAAAA"}