@shell-shock/plugin-help 0.2.22 → 0.2.24
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 +4 -4
- package/dist/components/display.d.cts.map +1 -1
- package/dist/components/display.d.mts.map +1 -1
- package/dist/components/display.mjs +4 -4
- package/dist/components/display.mjs.map +1 -1
- package/dist/components/help-command.cjs +106 -19
- package/dist/components/help-command.d.cts +9 -2
- package/dist/components/help-command.d.cts.map +1 -1
- package/dist/components/help-command.d.mts +9 -2
- package/dist/components/help-command.d.mts.map +1 -1
- package/dist/components/help-command.mjs +108 -22
- package/dist/components/help-command.mjs.map +1 -1
- package/dist/components/index.cjs +1 -0
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs +2 -2
- package/dist/index.cjs +9 -20
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +11 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +29 -28
|
@@ -66,7 +66,7 @@ function HelpOptionsDisplay(props) {
|
|
|
66
66
|
if (alias.length === 1) flags.push(`-${alias}`);
|
|
67
67
|
else names.push(`--${(0, _stryke_string_format_kebab_case.kebabCase)(alias)}`);
|
|
68
68
|
});
|
|
69
|
-
return _alloy_js_core.code`[{ value: textColors.body.primary("${flags.length > 0 ? `${flags.sort().join(", ")}${names.length > 0 ? ", " : ""}` : ""}${names.length > 0 ? names.sort().join(", ") : ""}${option.kind === _shell_shock_core.CommandParameterKinds.string ? ` <${(0, _stryke_string_format_snake_case.snakeCase)(option.choices && option.choices.length > 0 ? option.choices.join("|") : option.format ? option.format : option.name)}${option.variadic ? "..." : ""}>` : option.kind === _shell_shock_core.CommandParameterKinds.number ? ` <${(0, _stryke_string_format_snake_case.snakeCase)(option.choices && option.choices.length > 0 ? option.choices.join("|") : option.name)}${option.variadic ? "..." : ""}>` : ""}"), align: "right", border: "none", maxWidth: "1/3" }, { value: textColors.body.tertiary(\`${(0, _shell_shock_core_plugin_utils.formatShortDescription)(option.description).replace(/\.+$/, "").trim()}${option.env || option.default !== void 0 ? ` (${option.env ? `env: ${context.config.appSpecificEnvPrefix}_${option.env}${option.default !== void 0 ? ", " : ""}` : ""}${option.default !== void 0 ? `default: ${JSON.stringify(option.default).replace(/"/g, "\\\"")}` : ""})` : ""}.\`), align: "left", border: "none" }], `;
|
|
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" }], `;
|
|
70
70
|
}
|
|
71
71
|
}),
|
|
72
72
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
@@ -86,7 +86,7 @@ function HelpCommandsDisplay(props) {
|
|
|
86
86
|
return Object.values(commands);
|
|
87
87
|
},
|
|
88
88
|
hardline: true,
|
|
89
|
-
children: (child) => _alloy_js_core.code`[{ value: textColors.body.primary("${child.name}"), align: "right", border: "none" }, { value: textColors.body.tertiary(\`${(0, _shell_shock_core_plugin_utils.formatShortDescription)(child.description).replace(/\.+$/, "").trim()}.\`), align: "left", border: "none" }], `
|
|
89
|
+
children: (child) => _alloy_js_core.code`[{ value: textColors.body.primary("${child.name}"), align: "right", border: "none" }, { value: textColors.body.tertiary(\`${(0, _shell_shock_core_plugin_utils.formatShortDescription)(child.description, { length: 200 }).replace(/\.+$/, "").trim()}.\`), align: "left", border: "none" }], `
|
|
90
90
|
}),
|
|
91
91
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
92
92
|
_alloy_js_core.code` ]); `
|
|
@@ -174,7 +174,7 @@ function VirtualCommandHelpDisplay(props) {
|
|
|
174
174
|
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
175
175
|
return [
|
|
176
176
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
177
|
-
_alloy_js_core.code`writeLine(bold(textColors.heading.secondary("
|
|
177
|
+
_alloy_js_core.code`writeLine(bold(textColors.heading.secondary("Common Options:")));`,
|
|
178
178
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
179
179
|
(0, _alloy_js_core_jsx_runtime.createComponent)(HelpOptionsDisplay, { options }),
|
|
180
180
|
_alloy_js_core.code`writeLine(""); `,
|
|
@@ -211,7 +211,7 @@ function VirtualCommandHelpDisplay(props) {
|
|
|
211
211
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
212
212
|
]
|
|
213
213
|
}),
|
|
214
|
-
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`help(\`Running a specific command with the help flag (via: \${inlineCode("${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} ${segments && segments.length > 0 ? ` ${segments.join(" ")}` : ""} <specific command> --help")}) will provide additional information that is specific to that command.\`);
|
|
214
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`help(\`Running a specific command with the help flag (via: \${inlineCode("${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} ${segments && segments.length > 0 ? ` ${segments.join(" ")}` : ""} <specific command> --help")}) or the help command with the specific command as arguments (via: \${inlineCode("${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} ${segments && segments.length > 0 ? ` ${segments.join(" ")}` : ""} help <specific command>")}) will provide additional information that is specific to that command.\`);
|
|
215
215
|
writeLine("");`)
|
|
216
216
|
];
|
|
217
217
|
}
|
|
@@ -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,
|
|
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;;;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 +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,
|
|
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"}
|
|
@@ -64,7 +64,7 @@ function HelpOptionsDisplay(props) {
|
|
|
64
64
|
if (alias.length === 1) flags.push(`-${alias}`);
|
|
65
65
|
else names.push(`--${kebabCase(alias)}`);
|
|
66
66
|
});
|
|
67
|
-
return code`[{ value: textColors.body.primary("${flags.length > 0 ? `${flags.sort().join(", ")}${names.length > 0 ? ", " : ""}` : ""}${names.length > 0 ? names.sort().join(", ") : ""}${option.kind === CommandParameterKinds.string ? ` <${snakeCase(option.choices && option.choices.length > 0 ? option.choices.join("|") : option.format ? option.format : option.name)}${option.variadic ? "..." : ""}>` : option.kind === CommandParameterKinds.number ? ` <${snakeCase(option.choices && option.choices.length > 0 ? option.choices.join("|") : option.name)}${option.variadic ? "..." : ""}>` : ""}"), align: "right", border: "none", maxWidth: "1/3" }, { value: textColors.body.tertiary(\`${formatShortDescription(option.description).replace(/\.+$/, "").trim()}${option.env || option.default !== void 0 ? ` (${option.env ? `env: ${context.config.appSpecificEnvPrefix}_${option.env}${option.default !== void 0 ? ", " : ""}` : ""}${option.default !== void 0 ? `default: ${JSON.stringify(option.default).replace(/"/g, "\\\"")}` : ""})` : ""}.\`), align: "left", border: "none" }], `;
|
|
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" }], `;
|
|
68
68
|
}
|
|
69
69
|
}),
|
|
70
70
|
createIntrinsic("hbr", {}),
|
|
@@ -84,7 +84,7 @@ function HelpCommandsDisplay(props) {
|
|
|
84
84
|
return Object.values(commands);
|
|
85
85
|
},
|
|
86
86
|
hardline: true,
|
|
87
|
-
children: (child) => code`[{ value: textColors.body.primary("${child.name}"), align: "right", border: "none" }, { value: textColors.body.tertiary(\`${formatShortDescription(child.description).replace(/\.+$/, "").trim()}.\`), align: "left", border: "none" }], `
|
|
87
|
+
children: (child) => code`[{ value: textColors.body.primary("${child.name}"), align: "right", border: "none" }, { value: textColors.body.tertiary(\`${formatShortDescription(child.description, { length: 200 }).replace(/\.+$/, "").trim()}.\`), align: "left", border: "none" }], `
|
|
88
88
|
}),
|
|
89
89
|
createIntrinsic("hbr", {}),
|
|
90
90
|
code` ]); `
|
|
@@ -172,7 +172,7 @@ function VirtualCommandHelpDisplay(props) {
|
|
|
172
172
|
const context = usePowerlines();
|
|
173
173
|
return [
|
|
174
174
|
createIntrinsic("hbr", {}),
|
|
175
|
-
code`writeLine(bold(textColors.heading.secondary("
|
|
175
|
+
code`writeLine(bold(textColors.heading.secondary("Common Options:")));`,
|
|
176
176
|
createIntrinsic("hbr", {}),
|
|
177
177
|
createComponent(HelpOptionsDisplay, { options }),
|
|
178
178
|
code`writeLine(""); `,
|
|
@@ -209,7 +209,7 @@ function VirtualCommandHelpDisplay(props) {
|
|
|
209
209
|
createIntrinsic("hbr", {})
|
|
210
210
|
]
|
|
211
211
|
}),
|
|
212
|
-
memo(() => code`help(\`Running a specific command with the help flag (via: \${inlineCode("${getAppBin(context)} ${segments && segments.length > 0 ? ` ${segments.join(" ")}` : ""} <specific command> --help")}) will provide additional information that is specific to that command.\`);
|
|
212
|
+
memo(() => code`help(\`Running a specific command with the help flag (via: \${inlineCode("${getAppBin(context)} ${segments && segments.length > 0 ? ` ${segments.join(" ")}` : ""} <specific command> --help")}) or the help command with the specific command as arguments (via: \${inlineCode("${getAppBin(context)} ${segments && segments.length > 0 ? ` ${segments.join(" ")}` : ""} help <specific command>")}) will provide additional information that is specific to that command.\`);
|
|
213
213
|
writeLine("");`)
|
|
214
214
|
];
|
|
215
215
|
}
|
|
@@ -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 .replace(/\\.+$/, \"\")\n .trim()}${\n option.env || option.default !== undefined\n ? ` (${\n option.env\n ? `env: ${context.config.appSpecificEnvPrefix}_${\n option.env\n }${option.default !== undefined ? \", \" : \"\"}`\n : \"\"\n }${\n option.default !== undefined\n ? `default: ${JSON.stringify(option.default).replace(\n /\"/g,\n '\\\\\"'\n )}`\n : \"\"\n })`\n : \"\"\n }.\\`), align: \"left\", border: \"none\" }], `;\n }}\n </For>\n <hbr />\n {code` ]); `}\n </>\n );\n}\n\nexport interface HelpCommandsDisplayProps {\n /**\n * A mapping of command names to their command definitions.\n */\n commands: Record<string, CommandTree>;\n}\n\n/**\n * A component that generates the commands table display for a command.\n */\nexport function HelpCommandsDisplay(props: HelpCommandsDisplayProps) {\n const { commands } = props;\n\n return (\n <>\n {code`table([ `}\n <hbr />\n <For each={Object.values(commands)} hardline>\n {child =>\n code`[{ value: textColors.body.primary(\"${\n child.name\n }\"), align: \"right\", border: \"none\" }, { value: textColors.body.tertiary(\\`${formatShortDescription(\n child.description\n )\n .replace(/\\.+$/, \"\")\n .trim()}.\\`), align: \"left\", border: \"none\" }], `\n }\n </For>\n <hbr />\n {code` ]); `}\n </>\n );\n}\n\nexport interface BaseHelpDisplayProps {\n /**\n * The command to generate help for.\n */\n command: CommandTree;\n\n /**\n * Whether to filter out global options from the help display.\n *\n * @remarks\n * When enabled, any options that are present in the global options context will be filtered out from the help display. This is useful for sub-commands to avoid displaying global options that are not relevant to the specific command.\n *\n * @defaultValue false\n */\n filterGlobalOptions?: boolean;\n\n /**\n * The padding scale to apply to the help display headings.\n *\n * @remarks\n * This value is multiplied by the theme's app padding to determine the final padding.\n *\n * @defaultValue 1\n */\n indent?: number;\n}\n\n/**\n * A component that generates the `help` function declaration for a command.\n */\nexport function BaseHelpDisplay(props: BaseHelpDisplayProps) {\n const { command, indent = 1, filterGlobalOptions = false } = props;\n\n const theme = useTheme();\n const context = usePowerlines<HelpPluginContext>();\n\n const options = computed(() =>\n filterGlobalOptions\n ? Object.values(command.options).filter(\n option =>\n !context.options.some(\n globalOption =>\n globalOption.name === option.name ||\n option.alias.includes(globalOption.name) ||\n globalOption.alias?.includes(option.name) ||\n globalOption.alias?.some(alias => option.alias.includes(alias))\n )\n )\n : Object.values(command.options)\n );\n\n return (\n <>\n {code`writeLine(bold(textColors.heading.secondary(\"Usage:\"))${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <HelpUsageDisplay command={command} indent={indent} />\n <Spacing />\n <Show when={options.value.length > 0}>\n {code`writeLine(\"\");\n writeLine(bold(textColors.heading.secondary(\"Options:\"))${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <HelpOptionsDisplay options={options.value} />\n <Spacing />\n </Show>\n <Show when={Object.keys(command.children).length > 0}>\n {code`writeLine(\"\");\n writeLine(bold(textColors.heading.secondary(\"Commands:\"))${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <HelpCommandsDisplay commands={command.children} />\n <Spacing />\n </Show>\n <Show when={isSetString(command.reference)}>\n {code`writeLine(\"\");\n writeLine(textColors.heading.tertiary(\\`More information about this command can be found in the reference documentation at \\${link(\"${\n command.reference\n }\")}\\`)${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <Spacing />\n </Show>\n </>\n );\n}\n\nexport interface VirtualCommandHelpDisplayProps {\n /**\n * The options to display help for.\n */\n options: CommandOption[];\n\n /**\n * A mapping of command names to their command definitions.\n */\n commands: Record<string, CommandTree>;\n\n /**\n * The command path to generate help for, used for generating the help invocation instructions.\n *\n * @remarks\n * This is optional since the virtual command entry component can be used for both the global binary executable and virtual commands (there will be no command definition for the binary executable).\n */\n segments?: string[];\n}\n\nfunction sortCommands(commands: Record<string, CommandTree>) {\n return Object.values(commands).sort((a, b) => {\n if (\n a.tags.some(tag => tag.toLowerCase() === \"deprecated\") &&\n !b.tags.some(tag => tag.toLowerCase() === \"deprecated\")\n ) {\n return 1;\n } else if (\n !a.tags.some(tag => tag.toLowerCase() === \"deprecated\") &&\n b.tags.some(tag => tag.toLowerCase() === \"deprecated\")\n ) {\n return -1;\n } else if (\n a.tags.some(tag => tag.toLowerCase() === \"experimental\") &&\n !b.tags.some(tag => tag.toLowerCase() === \"experimental\")\n ) {\n return 1;\n } else if (\n !a.tags.some(tag => tag.toLowerCase() === \"experimental\") &&\n b.tags.some(tag => tag.toLowerCase() === \"experimental\")\n ) {\n return -1;\n } else if (\n a.tags.some(tag => tag.toLowerCase() === \"utility\") &&\n !b.tags.some(tag => tag.toLowerCase() === \"utility\")\n ) {\n return 1;\n } else if (\n !a.tags.some(tag => tag.toLowerCase() === \"utility\") &&\n b.tags.some(tag => tag.toLowerCase() === \"utility\")\n ) {\n return -1;\n }\n\n return a.name.localeCompare(b.name);\n });\n}\n\n/**\n * A component that generates the invocation of the `help` function for a command.\n */\nexport function VirtualCommandHelpDisplay(\n props: VirtualCommandHelpDisplayProps\n) {\n const { options, segments, commands } = props;\n\n const context = usePowerlines<HelpPluginContext>();\n\n return (\n <>\n <hbr />\n {code`writeLine(bold(textColors.heading.secondary(\"Global Options:\")));`}\n <hbr />\n <HelpOptionsDisplay options={options} />\n {code`writeLine(\"\"); `}\n <Spacing />\n <Show when={Object.keys(commands).length > 0}>\n {code`writeLine(textColors.body.tertiary(\"The following commands are available through the ${getAppTitle(\n context,\n true\n )} command-line interface:\"));\n writeLine(\"\"); `}\n <Spacing />\n <For\n each={sortCommands(commands)}\n doubleHardline\n joiner={code`writeLine(\"\"); `}\n ender={code`writeLine(\"\"); `}>\n {child => (\n <>\n <hbr />\n {code`\n writeLine(textColors.heading.primary(${\n child.icon\n ? `(isUnicodeSupported ? \" ${child.icon} \" : \"\") + `\n : \"\"\n }\\`${child.title} ${child.isVirtual ? \"\" : \"Command\"}${\n child.tags?.length > 0\n ? ` - ${child.tags\n .map(\n tag =>\n `\\${textColors.tags.${camelCase(tag)} ? textColors.tags.${camelCase(tag)}(inverse(\" ${tag} \")) : textColors.tags.$default(inverse(\" ${tag} \"))}`\n )\n .join(\" \")}`\n : \"\"\n }\\`));\n writeLine(\"\");\n writeLine(textColors.body.tertiary(splitText(\\`${formatDescription(\n child.description\n )\n .replace(/\\.+$/, \"\")\n .trim()}.\\`)));\n writeLine(\"\"); `}\n <hbr />\n <BaseHelpDisplay command={child} indent={2} filterGlobalOptions />\n <hbr />\n </>\n )}\n </For>\n {code`help(\\`Running a specific command with the help flag (via: \\${inlineCode(\"${getAppBin(\n context\n )} ${\n segments && segments.length > 0 ? ` ${segments.join(\" \")}` : \"\"\n } <specific command> --help\")}) will provide additional information that is specific to that command.\\`);\n writeLine(\"\");`}\n </Show>\n </>\n );\n}\n\nexport interface CommandHelpDisplayProps {\n /**\n * A mapping of command names to their command definitions.\n */\n command: CommandTree;\n}\n\n/**\n * A component that generates the invocation of the `help` function for a command.\n */\nexport function CommandHelpDisplay(props: CommandHelpDisplayProps) {\n const { command } = props;\n\n const context = usePowerlines<HelpPluginContext>();\n\n return (\n <>\n {code`writeLine(\"\"); `}\n <Spacing />\n <BaseHelpDisplay command={command} filterGlobalOptions={false} />\n {code`writeLine(\"\"); `}\n <Spacing />\n <Show when={Object.keys(command.children).length > 0}>\n {code`writeLine(textColors.body.tertiary(\"The following sub-commands are available:\"));\n writeLine(\"\"); `}\n <Spacing />\n <For\n each={sortCommands(command.children)}\n doubleHardline\n joiner={code`writeLine(\"\"); `}\n ender={code`writeLine(\"\"); `}>\n {child => (\n <>\n <hbr />\n {code`\n writeLine(textColors.heading.primary(${\n child.icon\n ? `(isUnicodeSupported ? \" ${child.icon} \" : \"\") + `\n : \"\"\n }\\`${child.title} ${child.isVirtual ? \"\" : \"Command\"}${\n child.tags?.length > 0\n ? ` - ${child.tags\n .map(\n tag =>\n `\\${textColors.tags.${camelCase(tag)} ? textColors.tags.${camelCase(tag)}(inverse(\" ${tag} \")) : textColors.tags.$default(inverse(\" ${tag} \"))}`\n )\n .join(\" \")}`\n : \"\"\n }\\`));\n writeLine(\"\");\n writeLine(textColors.body.tertiary(splitText(\\`${formatDescription(\n child.description\n )\n .replace(/\\.+$/, \"\")\n .trim()}.\\`)));\n writeLine(\"\"); `}\n <hbr />\n <BaseHelpDisplay command={child} indent={2} filterGlobalOptions />\n <hbr />\n </>\n )}\n </For>\n {code`help(\\`Running a specific command with the help flag (via: \\${inlineCode(\"${getAppBin(\n context\n )} ${command.segments.join(\n \" \"\n )} <specific command> --help\")}) will provide additional information that is specific to that command.\\`);\n writeLine(\"\");`}\n </Show>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmDA,SAAM,iBAAa,OAAA;CACjB,MAAE,EACF,SACF,SAAA;CAEE,MAAA,UAAA,eAAA;CACA,MAAG,QAAU,UAAK;AAClB,QAAA;EAAA,WAAA,IAAA;;kEAEqC,UAAA,QAAA,CAAA,KAAA,QAAA,SAAA,SAAA,IAAA,IAAA,QAAA,SAAA,KAAA,YAAA,uBAAA,qBAAA,QAAA,GAAA,YAAA,UAAA,IAAA,qBAAA,QAAA,GAAA,IAAA,UAAA,0BAAA,QAAA,CAAA,CAAA,KAAA,QAAA,KAAA,CAAA,KAAA,IAAA,KAAA,KAAA,OAAA,OAAA,QAAA,SAAA,CAAA,SAAA,IAAA,+CAAA,KAAA,QAAA,KAAA,SAAA,IAAA,IAAA,QAAA,KAAA,KAAA,QAAA,8BAAA,WAAA,IAAA,SAAA,sBAAA,UAAA,IAAA,SAAA,sBAAA,WAAA,IAAA,WAAA,IAAA,QAAA,SAAA,IAAA,IAAA,QAAA,KAAA,IAAA,GAAA,IAAA,SAAA,sBAAA,UAAA,IAAA,SAAA,IAAA,SAAA,IAAA,KAAA,IAAA,IAAA,SAAA,sBAAA,UAAA,IAAA,SAAA,sBAAA,WAAA,IAAA,WAAA,QAAA,GAAA,MAAA,CAAA,KAAA,IAAA,KAAA,GAAA,4DAAA,MAAA,QAAA,MAAA,OAAA;;;;GAErC,IAAM,OAAO;AACb,WAAW,QAAG,KAAU,SAAA;;GAExB,IAAM,WAAC;AACJ,WAAA;KAAA,gBAAA,OAAA,EAAA,CAAA;KAAA,WAAA,IAAA;;kEAEU,UAAA,QAAA,CAAA,KAAA,QAAA,SAAA,SAAA,IAAA,IAAA,QAAA,SAAA,KAAA,YAAA,uBAAA,qBAAA,QAAA,GAAA,YA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SAAW;;GAE/C,IAAE,WAAa;AACf,WAAA;KAAA,IAAA;;KACoB,gBAAO,SAAA,EAAA,CAAA;KAAA,gBAAA,KAAA;;AAE3B,cAAA,aAAA,QAAA,SAAA;;MAED,gBAAA;MACG,QAAA,IAAA;MACD,OAAU,IAAI;MAChB,WAAA,UAAA;OAAA,gBAAA,OAAA,EAAA,CAAA;OAAA,WAAA,IAAA;uDACgB,MAAA,OAAA,2BAAA,MAAA,KAAA,gBAAA,GAAA,IAAA,MAAA,MAAA,GAAA,MAAA,YAAA,KAAA,YAAA,MAAA,MAAA,SAAA,IAAA,MAAA,MAAA,KAAA,KAAA,QAAA,sBAAA,UAAA,IAAA,CAAA,qBAAA,UAAA,IAAA,CAAA,aAAA,IAAA,4CAAA,IAAA,OAAA,CAAA,KAAA,IAAA,KAAA,GAAA;;iEAEF,kBAAA,MAAA,YAAA,CAAA,QAAA,QAAA,GAAA,CAAA,MAAA,CAAA;iCACjB;OAAA,gBAAA,OAAA,EAAA,CAAA;OAAA,gBAAA,iBAAA;;QAEE,QAAA;QACG,qBAAyB;QAC5B,CAAA;OAAA,gBAAA,OAAA,EAAA,CAAA;OAAA;MACK,CAAA;KAAA,WAAS,IAAA,6EAA6C,UAAA,QAAA,CAAA,GAAA,QAAA,SAAA,KAAA,IAAA,CAAA;wBAC1C;KAAM;;GAEvB,CAAA;EAAA"}
|
|
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.options.some(\n globalOption =>\n globalOption.name === option.name ||\n option.alias.includes(globalOption.name) ||\n globalOption.alias?.includes(option.name) ||\n globalOption.alias?.some(alias => option.alias.includes(alias))\n )\n )\n : Object.values(command.options)\n );\n\n return (\n <>\n {code`writeLine(bold(textColors.heading.secondary(\"Usage:\"))${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <HelpUsageDisplay command={command} indent={indent} />\n <Spacing />\n <Show when={options.value.length > 0}>\n {code`writeLine(\"\");\n writeLine(bold(textColors.heading.secondary(\"Options:\"))${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <HelpOptionsDisplay options={options.value} />\n <Spacing />\n </Show>\n <Show when={Object.keys(command.children).length > 0}>\n {code`writeLine(\"\");\n writeLine(bold(textColors.heading.secondary(\"Commands:\"))${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <HelpCommandsDisplay commands={command.children} />\n <Spacing />\n </Show>\n <Show when={isSetString(command.reference)}>\n {code`writeLine(\"\");\n writeLine(textColors.heading.tertiary(\\`More information about this command can be found in the reference documentation at \\${link(\"${\n command.reference\n }\")}\\`)${\n indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"\n });`}\n <hbr />\n <Spacing />\n </Show>\n </>\n );\n}\n\nexport interface VirtualCommandHelpDisplayProps {\n /**\n * The options to display help for.\n */\n options: CommandOption[];\n\n /**\n * A mapping of command names to their command definitions.\n */\n commands: Record<string, CommandTree>;\n\n /**\n * The command path to generate help for, used for generating the help invocation instructions.\n *\n * @remarks\n * This is optional since the virtual command entry component can be used for both the global binary executable and virtual commands (there will be no command definition for the binary executable).\n */\n segments?: string[];\n}\n\nfunction sortCommands(commands: Record<string, CommandTree>) {\n return Object.values(commands).sort((a, b) => {\n if (\n a.tags.some(tag => tag.toLowerCase() === \"deprecated\") &&\n !b.tags.some(tag => tag.toLowerCase() === \"deprecated\")\n ) {\n return 1;\n } else if (\n !a.tags.some(tag => tag.toLowerCase() === \"deprecated\") &&\n b.tags.some(tag => tag.toLowerCase() === \"deprecated\")\n ) {\n return -1;\n } else if (\n a.tags.some(tag => tag.toLowerCase() === \"experimental\") &&\n !b.tags.some(tag => tag.toLowerCase() === \"experimental\")\n ) {\n return 1;\n } else if (\n !a.tags.some(tag => tag.toLowerCase() === \"experimental\") &&\n b.tags.some(tag => tag.toLowerCase() === \"experimental\")\n ) {\n return -1;\n } else if (\n a.tags.some(tag => tag.toLowerCase() === \"utility\") &&\n !b.tags.some(tag => tag.toLowerCase() === \"utility\")\n ) {\n return 1;\n } else if (\n !a.tags.some(tag => tag.toLowerCase() === \"utility\") &&\n b.tags.some(tag => tag.toLowerCase() === \"utility\")\n ) {\n return -1;\n }\n\n return a.name.localeCompare(b.name);\n });\n}\n\n/**\n * A component that generates the invocation of the `help` function for a command.\n */\nexport function VirtualCommandHelpDisplay(\n props: VirtualCommandHelpDisplayProps\n) {\n const { options, segments, commands } = props;\n\n const context = usePowerlines<HelpPluginContext>();\n\n return (\n <>\n <hbr />\n {code`writeLine(bold(textColors.heading.secondary(\"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":";;;;;;;;;;;;;;;;AAmDA,SAAM,iBAAa,OAAA;CACjB,MAAE,EACF,SACF,SAAA;CAEE,MAAA,UAAA,eAAA;CACA,MAAG,QAAU,UAAK;AAClB,QAAA;EAAA,WAAA,IAAA;;kEAEqC,UAAA,QAAA,CAAA,KAAA,QAAA,SAAA,SAAA,IAAA,IAAA,QAAA,SAAA,KAAA,YAAA,uBAAA,qBAAA,QAAA,GAAA,YAAA,UAAA,IAAA,qBAAA,QAAA,GAAA,IAAA,UAAA,0BAAA,QAAA,CAAA,CAAA,KAAA,QAAA,KAAA,CAAA,KAAA,IAAA,KAAA,KAAA,OAAA,OAAA,QAAA,SAAA,CAAA,SAAA,IAAA,+CAAA,KAAA,QAAA,KAAA,SAAA,IAAA,IAAA,QAAA,KAAA,KAAA,QAAA,8BAAA,WAAA,IAAA,SAAA,sBAAA,UAAA,IAAA,SAAA,sBAAA,WAAA,IAAA,WAAA,IAAA,QAAA,SAAA,IAAA,IAAA,QAAA,KAAA,IAAA,GAAA,IAAA,SAAA,sBAAA,UAAA,IAAA,SAAA,IAAA,SAAA,IAAA,KAAA,IAAA,IAAA,SAAA,sBAAA,UAAA,IAAA,SAAA,sBAAA,WAAA,IAAA,WAAA,QAAA,GAAA,MAAA,CAAA,KAAA,IAAA,KAAA,GAAA,4DAAA,MAAA,QAAA,MAAA,OAAA;;;;GAErC,IAAM,OAAO;AACb,WAAW,QAAG,KAAU,SAAA;;GAExB,IAAM,WAAC;AACJ,WAAA;KAAA,gBAAA,OAAA,EAAA,CAAA;KAAA,WAAA,IAAA;;kEAEU,UAAA,QAAA,CAAA,KAAA,QAAA,SAAA,SAAA,IAAA,IAAA,QAAA,SAAA,KAAA,YAAA,uBAAA,qBAAA,QAAA,GAAA,YAAA,U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,WAAA;KAAA,IAAA;;KACgB,gBAAA,SAAA,EAAA,CAAA;KAAA,gBAAA,KAAA;MACf,IAAA,OAAA;AACF,cAAA,aAAsB,QAAO,SAAA;;MAE3B,gBAAA;MACI,QAAQ,IAAC;MACd,OAAA,IAAA;MACG,WAAA,UAAA;OAAA,gBAAA,OAAA,EAAA,CAAA;OAAA,WAAA,IAAA;uDAC2C,MAAW,OAAA,2BAA2B,MAAA,KAAA,gBAAA,GAAA,IAAA,MAAA,MAAA,GAAA,MAAA,YAAA,KAAA,YAAA,MAAA,MAAA,SAAA,IAAA,MAAA,MAAA,KAAA,KAAA,QAAA,sBAAA,UAAA,IAAA,CAAA,qBAAA,UAAA,IAAA,CAAA,aAAA,IAAA,4CAAA,IAAA,OAAA,CAAA,KAAA,IAAA,KAAA,GAAA;;iEAEpE,kBAAA,MAAA,YAAA,CAAA,QAAA,QAAA,GAAA,CAAA,MAAA,CAAA;iCACf;OAAA,gBAAA,OAAA,EAAA,CAAA;OAAA,gBAAA,iBAAA;QACM,SAAO;QACjB,QAAA;;QAEE,CAAA;OAAA,gBAAA,OAAA,EAAA,CAAA;OAAA;MACG,CAAA;KAAA,WAAe,IAAA,6EAAuD,UAAA,QAAA,CAAA,GAAA,QAAA,SAAA,KAAA,IAAA,CAAA;wBACzE;KAAA;;GAEA,CAAA;EAAA"}
|
|
@@ -2,18 +2,65 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
4
|
let _alloy_js_core = require("@alloy-js/core");
|
|
5
|
+
let _powerlines_plugin_alloy_core_components = require("@powerlines/plugin-alloy/core/components");
|
|
5
6
|
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
6
7
|
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
7
8
|
let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
|
|
8
9
|
let _stryke_path = require("@stryke/path");
|
|
9
10
|
let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
11
|
+
let _stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
|
|
10
12
|
|
|
11
13
|
//#region src/components/help-command.tsx
|
|
12
14
|
/**
|
|
15
|
+
* 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.
|
|
16
|
+
*/
|
|
17
|
+
function TemporaryHelpCommand() {
|
|
18
|
+
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
19
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TypescriptFile, {
|
|
20
|
+
get path() {
|
|
21
|
+
return (0, _stryke_path.joinPaths)(context.entryPath, "help", "command.ts");
|
|
22
|
+
},
|
|
23
|
+
get children() {
|
|
24
|
+
return [
|
|
25
|
+
_alloy_js_core.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. `,
|
|
26
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
|
|
27
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
28
|
+
heading: "Display command usage details and other useful information to the user.",
|
|
29
|
+
get children() {
|
|
30
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
31
|
+
name: "segments",
|
|
32
|
+
children: `The command segments for the command to show help for. This is used to determine which command's help information to display. If no segments are provided, general help information about the CLI application will be displayed.`
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}),
|
|
36
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
37
|
+
"export": true,
|
|
38
|
+
"default": true,
|
|
39
|
+
async: true,
|
|
40
|
+
name: "handler",
|
|
41
|
+
parameters: [{
|
|
42
|
+
name: "segments",
|
|
43
|
+
type: "string[]",
|
|
44
|
+
default: "[]"
|
|
45
|
+
}]
|
|
46
|
+
})
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
13
52
|
* The Help command's handler wrapper for the Shell Shock project.
|
|
14
53
|
*/
|
|
15
|
-
function HelpCommand() {
|
|
54
|
+
function HelpCommand(props) {
|
|
16
55
|
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
56
|
+
const helpImports = (0, _alloy_js_core.computed)(() => props.segments ? props.segments.reduce((ret, segments) => {
|
|
57
|
+
ret[(0, _stryke_path.joinPaths)("help", ...segments)] = [{
|
|
58
|
+
name: "showHelp",
|
|
59
|
+
alias: `showHelp${segments.map((segment) => (0, _stryke_string_format_pascal_case.pascalCase)(segment.replace(/-/g, ""))).join("")}`
|
|
60
|
+
}];
|
|
61
|
+
return ret;
|
|
62
|
+
}, {}) : {});
|
|
63
|
+
const commandSegmentsList = props.segments ?? [];
|
|
17
64
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TypescriptFile, {
|
|
18
65
|
get path() {
|
|
19
66
|
return (0, _stryke_path.joinPaths)(context.entryPath, "help", "command.ts");
|
|
@@ -22,28 +69,31 @@ function HelpCommand() {
|
|
|
22
69
|
"node:os": "os",
|
|
23
70
|
"node:fs/promises": ["readFile", "writeFile"]
|
|
24
71
|
},
|
|
25
|
-
builtinImports
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
72
|
+
get builtinImports() {
|
|
73
|
+
return {
|
|
74
|
+
...helpImports.value,
|
|
75
|
+
help: ["showHelp"],
|
|
76
|
+
console: [
|
|
77
|
+
"splitText",
|
|
78
|
+
"writeLine",
|
|
79
|
+
"inlineCode",
|
|
80
|
+
"textColors",
|
|
81
|
+
"inverse",
|
|
82
|
+
"bold",
|
|
83
|
+
"help",
|
|
84
|
+
"table",
|
|
85
|
+
"link"
|
|
86
|
+
]
|
|
87
|
+
};
|
|
88
|
+
},
|
|
36
89
|
get children() {
|
|
37
90
|
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
38
91
|
heading: "Display command usage details and other useful information to the user.",
|
|
39
92
|
get children() {
|
|
40
|
-
return
|
|
41
|
-
name: "options",
|
|
42
|
-
children: `The options for the help command. This can include various flags and parameters to customize the behavior of the help command, such as specifying a particular command to show help for, or toggling the display of additional information.`
|
|
43
|
-
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
93
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
44
94
|
name: "segments",
|
|
45
95
|
children: `The command segments for the command to show help for. This is used to determine which command's help information to display. If no segments are provided, general help information about the CLI application will be displayed.`
|
|
46
|
-
})
|
|
96
|
+
});
|
|
47
97
|
}
|
|
48
98
|
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
49
99
|
"export": true,
|
|
@@ -55,11 +105,48 @@ function HelpCommand() {
|
|
|
55
105
|
type: "string[]",
|
|
56
106
|
default: "[]"
|
|
57
107
|
}],
|
|
58
|
-
children
|
|
108
|
+
get children() {
|
|
109
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
110
|
+
get when() {
|
|
111
|
+
return commandSegmentsList.length > 0;
|
|
112
|
+
},
|
|
113
|
+
fallback: _alloy_js_core.code`showHelp(); `,
|
|
114
|
+
get children() {
|
|
115
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
116
|
+
each: commandSegmentsList,
|
|
117
|
+
doubleHardline: true,
|
|
118
|
+
children: (segments, index) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
119
|
+
when: index > 0,
|
|
120
|
+
get fallback() {
|
|
121
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
122
|
+
get condition() {
|
|
123
|
+
return _alloy_js_core.code`segments.join("/").toLowerCase() === "${segments.join("/").toLowerCase()}"`;
|
|
124
|
+
},
|
|
125
|
+
get children() {
|
|
126
|
+
return _alloy_js_core.code` showHelp${segments.map((segment) => (0, _stryke_string_format_pascal_case.pascalCase)(segment)).join("")}(); `;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
get children() {
|
|
131
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseIfClause, {
|
|
132
|
+
get condition() {
|
|
133
|
+
return _alloy_js_core.code`segments.join("/").toLowerCase() === "${segments.join("/").toLowerCase()}"`;
|
|
134
|
+
},
|
|
135
|
+
get children() {
|
|
136
|
+
return _alloy_js_core.code` showHelp${segments.map((segment) => (0, _stryke_string_format_pascal_case.pascalCase)(segment)).join("")}(); `;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseClause, { children: _alloy_js_core.code`showHelp(); ` })];
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
59
145
|
})];
|
|
60
146
|
}
|
|
61
147
|
});
|
|
62
148
|
}
|
|
63
149
|
|
|
64
150
|
//#endregion
|
|
65
|
-
exports.HelpCommand = HelpCommand;
|
|
151
|
+
exports.HelpCommand = HelpCommand;
|
|
152
|
+
exports.TemporaryHelpCommand = TemporaryHelpCommand;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
2
2
|
|
|
3
3
|
//#region src/components/help-command.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* 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
|
+
*/
|
|
7
|
+
declare function TemporaryHelpCommand(): _$_alloy_js_core0.Children;
|
|
8
|
+
interface HelpCommandsProps {
|
|
9
|
+
segments: string[][];
|
|
10
|
+
}
|
|
4
11
|
/**
|
|
5
12
|
* The Help command's handler wrapper for the Shell Shock project.
|
|
6
13
|
*/
|
|
7
|
-
declare function HelpCommand(): _$_alloy_js_core0.Children;
|
|
14
|
+
declare function HelpCommand(props: HelpCommandsProps): _$_alloy_js_core0.Children;
|
|
8
15
|
//#endregion
|
|
9
|
-
export { HelpCommand };
|
|
16
|
+
export { HelpCommand, HelpCommandsProps, TemporaryHelpCommand };
|
|
10
17
|
//# 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":";;;;;;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,10 +1,17 @@
|
|
|
1
1
|
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
2
2
|
|
|
3
3
|
//#region src/components/help-command.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* 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
|
+
*/
|
|
7
|
+
declare function TemporaryHelpCommand(): _$_alloy_js_core0.Children;
|
|
8
|
+
interface HelpCommandsProps {
|
|
9
|
+
segments: string[][];
|
|
10
|
+
}
|
|
4
11
|
/**
|
|
5
12
|
* The Help command's handler wrapper for the Shell Shock project.
|
|
6
13
|
*/
|
|
7
|
-
declare function HelpCommand(): _$_alloy_js_core0.Children;
|
|
14
|
+
declare function HelpCommand(props: HelpCommandsProps): _$_alloy_js_core0.Children;
|
|
8
15
|
//#endregion
|
|
9
|
-
export { HelpCommand };
|
|
16
|
+
export { HelpCommand, HelpCommandsProps, TemporaryHelpCommand };
|
|
10
17
|
//# 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":";;;;;;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,17 +1,64 @@
|
|
|
1
|
-
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { code } from "@alloy-js/core";
|
|
1
|
+
import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { For, Show, code, computed } from "@alloy-js/core";
|
|
3
|
+
import { Spacing } from "@powerlines/plugin-alloy/core/components";
|
|
3
4
|
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
4
|
-
import { FunctionDeclaration } from "@alloy-js/typescript";
|
|
5
|
+
import { ElseClause, ElseIfClause, FunctionDeclaration, IfStatement } from "@alloy-js/typescript";
|
|
5
6
|
import { TypescriptFile } from "@powerlines/plugin-alloy/typescript";
|
|
6
7
|
import { joinPaths } from "@stryke/path";
|
|
7
8
|
import { TSDoc as TSDoc$1, TSDocParam } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
|
|
9
|
+
import { pascalCase } from "@stryke/string-format/pascal-case";
|
|
8
10
|
|
|
9
11
|
//#region src/components/help-command.tsx
|
|
10
12
|
/**
|
|
13
|
+
* 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.
|
|
14
|
+
*/
|
|
15
|
+
function TemporaryHelpCommand() {
|
|
16
|
+
const context = usePowerlines();
|
|
17
|
+
return createComponent(TypescriptFile, {
|
|
18
|
+
get path() {
|
|
19
|
+
return joinPaths(context.entryPath, "help", "command.ts");
|
|
20
|
+
},
|
|
21
|
+
get children() {
|
|
22
|
+
return [
|
|
23
|
+
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. `,
|
|
24
|
+
createComponent(Spacing, {}),
|
|
25
|
+
createComponent(TSDoc$1, {
|
|
26
|
+
heading: "Display command usage details and other useful information to the user.",
|
|
27
|
+
get children() {
|
|
28
|
+
return createComponent(TSDocParam, {
|
|
29
|
+
name: "segments",
|
|
30
|
+
children: `The command segments for the command to show help for. This is used to determine which command's help information to display. If no segments are provided, general help information about the CLI application will be displayed.`
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}),
|
|
34
|
+
createComponent(FunctionDeclaration, {
|
|
35
|
+
"export": true,
|
|
36
|
+
"default": true,
|
|
37
|
+
async: true,
|
|
38
|
+
name: "handler",
|
|
39
|
+
parameters: [{
|
|
40
|
+
name: "segments",
|
|
41
|
+
type: "string[]",
|
|
42
|
+
default: "[]"
|
|
43
|
+
}]
|
|
44
|
+
})
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
11
50
|
* The Help command's handler wrapper for the Shell Shock project.
|
|
12
51
|
*/
|
|
13
|
-
function HelpCommand() {
|
|
52
|
+
function HelpCommand(props) {
|
|
14
53
|
const context = usePowerlines();
|
|
54
|
+
const helpImports = computed(() => props.segments ? props.segments.reduce((ret, segments) => {
|
|
55
|
+
ret[joinPaths("help", ...segments)] = [{
|
|
56
|
+
name: "showHelp",
|
|
57
|
+
alias: `showHelp${segments.map((segment) => pascalCase(segment.replace(/-/g, ""))).join("")}`
|
|
58
|
+
}];
|
|
59
|
+
return ret;
|
|
60
|
+
}, {}) : {});
|
|
61
|
+
const commandSegmentsList = props.segments ?? [];
|
|
15
62
|
return createComponent(TypescriptFile, {
|
|
16
63
|
get path() {
|
|
17
64
|
return joinPaths(context.entryPath, "help", "command.ts");
|
|
@@ -20,28 +67,31 @@ function HelpCommand() {
|
|
|
20
67
|
"node:os": "os",
|
|
21
68
|
"node:fs/promises": ["readFile", "writeFile"]
|
|
22
69
|
},
|
|
23
|
-
builtinImports
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
70
|
+
get builtinImports() {
|
|
71
|
+
return {
|
|
72
|
+
...helpImports.value,
|
|
73
|
+
help: ["showHelp"],
|
|
74
|
+
console: [
|
|
75
|
+
"splitText",
|
|
76
|
+
"writeLine",
|
|
77
|
+
"inlineCode",
|
|
78
|
+
"textColors",
|
|
79
|
+
"inverse",
|
|
80
|
+
"bold",
|
|
81
|
+
"help",
|
|
82
|
+
"table",
|
|
83
|
+
"link"
|
|
84
|
+
]
|
|
85
|
+
};
|
|
86
|
+
},
|
|
34
87
|
get children() {
|
|
35
88
|
return [createComponent(TSDoc$1, {
|
|
36
89
|
heading: "Display command usage details and other useful information to the user.",
|
|
37
90
|
get children() {
|
|
38
|
-
return
|
|
39
|
-
name: "options",
|
|
40
|
-
children: `The options for the help command. This can include various flags and parameters to customize the behavior of the help command, such as specifying a particular command to show help for, or toggling the display of additional information.`
|
|
41
|
-
}), createComponent(TSDocParam, {
|
|
91
|
+
return createComponent(TSDocParam, {
|
|
42
92
|
name: "segments",
|
|
43
93
|
children: `The command segments for the command to show help for. This is used to determine which command's help information to display. If no segments are provided, general help information about the CLI application will be displayed.`
|
|
44
|
-
})
|
|
94
|
+
});
|
|
45
95
|
}
|
|
46
96
|
}), createComponent(FunctionDeclaration, {
|
|
47
97
|
"export": true,
|
|
@@ -53,12 +103,48 @@ function HelpCommand() {
|
|
|
53
103
|
type: "string[]",
|
|
54
104
|
default: "[]"
|
|
55
105
|
}],
|
|
56
|
-
children
|
|
106
|
+
get children() {
|
|
107
|
+
return createComponent(Show, {
|
|
108
|
+
get when() {
|
|
109
|
+
return commandSegmentsList.length > 0;
|
|
110
|
+
},
|
|
111
|
+
fallback: code`showHelp(); `,
|
|
112
|
+
get children() {
|
|
113
|
+
return [createComponent(For, {
|
|
114
|
+
each: commandSegmentsList,
|
|
115
|
+
doubleHardline: true,
|
|
116
|
+
children: (segments, index) => createComponent(Show, {
|
|
117
|
+
when: index > 0,
|
|
118
|
+
get fallback() {
|
|
119
|
+
return createComponent(IfStatement, {
|
|
120
|
+
get condition() {
|
|
121
|
+
return code`segments.join("/").toLowerCase() === "${segments.join("/").toLowerCase()}"`;
|
|
122
|
+
},
|
|
123
|
+
get children() {
|
|
124
|
+
return code` showHelp${segments.map((segment) => pascalCase(segment)).join("")}(); `;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
},
|
|
128
|
+
get children() {
|
|
129
|
+
return createComponent(ElseIfClause, {
|
|
130
|
+
get condition() {
|
|
131
|
+
return code`segments.join("/").toLowerCase() === "${segments.join("/").toLowerCase()}"`;
|
|
132
|
+
},
|
|
133
|
+
get children() {
|
|
134
|
+
return code` showHelp${segments.map((segment) => pascalCase(segment)).join("")}(); `;
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
}), createComponent(ElseClause, { children: code`showHelp(); ` })];
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
57
143
|
})];
|
|
58
144
|
}
|
|
59
145
|
});
|
|
60
146
|
}
|
|
61
147
|
|
|
62
148
|
//#endregion
|
|
63
|
-
export { HelpCommand };
|
|
149
|
+
export { HelpCommand, TemporaryHelpCommand };
|
|
64
150
|
//# sourceMappingURL=help-command.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help-command.mjs","names":[],"sources":["../../src/components/help-command.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code } from \"@alloy-js/core\";\nimport {
|
|
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 segments: 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.segments\n ? props.segments.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.segments ?? [];\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>\n );\n}\n"],"mappings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AA;IACb,UAAG;IACH,WAAG;IACH,OAAG;IACH,MAAG;IACH,YAAQ,CAAA;KACN,MAAM;KACN,MAAM;KACN,SAAK;KACP,CAAA;IACA,IAAA,WAAA;AACD,YAAM,gBAAiB,MAAQ;MAC7B,IAAA,OAAW;AACR,cAAI,oBAAyB,SAAQ;;MAEzC,UAAK,IAAA;MACN,IAAA,WAAA;AACC,cAAA,CAAA,gBAAA,KAAA;QACA,MAAA;QACA,gBAAA;QACM,WAAO,UAAA,UAAA,gBAAA,MAAA;SACH,MAAK,QAAO;SACrB,IAAA,WAAA;AACO,iBAAA,gBAA6B,aAAC;WAC1B,IAAK,YAAa;AACjB,mBAAA,IAAA,yCAAmC,SAAA,KAAA,IAAA,CAAA,aAAA,CAAA;;WAEzC,IAAA,WAAA;AACO,mBAAS,IAAA,YAAA,SAAA,KAAA,YAAA,WAAA,QAAA,CAAA,CAAA,KAAA,GAAA,CAAA;;WAEZ,CAAA;;SAED,IAAI,WAAS;AACX,iBAAG,gBAAiB,cAAA;WACnB,IAAK,YAAW;AACd,mBAAI,IAAQ,yCAAsB,SAAA,KAAA,IAAA,CAAA,aAAA,CAAA;;WAErC,IAAA,WAAW;AACd,mBAAA,IAAA,YAAA,SAAA,KAAA,YAAA,WAAA,QAAA,CAAA,CAAA,KAAA,GAAA,CAAA;;WAEC,CAAA;;SAED,CAAC;QACH,CAAC,EAAE,gBAAiB,YAAA,EACnB,UAAS,IAAA,gBACV,CAAC,CAAC;;MAEN,CAAC;;IAEL,CAAC,CAAC;;EAEN,CAAC"}
|
|
@@ -10,4 +10,5 @@ exports.HelpCommand = require_components_help_command.HelpCommand;
|
|
|
10
10
|
exports.HelpCommandsDisplay = require_components_display.HelpCommandsDisplay;
|
|
11
11
|
exports.HelpOptionsDisplay = require_components_display.HelpOptionsDisplay;
|
|
12
12
|
exports.HelpUsageDisplay = require_components_display.HelpUsageDisplay;
|
|
13
|
+
exports.TemporaryHelpCommand = require_components_help_command.TemporaryHelpCommand;
|
|
13
14
|
exports.VirtualCommandHelpDisplay = require_components_display.VirtualCommandHelpDisplay;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { BaseHelpDisplay, BaseHelpDisplayProps, CommandHelpDisplay, CommandHelpDisplayProps, HelpCommandsDisplay, HelpCommandsDisplayProps, HelpOptionsDisplay, HelpOptionsDisplayProps, HelpUsageDisplay, HelpUsageDisplayProps, VirtualCommandHelpDisplay, VirtualCommandHelpDisplayProps } from "./display.cjs";
|
|
2
2
|
import { HelpBuiltin, HelpBuiltinProps } from "./help-builtin.cjs";
|
|
3
|
-
import { HelpCommand } from "./help-command.cjs";
|
|
4
|
-
export { BaseHelpDisplay, BaseHelpDisplayProps, CommandHelpDisplay, CommandHelpDisplayProps, HelpBuiltin, HelpBuiltinProps, HelpCommand, HelpCommandsDisplay, HelpCommandsDisplayProps, HelpOptionsDisplay, HelpOptionsDisplayProps, HelpUsageDisplay, HelpUsageDisplayProps, VirtualCommandHelpDisplay, VirtualCommandHelpDisplayProps };
|
|
3
|
+
import { HelpCommand, HelpCommandsProps, TemporaryHelpCommand } from "./help-command.cjs";
|
|
4
|
+
export { BaseHelpDisplay, BaseHelpDisplayProps, CommandHelpDisplay, CommandHelpDisplayProps, HelpBuiltin, HelpBuiltinProps, HelpCommand, HelpCommandsDisplay, HelpCommandsDisplayProps, HelpCommandsProps, HelpOptionsDisplay, HelpOptionsDisplayProps, HelpUsageDisplay, HelpUsageDisplayProps, TemporaryHelpCommand, VirtualCommandHelpDisplay, VirtualCommandHelpDisplayProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { BaseHelpDisplay, BaseHelpDisplayProps, CommandHelpDisplay, CommandHelpDisplayProps, HelpCommandsDisplay, HelpCommandsDisplayProps, HelpOptionsDisplay, HelpOptionsDisplayProps, HelpUsageDisplay, HelpUsageDisplayProps, VirtualCommandHelpDisplay, VirtualCommandHelpDisplayProps } from "./display.mjs";
|
|
2
2
|
import { HelpBuiltin, HelpBuiltinProps } from "./help-builtin.mjs";
|
|
3
|
-
import { HelpCommand } from "./help-command.mjs";
|
|
4
|
-
export { BaseHelpDisplay, BaseHelpDisplayProps, CommandHelpDisplay, CommandHelpDisplayProps, HelpBuiltin, HelpBuiltinProps, HelpCommand, HelpCommandsDisplay, HelpCommandsDisplayProps, HelpOptionsDisplay, HelpOptionsDisplayProps, HelpUsageDisplay, HelpUsageDisplayProps, VirtualCommandHelpDisplay, VirtualCommandHelpDisplayProps };
|
|
3
|
+
import { HelpCommand, HelpCommandsProps, TemporaryHelpCommand } from "./help-command.mjs";
|
|
4
|
+
export { BaseHelpDisplay, BaseHelpDisplayProps, CommandHelpDisplay, CommandHelpDisplayProps, HelpBuiltin, HelpBuiltinProps, HelpCommand, HelpCommandsDisplay, HelpCommandsDisplayProps, HelpCommandsProps, HelpOptionsDisplay, HelpOptionsDisplayProps, HelpUsageDisplay, HelpUsageDisplayProps, TemporaryHelpCommand, VirtualCommandHelpDisplay, VirtualCommandHelpDisplayProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseHelpDisplay, CommandHelpDisplay, HelpCommandsDisplay, HelpOptionsDisplay, HelpUsageDisplay, VirtualCommandHelpDisplay } from "./display.mjs";
|
|
2
2
|
import { HelpBuiltin } from "./help-builtin.mjs";
|
|
3
|
-
import { HelpCommand } from "./help-command.mjs";
|
|
3
|
+
import { HelpCommand, TemporaryHelpCommand } from "./help-command.mjs";
|
|
4
4
|
|
|
5
|
-
export { BaseHelpDisplay, CommandHelpDisplay, HelpBuiltin, HelpCommand, HelpCommandsDisplay, HelpOptionsDisplay, HelpUsageDisplay, VirtualCommandHelpDisplay };
|
|
5
|
+
export { BaseHelpDisplay, CommandHelpDisplay, HelpBuiltin, HelpCommand, HelpCommandsDisplay, HelpOptionsDisplay, HelpUsageDisplay, TemporaryHelpCommand, VirtualCommandHelpDisplay };
|
package/dist/index.cjs
CHANGED
|
@@ -12,6 +12,7 @@ let _shell_shock_plugin_console = require("@shell-shock/plugin-console");
|
|
|
12
12
|
_shell_shock_plugin_console = require_runtime.__toESM(_shell_shock_plugin_console);
|
|
13
13
|
let _shell_shock_plugin_theme = require("@shell-shock/plugin-theme");
|
|
14
14
|
_shell_shock_plugin_theme = require_runtime.__toESM(_shell_shock_plugin_theme);
|
|
15
|
+
let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
15
16
|
let _stryke_path_join = require("@stryke/path/join");
|
|
16
17
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
17
18
|
let defu = require("defu");
|
|
@@ -24,7 +25,7 @@ defu = require_runtime.__toESM(defu);
|
|
|
24
25
|
const plugin = (options = {}) => {
|
|
25
26
|
return [
|
|
26
27
|
...(0, _shell_shock_plugin_theme.default)(options.theme),
|
|
27
|
-
(0, _shell_shock_plugin_console.default)(options.console),
|
|
28
|
+
...(0, _shell_shock_plugin_console.default)(options.console),
|
|
28
29
|
{
|
|
29
30
|
name: "shell-shock:help",
|
|
30
31
|
enforce: "post",
|
|
@@ -53,7 +54,7 @@ const plugin = (options = {}) => {
|
|
|
53
54
|
source: "help-plugin",
|
|
54
55
|
...this.config.help.command
|
|
55
56
|
});
|
|
56
|
-
await (0, _powerlines_plugin_alloy_render.render)(this, (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_help_command.
|
|
57
|
+
await (0, _powerlines_plugin_alloy_render.render)(this, (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_help_command.TemporaryHelpCommand, {}));
|
|
57
58
|
}
|
|
58
59
|
},
|
|
59
60
|
prepare: {
|
|
@@ -62,22 +63,7 @@ const plugin = (options = {}) => {
|
|
|
62
63
|
const _self$ = this;
|
|
63
64
|
const commands = await (0, _shell_shock_core_plugin_utils.getCommandList)(this);
|
|
64
65
|
this.debug(`Rendering \`help\` built-ins for each of the ${commands.length} command modules.`);
|
|
65
|
-
const
|
|
66
|
-
id: "",
|
|
67
|
-
name: (0, _shell_shock_core_plugin_utils.getAppName)(this),
|
|
68
|
-
title: (0, _shell_shock_core_plugin_utils.getAppTitle)(this),
|
|
69
|
-
description: (0, _shell_shock_core_plugin_utils.getAppDescription)(this),
|
|
70
|
-
isVirtual: true,
|
|
71
|
-
path: null,
|
|
72
|
-
segments: [],
|
|
73
|
-
alias: [],
|
|
74
|
-
tags: [],
|
|
75
|
-
options: Object.fromEntries(this.options.map((option) => [option.name, option])),
|
|
76
|
-
entry: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "bin.ts") },
|
|
77
|
-
args: [],
|
|
78
|
-
parent: null,
|
|
79
|
-
children: this.commands
|
|
80
|
-
}));
|
|
66
|
+
const segments = (0, _alloy_js_core.computed)(() => (0, _stryke_helpers_get_unique.getUniqueBy)(commands.map((command) => command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)).filter((segment) => segment.length > 0)), (segments) => segments.join("/")).filter((segments) => segments.length > 0).sort((a, b) => a.join("/").localeCompare(b.join("/"))));
|
|
81
67
|
return (0, _powerlines_plugin_alloy_render.render)(this, [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
82
68
|
get when() {
|
|
83
69
|
return _self$.config.help.builtins !== false;
|
|
@@ -85,7 +71,7 @@ const plugin = (options = {}) => {
|
|
|
85
71
|
get children() {
|
|
86
72
|
return [
|
|
87
73
|
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_help_builtin.HelpBuiltin, { get command() {
|
|
88
|
-
return
|
|
74
|
+
return (0, _shell_shock_core_plugin_utils.computeBin)(_self$);
|
|
89
75
|
} }),
|
|
90
76
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
|
|
91
77
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
@@ -94,7 +80,10 @@ const plugin = (options = {}) => {
|
|
|
94
80
|
},
|
|
95
81
|
doubleHardline: true,
|
|
96
82
|
children: (command) => (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_help_builtin.HelpBuiltin, { command })
|
|
97
|
-
})
|
|
83
|
+
}),
|
|
84
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_help_command.HelpCommand, { get segments() {
|
|
85
|
+
return segments.value;
|
|
86
|
+
} })
|
|
98
87
|
];
|
|
99
88
|
}
|
|
100
89
|
})]);
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AA0CA;cAAa,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AA0CA;cAAa,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.d.mts.map
CHANGED
|
@@ -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,
|
|
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"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { HelpBuiltin } from "./components/help-builtin.mjs";
|
|
2
|
-
import { HelpCommand } from "./components/help-command.mjs";
|
|
2
|
+
import { HelpCommand, TemporaryHelpCommand } from "./components/help-command.mjs";
|
|
3
3
|
import "./components/index.mjs";
|
|
4
4
|
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
5
5
|
import { For, Show, computed } from "@alloy-js/core";
|
|
6
6
|
import { Spacing } from "@powerlines/plugin-alloy/core/components";
|
|
7
7
|
import { render } from "@powerlines/plugin-alloy/render";
|
|
8
|
-
import {
|
|
8
|
+
import { computeBin, getCommandList, isDynamicPathSegment } from "@shell-shock/core/plugin-utils";
|
|
9
9
|
import console from "@shell-shock/plugin-console";
|
|
10
10
|
import theme from "@shell-shock/plugin-theme";
|
|
11
|
+
import { getUniqueBy } from "@stryke/helpers/get-unique";
|
|
11
12
|
import { joinPaths } from "@stryke/path/join";
|
|
12
13
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
13
14
|
import defu from "defu";
|
|
@@ -19,7 +20,7 @@ import defu from "defu";
|
|
|
19
20
|
const plugin = (options = {}) => {
|
|
20
21
|
return [
|
|
21
22
|
...theme(options.theme),
|
|
22
|
-
console(options.console),
|
|
23
|
+
...console(options.console),
|
|
23
24
|
{
|
|
24
25
|
name: "shell-shock:help",
|
|
25
26
|
enforce: "post",
|
|
@@ -48,7 +49,7 @@ const plugin = (options = {}) => {
|
|
|
48
49
|
source: "help-plugin",
|
|
49
50
|
...this.config.help.command
|
|
50
51
|
});
|
|
51
|
-
await render(this, createComponent(
|
|
52
|
+
await render(this, createComponent(TemporaryHelpCommand, {}));
|
|
52
53
|
}
|
|
53
54
|
},
|
|
54
55
|
prepare: {
|
|
@@ -57,22 +58,7 @@ const plugin = (options = {}) => {
|
|
|
57
58
|
const _self$ = this;
|
|
58
59
|
const commands = await getCommandList(this);
|
|
59
60
|
this.debug(`Rendering \`help\` built-ins for each of the ${commands.length} command modules.`);
|
|
60
|
-
const
|
|
61
|
-
id: "",
|
|
62
|
-
name: getAppName(this),
|
|
63
|
-
title: getAppTitle(this),
|
|
64
|
-
description: getAppDescription(this),
|
|
65
|
-
isVirtual: true,
|
|
66
|
-
path: null,
|
|
67
|
-
segments: [],
|
|
68
|
-
alias: [],
|
|
69
|
-
tags: [],
|
|
70
|
-
options: Object.fromEntries(this.options.map((option) => [option.name, option])),
|
|
71
|
-
entry: { file: joinPaths(this.entryPath, "bin.ts") },
|
|
72
|
-
args: [],
|
|
73
|
-
parent: null,
|
|
74
|
-
children: this.commands
|
|
75
|
-
}));
|
|
61
|
+
const segments = computed(() => getUniqueBy(commands.map((command) => command.segments.filter((segment) => !isDynamicPathSegment(segment)).filter((segment) => segment.length > 0)), (segments) => segments.join("/")).filter((segments) => segments.length > 0).sort((a, b) => a.join("/").localeCompare(b.join("/"))));
|
|
76
62
|
return render(this, [createComponent(Show, {
|
|
77
63
|
get when() {
|
|
78
64
|
return _self$.config.help.builtins !== false;
|
|
@@ -80,7 +66,7 @@ const plugin = (options = {}) => {
|
|
|
80
66
|
get children() {
|
|
81
67
|
return [
|
|
82
68
|
createComponent(HelpBuiltin, { get command() {
|
|
83
|
-
return
|
|
69
|
+
return computeBin(_self$);
|
|
84
70
|
} }),
|
|
85
71
|
createComponent(Spacing, {}),
|
|
86
72
|
createComponent(For, {
|
|
@@ -89,7 +75,10 @@ const plugin = (options = {}) => {
|
|
|
89
75
|
},
|
|
90
76
|
doubleHardline: true,
|
|
91
77
|
children: (command) => createComponent(HelpBuiltin, { command })
|
|
92
|
-
})
|
|
78
|
+
}),
|
|
79
|
+
createComponent(HelpCommand, { get segments() {
|
|
80
|
+
return segments.value;
|
|
81
|
+
} })
|
|
93
82
|
];
|
|
94
83
|
}
|
|
95
84
|
})]);
|
package/dist/index.mjs.map
CHANGED
|
@@ -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
|
|
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 =>\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 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 segments={segments.value} />\n </Show>\n </>\n );\n }\n }\n }\n ];\n};\n\n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,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;AAC/C,YAAM,OAAQ,MAAK,CAAA,gBAAA,MAAA;MACjB,IAAI,OAAO;AACT,cAAO,OAAG,OAAS,KAAA,aAAA;;MAErB,IAAI,WAAO;AACT,cAAI;QAAI,gBAAiB,aAAY,EACnC,IAAE,UAAO;AACP,gBAAO,WAAW,OAAK;WAE1B,CAAC;QAAC,gBAAA,SAAA,EAAA,CAAA;QAAA,gBAAA,KAAA;SACD,IAAA,OAAW;AACX,iBAAS,SAAK,MAAO,GAAA,MAAA,EAAA,KAAA,cAAA,EAAA,KAAA,CAAA;;SAErB,gBAAA;SACJ,WAAA,YAAA,gBAAA,aAAA,WAEK,CAAC;SACR,CAAA;QAAA,gBAAA,aAAA,EACD,IAAA,WAAA;AACQ,gBAAA,SAAA;WAEF,CAAC;QAAA;;MAEL,CAAC,CAAA,CAAA;;IAEL;GACF;EAAC"}
|
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.24",
|
|
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": [
|
|
@@ -44,32 +44,6 @@
|
|
|
44
44
|
}
|
|
45
45
|
],
|
|
46
46
|
"type": "module",
|
|
47
|
-
"main": "./dist/index.cjs",
|
|
48
|
-
"module": "./dist/index.mjs",
|
|
49
|
-
"types": "./dist/index.d.cts",
|
|
50
|
-
"typings": "dist/index.d.mts",
|
|
51
|
-
"files": ["dist/**/*"],
|
|
52
|
-
"dependencies": {
|
|
53
|
-
"@alloy-js/core": "0.23.0-dev.8",
|
|
54
|
-
"@alloy-js/typescript": "0.23.0-dev.4",
|
|
55
|
-
"@powerlines/deepkit": "^0.8.1",
|
|
56
|
-
"@powerlines/plugin-alloy": "^0.26.16",
|
|
57
|
-
"@powerlines/plugin-plugin": "^0.12.348",
|
|
58
|
-
"@shell-shock/core": "^0.17.4",
|
|
59
|
-
"@shell-shock/plugin-theme": "^0.4.17",
|
|
60
|
-
"@shell-shock/plugin-console": "^0.2.8",
|
|
61
|
-
"@stryke/string-format": "^0.17.9",
|
|
62
|
-
"@stryke/type-checks": "^0.6.1",
|
|
63
|
-
"@stryke/path": "^0.27.4",
|
|
64
|
-
"@stryke/types": "^0.11.3",
|
|
65
|
-
"defu": "^6.1.7",
|
|
66
|
-
"powerlines": "^0.42.38"
|
|
67
|
-
},
|
|
68
|
-
"devDependencies": {
|
|
69
|
-
"@powerlines/plugin-deepkit": "^0.11.278",
|
|
70
|
-
"@types/node": "^25.6.0"
|
|
71
|
-
},
|
|
72
|
-
"publishConfig": { "access": "public" },
|
|
73
47
|
"exports": {
|
|
74
48
|
".": {
|
|
75
49
|
"require": {
|
|
@@ -171,5 +145,32 @@
|
|
|
171
145
|
}
|
|
172
146
|
}
|
|
173
147
|
},
|
|
174
|
-
"
|
|
148
|
+
"main": "./dist/index.cjs",
|
|
149
|
+
"module": "./dist/index.mjs",
|
|
150
|
+
"types": "./dist/index.d.cts",
|
|
151
|
+
"typings": "dist/index.d.mts",
|
|
152
|
+
"files": ["dist/**/*"],
|
|
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.2",
|
|
157
|
+
"@powerlines/plugin-alloy": "^0.26.18",
|
|
158
|
+
"@powerlines/plugin-plugin": "^0.12.350",
|
|
159
|
+
"@shell-shock/core": "^0.17.6",
|
|
160
|
+
"@shell-shock/plugin-console": "^0.2.10",
|
|
161
|
+
"@shell-shock/plugin-theme": "^0.4.19",
|
|
162
|
+
"@stryke/helpers": "^0.10.8",
|
|
163
|
+
"@stryke/path": "^0.27.4",
|
|
164
|
+
"@stryke/string-format": "^0.17.9",
|
|
165
|
+
"@stryke/type-checks": "^0.6.1",
|
|
166
|
+
"@stryke/types": "^0.11.3",
|
|
167
|
+
"defu": "^6.1.7",
|
|
168
|
+
"powerlines": "^0.42.40"
|
|
169
|
+
},
|
|
170
|
+
"devDependencies": {
|
|
171
|
+
"@powerlines/plugin-deepkit": "^0.11.280",
|
|
172
|
+
"@types/node": "^25.6.0"
|
|
173
|
+
},
|
|
174
|
+
"publishConfig": { "access": "public" },
|
|
175
|
+
"gitHead": "592aee8162fccb2d8547f6cf31b820aca3ae13ec"
|
|
175
176
|
}
|