@shell-shock/plugin-banner 0.1.29 → 0.1.31
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/banner-function-declaration.cjs +47 -43
- package/dist/components/banner-function-declaration.d.cts.map +1 -1
- package/dist/components/banner-function-declaration.d.mts.map +1 -1
- package/dist/components/banner-function-declaration.mjs +48 -44
- package/dist/components/banner-function-declaration.mjs.map +1 -1
- package/package.json +10 -10
|
@@ -6,6 +6,7 @@ let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
|
6
6
|
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
7
7
|
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
8
8
|
let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
9
|
+
let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
9
10
|
let _shell_shock_plugin_theme_contexts_theme = require("@shell-shock/plugin-theme/contexts/theme");
|
|
10
11
|
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
11
12
|
|
|
@@ -19,13 +20,20 @@ let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-stri
|
|
|
19
20
|
function BannerFunctionDeclarationWrapper(props) {
|
|
20
21
|
const { command, children } = props;
|
|
21
22
|
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
22
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
23
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
24
|
+
get heading() {
|
|
25
|
+
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.`;
|
|
26
|
+
},
|
|
27
|
+
get children() {
|
|
28
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
29
|
+
name: "sleepTimeoutMs",
|
|
30
|
+
children: `The amount of time in milliseconds to sleep before displaying the banner. This can be used to create a delay before the banner is shown, allowing for any necessary setup or initialization to occur first. The default value is 500 milliseconds.`
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
23
34
|
"export": true,
|
|
24
35
|
async: true,
|
|
25
36
|
name: "showBanner",
|
|
26
|
-
get doc() {
|
|
27
|
-
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.`;
|
|
28
|
-
},
|
|
29
37
|
parameters: [{
|
|
30
38
|
name: "sleepTimeoutMs",
|
|
31
39
|
type: "number",
|
|
@@ -37,7 +45,7 @@ function BannerFunctionDeclarationWrapper(props) {
|
|
|
37
45
|
children: _alloy_js_core.code`await sleep(sleepTimeoutMs);`
|
|
38
46
|
})];
|
|
39
47
|
}
|
|
40
|
-
});
|
|
48
|
+
})];
|
|
41
49
|
}
|
|
42
50
|
/**
|
|
43
51
|
* A component to generate the `banner` function's body for a specific command or application.
|
|
@@ -48,8 +56,14 @@ function BannerFunctionDeclarationWrapper(props) {
|
|
|
48
56
|
function BannerFunctionBodyDeclaration(props) {
|
|
49
57
|
const { consoleFnName = "log", variant = "primary", title, header, footer, description, command, children, insertNewlineBeforeCommand = false, insertNewlineBeforeBanner = true, insertNewlineAfterDescription = false } = props;
|
|
50
58
|
const theme = (0, _shell_shock_plugin_theme_contexts_theme.useTheme)();
|
|
51
|
-
const
|
|
59
|
+
const borderStyle = theme.borderStyles.banner.outline[variant];
|
|
60
|
+
const icon = theme.icons.banner.header[variant];
|
|
61
|
+
const bannerPadding = (0, _alloy_js_core.computed)(() => Math.max(theme.padding.app, 0) * 2 + borderStyle.left.length + borderStyle.right.length);
|
|
62
|
+
const innerPadding = (0, _alloy_js_core.computed)(() => Math.max(theme.padding.banner, 2));
|
|
52
63
|
const totalPadding = (0, _alloy_js_core.computed)(() => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value);
|
|
64
|
+
const headerRepeat = (0, _alloy_js_core.computed)(() => Math.max(Math.floor(innerPadding.value / 2) - 1, 2));
|
|
65
|
+
const headerStaticWidth = (0, _alloy_js_core.computed)(() => borderStyle.topLeft.length + headerRepeat.value + (icon ? 1 + icon.length + 1 + borderStyle.top.length + 1 : 1) + (header ? header.length : 0) + 1 + borderStyle.topRight.length);
|
|
66
|
+
const footerStaticWidth = (0, _alloy_js_core.computed)(() => borderStyle.bottomLeft.length + 1 + (footer ? footer.length : 0) + 1 + headerRepeat.value + borderStyle.bottomRight.length);
|
|
53
67
|
return [
|
|
54
68
|
_alloy_js_core.code`
|
|
55
69
|
if (useMeta().get("banner") || hasFlag("no-banner") || hasFlag("hide-banner") || isMinimal) {
|
|
@@ -63,57 +77,47 @@ function BannerFunctionBodyDeclaration(props) {
|
|
|
63
77
|
children: _alloy_js_core.code`writeLine(""); `
|
|
64
78
|
}),
|
|
65
79
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
66
|
-
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
|
|
67
|
-
|
|
80
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine(borderColors.banner.outline.${variant}("${borderStyle.topLeft}") + borderColors.banner.outline.${variant}("${borderStyle.top}".repeat(${headerRepeat.value}))${icon ? ` + " " + textColors.banner.header.${variant}("${icon}") + " " + borderColors.banner.outline.${variant}("${borderStyle.top}")` : ""} + " " + bold(textColors.banner.header.${variant}("${(0, _shell_shock_core_plugin_utils.formatDescription)(header || "")}")) + " " + borderColors.banner.outline.${variant}("${borderStyle.top}".repeat(Math.max(getTerminalSize().columns - ${headerStaticWidth.value}, 0))) + borderColors.banner.outline.${variant}("${borderStyle.topRight}"), { consoleFn: console.${consoleFnName} }); `),
|
|
81
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
68
82
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
69
|
-
when
|
|
70
|
-
|
|
71
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
72
|
-
get when() {
|
|
73
|
-
return (0, _stryke_type_checks_is_set_string.isSetString)(title);
|
|
74
|
-
},
|
|
75
|
-
get children() {
|
|
76
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
77
|
-
get each() {
|
|
78
|
-
return title ? title.split("\n") : [];
|
|
79
|
-
},
|
|
80
|
-
hardline: true,
|
|
81
|
-
children: (line) => _alloy_js_core.code`splitText("${line}",
|
|
82
|
-
Math.max(getTerminalSize().columns - ${totalPadding.value}, 20)
|
|
83
|
-
).forEach((line) => {
|
|
84
|
-
writeLine(borderColors.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((getTerminalSize().columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + bold(textColors.banner.title.${variant}(line)) + " ".repeat(Math.max(Math.ceil((getTerminalSize().columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + borderColors.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} });
|
|
85
|
-
}); `
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
});
|
|
83
|
+
get when() {
|
|
84
|
+
return (0, _stryke_type_checks_is_set_string.isSetString)(title) && !children;
|
|
89
85
|
},
|
|
90
|
-
children
|
|
86
|
+
get children() {
|
|
87
|
+
return _alloy_js_core.code`splitText("${(0, _shell_shock_core_plugin_utils.formatDescription)(title || "")}", Math.max(getTerminalSize().columns - ${totalPadding.value}, 20)).forEach((line) => {
|
|
88
|
+
writeLine(borderColors.banner.outline.${variant}("${borderStyle.left}") + " ".repeat(Math.max(Math.floor((getTerminalSize().columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + bold(textColors.banner.title.${variant}(line)) + " ".repeat(Math.max(Math.ceil((getTerminalSize().columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + borderColors.banner.outline.${variant}("${borderStyle.right}"), { consoleFn: console.${consoleFnName} });
|
|
89
|
+
}); `;
|
|
90
|
+
}
|
|
91
91
|
}),
|
|
92
|
-
|
|
92
|
+
children,
|
|
93
93
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
94
94
|
get when() {
|
|
95
|
-
return (0, _stryke_type_checks_is_set_string.isSetString)(command?.title)
|
|
95
|
+
return (0, _stryke_type_checks_is_set_string.isSetString)(command?.title);
|
|
96
96
|
},
|
|
97
97
|
get children() {
|
|
98
98
|
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
99
99
|
when: insertNewlineBeforeCommand,
|
|
100
100
|
get children() {
|
|
101
|
-
return _alloy_js_core.code`writeLine(borderColors.banner.outline.${variant}("${
|
|
101
|
+
return _alloy_js_core.code`writeLine(borderColors.banner.outline.${variant}("${borderStyle.left}") + " ".repeat(Math.max(getTerminalSize().columns - ${bannerPadding.value}, 0)) + borderColors.banner.outline.${variant}("${borderStyle.right}"), { consoleFn: console.${consoleFnName} }); `;
|
|
102
102
|
}
|
|
103
|
-
}), (0, _alloy_js_core_jsx_runtime.memo)(() => `writeLine(borderColors.banner.outline.${variant}("${
|
|
103
|
+
}), (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine(borderColors.banner.outline.${variant}("${borderStyle.left}") + " ".repeat(Math.max(Math.floor((getTerminalSize().columns - (stripAnsi("${(0, _shell_shock_core_plugin_utils.formatDescription)(command?.title || "")}").length + ${bannerPadding.value})) / 2), 0)) + bold(textColors.banner.command.${variant}("${(0, _shell_shock_core_plugin_utils.formatDescription)(command?.title || "")}")) + " ".repeat(Math.max(Math.ceil((getTerminalSize().columns - (stripAnsi("${(0, _shell_shock_core_plugin_utils.formatDescription)(command?.title || "")}").length + ${bannerPadding.value})) / 2), 0)) + borderColors.banner.outline.${variant}("${borderStyle.right}"), { consoleFn: console.${consoleFnName} }); `)];
|
|
104
104
|
}
|
|
105
105
|
}),
|
|
106
106
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
107
|
-
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`splitText(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
107
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`splitText(bold(textColors.banner.${command ? "description" : "command"}.${variant}(\`${(0, _shell_shock_core_plugin_utils.formatDescription)(description)}\`)), Math.max(${command ? `${totalPadding.value * 2} > getTerminalSize().columns / 2 ? getTerminalSize().columns - ${Math.max(bannerPadding.value + 4, 6)} : ` : ""}getTerminalSize().columns - ${totalPadding.value}, 20)).forEach((line) => {
|
|
108
|
+
writeLine(borderColors.banner.outline.${variant}("${borderStyle.left}") + " ".repeat(Math.max(Math.floor((getTerminalSize().columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + textColors.banner.description.${variant}(line) + " ".repeat(Math.max(Math.ceil((getTerminalSize().columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + borderColors.banner.outline.${variant}("${borderStyle.right}"), { consoleFn: console.${consoleFnName} });
|
|
109
|
+
}); `),
|
|
110
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
111
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
112
|
+
when: insertNewlineAfterDescription,
|
|
113
|
+
get children() {
|
|
114
|
+
return _alloy_js_core.code`writeLine(borderColors.banner.outline.${variant}("${borderStyle.left}") + " ".repeat(Math.max(getTerminalSize().columns - ${bannerPadding.value}, 0)) + borderColors.banner.outline.${variant}("${borderStyle.right}"), { consoleFn: console.${consoleFnName} }); `;
|
|
115
|
+
}
|
|
116
|
+
}),
|
|
117
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
118
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine(borderColors.banner.outline.${variant}("${borderStyle.bottomLeft}") + ${footer ? `borderColors.banner.outline.${variant}("${borderStyle.bottom}".repeat(Math.max(getTerminalSize().columns - ${footerStaticWidth.value}, 0))) + " " + bold(textColors.banner.footer.${variant}("${(0, _shell_shock_core_plugin_utils.formatDescription)(footer)}")) + " " + borderColors.banner.outline.${variant}("${borderStyle.bottom}".repeat(${headerRepeat.value}))` : `borderColors.banner.outline.${variant}("${borderStyle.bottom}".repeat(Math.max(getTerminalSize().columns - ${borderStyle.bottomLeft.length + borderStyle.bottomRight.length}, 0)))`} + borderColors.banner.outline.${variant}("${borderStyle.bottomRight}"), { consoleFn: console.${consoleFnName} }); `),
|
|
119
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
120
|
+
_alloy_js_core.code`writeLine(""); `
|
|
117
121
|
];
|
|
118
122
|
}
|
|
119
123
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner-function-declaration.d.cts","names":[],"sources":["../../src/components/banner-function-declaration.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"banner-function-declaration.d.cts","names":[],"sources":["../../src/components/banner-function-declaration.tsx"],"mappings":";;;;;UAsCiB,qCAAA;EACf,OAAA,GAAU,WAAA;EACV,QAAA,GAAW,QAAA;AAAA;;;;;;;iBASG,gCAAA,CACd,KAAA,EAAO,qCAAA,GAAqC,QAAA;AAAA,UA8B7B,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,UAyM1B,8BAAA,SAAuC,qCAAA;EACtD,OAAA,GAAU,iBAAA;EACV,aAAA;EACA,yBAAA;AAAA;;;;AA7MF;;;iBAsNgB,yBAAA,CACd,KAAA,EAAO,8BAAA,GAA8B,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner-function-declaration.d.mts","names":[],"sources":["../../src/components/banner-function-declaration.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"banner-function-declaration.d.mts","names":[],"sources":["../../src/components/banner-function-declaration.tsx"],"mappings":";;;;;UAsCiB,qCAAA;EACf,OAAA,GAAU,WAAA;EACV,QAAA,GAAW,QAAA;AAAA;;;;;;;iBASG,gCAAA,CACd,KAAA,EAAO,qCAAA,GAAqC,QAAA;AAAA,UA8B7B,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,UAyM1B,8BAAA,SAAuC,qCAAA;EACtD,OAAA,GAAU,iBAAA;EACV,aAAA;EACA,yBAAA;AAAA;;;;AA7MF;;;iBAsNgB,yBAAA,CACd,KAAA,EAAO,8BAAA,GAA8B,QAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Show, code, computed } from "@alloy-js/core";
|
|
3
3
|
import { formatDescription, getAppDescription, getAppTitle } from "@shell-shock/core/plugin-utils";
|
|
4
4
|
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
5
5
|
import { FunctionDeclaration, IfStatement } from "@alloy-js/typescript";
|
|
6
6
|
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
7
|
+
import { TSDoc, TSDocParam } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
|
|
7
8
|
import { useTheme } from "@shell-shock/plugin-theme/contexts/theme";
|
|
8
9
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
9
10
|
|
|
@@ -17,13 +18,20 @@ import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
|
17
18
|
function BannerFunctionDeclarationWrapper(props) {
|
|
18
19
|
const { command, children } = props;
|
|
19
20
|
const context = usePowerlines();
|
|
20
|
-
return createComponent(
|
|
21
|
+
return [createComponent(TSDoc, {
|
|
22
|
+
get heading() {
|
|
23
|
+
return `Write the ${getAppTitle(context, true)} command-line interface application banner ${command ? `for the ${command.title} command ` : ""}to the console.`;
|
|
24
|
+
},
|
|
25
|
+
get children() {
|
|
26
|
+
return createComponent(TSDocParam, {
|
|
27
|
+
name: "sleepTimeoutMs",
|
|
28
|
+
children: `The amount of time in milliseconds to sleep before displaying the banner. This can be used to create a delay before the banner is shown, allowing for any necessary setup or initialization to occur first. The default value is 500 milliseconds.`
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}), createComponent(FunctionDeclaration, {
|
|
21
32
|
"export": true,
|
|
22
33
|
async: true,
|
|
23
34
|
name: "showBanner",
|
|
24
|
-
get doc() {
|
|
25
|
-
return `Write the ${getAppTitle(context, true)} command-line interface application banner ${command ? `for the ${command.title} command ` : ""}to the console.`;
|
|
26
|
-
},
|
|
27
35
|
parameters: [{
|
|
28
36
|
name: "sleepTimeoutMs",
|
|
29
37
|
type: "number",
|
|
@@ -35,7 +43,7 @@ function BannerFunctionDeclarationWrapper(props) {
|
|
|
35
43
|
children: code`await sleep(sleepTimeoutMs);`
|
|
36
44
|
})];
|
|
37
45
|
}
|
|
38
|
-
});
|
|
46
|
+
})];
|
|
39
47
|
}
|
|
40
48
|
/**
|
|
41
49
|
* A component to generate the `banner` function's body for a specific command or application.
|
|
@@ -46,8 +54,14 @@ function BannerFunctionDeclarationWrapper(props) {
|
|
|
46
54
|
function BannerFunctionBodyDeclaration(props) {
|
|
47
55
|
const { consoleFnName = "log", variant = "primary", title, header, footer, description, command, children, insertNewlineBeforeCommand = false, insertNewlineBeforeBanner = true, insertNewlineAfterDescription = false } = props;
|
|
48
56
|
const theme = useTheme();
|
|
49
|
-
const
|
|
57
|
+
const borderStyle = theme.borderStyles.banner.outline[variant];
|
|
58
|
+
const icon = theme.icons.banner.header[variant];
|
|
59
|
+
const bannerPadding = computed(() => Math.max(theme.padding.app, 0) * 2 + borderStyle.left.length + borderStyle.right.length);
|
|
60
|
+
const innerPadding = computed(() => Math.max(theme.padding.banner, 2));
|
|
50
61
|
const totalPadding = computed(() => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value);
|
|
62
|
+
const headerRepeat = computed(() => Math.max(Math.floor(innerPadding.value / 2) - 1, 2));
|
|
63
|
+
const headerStaticWidth = computed(() => borderStyle.topLeft.length + headerRepeat.value + (icon ? 1 + icon.length + 1 + borderStyle.top.length + 1 : 1) + (header ? header.length : 0) + 1 + borderStyle.topRight.length);
|
|
64
|
+
const footerStaticWidth = computed(() => borderStyle.bottomLeft.length + 1 + (footer ? footer.length : 0) + 1 + headerRepeat.value + borderStyle.bottomRight.length);
|
|
51
65
|
return [
|
|
52
66
|
code`
|
|
53
67
|
if (useMeta().get("banner") || hasFlag("no-banner") || hasFlag("hide-banner") || isMinimal) {
|
|
@@ -61,57 +75,47 @@ function BannerFunctionBodyDeclaration(props) {
|
|
|
61
75
|
children: code`writeLine(""); `
|
|
62
76
|
}),
|
|
63
77
|
createComponent(Spacing, {}),
|
|
64
|
-
memo(() => code`
|
|
65
|
-
|
|
78
|
+
memo(() => code`writeLine(borderColors.banner.outline.${variant}("${borderStyle.topLeft}") + borderColors.banner.outline.${variant}("${borderStyle.top}".repeat(${headerRepeat.value}))${icon ? ` + " " + textColors.banner.header.${variant}("${icon}") + " " + borderColors.banner.outline.${variant}("${borderStyle.top}")` : ""} + " " + bold(textColors.banner.header.${variant}("${formatDescription(header || "")}")) + " " + borderColors.banner.outline.${variant}("${borderStyle.top}".repeat(Math.max(getTerminalSize().columns - ${headerStaticWidth.value}, 0))) + borderColors.banner.outline.${variant}("${borderStyle.topRight}"), { consoleFn: console.${consoleFnName} }); `),
|
|
79
|
+
createComponent(Spacing, {}),
|
|
66
80
|
createComponent(Show, {
|
|
67
|
-
when
|
|
68
|
-
|
|
69
|
-
return createComponent(Show, {
|
|
70
|
-
get when() {
|
|
71
|
-
return isSetString(title);
|
|
72
|
-
},
|
|
73
|
-
get children() {
|
|
74
|
-
return createComponent(For, {
|
|
75
|
-
get each() {
|
|
76
|
-
return title ? title.split("\n") : [];
|
|
77
|
-
},
|
|
78
|
-
hardline: true,
|
|
79
|
-
children: (line) => code`splitText("${line}",
|
|
80
|
-
Math.max(getTerminalSize().columns - ${totalPadding.value}, 20)
|
|
81
|
-
).forEach((line) => {
|
|
82
|
-
writeLine(borderColors.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((getTerminalSize().columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + bold(textColors.banner.title.${variant}(line)) + " ".repeat(Math.max(Math.ceil((getTerminalSize().columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + borderColors.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} });
|
|
83
|
-
}); `
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
});
|
|
81
|
+
get when() {
|
|
82
|
+
return isSetString(title) && !children;
|
|
87
83
|
},
|
|
88
|
-
children
|
|
84
|
+
get children() {
|
|
85
|
+
return code`splitText("${formatDescription(title || "")}", Math.max(getTerminalSize().columns - ${totalPadding.value}, 20)).forEach((line) => {
|
|
86
|
+
writeLine(borderColors.banner.outline.${variant}("${borderStyle.left}") + " ".repeat(Math.max(Math.floor((getTerminalSize().columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + bold(textColors.banner.title.${variant}(line)) + " ".repeat(Math.max(Math.ceil((getTerminalSize().columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + borderColors.banner.outline.${variant}("${borderStyle.right}"), { consoleFn: console.${consoleFnName} });
|
|
87
|
+
}); `;
|
|
88
|
+
}
|
|
89
89
|
}),
|
|
90
|
-
|
|
90
|
+
children,
|
|
91
91
|
createComponent(Show, {
|
|
92
92
|
get when() {
|
|
93
|
-
return isSetString(command?.title)
|
|
93
|
+
return isSetString(command?.title);
|
|
94
94
|
},
|
|
95
95
|
get children() {
|
|
96
96
|
return [createComponent(Show, {
|
|
97
97
|
when: insertNewlineBeforeCommand,
|
|
98
98
|
get children() {
|
|
99
|
-
return code`writeLine(borderColors.banner.outline.${variant}("${
|
|
99
|
+
return code`writeLine(borderColors.banner.outline.${variant}("${borderStyle.left}") + " ".repeat(Math.max(getTerminalSize().columns - ${bannerPadding.value}, 0)) + borderColors.banner.outline.${variant}("${borderStyle.right}"), { consoleFn: console.${consoleFnName} }); `;
|
|
100
100
|
}
|
|
101
|
-
}), memo(() => `writeLine(borderColors.banner.outline.${variant}("${
|
|
101
|
+
}), memo(() => code`writeLine(borderColors.banner.outline.${variant}("${borderStyle.left}") + " ".repeat(Math.max(Math.floor((getTerminalSize().columns - (stripAnsi("${formatDescription(command?.title || "")}").length + ${bannerPadding.value})) / 2), 0)) + bold(textColors.banner.command.${variant}("${formatDescription(command?.title || "")}")) + " ".repeat(Math.max(Math.ceil((getTerminalSize().columns - (stripAnsi("${formatDescription(command?.title || "")}").length + ${bannerPadding.value})) / 2), 0)) + borderColors.banner.outline.${variant}("${borderStyle.right}"), { consoleFn: console.${consoleFnName} }); `)];
|
|
102
102
|
}
|
|
103
103
|
}),
|
|
104
104
|
createComponent(Spacing, {}),
|
|
105
|
-
memo(() => code`splitText(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
105
|
+
memo(() => code`splitText(bold(textColors.banner.${command ? "description" : "command"}.${variant}(\`${formatDescription(description)}\`)), Math.max(${command ? `${totalPadding.value * 2} > getTerminalSize().columns / 2 ? getTerminalSize().columns - ${Math.max(bannerPadding.value + 4, 6)} : ` : ""}getTerminalSize().columns - ${totalPadding.value}, 20)).forEach((line) => {
|
|
106
|
+
writeLine(borderColors.banner.outline.${variant}("${borderStyle.left}") + " ".repeat(Math.max(Math.floor((getTerminalSize().columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + textColors.banner.description.${variant}(line) + " ".repeat(Math.max(Math.ceil((getTerminalSize().columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + borderColors.banner.outline.${variant}("${borderStyle.right}"), { consoleFn: console.${consoleFnName} });
|
|
107
|
+
}); `),
|
|
108
|
+
createComponent(Spacing, {}),
|
|
109
|
+
createComponent(Show, {
|
|
110
|
+
when: insertNewlineAfterDescription,
|
|
111
|
+
get children() {
|
|
112
|
+
return code`writeLine(borderColors.banner.outline.${variant}("${borderStyle.left}") + " ".repeat(Math.max(getTerminalSize().columns - ${bannerPadding.value}, 0)) + borderColors.banner.outline.${variant}("${borderStyle.right}"), { consoleFn: console.${consoleFnName} }); `;
|
|
113
|
+
}
|
|
114
|
+
}),
|
|
115
|
+
createComponent(Spacing, {}),
|
|
116
|
+
memo(() => code`writeLine(borderColors.banner.outline.${variant}("${borderStyle.bottomLeft}") + ${footer ? `borderColors.banner.outline.${variant}("${borderStyle.bottom}".repeat(Math.max(getTerminalSize().columns - ${footerStaticWidth.value}, 0))) + " " + bold(textColors.banner.footer.${variant}("${formatDescription(footer)}")) + " " + borderColors.banner.outline.${variant}("${borderStyle.bottom}".repeat(${headerRepeat.value}))` : `borderColors.banner.outline.${variant}("${borderStyle.bottom}".repeat(Math.max(getTerminalSize().columns - ${borderStyle.bottomLeft.length + borderStyle.bottomRight.length}, 0)))`} + borderColors.banner.outline.${variant}("${borderStyle.bottomRight}"), { consoleFn: console.${consoleFnName} }); `),
|
|
117
|
+
createComponent(Spacing, {}),
|
|
118
|
+
code`writeLine(""); `
|
|
115
119
|
];
|
|
116
120
|
}
|
|
117
121
|
/**
|
|
@@ -1 +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, For, 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 {\n formatDescription,\n getAppDescription,\n getAppTitle\n} 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 { isSetString } from \"@stryke/type-checks/is-set-string\";\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 (useMeta().get(\"banner\") || hasFlag(\"no-banner\") || hasFlag(\"hide-banner\") || isMinimal) {\n return;\n }\n\n useMeta().set(\"banner\", true); `}\n <Spacing />\n <Show when={insertNewlineBeforeBanner}>{code`writeLine(\"\"); `}</Show>\n <Spacing />\n\n {code`\n writeLine(borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].topLeft\n }\") + ${\n theme.icons.banner.header[variant]\n ? `borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].top\n }\".repeat(6)) + \" \" + ${\n theme.icons.banner.header[variant]\n ? `textColors.banner.header.${variant}(\"${\n theme.icons.banner.header[variant]\n }\") + \" \" + borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].top\n }\") + \" \" +`\n : \"\"\n } bold(textColors.banner.header.${variant}(\"${\n header\n }\")) + \" \" + borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].top\n }\".repeat(Math.max(getTerminalSize().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 : `borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].top\n }\".repeat(Math.max(getTerminalSize().columns - ${\n bannerPadding.value\n }, 0)))`\n } + borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].topRight\n }\"), { consoleFn: console.${consoleFnName} }); `}\n\n <Show\n when={!!children}\n fallback={\n <Show when={isSetString(title)}>\n <For each={title ? title.split(\"\\n\") : []} hardline>\n {line => code`splitText(\"${line}\",\n Math.max(getTerminalSize().columns - ${totalPadding.value}, 20)\n ).forEach((line) => {\n writeLine(borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].left\n }\") + \" \".repeat(Math.max(Math.floor((getTerminalSize().columns - (stripAnsi(line).length + ${\n bannerPadding.value\n })) / 2), 0)) + bold(textColors.banner.title.${variant}(line)) + \" \".repeat(Math.max(Math.ceil((getTerminalSize().columns - (stripAnsi(line).length + ${\n bannerPadding.value\n })) / 2), 0)) + borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].right\n }\"), { consoleFn: console.${consoleFnName} });\n }); `}\n </For>\n </Show>\n }>\n {children}\n </Show>\n <Spacing />\n\n <Show when={isSetString(command?.title) && !!command?.path}>\n <Show when={insertNewlineBeforeCommand}>\n {code`writeLine(borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].left\n }\") + \" \".repeat(Math.max(getTerminalSize().columns - ${\n bannerPadding.value\n })) + borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].right\n }\"), { consoleFn: console.${consoleFnName} }); `}\n </Show>\n {`writeLine(borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].left\n }\") + \" \".repeat(Math.max(Math.floor((getTerminalSize().columns - (stripAnsi(\"${\n command?.title\n }\").length ${command?.icon ? \" + 3\" : \"\"} + ${\n bannerPadding.value\n })) / 2), 0)) + bold(textColors.banner.command.${\n variant\n }(\"${command?.icon ? `${command.icon} ` : \"\"}${command?.title}\")) + \" \".repeat(Math.max(Math.ceil((getTerminalSize().columns - (stripAnsi(\"${command?.title}\").length ${\n command?.icon ? \" + 3\" : \"\"\n } + ${\n bannerPadding.value\n })) / 2), 0)) + borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].right\n }\"), { consoleFn: console.${consoleFnName} }); `}\n </Show>\n <Spacing />\n\n {code`splitText(\n bold(${\n command?.title\n ? \"textColors.banner.description\"\n : \"textColors.banner.command\"\n }.${variant}(\\`${formatDescription(description)}\\`)),\n Math.max(${\n command?.title\n ? `${totalPadding.value} * 2 > getTerminalSize().columns / 2 ? getTerminalSize().columns - 6 : getTerminalSize().columns - ${totalPadding.value}`\n : `getTerminalSize().columns - ${totalPadding.value}`\n } , 20)\n ).forEach((line) => {\n writeLine(borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].left\n }\") + \" \".repeat(Math.max(Math.floor((getTerminalSize().columns - (stripAnsi(line).length + ${\n bannerPadding.value\n })) / 2), 0)) + textColors.banner.description.${variant}(line) + \" \".repeat(Math.max(Math.ceil((getTerminalSize().columns - (stripAnsi(line).length + ${\n bannerPadding.value\n })) / 2), 0)) + borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].right\n }\"), { consoleFn: console.${consoleFnName} });\n });\n ${\n insertNewlineAfterDescription\n ? `writeLine(borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].left\n }\") + \" \".repeat(Math.max(getTerminalSize().columns - ${\n bannerPadding.value\n })) + borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].right\n }\"), { consoleFn: console.${consoleFnName} });`\n : \"\"\n }\n writeLine(borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].bottomLeft\n }\") + ${\n footer\n ? `borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].bottom\n }\".repeat(Math.max(getTerminalSize().columns - ${\n 8 + (footer ? footer.length : 0) + bannerPadding.value\n }, 0))) + \" \" + ${\n footer\n ? `bold(textColors.banner.footer.${variant}(\"${footer}\"))`\n : \"\"\n } + \" \" + borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].bottom\n }\".repeat(6))`\n : `borderColors.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].bottom\n }\".repeat(Math.max(getTerminalSize().columns - ${\n bannerPadding.value\n }, 0)))`\n } + borderColors.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 () =>\n context.config.banner.title ||\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={!children ? title.value : undefined}\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":";;;;;;;;;;;;;;;;AAyCA,SAAC,iCAAA,OAAA;CACC,MAAE,EACD,SACD,aACI;CACJ,MAAM,UAAC,eAAA;AACP,QAAA,gBAAA,qBAAA;EACA,UAAQ;;EAER,MAAM;;AAEN,UAAO,aAAA,YAAA,SAAA,KAAA,CAAA,6CAAA,UAAA,WAAA,QAAA,MAAA,aAAA,GAAA;;EAEL,YAAE,CAAA;GACA,MAAA;GACA,MAAM;GACN,SAAM;GACP,CAAC;EACF,IAAG,WAAO;AACR,UAAA,CAAA,UAAe,gBAAqB,aAAU;IAC7C,WAAQ,IAAA;IACR,UAAW,IAAC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AAA;CACrD,MAAM,QAAK,eAAA,QAAA,OAAA,OAAA,SAAA,YAAA,SAAA,KAAA,CAAA,QAAA,IAAA,QAAA,YAAA,WAAA,WAAA,GAAA,CAAA;CACX,MAAM,cAAS,eAAA,SAAA,eAAA,kBAAA,QAAA,CAAA;AACf,QAAO,gBAAO,kCAAA;EACP;EACL,IAAI,WAAS;AACX,UAAM,gBAAA,+BAAA;IACL,IAAA,QAAS;;;IAGR,IAAC,SAAW;AACV,YAAM,OAAA;;IAER,IAAI,cAAc;AAChB,YAAE,YAAc;;IAElB,IAAI,SAAM;AACR,YAAO,OAAA;;IAEP;IACM;IACC;IACT,4BAAW;IACgB;IACzB;IACH,CAAC;;EAEL,CAAC"}
|
|
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 {\n TSDoc,\n TSDocParam\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport {\n formatDescription,\n getAppDescription,\n getAppTitle\n} 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 { isSetString } from \"@stryke/type-checks/is-set-string\";\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 <>\n <TSDoc\n heading={`Write the ${getAppTitle(context, true)} command-line interface application banner ${\n command ? `for the ${command.title} command ` : \"\"\n }to the console.`}>\n <TSDocParam name=\"sleepTimeoutMs\">\n {`The amount of time in milliseconds to sleep before displaying the banner. This can be used to create a delay before the banner is shown, allowing for any necessary setup or initialization to occur first. The default value is 500 milliseconds.`}\n </TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"showBanner\"\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}\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 borderStyle = theme.borderStyles.banner.outline[variant];\n const icon = theme.icons.banner.header[variant];\n\n const bannerPadding = computed(\n () =>\n Math.max(theme.padding.app, 0) * 2 +\n borderStyle.left.length +\n borderStyle.right.length\n );\n const innerPadding = computed(() => Math.max(theme.padding.banner, 2));\n const totalPadding = computed(\n () => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value\n );\n const headerRepeat = computed(() =>\n Math.max(Math.floor(innerPadding.value / 2) - 1, 2)\n );\n const headerStaticWidth = computed(\n () =>\n borderStyle.topLeft.length +\n headerRepeat.value +\n (icon ? 1 + icon.length + 1 + borderStyle.top.length + 1 : 1) +\n (header ? header.length : 0) +\n 1 +\n borderStyle.topRight.length\n );\n const footerStaticWidth = computed(\n () =>\n borderStyle.bottomLeft.length +\n 1 +\n (footer ? footer.length : 0) +\n 1 +\n headerRepeat.value +\n borderStyle.bottomRight.length\n );\n\n return (\n <>\n {code`\n if (useMeta().get(\"banner\") || hasFlag(\"no-banner\") || hasFlag(\"hide-banner\") || isMinimal) {\n return;\n }\n\n useMeta().set(\"banner\", true); `}\n <Spacing />\n <Show when={insertNewlineBeforeBanner}>{code`writeLine(\"\"); `}</Show>\n <Spacing />\n {code`writeLine(borderColors.banner.outline.${variant}(\"${\n borderStyle.topLeft\n }\") + borderColors.banner.outline.${\n variant\n }(\"${borderStyle.top}\".repeat(${headerRepeat.value}))${\n icon\n ? ` + \" \" + textColors.banner.header.${\n variant\n }(\"${icon}\") + \" \" + borderColors.banner.outline.${variant}(\"${\n borderStyle.top\n }\")`\n : \"\"\n } + \" \" + bold(textColors.banner.header.${variant}(\"${formatDescription(\n header || \"\"\n )}\")) + \" \" + borderColors.banner.outline.${\n variant\n }(\"${borderStyle.top}\".repeat(Math.max(getTerminalSize().columns - ${\n headerStaticWidth.value\n }, 0))) + borderColors.banner.outline.${\n variant\n }(\"${borderStyle.topRight}\"), { consoleFn: console.${consoleFnName} }); `}\n <Spacing />\n <Show when={isSetString(title) && !children}>\n {code`splitText(\"${formatDescription(\n title || \"\"\n )}\", Math.max(getTerminalSize().columns - ${\n totalPadding.value\n }, 20)).forEach((line) => {\n writeLine(borderColors.banner.outline.${variant}(\"${\n borderStyle.left\n }\") + \" \".repeat(Math.max(Math.floor((getTerminalSize().columns - (stripAnsi(line).length + ${\n bannerPadding.value\n })) / 2), 0)) + bold(textColors.banner.title.${\n variant\n }(line)) + \" \".repeat(Math.max(Math.ceil((getTerminalSize().columns - (stripAnsi(line).length + ${\n bannerPadding.value\n })) / 2), 0)) + borderColors.banner.outline.${variant}(\"${\n borderStyle.right\n }\"), { consoleFn: console.${consoleFnName} });\n }); `}\n </Show>\n {children}\n <Show when={isSetString(command?.title)}>\n <Show when={insertNewlineBeforeCommand}>\n {code`writeLine(borderColors.banner.outline.${variant}(\"${\n borderStyle.left\n }\") + \" \".repeat(Math.max(getTerminalSize().columns - ${\n bannerPadding.value\n }, 0)) + borderColors.banner.outline.${variant}(\"${\n borderStyle.right\n }\"), { consoleFn: console.${consoleFnName} }); `}\n </Show>\n {code`writeLine(borderColors.banner.outline.${variant}(\"${\n borderStyle.left\n }\") + \" \".repeat(Math.max(Math.floor((getTerminalSize().columns - (stripAnsi(\"${formatDescription(\n command?.title || \"\"\n )}\").length + ${\n bannerPadding.value\n })) / 2), 0)) + bold(textColors.banner.command.${\n variant\n }(\"${formatDescription(\n command?.title || \"\"\n )}\")) + \" \".repeat(Math.max(Math.ceil((getTerminalSize().columns - (stripAnsi(\"${formatDescription(\n command?.title || \"\"\n )}\").length + ${\n bannerPadding.value\n })) / 2), 0)) + borderColors.banner.outline.${variant}(\"${\n borderStyle.right\n }\"), { consoleFn: console.${consoleFnName} }); `}\n </Show>\n <Spacing />\n {code`splitText(bold(textColors.banner.${\n command ? \"description\" : \"command\"\n }.${variant}(\\`${formatDescription(description)}\\`)), Math.max(${\n command\n ? `${\n totalPadding.value * 2\n } > getTerminalSize().columns / 2 ? getTerminalSize().columns - ${Math.max(\n bannerPadding.value + 4,\n 6\n )} : `\n : \"\"\n }getTerminalSize().columns - ${\n totalPadding.value\n }, 20)).forEach((line) => {\n writeLine(borderColors.banner.outline.${\n variant\n }(\"${borderStyle.left}\") + \" \".repeat(Math.max(Math.floor((getTerminalSize().columns - (stripAnsi(line).length + ${\n bannerPadding.value\n })) / 2), 0)) + textColors.banner.description.${\n variant\n }(line) + \" \".repeat(Math.max(Math.ceil((getTerminalSize().columns - (stripAnsi(line).length + ${\n bannerPadding.value\n })) / 2), 0)) + borderColors.banner.outline.${variant}(\"${\n borderStyle.right\n }\"), { consoleFn: console.${consoleFnName} });\n }); `}\n <Spacing />\n <Show when={insertNewlineAfterDescription}>\n {code`writeLine(borderColors.banner.outline.${variant}(\"${\n borderStyle.left\n }\") + \" \".repeat(Math.max(getTerminalSize().columns - ${\n bannerPadding.value\n }, 0)) + borderColors.banner.outline.${variant}(\"${\n borderStyle.right\n }\"), { consoleFn: console.${consoleFnName} }); `}\n </Show>\n <Spacing />\n {code`writeLine(borderColors.banner.outline.${variant}(\"${\n borderStyle.bottomLeft\n }\") + ${\n footer\n ? `borderColors.banner.outline.${variant}(\"${\n borderStyle.bottom\n }\".repeat(Math.max(getTerminalSize().columns - ${\n footerStaticWidth.value\n }, 0))) + \" \" + bold(textColors.banner.footer.${\n variant\n }(\"${formatDescription(\n footer\n )}\")) + \" \" + borderColors.banner.outline.${variant}(\"${\n borderStyle.bottom\n }\".repeat(${headerRepeat.value}))`\n : `borderColors.banner.outline.${variant}(\"${\n borderStyle.bottom\n }\".repeat(Math.max(getTerminalSize().columns - ${\n borderStyle.bottomLeft.length + borderStyle.bottomRight.length\n }, 0)))`\n } + borderColors.banner.outline.${variant}(\"${\n borderStyle.bottomRight\n }\"), { consoleFn: console.${consoleFnName} }); `}\n <Spacing />\n {code`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 () =>\n context.config.banner.title ||\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={!children ? title.value : undefined}\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":";;;;;;;;;;;;;;;;;;CA2CE,MAAA,EACE,SACH,aACG;CACF,MAAM,UAAS,eAAqC;AACpD,QAAA,CAAA,gBAAA,OAAA;EACF,IAAO,UAAS;AACd,UAAO,aAAA,YAAA,SAAA,KAAA,CAAA,6CAAA,UAAA,WAAA,QAAA,MAAA,aAAA,GAAA;;EAEP,IAAM,WAAW;;IAEX,MAAA;;IAEN,CAAM;;EAEL,CAAC,EAAE,gBAAC,qBAAA;EACH,UAAI;EAC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A,GAAA,CAAA;CACN,MAAM,cAAc,eAAc,SAAS,eAAgB,kBAAa,QAAA,CAAA;AACxE,QAAM,gBAAkB,kCAAA;EACb;EACT,IAAI,WAAA;AACF,UAAK,gBAAoB,+BAA4B;IACpD,IAAA,QAAS;AACT,YAAU,CAAC,WAAW,MAAM,QAAM;;IAEjC,IAAE,SAAU;AACV,YAAO,OAAK;;IAEd,IAAG,cAAc;AACrB,YAAU,YAAa;;IAEnB,IAAI,SAAS;AACf,YAAA,OAAc;;IAEd;IACa;IACb;IACE,4BAAyB;IACf;IACP;IACJ,CAAA;;EAEJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shell-shock/plugin-banner",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing a Shell Shock plugin to generate banner built-in modules that display information about the application.",
|
|
6
6
|
"keywords": [
|
|
@@ -52,19 +52,19 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@alloy-js/core": "0.23.0-dev.8",
|
|
54
54
|
"@alloy-js/typescript": "0.23.0-dev.4",
|
|
55
|
-
"@powerlines/deepkit": "^0.
|
|
56
|
-
"@powerlines/plugin-alloy": "^0.26.
|
|
57
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
58
|
-
"@shell-shock/core": "^0.17.
|
|
59
|
-
"@shell-shock/plugin-theme": "^0.4.
|
|
60
|
-
"@shell-shock/plugin-console": "^0.2.
|
|
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
61
|
"@stryke/path": "^0.27.4",
|
|
62
62
|
"@stryke/type-checks": "^0.6.1",
|
|
63
63
|
"defu": "^6.1.7",
|
|
64
|
-
"powerlines": "^0.42.
|
|
64
|
+
"powerlines": "^0.42.38"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@powerlines/plugin-deepkit": "^0.11.
|
|
67
|
+
"@powerlines/plugin-deepkit": "^0.11.278",
|
|
68
68
|
"@types/node": "^25.6.0"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": { "access": "public" },
|
|
@@ -155,5 +155,5 @@
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
},
|
|
158
|
-
"gitHead": "
|
|
158
|
+
"gitHead": "1364666ac28f03cca26271afb582c71a2fe12ecd"
|
|
159
159
|
}
|