@shell-shock/plugin-help 0.2.28 → 0.2.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/display.cjs +7 -9
- package/dist/components/display.d.cts +6 -7
- package/dist/components/display.d.cts.map +1 -1
- package/dist/components/display.d.mts +6 -7
- package/dist/components/display.d.mts.map +1 -1
- package/dist/components/display.mjs +7 -8
- package/dist/components/display.mjs.map +1 -1
- package/dist/components/help-builtin.cjs +1 -1
- package/dist/components/help-builtin.d.cts +1 -2
- package/dist/components/help-builtin.d.cts.map +1 -1
- package/dist/components/help-builtin.d.mts +2 -3
- package/dist/components/help-builtin.d.mts.map +1 -1
- package/dist/components/help-builtin.mjs +1 -1
- package/dist/components/help-builtin.mjs.map +1 -1
- package/dist/components/help-command.cjs +0 -1
- package/dist/components/help-command.d.cts +2 -4
- package/dist/components/help-command.d.cts.map +1 -1
- package/dist/components/help-command.d.mts +2 -4
- package/dist/components/help-command.d.mts.map +1 -1
- package/dist/components/help-command.mjs.map +1 -1
- package/dist/index.cjs +2 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -3
- package/dist/index.mjs.map +1 -1
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +18 -18
|
@@ -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("<${(
|
|
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("<${(
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
199
|
+
writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title} ${child.virtual ? "" : "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(" ")}` : ""}\`));
|
|
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.
|
|
253
|
+
writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title} ${child.virtual ? "" : "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(" ")}` : ""}\`));
|
|
256
254
|
writeLine("");
|
|
257
255
|
writeLine(textColors.body.tertiary(splitText(\`${(0, _shell_shock_core_plugin_utils.formatDescription)(child.description).replace(/\.+$/, "").trim()}.\`)));
|
|
258
256
|
writeLine(""); `),
|
|
@@ -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):
|
|
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):
|
|
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):
|
|
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):
|
|
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):
|
|
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):
|
|
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":"
|
|
1
|
+
{"version":3,"file":"display.d.cts","names":[],"sources":["../../src/components/display.tsx"],"mappings":";;;UAsCiB,qBAAA;;AAAjB;;EAIE,OAAA,EAAS,WAAW;EAAA;;;;;AAUd;AAMR;;EANE,MAAA;AAAA;;;;iBAMc,gBAAA,CAAiB,KAAA,EAAO,qBAAqB,4BAAA,QAAA;AAAA,UAmH5C,uBAAA;EAAA;;;EAIf,OAAA,EAAS,aAAa;AAAA;AAMxB;;;AAAA,iBAAgB,kBAAA,CAAmB,KAAA,EAAO,uBAAuB,4BAAA,QAAA;AAAA,UAoFhD,wBAAA;EApFkB;;;EAwFjC,QAAA,EAAU,MAAM,SAAS,WAAA;AAAA;;;;iBAMX,mBAAA,CAAoB,KAAA,EAAO,wBAAwB,4BAAA,QAAA;AAAA,UA2BlD,oBAAA;EAjCU;;AAAW;EAqCpC,OAAA,EAAS,WAAW;EA/Ba;;;;;;;AAAgC;EAyCjE,mBAAA;EAdmC;;;;;;;;EAwBnC,MAAA;AAAA;;;;iBAMc,eAAA,CAAgB,KAAA,EAAO,oBAAoB,4BAAA,QAAA;AAAA,UA6D1C,8BAAA;EA7D0C;;AAAA;EAiEzD,OAAA,EAAS,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):
|
|
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):
|
|
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):
|
|
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):
|
|
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):
|
|
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):
|
|
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":"
|
|
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("<${
|
|
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("<${
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
198
|
+
writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title} ${child.virtual ? "" : "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(" ")}` : ""}\`));
|
|
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.
|
|
252
|
+
writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title} ${child.virtual ? "" : "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(" ")}` : ""}\`));
|
|
254
253
|
writeLine("");
|
|
255
254
|
writeLine(textColors.body.tertiary(splitText(\`${formatDescription(child.description).replace(/\.+$/, "").trim()}.\`)));
|
|
256
255
|
writeLine(""); `),
|
|
@@ -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,GA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YAAA,CAAA,QAAA,QAAA,GAAA,CAAA,MAAA,CAAA;iCACV;OAAA,gBAAA,OAAA,EAAA,CAAA;OAAA,gBAAA,iBAAA;QACX,SAAS;QACT,QAAQ;QACR,qBAAe;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.
|
|
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):
|
|
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":"
|
|
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):
|
|
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":"
|
|
1
|
+
{"version":3,"file":"help-builtin.d.mts","names":[],"sources":["../../src/components/help-builtin.tsx"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help-builtin.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"help-builtin.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,5 +1,4 @@
|
|
|
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 _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():
|
|
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):
|
|
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":"
|
|
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():
|
|
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):
|
|
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":"
|
|
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":[
|
|
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
|
|
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
|
-
|
|
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
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":"
|
|
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
|
|
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
|
-
|
|
49
|
-
source: "help-plugin",
|
|
48
|
+
virtual: false,
|
|
50
49
|
...this.config.help.command
|
|
51
50
|
});
|
|
52
51
|
await render(this, createComponent(TemporaryHelpCommand, {}));
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":[
|
|
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":"
|
|
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.
|
|
3
|
+
"version": "0.2.29",
|
|
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.
|
|
155
|
-
"@alloy-js/typescript": "0.23.0
|
|
156
|
-
"@powerlines/deepkit": "^0.
|
|
157
|
-
"@powerlines/plugin-alloy": "^0.26.
|
|
158
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
159
|
-
"@shell-shock/core": "
|
|
160
|
-
"@shell-shock/plugin-console": "
|
|
161
|
-
"@shell-shock/plugin-theme": "
|
|
162
|
-
"@stryke/helpers": "^0.10.
|
|
163
|
-
"@stryke/path": "^0.
|
|
164
|
-
"@stryke/string-format": "^0.17.
|
|
165
|
-
"@stryke/type-checks": "^0.6.
|
|
166
|
-
"@stryke/types": "^0.12.
|
|
154
|
+
"@alloy-js/core": "^0.23.1",
|
|
155
|
+
"@alloy-js/typescript": "^0.23.0",
|
|
156
|
+
"@powerlines/deepkit": "^0.9.78",
|
|
157
|
+
"@powerlines/plugin-alloy": "^0.26.217",
|
|
158
|
+
"@powerlines/plugin-plugin": "^0.12.536",
|
|
159
|
+
"@shell-shock/core": "0.17.11",
|
|
160
|
+
"@shell-shock/plugin-console": "0.2.15",
|
|
161
|
+
"@shell-shock/plugin-theme": "0.4.24",
|
|
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.
|
|
168
|
+
"powerlines": "^0.47.124"
|
|
169
169
|
},
|
|
170
170
|
"devDependencies": {
|
|
171
|
-
"@powerlines/plugin-deepkit": "^0.11.
|
|
172
|
-
"@types/node": "^25.
|
|
171
|
+
"@powerlines/plugin-deepkit": "^0.11.467",
|
|
172
|
+
"@types/node": "^25.9.1"
|
|
173
173
|
},
|
|
174
174
|
"publishConfig": { "access": "public" },
|
|
175
|
-
"gitHead": "
|
|
175
|
+
"gitHead": "9401c1de122d800040306fc89ad1835930c1a826"
|
|
176
176
|
}
|