@shell-shock/plugin-help 0.2.28 → 0.2.30

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.
@@ -1,12 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
3
  let _alloy_js_core = require("@alloy-js/core");
5
4
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
6
5
  let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
7
6
  let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
8
7
  let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
9
- let _shell_shock_core = require("@shell-shock/core");
10
8
  let _shell_shock_plugin_theme_contexts_theme = require("@shell-shock/plugin-theme/contexts/theme");
11
9
  let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
12
10
  let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
@@ -23,7 +21,7 @@ function HelpUsageDisplay(props) {
23
21
  return [
24
22
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
25
23
  writeLine(
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} }
24
+ 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("<${(arg.type === "string" || arg.type === "number") && arg.choices && arg.choices.length > 0 ? arg.choices.map((choice) => (0, _stryke_string_format_snake_case.snakeCase)(String(choice))).join("|") : arg.type === "string" && arg.format ? (0, _stryke_string_format_snake_case.snakeCase)(arg.format) : (0, _stryke_string_format_snake_case.snakeCase)(arg.name)}${(arg.type === "string" || arg.type === "number") && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""} \${textColors.usage.options("[options]")}\`), { padding: ${theme.padding.app * indent} }
27
25
  );`),
28
26
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
29
27
  (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
@@ -35,7 +33,7 @@ function HelpUsageDisplay(props) {
35
33
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
36
34
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
37
35
  writeLine(
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} }
36
+ 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("<${(arg.type === "string" || arg.type === "number") && arg.choices && arg.choices.length > 0 ? arg.choices.map((choice) => (0, _stryke_string_format_snake_case.snakeCase)(String(choice))).join("|") : arg.type === "string" && arg.format ? (0, _stryke_string_format_snake_case.snakeCase)(arg.format) : (0, _stryke_string_format_snake_case.snakeCase)(arg.name)}${(arg.type === "string" || arg.type === "number") && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""}\`), { padding: ${theme.padding.app * indent} }
39
37
  );`),
40
38
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
41
39
  ];
@@ -66,7 +64,7 @@ function HelpOptionsDisplay(props) {
66
64
  if (alias.length === 1) flags.push(`-${alias}`);
67
65
  else names.push(`--${(0, _stryke_string_format_kebab_case.kebabCase)(alias)}`);
68
66
  });
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, { length: 200 }).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 _alloy_js_core.code`[{ value: textColors.body.primary("${flags.length > 0 ? `${flags.sort().join(", ")}${names.length > 0 ? ", " : ""}` : ""}${names.length > 0 ? names.sort().join(", ") : ""}${option.type === "string" ? ` <${option.choices && option.choices.length > 0 ? option.choices.map((choice) => (0, _stryke_string_format_snake_case.snakeCase)(String(choice))).join("|") : option.format ? (0, _stryke_string_format_snake_case.snakeCase)(option.format) : (0, _stryke_string_format_snake_case.snakeCase)(option.name)}${option.variadic ? "..." : ""}>` : option.type === "number" ? ` <${option.choices && option.choices.length > 0 ? option.choices.map((choice) => (0, _stryke_string_format_snake_case.snakeCase)(String(choice))).join("|") : (0, _stryke_string_format_snake_case.snakeCase)(option.name)}${option.variadic ? "..." : ""}>` : ""}"), align: "right", border: "none", maxWidth: "1/3" }, { value: textColors.body.tertiary(\`${(0, _shell_shock_core_plugin_utils.formatShortDescription)(option.description, { length: 200 }).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
68
  }
71
69
  }),
72
70
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
@@ -142,12 +140,12 @@ function BaseHelpDisplay(props) {
142
140
  }),
143
141
  (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
144
142
  get when() {
145
- return (0, _stryke_type_checks_is_set_string.isSetString)(command.reference);
143
+ return (0, _stryke_type_checks_is_set_string.isSetString)(command.docs);
146
144
  },
147
145
  get children() {
148
146
  return [
149
147
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine("");
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} }` : ""});`),
148
+ writeLine(textColors.heading.tertiary(\`More information about this command can be found in the reference documentation at \${link("${command.docs}")}\`)${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
151
149
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
152
150
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
153
151
  ];
@@ -198,7 +196,7 @@ function VirtualCommandHelpDisplay(props) {
198
196
  children: (child) => [
199
197
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
200
198
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
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(" ")}` : ""}\`));
199
+ writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title}${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(" ")}` : ""}\`));
202
200
  writeLine("");
203
201
  writeLine(textColors.body.tertiary(splitText(\`${(0, _shell_shock_core_plugin_utils.formatDescription)(child.description).replace(/\.+$/, "").trim()}.\`)));
204
202
  writeLine(""); `),
@@ -252,7 +250,7 @@ function CommandHelpDisplay(props) {
252
250
  children: (child) => [
253
251
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
254
252
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
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(" ")}` : ""}\`));
253
+ writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title}${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(" ")}` : ""}\`));
256
254
  writeLine("");
257
255
  writeLine(textColors.body.tertiary(splitText(\`${(0, _shell_shock_core_plugin_utils.formatDescription)(child.description).replace(/\.+$/, "").trim()}.\`)));
258
256
  writeLine(""); `),
@@ -265,7 +263,7 @@ function CommandHelpDisplay(props) {
265
263
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
266
264
  ]
267
265
  }),
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.\`);
266
+ (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.length > 0 ? ` ${command.segments.join(" ")}` : ""} <specific command> --help")}) will provide additional information that is specific to that command.\`);
269
267
  writeLine("");`)
270
268
  ];
271
269
  }
@@ -1,4 +1,3 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
1
  import { CommandOption, CommandTree } from "@shell-shock/core";
3
2
 
4
3
  //#region src/components/display.d.ts
