@shell-shock/preset-cli 0.8.19 → 0.9.0

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 (73) hide show
  1. package/README.md +1 -1
  2. package/dist/components/banner-builtin.cjs +14 -8
  3. package/dist/components/banner-builtin.d.cts +1 -1
  4. package/dist/components/banner-builtin.d.cts.map +1 -1
  5. package/dist/components/banner-builtin.d.mts +2 -2
  6. package/dist/components/banner-builtin.d.mts.map +1 -1
  7. package/dist/components/banner-builtin.mjs +11 -5
  8. package/dist/components/banner-builtin.mjs.map +1 -1
  9. package/dist/components/command-entry.cjs +6 -6
  10. package/dist/components/command-entry.d.mts +1 -1
  11. package/dist/components/command-entry.mjs +5 -5
  12. package/dist/components/command-router.cjs +1 -1
  13. package/dist/components/command-router.mjs +1 -1
  14. package/dist/components/upgrade-builtin.cjs +1 -1
  15. package/dist/components/upgrade-builtin.mjs +1 -1
  16. package/dist/components/virtual-command-entry.cjs +2 -2
  17. package/dist/components/virtual-command-entry.d.mts +1 -1
  18. package/dist/components/virtual-command-entry.mjs +1 -1
  19. package/dist/index.cjs +8 -7
  20. package/dist/index.d.cts.map +1 -1
  21. package/dist/index.d.mts.map +1 -1
  22. package/dist/index.mjs +7 -8
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/types/plugin.d.cts +16 -7
  25. package/dist/types/plugin.d.cts.map +1 -1
  26. package/dist/types/plugin.d.mts +16 -7
  27. package/dist/types/plugin.d.mts.map +1 -1
  28. package/package.json +11 -8
  29. package/dist/plugin-banner/dist/components/banner-builtin.cjs +0 -63
  30. package/dist/plugin-banner/dist/components/banner-builtin.mjs +0 -62
  31. package/dist/plugin-banner/dist/components/banner-builtin.mjs.map +0 -1
  32. package/dist/plugin-banner/dist/components/banner-function-declaration.cjs +0 -138
  33. package/dist/plugin-banner/dist/components/banner-function-declaration.d.cts +0 -45
  34. package/dist/plugin-banner/dist/components/banner-function-declaration.d.cts.map +0 -1
  35. package/dist/plugin-banner/dist/components/banner-function-declaration.d.mts +0 -45
  36. package/dist/plugin-banner/dist/components/banner-function-declaration.d.mts.map +0 -1
  37. package/dist/plugin-banner/dist/components/banner-function-declaration.mjs +0 -136
  38. package/dist/plugin-banner/dist/components/banner-function-declaration.mjs.map +0 -1
  39. package/dist/plugin-banner/dist/components/index.cjs +0 -2
  40. package/dist/plugin-banner/dist/components/index.mjs +0 -4
  41. package/dist/plugin-banner/dist/index.cjs +0 -70
  42. package/dist/plugin-banner/dist/index.d.cts +0 -2
  43. package/dist/plugin-banner/dist/index.d.mts +0 -2
  44. package/dist/plugin-banner/dist/index.mjs +0 -68
  45. package/dist/plugin-banner/dist/index.mjs.map +0 -1
  46. package/dist/plugin-banner/dist/types/plugin.d.cts +0 -31
  47. package/dist/plugin-banner/dist/types/plugin.d.cts.map +0 -1
  48. package/dist/plugin-banner/dist/types/plugin.d.mts +0 -31
  49. package/dist/plugin-banner/dist/types/plugin.d.mts.map +0 -1
  50. package/dist/plugin-help/dist/components/display.cjs +0 -285
  51. package/dist/plugin-help/dist/components/display.mjs +0 -280
  52. package/dist/plugin-help/dist/components/display.mjs.map +0 -1
  53. package/dist/plugin-help/dist/components/help-builtin.cjs +0 -85
  54. package/dist/plugin-help/dist/components/help-builtin.mjs +0 -84
  55. package/dist/plugin-help/dist/components/help-builtin.mjs.map +0 -1
  56. package/dist/plugin-help/dist/components/help-command.cjs +0 -96
  57. package/dist/plugin-help/dist/components/help-command.mjs +0 -96
  58. package/dist/plugin-help/dist/components/help-command.mjs.map +0 -1
  59. package/dist/plugin-help/dist/components/index.cjs +0 -3
  60. package/dist/plugin-help/dist/components/index.mjs +0 -5
  61. package/dist/plugin-help/dist/index.cjs +0 -106
  62. package/dist/plugin-help/dist/index.d.cts +0 -2
  63. package/dist/plugin-help/dist/index.d.mts +0 -2
  64. package/dist/plugin-help/dist/index.mjs +0 -103
  65. package/dist/plugin-help/dist/index.mjs.map +0 -1
  66. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_types@0.11.2/node_modules/@stryke/types/dist/base.d.cts +0 -19
  67. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_types@0.11.2/node_modules/@stryke/types/dist/base.d.cts.map +0 -1
  68. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_types@0.11.2/node_modules/@stryke/types/dist/base.d.mts +0 -19
  69. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_types@0.11.2/node_modules/@stryke/types/dist/base.d.mts.map +0 -1
  70. package/dist/plugin-help/dist/types/plugin.d.cts +0 -63
  71. package/dist/plugin-help/dist/types/plugin.d.cts.map +0 -1
  72. package/dist/plugin-help/dist/types/plugin.d.mts +0 -63
  73. package/dist/plugin-help/dist/types/plugin.d.mts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"banner-function-declaration.mjs","names":[],"sources":["../../../../../plugin-banner/dist/components/banner-function-declaration.mjs"],"sourcesContent":["import { createComponent, memo } from \"@alloy-js/core/jsx-runtime\";\nimport { Show, code, computed } from \"@alloy-js/core\";\nimport { formatDescription, getAppDescription, getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { FunctionDeclaration, IfStatement } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { useTheme } from \"@shell-shock/plugin-theme/contexts/theme\";\n\n//#region src/components/banner-function-declaration.tsx\n/**\n* A component to generate the `banner` function for a specific command or application.\n*\n* @remarks\n* 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.\n*/\nfunction BannerFunctionDeclarationWrapper(props) {\n\tconst { command, children } = props;\n\tconst context = usePowerlines();\n\treturn createComponent(FunctionDeclaration, {\n\t\t\"export\": true,\n\t\tasync: true,\n\t\tname: \"showBanner\",\n\t\tget doc() {\n\t\t\treturn `Write the ${getAppTitle(context, true)} command-line interface application banner ${command ? `for the ${command.title} command ` : \"\"}to the console.`;\n\t\t},\n\t\tparameters: [{\n\t\t\tname: \"sleepTimeoutMs\",\n\t\t\ttype: \"number\",\n\t\t\tdefault: 500\n\t\t}],\n\t\tget children() {\n\t\t\treturn [children, createComponent(IfStatement, {\n\t\t\t\tcondition: code`isInteractive && !isHelp`,\n\t\t\t\tchildren: code`await sleep(sleepTimeoutMs);`\n\t\t\t})];\n\t\t}\n\t});\n}\n/**\n* A component to generate the `banner` function's body for a specific command or application.\n*\n* @remarks\n* 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.\n*/\nfunction BannerFunctionBodyDeclaration(props) {\n\tconst { consoleFnName = \"log\", variant = \"primary\", title, header, footer, description, command, children, insertNewlineBeforeCommand = false, insertNewlineBeforeBanner = true, insertNewlineAfterDescription = false } = props;\n\tconst theme = useTheme();\n\tconst bannerPadding = computed(() => Math.max(theme.padding.app, 0) * 2 + theme.borderStyles.banner.outline[variant].left.length + theme.borderStyles.banner.outline[variant].right.length);\n\tconst totalPadding = computed(() => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value);\n\treturn [\n\t\tcode`\n if (useApp().get(\"banner\") || hasFlag(\"no-banner\") || hasFlag(\"hide-banner\") || isMinimal) {\n return;\n }\n\n useApp().set(\"banner\", true); `,\n\t\tcreateComponent(Spacing, {}),\n\t\tchildren,\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(Show, {\n\t\t\twhen: insertNewlineBeforeBanner,\n\t\t\tchildren: code`writeLine(\"\"); `\n\t\t}),\n\t\tcreateComponent(Spacing, {}),\n\t\tmemo(() => code`\n 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} });\n\n ${title ? title.split(\"\\n\").map((line) => `splitText(\"${line}\",\n Math.max(process.stdout.columns - ${totalPadding.value}, 0)\n ).forEach((line) => {\n 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} });\n }); `) : `splitText(title,\n Math.max(process.stdout.columns - ${totalPadding.value}, 0)\n ).forEach((line) => {\n 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} });\n });`}\n\n ${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} }); ` : \"\"}\n ${`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} }); `} ` : \"\"}\n\n splitText(\n colors.bold(${command?.title ? \"colors.text.banner.description\" : \"colors.text.banner.command\"}.${variant}(\\`${formatDescription(description)}\\`)),\n 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)\n ).forEach((line) => {\n 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} });\n });\n ${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} });` : \"\"}\n 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} });\n\n writeLine(\"\"); `)\n\t];\n}\n/**\n* A component to generate the `banner` function for a specific command or application.\n*\n* @remarks\n* 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.\n*/\nfunction BannerFunctionDeclaration(props) {\n\tconst { consoleFnName = \"log\", variant = \"primary\", command, children, insertNewlineBeforeBanner = true } = props;\n\tconst theme = useTheme();\n\tconst context = usePowerlines();\n\tconst header = computed(() => `${theme.labels.banner.header[variant] || getAppTitle(context, false)} v${context.packageJson.version || \"1.0.0\"}`);\n\tconst footer = computed(() => theme.labels.banner.footer[variant]);\n\tconst title = computed(() => context.config.banner.title || getAppTitle(context, true).replace(`v${context.packageJson.version || \"1.0.0\"}`, \"\"));\n\tconst description = computed(() => command?.description || getAppDescription(context));\n\treturn createComponent(BannerFunctionDeclarationWrapper, {\n\t\tcommand,\n\t\tget children() {\n\t\t\treturn createComponent(BannerFunctionBodyDeclaration, {\n\t\t\t\tget title() {\n\t\t\t\t\treturn title.value;\n\t\t\t\t},\n\t\t\t\tget header() {\n\t\t\t\t\treturn header.value;\n\t\t\t\t},\n\t\t\t\tget description() {\n\t\t\t\t\treturn description.value;\n\t\t\t\t},\n\t\t\t\tget footer() {\n\t\t\t\t\treturn footer.value;\n\t\t\t\t},\n\t\t\t\tvariant,\n\t\t\t\tconsoleFnName,\n\t\t\t\tcommand,\n\t\t\t\tinsertNewlineBeforeCommand: true,\n\t\t\t\tinsertNewlineBeforeBanner,\n\t\t\t\tchildren\n\t\t\t});\n\t\t}\n\t});\n}\n\n//#endregion\nexport { BannerFunctionBodyDeclaration, BannerFunctionDeclaration, BannerFunctionDeclarationWrapper };\n//# sourceMappingURL=banner-function-declaration.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,iCAAiC,OAAO;CAChD,MAAM,EAAE,SAAS,aAAa;CAC9B,MAAM,UAAU,eAAe;AAC/B,QAAO,gBAAgB,qBAAqB;EAC3C,UAAU;EACV,OAAO;EACP,MAAM;EACN,IAAI,MAAM;AACT,UAAO,aAAa,YAAY,SAAS,KAAK,CAAC,6CAA6C,UAAU,WAAW,QAAQ,MAAM,aAAa,GAAG;;EAEhJ,YAAY,CAAC;GACZ,MAAM;GACN,MAAM;GACN,SAAS;GACT,CAAC;EACF,IAAI,WAAW;AACd,UAAO,CAAC,UAAU,gBAAgB,aAAa;IAC9C,WAAW,IAAI;IACf,UAAU,IAAI;IACd,CAAC,CAAC;;EAEJ,CAAC;;;;;;;;AAQH,SAAS,8BAA8B,OAAO;CAC7C,MAAM,EAAE,gBAAgB,OAAO,UAAU,WAAW,OAAO,QAAQ,QAAQ,aAAa,SAAS,UAAU,6BAA6B,OAAO,4BAA4B,MAAM,gCAAgC,UAAU;CAC3N,MAAM,QAAQ,UAAU;CACxB,MAAM,gBAAgB,eAAe,KAAK,IAAI,MAAM,QAAQ,KAAK,EAAE,GAAG,IAAI,MAAM,aAAa,OAAO,QAAQ,SAAS,KAAK,SAAS,M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AI,WAAW;AACd,UAAO,gBAAgB,+BAA+B;IACrD,IAAI,QAAQ;AACX,YAAO,MAAM;;IAEd,IAAI,SAAS;AACZ,YAAO,OAAO;;IAEf,IAAI,cAAc;AACjB,YAAO,YAAY;;IAEpB,IAAI,SAAS;AACZ,YAAO,OAAO;;IAEf;IACA;IACA;IACA,4BAA4B;IAC5B;IACA;IACA,CAAC;;EAEH,CAAC"}
