@shell-shock/preset-script 0.6.28 → 0.6.29

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 (91) hide show
  1. package/README.md +1 -1
  2. package/dist/components/bin-entry.cjs +4 -4
  3. package/dist/components/bin-entry.mjs +3 -3
  4. package/dist/components/command-entry.cjs +5 -5
  5. package/dist/components/command-entry.d.mts +1 -1
  6. package/dist/components/command-entry.mjs +4 -4
  7. package/dist/components/command-router.cjs +1 -1
  8. package/dist/components/command-router.mjs +1 -1
  9. package/dist/components/exit-function-declaration.cjs +1 -1
  10. package/dist/components/exit-function-declaration.mjs +1 -1
  11. package/dist/components/virtual-command-entry.cjs +3 -3
  12. package/dist/components/virtual-command-entry.mjs +3 -3
  13. package/dist/index.cjs +7 -3
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts.map +1 -1
  16. package/dist/index.d.mts.map +1 -1
  17. package/dist/index.mjs +5 -3
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/types/plugin.d.cts +6 -5
  20. package/dist/types/plugin.d.cts.map +1 -1
  21. package/dist/types/plugin.d.mts +7 -6
  22. package/dist/types/plugin.d.mts.map +1 -1
  23. package/package.json +12 -10
  24. package/dist/plugin-help/dist/components/display.cjs +0 -274
  25. package/dist/plugin-help/dist/components/display.cjs.map +0 -1
  26. package/dist/plugin-help/dist/components/display.mjs +0 -268
  27. package/dist/plugin-help/dist/components/display.mjs.map +0 -1
  28. package/dist/plugin-help/dist/components/help-builtin.cjs +0 -86
  29. package/dist/plugin-help/dist/components/help-builtin.cjs.map +0 -1
  30. package/dist/plugin-help/dist/components/help-builtin.mjs +0 -84
  31. package/dist/plugin-help/dist/components/help-builtin.mjs.map +0 -1
  32. package/dist/plugin-help/dist/components/help-command.cjs +0 -97
  33. package/dist/plugin-help/dist/components/help-command.cjs.map +0 -1
  34. package/dist/plugin-help/dist/components/help-command.mjs +0 -96
  35. package/dist/plugin-help/dist/components/help-command.mjs.map +0 -1
  36. package/dist/plugin-help/dist/components/index.cjs +0 -3
  37. package/dist/plugin-help/dist/components/index.mjs +0 -5
  38. package/dist/plugin-help/dist/index.cjs +0 -104
  39. package/dist/plugin-help/dist/index.cjs.map +0 -1
  40. package/dist/plugin-help/dist/index.d.cts +0 -2
  41. package/dist/plugin-help/dist/index.d.mts +0 -2
  42. package/dist/plugin-help/dist/index.mjs +0 -100
  43. package/dist/plugin-help/dist/index.mjs.map +0 -1
  44. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.cjs +0 -18
  45. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.cjs.map +0 -1
  46. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.mjs +0 -17
  47. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.mjs.map +0 -1
  48. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.cjs +0 -39
  49. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.cjs.map +0 -1
  50. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.mjs +0 -38
  51. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.mjs.map +0 -1
  52. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.cjs +0 -34
  53. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.cjs.map +0 -1
  54. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs +0 -34
  55. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs.map +0 -1
  56. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.cjs +0 -41
  57. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.cjs.map +0 -1
  58. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs +0 -41
  59. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs.map +0 -1
  60. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.cjs +0 -18
  61. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.cjs.map +0 -1
  62. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.mjs +0 -17
  63. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.mjs.map +0 -1
  64. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.cjs +0 -21
  65. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.cjs.map +0 -1
  66. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.mjs +0 -21
  67. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.mjs.map +0 -1
  68. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-null.cjs +0 -13
  69. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-null.cjs.map +0 -1
  70. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-null.mjs +0 -12
  71. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-null.mjs.map +0 -1
  72. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.cjs +0 -21
  73. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.cjs.map +0 -1
  74. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.mjs +0 -21
  75. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.mjs.map +0 -1
  76. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set.cjs +0 -20
  77. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set.cjs.map +0 -1
  78. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set.mjs +0 -20
  79. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set.mjs.map +0 -1
  80. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-string.cjs +0 -13
  81. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-string.cjs.map +0 -1
  82. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-string.mjs +0 -12
  83. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-string.mjs.map +0 -1
  84. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-undefined.cjs +0 -9
  85. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-undefined.cjs.map +0 -1
  86. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-undefined.mjs +0 -8
  87. package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-undefined.mjs.map +0 -1
  88. package/dist/plugin-help/dist/types/plugin.d.cts +0 -62
  89. package/dist/plugin-help/dist/types/plugin.d.cts.map +0 -1
  90. package/dist/plugin-help/dist/types/plugin.d.mts +0 -62
  91. package/dist/plugin-help/dist/types/plugin.d.mts.map +0 -1
