@shell-shock/plugin-help 0.2.13 → 0.2.14

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.
@@ -23,7 +23,7 @@ function HelpUsageDisplay(props) {
23
23
  return [
24
24
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
25
25
  writeLine(
26
- colors.text.body.secondary(\`\${colors.text.usage.bin("$_ ${(0, _shell_shock_core_plugin_utils.getAppBin)(context)}")}${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} }
26
+ textColors.body.secondary(\`\${textColors.usage.bin("$_ ${(0, _shell_shock_core_plugin_utils.getAppBin)(context)}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${textColors.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 ? ` \${textColors.usage.dynamic("[command]")}` : ""}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${textColors.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(" ")}` : ""} \${textColors.usage.options("[options]")}\`), { padding: ${theme.padding.app * indent} }
27
27
  );`),
28
28
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
29
29
  (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
@@ -35,7 +35,7 @@ function HelpUsageDisplay(props) {
35
35
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
36
36
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
37
37
  writeLine(
38
- colors.text.body.secondary(\`\${colors.text.usage.bin("$_ ${(0, _shell_shock_core_plugin_utils.getAppBin)(context)}")}${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} }
38
+ textColors.body.secondary(\`\${textColors.usage.bin("$_ ${(0, _shell_shock_core_plugin_utils.getAppBin)(context)}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${textColors.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 ? ` \${textColors.usage.dynamic("[command]")}` : ""} \${textColors.usage.options("[options]")}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${textColors.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} }
39
39
  );`),
40
40
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
41
41
  ];
@@ -66,7 +66,7 @@ function HelpOptionsDisplay(props) {
66
66
  if (alias.length === 1) flags.push(`-${alias}`);
67
67
  else names.push(`--${(0, _stryke_string_format_kebab_case.kebabCase)(alias)}`);
68
68
  });
69
- 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" }], `;
69
+ return _alloy_js_core.code`[{ value: textColors.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: textColors.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" }], `;
70
70
  }
71
71
  }),
72
72
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
@@ -86,7 +86,7 @@ function HelpCommandsDisplay(props) {
86
86
  return Object.values(commands);
87
87
  },
88
88
  hardline: true,
89
- 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" }], `
89
+ children: (child) => _alloy_js_core.code`[{ value: textColors.body.primary("${child.name}"), align: "right", border: "none" }, { value: textColors.body.tertiary(\`${(0, _shell_shock_core_plugin_utils.formatShortDescription)(child.description).replace(/\.+$/, "").trim()}.\`), align: "left", border: "none" }], `
90
90
  }),
91
91
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
92
92
  _alloy_js_core.code` ]); `
@@ -101,7 +101,7 @@ function BaseHelpDisplay(props) {
101
101
  const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
102
102
  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));