@@ -1,2 +0,0 @@
1
- const require_banner_function_declaration = require('./banner-function-declaration.cjs');
2
- const require_banner_builtin = require('./banner-builtin.cjs');
@@ -1,4 +0,0 @@
1
- import { BannerFunctionBodyDeclaration, BannerFunctionDeclaration, BannerFunctionDeclarationWrapper } from "./banner-function-declaration.mjs";
2
- import { BannerBuiltin } from "./banner-builtin.mjs";
3
-
4
- export { };
@@ -1,70 +0,0 @@
1
- const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
2
- const require_banner_builtin = require('./components/banner-builtin.cjs');
3
- require('./components/index.cjs');
4
- let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
5
- let _alloy_js_core = require("@alloy-js/core");
6
- let _powerlines_plugin_alloy_core_components = require("@powerlines/plugin-alloy/core/components");
7
- let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
8
- let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
9
- let _shell_shock_plugin_console = require("@shell-shock/plugin-console");
10
- _shell_shock_plugin_console = require_runtime.__toESM(_shell_shock_plugin_console);
11
- let _shell_shock_plugin_theme = require("@shell-shock/plugin-theme");
12
- _shell_shock_plugin_theme = require_runtime.__toESM(_shell_shock_plugin_theme);
13
- let _stryke_path_join = require("@stryke/path/join");
14
-
15
- //#region ../plugin-banner/dist/index.mjs
16
- /**
17
- * The Banner - Shell Shock plugin to add a banner command to the application.
18
- */
19
- const plugin = (options = {}) => {
20
- return [
21
- ...(0, _shell_shock_plugin_theme.default)(options.theme),
22
- (0, _shell_shock_plugin_console.default)(options.console),
23
- {
24
- name: "shell-shock:banner",
25
- enforce: "post",
26
- config() {
27
- return { banner: { title: options.title } };
28
- },
29
- prepare: {
30
- order: "post",
31
- async handler() {
32
- const commands = await (0, _shell_shock_core_plugin_utils.getCommandList)(this);
33
- this.debug(`Rendering \`banner\` built-ins for each of the ${commands.length} command modules.`);
34
- const bin = (0, _alloy_js_core.computed)(() => ({
35
- id: "",
36
- name: (0, _shell_shock_core_plugin_utils.getAppName)(this),
37
- title: (0, _shell_shock_core_plugin_utils.getAppTitle)(this),
38
- description: (0, _shell_shock_core_plugin_utils.getAppDescription)(this),
39
- isVirtual: true,
40
- path: null,
41
- segments: [],
42
- alias: [],
43
- tags: [],
44
- options: Object.fromEntries(this.options.map((option) => [option.name, option])),
45
- entry: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "bin.ts") },
46
- args: [],
47
- parent: null,
48
- children: this.commands
49
- }));
50
- return (0, _powerlines_plugin_alloy_render.render)(this, [
51
- (0, _alloy_js_core_jsx_runtime.createComponent)(require_banner_builtin.BannerBuiltin, { get command() {
52
- return bin.value;
53
- } }),
54
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
55
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
56
- get each() {
57
- return commands.sort((a, b) => a.name.localeCompare(b.name));
58
- },
59
- doubleHardline: true,
60
- children: (command) => (0, _alloy_js_core_jsx_runtime.createComponent)(require_banner_builtin.BannerBuiltin, { command })
61
- })
62
- ]);
63
- }
64
- }
65
- }
66
- ];
67
- };
68
-
69
- //#endregion
70
- exports.plugin = plugin;
@@ -1,2 +0,0 @@
1
- import { BannerPluginContext, BannerPluginOptions, BannerPluginResolvedConfig, BannerPluginUserConfig } from "./types/plugin.cjs";
2
- import { Plugin } from "powerlines";
@@ -1,2 +0,0 @@
1
- import { BannerPluginContext, BannerPluginOptions, BannerPluginResolvedConfig, BannerPluginUserConfig } from "./types/plugin.mjs";
2
- import { Plugin } from "powerlines";
@@ -1,68 +0,0 @@
1
- import { BannerBuiltin } from "./components/banner-builtin.mjs";
2
- import "./components/index.mjs";
3
- import { createComponent } from "@alloy-js/core/jsx-runtime";
4
- import { For, computed } from "@alloy-js/core";
5
- import { Spacing } from "@powerlines/plugin-alloy/core/components";
6
- import { render } from "@powerlines/plugin-alloy/render";
7
- import { getAppDescription, getAppName, getAppTitle, getCommandList } from "@shell-shock/core/plugin-utils";
8
- import console from "@shell-shock/plugin-console";
9
- import theme from "@shell-shock/plugin-theme";
10
- import { joinPaths } from "@stryke/path/join";
11
-
12
- //#region ../plugin-banner/dist/index.mjs
13
- /**
14
- * The Banner - Shell Shock plugin to add a banner command to the application.
15
- */
16
- const plugin = (options = {}) => {
17
- return [
18
- ...theme(options.theme),
19
- console(options.console),
20
- {
21
- name: "shell-shock:banner",
22
- enforce: "post",
23
- config() {
24
- return { banner: { title: options.title } };
25
- },
26
- prepare: {
27
- order: "post",
28
- async handler() {
29
- const commands = await getCommandList(this);
30
- this.debug(`Rendering \`banner\` built-ins for each of the ${commands.length} command modules.`);
31
- const bin = computed(() => ({
32
- id: "",
33
- name: getAppName(this),
34
- title: getAppTitle(this),
35
- description: getAppDescription(this),
36
- isVirtual: true,
37
- path: null,
38
- segments: [],
39
- alias: [],
40
- tags: [],
41
- options: Object.fromEntries(this.options.map((option) => [option.name, option])),
42
- entry: { file: joinPaths(this.entryPath, "bin.ts") },
43
- args: [],
44
- parent: null,
45
- children: this.commands
46
- }));
47
- return render(this, [
48
- createComponent(BannerBuiltin, { get command() {
49
- return bin.value;
50
- } }),
51
- createComponent(Spacing, {}),
52
- createComponent(For, {
53
- get each() {
54
- return commands.sort((a, b) => a.name.localeCompare(b.name));
55
- },
56
- doubleHardline: true,
57
- children: (command) => createComponent(BannerBuiltin, { command })
58
- })
59
- ]);
60
- }
61
- }
62
- }
63
- ];
64
- };
65
-
66
- //#endregion
67
- export { plugin };
68
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../plugin-banner/dist/index.mjs"],"sourcesContent":["import { BannerBuiltin } from \"./components/banner-builtin.mjs\";\nimport \"./components/index.mjs\";\nimport { createComponent } from \"@alloy-js/core/jsx-runtime\";\nimport { For, computed } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport { getAppDescription, getAppName, getAppTitle, getCommandList } from \"@shell-shock/core/plugin-utils\";\nimport console from \"@shell-shock/plugin-console\";\nimport theme from \"@shell-shock/plugin-theme\";\nimport { joinPaths } from \"@stryke/path/join\";\n\n//#region src/index.tsx\n/**\n* The Banner - Shell Shock plugin to add a banner command to the application.\n*/\nconst plugin = (options = {}) => {\n\treturn [\n\t\t...theme(options.theme),\n\t\tconsole(options.console),\n\t\t{\n\t\t\tname: \"shell-shock:banner\",\n\t\t\tenforce: \"post\",\n\t\t\tconfig() {\n\t\t\t\treturn { banner: { title: options.title } };\n\t\t\t},\n\t\t\tprepare: {\n\t\t\t\torder: \"post\",\n\t\t\t\tasync handler() {\n\t\t\t\t\tconst commands = await getCommandList(this);\n\t\t\t\t\tthis.debug(`Rendering \\`banner\\` built-ins for each of the ${commands.length} command modules.`);\n\t\t\t\t\tconst bin = computed(() => ({\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tname: getAppName(this),\n\t\t\t\t\t\ttitle: getAppTitle(this),\n\t\t\t\t\t\tdescription: getAppDescription(this),\n\t\t\t\t\t\tisVirtual: true,\n\t\t\t\t\t\tpath: null,\n\t\t\t\t\t\tsegments: [],\n\t\t\t\t\t\talias: [],\n\t\t\t\t\t\ttags: [],\n\t\t\t\t\t\toptions: Object.fromEntries(this.options.map((option) => [option.name, option])),\n\t\t\t\t\t\tentry: { file: joinPaths(this.entryPath, \"bin.ts\") },\n\t\t\t\t\t\targs: [],\n\t\t\t\t\t\tparent: null,\n\t\t\t\t\t\tchildren: this.commands\n\t\t\t\t\t}));\n\t\t\t\t\treturn render(this, [\n\t\t\t\t\t\tcreateComponent(BannerBuiltin, { get command() {\n\t\t\t\t\t\t\treturn bin.value;\n\t\t\t\t\t\t} }),\n\t\t\t\t\t\tcreateComponent(Spacing, {}),\n\t\t\t\t\t\tcreateComponent(For, {\n\t\t\t\t\t\t\tget each() {\n\t\t\t\t\t\t\t\treturn commands.sort((a, b) => a.name.localeCompare(b.name));\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tdoubleHardline: true,\n\t\t\t\t\t\t\tchildren: (command) => createComponent(BannerBuiltin, { command })\n\t\t\t\t\t\t})\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t];\n};\n\n//#endregion\nexport { plugin as default, plugin };\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAM,UAAU,UAAU,EAAE,KAAK;AAChC,QAAO;EACN,GAAG,MAAM,QAAQ,MAAM;EACvB,QAAQ,QAAQ,QAAQ;EACxB;GACC,MAAM;GACN,SAAS;GACT,SAAS;AACR,WAAO,EAAE,QAAQ,EAAE,OAAO,QAAQ,OAAO,EAAE;;GAE5C,SAAS;IACR,OAAO;IACP,MAAM,UAAU;KACf,MAAM,WAAW,MAAM,eAAe,KAAK;AAC3C,UAAK,MAAM,kDAAkD,SAAS,OAAO,mBAAmB;KAChG,MAAM,MAAM,gBAAgB;MAC3B,IAAI;MACJ,MAAM,WAAW,KAAK;MACtB,OAAO,YAAY,KAAK;MACxB,aAAa,kBAAkB,KAAK;MACpC,WAAW;MACX,MAAM;MACN,UAAU,EAAE;MACZ,OAAO,EAAE;MACT,MAAM,EAAE;MACR,SAAS,OAAO,YAAY,KAAK,QAAQ,KAAK,WAAW,CAAC,OAAO,MAAM,OAAO,CAAC,CAAC;MAChF,OAAO,EAAE,MAAM,UAAU,KAAK,WAAW,SAAS,EAAE;MACpD,MAAM,EAAE;MACR,QAAQ;MACR,UAAU,KAAK;MACf,EAAE;AACH,YAAO,OAAO,MAAM;MACnB,gBAAgB,eAAe,EAAE,IAAI,UAAU;AAC9C,cAAO,IAAI;SACT,CAAC;MACJ,gBAAgB,SAAS,EAAE,CAAC;MAC5B,gBAAgB,KAAK;OACpB,IAAI,OAAO;AACV,eAAO,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,cAAc,EAAE,KAAK,CAAC;;OAE7D,gBAAgB;OAChB,WAAW,YAAY,gBAAgB,eAAe,EAAE,SAAS,CAAC;OAClE,CAAC;MACF,CAAC;;IAEH;GACD;EACD"}
@@ -1,31 +0,0 @@
1
- import { ResolvedConfig, UserConfig } from "@shell-shock/core";
2
- import { Context as Context$1 } from "@shell-shock/core/types/context";
3
- import { ConsolePluginContext, ConsolePluginOptions, ConsolePluginResolvedConfig, ConsolePluginUserConfig } from "@shell-shock/plugin-console";
4
- import { ThemePluginContext, ThemePluginOptions, ThemePluginResolvedConfig, ThemePluginUserConfig } from "@shell-shock/plugin-theme";
5
-
6
- //#region ../plugin-banner/dist/types/plugin.d.cts
7
- //#region src/types/plugin.d.ts
8
- interface BannerPluginOptions {
9
- /**
10
- * Theme plugin options.
11
- */
12
- theme?: ThemePluginOptions;
13
- /**
14
- * Console plugin options.
15
- */
16
- console?: ConsolePluginOptions;
17
- /**
18
- * The title to display in the banner. If not provided, the app title from the theme plugin will be used.
19
- */
20
- title?: string;
21
- }
22
- type BannerPluginUserConfig = ThemePluginUserConfig & ConsolePluginUserConfig & UserConfig & {
23
- banner: Pick<BannerPluginOptions, "title">;
24
- };
25
- type BannerPluginResolvedConfig = ThemePluginResolvedConfig & ConsolePluginResolvedConfig & ResolvedConfig & {
26
- banner: Pick<BannerPluginOptions, "title">;
27
- };
28
- type BannerPluginContext<TResolvedConfig extends BannerPluginResolvedConfig = BannerPluginResolvedConfig> = ThemePluginContext<TResolvedConfig> & ConsolePluginContext<TResolvedConfig> & Context$1<TResolvedConfig>; //#endregion
29
- //#endregion
30
- export { BannerPluginContext, BannerPluginOptions, BannerPluginResolvedConfig, BannerPluginUserConfig };
31
- //# sourceMappingURL=plugin.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.cts","names":["ResolvedConfig","UserConfig","Context","ConsolePluginContext","ConsolePluginOptions","ConsolePluginResolvedConfig","ConsolePluginUserConfig","ThemePluginContext","ThemePluginOptions","ThemePluginResolvedConfig","ThemePluginUserConfig","BannerPluginOptions","theme","console","title","BannerPluginUserConfig","Pick","banner","BannerPluginResolvedConfig","BannerPluginContext","TResolvedConfig"],"sources":["../../../../../plugin-banner/dist/types/plugin.d.cts"],"mappings":";;;;;;;UAMUW,mBAAAA;EAAmB;;;EAI3BC,KAAAA,GAAQJ,kBAAAA;EAAAA;;;EAIRK,OAAAA,GAAUT,oBAAAA;EAIL;;AAAA;EAALU,KAAAA;AAAAA;AAAAA,KAEGC,sBAAAA,GAAyBL,qBAAAA,GAAwBJ,uBAAAA,GAA0BL,UAAAA;EAC9EgB,MAAAA,EAAQD,IAAAA,CAAKL,mBAAAA;AAAAA;AAAAA,KAEVO,0BAAAA,GAA6BT,yBAAAA,GAA4BJ,2BAAAA,GAA8BL,cAAAA;EAC1FiB,MAAAA,EAAQD,IAAAA,CAAKL,mBAAAA;AAAAA;AAAAA,KAEVQ,mBAAAA,yBAA4CD,0BAAAA,GAA6BA,0BAAAA,IAA8BX,kBAAAA,CAAmBa,eAAAA,IAAmBjB,oBAAAA,CAAqBiB,eAAAA,IAAmBlB,SAAAA,CAAQkB,eAAAA"}
@@ -1,31 +0,0 @@
1
- import { ConsolePluginContext, ConsolePluginOptions, ConsolePluginResolvedConfig, ConsolePluginUserConfig } from "@shell-shock/plugin-console";
2
- import { ThemePluginContext, ThemePluginOptions, ThemePluginResolvedConfig, ThemePluginUserConfig } from "@shell-shock/plugin-theme";
3
- import { ResolvedConfig, UserConfig } from "@shell-shock/core";
4
- import { Context as Context$1 } from "@shell-shock/core/types/context";
5
-
6
- //#region ../plugin-banner/dist/types/plugin.d.cts
7
- //#region src/types/plugin.d.ts
8
- interface BannerPluginOptions {
9
- /**
10
- * Theme plugin options.
11
- */
12
- theme?: ThemePluginOptions;
13
- /**
14
- * Console plugin options.
15
- */
16
- console?: ConsolePluginOptions;
17
- /**
18
- * The title to display in the banner. If not provided, the app title from the theme plugin will be used.
19
- */
20
- title?: string;
21
- }
22
- type BannerPluginUserConfig = ThemePluginUserConfig & ConsolePluginUserConfig & UserConfig & {
23
- banner: Pick<BannerPluginOptions, "title">;
24
- };
25
- type BannerPluginResolvedConfig = ThemePluginResolvedConfig & ConsolePluginResolvedConfig & ResolvedConfig & {
26
- banner: Pick<BannerPluginOptions, "title">;
27
- };
28
- type BannerPluginContext<TResolvedConfig extends BannerPluginResolvedConfig = BannerPluginResolvedConfig> = ThemePluginContext<TResolvedConfig> & ConsolePluginContext<TResolvedConfig> & Context$1<TResolvedConfig>; //#endregion
29
- //#endregion
30
- export { BannerPluginContext, BannerPluginOptions, BannerPluginResolvedConfig, BannerPluginUserConfig };
31
- //# sourceMappingURL=plugin.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.mts","names":["ResolvedConfig","UserConfig","Context","ConsolePluginContext","ConsolePluginOptions","ConsolePluginResolvedConfig","ConsolePluginUserConfig","ThemePluginContext","ThemePluginOptions","ThemePluginResolvedConfig","ThemePluginUserConfig","BannerPluginOptions","theme","console","title","BannerPluginUserConfig","Pick","banner","BannerPluginResolvedConfig","BannerPluginContext","TResolvedConfig"],"sources":["../../../../../plugin-banner/dist/types/plugin.d.cts"],"mappings":";;;;;;;UAMUW,mBAAAA;EAAmB;;;EAI3BC,KAAAA,GAAQJ,kBAAAA;EAAAA;;;EAIRK,OAAAA,GAAUT,oBAAAA;EAIL;;AAAA;EAALU,KAAAA;AAAAA;AAAAA,KAEGC,sBAAAA,GAAyBL,qBAAAA,GAAwBJ,uBAAAA,GAA0BL,UAAAA;EAC9EgB,MAAAA,EAAQD,IAAAA,CAAKL,mBAAAA;AAAAA;AAAAA,KAEVO,0BAAAA,GAA6BT,yBAAAA,GAA4BJ,2BAAAA,GAA8BL,cAAAA;EAC1FiB,MAAAA,EAAQD,IAAAA,CAAKL,mBAAAA;AAAAA;AAAAA,KAEVQ,mBAAAA,yBAA4CD,0BAAAA,GAA6BA,0BAAAA,IAA8BX,kBAAAA,CAAmBa,eAAAA,IAAmBjB,oBAAAA,CAAqBiB,eAAAA,IAAmBlB,SAAAA,CAAQkB,eAAAA"}
@@ -1,285 +0,0 @@
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 _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
5
- let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
6
- let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
7
- let _shell_shock_plugin_theme_contexts_theme = require("@shell-shock/plugin-theme/contexts/theme");
8
- let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
9
- let _shell_shock_core = require("@shell-shock/core");
10
- let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
11
- let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
12
- let _stryke_string_format_snake_case = require("@stryke/string-format/snake-case");
13
-
14
- //#region ../plugin-help/dist/components/display.mjs
15
- /**
16
- * A component that generates the usage display for a command.
17
- */
18
- function HelpUsageDisplay(props) {
19
- const { command, indent = 2 } = props;
20
- const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
21
- const theme = (0, _shell_shock_plugin_theme_contexts_theme.useTheme)();
22
- return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
23
- get each() {
24
- return Object.keys(context.config.bin);
25
- },
26
- hardline: true,
27
- children: (bin) => [(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
28
- writeLine(
29
- colors.text.body.secondary(\`\${colors.border.app.divider.tertiary("\$_")} \${colors.text.usage.bin("${bin}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${colors.text.usage.${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? "dynamic" : "command"}("${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? `[${(0, _stryke_string_format_snake_case.snakeCase)((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment))}]` : segment}")}`).join(" ")}` : ""}${Object.values(command.children).length > 0 ? ` \${colors.text.usage.dynamic("[command]")}` : ""}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${colors.text.usage.args("<${(0, _stryke_string_format_snake_case.snakeCase)((arg.kind === _shell_shock_core.CommandParameterKinds.string || arg.kind === _shell_shock_core.CommandParameterKinds.number) && arg.choices && arg.choices.length > 0 ? arg.choices.join("|") : arg.kind === _shell_shock_core.CommandParameterKinds.string && arg.format ? arg.format : arg.name)}${(arg.kind === _shell_shock_core.CommandParameterKinds.string || arg.kind === _shell_shock_core.CommandParameterKinds.number) && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""} \${colors.text.usage.options("[options]")}\`), { padding: ${theme.padding.app * indent} }
30
- );`), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})]
31
- }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
32
- get when() {
33
- return command.args.length > 0;
34
- },
35
- get children() {
36
- return [(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
37
- get each() {
38
- return Object.keys(context.config.bin);
39
- },
40
- hardline: true,
41
- children: (bin) => [(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
42
- writeLine(
43
- colors.text.body.secondary(\`\$ \${colors.text.usage.bin("${bin}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${colors.text.usage.${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? "dynamic" : "command"}("${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? `[${(0, _stryke_string_format_snake_case.snakeCase)((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment))}]` : segment}")}`).join(" ")}` : ""}${Object.values(command.children).length > 0 ? ` \${colors.text.usage.dynamic("[command]")}` : ""} \${colors.text.usage.options("[options]")}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${colors.text.usage.args("<${(0, _stryke_string_format_snake_case.snakeCase)((arg.kind === _shell_shock_core.CommandParameterKinds.string || arg.kind === _shell_shock_core.CommandParameterKinds.number) && arg.choices && arg.choices.length > 0 ? arg.choices.join("|") : arg.kind === _shell_shock_core.CommandParameterKinds.string && arg.format ? arg.format : arg.name)}${(arg.kind === _shell_shock_core.CommandParameterKinds.string || arg.kind === _shell_shock_core.CommandParameterKinds.number) && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""}\`), { padding: ${theme.padding.app * indent} }
44
- );`), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})]
45
- })];
46
- }
47
- })];
48
- }
49
- /**
50
- * A component that generates the options table display for a command.
51
- */
52
- function HelpOptionsDisplay(props) {
53
- const { options } = props;
54
- const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
55
- return [
56
- _alloy_js_core.code`table([ `,
57
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
58
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
59
- get each() {
60
- return (0, _shell_shock_core_plugin_utils.sortOptions)(options);
61
- },
62
- hardline: true,
63
- children: (option) => {
64
- const flags = [];
65
- const names = [];
66
- if (option.name.length === 1) flags.push(`-${option.name}`);
67
- else names.push(`--${(0, _stryke_string_format_kebab_case.kebabCase)(option.name)}`);
68
- option.alias.forEach((alias) => {
69
- if (alias.length === 1) flags.push(`-${alias}`);
70
- else names.push(`--${(0, _stryke_string_format_kebab_case.kebabCase)(alias)}`);
71
- });
72
- return _alloy_js_core.code`[{ value: colors.text.body.primary("${flags.length > 0 ? `${flags.sort().join(", ")}${names.length > 0 ? ", " : ""}` : ""}${names.length > 0 ? names.sort().join(", ") : ""}${option.kind === _shell_shock_core.CommandParameterKinds.string ? ` <${(0, _stryke_string_format_snake_case.snakeCase)(option.choices && option.choices.length > 0 ? option.choices.join("|") : option.format ? option.format : option.name)}${option.variadic ? "..." : ""}>` : option.kind === _shell_shock_core.CommandParameterKinds.number ? ` <${(0, _stryke_string_format_snake_case.snakeCase)(option.choices && option.choices.length > 0 ? option.choices.join("|") : option.name)}${option.variadic ? "..." : ""}>` : ""}"), align: "right", border: "none", maxWidth: "1/3" }, { value: colors.text.body.tertiary(\`${(0, _shell_shock_core_plugin_utils.formatShortDescription)(option.description).replace(/\.+$/, "").trim()}${option.env || option.default !== void 0 ? ` (${option.env ? `env: ${context.config.appSpecificEnvPrefix}_${option.env}${option.default !== void 0 ? ", " : ""}` : ""}${option.default !== void 0 ? `default: ${JSON.stringify(option.default).replace(/"/g, "\\\"")}` : ""})` : ""}.\`), align: "left", border: "none" }], `;
73
- }
74
- }),
75
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
76
- _alloy_js_core.code` ]); `
77
- ];
78
- }
79
- /**
80
- * A component that generates the commands table display for a command.
81
- */
82
- function HelpCommandsDisplay(props) {
83
- const { commands } = props;
84
- return [
85
- _alloy_js_core.code`table([ `,
86
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
87
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
88
- get each() {
89
- return Object.values(commands);
90
- },
91
- hardline: true,
92
- children: (child) => _alloy_js_core.code`[{ value: colors.text.body.primary("${child.name}"), align: "right", border: "none" }, { value: colors.text.body.tertiary(\`${(0, _shell_shock_core_plugin_utils.formatShortDescription)(child.description).replace(/\.+$/, "").trim()}.\`), align: "left", border: "none" }], `
93
- }),
94
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
95
- _alloy_js_core.code` ]); `
96
- ];
97
- }
98
- /**
99
- * A component that generates the `help` function declaration for a command.
100
- */
101
- function BaseHelpDisplay(props) {
102
- const { command, indent = 1, filterGlobalOptions = false } = props;
103
- const theme = (0, _shell_shock_plugin_theme_contexts_theme.useTheme)();
104
- const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
105
- const options = (0, _alloy_js_core.computed)(() => filterGlobalOptions ? Object.values(command.options).filter((option) => !context.options.some((globalOption) => globalOption.name === option.name || option.alias.includes(globalOption.name) || globalOption.alias?.includes(option.name) || globalOption.alias?.some((alias) => option.alias.includes(alias)))) : Object.values(command.options));
106
- return [
107
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine(colors.bold(colors.text.heading.secondary("Usage:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
108
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
109
- (0, _alloy_js_core_jsx_runtime.createComponent)(HelpUsageDisplay, {
110
- command,
111
- indent
112
- }),
113
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
114
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
115
- get when() {
116
- return options.value.length > 0;
117
- },
118
- get children() {
119
- return [
120
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine("");
121
- writeLine(colors.bold(colors.text.heading.secondary("Options:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
122
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
123
- (0, _alloy_js_core_jsx_runtime.createComponent)(HelpOptionsDisplay, { get options() {
124
- return options.value;
125
- } }),
126
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
127
- ];
128
- }
129
- }),
130
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
131
- get when() {
132
- return Object.keys(command.children).length > 0;
133
- },
134
- get children() {
135
- return [
136
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine("");
137
- writeLine(colors.bold(colors.text.heading.secondary("Commands:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
138
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
139
- (0, _alloy_js_core_jsx_runtime.createComponent)(HelpCommandsDisplay, { get commands() {
140
- return command.children;
141
- } }),
142
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
143
- ];
144
- }
145
- }),
146
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
147
- get when() {
148
- return (0, _stryke_type_checks_is_set_string.isSetString)(command.reference);
149
- },
150
- get children() {
151
- return [
152
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine("");
153
- writeLine(colors.text.heading.tertiary(\`More information about this command can be found in the reference documentation at ${command.reference}\`)${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
154
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
155
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
156
- ];
157
- }
158
- })
159
- ];
160
- }
161
- function sortCommands(commands) {
162
- return Object.values(commands).sort((a, b) => {
163
- if (a.tags.some((tag) => tag.toLowerCase() === "deprecated") && !b.tags.some((tag) => tag.toLowerCase() === "deprecated")) return 1;
164
- else if (!a.tags.some((tag) => tag.toLowerCase() === "deprecated") && b.tags.some((tag) => tag.toLowerCase() === "deprecated")) return -1;
165
- else if (a.tags.some((tag) => tag.toLowerCase() === "experimental") && !b.tags.some((tag) => tag.toLowerCase() === "experimental")) return 1;
166
- else if (!a.tags.some((tag) => tag.toLowerCase() === "experimental") && b.tags.some((tag) => tag.toLowerCase() === "experimental")) return -1;
167
- else if (a.tags.some((tag) => tag.toLowerCase() === "utility") && !b.tags.some((tag) => tag.toLowerCase() === "utility")) return 1;
168
- else if (!a.tags.some((tag) => tag.toLowerCase() === "utility") && b.tags.some((tag) => tag.toLowerCase() === "utility")) return -1;
169
- return a.name.localeCompare(b.name);
170
- });
171
- }
172
- /**
173
- * A component that generates the invocation of the `help` function for a command.
174
- */
175
- function VirtualCommandHelpDisplay(props) {
176
- const { options, segments, commands } = props;
177
- const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
178
- return [
179
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
180
- _alloy_js_core.code`writeLine(colors.bold(colors.text.heading.secondary("Global Options:")));`,
181
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
182
- (0, _alloy_js_core_jsx_runtime.createComponent)(HelpOptionsDisplay, { options }),
183
- _alloy_js_core.code`writeLine(""); `,
184
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
185
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
186
- get when() {
187
- return Object.keys(commands).length > 0;
188
- },
189
- get children() {
190
- return [
191
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine(colors.text.body.secondary("The following commands are available through the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} command-line interface:"));
192
- writeLine(""); `),
193
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
194
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
195
- get each() {
196
- return sortCommands(commands);
197
- },
198
- doubleHardline: true,
199
- joiner: _alloy_js_core.code`writeLine(""); `,
200
- ender: _alloy_js_core.code`writeLine(""); `,
201
- children: (child) => [
202
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
203
- writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title} ${child.isVirtual ? "" : "Command"}${child.tags?.length > 0 ? ` ${child.tags.map((tag) => `\${colors.text.body.tertiary(colors.text.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)} ? colors.text.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)}(" ${tag} ", true) : colors.text.tags.$default(" ${tag} ", true))}`).join(" ")}` : ""}\`);
204
- writeLine("");
205
- writeLine(colors.text.body.secondary(splitText(\`${(0, _shell_shock_core_plugin_utils.formatDescription)(child.description).replace(/\.+$/, "").trim()}.\`)));
206
- writeLine("");
207
- `),
208
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
209
- (0, _alloy_js_core_jsx_runtime.createComponent)(BaseHelpDisplay, {
210
- command: child,
211
- indent: 2,
212
- filterGlobalOptions: true
213
- }),
214
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
215
- ]
216
- }),
217
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`help("Running a specific command with the help flag (via: '${(0, _shell_shock_core_plugin_utils.getAppBin)(context)}${segments && segments.length > 0 ? ` ${segments.join(" ")}` : ""} <specific command> --help') will provide additional information that is specific to that command.");
218
- writeLine("");`)
219
- ];
220
- }
221
- })
222
- ];
223
- }
224
- /**
225
- * A component that generates the invocation of the `help` function for a command.
226
- */
227
- function CommandHelpDisplay(props) {
228
- const { command } = props;
229
- const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
230
- return [
231
- _alloy_js_core.code`writeLine(""); `,
232
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
233
- (0, _alloy_js_core_jsx_runtime.createComponent)(BaseHelpDisplay, {
234
- command,
235
- filterGlobalOptions: false
236
- }),
237
- _alloy_js_core.code`writeLine(""); `,
238
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
239
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
240
- get when() {
241
- return Object.keys(command.children).length > 0;
242
- },
243
- get children() {
244
- return [
245
- _alloy_js_core.code`writeLine(colors.text.body.secondary("The following sub-commands are available:"));
246
- writeLine(""); `,
247
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
248
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
249
- get each() {
250
- return sortCommands(command.children);
251
- },
252
- doubleHardline: true,
253
- joiner: _alloy_js_core.code`writeLine(""); `,
254
- ender: _alloy_js_core.code`writeLine(""); `,
255
- children: (child) => [
256
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
257
- writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title} ${child.isVirtual ? "" : "Command"}${child.tags?.length > 0 ? ` ${child.tags.map((tag) => `\${colors.text.body.tertiary(colors.text.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)} ? colors.text.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)}(" ${tag} ", true) : colors.text.tags.$default(" ${tag} ", true))}`).join(" ")}` : ""}\`);
258
- writeLine("");
259
- writeLine(colors.text.body.secondary(splitText(\`${(0, _shell_shock_core_plugin_utils.formatDescription)(child.description).replace(/\.+$/, "").trim()}.\`)));
260
- writeLine("");
261
- `),
262
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
263
- (0, _alloy_js_core_jsx_runtime.createComponent)(BaseHelpDisplay, {
264
- command: child,
265
- indent: 2,
266
- filterGlobalOptions: true
267
- }),
268
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
269
- ]
270
- }),
271
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`help("Running a specific command with the help flag (via: '${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} ${command.segments.join(" ")} <specific command> --help') will provide additional information that is specific to that command.");
272
- writeLine("");`)
273
- ];
274
- }
275
- })
276
- ];
277
- }
278
-
279
- //#endregion
280
- exports.BaseHelpDisplay = BaseHelpDisplay;
281
- exports.CommandHelpDisplay = CommandHelpDisplay;
282
- exports.HelpCommandsDisplay = HelpCommandsDisplay;
283
- exports.HelpOptionsDisplay = HelpOptionsDisplay;
284
- exports.HelpUsageDisplay = HelpUsageDisplay;
285
- exports.VirtualCommandHelpDisplay = VirtualCommandHelpDisplay;