@@ -1,274 +0,0 @@
1
- const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
2
- const require_is_set_string = require('../node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.cjs');
3
- const require_kebab_case = require('../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.cjs');
4
- const require_snake_case = require('../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.cjs');
5
- let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
6
- let _alloy_js_core = require("@alloy-js/core");
7
- let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
8
- let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
9
- let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
10
- let _shell_shock_core = require("@shell-shock/core");
11
- let _shell_shock_plugin_theme_contexts_theme = require("@shell-shock/plugin-theme/contexts/theme");
12
-
13
- //#region ../plugin-help/dist/components/display.mjs
14
- /**
15
- * A component that generates the usage display for a command.
16
- */
17
- function HelpUsageDisplay(props) {
18
- const { command, indent = 2 } = props;
19
- const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
20
- const theme = (0, _shell_shock_plugin_theme_contexts_theme.useTheme)();
21
- return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
22
- get each() {
23
- return Object.keys(context.config.bin);
24
- },
25
- hardline: true,
26
- children: (bin) => [(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
27
- writeLine(
28
- 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) ? `[${require_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("<${require_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} }
29
- );`), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})]
30
- }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
31
- get when() {
32
- return command.args.length > 0;
33
- },
34
- get children() {
35
- return [(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
36
- get each() {
37
- return Object.keys(context.config.bin);
38
- },
39
- hardline: true,
40
- children: (bin) => [(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
41
- writeLine(
42
- 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) ? `[${require_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("<${require_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} }
43
- );`), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})]
44
- })];
45
- }
46
- })];
47
- }
48
- /**
49
- * A component that generates the options table display for a command.
50
- */
51
- function HelpOptionsDisplay(props) {
52
- const { options } = props;
53
- const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
54
- return [
55
- _alloy_js_core.code`table([ `,
56
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
57
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
58
- get each() {
59
- return (0, _shell_shock_core_plugin_utils.sortOptions)(options);
60
- },
61
- hardline: true,
62
- children: (option) => {
63
- const flags = [];
64
- const names = [];
65
- if (option.name.length === 1) flags.push(`-${option.name}`);
66
- else names.push(`--${require_kebab_case.kebabCase(option.name)}`);
67
- option.alias.forEach((alias) => {
68
- if (alias.length === 1) flags.push(`-${alias}`);
69
- else names.push(`--${require_kebab_case.kebabCase(alias)}`);
70
- });
71
- 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 ? ` <${require_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 ? ` <${require_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" }], `;
72
- }
73
- }),
74
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
75
- _alloy_js_core.code` ]); `
76
- ];
77
- }
78
- /**
79
- * A component that generates the commands table display for a command.
80
- */
81
- function HelpCommandsDisplay(props) {
82
- const { commands } = props;
83
- return [
84
- _alloy_js_core.code`table([ `,
85
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
86
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
87
- get each() {
88
- return Object.values(commands);
89
- },
90
- hardline: true,
91
- 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" }], `
92
- }),
93
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
94
- _alloy_js_core.code` ]); `
95
- ];
96
- }
97
- /**
98
- * A component that generates the `help` function declaration for a command.
99
- */
100
- function BaseHelpDisplay(props) {
101
- const { command, indent = 1, filterGlobalOptions = false } = props;
102
- const theme = (0, _shell_shock_plugin_theme_contexts_theme.useTheme)();
103
- const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
104
- 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));
105
- return [
106
- (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} }` : ""});`),
107
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
108
- (0, _alloy_js_core_jsx_runtime.createComponent)(HelpUsageDisplay, {
109
- command,
110
- indent
111
- }),
112
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
113
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
114
- get when() {
115
- return options.value.length > 0;
116
- },
117
- get children() {
118
- return [
119
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine("");
120
- writeLine(colors.bold(colors.text.heading.secondary("Options:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
121
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
122
- (0, _alloy_js_core_jsx_runtime.createComponent)(HelpOptionsDisplay, { get options() {
123
- return options.value;
124
- } }),
125
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
126
- ];
127
- }
128
- }),
129
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
130
- get when() {
131
- return Object.keys(command.children).length > 0;
132
- },
133
- get children() {
134
- return [
135
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine("");
136
- writeLine(colors.bold(colors.text.heading.secondary("Commands:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
137
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
138
- (0, _alloy_js_core_jsx_runtime.createComponent)(HelpCommandsDisplay, { get commands() {
139
- return command.children;
140
- } }),
141
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
142
- ];
143
- }
144
- }),
145
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
146
- get when() {
147
- return require_is_set_string.isSetString(command.reference);
148
- },
149
- get children() {
150
- return [
151
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine("");
152
- 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} }` : ""});`),
153
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
154
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
155
- ];
156
- }
157
- })
158
- ];
159
- }
160
- /**
161
- * A component that generates the invocation of the `help` function for a command.
162
- */
163
- function VirtualCommandHelpDisplay(props) {
164
- const { options, segments, commands } = props;
165
- const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
166
- return [
167
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
168
- _alloy_js_core.code`writeLine(colors.bold(colors.text.heading.secondary("Global Options:")));`,
169
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
170
- (0, _alloy_js_core_jsx_runtime.createComponent)(HelpOptionsDisplay, { options }),
171
- _alloy_js_core.code`writeLine(""); `,
172
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
173
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
174
- get when() {
175
- return Object.keys(commands).length > 0;
176
- },
177
- get children() {
178
- return [
179
- (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:"));
180
- writeLine(""); `),
181
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
182
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
183
- get each() {
184
- return Object.values(commands);
185
- },
186
- doubleHardline: true,
187
- joiner: _alloy_js_core.code`writeLine(""); `,
188
- ender: _alloy_js_core.code`writeLine(""); `,
189
- children: (child) => [
190
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
191
- writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}"${child.title} ${child.isVirtual ? "" : "Command"}"));
192
- writeLine("");
193
- writeLine(colors.text.body.secondary(splitText(\`${(0, _shell_shock_core_plugin_utils.formatDescription)(child.description).replace(/\.+$/, "").trim()}.\`)));
194
- writeLine("");
195
- `),
196
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
197
- (0, _alloy_js_core_jsx_runtime.createComponent)(BaseHelpDisplay, {
198
- command: child,
199
- indent: 2,
200
- filterGlobalOptions: true
201
- }),
202
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
203
- ]
204
- }),
205
- (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.");
206
- writeLine("");`)
207
- ];
208
- }
209
- })
210
- ];
211
- }
212
- /**
213
- * A component that generates the invocation of the `help` function for a command.
214
- */
215
- function CommandHelpDisplay(props) {
216
- const { command } = props;
217
- const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
218
- return [
219
- _alloy_js_core.code`writeLine(""); `,
220
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
221
- (0, _alloy_js_core_jsx_runtime.createComponent)(BaseHelpDisplay, {
222
- command,
223
- filterGlobalOptions: false
224
- }),
225
- _alloy_js_core.code`writeLine(""); `,
226
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
227
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
228
- get when() {
229
- return Object.keys(command.children).length > 0;
230
- },
231
- get children() {
232
- return [
233
- _alloy_js_core.code`writeLine(colors.text.body.secondary("The following sub-commands are available:"));
234
- writeLine(""); `,
235
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
236
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
237
- get each() {
238
- return Object.values(command.children);
239
- },
240
- doubleHardline: true,
241
- joiner: _alloy_js_core.code`writeLine(""); `,
242
- ender: _alloy_js_core.code`writeLine(""); `,
243
- children: (child) => [
244
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
245
- writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}"${child.title} ${child.isVirtual ? "" : "Command"}"));
246
- writeLine("");
247
- writeLine(colors.text.body.secondary(splitText(\`${(0, _shell_shock_core_plugin_utils.formatDescription)(child.description).replace(/\.+$/, "").trim()}.\`)));
248
- writeLine("");
249
- `),
250
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
251
- (0, _alloy_js_core_jsx_runtime.createComponent)(BaseHelpDisplay, {
252
- command: child,
253
- indent: 2,
254
- filterGlobalOptions: true
255
- }),
256
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
257
- ]
258
- }),
259
- (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.");
260
- writeLine("");`)
261
- ];
262
- }
263
- })
264
- ];
265
- }
266
-
267
- //#endregion
268
- exports.BaseHelpDisplay = BaseHelpDisplay;
269
- exports.CommandHelpDisplay = CommandHelpDisplay;
270
- exports.HelpCommandsDisplay = HelpCommandsDisplay;
271
- exports.HelpOptionsDisplay = HelpOptionsDisplay;
272
- exports.HelpUsageDisplay = HelpUsageDisplay;
273
- exports.VirtualCommandHelpDisplay = VirtualCommandHelpDisplay;
274
- //# sourceMappingURL=display.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"display.cjs","names":["For","snakeCase","CommandParameterKinds","Show","kebabCase","Spacing","isSetString"],"sources":["../../../../../plugin-help/dist/components/display.mjs"],"sourcesContent":["import { isSetString } from \"../node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.mjs\";\nimport { kebabCase } from \"../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs\";\nimport { snakeCase } from \"../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs\";\nimport { createComponent, createIntrinsic, memo } from \"@alloy-js/core/jsx-runtime\";\nimport { For, Show, code, computed } from \"@alloy-js/core\";\nimport { formatDescription, formatShortDescription, getAppBin, getAppTitle, getDynamicPathSegmentName, isDynamicPathSegment, sortOptions } from \"@shell-shock/core/plugin-utils\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\nimport { useTheme } from \"@shell-shock/plugin-theme/contexts/theme\";\n\n//#region src/components/display.tsx\n/**\n* A component that generates the usage display for a command.\n*/\nfunction HelpUsageDisplay(props) {\n\tconst { command, indent = 2 } = props;\n\tconst context = usePowerlines();\n\tconst theme = useTheme();\n\treturn [createComponent(For, {\n\t\tget each() {\n\t\t\treturn Object.keys(context.config.bin);\n\t\t},\n\t\thardline: true,\n\t\tchildren: (bin) => [memo(() => code`\n writeLine(\n colors.text.body.secondary(\\`\\$ \\${colors.text.usage.bin(\"${bin}\")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\\${colors.text.usage.${isDynamicPathSegment(segment) ? \"dynamic\" : \"command\"}(\"${isDynamicPathSegment(segment) ? `[${snakeCase(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(\"<${snakeCase((arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.choices && arg.choices.length > 0 ? arg.choices.join(\"|\") : arg.kind === CommandParameterKinds.string && arg.format ? arg.format : arg.name)}${(arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.variadic ? \"...\" : \"\"}>\")}`).join(\" \")}` : \"\"} \\${colors.text.usage.options(\"[options]\")}\\`), { padding: ${theme.padding.app * indent} }\n );`), createIntrinsic(\"hbr\", {})]\n\t}), createComponent(Show, {\n\t\tget when() {\n\t\t\treturn command.args.length > 0;\n\t\t},\n\t\tget children() {\n\t\t\treturn [createIntrinsic(\"hbr\", {}), createComponent(For, {\n\t\t\t\tget each() {\n\t\t\t\t\treturn Object.keys(context.config.bin);\n\t\t\t\t},\n\t\t\t\thardline: true,\n\t\t\t\tchildren: (bin) => [memo(() => code`\n writeLine(\n colors.text.body.secondary(\\`\\$ \\${colors.text.usage.bin(\"${bin}\")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\\${colors.text.usage.${isDynamicPathSegment(segment) ? \"dynamic\" : \"command\"}(\"${isDynamicPathSegment(segment) ? `[${snakeCase(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(\"<${snakeCase((arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.choices && arg.choices.length > 0 ? arg.choices.join(\"|\") : arg.kind === CommandParameterKinds.string && arg.format ? arg.format : arg.name)}${(arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.variadic ? \"...\" : \"\"}>\")}`).join(\" \")}` : \"\"}\\`), { padding: ${theme.padding.app * indent} }\n );`), createIntrinsic(\"hbr\", {})]\n\t\t\t})];\n\t\t}\n\t})];\n}\n/**\n* A component that generates the options table display for a command.\n*/\nfunction HelpOptionsDisplay(props) {\n\tconst { options } = props;\n\tconst context = usePowerlines();\n\treturn [\n\t\tcode`table([ `,\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcreateComponent(For, {\n\t\t\tget each() {\n\t\t\t\treturn sortOptions(options);\n\t\t\t},\n\t\t\thardline: true,\n\t\t\tchildren: (option) => {\n\t\t\t\tconst flags = [];\n\t\t\t\tconst names = [];\n\t\t\t\tif (option.name.length === 1) flags.push(`-${option.name}`);\n\t\t\t\telse names.push(`--${kebabCase(option.name)}`);\n\t\t\t\toption.alias.forEach((alias) => {\n\t\t\t\t\tif (alias.length === 1) flags.push(`-${alias}`);\n\t\t\t\t\telse names.push(`--${kebabCase(alias)}`);\n\t\t\t\t});\n\t\t\t\treturn code`[{ value: colors.text.body.primary(\"${flags.length > 0 ? `${flags.sort().join(\", \")}${names.length > 0 ? \", \" : \"\"}` : \"\"}${names.length > 0 ? names.sort().join(\", \") : \"\"}${option.kind === CommandParameterKinds.string ? ` <${snakeCase(option.choices && option.choices.length > 0 ? option.choices.join(\"|\") : option.format ? option.format : option.name)}${option.variadic ? \"...\" : \"\"}>` : option.kind === CommandParameterKinds.number ? ` <${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(\\`${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\" }], `;\n\t\t\t}\n\t\t}),\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcode` ]); `\n\t];\n}\n/**\n* A component that generates the commands table display for a command.\n*/\nfunction HelpCommandsDisplay(props) {\n\tconst { commands } = props;\n\treturn [\n\t\tcode`table([ `,\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcreateComponent(For, {\n\t\t\tget each() {\n\t\t\t\treturn Object.values(commands);\n\t\t\t},\n\t\t\thardline: true,\n\t\t\tchildren: (child) => code`[{ value: colors.text.body.primary(\"${child.name}\"), align: \"right\", border: \"none\" }, { value: colors.text.body.tertiary(\\`${formatShortDescription(child.description).replace(/\\.+$/, \"\").trim()}.\\`), align: \"left\", border: \"none\" }], `\n\t\t}),\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcode` ]); `\n\t];\n}\n/**\n* A component that generates the `help` function declaration for a command.\n*/\nfunction BaseHelpDisplay(props) {\n\tconst { command, indent = 1, filterGlobalOptions = false } = props;\n\tconst theme = useTheme();\n\tconst context = usePowerlines();\n\tconst options = 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));\n\treturn [\n\t\tmemo(() => code`writeLine(colors.bold(colors.text.heading.secondary(\"Usage:\"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"});`),\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcreateComponent(HelpUsageDisplay, {\n\t\t\tcommand,\n\t\t\tindent\n\t\t}),\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn options.value.length > 0;\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tmemo(() => code`writeLine(\"\");\n writeLine(colors.bold(colors.text.heading.secondary(\"Options:\"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"});`),\n\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\tcreateComponent(HelpOptionsDisplay, { get options() {\n\t\t\t\t\t\treturn options.value;\n\t\t\t\t\t} }),\n\t\t\t\t\tcreateComponent(Spacing, {})\n\t\t\t\t];\n\t\t\t}\n\t\t}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn Object.keys(command.children).length > 0;\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tmemo(() => code`writeLine(\"\");\n writeLine(colors.bold(colors.text.heading.secondary(\"Commands:\"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"});`),\n\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\tcreateComponent(HelpCommandsDisplay, { get commands() {\n\t\t\t\t\t\treturn command.children;\n\t\t\t\t\t} }),\n\t\t\t\t\tcreateComponent(Spacing, {})\n\t\t\t\t];\n\t\t\t}\n\t\t}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn isSetString(command.reference);\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tmemo(() => code`writeLine(\"\");\n 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} }` : \"\"});`),\n\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\tcreateComponent(Spacing, {})\n\t\t\t\t];\n\t\t\t}\n\t\t})\n\t];\n}\n/**\n* A component that generates the invocation of the `help` function for a command.\n*/\nfunction VirtualCommandHelpDisplay(props) {\n\tconst { options, segments, commands } = props;\n\tconst context = usePowerlines();\n\treturn [\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcode`writeLine(colors.bold(colors.text.heading.secondary(\"Global Options:\")));`,\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcreateComponent(HelpOptionsDisplay, { options }),\n\t\tcode`writeLine(\"\"); `,\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn Object.keys(commands).length > 0;\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tmemo(() => code`writeLine(colors.text.body.secondary(\"The following commands are available through the ${getAppTitle(context, true)} command-line interface:\"));\n writeLine(\"\"); `),\n\t\t\t\t\tcreateComponent(Spacing, {}),\n\t\t\t\t\tcreateComponent(For, {\n\t\t\t\t\t\tget each() {\n\t\t\t\t\t\t\treturn Object.values(commands);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdoubleHardline: true,\n\t\t\t\t\t\tjoiner: code`writeLine(\"\"); `,\n\t\t\t\t\t\tender: code`writeLine(\"\"); `,\n\t\t\t\t\t\tchildren: (child) => [\n\t\t\t\t\t\t\tmemo(() => code`\n writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? \" ${child.icon} \" : \"\") + ` : \"\"}\"${child.title} ${child.isVirtual ? \"\" : \"Command\"}\"));\n writeLine(\"\");\n writeLine(colors.text.body.secondary(splitText(\\`${formatDescription(child.description).replace(/\\.+$/, \"\").trim()}.\\`)));\n writeLine(\"\");\n `),\n\t\t\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\t\t\tcreateComponent(BaseHelpDisplay, {\n\t\t\t\t\t\t\t\tcommand: child,\n\t\t\t\t\t\t\t\tindent: 2,\n\t\t\t\t\t\t\t\tfilterGlobalOptions: true\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcreateIntrinsic(\"hbr\", {})\n\t\t\t\t\t\t]\n\t\t\t\t\t}),\n\t\t\t\t\tmemo(() => code`help(\"Running a specific command with the help flag (via: '${getAppBin(context)}${segments && segments.length > 0 ? ` ${segments.join(\" \")}` : \"\"} <specific command> --help') will provide additional information that is specific to that command.\");\n writeLine(\"\");`)\n\t\t\t\t];\n\t\t\t}\n\t\t})\n\t];\n}\n/**\n* A component that generates the invocation of the `help` function for a command.\n*/\nfunction CommandHelpDisplay(props) {\n\tconst { command } = props;\n\tconst context = usePowerlines();\n\treturn [\n\t\tcode`writeLine(\"\"); `,\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(BaseHelpDisplay, {\n\t\t\tcommand,\n\t\t\tfilterGlobalOptions: false\n\t\t}),\n\t\tcode`writeLine(\"\"); `,\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn Object.keys(command.children).length > 0;\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tcode`writeLine(colors.text.body.secondary(\"The following sub-commands are available:\"));\n writeLine(\"\"); `,\n\t\t\t\t\tcreateComponent(Spacing, {}),\n\t\t\t\t\tcreateComponent(For, {\n\t\t\t\t\t\tget each() {\n\t\t\t\t\t\t\treturn Object.values(command.children);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdoubleHardline: true,\n\t\t\t\t\t\tjoiner: code`writeLine(\"\"); `,\n\t\t\t\t\t\tender: code`writeLine(\"\"); `,\n\t\t\t\t\t\tchildren: (child) => [\n\t\t\t\t\t\t\tmemo(() => code`\n writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? \" ${child.icon} \" : \"\") + ` : \"\"}\"${child.title} ${child.isVirtual ? \"\" : \"Command\"}\"));\n writeLine(\"\");\n writeLine(colors.text.body.secondary(splitText(\\`${formatDescription(child.description).replace(/\\.+$/, \"\").trim()}.\\`)));\n writeLine(\"\");\n `),\n\t\t\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\t\t\tcreateComponent(BaseHelpDisplay, {\n\t\t\t\t\t\t\t\tcommand: child,\n\t\t\t\t\t\t\t\tindent: 2,\n\t\t\t\t\t\t\t\tfilterGlobalOptions: true\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcreateIntrinsic(\"hbr\", {})\n\t\t\t\t\t\t]\n\t\t\t\t\t}),\n\t\t\t\t\tmemo(() => code`help(\"Running a specific command with the help flag (via: '${getAppBin(context)} ${command.segments.join(\" \")} <specific command> --help') will provide additional information that is specific to that command.\");\n writeLine(\"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SAAS,KAAK,IAAI,CAAC;wBAC3G;KACnB;;GAEF,CAAC;EACF"}
@@ -1,268 +0,0 @@
1
- import { isSetString } from "../node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.mjs";
2
- import { kebabCase } from "../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs";
3
- import { snakeCase } from "../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs";
4
- import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
5
- import { For, Show, code, computed } from "@alloy-js/core";
6
- import { formatDescription, formatShortDescription, getAppBin, getAppTitle, getDynamicPathSegmentName, isDynamicPathSegment, sortOptions } from "@shell-shock/core/plugin-utils";
7
- import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
8
- import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
9
- import { CommandParameterKinds } from "@shell-shock/core";
10
- import { useTheme } from "@shell-shock/plugin-theme/contexts/theme";
11
-
12
- //#region ../plugin-help/dist/components/display.mjs
13
- /**
14
- * A component that generates the usage display for a command.
15
- */
16
- function HelpUsageDisplay(props) {
17
- const { command, indent = 2 } = props;
18
- const context = usePowerlines();
19
- const theme = useTheme();
20
- return [createComponent(For, {
21
- get each() {
22
- return Object.keys(context.config.bin);
23
- },
24
- hardline: true,
25
- children: (bin) => [memo(() => code`
26
- writeLine(
27
- colors.text.body.secondary(\`\$ \${colors.text.usage.bin("${bin}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${colors.text.usage.${isDynamicPathSegment(segment) ? "dynamic" : "command"}("${isDynamicPathSegment(segment) ? `[${snakeCase(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("<${snakeCase((arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.choices && arg.choices.length > 0 ? arg.choices.join("|") : arg.kind === CommandParameterKinds.string && arg.format ? arg.format : arg.name)}${(arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""} \${colors.text.usage.options("[options]")}\`), { padding: ${theme.padding.app * indent} }
28
- );`), createIntrinsic("hbr", {})]
29
- }), createComponent(Show, {
30
- get when() {
31
- return command.args.length > 0;
32
- },
33
- get children() {
34
- return [createIntrinsic("hbr", {}), createComponent(For, {
35
- get each() {
36
- return Object.keys(context.config.bin);
37
- },
38
- hardline: true,
39
- children: (bin) => [memo(() => code`
40
- writeLine(
41
- colors.text.body.secondary(\`\$ \${colors.text.usage.bin("${bin}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${colors.text.usage.${isDynamicPathSegment(segment) ? "dynamic" : "command"}("${isDynamicPathSegment(segment) ? `[${snakeCase(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("<${snakeCase((arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.choices && arg.choices.length > 0 ? arg.choices.join("|") : arg.kind === CommandParameterKinds.string && arg.format ? arg.format : arg.name)}${(arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""}\`), { padding: ${theme.padding.app * indent} }
42
- );`), createIntrinsic("hbr", {})]
43
- })];
44
- }
45
- })];
46
- }
47
- /**
48
- * A component that generates the options table display for a command.
49
- */
50
- function HelpOptionsDisplay(props) {
51
- const { options } = props;
52
- const context = usePowerlines();
53
- return [
54
- code`table([ `,
55
- createIntrinsic("hbr", {}),
56
- createComponent(For, {
57
- get each() {
58
- return sortOptions(options);
59
- },
60
- hardline: true,
61
- children: (option) => {
62
- const flags = [];
63
- const names = [];
64
- if (option.name.length === 1) flags.push(`-${option.name}`);
65
- else names.push(`--${kebabCase(option.name)}`);
66
- option.alias.forEach((alias) => {
67
- if (alias.length === 1) flags.push(`-${alias}`);
68
- else names.push(`--${kebabCase(alias)}`);
69
- });
70
- return code`[{ value: colors.text.body.primary("${flags.length > 0 ? `${flags.sort().join(", ")}${names.length > 0 ? ", " : ""}` : ""}${names.length > 0 ? names.sort().join(", ") : ""}${option.kind === CommandParameterKinds.string ? ` <${snakeCase(option.choices && option.choices.length > 0 ? option.choices.join("|") : option.format ? option.format : option.name)}${option.variadic ? "..." : ""}>` : option.kind === CommandParameterKinds.number ? ` <${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(\`${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" }], `;
71
- }
72
- }),
73
- createIntrinsic("hbr", {}),
74
- code` ]); `
75
- ];
76
- }
77
- /**
78
- * A component that generates the commands table display for a command.
79
- */
80
- function HelpCommandsDisplay(props) {
81
- const { commands } = props;
82
- return [
83
- code`table([ `,
84
- createIntrinsic("hbr", {}),
85
- createComponent(For, {
86
- get each() {
87
- return Object.values(commands);
88
- },
89
- hardline: true,
90
- children: (child) => code`[{ value: colors.text.body.primary("${child.name}"), align: "right", border: "none" }, { value: colors.text.body.tertiary(\`${formatShortDescription(child.description).replace(/\.+$/, "").trim()}.\`), align: "left", border: "none" }], `
91
- }),
92
- createIntrinsic("hbr", {}),
93
- code` ]); `
94
- ];
95
- }
96
- /**
97
- * A component that generates the `help` function declaration for a command.
98
- */
99
- function BaseHelpDisplay(props) {
100
- const { command, indent = 1, filterGlobalOptions = false } = props;
101
- const theme = useTheme();
102
- const context = usePowerlines();
103
- const options = 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));
104
- return [
105
- memo(() => code`writeLine(colors.bold(colors.text.heading.secondary("Usage:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
106
- createIntrinsic("hbr", {}),
107
- createComponent(HelpUsageDisplay, {
108
- command,
109
- indent
110
- }),
111
- createComponent(Spacing, {}),
112
- createComponent(Show, {
113
- get when() {
114
- return options.value.length > 0;
115
- },
116
- get children() {
117
- return [
118
- memo(() => code`writeLine("");
119
- writeLine(colors.bold(colors.text.heading.secondary("Options:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
120
- createIntrinsic("hbr", {}),
121
- createComponent(HelpOptionsDisplay, { get options() {
122
- return options.value;
123
- } }),
124
- createComponent(Spacing, {})
125
- ];
126
- }
127
- }),
128
- createComponent(Show, {
129
- get when() {
130
- return Object.keys(command.children).length > 0;
131
- },
132
- get children() {
133
- return [
134
- memo(() => code`writeLine("");
135
- writeLine(colors.bold(colors.text.heading.secondary("Commands:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
136
- createIntrinsic("hbr", {}),
137
- createComponent(HelpCommandsDisplay, { get commands() {
138
- return command.children;
139
- } }),
140
- createComponent(Spacing, {})
141
- ];
142
- }
143
- }),
144
- createComponent(Show, {
145
- get when() {
146
- return isSetString(command.reference);
147
- },
148
- get children() {
149
- return [
150
- memo(() => code`writeLine("");
151
- 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} }` : ""});`),
152
- createIntrinsic("hbr", {}),
153
- createComponent(Spacing, {})
154
- ];
155
- }
156
- })
157
- ];
158
- }
159
- /**
160
- * A component that generates the invocation of the `help` function for a command.
161
- */
162
- function VirtualCommandHelpDisplay(props) {
163
- const { options, segments, commands } = props;
164
- const context = usePowerlines();
165
- return [
166
- createIntrinsic("hbr", {}),
167
- code`writeLine(colors.bold(colors.text.heading.secondary("Global Options:")));`,
168
- createIntrinsic("hbr", {}),
169
- createComponent(HelpOptionsDisplay, { options }),
170
- code`writeLine(""); `,
171
- createComponent(Spacing, {}),
172
- createComponent(Show, {
173
- get when() {
174
- return Object.keys(commands).length > 0;
175
- },
176
- get children() {
177
- return [
178
- memo(() => code`writeLine(colors.text.body.secondary("The following commands are available through the ${getAppTitle(context, true)} command-line interface:"));
179
- writeLine(""); `),
180
- createComponent(Spacing, {}),
181
- createComponent(For, {
182
- get each() {
183
- return Object.values(commands);
184
- },
185
- doubleHardline: true,
186
- joiner: code`writeLine(""); `,
187
- ender: code`writeLine(""); `,
188
- children: (child) => [
189
- memo(() => code`
190
- writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}"${child.title} ${child.isVirtual ? "" : "Command"}"));
191
- writeLine("");
192
- writeLine(colors.text.body.secondary(splitText(\`${formatDescription(child.description).replace(/\.+$/, "").trim()}.\`)));
193
- writeLine("");
194
- `),
195
- createIntrinsic("hbr", {}),
196
- createComponent(BaseHelpDisplay, {
197
- command: child,
198
- indent: 2,
199
- filterGlobalOptions: true
200
- }),
201
- createIntrinsic("hbr", {})
202
- ]
203
- }),
204
- memo(() => code`help("Running a specific command with the help flag (via: '${getAppBin(context)}${segments && segments.length > 0 ? ` ${segments.join(" ")}` : ""} <specific command> --help') will provide additional information that is specific to that command.");
205
- writeLine("");`)
206
- ];
207
- }
208
- })
209
- ];
210
- }
211
- /**
212
- * A component that generates the invocation of the `help` function for a command.
213
- */
214
- function CommandHelpDisplay(props) {
215
- const { command } = props;
216
- const context = usePowerlines();
217
- return [
218
- code`writeLine(""); `,
219
- createComponent(Spacing, {}),
220
- createComponent(BaseHelpDisplay, {
221
- command,
222
- filterGlobalOptions: false
223
- }),
224
- code`writeLine(""); `,
225
- createComponent(Spacing, {}),
226
- createComponent(Show, {
227
- get when() {
228
- return Object.keys(command.children).length > 0;
229
- },
230
- get children() {
231
- return [
232
- code`writeLine(colors.text.body.secondary("The following sub-commands are available:"));
233
- writeLine(""); `,
234
- createComponent(Spacing, {}),
235
- createComponent(For, {
236
- get each() {
237
- return Object.values(command.children);
238
- },
239
- doubleHardline: true,
240
- joiner: code`writeLine(""); `,
241
- ender: code`writeLine(""); `,
242
- children: (child) => [
243
- memo(() => code`
244
- writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}"${child.title} ${child.isVirtual ? "" : "Command"}"));
245
- writeLine("");
246
- writeLine(colors.text.body.secondary(splitText(\`${formatDescription(child.description).replace(/\.+$/, "").trim()}.\`)));
247
- writeLine("");
248
- `),
249
- createIntrinsic("hbr", {}),
250
- createComponent(BaseHelpDisplay, {
251
- command: child,
252
- indent: 2,
253
- filterGlobalOptions: true
254
- }),
255
- createIntrinsic("hbr", {})
256
- ]
257
- }),
258
- memo(() => code`help("Running a specific command with the help flag (via: '${getAppBin(context)} ${command.segments.join(" ")} <specific command> --help') will provide additional information that is specific to that command.");
259
- writeLine("");`)
260
- ];
261
- }
262
- })
263
- ];
264
- }
265
-
266
- //#endregion
267
- export { BaseHelpDisplay, CommandHelpDisplay, HelpCommandsDisplay, HelpOptionsDisplay, HelpUsageDisplay, VirtualCommandHelpDisplay };
268
- //# sourceMappingURL=display.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"display.mjs","names":[],"sources":["../../../../../plugin-help/dist/components/display.mjs"],"sourcesContent":["import { isSetString } from \"../node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.mjs\";\nimport { kebabCase } from \"../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs\";\nimport { snakeCase } from \"../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs\";\nimport { createComponent, createIntrinsic, memo } from \"@alloy-js/core/jsx-runtime\";\nimport { For, Show, code, computed } from \"@alloy-js/core\";\nimport { formatDescription, formatShortDescription, getAppBin, getAppTitle, getDynamicPathSegmentName, isDynamicPathSegment, sortOptions } from \"@shell-shock/core/plugin-utils\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\nimport { useTheme } from \"@shell-shock/plugin-theme/contexts/theme\";\n\n//#region src/components/display.tsx\n/**\n* A component that generates the usage display for a command.\n*/\nfunction HelpUsageDisplay(props) {\n\tconst { command, indent = 2 } = props;\n\tconst context = usePowerlines();\n\tconst theme = useTheme();\n\treturn [createComponent(For, {\n\t\tget each() {\n\t\t\treturn Object.keys(context.config.bin);\n\t\t},\n\t\thardline: true,\n\t\tchildren: (bin) => [memo(() => code`\n writeLine(\n colors.text.body.secondary(\\`\\$ \\${colors.text.usage.bin(\"${bin}\")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\\${colors.text.usage.${isDynamicPathSegment(segment) ? \"dynamic\" : \"command\"}(\"${isDynamicPathSegment(segment) ? `[${snakeCase(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(\"<${snakeCase((arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.choices && arg.choices.length > 0 ? arg.choices.join(\"|\") : arg.kind === CommandParameterKinds.string && arg.format ? arg.format : arg.name)}${(arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.variadic ? \"...\" : \"\"}>\")}`).join(\" \")}` : \"\"} \\${colors.text.usage.options(\"[options]\")}\\`), { padding: ${theme.padding.app * indent} }\n );`), createIntrinsic(\"hbr\", {})]\n\t}), createComponent(Show, {\n\t\tget when() {\n\t\t\treturn command.args.length > 0;\n\t\t},\n\t\tget children() {\n\t\t\treturn [createIntrinsic(\"hbr\", {}), createComponent(For, {\n\t\t\t\tget each() {\n\t\t\t\t\treturn Object.keys(context.config.bin);\n\t\t\t\t},\n\t\t\t\thardline: true,\n\t\t\t\tchildren: (bin) => [memo(() => code`\n writeLine(\n colors.text.body.secondary(\\`\\$ \\${colors.text.usage.bin(\"${bin}\")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\\${colors.text.usage.${isDynamicPathSegment(segment) ? \"dynamic\" : \"command\"}(\"${isDynamicPathSegment(segment) ? `[${snakeCase(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(\"<${snakeCase((arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.choices && arg.choices.length > 0 ? arg.choices.join(\"|\") : arg.kind === CommandParameterKinds.string && arg.format ? arg.format : arg.name)}${(arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.variadic ? \"...\" : \"\"}>\")}`).join(\" \")}` : \"\"}\\`), { padding: ${theme.padding.app * indent} }\n );`), createIntrinsic(\"hbr\", {})]\n\t\t\t})];\n\t\t}\n\t})];\n}\n/**\n* A component that generates the options table display for a command.\n*/\nfunction HelpOptionsDisplay(props) {\n\tconst { options } = props;\n\tconst context = usePowerlines();\n\treturn [\n\t\tcode`table([ `,\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcreateComponent(For, {\n\t\t\tget each() {\n\t\t\t\treturn sortOptions(options);\n\t\t\t},\n\t\t\thardline: true,\n\t\t\tchildren: (option) => {\n\t\t\t\tconst flags = [];\n\t\t\t\tconst names = [];\n\t\t\t\tif (option.name.length === 1) flags.push(`-${option.name}`);\n\t\t\t\telse names.push(`--${kebabCase(option.name)}`);\n\t\t\t\toption.alias.forEach((alias) => {\n\t\t\t\t\tif (alias.length === 1) flags.push(`-${alias}`);\n\t\t\t\t\telse names.push(`--${kebabCase(alias)}`);\n\t\t\t\t});\n\t\t\t\treturn code`[{ value: colors.text.body.primary(\"${flags.length > 0 ? `${flags.sort().join(\", \")}${names.length > 0 ? \", \" : \"\"}` : \"\"}${names.length > 0 ? names.sort().join(\", \") : \"\"}${option.kind === CommandParameterKinds.string ? ` <${snakeCase(option.choices && option.choices.length > 0 ? option.choices.join(\"|\") : option.format ? option.format : option.name)}${option.variadic ? \"...\" : \"\"}>` : option.kind === CommandParameterKinds.number ? ` <${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(\\`${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\" }], `;\n\t\t\t}\n\t\t}),\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcode` ]); `\n\t];\n}\n/**\n* A component that generates the commands table display for a command.\n*/\nfunction HelpCommandsDisplay(props) {\n\tconst { commands } = props;\n\treturn [\n\t\tcode`table([ `,\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcreateComponent(For, {\n\t\t\tget each() {\n\t\t\t\treturn Object.values(commands);\n\t\t\t},\n\t\t\thardline: true,\n\t\t\tchildren: (child) => code`[{ value: colors.text.body.primary(\"${child.name}\"), align: \"right\", border: \"none\" }, { value: colors.text.body.tertiary(\\`${formatShortDescription(child.description).replace(/\\.+$/, \"\").trim()}.\\`), align: \"left\", border: \"none\" }], `\n\t\t}),\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcode` ]); `\n\t];\n}\n/**\n* A component that generates the `help` function declaration for a command.\n*/\nfunction BaseHelpDisplay(props) {\n\tconst { command, indent = 1, filterGlobalOptions = false } = props;\n\tconst theme = useTheme();\n\tconst context = usePowerlines();\n\tconst options = 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));\n\treturn [\n\t\tmemo(() => code`writeLine(colors.bold(colors.text.heading.secondary(\"Usage:\"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"});`),\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcreateComponent(HelpUsageDisplay, {\n\t\t\tcommand,\n\t\t\tindent\n\t\t}),\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn options.value.length > 0;\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tmemo(() => code`writeLine(\"\");\n writeLine(colors.bold(colors.text.heading.secondary(\"Options:\"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"});`),\n\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\tcreateComponent(HelpOptionsDisplay, { get options() {\n\t\t\t\t\t\treturn options.value;\n\t\t\t\t\t} }),\n\t\t\t\t\tcreateComponent(Spacing, {})\n\t\t\t\t];\n\t\t\t}\n\t\t}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn Object.keys(command.children).length > 0;\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tmemo(() => code`writeLine(\"\");\n writeLine(colors.bold(colors.text.heading.secondary(\"Commands:\"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"});`),\n\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\tcreateComponent(HelpCommandsDisplay, { get commands() {\n\t\t\t\t\t\treturn command.children;\n\t\t\t\t\t} }),\n\t\t\t\t\tcreateComponent(Spacing, {})\n\t\t\t\t];\n\t\t\t}\n\t\t}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn isSetString(command.reference);\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tmemo(() => code`writeLine(\"\");\n 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} }` : \"\"});`),\n\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\tcreateComponent(Spacing, {})\n\t\t\t\t];\n\t\t\t}\n\t\t})\n\t];\n}\n/**\n* A component that generates the invocation of the `help` function for a command.\n*/\nfunction VirtualCommandHelpDisplay(props) {\n\tconst { options, segments, commands } = props;\n\tconst context = usePowerlines();\n\treturn [\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcode`writeLine(colors.bold(colors.text.heading.secondary(\"Global Options:\")));`,\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcreateComponent(HelpOptionsDisplay, { options }),\n\t\tcode`writeLine(\"\"); `,\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn Object.keys(commands).length > 0;\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tmemo(() => code`writeLine(colors.text.body.secondary(\"The following commands are available through the ${getAppTitle(context, true)} command-line interface:\"));\n writeLine(\"\"); `),\n\t\t\t\t\tcreateComponent(Spacing, {}),\n\t\t\t\t\tcreateComponent(For, {\n\t\t\t\t\t\tget each() {\n\t\t\t\t\t\t\treturn Object.values(commands);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdoubleHardline: true,\n\t\t\t\t\t\tjoiner: code`writeLine(\"\"); `,\n\t\t\t\t\t\tender: code`writeLine(\"\"); `,\n\t\t\t\t\t\tchildren: (child) => [\n\t\t\t\t\t\t\tmemo(() => code`\n writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? \" ${child.icon} \" : \"\") + ` : \"\"}\"${child.title} ${child.isVirtual ? \"\" : \"Command\"}\"));\n writeLine(\"\");\n writeLine(colors.text.body.secondary(splitText(\\`${formatDescription(child.description).replace(/\\.+$/, \"\").trim()}.\\`)));\n writeLine(\"\");\n `),\n\t\t\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\t\t\tcreateComponent(BaseHelpDisplay, {\n\t\t\t\t\t\t\t\tcommand: child,\n\t\t\t\t\t\t\t\tindent: 2,\n\t\t\t\t\t\t\t\tfilterGlobalOptions: true\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcreateIntrinsic(\"hbr\", {})\n\t\t\t\t\t\t]\n\t\t\t\t\t}),\n\t\t\t\t\tmemo(() => code`help(\"Running a specific command with the help flag (via: '${getAppBin(context)}${segments && segments.length > 0 ? ` ${segments.join(\" \")}` : \"\"} <specific command> --help') will provide additional information that is specific to that command.\");\n writeLine(\"\");`)\n\t\t\t\t];\n\t\t\t}\n\t\t})\n\t];\n}\n/**\n* A component that generates the invocation of the `help` function for a command.\n*/\nfunction CommandHelpDisplay(props) {\n\tconst { command } = props;\n\tconst context = usePowerlines();\n\treturn [\n\t\tcode`writeLine(\"\"); `,\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(BaseHelpDisplay, {\n\t\t\tcommand,\n\t\t\tfilterGlobalOptions: false\n\t\t}),\n\t\tcode`writeLine(\"\"); `,\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn Object.keys(command.children).length > 0;\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tcode`writeLine(colors.text.body.secondary(\"The following sub-commands are available:\"));\n writeLine(\"\"); `,\n\t\t\t\t\tcreateComponent(Spacing, {}),\n\t\t\t\t\tcreateComponent(For, {\n\t\t\t\t\t\tget each() {\n\t\t\t\t\t\t\treturn Object.values(command.children);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdoubleHardline: true,\n\t\t\t\t\t\tjoiner: code`writeLine(\"\"); `,\n\t\t\t\t\t\tender: code`writeLine(\"\"); `,\n\t\t\t\t\t\tchildren: (child) => [\n\t\t\t\t\t\t\tmemo(() => code`\n writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? \" ${child.icon} \" : \"\") + ` : \"\"}\"${child.title} ${child.isVirtual ? \"\" : \"Command\"}\"));\n writeLine(\"\");\n writeLine(colors.text.body.secondary(splitText(\\`${formatDescription(child.description).replace(/\\.+$/, \"\").trim()}.\\`)));\n writeLine(\"\");\n `),\n\t\t\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\t\t\tcreateComponent(BaseHelpDisplay, {\n\t\t\t\t\t\t\t\tcommand: child,\n\t\t\t\t\t\t\t\tindent: 2,\n\t\t\t\t\t\t\t\tfilterGlobalOptions: true\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcreateIntrinsic(\"hbr\", {})\n\t\t\t\t\t\t]\n\t\t\t\t\t}),\n\t\t\t\t\tmemo(() => code`help(\"Running a specific command with the help flag (via: '${getAppBin(context)} ${command.segments.join(\" \")} <specific command> --help') will provide additional information that is specific to that command.\");\n writeLine(\"\");`)\n\t\t\t\t];\n\t\t\t}\n\t\t})\n\t];\n}\n\n//#endregion\nexport { BaseHelpDisplay, CommandHelpDisplay, HelpCommandsD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