@shell-shock/plugin-banner 0.1.0
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/LICENSE +201 -0
- package/README.md +264 -0
- package/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/_virtual/_rolldown/runtime.mjs +3 -0
- package/dist/components/banner-builtin.cjs +64 -0
- package/dist/components/banner-builtin.d.cts +18 -0
- package/dist/components/banner-builtin.d.cts.map +1 -0
- package/dist/components/banner-builtin.d.mts +18 -0
- package/dist/components/banner-builtin.d.mts.map +1 -0
- package/dist/components/banner-builtin.mjs +62 -0
- package/dist/components/banner-builtin.mjs.map +1 -0
- package/dist/components/banner-function-declaration.cjs +136 -0
- package/dist/components/banner-function-declaration.d.cts +47 -0
- package/dist/components/banner-function-declaration.d.cts.map +1 -0
- package/dist/components/banner-function-declaration.d.mts +47 -0
- package/dist/components/banner-function-declaration.d.mts.map +1 -0
- package/dist/components/banner-function-declaration.mjs +133 -0
- package/dist/components/banner-function-declaration.mjs.map +1 -0
- package/dist/components/index.cjs +8 -0
- package/dist/components/index.d.cts +3 -0
- package/dist/components/index.d.mts +3 -0
- package/dist/components/index.mjs +4 -0
- package/dist/index.cjs +68 -0
- package/dist/index.d.cts +11 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +11 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +64 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/index.cjs +0 -0
- package/dist/types/index.d.cts +2 -0
- package/dist/types/index.d.mts +2 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/plugin.cjs +0 -0
- package/dist/types/plugin.d.cts +22 -0
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +22 -0
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.mjs +1 -0
- package/package.json +158 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { BannerFunctionDeclaration } from "./banner-function-declaration.mjs";
|
|
2
|
+
import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
3
|
+
import { Show, splitProps } from "@alloy-js/core";
|
|
4
|
+
import { getAppTitle, isDynamicPathSegment } from "@shell-shock/core/plugin-utils";
|
|
5
|
+
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
6
|
+
import { BuiltinFile } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
|
|
7
|
+
import { joinPaths } from "@stryke/path";
|
|
8
|
+
import defu from "defu";
|
|
9
|
+
|
|
10
|
+
//#region src/components/banner-builtin.tsx
|
|
11
|
+
/**
|
|
12
|
+
* A built-in banner module for Shell Shock.
|
|
13
|
+
*/
|
|
14
|
+
function BannerBuiltin(props) {
|
|
15
|
+
const [{ command, children }, rest] = splitProps(props, ["command", "children"]);
|
|
16
|
+
const context = usePowerlines();
|
|
17
|
+
return createComponent(BuiltinFile, mergeProps({
|
|
18
|
+
get id() {
|
|
19
|
+
return joinPaths("banner", ...command.segments.filter((segment) => !isDynamicPathSegment(segment)));
|
|
20
|
+
},
|
|
21
|
+
get description() {
|
|
22
|
+
return memo(() => !!command.path)() ? `A collection of utility functions that assist in displaying banner information for the ${command.title} command.` : `A collection of utility functions that assist in displaying banner information for the ${getAppTitle(context, true)} command-line interface application.`;
|
|
23
|
+
}
|
|
24
|
+
}, rest, {
|
|
25
|
+
get builtinImports() {
|
|
26
|
+
return defu(rest.builtinImports ?? {}, {
|
|
27
|
+
utils: [
|
|
28
|
+
"isUnicodeSupported",
|
|
29
|
+
"useApp",
|
|
30
|
+
"hasFlag",
|
|
31
|
+
"isMinimal",
|
|
32
|
+
"sleep",
|
|
33
|
+
"isInteractive",
|
|
34
|
+
"isHelp"
|
|
35
|
+
],
|
|
36
|
+
console: [
|
|
37
|
+
"splitText",
|
|
38
|
+
"writeLine",
|
|
39
|
+
"colors",
|
|
40
|
+
"help",
|
|
41
|
+
"table",
|
|
42
|
+
"stripAnsi"
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
get children() {
|
|
47
|
+
return createComponent(Show, {
|
|
48
|
+
get when() {
|
|
49
|
+
return Boolean(children);
|
|
50
|
+
},
|
|
51
|
+
get fallback() {
|
|
52
|
+
return createComponent(BannerFunctionDeclaration, { command });
|
|
53
|
+
},
|
|
54
|
+
children
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
export { BannerBuiltin };
|
|
62
|
+
//# sourceMappingURL=banner-builtin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner-builtin.mjs","names":[],"sources":["../../src/components/banner-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Show, splitProps } from \"@alloy-js/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { BuiltinFileProps } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport { BuiltinFile } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport type { CommandTree } from \"@shell-shock/core\";\nimport {\n getAppTitle,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport defu from \"defu\";\nimport type { BannerPluginContext } from \"../types\";\nimport { BannerFunctionDeclaration } from \"./banner-function-declaration\";\n\nexport type BannerBuiltinProps = Omit<\n BuiltinFileProps,\n \"id\" | \"description\"\n> & {\n /**\n * The command to generate the `banner` function declaration for.\n */\n command: CommandTree;\n};\n\n/**\n * A built-in banner module for Shell Shock.\n */\nexport function BannerBuiltin(props: BannerBuiltinProps) {\n const [{ command, children }, rest] = splitProps(props, [\n \"command\",\n \"children\"\n ]);\n const context = usePowerlines<BannerPluginContext>();\n\n return (\n <BuiltinFile\n id={joinPaths(\n \"banner\",\n ...command.segments.filter(segment => !isDynamicPathSegment(segment))\n )}\n description={\n command.path\n ? `A collection of utility functions that assist in displaying banner information for the ${command.title} command.`\n : `A collection of utility functions that assist in displaying banner information for the ${getAppTitle(\n context,\n true\n )} command-line interface application.`\n }\n {...rest}\n builtinImports={defu(rest.builtinImports ?? {}, {\n utils: [\n \"isUnicodeSupported\",\n \"useApp\",\n \"hasFlag\",\n \"isMinimal\",\n \"sleep\",\n \"isInteractive\",\n \"isHelp\"\n ],\n console: [\n \"splitText\",\n \"writeLine\",\n \"colors\",\n \"help\",\n \"table\",\n \"stripAnsi\"\n ]\n })}>\n <Show\n when={Boolean(children)}\n fallback={<BannerFunctionDeclaration command={command} />}>\n {children}\n </Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAuCA,SAAW,cAAW,OAAA;CACrB,MAAA,CAAA,WAEC,YACG,QAAQ,WAAQ,OAAU,CAAC,WAAW,WAAA,CAAA;CACzC,MAAA,UAAA,eAAA;AACF,QAAO,gBAAS,aAAqB,WAAA;EACnC,IAAM,KAAG;AACN,UAAQ,UAAA,UAAA,GAAA,QAAA,SAAA,QAAA,YAAA,CAAA,qBAAA,QAAA,CAAA,CAAA;;EAET,IAAA,cAAA;AACF,UAAM,WAAU,CAAA,CAAA,QAAc,KAAA,EAAA,GAAA,0FAAsB,QAAA,MAAA,aAAA,0FAAA,YAAA,SAAA,KAAA,CAAA;;EAEpD,EAAA,MAAO;EACL,IAAC,iBAAA;AACC,UAAI,KAAA,KAAS,kBAAA,EAAA,EAAA;IACX,OAAO;KAAC;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IACR,SAAG;KAAO;KAAU;KAAgB;KAAG;KAAA;KAAqB;KAAQ;IACrE,CAAA;;EAEH,IAAI,WAAQ;AACV,UAAO,gBAAgB,MAAQ;IAC7B,IAAI,OAAG;AACL,YAAI,QAAO,SAAA;;IAEb,IAAI,WAAW;AACjB,YAAA,gBAAA,2BAAA,EACQ,SACR,CAAA;;IAEK;IACJ,CAAC;;EAEL,CAAC,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
5
|
+
let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
6
|
+
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
7
|
+
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
8
|
+
let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
9
|
+
let _shell_shock_plugin_theme_contexts_theme = require("@shell-shock/plugin-theme/contexts/theme");
|
|
10
|
+
|
|
11
|
+
//#region src/components/banner-function-declaration.tsx
|
|
12
|
+
/**
|
|
13
|
+
* A component to generate the `banner` function for a specific command or application.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
|
|
17
|
+
*/
|
|
18
|
+
function BannerFunctionDeclarationWrapper(props) {
|
|
19
|
+
const { command, children } = props;
|
|
20
|
+
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
21
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
22
|
+
"export": true,
|
|
23
|
+
async: true,
|
|
24
|
+
name: "showBanner",
|
|
25
|
+
get doc() {
|
|
26
|
+
return `Write the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} command-line interface application banner ${command ? `for the ${command.title} command ` : ""}to the console.`;
|
|
27
|
+
},
|
|
28
|
+
parameters: [{
|
|
29
|
+
name: "sleepTimeoutMs",
|
|
30
|
+
type: "number",
|
|
31
|
+
default: 500
|
|
32
|
+
}],
|
|
33
|
+
get children() {
|
|
34
|
+
return [children, (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
35
|
+
condition: _alloy_js_core.code`isInteractive && !isHelp`,
|
|
36
|
+
children: _alloy_js_core.code`await sleep(sleepTimeoutMs);`
|
|
37
|
+
})];
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A component to generate the `banner` function's body for a specific command or application.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
|
|
46
|
+
*/
|
|
47
|
+
function BannerFunctionBodyDeclaration(props) {
|
|
48
|
+
const { consoleFnName = "log", variant = "primary", title, header, footer, description, command, children, insertNewlineBeforeCommand = false, insertNewlineBeforeBanner = true, insertNewlineAfterDescription = false } = props;
|
|
49
|
+
const theme = (0, _shell_shock_plugin_theme_contexts_theme.useTheme)();
|
|
50
|
+
const bannerPadding = (0, _alloy_js_core.computed)(() => Math.max(theme.padding.app, 0) * 2 + theme.borderStyles.banner.outline[variant].left.length + theme.borderStyles.banner.outline[variant].right.length);
|
|
51
|
+
const totalPadding = (0, _alloy_js_core.computed)(() => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value);
|
|
52
|
+
return [
|
|
53
|
+
_alloy_js_core.code`
|
|
54
|
+
if (useApp().get("banner") || hasFlag("no-banner") || hasFlag("hide-banner") || isMinimal) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
useApp().set("banner", true); `,
|
|
59
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
60
|
+
children,
|
|
61
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
62
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
63
|
+
when: insertNewlineBeforeBanner,
|
|
64
|
+
children: _alloy_js_core.code`writeLine(""); `
|
|
65
|
+
}),
|
|
66
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
67
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
|
|
68
|
+
writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].topLeft}") + ${theme.icons.banner.header[variant] ? `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}".repeat(6)) + " " + ${theme.icons.banner.header[variant] ? `colors.text.banner.header.${variant}("${theme.icons.banner.header[variant]}") + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}") + " " +` : ""} colors.bold(colors.text.banner.header.${variant}("${header}")) + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}".repeat(Math.max(process.stdout.columns - ${6 + (theme.icons.banner.header[variant] ? theme.icons.banner.header[variant].length + 3 : 0) + (header ? header.length + 2 : 0) + bannerPadding.value}, 0)))` : `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}".repeat(Math.max(process.stdout.columns - ${bannerPadding.value}, 0)))`} + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].topRight}"), { consoleFn: console.${consoleFnName} });
|
|
69
|
+
|
|
70
|
+
splitText(
|
|
71
|
+
${title ? `"${title}"` : "title"},
|
|
72
|
+
Math.max(process.stdout.columns - ${totalPadding.value}, 0)
|
|
73
|
+
).forEach((line) => {
|
|
74
|
+
writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.bold(colors.text.banner.title.${variant}(line)) + " ".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} });
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
${command?.title ? `${insertNewlineBeforeCommand ? `writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(process.stdout.columns - ${bannerPadding.value})) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} }); ` : ""}
|
|
78
|
+
${`writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi("${command.title}").length ${command.icon ? " + 3" : ""} + ${bannerPadding.value})) / 2), 0)) + colors.bold(colors.text.banner.command.${variant}("${command.icon ? `${command.icon} ` : ""}${command.title}")) + " ".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi("${command.title}").length ${command.icon ? " + 3" : ""} + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} }); `} ` : ""}
|
|
79
|
+
|
|
80
|
+
splitText(
|
|
81
|
+
colors.bold(${command?.title ? "colors.text.banner.description" : "colors.text.banner.command"}.${variant}("${description.replace(/"/g, "\\\"")}")),
|
|
82
|
+
Math.max(process.stdout.columns - ${totalPadding.value}, 0)
|
|
83
|
+
).forEach((line) => {
|
|
84
|
+
writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.text.banner.description.${variant}(line) + " ".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} });
|
|
85
|
+
});
|
|
86
|
+
${insertNewlineAfterDescription ? `writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(process.stdout.columns - ${bannerPadding.value})) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} });` : ""}
|
|
87
|
+
writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottomLeft}") + ${footer ? `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottom}".repeat(Math.max(process.stdout.columns - ${8 + (footer ? footer.length : 0) + bannerPadding.value}, 0))) + " " + ${footer ? `colors.bold(colors.text.banner.footer.${variant}("${footer}"))` : ""} + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottom}".repeat(6))` : `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottom}".repeat(Math.max(process.stdout.columns - ${bannerPadding.value}, 0)))`} + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottomRight}"), { consoleFn: console.${consoleFnName} });
|
|
88
|
+
|
|
89
|
+
writeLine(""); `)
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* A component to generate the `banner` function for a specific command or application.
|
|
94
|
+
*
|
|
95
|
+
* @remarks
|
|
96
|
+
* This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
|
|
97
|
+
*/
|
|
98
|
+
function BannerFunctionDeclaration(props) {
|
|
99
|
+
const { consoleFnName = "log", variant = "primary", command, children, insertNewlineBeforeBanner = true } = props;
|
|
100
|
+
const theme = (0, _shell_shock_plugin_theme_contexts_theme.useTheme)();
|
|
101
|
+
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
102
|
+
const header = (0, _alloy_js_core.computed)(() => `${theme.labels.banner.header[variant] || (0, _shell_shock_core_plugin_utils.getAppTitle)(context, false)} v${context.packageJson.version || "1.0.0"}`);
|
|
103
|
+
const footer = (0, _alloy_js_core.computed)(() => theme.labels.banner.footer[variant]);
|
|
104
|
+
const title = (0, _alloy_js_core.computed)(() => (0, _shell_shock_core_plugin_utils.getAppTitle)(context, true).replace(`v${context.packageJson.version || "1.0.0"}`, ""));
|
|
105
|
+
const description = (0, _alloy_js_core.computed)(() => command?.description || (0, _shell_shock_core_plugin_utils.getAppDescription)(context));
|
|
106
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(BannerFunctionDeclarationWrapper, {
|
|
107
|
+
command,
|
|
108
|
+
get children() {
|
|
109
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(BannerFunctionBodyDeclaration, {
|
|
110
|
+
get title() {
|
|
111
|
+
return title.value;
|
|
112
|
+
},
|
|
113
|
+
get header() {
|
|
114
|
+
return header.value;
|
|
115
|
+
},
|
|
116
|
+
get description() {
|
|
117
|
+
return description.value;
|
|
118
|
+
},
|
|
119
|
+
get footer() {
|
|
120
|
+
return footer.value;
|
|
121
|
+
},
|
|
122
|
+
variant,
|
|
123
|
+
consoleFnName,
|
|
124
|
+
command,
|
|
125
|
+
insertNewlineBeforeCommand: true,
|
|
126
|
+
insertNewlineBeforeBanner,
|
|
127
|
+
children
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
//#endregion
|
|
134
|
+
exports.BannerFunctionBodyDeclaration = BannerFunctionBodyDeclaration;
|
|
135
|
+
exports.BannerFunctionDeclaration = BannerFunctionDeclaration;
|
|
136
|
+
exports.BannerFunctionDeclarationWrapper = BannerFunctionDeclarationWrapper;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Children } from "@alloy-js/core";
|
|
2
|
+
import { CommandTree } from "@shell-shock/core/types/command";
|
|
3
|
+
import { ThemeColorVariant } from "@shell-shock/plugin-theme/types/theme";
|
|
4
|
+
|
|
5
|
+
//#region src/components/banner-function-declaration.d.ts
|
|
6
|
+
interface BannerFunctionDeclarationWrapperProps {
|
|
7
|
+
command?: CommandTree;
|
|
8
|
+
children?: Children;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A component to generate the `banner` function for a specific command or application.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
|
|
15
|
+
*/
|
|
16
|
+
declare function BannerFunctionDeclarationWrapper(props: BannerFunctionDeclarationWrapperProps): Children;
|
|
17
|
+
interface BannerFunctionBodyDeclarationProps extends BannerFunctionDeclarationProps {
|
|
18
|
+
title?: string;
|
|
19
|
+
header?: string;
|
|
20
|
+
footer?: string;
|
|
21
|
+
description: string;
|
|
22
|
+
insertNewlineBeforeCommand?: boolean;
|
|
23
|
+
insertNewlineBeforeBanner?: boolean;
|
|
24
|
+
insertNewlineAfterDescription?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A component to generate the `banner` function's body for a specific command or application.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
|
|
31
|
+
*/
|
|
32
|
+
declare function BannerFunctionBodyDeclaration(props: BannerFunctionBodyDeclarationProps): Children;
|
|
33
|
+
interface BannerFunctionDeclarationProps extends BannerFunctionDeclarationWrapperProps {
|
|
34
|
+
variant?: ThemeColorVariant;
|
|
35
|
+
consoleFnName?: "log" | "info" | "warn" | "error" | "debug";
|
|
36
|
+
insertNewlineBeforeBanner?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A component to generate the `banner` function for a specific command or application.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
|
|
43
|
+
*/
|
|
44
|
+
declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps): Children;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { BannerFunctionBodyDeclaration, BannerFunctionBodyDeclarationProps, BannerFunctionDeclaration, BannerFunctionDeclarationProps, BannerFunctionDeclarationWrapper, BannerFunctionDeclarationWrapperProps };
|
|
47
|
+
//# sourceMappingURL=banner-function-declaration.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner-function-declaration.d.cts","names":[],"sources":["../../src/components/banner-function-declaration.tsx"],"mappings":";;;;;UA6BiB,qCAAA;EACf,OAAA,GAAU,WAAA;EACV,QAAA,GAAW,QAAA;AAAA;;;;;;;iBASG,gCAAA,CACd,KAAA,EAAO,qCAAA,GAAqC,QAAA;AAAA,UAuB7B,kCAAA,SAA2C,8BAAA;EAC1D,KAAA;EACA,MAAA;EACA,MAAA;EACA,WAAA;EACA,0BAAA;EACA,yBAAA;EACA,6BAAA;AAAA;;AAPF;;;;;iBAgBgB,6BAAA,CACd,KAAA,EAAO,kCAAA,GAAkC,QAAA;AAAA,UAqL1B,8BAAA,SAAuC,qCAAA;EACtD,OAAA,GAAU,iBAAA;EACV,aAAA;EACA,yBAAA;AAAA;;;;AAzLF;;;iBAkMgB,yBAAA,CACd,KAAA,EAAO,8BAAA,GAA8B,QAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Children } from "@alloy-js/core";
|
|
2
|
+
import { CommandTree } from "@shell-shock/core/types/command";
|
|
3
|
+
import { ThemeColorVariant } from "@shell-shock/plugin-theme/types/theme";
|
|
4
|
+
|
|
5
|
+
//#region src/components/banner-function-declaration.d.ts
|
|
6
|
+
interface BannerFunctionDeclarationWrapperProps {
|
|
7
|
+
command?: CommandTree;
|
|
8
|
+
children?: Children;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A component to generate the `banner` function for a specific command or application.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
|
|
15
|
+
*/
|
|
16
|
+
declare function BannerFunctionDeclarationWrapper(props: BannerFunctionDeclarationWrapperProps): Children;
|
|
17
|
+
interface BannerFunctionBodyDeclarationProps extends BannerFunctionDeclarationProps {
|
|
18
|
+
title?: string;
|
|
19
|
+
header?: string;
|
|
20
|
+
footer?: string;
|
|
21
|
+
description: string;
|
|
22
|
+
insertNewlineBeforeCommand?: boolean;
|
|
23
|
+
insertNewlineBeforeBanner?: boolean;
|
|
24
|
+
insertNewlineAfterDescription?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A component to generate the `banner` function's body for a specific command or application.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
|
|
31
|
+
*/
|
|
32
|
+
declare function BannerFunctionBodyDeclaration(props: BannerFunctionBodyDeclarationProps): Children;
|
|
33
|
+
interface BannerFunctionDeclarationProps extends BannerFunctionDeclarationWrapperProps {
|
|
34
|
+
variant?: ThemeColorVariant;
|
|
35
|
+
consoleFnName?: "log" | "info" | "warn" | "error" | "debug";
|
|
36
|
+
insertNewlineBeforeBanner?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A component to generate the `banner` function for a specific command or application.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
|
|
43
|
+
*/
|
|
44
|
+
declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps): Children;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { BannerFunctionBodyDeclaration, BannerFunctionBodyDeclarationProps, BannerFunctionDeclaration, BannerFunctionDeclarationProps, BannerFunctionDeclarationWrapper, BannerFunctionDeclarationWrapperProps };
|
|
47
|
+
//# sourceMappingURL=banner-function-declaration.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner-function-declaration.d.mts","names":[],"sources":["../../src/components/banner-function-declaration.tsx"],"mappings":";;;;;UA6BiB,qCAAA;EACf,OAAA,GAAU,WAAA;EACV,QAAA,GAAW,QAAA;AAAA;;;;;;;iBASG,gCAAA,CACd,KAAA,EAAO,qCAAA,GAAqC,QAAA;AAAA,UAuB7B,kCAAA,SAA2C,8BAAA;EAC1D,KAAA;EACA,MAAA;EACA,MAAA;EACA,WAAA;EACA,0BAAA;EACA,yBAAA;EACA,6BAAA;AAAA;;AAPF;;;;;iBAgBgB,6BAAA,CACd,KAAA,EAAO,kCAAA,GAAkC,QAAA;AAAA,UAqL1B,8BAAA,SAAuC,qCAAA;EACtD,OAAA,GAAU,iBAAA;EACV,aAAA;EACA,yBAAA;AAAA;;;;AAzLF;;;iBAkMgB,yBAAA,CACd,KAAA,EAAO,8BAAA,GAA8B,QAAA"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { Show, code, computed } from "@alloy-js/core";
|
|
3
|
+
import { getAppDescription, getAppTitle } from "@shell-shock/core/plugin-utils";
|
|
4
|
+
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
5
|
+
import { FunctionDeclaration, IfStatement } from "@alloy-js/typescript";
|
|
6
|
+
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
7
|
+
import { useTheme } from "@shell-shock/plugin-theme/contexts/theme";
|
|
8
|
+
|
|
9
|
+
//#region src/components/banner-function-declaration.tsx
|
|
10
|
+
/**
|
|
11
|
+
* A component to generate the `banner` function for a specific command or application.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
|
|
15
|
+
*/
|
|
16
|
+
function BannerFunctionDeclarationWrapper(props) {
|
|
17
|
+
const { command, children } = props;
|
|
18
|
+
const context = usePowerlines();
|
|
19
|
+
return createComponent(FunctionDeclaration, {
|
|
20
|
+
"export": true,
|
|
21
|
+
async: true,
|
|
22
|
+
name: "showBanner",
|
|
23
|
+
get doc() {
|
|
24
|
+
return `Write the ${getAppTitle(context, true)} command-line interface application banner ${command ? `for the ${command.title} command ` : ""}to the console.`;
|
|
25
|
+
},
|
|
26
|
+
parameters: [{
|
|
27
|
+
name: "sleepTimeoutMs",
|
|
28
|
+
type: "number",
|
|
29
|
+
default: 500
|
|
30
|
+
}],
|
|
31
|
+
get children() {
|
|
32
|
+
return [children, createComponent(IfStatement, {
|
|
33
|
+
condition: code`isInteractive && !isHelp`,
|
|
34
|
+
children: code`await sleep(sleepTimeoutMs);`
|
|
35
|
+
})];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A component to generate the `banner` function's body for a specific command or application.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
|
|
44
|
+
*/
|
|
45
|
+
function BannerFunctionBodyDeclaration(props) {
|
|
46
|
+
const { consoleFnName = "log", variant = "primary", title, header, footer, description, command, children, insertNewlineBeforeCommand = false, insertNewlineBeforeBanner = true, insertNewlineAfterDescription = false } = props;
|
|
47
|
+
const theme = useTheme();
|
|
48
|
+
const bannerPadding = computed(() => Math.max(theme.padding.app, 0) * 2 + theme.borderStyles.banner.outline[variant].left.length + theme.borderStyles.banner.outline[variant].right.length);
|
|
49
|
+
const totalPadding = computed(() => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value);
|
|
50
|
+
return [
|
|
51
|
+
code`
|
|
52
|
+
if (useApp().get("banner") || hasFlag("no-banner") || hasFlag("hide-banner") || isMinimal) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
useApp().set("banner", true); `,
|
|
57
|
+
createComponent(Spacing, {}),
|
|
58
|
+
children,
|
|
59
|
+
createComponent(Spacing, {}),
|
|
60
|
+
createComponent(Show, {
|
|
61
|
+
when: insertNewlineBeforeBanner,
|
|
62
|
+
children: code`writeLine(""); `
|
|
63
|
+
}),
|
|
64
|
+
createComponent(Spacing, {}),
|
|
65
|
+
memo(() => code`
|
|
66
|
+
writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].topLeft}") + ${theme.icons.banner.header[variant] ? `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}".repeat(6)) + " " + ${theme.icons.banner.header[variant] ? `colors.text.banner.header.${variant}("${theme.icons.banner.header[variant]}") + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}") + " " +` : ""} colors.bold(colors.text.banner.header.${variant}("${header}")) + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}".repeat(Math.max(process.stdout.columns - ${6 + (theme.icons.banner.header[variant] ? theme.icons.banner.header[variant].length + 3 : 0) + (header ? header.length + 2 : 0) + bannerPadding.value}, 0)))` : `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}".repeat(Math.max(process.stdout.columns - ${bannerPadding.value}, 0)))`} + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].topRight}"), { consoleFn: console.${consoleFnName} });
|
|
67
|
+
|
|
68
|
+
splitText(
|
|
69
|
+
${title ? `"${title}"` : "title"},
|
|
70
|
+
Math.max(process.stdout.columns - ${totalPadding.value}, 0)
|
|
71
|
+
).forEach((line) => {
|
|
72
|
+
writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.bold(colors.text.banner.title.${variant}(line)) + " ".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} });
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
${command?.title ? `${insertNewlineBeforeCommand ? `writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(process.stdout.columns - ${bannerPadding.value})) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} }); ` : ""}
|
|
76
|
+
${`writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi("${command.title}").length ${command.icon ? " + 3" : ""} + ${bannerPadding.value})) / 2), 0)) + colors.bold(colors.text.banner.command.${variant}("${command.icon ? `${command.icon} ` : ""}${command.title}")) + " ".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi("${command.title}").length ${command.icon ? " + 3" : ""} + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} }); `} ` : ""}
|
|
77
|
+
|
|
78
|
+
splitText(
|
|
79
|
+
colors.bold(${command?.title ? "colors.text.banner.description" : "colors.text.banner.command"}.${variant}("${description.replace(/"/g, "\\\"")}")),
|
|
80
|
+
Math.max(process.stdout.columns - ${totalPadding.value}, 0)
|
|
81
|
+
).forEach((line) => {
|
|
82
|
+
writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.text.banner.description.${variant}(line) + " ".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} });
|
|
83
|
+
});
|
|
84
|
+
${insertNewlineAfterDescription ? `writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(process.stdout.columns - ${bannerPadding.value})) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} });` : ""}
|
|
85
|
+
writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottomLeft}") + ${footer ? `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottom}".repeat(Math.max(process.stdout.columns - ${8 + (footer ? footer.length : 0) + bannerPadding.value}, 0))) + " " + ${footer ? `colors.bold(colors.text.banner.footer.${variant}("${footer}"))` : ""} + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottom}".repeat(6))` : `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottom}".repeat(Math.max(process.stdout.columns - ${bannerPadding.value}, 0)))`} + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottomRight}"), { consoleFn: console.${consoleFnName} });
|
|
86
|
+
|
|
87
|
+
writeLine(""); `)
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A component to generate the `banner` function for a specific command or application.
|
|
92
|
+
*
|
|
93
|
+
* @remarks
|
|
94
|
+
* This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
|
|
95
|
+
*/
|
|
96
|
+
function BannerFunctionDeclaration(props) {
|
|
97
|
+
const { consoleFnName = "log", variant = "primary", command, children, insertNewlineBeforeBanner = true } = props;
|
|
98
|
+
const theme = useTheme();
|
|
99
|
+
const context = usePowerlines();
|
|
100
|
+
const header = computed(() => `${theme.labels.banner.header[variant] || getAppTitle(context, false)} v${context.packageJson.version || "1.0.0"}`);
|
|
101
|
+
const footer = computed(() => theme.labels.banner.footer[variant]);
|
|
102
|
+
const title = computed(() => getAppTitle(context, true).replace(`v${context.packageJson.version || "1.0.0"}`, ""));
|
|
103
|
+
const description = computed(() => command?.description || getAppDescription(context));
|
|
104
|
+
return createComponent(BannerFunctionDeclarationWrapper, {
|
|
105
|
+
command,
|
|
106
|
+
get children() {
|
|
107
|
+
return createComponent(BannerFunctionBodyDeclaration, {
|
|
108
|
+
get title() {
|
|
109
|
+
return title.value;
|
|
110
|
+
},
|
|
111
|
+
get header() {
|
|
112
|
+
return header.value;
|
|
113
|
+
},
|
|
114
|
+
get description() {
|
|
115
|
+
return description.value;
|
|
116
|
+
},
|
|
117
|
+
get footer() {
|
|
118
|
+
return footer.value;
|
|
119
|
+
},
|
|
120
|
+
variant,
|
|
121
|
+
consoleFnName,
|
|
122
|
+
command,
|
|
123
|
+
insertNewlineBeforeCommand: true,
|
|
124
|
+
insertNewlineBeforeBanner,
|
|
125
|
+
children
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
//#endregion
|
|
132
|
+
export { BannerFunctionBodyDeclaration, BannerFunctionDeclaration, BannerFunctionDeclarationWrapper };
|
|
133
|
+
//# sourceMappingURL=banner-function-declaration.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner-function-declaration.mjs","names":[],"sources":["../../src/components/banner-function-declaration.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 type { Children } from \"@alloy-js/core\";\nimport { code, computed, Show } from \"@alloy-js/core\";\nimport { FunctionDeclaration, IfStatement } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { getAppDescription, getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport { useTheme } from \"@shell-shock/plugin-theme/contexts/theme\";\nimport type { ThemeColorVariant } from \"@shell-shock/plugin-theme/types/theme\";\nimport type { BannerPluginContext } from \"../types\";\n\nexport interface BannerFunctionDeclarationWrapperProps {\n command?: CommandTree;\n children?: Children;\n}\n\n/**\n * A component to generate the `banner` function for a specific command or application.\n *\n * @remarks\n * This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.\n */\nexport function BannerFunctionDeclarationWrapper(\n props: BannerFunctionDeclarationWrapperProps\n) {\n const { command, children } = props;\n\n const context = usePowerlines<BannerPluginContext>();\n\n return (\n <FunctionDeclaration\n export\n async\n name=\"showBanner\"\n doc={`Write the ${getAppTitle(context, true)} command-line interface application banner ${\n command ? `for the ${command.title} command ` : \"\"\n }to the console.`}\n parameters={[{ name: \"sleepTimeoutMs\", type: \"number\", default: 500 }]}>\n {children}\n <IfStatement condition={code`isInteractive && !isHelp`}>\n {code`await sleep(sleepTimeoutMs);`}\n </IfStatement>\n </FunctionDeclaration>\n );\n}\n\nexport interface BannerFunctionBodyDeclarationProps extends BannerFunctionDeclarationProps {\n title?: string;\n header?: string;\n footer?: string;\n description: string;\n insertNewlineBeforeCommand?: boolean;\n insertNewlineBeforeBanner?: boolean;\n insertNewlineAfterDescription?: boolean;\n}\n\n/**\n * A component to generate the `banner` function's body for a specific command or application.\n *\n * @remarks\n * This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.\n */\nexport function BannerFunctionBodyDeclaration(\n props: BannerFunctionBodyDeclarationProps\n) {\n const {\n consoleFnName = \"log\",\n variant = \"primary\",\n title,\n header,\n footer,\n description,\n command,\n children,\n insertNewlineBeforeCommand = false,\n insertNewlineBeforeBanner = true,\n insertNewlineAfterDescription = false\n } = props;\n\n const theme = useTheme();\n\n const bannerPadding = computed(\n () =>\n Math.max(theme.padding.app, 0) * 2 +\n theme.borderStyles.banner.outline[variant].left.length +\n theme.borderStyles.banner.outline[variant].right.length\n );\n const totalPadding = computed(\n () => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value\n );\n\n return (\n <>\n {code`\n if (useApp().get(\"banner\") || hasFlag(\"no-banner\") || hasFlag(\"hide-banner\") || isMinimal) {\n return;\n }\n\n useApp().set(\"banner\", true); `}\n <Spacing />\n {children}\n <Spacing />\n <Show when={insertNewlineBeforeBanner}>{code`writeLine(\"\"); `}</Show>\n <Spacing />\n {code`\n writeLine(colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].topLeft\n }\") + ${\n theme.icons.banner.header[variant]\n ? `colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].top\n }\".repeat(6)) + \" \" + ${\n theme.icons.banner.header[variant]\n ? `colors.text.banner.header.${variant}(\"${\n theme.icons.banner.header[variant]\n }\") + \" \" + colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].top\n }\") + \" \" +`\n : \"\"\n } colors.bold(colors.text.banner.header.${variant}(\"${\n header\n }\")) + \" \" + colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].top\n }\".repeat(Math.max(process.stdout.columns - ${\n 6 +\n (theme.icons.banner.header[variant]\n ? theme.icons.banner.header[variant].length + 3\n : 0) +\n (header ? header.length + 2 : 0) +\n bannerPadding.value\n }, 0)))`\n : `colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].top\n }\".repeat(Math.max(process.stdout.columns - ${\n bannerPadding.value\n }, 0)))`\n } + colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].topRight\n }\"), { consoleFn: console.${consoleFnName} });\n\n splitText(\n ${title ? `\"${title}\"` : \"title\"},\n Math.max(process.stdout.columns - ${totalPadding.value}, 0)\n ).forEach((line) => {\n writeLine(colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].left\n }\") + \" \".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi(line).length + ${\n bannerPadding.value\n })) / 2), 0)) + colors.bold(colors.text.banner.title.${variant}(line)) + \" \".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi(line).length + ${\n bannerPadding.value\n })) / 2), 0)) + colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].right\n }\"), { consoleFn: console.${consoleFnName} });\n });\n\n ${\n command?.title\n ? `${\n insertNewlineBeforeCommand\n ? `writeLine(colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].left\n }\") + \" \".repeat(Math.max(process.stdout.columns - ${\n bannerPadding.value\n })) + colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].right\n }\"), { consoleFn: console.${consoleFnName} }); `\n : \"\"\n }\n ${`writeLine(colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].left\n }\") + \" \".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi(\"${\n command.title\n }\").length ${command.icon ? \" + 3\" : \"\"} + ${\n bannerPadding.value\n })) / 2), 0)) + colors.bold(colors.text.banner.command.${\n variant\n }(\"${command.icon ? `${command.icon} ` : \"\"}${command.title}\")) + \" \".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi(\"${command.title}\").length ${\n command.icon ? \" + 3\" : \"\"\n } + ${\n bannerPadding.value\n })) / 2), 0)) + colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].right\n }\"), { consoleFn: console.${consoleFnName} }); `} `\n : \"\"\n }\n\n splitText(\n colors.bold(${\n command?.title\n ? \"colors.text.banner.description\"\n : \"colors.text.banner.command\"\n }.${variant}(\"${description.replace(/\"/g, '\\\\\"')}\")),\n Math.max(process.stdout.columns - ${totalPadding.value}, 0)\n ).forEach((line) => {\n writeLine(colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].left\n }\") + \" \".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi(line).length + ${\n bannerPadding.value\n })) / 2), 0)) + colors.text.banner.description.${variant}(line) + \" \".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi(line).length + ${\n bannerPadding.value\n })) / 2), 0)) + colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].right\n }\"), { consoleFn: console.${consoleFnName} });\n });\n ${\n insertNewlineAfterDescription\n ? `writeLine(colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].left\n }\") + \" \".repeat(Math.max(process.stdout.columns - ${\n bannerPadding.value\n })) + colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].right\n }\"), { consoleFn: console.${consoleFnName} });`\n : \"\"\n }\n writeLine(colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].bottomLeft\n }\") + ${\n footer\n ? `colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].bottom\n }\".repeat(Math.max(process.stdout.columns - ${\n 8 + (footer ? footer.length : 0) + bannerPadding.value\n }, 0))) + \" \" + ${\n footer\n ? `colors.bold(colors.text.banner.footer.${variant}(\"${footer}\"))`\n : \"\"\n } + \" \" + colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].bottom\n }\".repeat(6))`\n : `colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].bottom\n }\".repeat(Math.max(process.stdout.columns - ${\n bannerPadding.value\n }, 0)))`\n } + colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].bottomRight\n }\"), { consoleFn: console.${consoleFnName} });\n\n writeLine(\"\"); `}\n </>\n );\n}\n\nexport interface BannerFunctionDeclarationProps extends BannerFunctionDeclarationWrapperProps {\n variant?: ThemeColorVariant;\n consoleFnName?: \"log\" | \"info\" | \"warn\" | \"error\" | \"debug\";\n insertNewlineBeforeBanner?: boolean;\n}\n\n/**\n * A component to generate the `banner` function for a specific command or application.\n *\n * @remarks\n * This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.\n */\nexport function BannerFunctionDeclaration(\n props: BannerFunctionDeclarationProps\n) {\n const {\n consoleFnName = \"log\",\n variant = \"primary\",\n command,\n children,\n insertNewlineBeforeBanner = true\n } = props;\n\n const theme = useTheme();\n const context = usePowerlines<BannerPluginContext>();\n\n const header = computed(\n () =>\n `${theme.labels.banner.header[variant] || getAppTitle(context, false)} v${\n context.packageJson.version || \"1.0.0\"\n }`\n );\n const footer = computed(() => theme.labels.banner.footer[variant]);\n const title = computed(() =>\n getAppTitle(context, true).replace(\n `v${context.packageJson.version || \"1.0.0\"}`,\n \"\"\n )\n );\n const description = computed(\n () => command?.description || getAppDescription(context)\n );\n\n return (\n <BannerFunctionDeclarationWrapper command={command}>\n <BannerFunctionBodyDeclaration\n title={title.value}\n header={header.value}\n description={description.value}\n footer={footer.value}\n variant={variant}\n consoleFnName={consoleFnName}\n command={command}\n insertNewlineBeforeCommand\n insertNewlineBeforeBanner={insertNewlineBeforeBanner}>\n {children}\n </BannerFunctionBodyDeclaration>\n </BannerFunctionDeclarationWrapper>\n );\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_components_banner_function_declaration = require('./banner-function-declaration.cjs');
|
|
3
|
+
const require_components_banner_builtin = require('./banner-builtin.cjs');
|
|
4
|
+
|
|
5
|
+
exports.BannerBuiltin = require_components_banner_builtin.BannerBuiltin;
|
|
6
|
+
exports.BannerFunctionBodyDeclaration = require_components_banner_function_declaration.BannerFunctionBodyDeclaration;
|
|
7
|
+
exports.BannerFunctionDeclaration = require_components_banner_function_declaration.BannerFunctionDeclaration;
|
|
8
|
+
exports.BannerFunctionDeclarationWrapper = require_components_banner_function_declaration.BannerFunctionDeclarationWrapper;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BannerBuiltin, BannerBuiltinProps } from "./banner-builtin.cjs";
|
|
2
|
+
import { BannerFunctionBodyDeclaration, BannerFunctionBodyDeclarationProps, BannerFunctionDeclaration, BannerFunctionDeclarationProps, BannerFunctionDeclarationWrapper, BannerFunctionDeclarationWrapperProps } from "./banner-function-declaration.cjs";
|
|
3
|
+
export { BannerBuiltin, BannerBuiltinProps, BannerFunctionBodyDeclaration, BannerFunctionBodyDeclarationProps, BannerFunctionDeclaration, BannerFunctionDeclarationProps, BannerFunctionDeclarationWrapper, BannerFunctionDeclarationWrapperProps };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BannerBuiltin, BannerBuiltinProps } from "./banner-builtin.mjs";
|
|
2
|
+
import { BannerFunctionBodyDeclaration, BannerFunctionBodyDeclarationProps, BannerFunctionDeclaration, BannerFunctionDeclarationProps, BannerFunctionDeclarationWrapper, BannerFunctionDeclarationWrapperProps } from "./banner-function-declaration.mjs";
|
|
3
|
+
export { BannerBuiltin, BannerBuiltinProps, BannerFunctionBodyDeclaration, BannerFunctionBodyDeclarationProps, BannerFunctionDeclaration, BannerFunctionDeclarationProps, BannerFunctionDeclarationWrapper, BannerFunctionDeclarationWrapperProps };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BannerFunctionBodyDeclaration, BannerFunctionDeclaration, BannerFunctionDeclarationWrapper } from "./banner-function-declaration.mjs";
|
|
2
|
+
import { BannerBuiltin } from "./banner-builtin.mjs";
|
|
3
|
+
|
|
4
|
+
export { BannerBuiltin, BannerFunctionBodyDeclaration, BannerFunctionDeclaration, BannerFunctionDeclarationWrapper };
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_components_banner_builtin = require('./components/banner-builtin.cjs');
|
|
4
|
+
require('./components/index.cjs');
|
|
5
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
6
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
7
|
+
let _powerlines_plugin_alloy_core_components = require("@powerlines/plugin-alloy/core/components");
|
|
8
|
+
let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
|
|
9
|
+
let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
10
|
+
let _shell_shock_plugin_console = require("@shell-shock/plugin-console");
|
|
11
|
+
_shell_shock_plugin_console = require_runtime.__toESM(_shell_shock_plugin_console);
|
|
12
|
+
let _shell_shock_plugin_theme = require("@shell-shock/plugin-theme");
|
|
13
|
+
_shell_shock_plugin_theme = require_runtime.__toESM(_shell_shock_plugin_theme);
|
|
14
|
+
let _stryke_path_join = require("@stryke/path/join");
|
|
15
|
+
|
|
16
|
+
//#region src/index.tsx
|
|
17
|
+
/**
|
|
18
|
+
* The Banner - Shell Shock plugin to add a banner command to the application.
|
|
19
|
+
*/
|
|
20
|
+
const plugin = (options = {}) => {
|
|
21
|
+
return [
|
|
22
|
+
...(0, _shell_shock_plugin_theme.default)(options.theme),
|
|
23
|
+
(0, _shell_shock_plugin_console.default)(options.console),
|
|
24
|
+
{
|
|
25
|
+
name: "shell-shock:banner",
|
|
26
|
+
enforce: "post",
|
|
27
|
+
prepare: {
|
|
28
|
+
order: "post",
|
|
29
|
+
async handler() {
|
|
30
|
+
const commands = await (0, _shell_shock_core_plugin_utils.getCommandList)(this);
|
|
31
|
+
this.debug(`Rendering \`banner\` built-ins for each of the ${commands.length} command modules.`);
|
|
32
|
+
const bin = (0, _alloy_js_core.computed)(() => ({
|
|
33
|
+
id: "",
|
|
34
|
+
name: (0, _shell_shock_core_plugin_utils.getAppName)(this),
|
|
35
|
+
title: (0, _shell_shock_core_plugin_utils.getAppTitle)(this),
|
|
36
|
+
description: (0, _shell_shock_core_plugin_utils.getAppDescription)(this),
|
|
37
|
+
isVirtual: true,
|
|
38
|
+
path: null,
|
|
39
|
+
segments: [],
|
|
40
|
+
alias: [],
|
|
41
|
+
options: Object.fromEntries(this.options.map((option) => [option.name, option])),
|
|
42
|
+
entry: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "bin.ts") },
|
|
43
|
+
args: [],
|
|
44
|
+
parent: null,
|
|
45
|
+
children: this.commands
|
|
46
|
+
}));
|
|
47
|
+
return (0, _powerlines_plugin_alloy_render.render)(this, [
|
|
48
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_banner_builtin.BannerBuiltin, { get command() {
|
|
49
|
+
return bin.value;
|
|
50
|
+
} }),
|
|
51
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components.Spacing, {}),
|
|
52
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
53
|
+
get each() {
|
|
54
|
+
return commands.sort((a, b) => a.name.localeCompare(b.name));
|
|
55
|
+
},
|
|
56
|
+
doubleHardline: true,
|
|
57
|
+
children: (command) => (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_banner_builtin.BannerBuiltin, { command })
|
|
58
|
+
})
|
|
59
|
+
]);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
];
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
//#endregion
|
|
67
|
+
exports.default = plugin;
|
|
68
|
+
exports.plugin = plugin;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BannerPluginContext, BannerPluginOptions, BannerPluginResolvedConfig, BannerPluginUserConfig } from "./types/plugin.cjs";
|
|
2
|
+
import { Plugin } from "powerlines";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The Banner - Shell Shock plugin to add a banner command to the application.
|
|
7
|
+
*/
|
|
8
|
+
declare const plugin: <TContext extends BannerPluginContext = BannerPluginContext>(options?: BannerPluginOptions) => Plugin<TContext>[];
|
|
9
|
+
//#endregion
|
|
10
|
+
export { BannerPluginContext, BannerPluginOptions, BannerPluginResolvedConfig, BannerPluginUserConfig, plugin as default, plugin };
|
|
11
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;AAuCA;;cAAa,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KAqDJ,MAAA,CAAO,QAAA"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BannerPluginContext, BannerPluginOptions, BannerPluginResolvedConfig, BannerPluginUserConfig } from "./types/plugin.mjs";
|
|
2
|
+
import { Plugin } from "powerlines";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The Banner - Shell Shock plugin to add a banner command to the application.
|
|
7
|
+
*/
|
|
8
|
+
declare const plugin: <TContext extends BannerPluginContext = BannerPluginContext>(options?: BannerPluginOptions) => Plugin<TContext>[];
|
|
9
|
+
//#endregion
|
|
10
|
+
export { BannerPluginContext, BannerPluginOptions, BannerPluginResolvedConfig, BannerPluginUserConfig, plugin as default, plugin };
|
|
11
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AAuCA;cAAa,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KAqDJ,MAAA,CAAO,QAAA"}
|