103
103
  return [
104
- (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} }` : ""});`),
104
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine(bold(textColors.heading.secondary("Usage:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
105
105
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
106
106
  (0, _alloy_js_core_jsx_runtime.createComponent)(HelpUsageDisplay, {
107
107
  command,
@@ -115,7 +115,7 @@ function BaseHelpDisplay(props) {
115
115
  get children() {
116
116
  return [
117
117
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine("");
118
- writeLine(colors.bold(colors.text.heading.secondary("Options:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
118
+ writeLine(bold(textColors.heading.secondary("Options:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
119
119
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
120
120
  (0, _alloy_js_core_jsx_runtime.createComponent)(HelpOptionsDisplay, { get options() {
121
121
  return options.value;
@@ -131,7 +131,7 @@ function BaseHelpDisplay(props) {
131
131
  get children() {
132
132
  return [
133
133
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine("");
134
- writeLine(colors.bold(colors.text.heading.secondary("Commands:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
134
+ writeLine(bold(textColors.heading.secondary("Commands:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
135
135
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
136
136
  (0, _alloy_js_core_jsx_runtime.createComponent)(HelpCommandsDisplay, { get commands() {
137
137
  return command.children;
@@ -147,7 +147,7 @@ function BaseHelpDisplay(props) {
147
147
  get children() {
148
148
  return [
149
149
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine("");
150
- writeLine(colors.text.heading.tertiary(\`More information about this command can be found in the reference documentation at \${link("${command.reference}")}\`)${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
150
+ writeLine(textColors.heading.tertiary(\`More information about this command can be found in the reference documentation at \${link("${command.reference}")}\`)${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
151
151
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
152
152
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
153
153
  ];
@@ -174,7 +174,7 @@ function VirtualCommandHelpDisplay(props) {
174
174
  const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
175
175
  return [
176
176
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
177
- _alloy_js_core.code`writeLine(colors.bold(colors.text.heading.secondary("Global Options:")));`,
177
+ _alloy_js_core.code`writeLine(bold(textColors.heading.secondary("Global Options:")));`,
178
178
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
179
179
  (0, _alloy_js_core_jsx_runtime.createComponent)(HelpOptionsDisplay, { options }),
180
180
  _alloy_js_core.code`writeLine(""); `,
@@ -185,7 +185,7 @@ function VirtualCommandHelpDisplay(props) {
185
185
  },
186
186
  get children() {
187
187
  return [
188
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine(colors.text.body.tertiary("The following commands are available through the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} command-line interface:"));
188
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine(textColors.body.tertiary("The following commands are available through the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} command-line interface:"));
189
189
  writeLine(""); `),
190
190
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
191
191
  (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
@@ -196,12 +196,12 @@ function VirtualCommandHelpDisplay(props) {
196
196
  joiner: _alloy_js_core.code`writeLine(""); `,
197
197
  ender: _alloy_js_core.code`writeLine(""); `,
198
198
  children: (child) => [
199
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
199
200
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
200
- 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.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)} ? colors.text.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)}(colors.inverse(" ${tag} ")) : colors.text.tags.$default(colors.inverse(" ${tag} "))}`).join(" ")}` : ""}\`);
201
- writeLine("");
202
- writeLine(colors.text.body.tertiary(splitText(\`${(0, _shell_shock_core_plugin_utils.formatDescription)(child.description).replace(/\.+$/, "").trim()}.\`)));
201
+ writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title} ${child.isVirtual ? "" : "Command"}${child.tags?.length > 0 ? ` - ${child.tags.map((tag) => `\${textColors.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)} ? textColors.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)}(inverse(" ${tag} ")) : textColors.tags.$default(inverse(" ${tag} "))}`).join(" ")}` : ""}\`));
203
202
  writeLine("");
204
- `),
203
+ writeLine(textColors.body.tertiary(splitText(\`${(0, _shell_shock_core_plugin_utils.formatDescription)(child.description).replace(/\.+$/, "").trim()}.\`)));
204
+ writeLine(""); `),
205
205
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
206
206
  (0, _alloy_js_core_jsx_runtime.createComponent)(BaseHelpDisplay, {
207
207
  command: child,
@@ -211,7 +211,7 @@ function VirtualCommandHelpDisplay(props) {
211
211
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
212
212
  ]
213
213
  }),
214
- (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.");
214
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`help(\`Running a specific command with the help flag (via: \${inlineCode("${(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.\`);
215
215
  writeLine("");`)
216
216
  ];
217
217
  }
@@ -239,7 +239,7 @@ function CommandHelpDisplay(props) {
239
239
  },
240
240
  get children() {
241
241
  return [
242
- _alloy_js_core.code`writeLine(colors.text.body.tertiary("The following sub-commands are available:"));
242
+ _alloy_js_core.code`writeLine(textColors.body.tertiary("The following sub-commands are available:"));
243
243
  writeLine(""); `,
244
244
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
245
245
  (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
@@ -250,12 +250,12 @@ function CommandHelpDisplay(props) {
250
250
  joiner: _alloy_js_core.code`writeLine(""); `,
251
251
  ender: _alloy_js_core.code`writeLine(""); `,
252
252
  children: (child) => [
253
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
253
254
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
254
- 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.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)} ? colors.text.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)}(colors.inverse(" ${tag} ")) : colors.text.tags.$default(colors.inverse(" ${tag} "))}`).join(" ")}` : ""}\`);
255
- writeLine("");
256
- writeLine(colors.text.body.tertiary(splitText(\`${(0, _shell_shock_core_plugin_utils.formatDescription)(child.description).replace(/\.+$/, "").trim()}.\`)));
255
+ writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title} ${child.isVirtual ? "" : "Command"}${child.tags?.length > 0 ? ` - ${child.tags.map((tag) => `\${textColors.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)} ? textColors.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)}(inverse(" ${tag} ")) : textColors.tags.$default(inverse(" ${tag} "))}`).join(" ")}` : ""}\`));
257
256
  writeLine("");
258
- `),
257
+ writeLine(textColors.body.tertiary(splitText(\`${(0, _shell_shock_core_plugin_utils.formatDescription)(child.description).replace(/\.+$/, "").trim()}.\`)));
258
+ writeLine(""); `),
259
259
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
260
260
  (0, _alloy_js_core_jsx_runtime.createComponent)(BaseHelpDisplay, {
261
261
  command: child,
@@ -265,7 +265,7 @@ function CommandHelpDisplay(props) {
265
265
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
266
266
  ]
267
267
  }),
268
- (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.");
268
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`help(\`Running a specific command with the help flag (via: \${inlineCode("${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} ${command.segments.join(" ")} <specific command> --help")}) will provide additional information that is specific to that command.\`);
269
269
  writeLine("");`)
270
270
  ];
271
271
  }
@@ -21,7 +21,7 @@ function HelpUsageDisplay(props) {
21
21
  return [
22
22
  memo(() => code`
23
23
  writeLine(
24
- colors.text.body.secondary(\`\${colors.text.usage.bin("$_ ${getAppBin(context)}")}${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} }
24
+ textColors.body.secondary(\`\${textColors.usage.bin("$_ ${getAppBin(context)}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${textColors.usage.${isDynamicPathSegment(segment) ? "dynamic" : "command"}("${isDynamicPathSegment(segment) ? `[${snakeCase(getDynamicPathSegmentName(segment))}]` : segment}")}`).join(" ")}` : ""}${Object.values(command.children).length > 0 ? ` \${textColors.usage.dynamic("[command]")}` : ""}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${textColors.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(" ")}` : ""} \${textColors.usage.options("[options]")}\`), { padding: ${theme.padding.app * indent} }
25
25
  );`),
26
26
  createIntrinsic("hbr", {}),
27
27
  createComponent(Show, {
@@ -33,7 +33,7 @@ function HelpUsageDisplay(props) {
33
33
  createIntrinsic("hbr", {}),
34
34
  memo(() => code`
35
35
  writeLine(
36
- colors.text.body.secondary(\`\${colors.text.usage.bin("$_ ${getAppBin(context)}")}${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} }
36
+ textColors.body.secondary(\`\${textColors.usage.bin("$_ ${getAppBin(context)}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${textColors.usage.${isDynamicPathSegment(segment) ? "dynamic" : "command"}("${isDynamicPathSegment(segment) ? `[${snakeCase(getDynamicPathSegmentName(segment))}]` : segment}")}`).join(" ")}` : ""}${Object.values(command.children).length > 0 ? ` \${textColors.usage.dynamic("[command]")}` : ""} \${textColors.usage.options("[options]")}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${textColors.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} }
37
37
  );`),
38
38
  createIntrinsic("hbr", {})
39
39
  ];
@@ -64,7 +64,7 @@ function HelpOptionsDisplay(props) {
64
64
  if (alias.length === 1) flags.push(`-${alias}`);
65
65
  else names.push(`--${kebabCase(alias)}`);
66
66
  });
67
- 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" }], `;
67
+ return code`[{ value: textColors.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: textColors.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" }], `;
68
68
  }
69
69
  }),
70
70
  createIntrinsic("hbr", {}),
@@ -84,7 +84,7 @@ function HelpCommandsDisplay(props) {
84
84
  return Object.values(commands);
85
85
  },
86
86
  hardline: true,
87
- 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" }], `
87
+ children: (child) => code`[{ value: textColors.body.primary("${child.name}"), align: "right", border: "none" }, { value: textColors.body.tertiary(\`${formatShortDescription(child.description).replace(/\.+$/, "").trim()}.\`), align: "left", border: "none" }], `
88
88
  }),
89
89
  createIntrinsic("hbr", {}),
90
90
  code` ]); `
@@ -99,7 +99,7 @@ function BaseHelpDisplay(props) {
99
99
  const context = usePowerlines();
100
100
  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));
101
101
  return [
102
- memo(() => code`writeLine(colors.bold(colors.text.heading.secondary("Usage:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
102
+ memo(() => code`writeLine(bold(textColors.heading.secondary("Usage:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
103
103
  createIntrinsic("hbr", {}),
104
104
  createComponent(HelpUsageDisplay, {
105
105
  command,
@@ -113,7 +113,7 @@ function BaseHelpDisplay(props) {
113
113
  get children() {
114
114
  return [
115
115
  memo(() => code`writeLine("");
116
- writeLine(colors.bold(colors.text.heading.secondary("Options:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
116
+ writeLine(bold(textColors.heading.secondary("Options:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
117
117
  createIntrinsic("hbr", {}),
118
118
  createComponent(HelpOptionsDisplay, { get options() {
119
119
  return options.value;
@@ -129,7 +129,7 @@ function BaseHelpDisplay(props) {
129
129
  get children() {
130
130
  return [
131
131
  memo(() => code`writeLine("");
132
- writeLine(colors.bold(colors.text.heading.secondary("Commands:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
132
+ writeLine(bold(textColors.heading.secondary("Commands:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
133
133
  createIntrinsic("hbr", {}),
134
134
  createComponent(HelpCommandsDisplay, { get commands() {
135
135
  return command.children;
@@ -145,7 +145,7 @@ function BaseHelpDisplay(props) {
145
145
  get children() {
146
146
  return [
147
147
  memo(() => code`writeLine("");
148
- writeLine(colors.text.heading.tertiary(\`More information about this command can be found in the reference documentation at \${link("${command.reference}")}\`)${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
148
+ writeLine(textColors.heading.tertiary(\`More information about this command can be found in the reference documentation at \${link("${command.reference}")}\`)${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
149
149
  createIntrinsic("hbr", {}),
150
150
  createComponent(Spacing, {})
151
151
  ];
@@ -172,7 +172,7 @@ function VirtualCommandHelpDisplay(props) {
172
172
  const context = usePowerlines();
173
173
  return [
174
174
  createIntrinsic("hbr", {}),
175
- code`writeLine(colors.bold(colors.text.heading.secondary("Global Options:")));`,
175
+ code`writeLine(bold(textColors.heading.secondary("Global Options:")));`,
176
176
  createIntrinsic("hbr", {}),
177
177
  createComponent(HelpOptionsDisplay, { options }),
178
178
  code`writeLine(""); `,
@@ -183,7 +183,7 @@ function VirtualCommandHelpDisplay(props) {
183
183
  },
184
184
  get children() {
185
185
  return [
186
- memo(() => code`writeLine(colors.text.body.tertiary("The following commands are available through the ${getAppTitle(context, true)} command-line interface:"));
186
+ memo(() => code`writeLine(textColors.body.tertiary("The following commands are available through the ${getAppTitle(context, true)} command-line interface:"));
187
187
  writeLine(""); `),
188
188
  createComponent(Spacing, {}),
189
189
  createComponent(For, {
@@ -194,12 +194,12 @@ function VirtualCommandHelpDisplay(props) {
194
194
  joiner: code`writeLine(""); `,
195
195
  ender: code`writeLine(""); `,
196
196
  children: (child) => [
197
+ createIntrinsic("hbr", {}),
197
198
  memo(() => code`
198
- 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.tags.${camelCase(tag)} ? colors.text.tags.${camelCase(tag)}(colors.inverse(" ${tag} ")) : colors.text.tags.$default(colors.inverse(" ${tag} "))}`).join(" ")}` : ""}\`);
199
- writeLine("");
200
- writeLine(colors.text.body.tertiary(splitText(\`${formatDescription(child.description).replace(/\.+$/, "").trim()}.\`)));
199
+ writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title} ${child.isVirtual ? "" : "Command"}${child.tags?.length > 0 ? ` - ${child.tags.map((tag) => `\${textColors.tags.${camelCase(tag)} ? textColors.tags.${camelCase(tag)}(inverse(" ${tag} ")) : textColors.tags.$default(inverse(" ${tag} "))}`).join(" ")}` : ""}\`));
201
200
  writeLine("");
202
- `),
201
+ writeLine(textColors.body.tertiary(splitText(\`${formatDescription(child.description).replace(/\.+$/, "").trim()}.\`)));
202
+ writeLine(""); `),
203
203
  createIntrinsic("hbr", {}),
204
204
  createComponent(BaseHelpDisplay, {
205
205
  command: child,
@@ -209,7 +209,7 @@ function VirtualCommandHelpDisplay(props) {
209
209
  createIntrinsic("hbr", {})
210
210
  ]
211
211
  }),
212
- 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.");
212
+ memo(() => code`help(\`Running a specific command with the help flag (via: \${inlineCode("${getAppBin(context)} ${segments && segments.length > 0 ? ` ${segments.join(" ")}` : ""} <specific command> --help")}) will provide additional information that is specific to that command.\`);
213
213
  writeLine("");`)
214
214
  ];
215
215
  }
@@ -237,7 +237,7 @@ function CommandHelpDisplay(props) {
237
237
  },
238
238
  get children() {
239
239
  return [
240
- code`writeLine(colors.text.body.tertiary("The following sub-commands are available:"));
240
+ code`writeLine(textColors.body.tertiary("The following sub-commands are available:"));
241
241
  writeLine(""); `,
242
242
  createComponent(Spacing, {}),
243
243
  createComponent(For, {
@@ -248,12 +248,12 @@ function CommandHelpDisplay(props) {
248
248
  joiner: code`writeLine(""); `,
249
249
  ender: code`writeLine(""); `,
250
250
  children: (child) => [
251
+ createIntrinsic("hbr", {}),
251
252
  memo(() => code`
252
- 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.tags.${camelCase(tag)} ? colors.text.tags.${camelCase(tag)}(colors.inverse(" ${tag} ")) : colors.text.tags.$default(colors.inverse(" ${tag} "))}`).join(" ")}` : ""}\`);
253
- writeLine("");
254
- writeLine(colors.text.body.tertiary(splitText(\`${formatDescription(child.description).replace(/\.+$/, "").trim()}.\`)));
253
+ writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title} ${child.isVirtual ? "" : "Command"}${child.tags?.length > 0 ? ` - ${child.tags.map((tag) => `\${textColors.tags.${camelCase(tag)} ? textColors.tags.${camelCase(tag)}(inverse(" ${tag} ")) : textColors.tags.$default(inverse(" ${tag} "))}`).join(" ")}` : ""}\`));
255
254
  writeLine("");
256
- `),
255
+ writeLine(textColors.body.tertiary(splitText(\`${formatDescription(child.description).replace(/\.+$/, "").trim()}.\`)));
256
+ writeLine(""); `),
257
257
  createIntrinsic("hbr", {}),
258
258
  createComponent(BaseHelpDisplay, {
259
259
  command: child,
@@ -263,7 +263,7 @@ function CommandHelpDisplay(props) {
263
263
  createIntrinsic("hbr", {})
264
264
  ]
265
265
  }),
266
- 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.");
266
+ memo(() => code`help(\`Running a specific command with the help flag (via: \${inlineCode("${getAppBin(context)} ${command.segments.join(" ")} <specific command> --help")}) will provide additional information that is specific to that command.\`);
267
267
  writeLine("");`)
268
268
  ];
269
269
  }
@@ -1 +1 @@
1
- {"version":3,"file":"display.mjs","names":[],"sources":["../../src/components/display.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed, For, Show } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { CommandOption, CommandTree } from \"@shell-shock/core\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\nimport {\n formatDescription,\n formatShortDescription,\n getAppBin,\n getAppTitle,\n getDynamicPathSegmentName,\n isDynamicPathSegment,\n sortOptions\n} from \"@shell-shock/core/plugin-utils\";\nimport { useTheme } from \"@shell-shock/plugin-theme/contexts/theme\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { snakeCase } from \"@stryke/string-format/snake-case\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport type { HelpPluginContext } from \"../types/plugin\";\n\nexport interface HelpUsageDisplayProps {\n /**\n * The command to generate help for.\n */\n command: CommandTree;\n\n /**\n * The padding scale to apply to the help display headings.\n *\n * @remarks\n * This value is multiplied by the theme's app padding to determine the final padding.\n *\n * @defaultValue 2\n */\n indent?: number;\n}\n\n/**\n * A component that generates the usage display for a command.\n */\nexport function HelpUsageDisplay(props: HelpUsageDisplayProps) {\n const { command, indent = 2 } = props;\n\n const context = usePowerlines<HelpPluginContext>();\n const theme = useTheme();\n\n return (\n <>\n {code`\n writeLine(\n colors.text.body.secondary(\\`\\${colors.text.usage.bin(\"$_ ${getAppBin(\n context\n )}\")}${\n command.segments.length > 0\n ? ` ${command.segments\n .map(\n segment =>\n `\\${colors.text.usage.${\n isDynamicPathSegment(segment) ? \"dynamic\" : \"command\"\n }(\"${\n isDynamicPathSegment(segment)\n ? `[${snakeCase(getDynamicPathSegmentName(segment))}]`\n : segment\n }\")}`\n )\n .join(\" \")}`\n : \"\"\n }${\n Object.values(command.children).length > 0\n ? ` \\${colors.text.usage.dynamic(\"[command]\")}`\n : \"\"\n }${\n command.args.length > 0\n ? ` ${command.args\n .map(\n arg =>\n `\\${colors.text.usage.args(\"<${snakeCase(\n (arg.kind === CommandParameterKinds.string ||\n arg.kind === CommandParameterKinds.number) &&\n arg.choices &&\n arg.choices.length > 0\n ? arg.choices.join(\"|\")\n : arg.kind === CommandParameterKinds.string &&\n arg.format\n ? arg.format\n : arg.name\n )}${\n (arg.kind === CommandParameterKinds.string ||\n arg.kind === CommandParameterKinds.number) &&\n arg.variadic\n ? \"...\"\n : \"\"\n }>\")}`\n )\n .join(\" \")}`\n : \"\"\n } \\${colors.text.usage.options(\"[options]\")}\\`), { padding: ${\n theme.padding.app * indent\n } }\n );`}\n <hbr />\n <Show when={command.args.length > 0}>\n <hbr />\n {code`\n writeLine(\n colors.text.body.secondary(\\`\\${colors.text.usage.bin(\"$_ ${getAppBin(context)}\")}${\n command.segments.length > 0\n ? ` ${command.segments\n .map(\n segment =>\n `\\${colors.text.usage.${\n isDynamicPathSegment(segment) ? \"dynamic\" : \"command\"\n }(\"${\n isDynamicPathSegment(segment)\n ? `[${snakeCase(getDynamicPathSegmentName(segment))}]`\n : segment\n }\")}`\n )\n .join(\" \")}`\n : \"\"\n }${\n Object.values(command.children).length > 0\n ? ` \\${colors.text.usage.dynamic(\"[command]\")}`\n : \"\"\n } \\${colors.text.usage.options(\"[options]\")}${\n command.args.length > 0\n ? ` ${command.args\n .map(\n arg =>\n `\\${colors.text.usage.args(\"<${snakeCase(\n (arg.kind === CommandParameterKinds.string ||\n arg.kind === CommandParameterKinds.number) &&\n arg.choices &&\n arg.choices.length > 0\n ? arg.choices.join(\"|\")\n : arg.kind === CommandParameterKinds.string &&\n arg.format\n ? arg.format\n : arg.name\n )}${\n (arg.kind === CommandParameterKinds.string ||\n arg.kind === CommandParameterKinds.number) &&\n arg.variadic\n ? \"...\"\n : \"\"\n }>\")}`\n )\n .join(\" \")}`\n : \"\"\n }\\`), { padding: ${theme.padding.app * indent} }\n );`}\n <hbr />\n </Show>\n </>\n );\n}\n\nexport interface HelpOptionsDisplayProps {\n /**\n * The options to display help for.\n */\n options: CommandOption[];\n}\n\n/**\n * A component that generates the options table display for a command.\n */\nexport function HelpOptionsDisplay(props: HelpOptionsDisplayProps) {\n const { options } = props;\n\n const context = usePowerlines<HelpPluginContext>();\n\n return (\n <>\n {code`table([ `}\n <hbr />\n <For each={sortOptions(options)} hardline>\n {option => {\n const flags = [] as string[];\n const names = [] as string[];\n if (option.name.length === 1) {\n flags.push(`-${option.name}`);\n } else {\n names.push(`--${kebabCase(option.name)}`);\n }\n\n option.alias.forEach((alias: string) => {\n if (alias.length === 1) {\n flags.push(`-${alias}`);\n } else {\n names.push(`--${kebabCase(alias)}`);\n }\n });\n\n return code`[{ value: colors.text.body.primary(\"${\n flags.length > 0\n ? `${flags.sort().join(\", \")}${names.length > 0 ? \", \" : \"\"}`\n : \"\"\n }${names.length > 0 ? names.sort().join(\", \") : \"\"}${\n option.kind === CommandParameterKinds.string\n ? ` <${snakeCase(\n option.choices && option.choices.length > 0\n ? option.choices.join(\"|\")\n : option.format\n ? option.format\n : option.name\n )}${option.variadic ? \"...\" : \"\"}>`\n : option.kind === CommandParameterKinds.number\n ? ` <${snakeCase(\n option.choices && option.choices.length > 0\n ? option.choices.join(\"|\")\n : option.name\n )}${option.variadic ? \"...\" : \"\"}>`\n : \"\"\n }\"), align: \"right\", border: \"none\", maxWidth: \"1/3\" }, { value: colors.text.body.tertiary(\\`${formatShortDescription(\n option.description\n )\n .replace(/\\.+$/, \"\")\n .trim()}${\n option.env || option.default !== undefined\n ? ` (${\n option.env\n ? `env: ${context.config.appSpecificEnvPrefix}_${\n option.env\n }${option.default !== undefined ? \", \" : \"\"}`\n : \"\"\n }${\n option.default !== undefined\n ? `default: ${JSON.stringify(option.default).replace(\n /\"/g,\n '\\\\\"'\n )}`\n : \"\"\n })`\n : \"\"\n }.\\`), align: \"left\", border: \"none\" }], `;\n }}\n </For>\n <hbr />\n {code` ]); `}\n </>\n );\n}\n\nexport interface HelpCommandsDisplayProps {\n /**\n * A mapping of command names to their command definitions.\n */\n commands: Record<string, CommandTree>;\n}\n\n/**\n * A component that generates the commands table display for a command.\n */\nexport function HelpCommandsDisplay(props: HelpCommandsDisplayProps) {\n const { commands } = props;\n\n return (\n <>\n {code`table([ `}\n <hbr />\n <For each={Object.values(commands)} hardline>\n {child =>\n code`[{ value: colors.text.body.primary(\"${\n child.name\n }\"), align: \"right\", border: \"none\" }, { value: colors.text.body.tertiary(\\`${formatShortDescription(\n child.description\n )\n .replace(/\\.+$/, \"\")\n .trim()}.\\`), align: \"left\", border: \"none\" }], `\n }\n </For>\n <hbr />\n {code` ]); `}\n </>\n );\n}\n\nexport interface BaseHelpDisplayProps {\n /**\n * The command to generate help for.\n */\n command: CommandTree;\n\n /**\n * Whether to filter out global options from the help display.\n *\n * @remarks\n * When enabled, any options that are present in the global options context will be filtered out from the help display. This is useful for sub-commands to avoid displaying global options that are not relevant to the specific command.\n *\n * @defaultValue false\n */\n filterGlobalOptions?: boolean;\n\n /**\n * The padding scale to apply to the help display headings.\n *\n * @remarks\n * This value is multiplied by the theme's app padding to determine the final padding.\n *\n * @defaultValue 1\n */\n indent?: number;\n}\n\n/**\n * A component that generates the `help` function declaration for a command.\n */\nexport function BaseHelpDisplay(props: BaseHelpDisplayProps) {\n const { command, indent = 1, filterGlobalOptions = false } = props;\n\n const theme = useTheme();\n const context = usePowerlines<HelpPluginContext>();\n\n const options = computed(() =>\n filterGlobalOptions\n ? Object.values(command.options).filter(\n option =>\n !context.options.some(\n globalOption =>\n globalOption.name === option.name ||\n option.alias.includes(globalOption.name) ||\n globalOption.alias?.includes(option.name) ||\n globalOption.alias?.some(alias => option.alias.includes(alias))\n )\n )\n : Object.values(command.options)\n );\n\n return (\n <>\n {code`writeLine(colors.bold(colors.text.heading.secondary(\"Usage:\"))${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <HelpUsageDisplay command={command} indent={indent} />\n <Spacing />\n <Show when={options.value.length > 0}>\n {code`writeLine(\"\");\n writeLine(colors.bold(colors.text.heading.secondary(\"Options:\"))${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <HelpOptionsDisplay options={options.value} />\n <Spacing />\n </Show>\n <Show when={Object.keys(command.children).length > 0}>\n {code`writeLine(\"\");\n writeLine(colors.bold(colors.text.heading.secondary(\"Commands:\"))${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <HelpCommandsDisplay commands={command.children} />\n <Spacing />\n </Show>\n <Show when={isSetString(command.reference)}>\n {code`writeLine(\"\");\n writeLine(colors.text.heading.tertiary(\\`More information about this command can be found in the reference documentation at \\${link(\"${\n command.reference\n }\")}\\`)${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <Spacing />\n </Show>\n </>\n );\n}\n\nexport interface VirtualCommandHelpDisplayProps {\n /**\n * The options to display help for.\n */\n options: CommandOption[];\n\n /**\n * A mapping of command names to their command definitions.\n */\n commands: Record<string, CommandTree>;\n\n /**\n * The command path to generate help for, used for generating the help invocation instructions.\n *\n * @remarks\n * This is optional since the virtual command entry component can be used for both the global binary executable and virtual commands (there will be no command definition for the binary executable).\n */\n segments?: string[];\n}\n\nfunction sortCommands(commands: Record<string, CommandTree>) {\n return Object.values(commands).sort((a, b) => {\n if (\n a.tags.some(tag => tag.toLowerCase() === \"deprecated\") &&\n !b.tags.some(tag => tag.toLowerCase() === \"deprecated\")\n ) {\n return 1;\n } else if (\n !a.tags.some(tag => tag.toLowerCase() === \"deprecated\") &&\n b.tags.some(tag => tag.toLowerCase() === \"deprecated\")\n ) {\n return -1;\n } else if (\n a.tags.some(tag => tag.toLowerCase() === \"experimental\") &&\n !b.tags.some(tag => tag.toLowerCase() === \"experimental\")\n ) {\n return 1;\n } else if (\n !a.tags.some(tag => tag.toLowerCase() === \"experimental\") &&\n b.tags.some(tag => tag.toLowerCase() === \"experimental\")\n ) {\n return -1;\n } else if (\n a.tags.some(tag => tag.toLowerCase() === \"utility\") &&\n !b.tags.some(tag => tag.toLowerCase() === \"utility\")\n ) {\n return 1;\n } else if (\n !a.tags.some(tag => tag.toLowerCase() === \"utility\") &&\n b.tags.some(tag => tag.toLowerCase() === \"utility\")\n ) {\n return -1;\n }\n\n return a.name.localeCompare(b.name);\n });\n}\n\n/**\n * A component that generates the invocation of the `help` function for a command.\n */\nexport function VirtualCommandHelpDisplay(\n props: VirtualCommandHelpDisplayProps\n) {\n const { options, segments, commands } = props;\n\n const context = usePowerlines<HelpPluginContext>();\n\n return (\n <>\n <hbr />\n {code`writeLine(colors.bold(colors.text.heading.secondary(\"Global Options:\")));`}\n <hbr />\n <HelpOptionsDisplay options={options} />\n {code`writeLine(\"\"); `}\n <Spacing />\n <Show when={Object.keys(commands).length > 0}>\n {code`writeLine(colors.text.body.tertiary(\"The following commands are available through the ${getAppTitle(\n context,\n true\n )} command-line interface:\"));\n writeLine(\"\"); `}\n <Spacing />\n <For\n each={sortCommands(commands)}\n doubleHardline\n joiner={code`writeLine(\"\"); `}\n ender={code`writeLine(\"\"); `}>\n {child => (\n <>\n {code`\n writeLine(colors.text.heading.primary(${\n child.icon\n ? `(isUnicodeSupported ? \" ${child.icon} \" : \"\") + `\n : \"\"\n }\\`${child.title} ${child.isVirtual ? \"\" : \"Command\"}${\n child.tags?.length > 0\n ? ` - ${child.tags\n .map(\n tag =>\n `\\${colors.text.tags.${camelCase(tag)} ? colors.text.tags.${camelCase(tag)}(colors.inverse(\" ${tag} \")) : colors.text.tags.$default(colors.inverse(\" ${tag} \"))}`\n )\n .join(\" \")}`\n : \"\"\n }\\`);\n writeLine(\"\");\n writeLine(colors.text.body.tertiary(splitText(\\`${formatDescription(\n child.description\n )\n .replace(/\\.+$/, \"\")\n .trim()}.\\`)));\n writeLine(\"\");\n `}\n <hbr />\n <BaseHelpDisplay command={child} indent={2} filterGlobalOptions />\n <hbr />\n </>\n )}\n </For>\n {code`help(\"Running a specific command with the help flag (via: '${getAppBin(\n context\n )}${\n segments && segments.length > 0 ? ` ${segments.join(\" \")}` : \"\"\n } <specific command> --help') will provide additional information that is specific to that command.\");\n writeLine(\"\");`}\n </Show>\n </>\n );\n}\n\nexport interface CommandHelpDisplayProps {\n /**\n * A mapping of command names to their command definitions.\n */\n command: CommandTree;\n}\n\n/**\n * A component that generates the invocation of the `help` function for a command.\n */\nexport function CommandHelpDisplay(props: CommandHelpDisplayProps) {\n const { command } = props;\n\n const context = usePowerlines<HelpPluginContext>();\n\n return (\n <>\n {code`writeLine(\"\"); `}\n <Spacing />\n <BaseHelpDisplay command={command} filterGlobalOptions={false} />\n {code`writeLine(\"\"); `}\n <Spacing />\n <Show when={Object.keys(command.children).length > 0}>\n {code`writeLine(colors.text.body.tertiary(\"The following sub-commands are available:\"));\n writeLine(\"\"); `}\n <Spacing />\n <For\n each={sortCommands(command.children)}\n doubleHardline\n joiner={code`writeLine(\"\"); `}\n ender={code`writeLine(\"\"); `}>\n {child => (\n <>\n {code`\n writeLine(colors.text.heading.primary(${\n child.icon\n ? `(isUnicodeSupported ? \" ${child.icon} \" : \"\") + `\n : \"\"\n }\\`${child.title} ${child.isVirtual ? \"\" : \"Command\"}${\n child.tags?.length > 0\n ? ` - ${child.tags\n .map(\n tag =>\n `\\${colors.text.tags.${camelCase(tag)} ? colors.text.tags.${camelCase(tag)}(colors.inverse(\" ${tag} \")) : colors.text.tags.$default(colors.inverse(\" ${tag} \"))}`\n )\n .join(\" \")}`\n : \"\"\n }\\`);\n writeLine(\"\");\n writeLine(colors.text.body.tertiary(splitText(\\`${formatDescription(\n child.description\n )\n .replace(/\\.+$/, \"\")\n .trim()}.\\`)));\n writeLine(\"\");\n `}\n <hbr />\n <BaseHelpDisplay command={child} indent={2} filterGlobalOptions />\n <hbr />\n </>\n )}\n </For>\n {code`help(\"Running a specific command with the help flag (via: '${getAppBin(\n context\n )} ${command.segments.join(\n \" \"\n )} <specific command> --help') will provide additional information that is specific to that command.\");\n writeLine(\"\");`}\n </Show>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmDA,SAAM,iBAAa,OAAA;CACjB,MAAE,EACF,SACF,SAAA;CAEE,MAAA,UAAA,eAAA;CACA,MAAG,QAAU,UAAK;AAClB,QAAA;EAAA,WAAA,IAAA;;oEAEqC,UAAA,QAAA,CAAA,KAAA,QAAA,SAAA,SAAA,IAAA,IAAA,QAAA,SAAA,KAAA,YAAA,wBAAA,qBAAA,QAAA,GAAA,YAAA,UAAA,IAAA,qBAAA,QAAA,GAAA,IAAA,UAAA,0BAAA,QAAA,CAAA,CAAA,KAAA,QAAA,KAAA,CAAA,KAAA,IAAA,KAAA,KAAA,OAAA,OAAA,QAAA,SAAA,CAAA,SAAA,IAAA,gDAAA,KAAA,QAAA,KAAA,SAAA,IAAA,IAAA,QAAA,KAAA,KAAA,QAAA,+BAAA,WAAA,IAAA,SAAA,sBAAA,UAAA,IAAA,SAAA,sBAAA,WAAA,IAAA,WAAA,IAAA,QAAA,SAAA,IAAA,IAAA,QAAA,KAAA,IAAA,GAAA,IAAA,SAAA,sB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AAA,CAAA;OAAI;MAClC,CAAC;KAAE,WAAQ,IAAA,8DAAA,UAAA,QAAA,GAAA,YAAA,SAAA,SAAA,IAAA,IAAA,SAAA,KAAA,IAAA,KAAA,GAAA;wBACK;KAAA;;GAEpB,CAAC;EAAC;;;;;AAYL,SAAI,mBAAA,OAAA;CACF,MAAM,EACJ,YACF;;AAEA,QAAE;EAAA,IAAA;EAAA,gBAAA,SAAA,EAAA,CAAA;EAAA,gBAAA,iBAAA;GACS;GACV,qBAAA;GACA,CAAC;EAAE,IAAA;EAAA,gBAAA,SAAA,EAAA,CAAA;EAAA,gBAAA,MAAA;GACF,IAAC,OAAK;AACP,WAAA,OAAA,KAAA,QAAA,SAAA,CAAA,SAAA;;GAEC,IAAA,WAAA;AACF,WAAA;KAAA,IAAA;;;;MAEE,IAAA,OAAA;AACK,cAAQ,aAAS,QAAY,SAAM;;MAEtC,gBAAA;MACD,QAAW,IAAG;MAChB,OAAA,IAAA;MACG,WAAY,UAAC;OAAA,WAAA,IAAA;wDACf,MAAA,OAAA,2BAAA,MAAA,KAAA,gBAAA,GAAA,IAAA,MAAA,MAAA,GAAA,MAAA,YAAA,KAAA,YAAA,MAAA,MAAA,SAAA,IAAA,MAAA,MAAA,KAAA,KAAA,QAAA,uBAAA,UAAA,IAAA,CAAA,sBAAA,UAAA,IAAA,CAAA,oBAAA,IAAA,oDAAA,IAAA,OAAA,CAAA,KAAA,IAAA,KAAA,GAAA;;kEAEJ,kBAAA,MAAA,YAAA,CAAA,QAAA,QAAA,GAAA,CAAA,MAAA,CAAA;;kBAEE;OAAA,gBAAA,OAAA,EAAA,CAAA;OAAA,gBAAA,iBAAA;QACG,SAAc;QACjB,QAAA;QACK,qBAAwB;QACtB,CAAC;OAAA,gBAAoB,OAAC,EAAA,CAAA;OAAA;;;wBAEP;KAAC"}
1
+ {"version":3,"file":"display.mjs","names":[],"sources":["../../src/components/display.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed, For, Show } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { CommandOption, CommandTree } from \"@shell-shock/core\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\nimport {\n formatDescription,\n formatShortDescription,\n getAppBin,\n getAppTitle,\n getDynamicPathSegmentName,\n isDynamicPathSegment,\n sortOptions\n} from \"@shell-shock/core/plugin-utils\";\nimport { useTheme } from \"@shell-shock/plugin-theme/contexts/theme\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { snakeCase } from \"@stryke/string-format/snake-case\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport type { HelpPluginContext } from \"../types/plugin\";\n\nexport interface HelpUsageDisplayProps {\n /**\n * The command to generate help for.\n */\n command: CommandTree;\n\n /**\n * The padding scale to apply to the help display headings.\n *\n * @remarks\n * This value is multiplied by the theme's app padding to determine the final padding.\n *\n * @defaultValue 2\n */\n indent?: number;\n}\n\n/**\n * A component that generates the usage display for a command.\n */\nexport function HelpUsageDisplay(props: HelpUsageDisplayProps) {\n const { command, indent = 2 } = props;\n\n const context = usePowerlines<HelpPluginContext>();\n const theme = useTheme();\n\n return (\n <>\n {code`\n writeLine(\n textColors.body.secondary(\\`\\${textColors.usage.bin(\"$_ ${getAppBin(\n context\n )}\")}${\n command.segments.length > 0\n ? ` ${command.segments\n .map(\n segment =>\n `\\${textColors.usage.${\n isDynamicPathSegment(segment) ? \"dynamic\" : \"command\"\n }(\"${\n isDynamicPathSegment(segment)\n ? `[${snakeCase(getDynamicPathSegmentName(segment))}]`\n : segment\n }\")}`\n )\n .join(\" \")}`\n : \"\"\n }${\n Object.values(command.children).length > 0\n ? ` \\${textColors.usage.dynamic(\"[command]\")}`\n : \"\"\n }${\n command.args.length > 0\n ? ` ${command.args\n .map(\n arg =>\n `\\${textColors.usage.args(\"<${snakeCase(\n (arg.kind === CommandParameterKinds.string ||\n arg.kind === CommandParameterKinds.number) &&\n arg.choices &&\n arg.choices.length > 0\n ? arg.choices.join(\"|\")\n : arg.kind === CommandParameterKinds.string &&\n arg.format\n ? arg.format\n : arg.name\n )}${\n (arg.kind === CommandParameterKinds.string ||\n arg.kind === CommandParameterKinds.number) &&\n arg.variadic\n ? \"...\"\n : \"\"\n }>\")}`\n )\n .join(\" \")}`\n : \"\"\n } \\${textColors.usage.options(\"[options]\")}\\`), { padding: ${\n theme.padding.app * indent\n } }\n );`}\n <hbr />\n <Show when={command.args.length > 0}>\n <hbr />\n {code`\n writeLine(\n textColors.body.secondary(\\`\\${textColors.usage.bin(\"$_ ${getAppBin(context)}\")}${\n command.segments.length > 0\n ? ` ${command.segments\n .map(\n segment =>\n `\\${textColors.usage.${\n isDynamicPathSegment(segment) ? \"dynamic\" : \"command\"\n }(\"${\n isDynamicPathSegment(segment)\n ? `[${snakeCase(getDynamicPathSegmentName(segment))}]`\n : segment\n }\")}`\n )\n .join(\" \")}`\n : \"\"\n }${\n Object.values(command.children).length > 0\n ? ` \\${textColors.usage.dynamic(\"[command]\")}`\n : \"\"\n } \\${textColors.usage.options(\"[options]\")}${\n command.args.length > 0\n ? ` ${command.args\n .map(\n arg =>\n `\\${textColors.usage.args(\"<${snakeCase(\n (arg.kind === CommandParameterKinds.string ||\n arg.kind === CommandParameterKinds.number) &&\n arg.choices &&\n arg.choices.length > 0\n ? arg.choices.join(\"|\")\n : arg.kind === CommandParameterKinds.string &&\n arg.format\n ? arg.format\n : arg.name\n )}${\n (arg.kind === CommandParameterKinds.string ||\n arg.kind === CommandParameterKinds.number) &&\n arg.variadic\n ? \"...\"\n : \"\"\n }>\")}`\n )\n .join(\" \")}`\n : \"\"\n }\\`), { padding: ${theme.padding.app * indent} }\n );`}\n <hbr />\n </Show>\n </>\n );\n}\n\nexport interface HelpOptionsDisplayProps {\n /**\n * The options to display help for.\n */\n options: CommandOption[];\n}\n\n/**\n * A component that generates the options table display for a command.\n */\nexport function HelpOptionsDisplay(props: HelpOptionsDisplayProps) {\n const { options } = props;\n\n const context = usePowerlines<HelpPluginContext>();\n\n return (\n <>\n {code`table([ `}\n <hbr />\n <For each={sortOptions(options)} hardline>\n {option => {\n const flags = [] as string[];\n const names = [] as string[];\n if (option.name.length === 1) {\n flags.push(`-${option.name}`);\n } else {\n names.push(`--${kebabCase(option.name)}`);\n }\n\n option.alias.forEach((alias: string) => {\n if (alias.length === 1) {\n flags.push(`-${alias}`);\n } else {\n names.push(`--${kebabCase(alias)}`);\n }\n });\n\n return code`[{ value: textColors.body.primary(\"${\n flags.length > 0\n ? `${flags.sort().join(\", \")}${names.length > 0 ? \", \" : \"\"}`\n : \"\"\n }${names.length > 0 ? names.sort().join(\", \") : \"\"}${\n option.kind === CommandParameterKinds.string\n ? ` <${snakeCase(\n option.choices && option.choices.length > 0\n ? option.choices.join(\"|\")\n : option.format\n ? option.format\n : option.name\n )}${option.variadic ? \"...\" : \"\"}>`\n : option.kind === CommandParameterKinds.number\n ? ` <${snakeCase(\n option.choices && option.choices.length > 0\n ? option.choices.join(\"|\")\n : option.name\n )}${option.variadic ? \"...\" : \"\"}>`\n : \"\"\n }\"), align: \"right\", border: \"none\", maxWidth: \"1/3\" }, { value: textColors.body.tertiary(\\`${formatShortDescription(\n option.description\n )\n .replace(/\\.+$/, \"\")\n .trim()}${\n option.env || option.default !== undefined\n ? ` (${\n option.env\n ? `env: ${context.config.appSpecificEnvPrefix}_${\n option.env\n }${option.default !== undefined ? \", \" : \"\"}`\n : \"\"\n }${\n option.default !== undefined\n ? `default: ${JSON.stringify(option.default).replace(\n /\"/g,\n '\\\\\"'\n )}`\n : \"\"\n })`\n : \"\"\n }.\\`), align: \"left\", border: \"none\" }], `;\n }}\n </For>\n <hbr />\n {code` ]); `}\n </>\n );\n}\n\nexport interface HelpCommandsDisplayProps {\n /**\n * A mapping of command names to their command definitions.\n */\n commands: Record<string, CommandTree>;\n}\n\n/**\n * A component that generates the commands table display for a command.\n */\nexport function HelpCommandsDisplay(props: HelpCommandsDisplayProps) {\n const { commands } = props;\n\n return (\n <>\n {code`table([ `}\n <hbr />\n <For each={Object.values(commands)} hardline>\n {child =>\n code`[{ value: textColors.body.primary(\"${\n child.name\n }\"), align: \"right\", border: \"none\" }, { value: textColors.body.tertiary(\\`${formatShortDescription(\n child.description\n )\n .replace(/\\.+$/, \"\")\n .trim()}.\\`), align: \"left\", border: \"none\" }], `\n }\n </For>\n <hbr />\n {code` ]); `}\n </>\n );\n}\n\nexport interface BaseHelpDisplayProps {\n /**\n * The command to generate help for.\n */\n command: CommandTree;\n\n /**\n * Whether to filter out global options from the help display.\n *\n * @remarks\n * When enabled, any options that are present in the global options context will be filtered out from the help display. This is useful for sub-commands to avoid displaying global options that are not relevant to the specific command.\n *\n * @defaultValue false\n */\n filterGlobalOptions?: boolean;\n\n /**\n * The padding scale to apply to the help display headings.\n *\n * @remarks\n * This value is multiplied by the theme's app padding to determine the final padding.\n *\n * @defaultValue 1\n */\n indent?: number;\n}\n\n/**\n * A component that generates the `help` function declaration for a command.\n */\nexport function BaseHelpDisplay(props: BaseHelpDisplayProps) {\n const { command, indent = 1, filterGlobalOptions = false } = props;\n\n const theme = useTheme();\n const context = usePowerlines<HelpPluginContext>();\n\n const options = computed(() =>\n filterGlobalOptions\n ? Object.values(command.options).filter(\n option =>\n !context.options.some(\n globalOption =>\n globalOption.name === option.name ||\n option.alias.includes(globalOption.name) ||\n globalOption.alias?.includes(option.name) ||\n globalOption.alias?.some(alias => option.alias.includes(alias))\n )\n )\n : Object.values(command.options)\n );\n\n return (\n <>\n {code`writeLine(bold(textColors.heading.secondary(\"Usage:\"))${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <HelpUsageDisplay command={command} indent={indent} />\n <Spacing />\n <Show when={options.value.length > 0}>\n {code`writeLine(\"\");\n writeLine(bold(textColors.heading.secondary(\"Options:\"))${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <HelpOptionsDisplay options={options.value} />\n <Spacing />\n </Show>\n <Show when={Object.keys(command.children).length > 0}>\n {code`writeLine(\"\");\n writeLine(bold(textColors.heading.secondary(\"Commands:\"))${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <HelpCommandsDisplay commands={command.children} />\n <Spacing />\n </Show>\n <Show when={isSetString(command.reference)}>\n {code`writeLine(\"\");\n writeLine(textColors.heading.tertiary(\\`More information about this command can be found in the reference documentation at \\${link(\"${\n command.reference\n }\")}\\`)${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <Spacing />\n </Show>\n </>\n );\n}\n\nexport interface VirtualCommandHelpDisplayProps {\n /**\n * The options to display help for.\n */\n options: CommandOption[];\n\n /**\n * A mapping of command names to their command definitions.\n */\n commands: Record<string, CommandTree>;\n\n /**\n * The command path to generate help for, used for generating the help invocation instructions.\n *\n * @remarks\n * This is optional since the virtual command entry component can be used for both the global binary executable and virtual commands (there will be no command definition for the binary executable).\n */\n segments?: string[];\n}\n\nfunction sortCommands(commands: Record<string, CommandTree>) {\n return Object.values(commands).sort((a, b) => {\n if (\n a.tags.some(tag => tag.toLowerCase() === \"deprecated\") &&\n !b.tags.some(tag => tag.toLowerCase() === \"deprecated\")\n ) {\n return 1;\n } else if (\n !a.tags.some(tag => tag.toLowerCase() === \"deprecated\") &&\n b.tags.some(tag => tag.toLowerCase() === \"deprecated\")\n ) {\n return -1;\n } else if (\n a.tags.some(tag => tag.toLowerCase() === \"experimental\") &&\n !b.tags.some(tag => tag.toLowerCase() === \"experimental\")\n ) {\n return 1;\n } else if (\n !a.tags.some(tag => tag.toLowerCase() === \"experimental\") &&\n b.tags.some(tag => tag.toLowerCase() === \"experimental\")\n ) {\n return -1;\n } else if (\n a.tags.some(tag => tag.toLowerCase() === \"utility\") &&\n !b.tags.some(tag => tag.toLowerCase() === \"utility\")\n ) {\n return 1;\n } else if (\n !a.tags.some(tag => tag.toLowerCase() === \"utility\") &&\n b.tags.some(tag => tag.toLowerCase() === \"utility\")\n ) {\n return -1;\n }\n\n return a.name.localeCompare(b.name);\n });\n}\n\n/**\n * A component that generates the invocation of the `help` function for a command.\n */\nexport function VirtualCommandHelpDisplay(\n props: VirtualCommandHelpDisplayProps\n) {\n const { options, segments, commands } = props;\n\n const context = usePowerlines<HelpPluginContext>();\n\n return (\n <>\n <hbr />\n {code`writeLine(bold(textColors.heading.secondary(\"Global Options:\")));`}\n <hbr />\n <HelpOptionsDisplay options={options} />\n {code`writeLine(\"\"); `}\n <Spacing />\n <Show when={Object.keys(commands).length > 0}>\n {code`writeLine(textColors.body.tertiary(\"The following commands are available through the ${getAppTitle(\n context,\n true\n )} command-line interface:\"));\n writeLine(\"\"); `}\n <Spacing />\n <For\n each={sortCommands(commands)}\n doubleHardline\n joiner={code`writeLine(\"\"); `}\n ender={code`writeLine(\"\"); `}>\n {child => (\n <>\n <hbr />\n {code`\n writeLine(textColors.heading.primary(${\n child.icon\n ? `(isUnicodeSupported ? \" ${child.icon} \" : \"\") + `\n : \"\"\n }\\`${child.title} ${child.isVirtual ? \"\" : \"Command\"}${\n child.tags?.length > 0\n ? ` - ${child.tags\n .map(\n tag =>\n `\\${textColors.tags.${camelCase(tag)} ? textColors.tags.${camelCase(tag)}(inverse(\" ${tag} \")) : textColors.tags.$default(inverse(\" ${tag} \"))}`\n )\n .join(\" \")}`\n : \"\"\n }\\`));\n writeLine(\"\");\n writeLine(textColors.body.tertiary(splitText(\\`${formatDescription(\n child.description\n )\n .replace(/\\.+$/, \"\")\n .trim()}.\\`)));\n writeLine(\"\"); `}\n <hbr />\n <BaseHelpDisplay command={child} indent={2} filterGlobalOptions />\n <hbr />\n </>\n )}\n </For>\n {code`help(\\`Running a specific command with the help flag (via: \\${inlineCode(\"${getAppBin(\n context\n )} ${\n segments && segments.length > 0 ? ` ${segments.join(\" \")}` : \"\"\n } <specific command> --help\")}) will provide additional information that is specific to that command.\\`);\n writeLine(\"\");`}\n </Show>\n </>\n );\n}\n\nexport interface CommandHelpDisplayProps {\n /**\n * A mapping of command names to their command definitions.\n */\n command: CommandTree;\n}\n\n/**\n * A component that generates the invocation of the `help` function for a command.\n */\nexport function CommandHelpDisplay(props: CommandHelpDisplayProps) {\n const { command } = props;\n\n const context = usePowerlines<HelpPluginContext>();\n\n return (\n <>\n {code`writeLine(\"\"); `}\n <Spacing />\n <BaseHelpDisplay command={command} filterGlobalOptions={false} />\n {code`writeLine(\"\"); `}\n <Spacing />\n <Show when={Object.keys(command.children).length > 0}>\n {code`writeLine(textColors.body.tertiary(\"The following sub-commands are available:\"));\n writeLine(\"\"); `}\n <Spacing />\n <For\n each={sortCommands(command.children)}\n doubleHardline\n joiner={code`writeLine(\"\"); `}\n ender={code`writeLine(\"\"); `}>\n {child => (\n <>\n <hbr />\n {code`\n writeLine(textColors.heading.primary(${\n child.icon\n ? `(isUnicodeSupported ? \" ${child.icon} \" : \"\") + `\n : \"\"\n }\\`${child.title} ${child.isVirtual ? \"\" : \"Command\"}${\n child.tags?.length > 0\n ? ` - ${child.tags\n .map(\n tag =>\n `\\${textColors.tags.${camelCase(tag)} ? textColors.tags.${camelCase(tag)}(inverse(\" ${tag} \")) : textColors.tags.$default(inverse(\" ${tag} \"))}`\n )\n .join(\" \")}`\n : \"\"\n }\\`));\n writeLine(\"\");\n writeLine(textColors.body.tertiary(splitText(\\`${formatDescription(\n child.description\n )\n .replace(/\\.+$/, \"\")\n .trim()}.\\`)));\n writeLine(\"\"); `}\n <hbr />\n <BaseHelpDisplay command={child} indent={2} filterGlobalOptions />\n <hbr />\n </>\n )}\n </For>\n {code`help(\\`Running a specific command with the help flag (via: \\${inlineCode(\"${getAppBin(\n context\n )} ${command.segments.join(\n \" \"\n )} <specific command> --help\")}) will provide additional information that is specific to that command.\\`);\n writeLine(\"\");`}\n </Show>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmDA,SAAM,iBAAa,OAAA;CACjB,MAAE,EACF,SACF,SAAA;CAEE,MAAA,UAAA,eAAA;CACA,MAAG,QAAU,UAAK;AAClB,QAAA;EAAA,WAAA,IAAA;;kEAEqC,UAAA,QAAA,CAAA,KAAA,QAAA,SAAA,SAAA,IAAA,IAAA,QAAA,SAAA,KAAA,YAAA,uBAAA,qBAAA,QAAA,GAAA,YAAA,UAAA,IAAA,qBAAA,QAAA,GAAA,IAAA,UAAA,0BAAA,QAAA,CAAA,CAAA,KAAA,QAAA,KAAA,CAAA,KAAA,IAAA,KAAA,KAAA,OAAA,OAAA,QAAA,SAAA,CAAA,SAAA,IAAA,+CAAA,KAAA,QAAA,KAAA,SAAA,IAAA,IAAA,QAAA,KAAA,KAAA,QAAA,8BAAA,WAAA,IAAA,SAAA,sBAAA,UAAA,IAAA,SAAA,sBAAA,WAAA,IAAA,WAAA,IAAA,QAAA,SAAA,IAAA,IAAA,QAAA,KAAA,IAAA,GAAA,IAAA,SAAA,sBAAA,UAAA,IAAA,SAAA,IAAA,SAAA,IAAA,KAAA,IAAA,IAAA,SAAA,sBAAA,UAAA,IAAA,SAAA,sBAAA,WAAA,IAAA,WAAA,QAAA,GAAA,MAAA,CAAA,KAAA,IAAA,KAAA,GAAA,4DAAA,MAAA,QAAA,MAAA,OAAA;;;;GAErC,IAAM,OAAO;AACb,WAAW,QAAG,KAAU,SAAA;;GAExB,IAAM,WAAC;AACJ,WAAA;KAAA,gBAAA,OAAA,EAAA,CAAA;KAAA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,CAAA;EAAA,IAAA;EAAA,gBAAA,SAAA,EAAA,CAAA;EAAA,gBAAA,MAAA;GACC,IAAE,OAAA;AACD,WAAK,OAAS,KAAI,QAAQ,SAAS,CAAA,SAAW;;GAE/C,IAAE,WAAa;AACf,WAAA;KAAA,IAAA;;KACoB,gBAAO,SAAA,EAAA,CAAA;KAAA,gBAAA,KAAA;;AAE3B,cAAA,aAAA,QAAA,SAAA;;MAED,gBAAA;MACG,QAAA,IAAA;MACD,OAAU,IAAI;MAChB,WAAA,UAAA;OAAA,gBAAA,OAAA,EAAA,CAAA;OAAA,WAAA,IAAA;uDACgB,MAAA,OAAA,2BAAA,MAAA,KAAA,gBAAA,GAAA,IAAA,MAAA,MAAA,GAAA,MAAA,YAAA,KAAA,YAAA,MAAA,MAAA,SAAA,IAAA,MAAA,MAAA,KAAA,KAAA,QAAA,sBAAA,UAAA,IAAA,CAAA,qBAAA,UAAA,IAAA,CAAA,aAAA,IAAA,4CAAA,IAAA,OAAA,CAAA,KAAA,IAAA,KAAA,GAAA;;iEAEF,kBAAA,MAAA,YAAA,CAAA,QAAA,QAAA,GAAA,CAAA,MAAA,CAAA;iCACjB;OAAA,gBAAA,OAAA,EAAA,CAAA;OAAA,gBAAA,iBAAA;;QAEE,QAAA;QACG,qBAAyB;QAC5B,CAAA;OAAA,gBAAA,OAAA,EAAA,CAAA;OAAA;MACK,CAAA;KAAA,WAAS,IAAA,6EAA6C,UAAA,QAAA,CAAA,GAAA,QAAA,SAAA,KAAA,IAAA,CAAA;wBAC1C;KAAM;;GAEvB,CAAA;EAAA"}
@@ -60,7 +60,10 @@ function HelpBuiltin(props) {
60
60
  console: [
61
61
  "splitText",
62
62
  "writeLine",
63
- "colors",
63
+ "inlineCode",
64
+ "textColors",
65
+ "inverse",
66
+ "bold",
64
67
  "help",
65
68
  "table",
66
69
  "link"
@@ -57,7 +57,10 @@ function HelpBuiltin(props) {
57
57
  console: [
58
58
  "splitText",
59
59
  "writeLine",
60
- "colors",
60
+ "inlineCode",
61
+ "textColors",
62
+ "inverse",
63
+ "bold",
61
64
  "help",
62
65
  "table",
63
66
  "link"
@@ -1 +1 @@
1
- {"version":3,"file":"help-builtin.mjs","names":[],"sources":["../../src/components/help-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport { FunctionDeclaration, IfStatement } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n TSDoc,\n TSDocRemarks,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript\";\nimport type { BuiltinFileProps } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport { BuiltinFile } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport type { CommandTree } from \"@shell-shock/core\";\nimport {\n getAppTitle,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport defu from \"defu\";\nimport type { HelpPluginContext } from \"../types\";\nimport { CommandHelpDisplay, VirtualCommandHelpDisplay } from \"./display\";\n\n/**\n * The `updateVersionCheckFile` handler function declaration code for the Shell Shock project.\n */\nexport function HelpFunctionDeclaration() {\n return (\n <>\n <TSDoc heading=\"A helper function that updates the version check file.\">\n <TSDocRemarks>\n {`This function is used to update the version check file with the current timestamp. It can be used in the CLI upgrade command to record the last time a check for updates was performed. The function writes a \"version-check.json\" file in the data directory, which contains a timestamp of the last check for updates.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocReturns>\n {`A promise that resolves to a boolean indicating whether a check for updates is required.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"updateVersionCheckFile\"\n returnType=\"void\">\n <IfStatement condition={code`!existsSync(paths.data)`}>\n {code`await mkdir(paths.data, { recursive: true }); `}\n </IfStatement>\n {code`await writeFile(join(paths.data, \"version-check.json\"), JSON.stringify({ timestamp: new Date().getTime() }), \"utf8\"); `}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface HelpBuiltinProps extends Omit<\n BuiltinFileProps,\n \"id\" | \"description\"\n> {\n /**\n * The command to generate the `help` function declaration for.\n */\n command: CommandTree;\n}\n\n/**\n * A built-in help module for Shell Shock.\n */\nexport function HelpBuiltin(props: HelpBuiltinProps) {\n const [{ command, children }, rest] = splitProps(props, [\n \"command\",\n \"children\"\n ]);\n const context = usePowerlines<HelpPluginContext>();\n\n return (\n <BuiltinFile\n id={joinPaths(\n \"help\",\n ...command.segments.filter(segment => !isDynamicPathSegment(segment))\n )}\n description={\n command.path\n ? `A collection of utility functions that assist in displaying help information for the ${\n command.title\n } command.`\n : `A collection of utility functions that assist in displaying help information for the ${getAppTitle(\n context,\n true\n )} command-line interface application.`\n }\n {...rest}\n builtinImports={defu(rest.builtinImports ?? {}, {\n utils: [\"isUnicodeSupported\"],\n console: [\"splitText\", \"writeLine\", \"colors\", \"help\", \"table\", \"link\"]\n })}>\n <FunctionDeclaration\n export\n name=\"showHelp\"\n doc={`Display help information for the ${\n command.path\n ? `${command.title} command`\n : `${getAppTitle(context, true)} application`\n }.`}\n parameters={[]}>\n <Show\n when={!command.isVirtual}\n fallback={\n <VirtualCommandHelpDisplay\n options={Object.values(command.options)}\n commands={command.children ?? {}}\n />\n }>\n <CommandHelpDisplay command={command} />\n </Show>\n </FunctionDeclaration>\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </Built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G,WAAY;AACrB,eAAA,gBAAA,2BAAA;SACQ,IAAA,UAAA;AACR,iBAAgB,OAAU,OAAA,QAAe,QAAO;;SAEtC,IAAG,WAAY;AACtB,iBAAA,QAAA,YAAA,EAAA;;SAED,CAAA;;OAEI,IAAE,WAAa;AACjB,eAAQ,gBAAA,oBAAA,EACO,SACV,CAAC;;OAER,CAAA;;KAED,CAAC;IAAE,gBAAe,SAAS,EAAA,CAAA;IAAA,gBAAA,MAAA;KAC1B,IAAE,OAAS;AACT,aAAG,QAAA,SAAA;;KAEC;KACP,CAAC;IAAC;;EAEN,CAAC,CAAC"}
1
+ {"version":3,"file":"help-builtin.mjs","names":[],"sources":["../../src/components/help-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport { FunctionDeclaration, IfStatement } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n TSDoc,\n TSDocRemarks,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript\";\nimport type { BuiltinFileProps } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport { BuiltinFile } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport type { CommandTree } from \"@shell-shock/core\";\nimport {\n getAppTitle,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport defu from \"defu\";\nimport type { HelpPluginContext } from \"../types\";\nimport { CommandHelpDisplay, VirtualCommandHelpDisplay } from \"./display\";\n\n/**\n * The `updateVersionCheckFile` handler function declaration code for the Shell Shock project.\n */\nexport function HelpFunctionDeclaration() {\n return (\n <>\n <TSDoc heading=\"A helper function that updates the version check file.\">\n <TSDocRemarks>\n {`This function is used to update the version check file with the current timestamp. It can be used in the CLI upgrade command to record the last time a check for updates was performed. The function writes a \"version-check.json\" file in the data directory, which contains a timestamp of the last check for updates.`}\n </TSDocRemarks>\n <Spacing />\n <TSDocReturns>\n {`A promise that resolves to a boolean indicating whether a check for updates is required.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"updateVersionCheckFile\"\n returnType=\"void\">\n <IfStatement condition={code`!existsSync(paths.data)`}>\n {code`await mkdir(paths.data, { recursive: true }); `}\n </IfStatement>\n {code`await writeFile(join(paths.data, \"version-check.json\"), JSON.stringify({ timestamp: new Date().getTime() }), \"utf8\"); `}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface HelpBuiltinProps extends Omit<\n BuiltinFileProps,\n \"id\" | \"description\"\n> {\n /**\n * The command to generate the `help` function declaration for.\n */\n command: CommandTree;\n}\n\n/**\n * A built-in help module for Shell Shock.\n */\nexport function HelpBuiltin(props: HelpBuiltinProps) {\n const [{ command, children }, rest] = splitProps(props, [\n \"command\",\n \"children\"\n ]);\n const context = usePowerlines<HelpPluginContext>();\n\n return (\n <BuiltinFile\n id={joinPaths(\n \"help\",\n ...command.segments.filter(segment => !isDynamicPathSegment(segment))\n )}\n description={\n command.path\n ? `A collection of utility functions that assist in displaying help information for the ${\n command.title\n } command.`\n : `A collection of utility functions that assist in displaying help information for the ${getAppTitle(\n context,\n true\n )} command-line interface application.`\n }\n {...rest}\n builtinImports={defu(rest.builtinImports ?? {}, {\n utils: [\"isUnicodeSupported\"],\n console: [\n \"splitText\",\n \"writeLine\",\n \"inlineCode\",\n \"textColors\",\n \"inverse\",\n \"bold\",\n \"help\",\n \"table\",\n \"link\"\n ]\n })}>\n <FunctionDeclaration\n export\n name=\"showHelp\"\n doc={`Display help information for the ${\n command.path\n ? `${command.title} command`\n : `${getAppTitle(context, true)} application`\n }.`}\n parameters={[]}>\n <Show\n when={!command.isVirtual}\n fallback={\n <VirtualCommandHelpDisplay\n options={Object.values(command.options)}\n commands={command.children ?? {}}\n />\n }>\n <CommandHelpDisplay command={command} />\n </Show>\n </FunctionDeclaration>\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAoCA,SAAc,0BAA4B;AAC1C,QAAS,CAAA,gBAAmB,OAAC;;EAE3B,IAAA,WAAA;AACI,UAAE;IAAA,gBAAwB,cAAQ,EACtC,UAAA,4TACK,CAAA;IAAA,gBAAS,SAAA,EAAuB,CAAC;IAAE,gBAAA,cAAA,EAClC,UAAC,4FACJ,CAAA;IAAA;;EAEF,CAAC,EAAE,gBAAe,qBAAA;EACjB,UAAQ;EACR,OAAM;EACN,MAAK;EACL,YAAK;EACL,IAAI,WAAM;AACR,UAAI,CAAA,gBAAY,aAAA;IACd,WAAK,IAAA;IACN,UAAA,IAAA;IACA,CAAC,EAAA,IAAA,yHAAA;;EAEL,CAAC,CAAC;;;;;AAYL,SAAE,YAAgB,OAAA;CAChB,MAAM,CAAC,EACP,SACE,YACC,QAAI,WAAW,OAAS,CAAG,WAAQ,WAAS,CAAA;CAC/C,MAAE,UAAA,eAAA;AACF,QAAO,gBAAa,aAAA,WAAA;EACtB,IAAA,KAAA;;;EAGI,IAAC,cAAc;AACjB,UAAA,WAAA,CAAA,CAAA,QAAA,KAAA,EAAA,GAAA,wFAAA,QAAA,MAAA,aAAA,wFAAA,YAAA,SAAA,KAAA,CAAA;;EAEA,EAAA,MAAS;EACP,IAAC,iBAAQ;AACR,UAAQ,KAAA,KAAA,kBAAA,EAAA,EAAA;IACT,OAAA,CAAA,qBAAA;IACI,SAAS;KAAC;KAAa;KAAC;KAAoB;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;;;EAGhD,IAAC,WAAA;AACC,UAAI;IAAA,gBAAS,qBAAA;KACX,UAAM;KACN,MAAG;KACJ,IAAA,MAAA;AACD,aAAW,oCAAC,QAAA,OAAA,GAAA,QAAA,MAAA,YAAA,GAAA,YAAA,SAAA,KAAA,CAAA,cAAA;;KAEV,YAAO,EAAA;KACP,IAAI,WAAU;AACZ,aAAI,gBAAQ,MAAA;OACV,IAAG,OAAA;AACD,eAAO,CAAA,QAAA;;OAET,IAAG,WAAY;AACrB,eAAA,gBAAA,2BAAA;SACQ,IAAA,UAAA;AACR,iBAAgB,OAAU,OAAA,QAAe,QAAO;;SAEtC,IAAC,WAAA;AACN,iBAAU,QAAA,YAAA,EAAA;;SAEV,CAAA;;OAEA,IAAA,WAAQ;AACR,eAAK,gBAAA,oBAAA,EACA,SACL,CAAK;;OAER,CAAA;;KAED,CAAA;IAAA,gBAAA,SAAA,EAAA,CAAA;IAAA,gBAAA,MAAA;KACC,IAAA,OAAA;AACA,aAAM,QAAQ,SAAA;;KAEJ;KACX,CAAC;IAAC;;EAEN,CAAC,CAAC"}
@@ -6,8 +6,6 @@ let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin
6
6
  let _alloy_js_typescript = require("@alloy-js/typescript");
7
7
  let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
8
8
  let _stryke_path = require("@stryke/path");
9
- let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
10
- let _powerlines_plugin_alloy_core = require("@powerlines/plugin-alloy/core");
11
9
  let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
12
10
 
13
11
  //#region src/components/help-command.tsx
@@ -25,70 +23,40 @@ function HelpCommand() {
25
23
  "node:fs/promises": ["readFile", "writeFile"]
26
24
  },
27
25
  builtinImports: { console: [
28
- "colors",
26
+ "splitText",
29
27
  "writeLine",
30
- "success",
31
- "warn",
32
- "stripAnsi"
28
+ "inlineCode",
29
+ "textColors",
30
+ "inverse",
31
+ "bold",
32
+ "help",
33
+ "table",
34
+ "link"
33
35
  ] },
34
36
  get children() {
35
- return [
36
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Options for the Help command." }),
37
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
38
- "export": true,
39
- name: "HelpOptions",
40
- get children() {
41
- return [
42
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
43
- heading: "Whether to help to the latest version.",
44
- get children() {
45
- return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `If set to \`true\`, the command will attempt to help to the latest version. This option takes precedence over the \`version\` option.` }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
46
- get type() {
47
- return _powerlines_deepkit_vendor_type.ReflectionKind.boolean;
48
- },
49
- defaultValue: false
50
- })];
51
- }
52
- }),
53
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
54
- name: "latest",
55
- optional: true,
56
- type: "boolean"
57
- }),
58
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
59
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
60
- heading: "A specific application version to help to.",
61
- get children() {
62
- return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The command will attempt to help to the specified version. The version should be a valid semantic version string, or \`latest\` to help to the latest version.` }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
63
- get type() {
64
- return _powerlines_deepkit_vendor_type.ReflectionKind.string;
65
- },
66
- defaultValue: "latest"
67
- })];
68
- }
69
- }),
70
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
71
- name: "version",
72
- optional: true,
73
- type: "string"
74
- })
75
- ];
76
- }
77
- }),
78
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
79
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Handler logic for the \\`help\\` command." }),
80
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
81
- "export": true,
82
- "default": true,
83
- async: true,
84
- name: "handler",
85
- parameters: [{
37
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
38
+ heading: "Display command usage details and other useful information to the user.",
39
+ get children() {
40
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
86
41
  name: "options",
87
- type: "HelpOptions"
88
- }],
89
- children: _alloy_js_core.code` return;`
90
- })
91
- ];
42
+ children: `The options for the help command. This can include various flags and parameters to customize the behavior of the help command, such as specifying a particular command to show help for, or toggling the display of additional information.`
43
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
44
+ name: "segments",
45
+ children: `The command segments for the command to show help for. This is used to determine which command's help information to display. If no segments are provided, general help information about the CLI application will be displayed.`
46
+ })];
47
+ }
48
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
49
+ "export": true,
50
+ "default": true,
51
+ async: true,
52
+ name: "handler",
53
+ parameters: [{
54
+ name: "segments",
55
+ type: "string[]",
56
+ default: "[]"
57
+ }],
58
+ children: _alloy_js_core.code` return;`
59
+ })];
92
60
  }
93
61
  });
94
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"help-command.d.cts","names":[],"sources":["../../src/components/help-command.tsx"],"mappings":";;;;;;iBAyCgB,WAAA,CAAA,GAAW,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"help-command.d.cts","names":[],"sources":["../../src/components/help-command.tsx"],"mappings":";;;;;;iBAgCgB,WAAA,CAAA,GAAW,iBAAA,CAAA,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"help-command.d.mts","names":[],"sources":["../../src/components/help-command.tsx"],"mappings":";;;;;;iBAyCgB,WAAA,CAAA,GAAW,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"help-command.d.mts","names":[],"sources":["../../src/components/help-command.tsx"],"mappings":";;;;;;iBAgCgB,WAAA,CAAA,GAAW,iBAAA,CAAA,QAAA"}
@@ -1,12 +1,10 @@
1
1
  import { createComponent } from "@alloy-js/core/jsx-runtime";
2
2
  import { code } from "@alloy-js/core";
3
3
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
4
- import { FunctionDeclaration, InterfaceDeclaration } from "@alloy-js/typescript";
5
- import { InterfaceMember, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
4
+ import { FunctionDeclaration } from "@alloy-js/typescript";
5
+ import { TypescriptFile } from "@powerlines/plugin-alloy/typescript";
6
6
  import { joinPaths } from "@stryke/path";
7
- import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
8
- import { Spacing } from "@powerlines/plugin-alloy/core";
9
- import { TSDoc as TSDoc$1, TSDocDefaultValue, TSDocRemarks as TSDocRemarks$1 } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
7
+ import { TSDoc as TSDoc$1, TSDocParam } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
10
8
 
11
9
  //#region src/components/help-command.tsx
12
10
  /**
@@ -23,70 +21,40 @@ function HelpCommand() {
23
21
  "node:fs/promises": ["readFile", "writeFile"]
24
22
  },
25
23
  builtinImports: { console: [
26
- "colors",
24
+ "splitText",
27
25
  "writeLine",
28
- "success",
29
- "warn",
30
- "stripAnsi"
26
+ "inlineCode",
27
+ "textColors",
28
+ "inverse",
29
+ "bold",
30
+ "help",
31
+ "table",
32
+ "link"
31
33
  ] },
32
34
  get children() {
33
- return [
34
- createComponent(TSDoc$1, { heading: "Options for the Help command." }),
35
- createComponent(InterfaceDeclaration, {
36
- "export": true,
37
- name: "HelpOptions",
38
- get children() {
39
- return [
40
- createComponent(TSDoc$1, {
41
- heading: "Whether to help to the latest version.",
42
- get children() {
43
- return [createComponent(TSDocRemarks$1, { children: `If set to \`true\`, the command will attempt to help to the latest version. This option takes precedence over the \`version\` option.` }), createComponent(TSDocDefaultValue, {
44
- get type() {
45
- return ReflectionKind.boolean;
46
- },
47
- defaultValue: false
48
- })];
49
- }
50
- }),
51
- createComponent(InterfaceMember, {
52
- name: "latest",
53
- optional: true,
54
- type: "boolean"
55
- }),
56
- createComponent(Spacing, {}),
57
- createComponent(TSDoc$1, {
58
- heading: "A specific application version to help to.",
59
- get children() {
60
- return [createComponent(TSDocRemarks$1, { children: `The command will attempt to help to the specified version. The version should be a valid semantic version string, or \`latest\` to help to the latest version.` }), createComponent(TSDocDefaultValue, {
61
- get type() {
62
- return ReflectionKind.string;
63
- },
64
- defaultValue: "latest"
65
- })];
66
- }
67
- }),
68
- createComponent(InterfaceMember, {
69
- name: "version",
70
- optional: true,
71
- type: "string"
72
- })
73
- ];
74
- }
75
- }),
76
- createComponent(Spacing, {}),
77
- createComponent(TSDoc$1, { heading: "Handler logic for the \\`help\\` command." }),
78
- createComponent(FunctionDeclaration, {
79
- "export": true,
80
- "default": true,
81
- async: true,
82
- name: "handler",
83
- parameters: [{
35
+ return [createComponent(TSDoc$1, {
36
+ heading: "Display command usage details and other useful information to the user.",
37
+ get children() {
38
+ return [createComponent(TSDocParam, {
84
39
  name: "options",
85
- type: "HelpOptions"
86
- }],
87
- children: code` return;`
88
- })
89
- ];
40
+ children: `The options for the help command. This can include various flags and parameters to customize the behavior of the help command, such as specifying a particular command to show help for, or toggling the display of additional information.`
41
+ }), createComponent(TSDocParam, {
42
+ name: "segments",
43
+ children: `The command segments for the command to show help for. This is used to determine which command's help information to display. If no segments are provided, general help information about the CLI application will be displayed.`
44
+ })];
45
+ }
46
+ }), createComponent(FunctionDeclaration, {
47
+ "export": true,
48
+ "default": true,
49
+ async: true,
50
+ name: "handler",
51
+ parameters: [{
52
+ name: "segments",
53
+ type: "string[]",
54
+ default: "[]"
55
+ }],
56
+ children: code` return;`
57
+ })];
90
58
  }
91
59
  });
92
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"help-command.mjs","names":[],"sources":["../../src/components/help-command.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code } from \"@alloy-js/core\";\nimport {\n FunctionDeclaration,\n InterfaceDeclaration\n} from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n InterfaceMember,\n TypescriptFile\n} from \"@powerlines/plugin-alloy/typescript\";\nimport {\n TSDoc,\n TSDocDefaultValue,\n TSDocRemarks\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { joinPaths } from \"@stryke/path\";\nimport type { HelpPluginContext } from \"../types/plugin\";\n\n/**\n * The Help command's handler wrapper for the Shell Shock project.\n */\nexport function HelpCommand() {\n const context = usePowerlines<HelpPluginContext>();\n\n return (\n <TypescriptFile\n path={joinPaths(context.entryPath, \"help\", \"command.ts\")}\n imports={{\n \"node:os\": \"os\",\n \"node:fs/promises\": [\"readFile\", \"writeFile\"]\n }}\n builtinImports={{\n console: [\"colors\", \"writeLine\", \"success\", \"warn\", \"stripAnsi\"]\n }}>\n <TSDoc heading=\"Options for the Help command.\" />\n <InterfaceDeclaration export name=\"HelpOptions\">\n <TSDoc heading=\"Whether to help to the latest version.\">\n <TSDocRemarks>{`If set to \\`true\\`, the command will attempt to help to the latest version. This option takes precedence over the \\`version\\` option.`}</TSDocRemarks>\n <TSDocDefaultValue\n type={ReflectionKind.boolean}\n defaultValue={false}\n />\n </TSDoc>\n <InterfaceMember name=\"latest\" optional type=\"boolean\" />\n <Spacing />\n <TSDoc heading=\"A specific application version to help to.\">\n <TSDocRemarks>{`The command will attempt to help to the specified version. The version should be a valid semantic version string, or \\`latest\\` to help to the latest version.`}</TSDocRemarks>\n <TSDocDefaultValue\n type={ReflectionKind.string}\n defaultValue=\"latest\"\n />\n </TSDoc>\n <InterfaceMember name=\"version\" optional type=\"string\" />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Handler logic for the \\`help\\` command.\"></TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[{ name: \"options\", type: \"HelpOptions\" }]}>\n {code` return;`}\n </FunctionDeclaration>\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAgCA,SAAE,cAAiB;CACjB,MAAA,UAAA,eAAA;AACA,QAAO,gBAAkB,gBAAgB;EAC3C,IAAQ,OAAC;AACH,UAAO,UAAC,QAAiB,WAAW,QAAO,aAAO;;EAEtD,SAAA;GACI,WAAM;GACV,oBAAA,CAAA,YAAA,YAAA;GACF;EACE,gBAAgB;;;;;;KAEhB;EACE,IAAC,WAAA;AACC,UAAM;IAAA,gBAAkB,SAAS,EACjC,SAAS,iCACR,CAAC;IAAC,gBAAc,sBAAA;KACf,UAAS;KACV,MAAA;KACD,IAAA,WAAgB;AACd,aAAS;OAAC,gBAAW,SAAa;QAClC,SAAA;QACI,IAAC,WAAS;AACf,gBAAA,CAAA,gBAAiC,gBAAa,EACtC,UAAS,yIACb,CAAA,EAAA,gBAAyB,mBAAc;UACvC,IAAA,OAAA;AACO,kBAAA,eAAsB;;UAE7B,cAAA;UACI,CAAA,CAAA;;QAEN,CAAA;OAAA,gBAAS,iBAAA;QACT,MAAM;QACJ,UAAA;QACA,MAAA;QACA,CAAC;OAAA,gBAAoB,SAAO,EAAA,CAAA;OAAA,gBAAA,SAAA;QAC3B,SAAA;QACD,IAAA,WAAA;AACD,gBAAK,CAAA,gBAAA,gBAAA,EACN,UAAgB,kKACjB,CAAA,EAAA,gBAAoB,mBAAA;UACZ,IAAA,OAAA;AACH,kBAAS,eAAkB;;UAEhC,cAAA;UACA,CAAA,CAAA;;QAEA,CAAI;OAAE,gBAAO,iBAAA;QACb,MAAU;QACT,UAAa;QACd,MAAA;QACF,CAAA;OAAA;;KAEN,CAAA;IAAA,gBAAA,SAAA,EAAA,CAAA;IAAA,gBAAA,SAAA"}
1
+ {"version":3,"file":"help-command.mjs","names":[],"sources":["../../src/components/help-command.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code } from \"@alloy-js/core\";\nimport { FunctionDeclaration } from \"@alloy-js/typescript\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript\";\nimport {\n TSDoc,\n TSDocParam\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { joinPaths } from \"@stryke/path\";\nimport type { HelpPluginContext } from \"../types/plugin\";\n\n/**\n * The Help command's handler wrapper for the Shell Shock project.\n */\nexport function HelpCommand() {\n const context = usePowerlines<HelpPluginContext>();\n\n return (\n <TypescriptFile\n path={joinPaths(context.entryPath, \"help\", \"command.ts\")}\n imports={{\n \"node:os\": \"os\",\n \"node:fs/promises\": [\"readFile\", \"writeFile\"]\n }}\n builtinImports={{\n console: [\n \"splitText\",\n \"writeLine\",\n \"inlineCode\",\n \"textColors\",\n \"inverse\",\n \"bold\",\n \"help\",\n \"table\",\n \"link\"\n ]\n }}>\n <TSDoc heading=\"Display command usage details and other useful information to the user.\">\n <TSDocParam name=\"options\">\n {`The options for the help command. This can include various flags and parameters to customize the behavior of the help command, such as specifying a particular command to show help for, or toggling the display of additional information.`}\n </TSDocParam>\n <TSDocParam name=\"segments\">\n {`The command segments for the command to show help for. This is used to determine which command's help information to display. If no segments are provided, general help information about the CLI application will be displayed.`}\n </TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[{ name: \"segments\", type: \"string[]\", default: \"[]\" }]}>\n {code` return;`}\n </FunctionDeclaration>\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA8BA,SAAY,cAAkB;CAC5B,MAAA,UAAA,eAAA;AACF,QAAO,gBAAoB,gBAAG;EAC5B,IAAM,OAAO;;;EAGX,SAAC;GACC,WAAM;GACN,oBAAS,CAAA,YAAA,YAAA;GACV;EACD,gBAAa,EACX,SAAC;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA,EACF;EACD,IAAI,WAAS;AACX,UAAK,CAAA,gBAAU,SAAA;IACb,SAAG;IACH,IAAG,WAAW;AACZ,YAAC,CAAA,gBAAW,YAAA;MACX,MAAO;MACP,UAAK;MACL,CAAA,EAAA,gBAAK,YAAA;MACL,MAAM;MACN,UAAI;MACP,CAAA,CAAA;;IAED,CAAA,EAAA,gBAAe,qBAAsB;IACpC,UAAC;IACD,WAAQ;IACR,OAAE;IACF,MAAC;IACD,YAAQ,CAAA;KACN,MAAA;KACF,MAAK;KACN,SAAA;KACC,CAAA;IACA,UAAA,IAAA;IACD,CAAC,CAAA;;EAEL,CAAC"}
package/dist/index.cjs CHANGED
@@ -44,7 +44,7 @@ const plugin = (options = {}) => {
44
44
  title: "Help",
45
45
  icon: "🛈",
46
46
  tags: ["Utility"],
47
- description: `A command for displaying help information to assist in using the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface application.`,
47
+ description: `Display command usage details and other useful information to the user.`,
48
48
  entry: {
49
49
  file: (0, _stryke_path_join.joinPaths)(this.entryPath, "help", "index.ts"),
50
50
  input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "help", "command.ts") }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AA0CA;cAAa,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KAsHJ,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AA0CA;cAAa,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KAmHJ,MAAA,CAAO,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AA0CA;cAAa,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KAsHJ,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AA0CA;cAAa,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KAmHJ,MAAA,CAAO,QAAA"}
package/dist/index.mjs CHANGED
@@ -39,7 +39,7 @@ const plugin = (options = {}) => {
39
39
  title: "Help",
40
40
  icon: "🛈",
41
41
  tags: ["Utility"],
42
- description: `A command for displaying help information to assist in using the ${getAppTitle(this, true)} command-line interface application.`,
42
+ description: `Display command usage details and other useful information to the user.`,
43
43
  entry: {
44
44
  file: joinPaths(this.entryPath, "help", "index.ts"),
45
45
  input: { file: joinPaths(this.entryPath, "help", "command.ts") }
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { computed, For, Show } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport {\n getAppDescription,\n getAppName,\n getAppTitle,\n getCommandList\n} from \"@shell-shock/core/plugin-utils\";\nimport type { CommandConfig } from \"@shell-shock/core/types/command\";\nimport console from \"@shell-shock/plugin-console\";\nimport theme from \"@shell-shock/plugin-theme\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport type { Plugin } from \"powerlines\";\nimport { HelpBuiltin, HelpCommand } from \"./components\";\nimport type { HelpPluginContext, HelpPluginOptions } from \"./types/plugin\";\n\nexport type * from \"./types\";\n\n/**\n * The Help - Shell Shock plugin to add a help command to the application.\n */\nexport const plugin = <TContext extends HelpPluginContext = HelpPluginContext>(\n options: HelpPluginOptions = {}\n) => {\n return [\n ...theme(options.theme),\n console(options.console),\n {\n name: \"shell-shock:help\",\n enforce: \"post\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `help` plugin.\"\n );\n\n return {\n help: defu(\n {\n command:\n options.command === false\n ? false\n : isSetString(options.command)\n ? { name: options.command }\n : { name: \"help\" }\n },\n options,\n {\n builtins: true\n }\n )\n };\n },\n async configResolved() {\n this.debug(\"Adding the Help command to the application context.\");\n\n if (this.config.help.command !== false) {\n this.inputs ??= [];\n if (\n this.inputs.some(\n input =>\n input.name === (this.config.help.command as CommandConfig).name\n )\n ) {\n this.info(\n \"The `help` command already exists in the commands list. If you would like the help command to be managed by the `@shell-shock/plugin-help` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: this.config.help.command.name,\n path: this.config.help.command.name,\n segments: [this.config.help.command.name],\n title: \"Help\",\n icon: \"🛈\",\n tags: [\"Utility\"],\n description: `A command for displaying help information to assist in using the ${getAppTitle(\n this,\n true\n )} command-line interface application.`,\n entry: {\n file: joinPaths(this.entryPath, \"help\", \"index.ts\"),\n input: {\n file: joinPaths(this.entryPath, \"help\", \"command.ts\")\n }\n },\n isVirtual: false,\n ...this.config.help.command\n });\n }\n\n await render(this, <HelpCommand />);\n }\n },\n prepare: {\n order: \"post\",\n async handler() {\n const commands = await getCommandList(this);\n this.debug(\n `Rendering \\`help\\` built-ins for each of the ${\n commands.length\n } command modules.`\n );\n\n const bin = computed(() => ({\n id: \"\",\n name: getAppName(this),\n title: getAppTitle(this),\n description: getAppDescription(this),\n isVirtual: true,\n path: null,\n segments: [],\n alias: [],\n tags: [],\n options: Object.fromEntries(\n this.options.map(option => [option.name, option])\n ),\n entry: {\n file: joinPaths(this.entryPath, \"bin.ts\")\n },\n args: [],\n parent: null,\n children: this.commands\n }));\n\n return render(\n this,\n <>\n <Show when={this.config.help.builtins !== false}>\n <HelpBuiltin command={bin.value} />\n <Spacing />\n <For\n each={commands.sort((a, b) => a.name.localeCompare(b.name))}\n doubleHardline>\n {command => <HelpBuiltin command={command} />}\n </For>\n </Show>\n </>\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqCA,MAAa,UAAe,UAAA,EAAA,KAAA;;;;;GAE1B,MAAA;GACC,SAAU;GACX,SAAA;AACI,SAAC,MAAM,qEAAiE;AAC5E,WAAS,EACN,MAAA,KAAA,EACI,SAAA,QAAA,YAAA,QAAA,QAAA,YAAA,QAAA,QAAA,GAAA,EACG,MAAC,QAAa,SACf,GAAC,EACR,MAAA,QACO,EACL,EAAA,SAAc,EACd,UAAS,MACP,CAAA,EACD;;;AAGD,SAAE,MAAO,sDAAA;AACT,QAAI,KAAK,OAAK,KAAA,YAAA,OAAA;AACZ,UAAI,WAAA,EAAA;AACJ,SAAI,KAAE,OAAO,MAAA,UAAA,MAAA,SAAA,KAAA,OAAA,KAAA,QAAA,KAAA,CACX,MAAK,KAAC,2LAAoB;SAE1B,MAAK,OAAK,KAAA;MACR,IAAI,KAAK,OAAO,KAAE,QAAQ;MAC1B,MAAM,KAAK,OAAO,KAAK,QAAE;MACzB,UAAC,CAAA,KAAA,OAAA,KAAA,QAAA,KAAA;MACD,OAAO;MACP,MAAA;MACA,MAAE,CAAA,UAAU;MACZ,aAAA,oEAAA,YAAA,MAAA,KAAA,CAAA;MACF,OAAA;OACD,MAAA,UAAA,KAAA,WAAA,QAAA,WAAA;OACF,OAAA,EACK,MAAA,UAAiB,KAAA,WAAA,QAAA,aAAA,EAChB;;MAED,WAAW;MACb,GAAK,KAAA,OAAY,KAAC;MAClB,CAAE;AAEJ,WAAM,OAAO,MAAA,gBAAA,aAAA,EAAA,CAAA,CAAA;;;GAGjB,SAAQ;IACN,OAAM;IACN,MAAM,UAAQ;KACZ,MAAK,SAAA;KACL,MAAI,WAAK,MAAA,eAAA,KAAA;AACT,UAAI,MAAK,gDAAY,SAAA,OAAA,mBAAA;KACrB,MAAM,MAAI,gBAAiB;MACzB,IAAI;MACJ,MAAI,WAAW,KAAK;MACpB,OAAI,YAAa,KAAA;MACjB,aAAa,kBAAC,KAAA;MACd,WAAW;MACX,MAAI;MACJ,UAAU,EAAA;MACV,OAAM,EAAA;MACN,MAAM,EAAC;MACP,SAAS,OAAE,YAAA,KAAA,QAAA,KAAA,WAAA,CAAA,OAAA,MAAA,OAAA,CAAA,CAAA;MACX,OAAM,EACJ,MAAI,UAAO,KAAA,WAAA,SAAA,EACZ;MACD,MAAM,EAAA;MACN,QAAK;MACL,UAAI,KAAW;MAChB,EAAE;AACH,YAAM,OAAA,MAAA,CAAA,gBAAA,MAAA;MACJ,IAAA,OAAA;;;MAGF,IAAA,WAAA;AACD,cAAA;QAAA,gBAAA,aAAA,EACO,IAAC,UAAA;AACC,gBAAK,IAAA;WAEX,CAAA;QAAM,gBAAiB,SAAA,EAAA,CAAA;QAAe,gBAAK,KAAA;SACvC,IAAC,OAAK;AACP,iBAAU,SAAS,MAAM,GAAG,MAAK,EAAA,KAAQ,cAAK,EAAA,KAAA,CAAA;;SAE7C,gBAAgB;SACnB,WAAA,YAAA,gBAAA,aAAA,WAEI,CAAC;SACJ,CAAE;QAAC;;MAEN,CAAC,CAAC,CAAC;;IAEP;GACF;EAAC"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { computed, For, Show } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport {\n getAppDescription,\n getAppName,\n getAppTitle,\n getCommandList\n} from \"@shell-shock/core/plugin-utils\";\nimport type { CommandConfig } from \"@shell-shock/core/types/command\";\nimport console from \"@shell-shock/plugin-console\";\nimport theme from \"@shell-shock/plugin-theme\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport type { Plugin } from \"powerlines\";\nimport { HelpBuiltin, HelpCommand } from \"./components\";\nimport type { HelpPluginContext, HelpPluginOptions } from \"./types/plugin\";\n\nexport type * from \"./types\";\n\n/**\n * The Help - Shell Shock plugin to add a help command to the application.\n */\nexport const plugin = <TContext extends HelpPluginContext = HelpPluginContext>(\n options: HelpPluginOptions = {}\n) => {\n return [\n ...theme(options.theme),\n console(options.console),\n {\n name: \"shell-shock:help\",\n enforce: \"post\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `help` plugin.\"\n );\n\n return {\n help: defu(\n {\n command:\n options.command === false\n ? false\n : isSetString(options.command)\n ? { name: options.command }\n : { name: \"help\" }\n },\n options,\n {\n builtins: true\n }\n )\n };\n },\n async configResolved() {\n this.debug(\"Adding the Help command to the application context.\");\n\n if (this.config.help.command !== false) {\n this.inputs ??= [];\n if (\n this.inputs.some(\n input =>\n input.name === (this.config.help.command as CommandConfig).name\n )\n ) {\n this.info(\n \"The `help` command already exists in the commands list. If you would like the help command to be managed by the `@shell-shock/plugin-help` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: this.config.help.command.name,\n path: this.config.help.command.name,\n segments: [this.config.help.command.name],\n title: \"Help\",\n icon: \"🛈\",\n tags: [\"Utility\"],\n description: `Display command usage details and other useful information to the user.`,\n entry: {\n file: joinPaths(this.entryPath, \"help\", \"index.ts\"),\n input: {\n file: joinPaths(this.entryPath, \"help\", \"command.ts\")\n }\n },\n isVirtual: false,\n ...this.config.help.command\n });\n }\n\n await render(this, <HelpCommand />);\n }\n },\n prepare: {\n order: \"post\",\n async handler() {\n const commands = await getCommandList(this);\n this.debug(\n `Rendering \\`help\\` built-ins for each of the ${\n commands.length\n } command modules.`\n );\n\n const bin = computed(() => ({\n id: \"\",\n name: getAppName(this),\n title: getAppTitle(this),\n description: getAppDescription(this),\n isVirtual: true,\n path: null,\n segments: [],\n alias: [],\n tags: [],\n options: Object.fromEntries(\n this.options.map(option => [option.name, option])\n ),\n entry: {\n file: joinPaths(this.entryPath, \"bin.ts\")\n },\n args: [],\n parent: null,\n children: this.commands\n }));\n\n return render(\n this,\n <>\n <Show when={this.config.help.builtins !== false}>\n <HelpBuiltin command={bin.value} />\n <Spacing />\n <For\n each={commands.sort((a, b) => a.name.localeCompare(b.name))}\n doubleHardline>\n {command => <HelpBuiltin command={command} />}\n </For>\n </Show>\n </>\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqCA,MAAa,UAAe,UAAA,EAAA,KAAA;;;;;GAE1B,MAAA;GACC,SAAU;GACX,SAAA;AACI,SAAC,MAAM,qEAAiE;AAC5E,WAAS,EACN,MAAA,KAAA,EACI,SAAA,QAAA,YAAA,QAAA,QAAA,YAAA,QAAA,QAAA,GAAA,EACG,MAAC,QAAa,SACf,GAAC,EACR,MAAA,QACO,EACL,EAAA,SAAc,EACd,UAAS,MACP,CAAA,EACD;;;AAGD,SAAE,MAAO,sDAAA;AACT,QAAI,KAAK,OAAK,KAAA,YAAA,OAAA;AACZ,UAAI,WAAA,EAAA;AACJ,SAAI,KAAE,OAAO,MAAA,UAAA,MAAA,SAAA,KAAA,OAAA,KAAA,QAAA,KAAA,CACX,MAAK,KAAC,2LAAoB;SAE1B,MAAK,OAAK,KAAA;MACR,IAAI,KAAK,OAAO,KAAE,QAAQ;M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AAI,YAAA,gBAAA,aAAA,EACA,SACN,CAAA;SACA,CAAA;QAAA;;MAEH,CAAC,CAAC,CAAC;;IAEP;GACF;EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/plugin-help",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "private": false,
5
5
  "description": "A package containing a Shell Shock plugin to provide help and documentation for the local application's commands.",
6
6
  "keywords": [
@@ -55,9 +55,9 @@
55
55
  "@powerlines/deepkit": "^0.6.165",
56
56
  "@powerlines/plugin-alloy": "^0.26.2",
57
57
  "@powerlines/plugin-plugin": "^0.12.337",
58
- "@shell-shock/core": "^0.15.1",
59
- "@shell-shock/plugin-theme": "^0.4.8",
60
- "@shell-shock/plugin-console": "^0.1.35",
58
+ "@shell-shock/core": "^0.15.2",
59
+ "@shell-shock/plugin-theme": "^0.4.9",
60
+ "@shell-shock/plugin-console": "^0.2.0",
61
61
  "@stryke/string-format": "^0.17.7",
62
62
  "@stryke/type-checks": "^0.6.0",
63
63
  "@stryke/path": "^0.27.3",
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "devDependencies": {
68
68
  "@powerlines/plugin-deepkit": "^0.11.265",
69
- "@types/node": "^25.5.0",
69
+ "@types/node": "^25.5.1",
70
70
  "@stryke/types": "^0.11.2"
71
71
  },
72
72
  "publishConfig": { "access": "public" },
@@ -172,5 +172,5 @@
172
172
  }
173
173
  },
174
174
  "inlinedDependencies": { "@stryke/types": "0.11.2" },
175
- "gitHead": "b39233bcc3bed352f050a2b43ca0fa432a4175a4"
175
+ "gitHead": "ba74aaa8aaa2c911ce54df1fae944951af53a3ad"
176
176
  }