@@ -20,7 +19,7 @@ interface HelpUsageDisplayProps {
20
19
  /**
21
20
  * A component that generates the usage display for a command.
22
21
  */
23
- declare function HelpUsageDisplay(props: HelpUsageDisplayProps): _$_alloy_js_core0.Children;
22
+ declare function HelpUsageDisplay(props: HelpUsageDisplayProps): import("@alloy-js/core").Children;
24
23
  interface HelpOptionsDisplayProps {
25
24
  /**
26
25
  * The options to display help for.
@@ -30,7 +29,7 @@ interface HelpOptionsDisplayProps {
30
29
  /**
31
30
  * A component that generates the options table display for a command.
32
31
  */
33
- declare function HelpOptionsDisplay(props: HelpOptionsDisplayProps): _$_alloy_js_core0.Children;
32
+ declare function HelpOptionsDisplay(props: HelpOptionsDisplayProps): import("@alloy-js/core").Children;
34
33
  interface HelpCommandsDisplayProps {
35
34
  /**
36
35
  * A mapping of command names to their command definitions.
@@ -40,7 +39,7 @@ interface HelpCommandsDisplayProps {
40
39
  /**
41
40
  * A component that generates the commands table display for a command.
42
41
  */
43
- declare function HelpCommandsDisplay(props: HelpCommandsDisplayProps): _$_alloy_js_core0.Children;
42
+ declare function HelpCommandsDisplay(props: HelpCommandsDisplayProps): import("@alloy-js/core").Children;
44
43
  interface BaseHelpDisplayProps {
45
44
  /**
46
45
  * The command to generate help for.
@@ -68,7 +67,7 @@ interface BaseHelpDisplayProps {
68
67
  /**
69
68
  * A component that generates the `help` function declaration for a command.
70
69
  */
71
- declare function BaseHelpDisplay(props: BaseHelpDisplayProps): _$_alloy_js_core0.Children;
70
+ declare function BaseHelpDisplay(props: BaseHelpDisplayProps): import("@alloy-js/core").Children;
72
71
  interface VirtualCommandHelpDisplayProps {
73
72
  /**
74
73
  * The options to display help for.
@@ -89,7 +88,7 @@ interface VirtualCommandHelpDisplayProps {
89
88
  /**
90
89
  * A component that generates the invocation of the `help` function for a command.
91
90
  */
92
- declare function VirtualCommandHelpDisplay(props: VirtualCommandHelpDisplayProps): _$_alloy_js_core0.Children;
91
+ declare function VirtualCommandHelpDisplay(props: VirtualCommandHelpDisplayProps): import("@alloy-js/core").Children;
93
92
  interface CommandHelpDisplayProps {
94
93
  /**
95
94
  * A mapping of command names to their command definitions.
@@ -99,7 +98,7 @@ interface CommandHelpDisplayProps {
99
98
  /**
100
99
  * A component that generates the invocation of the `help` function for a command.
101
100
  */
102
- declare function CommandHelpDisplay(props: CommandHelpDisplayProps): _$_alloy_js_core0.Children;
101
+ declare function CommandHelpDisplay(props: CommandHelpDisplayProps): import("@alloy-js/core").Children;
103
102
  //#endregion
104
103
  export { BaseHelpDisplay, BaseHelpDisplayProps, CommandHelpDisplay, CommandHelpDisplayProps, HelpCommandsDisplay, HelpCommandsDisplayProps, HelpOptionsDisplay, HelpOptionsDisplayProps, HelpUsageDisplay, HelpUsageDisplayProps, VirtualCommandHelpDisplay, VirtualCommandHelpDisplayProps };
105
104
  //# sourceMappingURL=display.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"display.d.cts","names":[],"sources":["../../src/components/display.tsx"],"mappings":";;;;UAuCiB,qBAAA;;;AAAjB;EAIE,OAAA,EAAS,WAAA;;;;;;;;AAgBX;EANE,MAAA;AAAA;;;;iBAMc,gBAAA,CAAiB,KAAA,EAAO,qBAAA,GAAqB,iBAAA,CAAA,QAAA;AAAA,UAqH5C,uBAAA;EArH4C;AAqH7D;;EAIE,OAAA,EAAS,aAAA;AAAA;;AAMX;;iBAAgB,kBAAA,CAAmB,KAAA,EAAO,uBAAA,GAAuB,iBAAA,CAAA,QAAA;AAAA,UAgFhD,wBAAA;EAhFyB;;;EAoFxC,QAAA,EAAU,MAAA,SAAe,WAAA;AAAA;AAJ3B;;;AAAA,iBAUgB,mBAAA,CAAoB,KAAA,EAAO,wBAAA,GAAwB,iBAAA,CAAA,QAAA;AAAA,UA2BlD,oBAAA;EAjCL;;;EAqC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AS,aAAA;EAJoC;;;EAS7C,QAAA,EAAU,MAAA,SAAe,WAAA;EAAf;;;;;;EAQV,QAAA;AAAA;;;AAAQ;iBA4CM,yBAAA,CACd,KAAA,EAAO,8BAA8B,4BAAA,QAAA;AAAA,UAwEtB,uBAAA;;;;EAIf,OAAA,EAAS,WAAW;AAAA;;AA5EiB;AAwEvC;iBAUgB,kBAAA,CAAmB,KAAA,EAAO,uBAAuB,4BAAA,QAAA"}
@@ -1,4 +1,3 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
1
  import { CommandOption, CommandTree } from "@shell-shock/core";
3
2
 
4
3
  //#region src/components/display.d.ts
@@ -20,7 +19,7 @@ interface HelpUsageDisplayProps {
20
19
  /**
21
20
  * A component that generates the usage display for a command.
22
21
  */
23
- declare function HelpUsageDisplay(props: HelpUsageDisplayProps): _$_alloy_js_core0.Children;
22
+ declare function HelpUsageDisplay(props: HelpUsageDisplayProps): import("@alloy-js/core").Children;
24
23
  interface HelpOptionsDisplayProps {
25
24
  /**
26
25
  * The options to display help for.
@@ -30,7 +29,7 @@ interface HelpOptionsDisplayProps {
30
29
  /**
31
30
  * A component that generates the options table display for a command.
32
31
  */
33
- declare function HelpOptionsDisplay(props: HelpOptionsDisplayProps): _$_alloy_js_core0.Children;
32
+ declare function HelpOptionsDisplay(props: HelpOptionsDisplayProps): import("@alloy-js/core").Children;
34
33
  interface HelpCommandsDisplayProps {
35
34
  /**
36
35
  * A mapping of command names to their command definitions.
@@ -40,7 +39,7 @@ interface HelpCommandsDisplayProps {
40
39
  /**
41
40
  * A component that generates the commands table display for a command.
42
41
  */
43
- declare function HelpCommandsDisplay(props: HelpCommandsDisplayProps): _$_alloy_js_core0.Children;
42
+ declare function HelpCommandsDisplay(props: HelpCommandsDisplayProps): import("@alloy-js/core").Children;
44
43
  interface BaseHelpDisplayProps {
45
44
  /**
46
45
  * The command to generate help for.
@@ -68,7 +67,7 @@ interface BaseHelpDisplayProps {
68
67
  /**
69
68
  * A component that generates the `help` function declaration for a command.
70
69
  */
71
- declare function BaseHelpDisplay(props: BaseHelpDisplayProps): _$_alloy_js_core0.Children;
70
+ declare function BaseHelpDisplay(props: BaseHelpDisplayProps): import("@alloy-js/core").Children;
72
71
  interface VirtualCommandHelpDisplayProps {
73
72
  /**
74
73
  * The options to display help for.
@@ -89,7 +88,7 @@ interface VirtualCommandHelpDisplayProps {
89
88
  /**
90
89
  * A component that generates the invocation of the `help` function for a command.
91
90
  */
92
- declare function VirtualCommandHelpDisplay(props: VirtualCommandHelpDisplayProps): _$_alloy_js_core0.Children;
91
+ declare function VirtualCommandHelpDisplay(props: VirtualCommandHelpDisplayProps): import("@alloy-js/core").Children;
93
92
  interface CommandHelpDisplayProps {
94
93
  /**
95
94
  * A mapping of command names to their command definitions.
@@ -99,7 +98,7 @@ interface CommandHelpDisplayProps {
99
98
  /**
100
99
  * A component that generates the invocation of the `help` function for a command.
101
100
  */
102
- declare function CommandHelpDisplay(props: CommandHelpDisplayProps): _$_alloy_js_core0.Children;
101
+ declare function CommandHelpDisplay(props: CommandHelpDisplayProps): import("@alloy-js/core").Children;
103
102
  //#endregion
104
103
  export { BaseHelpDisplay, BaseHelpDisplayProps, CommandHelpDisplay, CommandHelpDisplayProps, HelpCommandsDisplay, HelpCommandsDisplayProps, HelpOptionsDisplay, HelpOptionsDisplayProps, HelpUsageDisplay, HelpUsageDisplayProps, VirtualCommandHelpDisplay, VirtualCommandHelpDisplayProps };
105
104
  //# sourceMappingURL=display.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"display.d.mts","names":[],"sources":["../../src/components/display.tsx"],"mappings":";;;;UAuCiB,qBAAA;;;AAAjB;EAIE,OAAA,EAAS,WAAA;;;;;;;;AAgBX;EANE,MAAA;AAAA;;;;iBAMc,gBAAA,CAAiB,KAAA,EAAO,qBAAA,GAAqB,iBAAA,CAAA,QAAA;AAAA,UAqH5C,uBAAA;EArH4C;AAqH7D;;EAIE,OAAA,EAAS,aAAA;AAAA;;AAMX;;iBAAgB,kBAAA,CAAmB,KAAA,EAAO,uBAAA,GAAuB,iBAAA,CAAA,QAAA;AAAA,UAgFhD,wBAAA;EAhFyB;;;EAoFxC,QAAA,EAAU,MAAA,SAAe,WAAA;AAAA;AAJ3B;;;AAAA,iBAUgB,mBAAA,CAAoB,KAAA,EAAO,wBAAA,GAAwB,iBAAA,CAAA,QAAA;AAAA,UA2BlD,oBAAA;EAjCL;;;EAqCV,OAAA,EAAS,WAAA;EA/BK;;;;;;;;EAyCd,mBAAA;EAde;;;;;;;;EAwBf,MAAA;AAAA;AAMF;;;AAAA,iBAAgB,eAAA,CAAgB,KAAA,EAAO,oBAAA,GAAoB,iBAAA,CAAA,QAAA;AAAA,UA6D1C,8BAAA;EA7De;;;EAiE9B,OAAA,EAAS,aAAA;EAJM;;;EASf,QAAA,EAAU,MAAA,SAAe,WAAA;EAAA;;;;;;EAQzB,QAAA;AAAA;;;;iBA4Cc,yBAAA,CACd,KAAA,EAAO,8BAAA,GAA8B,iBAAA,CAAA,QAAA;AAAA,UAwEtB,uBAAA;EAzEwB;;;EA6EvC,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,kBAAA,CAAmB,KAAA,EAAO,uBAAA,GAAuB,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"display.d.mts","names":[],"sources":["../../src/components/display.tsx"],"mappings":""}
@@ -4,7 +4,6 @@ import { formatDescription, formatShortDescription, getAppBin, getAppTitle, getD
4
4
  import { isSetString } from "@stryke/type-checks/is-set-string";
5
5
  import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
6
6
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
7
- import { CommandParameterKinds } from "@shell-shock/core";
8
7
  import { useTheme } from "@shell-shock/plugin-theme/contexts/theme";
9
8
  import { camelCase } from "@stryke/string-format/camel-case";
10
9
  import { kebabCase } from "@stryke/string-format/kebab-case";
@@ -21,7 +20,7 @@ function HelpUsageDisplay(props) {
21
20
  return [
22
21
  memo(() => code`
23
22
  writeLine(
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} }
23
+ 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("<${(arg.type === "string" || arg.type === "number") && arg.choices && arg.choices.length > 0 ? arg.choices.map((choice) => snakeCase(String(choice))).join("|") : arg.type === "string" && arg.format ? snakeCase(arg.format) : snakeCase(arg.name)}${(arg.type === "string" || arg.type === "number") && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""} \${textColors.usage.options("[options]")}\`), { padding: ${theme.padding.app * indent} }
25
24
  );`),
26
25
  createIntrinsic("hbr", {}),
27
26
  createComponent(Show, {
@@ -33,7 +32,7 @@ function HelpUsageDisplay(props) {
33
32
  createIntrinsic("hbr", {}),
34
33
  memo(() => code`
35
34
  writeLine(
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} }
35
+ 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("<${(arg.type === "string" || arg.type === "number") && arg.choices && arg.choices.length > 0 ? arg.choices.map((choice) => snakeCase(String(choice))).join("|") : arg.type === "string" && arg.format ? snakeCase(arg.format) : snakeCase(arg.name)}${(arg.type === "string" || arg.type === "number") && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""}\`), { padding: ${theme.padding.app * indent} }
37
36
  );`),
38
37
  createIntrinsic("hbr", {})
39
38
  ];
@@ -64,7 +63,7 @@ function HelpOptionsDisplay(props) {
64
63
  if (alias.length === 1) flags.push(`-${alias}`);
65
64
  else names.push(`--${kebabCase(alias)}`);
66
65
  });
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, { length: 200 }).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" }], `;
66
+ return code`[{ value: textColors.body.primary("${flags.length > 0 ? `${flags.sort().join(", ")}${names.length > 0 ? ", " : ""}` : ""}${names.length > 0 ? names.sort().join(", ") : ""}${option.type === "string" ? ` <${option.choices && option.choices.length > 0 ? option.choices.map((choice) => snakeCase(String(choice))).join("|") : option.format ? snakeCase(option.format) : snakeCase(option.name)}${option.variadic ? "..." : ""}>` : option.type === "number" ? ` <${option.choices && option.choices.length > 0 ? option.choices.map((choice) => snakeCase(String(choice))).join("|") : snakeCase(option.name)}${option.variadic ? "..." : ""}>` : ""}"), align: "right", border: "none", maxWidth: "1/3" }, { value: textColors.body.tertiary(\`${formatShortDescription(option.description, { length: 200 }).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
67
  }
69
68
  }),
70
69
  createIntrinsic("hbr", {}),
@@ -140,12 +139,12 @@ function BaseHelpDisplay(props) {
140
139
  }),
141
140
  createComponent(Show, {
142
141
  get when() {
143
- return isSetString(command.reference);
142
+ return isSetString(command.docs);
144
143
  },
145
144
  get children() {
146
145
  return [
147
146
  memo(() => code`writeLine("");
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} }` : ""});`),
147
+ writeLine(textColors.heading.tertiary(\`More information about this command can be found in the reference documentation at \${link("${command.docs}")}\`)${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
149
148
  createIntrinsic("hbr", {}),
150
149
  createComponent(Spacing, {})
151
150
  ];
@@ -196,7 +195,7 @@ function VirtualCommandHelpDisplay(props) {
196
195
  children: (child) => [
197
196
  createIntrinsic("hbr", {}),
198
197
  memo(() => code`
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(" ")}` : ""}\`));
198
+ writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title}${child.tags?.length > 0 ? ` - ${child.tags.map((tag) => `\${textColors.tags.${camelCase(tag)} ? textColors.tags.${camelCase(tag)}(inverse(" ${tag} ")) : textColors.tags.$default(inverse(" ${tag} "))}`).join(" ")}` : ""}\`));
200
199
  writeLine("");
201
200
  writeLine(textColors.body.tertiary(splitText(\`${formatDescription(child.description).replace(/\.+$/, "").trim()}.\`)));
202
201
  writeLine(""); `),
@@ -250,7 +249,7 @@ function CommandHelpDisplay(props) {
250
249
  children: (child) => [
251
250
  createIntrinsic("hbr", {}),
252
251
  memo(() => code`
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(" ")}` : ""}\`));
252
+ writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title}${child.tags?.length > 0 ? ` - ${child.tags.map((tag) => `\${textColors.tags.${camelCase(tag)} ? textColors.tags.${camelCase(tag)}(inverse(" ${tag} ")) : textColors.tags.$default(inverse(" ${tag} "))}`).join(" ")}` : ""}\`));
254
253
  writeLine("");
255
254
  writeLine(textColors.body.tertiary(splitText(\`${formatDescription(child.description).replace(/\.+$/, "").trim()}.\`)));
256
255
  writeLine(""); `),
@@ -263,7 +262,7 @@ function CommandHelpDisplay(props) {
263
262
  createIntrinsic("hbr", {})
264
263
  ]
265
264
  }),
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.\`);
265
+ memo(() => code`help(\`Running a specific command with the help flag (via: \${inlineCode("${getAppBin(context)}${command.segments.length > 0 ? ` ${command.segments.join(" ")}` : ""} <specific command> --help")}) will provide additional information that is specific to that command.\`);
267
266
  writeLine("");`)
268
267
  ];
269
268
  }
@@ -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 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 length: 200\n }\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 length: 200\n }\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.globalOptions.some(\n (globalOption: CommandOption) =>\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(\"Common 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\")}) or the help command with the specific command as arguments (via: \\${inlineCode(\"${getAppBin(\n context\n )} ${\n segments && segments.length > 0 ? ` ${segments.join(\" \")}` : \"\"\n } help <specific command>\")}) 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":";;;;;;;;;;;;;;;;AAgCA,SAAS,iBAAwB,OAAM;CACvC,MAAQ,EACR,SACA,SAAS,MACH;CACN,MAAO,UAAO,eAAmB;;AAEjC,QAAO;EAAA,WAAU,IAAA;;kEAEoB,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;UACjC;EAAA,gBAAA,OAAA,EAAA,CAAA;EAAA,gBAAA,MAAA;GACF,IAAA,O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;QAChB,CAAC;OAAE,gBAAkB,OAAO,EAAC,CAAA;OAAA;MAC/B,CAAC;KAAE,WAAa,IAAC,6EAAO,UAAA,QAAA,CAAA,GAAA,QAAA,SAAA,KAAA,IAAA,CAAA;wBACP;KAAC;;GAEtB,CAAC;EAAC"}
1
+ {"version":3,"file":"display.mjs","names":[],"sources":[],"mappings":""}
@@ -65,7 +65,7 @@ function HelpBuiltin(props) {
65
65
  get children() {
66
66
  return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
67
67
  get when() {
68
- return !command.isVirtual;
68
+ return !command.virtual;
69
69
  },
70
70
  get fallback() {
71
71
  return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_display.VirtualCommandHelpDisplay, {
@@ -1,4 +1,3 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
1
  import { CommandTree } from "@shell-shock/core";
3
2
  import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
4
3
 
@@ -12,7 +11,7 @@ interface HelpBuiltinProps extends Omit<BuiltinFileProps, "id" | "description">
12
11
  /**
13
12
  * A built-in help module for Shell Shock.
14
13
  */
15
- declare function HelpBuiltin(props: HelpBuiltinProps): _$_alloy_js_core0.Children;
14
+ declare function HelpBuiltin(props: HelpBuiltinProps): import("@alloy-js/core").Children;
16
15
  //#endregion
17
16
  export { HelpBuiltin, HelpBuiltinProps };
18
17
  //# sourceMappingURL=help-builtin.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"help-builtin.d.cts","names":[],"sources":["../../src/components/help-builtin.tsx"],"mappings":";;;;;UAmCiB,gBAAA,SAAyB,IAAA,CACxC,gBAAA;;;AADF;EAOE,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAgB,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"help-builtin.d.cts","names":[],"sources":["../../src/components/help-builtin.tsx"],"mappings":";;;;UAmCiB,gBAAA,SAAyB,IAAA,CACxC,gBAAA;;AADF;;EAOE,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,WAAA,CAAY,KAAA,EAAO,gBAAgB,4BAAA,QAAA"}
@@ -1,6 +1,5 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
- import { CommandTree } from "@shell-shock/core";
3
1
  import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
2
+ import { CommandTree } from "@shell-shock/core";
4
3
 
5
4
  //#region src/components/help-builtin.d.ts
6
5
  interface HelpBuiltinProps extends Omit<BuiltinFileProps, "id" | "description"> {
@@ -12,7 +11,7 @@ interface HelpBuiltinProps extends Omit<BuiltinFileProps, "id" | "description">
12
11
  /**
13
12
  * A built-in help module for Shell Shock.
14
13
  */
15
- declare function HelpBuiltin(props: HelpBuiltinProps): _$_alloy_js_core0.Children;
14
+ declare function HelpBuiltin(props: HelpBuiltinProps): import("@alloy-js/core").Children;
16
15
  //#endregion
17
16
  export { HelpBuiltin, HelpBuiltinProps };
18
17
  //# sourceMappingURL=help-builtin.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"help-builtin.d.mts","names":[],"sources":["../../src/components/help-builtin.tsx"],"mappings":";;;;;UAmCiB,gBAAA,SAAyB,IAAA,CACxC,gBAAA;;;AADF;EAOE,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAgB,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"help-builtin.d.mts","names":[],"sources":["../../src/components/help-builtin.tsx"],"mappings":""}
@@ -62,7 +62,7 @@ function HelpBuiltin(props) {
62
62
  get children() {
63
63
  return createComponent(Show, {
64
64
  get when() {
65
- return !command.isVirtual;
65
+ return !command.virtual;
66
66
  },
67
67
  get fallback() {
68
68
  return createComponent(VirtualCommandHelpDisplay, {
@@ -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 { Show, splitProps } from \"@alloy-js/core\";\nimport { FunctionDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { TSDoc, TSDocRemarks } 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\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 <TSDoc\n heading={`Utility functions for displaying help information for the ${\n command.path\n ? `${command.title} command`\n : `${getAppTitle(context, true)} application`\n }.`}>\n <TSDocRemarks>\n {`This module contains utility functions that assist in displaying help information for the ${\n command.path\n ? `${command.title} command`\n : `${getAppTitle(context, true)} application`\n }. The main function exported by this module is the \\`showHelp\\` function, which can be used to display help information for the specified command or application. This function can be called from within the command's handler or from any other part of the application where help information needs to be displayed.`}\n </TSDocRemarks>\n </TSDoc>\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 <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":";;;;;;;;;;;;;;;;AAgCA,SAAc,YAAA,OAAoB;CAClC,MAAQ,CAAC,WAET,YACE,QAAA,WAAgB,OAAA,CAAA,WAAA,WAAA,CAAA;CAChB,MAAM,UAAE,eAAW;AACnB,QAAA,gBAAA,aAAA,WAAA;EACE,IAAA,KAAA;AACC,UAAI,UAAW,QAAS,GAAK,QAAM,SAAS,QAAA,YAAe,CAAA,qBAAA,QAAA,CAAA,CAAA;;EAE9D,IAAA,cAAoB;AACtB,UAAA,WAAA,CAAA,CAAA,QAAA,KAAA,EAAA,GAAA,wFAAA,QAAA,MAAA,aAAA,wFAAA,YAAA,SAAA,KAAA,CAAA;;E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{ value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
3
  let _alloy_js_core = require("@alloy-js/core");
5
4
  let _powerlines_plugin_alloy_core_components = require("@powerlines/plugin-alloy/core/components");
@@ -1,17 +1,15 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
-
3
1
  //#region src/components/help-command.d.ts
4
2
  /**
5
3
  * A temporary placeholder component for the help command. The actual content of this component will be rendered in the `prepare` step of the help plugin, after the command list has been fully resolved. This is necessary to ensure that the help command's entry file is generated, and to avoid any issues with missing files or circular dependencies during the rendering process.
6
4
  */
7
- declare function TemporaryHelpCommand(): _$_alloy_js_core0.Children;
5
+ declare function TemporaryHelpCommand(): import("@alloy-js/core").Children;
8
6
  interface HelpCommandsProps {
9
7
  commands: string[][];
10
8
  }
11
9
  /**
12
10
  * The Help command's handler wrapper for the Shell Shock project.
13
11
  */
14
- declare function HelpCommand(props: HelpCommandsProps): _$_alloy_js_core0.Children;
12
+ declare function HelpCommand(props: HelpCommandsProps): import("@alloy-js/core").Children;
15
13
  //#endregion
16
14
  export { HelpCommand, HelpCommandsProps, TemporaryHelpCommand };
17
15
  //# sourceMappingURL=help-command.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"help-command.d.cts","names":[],"sources":["../../src/components/help-command.tsx"],"mappings":";;;;;;iBAuCgB,oBAAA,CAAA,GAAoB,iBAAA,CAAA,QAAA;AAAA,UAwBnB,iBAAA;EACf,QAAA;AAAA;;AADF;;iBAOgB,WAAA,CAAY,KAAA,EAAO,iBAAA,GAAiB,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"help-command.d.cts","names":[],"sources":["../../src/components/help-command.tsx"],"mappings":";;AAuCA;;iBAAgB,oBAAA,6BAAoB,QAAA;AAAA,UAwBnB,iBAAA;EACf,QAAQ;AAAA;;;;iBAMM,WAAA,CAAY,KAAA,EAAO,iBAAiB,4BAAA,QAAA"}
@@ -1,17 +1,15 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
-
3
1
  //#region src/components/help-command.d.ts
4
2
  /**
5
3
  * A temporary placeholder component for the help command. The actual content of this component will be rendered in the `prepare` step of the help plugin, after the command list has been fully resolved. This is necessary to ensure that the help command's entry file is generated, and to avoid any issues with missing files or circular dependencies during the rendering process.
6
4
  */
7
- declare function TemporaryHelpCommand(): _$_alloy_js_core0.Children;
5
+ declare function TemporaryHelpCommand(): import("@alloy-js/core").Children;
8
6
  interface HelpCommandsProps {
9
7
  commands: string[][];
10
8
  }
11
9
  /**
12
10
  * The Help command's handler wrapper for the Shell Shock project.
13
11
  */
14
- declare function HelpCommand(props: HelpCommandsProps): _$_alloy_js_core0.Children;
12
+ declare function HelpCommand(props: HelpCommandsProps): import("@alloy-js/core").Children;
15
13
  //#endregion
16
14
  export { HelpCommand, HelpCommandsProps, TemporaryHelpCommand };
17
15
  //# sourceMappingURL=help-command.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"help-command.d.mts","names":[],"sources":["../../src/components/help-command.tsx"],"mappings":";;;;;;iBAuCgB,oBAAA,CAAA,GAAoB,iBAAA,CAAA,QAAA;AAAA,UAwBnB,iBAAA;EACf,QAAA;AAAA;;AADF;;iBAOgB,WAAA,CAAY,KAAA,EAAO,iBAAA,GAAiB,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"help-command.d.mts","names":[],"sources":["../../src/components/help-command.tsx"],"mappings":""}
@@ -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, computed, For, Show } from \"@alloy-js/core\";\nimport {\n ElseClause,\n ElseIfClause,\n FunctionDeclaration,\n IfStatement\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\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 { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport type { HelpPluginContext } from \"../types/plugin\";\n\n/**\n * A temporary placeholder component for the help command. The actual content of this component will be rendered in the `prepare` step of the help plugin, after the command list has been fully resolved. This is necessary to ensure that the help command's entry file is generated, and to avoid any issues with missing files or circular dependencies during the rendering process.\n */\nexport function TemporaryHelpCommand() {\n const context = usePowerlines<HelpPluginContext>();\n\n return (\n <TypescriptFile path={joinPaths(context.entryPath, \"help\", \"command.ts\")}>\n {code` // Temporary placeholder file to ensure the help command's entry file is generated. The actual content of this file will be rendered in the \\`prepare\\` step of this plugin, after the command list has been fully resolved. `}\n <Spacing />\n <TSDoc heading=\"Display command usage details and other useful information to the user.\">\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={[\n { name: \"segments\", type: \"string[]\", default: \"[]\" }\n ]}></FunctionDeclaration>\n </TypescriptFile>\n );\n}\n\nexport interface HelpCommandsProps {\n commands: string[][];\n}\n\n/**\n * The Help command's handler wrapper for the Shell Shock project.\n */\nexport function HelpCommand(props: HelpCommandsProps) {\n const context = usePowerlines<HelpPluginContext>();\n\n const helpImports = computed(() =>\n props.commands\n ? props.commands.reduce(\n (ret, segments) => {\n ret[joinPaths(\"help\", ...segments)] = [\n {\n name: \"showHelp\",\n alias: `showHelp${segments\n .map(segment => pascalCase(segment.replace(/-/g, \"\")))\n .join(\"\")}`\n }\n ];\n return ret;\n },\n {} as Record<string, { name: string; alias: string }[]>\n )\n : {}\n );\n\n const commandSegmentsList = props.commands ?? [];\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 ...helpImports.value,\n help: [\"showHelp\"],\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=\"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 <Show\n when={commandSegmentsList.length > 0}\n fallback={code`showHelp(); `}>\n <For each={commandSegmentsList} doubleHardline>\n {(segments, index) => (\n <Show\n when={index > 0}\n fallback={\n <IfStatement\n condition={code`segments.join(\"/\").toLowerCase() === \"${segments\n .join(\"/\")\n .toLowerCase()}\"`}>\n {code` showHelp${segments\n .map(segment => pascalCase(segment))\n .join(\"\")}(); `}\n </IfStatement>\n }>\n <ElseIfClause\n condition={code`segments.join(\"/\").toLowerCase() === \"${segments\n .join(\"/\")\n .toLowerCase()}\"`}>\n {code` showHelp${segments\n .map(segment => pascalCase(segment))\n .join(\"\")}(); `}\n </ElseIfClause>\n </Show>\n )}\n </For>\n <ElseClause>{code`showHelp(); `}</ElseClause>\n </Show>\n </FunctionDeclaration>\n </TypescriptFile>\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CAAA,EAAI,gBAAY,qBAA2B;IAC3C,UAAS;IACP,WAAW;IACX,OAAM;IACP,MAAA;IACD,YAAc,CAAC;KACX,MAAC;KACH,MAAQ;KACR,SAAS;KACR,CAAC;IACF,IAAG,WAAU;AACX,YAAC,gBAAW,MAAA;MACX,IAAA,OAAW;AACX,cAAQ,oBAAA,SAAA;;MAER,UAAK,IAAA;MACL,IAAK,WAAC;AACN,cAAI,CAAA,gBAAA,KAAA;QACP,MAAA;QACA,gBAAA;QACK,WAAS,UAAe,UAAO,gBAAkB,MAAO;SAC5D,MAAe,QAAE;SACV,IAAA,WAAiB;AACb,iBAAA,gBAAA,aAAA;WACP,IAAA,YAAA;AACN,mBAAA,IAAA,yCAAA,SAAA,KAAA,IAAA,CAAA,aAAA,CAAA;;WAEC,IAAA,WAAA;AACA,mBAAA,IAAA,YAAA,SAAA,KAAA,YAAA,WAAA,QAAA,CAAA,CAAA,KAAA,GAAA,CAAA;;WAEa,CAAC;;SAEN,IAAA,WAAA;AACI,iBAAK,gBAAc,cAAA;WAClB,IAAA,YAAA;AACG,mBAAO,IAAG,yCAAA,SAAA,KAAA,IAAA,CAAA,aAAA,CAAA;;WAEZ,IAAA,WAAS;AACP,mBAAC,IAAA,YAAA,SAAA,KAAA,YAAA,WAAA,QAAA,CAAA,CAAA,KAAA,GAAA,CAAA;;WAEL,CAAA;;SAEH,CAAC;QACH,CAAC,EAAE,gBAAkB,YAAC,EACrB,UAAU,IAAC,gBACZ,CAAC,CAAC;;MAEN,CAAC;;IAEL,CAAC,CAAC;;EAEN,CAAC"}
1
+ {"version":3,"file":"help-command.mjs","names":[],"sources":[],"mappings":""}
package/dist/index.cjs CHANGED
@@ -27,7 +27,7 @@ const plugin = (options = {}) => {
27
27
  ...(0, _shell_shock_plugin_theme.default)(options.theme),
28
28
  ...(0, _shell_shock_plugin_console.default)(options.console),
29
29
  {
30
- name: "shell-shock:help",
30
+ name: "shell-shock/help",
31
31
  enforce: "post",
32
32
  config() {
33
33
  this.debug("Providing default configuration for the Shell Shock `help` plugin.");
@@ -50,8 +50,7 @@ const plugin = (options = {}) => {
50
50
  file: (0, _stryke_path_join.joinPaths)(this.entryPath, "help", "index.ts"),
51
51
  input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "help", "command.ts") }
52
52
  },
53
- isVirtual: false,
54
- source: "help-plugin",
53
+ virtual: false,
55
54
  ...this.config.help.command
56
55
  });
57
56
  await (0, _powerlines_plugin_alloy_render.render)(this, (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_help_command.TemporaryHelpCommand, {}));
package/dist/index.d.cts CHANGED
@@ -7,5 +7,5 @@ import { Plugin } from "powerlines";
7
7
  */
8
8
  declare const plugin: <TContext extends HelpPluginContext = HelpPluginContext>(options?: HelpPluginOptions) => Plugin<TContext>[];
9
9
  //#endregion
10
- export { HelpPluginContext, HelpPluginOptions, HelpPluginResolvedConfig, HelpPluginUserConfig, plugin as default, plugin };
10
+ export { type HelpPluginContext, type HelpPluginOptions, type HelpPluginResolvedConfig, type HelpPluginUserConfig, plugin as default, plugin };
11
11
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.mts CHANGED
@@ -7,5 +7,5 @@ import { Plugin } from "powerlines";
7
7
  */
8
8
  declare const plugin: <TContext extends HelpPluginContext = HelpPluginContext>(options?: HelpPluginOptions) => Plugin<TContext>[];
9
9
  //#endregion
10
- export { HelpPluginContext, HelpPluginOptions, HelpPluginResolvedConfig, HelpPluginUserConfig, plugin as default, plugin };
10
+ export { type HelpPluginContext, type HelpPluginOptions, type HelpPluginResolvedConfig, type HelpPluginUserConfig, plugin as default, plugin };
11
11
  //# sourceMappingURL=index.d.mts.map
@@ -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,KACR,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":""}
package/dist/index.mjs CHANGED
@@ -22,7 +22,7 @@ const plugin = (options = {}) => {
22
22
  ...theme(options.theme),
23
23
  ...console(options.console),
24
24
  {
25
- name: "shell-shock:help",
25
+ name: "shell-shock/help",
26
26
  enforce: "post",
27
27
  config() {
28
28
  this.debug("Providing default configuration for the Shell Shock `help` plugin.");
@@ -45,8 +45,7 @@ const plugin = (options = {}) => {
45
45
  file: joinPaths(this.entryPath, "help", "index.ts"),
46
46
  input: { file: joinPaths(this.entryPath, "help", "command.ts") }
47
47
  },
48
- isVirtual: false,
49
- source: "help-plugin",
48
+ virtual: false,
50
49
  ...this.config.help.command
51
50
  });
52
51
  await render(this, createComponent(TemporaryHelpCommand, {}));
@@ -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 computeBin,\n getCommandList,\n isDynamicPathSegment\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 { getUniqueBy } from \"@stryke/helpers/get-unique\";\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, TemporaryHelpCommand } 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): Plugin<TContext>[] => {\n return [\n ...theme<TContext>(options.theme),\n ...console<TContext>(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: CommandConfig) =>\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 source: \"help-plugin\",\n ...this.config.help.command\n });\n }\n\n await render(this, <TemporaryHelpCommand />);\n }\n },\n prepare: {\n order: \"post\",\n async handler() {\n const commands = await getCommandList(this);\n\n this.debug(\n `Rendering \\`help\\` built-ins for each of the ${\n commands.length\n } command modules.`\n );\n\n const segments = computed(() =>\n getUniqueBy(\n commands.map(command =>\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .filter(segment => segment.length > 0)\n ),\n segments => segments.join(\"/\")\n )\n .filter(segments => segments.length > 0)\n .sort((a, b) => a.join(\"/\").localeCompare(b.join(\"/\")))\n );\n\n return render(\n this,\n <>\n <Show when={this.config.help.builtins !== false}>\n <HelpBuiltin command={computeBin(this)} />\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 <HelpCommand commands={segments.value} />\n </Show>\n </>\n );\n }\n }\n }\n ];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiCA,MAAa,UAAU,UAAM,EAAA,KAAW;AACxC,QAAS;EAAA,GAAA,MAAA,QAAa,MAAW;EAAE,GAAA,QAAA,QAAA,QAA2B;EAAE;GAChE,MAAO;;GAEP,SAAa;;AAEX,WAAA,EACK,MAAO,KAAK,EACjB,SAAA,QAAA,YAAA,QAAA,QAAA,YAAA,QAAA,QAAA,GAAA,EACU,MAAC,QAAU,SACZ,GAAA,EACD,MAAQ,QACT,EACF,EAAA,SAAM,EACN,UAAQ,MACX,CAAA,EACE;;GAEF,MAAE,iBAAS;AACT,SAAE,MAAK,sDAAK;AACZ,QAAI,KAAC,OAAU,KAAA,YAAQ,OAAiB;AACtC,UAAC,WAAA,EAAA;mFAED,MAAO,KAAA,2LAAA;SAEL,MAAE,OAAA,KAAA;MACA,IAAE,KAAO,OAAA,KAAA,QAAA;MACT,MAAI,KAAO,OAAC,KAAW,QAAC;MACxB,UAAQ,CAAA,KAAA,OAAA,KAAA,QAAA,KAAA;MACR,OAAO;MACP,MAAM;MACN,MAAM,CAAC,UAAU;MACjB,aAAC;MACD,OAAO;OACP,MAAA,UAAA,KAAA,WAAA,QAAA,WAAA;OACE,OAAA,EACF,MAAA,UAAA,KAAA,WAAA,QAAA,aAAA,EACF;OACD;MACF,WAAA;MACK,QAAA;MACA,GAAC,KAAO,OAAO,KAAI;;AAGvB,WAAM,OAAO,MAAM,gBAAC,sBAAA,EAAA,CAAA,CAAA;;;GAGxB,SAAS;IACP,OAAO;IACP,MAAM,UAAA;KACJ,MAAI,SAAA;KACJ,MAAI,WAAS,MAAA,eAAA,KAAA;AACb,UAAK,MAAM,gDAA8C,SAAS,OAAS,mBAAe;KAC1F,MAAK,WAAA,eAAA,YAAA,SAAA,KAAA,YAAA,QAAA,SAAA,QAAA,YAAA,CAAA,qBAAA,QAAA,CAAA,CAAA,QAAA,YAAA,QAAA,SAAA,EAAA,CAAA,GAAA,aAAA,SAAA,KAAA,IAAA,CAAA,CAAA,QAAA,aAAA,SAAA,SAAA,EAAA,CAAA,MAAA,GAAA,MAAA,EAAA,KAAA,IAAA,CAAA,cAAA,EAAA,KAAA,IAAA,CAAA,CAAA,CAAA;AACL,YAAI,OAAK,MAAA,CAAA,gBAAA,MAAA;MACP,IAAE,OAAK;AACL,cAAM,OAAK,OAAO,KAAK,aAAY;;MAErC,IAAI,WAAW;AACb,cAAO;QAAC,gBAAO,aAAA,EACb,IAAI,UAAM;AACV,gBAAQ,WAAS,OAAA;WAElB,CAAC;QAAA,gBAAO,SAAA,EAAA,CAAA;QAAA,gBAAA,KAAA;SACP,IAAE,OAAM;AACN,iBAAO,SAAA,MAAA,GAAA,MAAA,EAAA,KAAA,cAAA,EAAA,KAAA,CAAA;;SAET,gBAAE;SACF,WAAC,YAAA,gBAAA,aAAA,EACU,SACX,CAAA;SACD,CAAC;QAAE,gBAAkB,aAAA,EACpB,IAAA,WAAA;AACJ,gBAAA,SAAA;WAEA,CAAA;QAAK;;MAER,CAAA,CAAA,CAAA;;IAEF;GACF;EAAC"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;UAsCiB,iBAAA;;AAAjB;;;;EAME,QAAA;EAeQ;;;;;;;;EALR,OAAA,GAAU,OAAA,CAAQ,aAAA;EAKV;;;EAAR,KAAA,GAAQ,kBAAA;EAKsB;AAGhC;;EAHE,OAAA,GAAU,oBAAA;AAAA;AAAA,KAGA,oBAAA,GAAuB,qBAAA,GACjC,uBAAA,GACA,UAAA;EAAA;;;EAIE,IAAA,EAAM,IAAA,CAAK,iBAAA;IAMA;;;;;IAAT,OAAA,EAAS,OAAA,CAAQ,aAAA;EAAA;AAAA;AAAA,KAIX,wBAAA,GAA2B,yBAAA,GACrC,2BAAA,GACA,cAAA;EANI;;;EAUF,IAAA,EAAM,QAAA,CAAS,IAAA,CAAK,iBAAA;IAVY;AAIpC;;;;IAYM,OAAA,EAAS,YAAA,CAAa,OAAA,CAAQ,aAAA;EAAA;AAAA;AAAA,KAIxB,iBAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,kBAAA,CAAmB,eAAA,IACrB,oBAAA,CAAqB,eAAA,IACrB,OAAA,CAAQ,eAAA"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/plugin-help",
3
- "version": "0.2.28",
3
+ "version": "0.2.30",
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": [
@@ -151,26 +151,26 @@
151
151
  "typings": "dist/index.d.mts",
152
152
  "files": ["dist/**/*"],
153
153
  "dependencies": {
154
- "@alloy-js/core": "0.23.0-dev.8",
155
- "@alloy-js/typescript": "0.23.0-dev.4",
156
- "@powerlines/deepkit": "^0.8.64",
157
- "@powerlines/plugin-alloy": "^0.26.84",
158
- "@powerlines/plugin-plugin": "^0.12.416",
159
- "@shell-shock/core": "^0.17.10",
160
- "@shell-shock/plugin-console": "^0.2.14",
161
- "@shell-shock/plugin-theme": "^0.4.23",
162
- "@stryke/helpers": "^0.10.12",
163
- "@stryke/path": "^0.28.2",
164
- "@stryke/string-format": "^0.17.13",
165
- "@stryke/type-checks": "^0.6.5",
166
- "@stryke/types": "^0.12.0",
154
+ "@alloy-js/core": "^0.23.1",
155
+ "@alloy-js/typescript": "^0.23.0",
156
+ "@powerlines/deepkit": "^0.9.80",
157
+ "@powerlines/plugin-alloy": "^0.26.219",
158
+ "@powerlines/plugin-plugin": "^0.12.538",
159
+ "@shell-shock/core": "0.17.12",
160
+ "@shell-shock/plugin-console": "0.2.16",
161
+ "@shell-shock/plugin-theme": "0.4.25",
162
+ "@stryke/helpers": "^0.10.24",
163
+ "@stryke/path": "^0.29.11",
164
+ "@stryke/string-format": "^0.17.26",
165
+ "@stryke/type-checks": "^0.6.17",
166
+ "@stryke/types": "^0.12.12",
167
167
  "defu": "^6.1.7",
168
- "powerlines": "^0.47.4"
168
+ "powerlines": "^0.47.126"
169
169
  },
170
170
  "devDependencies": {
171
- "@powerlines/plugin-deepkit": "^0.11.347",
172
- "@types/node": "^25.6.0"
171
+ "@powerlines/plugin-deepkit": "^0.11.469",
172
+ "@types/node": "^25.9.1"
173
173
  },
174
174
  "publishConfig": { "access": "public" },
175
- "gitHead": "7b4030fd6be000c960e8cc4c4f7b4db205054e69"
175
+ "gitHead": "3c10901dd3fbbc3c9d6d1a3373f01cc5f56d3321"
176
176
  }