@shell-shock/preset-cli 0.0.7 → 0.1.1
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/README.md +1 -1
- package/dist/components/banner-function-declaration.cjs +83 -0
- package/dist/components/banner-function-declaration.d.cts +16 -0
- package/dist/components/banner-function-declaration.d.cts.map +1 -0
- package/dist/components/banner-function-declaration.d.mts +16 -0
- package/dist/components/banner-function-declaration.d.mts.map +1 -0
- package/dist/components/banner-function-declaration.mjs +83 -0
- package/dist/components/banner-function-declaration.mjs.map +1 -0
- package/dist/components/index.cjs +2 -2
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.mts +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/helpers/get-default-options.cjs +4 -39
- package/dist/helpers/get-default-options.mjs +6 -41
- package/dist/helpers/get-default-options.mjs.map +1 -1
- package/dist/index.cjs +97 -44
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +98 -45
- package/dist/index.mjs.map +1 -1
- package/package.json +18 -19
- package/dist/components/banner.cjs +0 -64
- package/dist/components/banner.d.cts +0 -47
- package/dist/components/banner.d.cts.map +0 -1
- package/dist/components/banner.d.mts +0 -47
- package/dist/components/banner.d.mts.map +0 -1
- package/dist/components/banner.mjs +0 -64
- package/dist/components/banner.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ This package is part of the ⚡<b>Shell Shock</b> monorepo. The Shell Shock pack
|
|
|
27
27
|
|
|
28
28
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
29
29
|
|
|
30
|
-
[](https://stormsoftware.com/projects/shell-shock/) [](http://commitizen.github.io/cz-cli/)  
|
|
31
31
|
|
|
32
32
|
<!-- prettier-ignore-start -->
|
|
33
33
|
<!-- markdownlint-disable -->
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
3
|
+
let __alloy_js_core = require("@alloy-js/core");
|
|
4
|
+
let __alloy_js_typescript = require("@alloy-js/typescript");
|
|
5
|
+
let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
6
|
+
let __shell_shock_core_contexts_command = require("@shell-shock/core/contexts/command");
|
|
7
|
+
let __shell_shock_core_plugin_utils_context_helpers = require("@shell-shock/core/plugin-utils/context-helpers");
|
|
8
|
+
let __shell_shock_preset_script_contexts_theme = require("@shell-shock/preset-script/contexts/theme");
|
|
9
|
+
let cfonts = require("cfonts");
|
|
10
|
+
|
|
11
|
+
//#region src/components/banner-function-declaration.tsx
|
|
12
|
+
/**
|
|
13
|
+
* A component to generate the `banner` function in the `shell-shock:console` builtin module.
|
|
14
|
+
*/
|
|
15
|
+
function BannerFunctionDeclaration(props) {
|
|
16
|
+
const { consoleFnName = "log", variant = "primary", title: titleProp } = props;
|
|
17
|
+
const theme = (0, __shell_shock_preset_script_contexts_theme.useTheme)();
|
|
18
|
+
const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
19
|
+
const command = (0, __shell_shock_core_contexts_command.useCommand)();
|
|
20
|
+
const header = (0, __alloy_js_core.computed)(() => `${theme.labels.banner.header[variant] || (0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context)} v${context.packageJson.version || "1.0.0"}`);
|
|
21
|
+
const description = (0, __alloy_js_core.computed)(() => command?.description || (0, __shell_shock_core_plugin_utils_context_helpers.getAppDescription)(context));
|
|
22
|
+
const footer = (0, __alloy_js_core.computed)(() => theme.labels.banner.footer[variant]);
|
|
23
|
+
const title = (0, __alloy_js_core.computed)(() => titleProp || /(?:cli|command-line|command line)\s+(?:application|app)?$/.test(header.value.toLowerCase()) ? header.value.replace(`v${context.packageJson.version || "1.0.0"}`, "").trim() : `${header.value.replace(`v${context.packageJson.version || "1.0.0"}`, "").trim()} Command-Line Application`);
|
|
24
|
+
const titleLines = (0, __alloy_js_core.computed)(() => {
|
|
25
|
+
const result = (0, cfonts.render)((0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context), {
|
|
26
|
+
font: "tiny",
|
|
27
|
+
align: "left",
|
|
28
|
+
colors: ["system"],
|
|
29
|
+
background: "transparent",
|
|
30
|
+
letterSpacing: 1,
|
|
31
|
+
lineHeight: 1,
|
|
32
|
+
gradient: false,
|
|
33
|
+
transitionGradient: false,
|
|
34
|
+
env: "node"
|
|
35
|
+
});
|
|
36
|
+
if (!result) return [(0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context)];
|
|
37
|
+
return result.array;
|
|
38
|
+
});
|
|
39
|
+
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);
|
|
40
|
+
const totalPadding = (0, __alloy_js_core.computed)(() => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value);
|
|
41
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
|
|
42
|
+
name: "banner",
|
|
43
|
+
get doc() {
|
|
44
|
+
return `Write the ${(0, __shell_shock_core_plugin_utils_context_helpers.getAppTitle)(context)} application banner ${command ? `for the ${command.title} command ` : ""}to the console.`;
|
|
45
|
+
},
|
|
46
|
+
get children() {
|
|
47
|
+
return __alloy_js_core.code`
|
|
48
|
+
if (hasFlag("no-banner") || hasFlag("hide-banner") || isCI || isMinimal) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const titleLines = [${titleLines.value.map((line) => JSON.stringify(line)).join(", ")}];
|
|
53
|
+
const title = Math.max(...titleLines.map(line => stripAnsi(line).trim().length)) > Math.max(process.stdout.columns - ${totalPadding.value}, 0)
|
|
54
|
+
? ["${title.value}"]
|
|
55
|
+
: titleLines;
|
|
56
|
+
|
|
57
|
+
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(4)) + " " + ${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.value}")) + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}".repeat(Math.max(process.stdout.columns - ${4 + (theme.icons.banner.header[variant] ? theme.icons.banner.header[variant].length + 3 : 0) + (header.value ? header.value.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} });
|
|
58
|
+
|
|
59
|
+
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} });
|
|
60
|
+
|
|
61
|
+
title.map(line => line.trim()).forEach((line) => {
|
|
62
|
+
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.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} });
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
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} });
|
|
66
|
+
|
|
67
|
+
${command?.title ? `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.command.${variant}("${command.title}")) + " ".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} }); ` : ""}
|
|
68
|
+
|
|
69
|
+
splitText(
|
|
70
|
+
${command?.title ? "colors.text.banner.description" : "colors.text.banner.command"}.${variant}("${description.value.replace(/"/g, "\\\"")}"),
|
|
71
|
+
Math.max(process.stdout.columns - ${totalPadding.value}, 0)
|
|
72
|
+
).forEach((line) => {
|
|
73
|
+
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} });
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottomLeft}") + ${footer.value ? `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottom}".repeat(Math.max(process.stdout.columns - ${6 + (footer.value ? footer.value.length : 0) + bannerPadding.value}, 0))) + " " + ${footer.value ? `colors.bold(colors.text.banner.footer.${variant}("${footer.value}"))` : ""} + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottom}".repeat(4))` : `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} });
|
|
77
|
+
`;
|
|
78
|
+
}
|
|
79
|
+
})];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
exports.BannerFunctionDeclaration = BannerFunctionDeclaration;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
+
import { ThemeColorVariant } from "@shell-shock/plugin-theme/types/theme";
|
|
3
|
+
|
|
4
|
+
//#region src/components/banner-function-declaration.d.ts
|
|
5
|
+
interface BannerFunctionDeclarationProps {
|
|
6
|
+
variant?: ThemeColorVariant;
|
|
7
|
+
consoleFnName?: "log" | "info" | "warn" | "error" | "debug";
|
|
8
|
+
title?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A component to generate the `banner` function in the `shell-shock:console` builtin module.
|
|
12
|
+
*/
|
|
13
|
+
declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps): _alloy_js_core0.Children;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { BannerFunctionDeclaration, BannerFunctionDeclarationProps };
|
|
16
|
+
//# 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"],"sourcesContent":[],"mappings":";;;;UA+BiB,8BAAA;YACL;;EADK,KAAA,CAAA,EAAA,MAAA;AASjB;;;;iBAAgB,yBAAA,QACP,iCAA8B,eAAA,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
+
import { ThemeColorVariant } from "@shell-shock/plugin-theme/types/theme";
|
|
3
|
+
|
|
4
|
+
//#region src/components/banner-function-declaration.d.ts
|
|
5
|
+
interface BannerFunctionDeclarationProps {
|
|
6
|
+
variant?: ThemeColorVariant;
|
|
7
|
+
consoleFnName?: "log" | "info" | "warn" | "error" | "debug";
|
|
8
|
+
title?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A component to generate the `banner` function in the `shell-shock:console` builtin module.
|
|
12
|
+
*/
|
|
13
|
+
declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps): _alloy_js_core0.Children;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { BannerFunctionDeclaration, BannerFunctionDeclarationProps };
|
|
16
|
+
//# 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"],"sourcesContent":[],"mappings":";;;;UA+BiB,8BAAA;YACL;;EADK,KAAA,CAAA,EAAA,MAAA;AASjB;;;;iBAAgB,yBAAA,QACP,iCAA8B,eAAA,CAAA"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { code, computed } from "@alloy-js/core";
|
|
3
|
+
import { FunctionDeclaration } from "@alloy-js/typescript";
|
|
4
|
+
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
5
|
+
import { useCommand } from "@shell-shock/core/contexts/command";
|
|
6
|
+
import { getAppDescription, getAppTitle } from "@shell-shock/core/plugin-utils/context-helpers";
|
|
7
|
+
import { useTheme } from "@shell-shock/preset-script/contexts/theme";
|
|
8
|
+
import { render } from "cfonts";
|
|
9
|
+
|
|
10
|
+
//#region src/components/banner-function-declaration.tsx
|
|
11
|
+
/**
|
|
12
|
+
* A component to generate the `banner` function in the `shell-shock:console` builtin module.
|
|
13
|
+
*/
|
|
14
|
+
function BannerFunctionDeclaration(props) {
|
|
15
|
+
const { consoleFnName = "log", variant = "primary", title: titleProp } = props;
|
|
16
|
+
const theme = useTheme();
|
|
17
|
+
const context = usePowerlines();
|
|
18
|
+
const command = useCommand();
|
|
19
|
+
const header = computed(() => `${theme.labels.banner.header[variant] || getAppTitle(context)} v${context.packageJson.version || "1.0.0"}`);
|
|
20
|
+
const description = computed(() => command?.description || getAppDescription(context));
|
|
21
|
+
const footer = computed(() => theme.labels.banner.footer[variant]);
|
|
22
|
+
const title = computed(() => titleProp || /(?:cli|command-line|command line)\s+(?:application|app)?$/.test(header.value.toLowerCase()) ? header.value.replace(`v${context.packageJson.version || "1.0.0"}`, "").trim() : `${header.value.replace(`v${context.packageJson.version || "1.0.0"}`, "").trim()} Command-Line Application`);
|
|
23
|
+
const titleLines = computed(() => {
|
|
24
|
+
const result = render(getAppTitle(context), {
|
|
25
|
+
font: "tiny",
|
|
26
|
+
align: "left",
|
|
27
|
+
colors: ["system"],
|
|
28
|
+
background: "transparent",
|
|
29
|
+
letterSpacing: 1,
|
|
30
|
+
lineHeight: 1,
|
|
31
|
+
gradient: false,
|
|
32
|
+
transitionGradient: false,
|
|
33
|
+
env: "node"
|
|
34
|
+
});
|
|
35
|
+
if (!result) return [getAppTitle(context)];
|
|
36
|
+
return result.array;
|
|
37
|
+
});
|
|
38
|
+
const bannerPadding = computed(() => Math.max(theme.padding.app, 0) * 2 + theme.borderStyles.banner.outline[variant].left.length + theme.borderStyles.banner.outline[variant].right.length);
|
|
39
|
+
const totalPadding = computed(() => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value);
|
|
40
|
+
return [createComponent(FunctionDeclaration, {
|
|
41
|
+
name: "banner",
|
|
42
|
+
get doc() {
|
|
43
|
+
return `Write the ${getAppTitle(context)} application banner ${command ? `for the ${command.title} command ` : ""}to the console.`;
|
|
44
|
+
},
|
|
45
|
+
get children() {
|
|
46
|
+
return code`
|
|
47
|
+
if (hasFlag("no-banner") || hasFlag("hide-banner") || isCI || isMinimal) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const titleLines = [${titleLines.value.map((line) => JSON.stringify(line)).join(", ")}];
|
|
52
|
+
const title = Math.max(...titleLines.map(line => stripAnsi(line).trim().length)) > Math.max(process.stdout.columns - ${totalPadding.value}, 0)
|
|
53
|
+
? ["${title.value}"]
|
|
54
|
+
: titleLines;
|
|
55
|
+
|
|
56
|
+
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(4)) + " " + ${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.value}")) + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}".repeat(Math.max(process.stdout.columns - ${4 + (theme.icons.banner.header[variant] ? theme.icons.banner.header[variant].length + 3 : 0) + (header.value ? header.value.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} });
|
|
57
|
+
|
|
58
|
+
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} });
|
|
59
|
+
|
|
60
|
+
title.map(line => line.trim()).forEach((line) => {
|
|
61
|
+
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.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} });
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
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} });
|
|
65
|
+
|
|
66
|
+
${command?.title ? `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.command.${variant}("${command.title}")) + " ".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} }); ` : ""}
|
|
67
|
+
|
|
68
|
+
splitText(
|
|
69
|
+
${command?.title ? "colors.text.banner.description" : "colors.text.banner.command"}.${variant}("${description.value.replace(/"/g, "\\\"")}"),
|
|
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.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} });
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottomLeft}") + ${footer.value ? `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottom}".repeat(Math.max(process.stdout.columns - ${6 + (footer.value ? footer.value.length : 0) + bannerPadding.value}, 0))) + " " + ${footer.value ? `colors.bold(colors.text.banner.footer.${variant}("${footer.value}"))` : ""} + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottom}".repeat(4))` : `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} });
|
|
76
|
+
`;
|
|
77
|
+
}
|
|
78
|
+
})];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
//#endregion
|
|
82
|
+
export { BannerFunctionDeclaration };
|
|
83
|
+
//# sourceMappingURL=banner-function-declaration.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner-function-declaration.mjs","names":["code","computed","FunctionDeclaration","usePowerlines","useCommand","getAppDescription","getAppTitle","useTheme","render","BannerFunctionDeclaration","props","consoleFnName","variant","title","titleProp","theme","context","command","header","labels","banner","packageJson","version","description","footer","test","value","toLowerCase","replace","trim","titleLines","result","font","align","colors","background","letterSpacing","lineHeight","gradient","transitionGradient","env","array","bannerPadding","Math","max","padding","app","borderStyles","outline","left","length","right","totalPadding","_$createComponent","name","doc","children","map","line","JSON","stringify","join","topLeft","icons","top","topRight","bottomLeft","bottom","bottomRight"],"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 { code, computed } from \"@alloy-js/core\";\nimport { FunctionDeclaration } from \"@alloy-js/typescript\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { useCommand } from \"@shell-shock/core/contexts/command\";\nimport {\n getAppDescription,\n getAppTitle\n} from \"@shell-shock/core/plugin-utils/context-helpers\";\nimport type { ThemeColorVariant } from \"@shell-shock/plugin-theme/types/theme\";\nimport { useTheme } from \"@shell-shock/preset-script/contexts/theme\";\nimport { render } from \"cfonts\";\nimport type { CLIPresetContext } from \"../types/plugin\";\n\nexport interface BannerFunctionDeclarationProps {\n variant?: ThemeColorVariant;\n consoleFnName?: \"log\" | \"info\" | \"warn\" | \"error\" | \"debug\";\n title?: string;\n}\n\n/**\n * A component to generate the `banner` function in the `shell-shock:console` builtin module.\n */\nexport function BannerFunctionDeclaration(\n props: BannerFunctionDeclarationProps\n) {\n const {\n consoleFnName = \"log\",\n variant = \"primary\",\n title: titleProp\n } = props;\n\n const theme = useTheme();\n\n const context = usePowerlines<CLIPresetContext>();\n const command = useCommand();\n\n const header = computed(\n () =>\n `${theme.labels.banner.header[variant] || getAppTitle(context)} v${context.packageJson.version || \"1.0.0\"}`\n );\n const description = computed(\n () => command?.description || getAppDescription(context)\n );\n const footer = computed(() => theme.labels.banner.footer[variant]);\n\n const title = computed(() =>\n titleProp ||\n /(?:cli|command-line|command line)\\s+(?:application|app)?$/.test(\n header.value.toLowerCase()\n )\n ? header.value\n .replace(`v${context.packageJson.version || \"1.0.0\"}`, \"\")\n .trim()\n : `${header.value\n .replace(`v${context.packageJson.version || \"1.0.0\"}`, \"\")\n .trim()} Command-Line Application`\n );\n\n const titleLines = computed(() => {\n const result = render(getAppTitle(context), {\n font: \"tiny\",\n align: \"left\",\n colors: [\"system\"],\n background: \"transparent\",\n letterSpacing: 1,\n lineHeight: 1,\n gradient: false,\n transitionGradient: false,\n env: \"node\"\n });\n if (!result) {\n return [getAppTitle(context)];\n }\n\n return result.array;\n });\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 <FunctionDeclaration\n name=\"banner\"\n doc={`Write the ${getAppTitle(context)} application banner ${\n command ? `for the ${command.title} command ` : \"\"\n }to the console.`}>\n {code`\n if (hasFlag(\"no-banner\") || hasFlag(\"hide-banner\") || isCI || isMinimal) {\n return;\n }\n\n const titleLines = [${titleLines.value\n .map(line => JSON.stringify(line))\n .join(\", \")}];\n const title = Math.max(...titleLines.map(line => stripAnsi(line).trim().length)) > Math.max(process.stdout.columns - ${\n totalPadding.value\n }, 0)\n ? [\"${title.value}\"]\n : titleLines;\n\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(4)) + \" \" + ${\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.value\n }\")) + \" \" + colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].top\n }\".repeat(Math.max(process.stdout.columns - ${\n 4 +\n (theme.icons.banner.header[variant]\n ? theme.icons.banner.header[variant].length + 3\n : 0) +\n (header.value ? header.value.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 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 title.map(line => line.trim()).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.title.${\n variant\n }(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 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 command?.title\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.command.${\n variant\n }(\"${command.title}\")) + \" \".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 splitText(\n ${\n command?.title\n ? \"colors.text.banner.description\"\n : \"colors.text.banner.command\"\n }.${variant}(\"${description.value.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 writeLine(colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].bottomLeft\n }\") + ${\n footer.value\n ? `colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].bottom\n }\".repeat(Math.max(process.stdout.columns - ${\n 6 +\n (footer.value ? footer.value.length : 0) +\n bannerPadding.value\n }, 0))) + \" \" + ${\n footer.value\n ? `colors.bold(colors.text.banner.footer.${variant}(\"${footer.value}\"))`\n : \"\"\n } + \" \" + colors.border.banner.outline.${variant}(\"${\n theme.borderStyles.banner.outline[variant].bottom\n }\".repeat(4))`\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 }\"), { cons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AAO4B,QAAQpC,SAASuC,MAAK,2BACtBxC,cAAa;;;iDAGFC,QAAO,IAC9CG,MAAMgC,aAAa3B,OAAO4B,QAAQpC,SAASsD,WAAU,OAErD1C,OAAOE,QACH,gCAAgCd,QAAO,IACrCG,MAAMgC,aAAa3B,OAAO4B,QAAQpC,SAASuD,OAAM,6CAEjD,KACC3C,OAAOE,QAAQF,OAAOE,MAAMwB,SAAS,KACtCR,cAAchB,MAAK,iBAEnBF,OAAOE,QACH,yCAAyCd,QAAO,IAAKY,OAAOE,MAAK,OACjE,GAAE,wCACiCd,QAAO,IAC9CG,MAAMgC,aAAa3B,OAAO4B,QAAQpC,SAASuD,OAAM,gBAEnD,gCAAgCvD,QAAO,IACrCG,MAAMgC,aAAa3B,OAAO4B,QAAQpC,SAASuD,OAAM,6CAEjDzB,cAAchB,MAAK,QACb,kCACqBd,QAAO,IACxCG,MAAMgC,aAAa3B,OAAO4B,QAAQpC,SAASwD,YAAW,2BAC5BzD,cAAa;;;EAChD,CAAA,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_components_banner_function_declaration = require('./banner-function-declaration.cjs');
|
|
2
2
|
|
|
3
|
-
exports.BannerFunctionDeclaration =
|
|
3
|
+
exports.BannerFunctionDeclaration = require_components_banner_function_declaration.BannerFunctionDeclaration;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BannerFunctionDeclaration, BannerFunctionDeclarationProps } from "./banner.cjs";
|
|
1
|
+
import { BannerFunctionDeclaration, BannerFunctionDeclarationProps } from "./banner-function-declaration.cjs";
|
|
2
2
|
export { BannerFunctionDeclaration, BannerFunctionDeclarationProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BannerFunctionDeclaration, BannerFunctionDeclarationProps } from "./banner.mjs";
|
|
1
|
+
import { BannerFunctionDeclaration, BannerFunctionDeclarationProps } from "./banner-function-declaration.mjs";
|
|
2
2
|
export { BannerFunctionDeclaration, BannerFunctionDeclarationProps };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
3
|
+
let __shell_shock_preset_script_helpers_get_default_options = require("@shell-shock/preset-script/helpers/get-default-options");
|
|
3
4
|
|
|
4
5
|
//#region src/helpers/get-default-options.ts
|
|
5
6
|
/**
|
|
@@ -11,30 +12,11 @@ let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type"
|
|
|
11
12
|
*/
|
|
12
13
|
function getDefaultOptions(context, _) {
|
|
13
14
|
return [
|
|
14
|
-
|
|
15
|
-
name: "help",
|
|
16
|
-
title: "Help",
|
|
17
|
-
description: "Show help information.",
|
|
18
|
-
alias: ["h", "?"],
|
|
19
|
-
kind: __powerlines_deepkit_vendor_type.ReflectionKind.boolean,
|
|
20
|
-
optional: true,
|
|
21
|
-
default: false,
|
|
22
|
-
skipAddingNegative: true
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: "version",
|
|
26
|
-
title: "Version",
|
|
27
|
-
description: "Show the version of the application.",
|
|
28
|
-
alias: ["v"],
|
|
29
|
-
kind: __powerlines_deepkit_vendor_type.ReflectionKind.boolean,
|
|
30
|
-
optional: true,
|
|
31
|
-
default: false,
|
|
32
|
-
skipAddingNegative: true
|
|
33
|
-
},
|
|
15
|
+
...(0, __shell_shock_preset_script_helpers_get_default_options.getDefaultOptions)(),
|
|
34
16
|
context.config.interactive !== "never" && context.config.interactive !== true && {
|
|
35
17
|
name: "interactive",
|
|
36
18
|
title: "Interactive",
|
|
37
|
-
description: "Enable interactive mode
|
|
19
|
+
description: "Enable interactive mode - will be set to false if running in a CI pipeline.",
|
|
38
20
|
alias: ["i", "interact"],
|
|
39
21
|
kind: __powerlines_deepkit_vendor_type.ReflectionKind.boolean,
|
|
40
22
|
optional: true,
|
|
@@ -43,29 +25,12 @@ function getDefaultOptions(context, _) {
|
|
|
43
25
|
context.config.interactive !== "never" && context.config.interactive !== false && {
|
|
44
26
|
name: "no-interactive",
|
|
45
27
|
title: "Non-Interactive",
|
|
46
|
-
description: "Disable interactive mode
|
|
28
|
+
description: "Disable interactive mode - will be set to true if running in a CI pipeline.",
|
|
47
29
|
alias: ["no-interact"],
|
|
48
30
|
kind: __powerlines_deepkit_vendor_type.ReflectionKind.boolean,
|
|
49
31
|
optional: true,
|
|
50
32
|
default: false,
|
|
51
33
|
isNegativeOf: "interactive"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
name: "no-banner",
|
|
55
|
-
title: "Hide Banner",
|
|
56
|
-
description: "Hide the banner displayed while running the CLI application (will be set to true if running in a CI pipeline).",
|
|
57
|
-
kind: __powerlines_deepkit_vendor_type.ReflectionKind.boolean,
|
|
58
|
-
optional: true,
|
|
59
|
-
default: false
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: "verbose",
|
|
63
|
-
title: "Verbose",
|
|
64
|
-
description: "Enable verbose output.",
|
|
65
|
-
kind: __powerlines_deepkit_vendor_type.ReflectionKind.boolean,
|
|
66
|
-
optional: true,
|
|
67
|
-
default: false,
|
|
68
|
-
skipAddingNegative: true
|
|
69
34
|
}
|
|
70
35
|
].filter(Boolean);
|
|
71
36
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
|
|
2
|
+
import { getDefaultOptions } from "@shell-shock/preset-script/helpers/get-default-options";
|
|
2
3
|
|
|
3
4
|
//#region src/helpers/get-default-options.ts
|
|
4
5
|
/**
|
|
@@ -8,32 +9,13 @@ import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
|
|
|
8
9
|
* @param _ - The command input.
|
|
9
10
|
* @returns The default command options.
|
|
10
11
|
*/
|
|
11
|
-
function getDefaultOptions(context, _) {
|
|
12
|
+
function getDefaultOptions$1(context, _) {
|
|
12
13
|
return [
|
|
13
|
-
|
|
14
|
-
name: "help",
|
|
15
|
-
title: "Help",
|
|
16
|
-
description: "Show help information.",
|
|
17
|
-
alias: ["h", "?"],
|
|
18
|
-
kind: ReflectionKind.boolean,
|
|
19
|
-
optional: true,
|
|
20
|
-
default: false,
|
|
21
|
-
skipAddingNegative: true
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: "version",
|
|
25
|
-
title: "Version",
|
|
26
|
-
description: "Show the version of the application.",
|
|
27
|
-
alias: ["v"],
|
|
28
|
-
kind: ReflectionKind.boolean,
|
|
29
|
-
optional: true,
|
|
30
|
-
default: false,
|
|
31
|
-
skipAddingNegative: true
|
|
32
|
-
},
|
|
14
|
+
...getDefaultOptions(),
|
|
33
15
|
context.config.interactive !== "never" && context.config.interactive !== true && {
|
|
34
16
|
name: "interactive",
|
|
35
17
|
title: "Interactive",
|
|
36
|
-
description: "Enable interactive mode
|
|
18
|
+
description: "Enable interactive mode - will be set to false if running in a CI pipeline.",
|
|
37
19
|
alias: ["i", "interact"],
|
|
38
20
|
kind: ReflectionKind.boolean,
|
|
39
21
|
optional: true,
|
|
@@ -42,33 +24,16 @@ function getDefaultOptions(context, _) {
|
|
|
42
24
|
context.config.interactive !== "never" && context.config.interactive !== false && {
|
|
43
25
|
name: "no-interactive",
|
|
44
26
|
title: "Non-Interactive",
|
|
45
|
-
description: "Disable interactive mode
|
|
27
|
+
description: "Disable interactive mode - will be set to true if running in a CI pipeline.",
|
|
46
28
|
alias: ["no-interact"],
|
|
47
29
|
kind: ReflectionKind.boolean,
|
|
48
30
|
optional: true,
|
|
49
31
|
default: false,
|
|
50
32
|
isNegativeOf: "interactive"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: "no-banner",
|
|
54
|
-
title: "Hide Banner",
|
|
55
|
-
description: "Hide the banner displayed while running the CLI application (will be set to true if running in a CI pipeline).",
|
|
56
|
-
kind: ReflectionKind.boolean,
|
|
57
|
-
optional: true,
|
|
58
|
-
default: false
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: "verbose",
|
|
62
|
-
title: "Verbose",
|
|
63
|
-
description: "Enable verbose output.",
|
|
64
|
-
kind: ReflectionKind.boolean,
|
|
65
|
-
optional: true,
|
|
66
|
-
default: false,
|
|
67
|
-
skipAddingNegative: true
|
|
68
33
|
}
|
|
69
34
|
].filter(Boolean);
|
|
70
35
|
}
|
|
71
36
|
|
|
72
37
|
//#endregion
|
|
73
|
-
export { getDefaultOptions };
|
|
38
|
+
export { getDefaultOptions$1 as getDefaultOptions };
|
|
74
39
|
//# sourceMappingURL=get-default-options.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-default-options.mjs","names":["ReflectionKind","getDefaultOptions","context","_","name","title","description","alias","kind","boolean","optional","default","
|
|
1
|
+
{"version":3,"file":"get-default-options.mjs","names":["ReflectionKind","getDefaultOptions","getDefaultOptionsBase","context","_","config","interactive","name","title","description","alias","kind","boolean","optional","default","isNegativeOf","filter","Boolean"],"sources":["../../src/helpers/get-default-options.ts"],"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 { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport type { CommandBase, CommandOption } from \"@shell-shock/core\";\nimport { getDefaultOptions as getDefaultOptionsBase } from \"@shell-shock/preset-script/helpers/get-default-options\";\nimport type { CLIPresetContext } from \"../types\";\n\n/**\n * Get the default command options.\n *\n * @param context - The build context.\n * @param _ - The command input.\n * @returns The default command options.\n */\nexport function getDefaultOptions(\n context: CLIPresetContext,\n _: CommandBase\n): CommandOption[] {\n return [\n ...getDefaultOptionsBase(),\n context.config.interactive !== \"never\" &&\n context.config.interactive !== true && {\n name: \"interactive\",\n title: \"Interactive\",\n description:\n \"Enable interactive mode - will be set to false if running in a CI pipeline.\",\n alias: [\"i\", \"interact\"],\n kind: ReflectionKind.boolean,\n optional: true,\n default: context.config.interactive !== false\n },\n context.config.interactive !== \"never\" &&\n context.config.interactive !== false && {\n name: \"no-interactive\",\n title: \"Non-Interactive\",\n description:\n \"Disable interactive mode - will be set to true if running in a CI pipeline.\",\n alias: [\"no-interact\"],\n kind: ReflectionKind.boolean,\n optional: true,\n default: false,\n isNegativeOf: \"interactive\"\n }\n ].filter(Boolean) as CommandOption[];\n}\n"],"mappings":";;;;;;;;;;;AA8BA,SAAgBC,oBACdE,SACAC,GACiB;AACjB,QAAO;EACL,GAAGF,mBAAuB;EAC1BC,QAAQE,OAAOC,gBAAgB,WAC7BH,QAAQE,OAAOC,gBAAgB,QAAQ;GACrCC,MAAM;GACNC,OAAO;GACPC,aACE;GACFC,OAAO,CAAC,KAAK,WAAW;GACxBC,MAAMX,eAAeY;GACrBC,UAAU;GACVC,SAASX,QAAQE,OAAOC,gBAAgB;GACzC;EACHH,QAAQE,OAAOC,gBAAgB,WAC7BH,QAAQE,OAAOC,gBAAgB,SAAS;GACtCC,MAAM;GACNC,OAAO;GACPC,aACE;GACFC,OAAO,CAAC,cAAc;GACtBC,MAAMX,eAAeY;GACrBC,UAAU;GACVC,SAAS;GACTC,cAAc;GACf;EACJ,CAACC,OAAOC,QAAQ"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
|
+
const require_components_banner_function_declaration = require('./components/banner-function-declaration.cjs');
|
|
4
|
+
require('./components/index.cjs');
|
|
3
5
|
const require_get_default_options = require('./helpers/get-default-options.cjs');
|
|
4
6
|
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
5
7
|
let __alloy_js_core = require("@alloy-js/core");
|
|
6
8
|
let __alloy_js_typescript = require("@alloy-js/typescript");
|
|
7
9
|
let __powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
|
|
8
|
-
let __shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
9
10
|
let __shell_shock_plugin_theme = require("@shell-shock/plugin-theme");
|
|
10
11
|
__shell_shock_plugin_theme = require_rolldown_runtime.__toESM(__shell_shock_plugin_theme);
|
|
11
12
|
let __shell_shock_preset_script_components_bin_entry = require("@shell-shock/preset-script/components/bin-entry");
|
|
12
13
|
let __shell_shock_preset_script_components_command_entry = require("@shell-shock/preset-script/components/command-entry");
|
|
13
14
|
let __shell_shock_preset_script_components_command_router = require("@shell-shock/preset-script/components/command-router");
|
|
14
15
|
let __shell_shock_preset_script_components_console_builtin = require("@shell-shock/preset-script/components/console-builtin");
|
|
16
|
+
let __shell_shock_preset_script_components_help = require("@shell-shock/preset-script/components/help");
|
|
15
17
|
let __shell_shock_preset_script_components_utils_builtin = require("@shell-shock/preset-script/components/utils-builtin");
|
|
16
18
|
let __shell_shock_preset_script_components_virtual_command_entry = require("@shell-shock/preset-script/components/virtual-command-entry");
|
|
17
19
|
|
|
@@ -20,66 +22,117 @@ let __shell_shock_preset_script_components_virtual_command_entry = require("@she
|
|
|
20
22
|
* The Shell Shock base plugin.
|
|
21
23
|
*/
|
|
22
24
|
const plugin = (options = {}) => {
|
|
23
|
-
return [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
return [
|
|
26
|
+
(0, __shell_shock_plugin_theme.default)({ theme: options.theme }),
|
|
27
|
+
{
|
|
28
|
+
name: "shell-shock:cli-preset",
|
|
29
|
+
config() {
|
|
30
|
+
this.debug("Providing default configuration for the Shell Shock `cli` preset.");
|
|
31
|
+
return {
|
|
32
|
+
defaultOptions: require_get_default_options.getDefaultOptions,
|
|
33
|
+
isCaseSensitive: false,
|
|
34
|
+
...options
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
configResolved() {
|
|
38
|
+
this.dependencies.didyoumean2 = "^7.0.4";
|
|
39
|
+
},
|
|
40
|
+
async prepare() {
|
|
41
|
+
this.debug("Rendering built-in modules for the Shell Shock `cli` preset.");
|
|
42
|
+
return (0, __powerlines_plugin_alloy_render.render)(this, [(0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_utils_builtin.UtilsBuiltin, {}), (0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_console_builtin.ConsoleBuiltin, {})]);
|
|
43
|
+
}
|
|
32
44
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
{
|
|
46
|
+
name: "shell-shock:cli-preset:generate-entrypoint",
|
|
47
|
+
prepare: {
|
|
48
|
+
order: "post",
|
|
49
|
+
async handler() {
|
|
50
|
+
const _self$ = this;
|
|
51
|
+
this.debug("Rendering entrypoint modules for the Shell Shock `cli` preset.");
|
|
52
|
+
return (0, __powerlines_plugin_alloy_render.render)(this, [(0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_bin_entry.BinEntry, {
|
|
53
|
+
builtinImports: {
|
|
54
|
+
console: [
|
|
55
|
+
"divider",
|
|
56
|
+
"stripAnsi",
|
|
57
|
+
"writeLine",
|
|
58
|
+
"splitText",
|
|
59
|
+
"colors",
|
|
60
|
+
"help"
|
|
61
|
+
],
|
|
62
|
+
utils: ["getArgs", "isMinimal"],
|
|
63
|
+
env: ["isCI"]
|
|
64
|
+
},
|
|
65
|
+
get prefix() {
|
|
66
|
+
return [
|
|
67
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(require_components_banner_function_declaration.BannerFunctionDeclaration, {}),
|
|
68
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
69
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
70
|
+
];
|
|
42
71
|
},
|
|
43
72
|
get children() {
|
|
44
73
|
return [
|
|
45
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
74
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
75
|
+
get when() {
|
|
76
|
+
return Object.keys(_self$.commands).length > 0;
|
|
77
|
+
},
|
|
78
|
+
get children() {
|
|
79
|
+
return [
|
|
80
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
81
|
+
"const": true,
|
|
82
|
+
name: "args",
|
|
83
|
+
type: "string[]",
|
|
84
|
+
initializer: __alloy_js_core.code`getArgs();`
|
|
85
|
+
}),
|
|
86
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
87
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_command_router.CommandRouter, {
|
|
88
|
+
path: [],
|
|
89
|
+
get commands() {
|
|
90
|
+
return _self$.commands ?? {};
|
|
91
|
+
}
|
|
92
|
+
}),
|
|
93
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
94
|
+
];
|
|
95
|
+
}
|
|
50
96
|
}),
|
|
51
97
|
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
52
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(
|
|
53
|
-
|
|
98
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_help.HelpInvoke, {
|
|
99
|
+
get options() {
|
|
100
|
+
return _self$.options;
|
|
101
|
+
},
|
|
54
102
|
get commands() {
|
|
55
103
|
return _self$.commands ?? {};
|
|
56
104
|
}
|
|
57
105
|
})
|
|
58
106
|
];
|
|
59
107
|
}
|
|
60
|
-
})
|
|
61
|
-
} }),
|
|
62
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
63
|
-
get each() {
|
|
64
|
-
return Object.values(commands);
|
|
65
|
-
},
|
|
66
|
-
children: (child) => (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
108
|
+
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
67
109
|
get when() {
|
|
68
|
-
return
|
|
69
|
-
},
|
|
70
|
-
get fallback() {
|
|
71
|
-
return (0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_command_entry.CommandEntry, { command: child });
|
|
110
|
+
return Object.values(_self$.commands).length > 0;
|
|
72
111
|
},
|
|
73
112
|
get children() {
|
|
74
|
-
return (0, __alloy_js_core_jsx_runtime.createComponent)(
|
|
113
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
114
|
+
get each() {
|
|
115
|
+
return Object.values(_self$.commands);
|
|
116
|
+
},
|
|
117
|
+
doubleHardline: true,
|
|
118
|
+
children: (child) => (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
119
|
+
get when() {
|
|
120
|
+
return child.isVirtual;
|
|
121
|
+
},
|
|
122
|
+
get fallback() {
|
|
123
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_command_entry.CommandEntry, { command: child });
|
|
124
|
+
},
|
|
125
|
+
get children() {
|
|
126
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_virtual_command_entry.VirtualCommandEntry, { command: child });
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
});
|
|
75
130
|
}
|
|
76
|
-
})
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
(0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_preset_script_components_console_builtin.ConsoleBuiltin, {})
|
|
80
|
-
]);
|
|
131
|
+
})]);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
81
134
|
}
|
|
82
|
-
|
|
135
|
+
];
|
|
83
136
|
};
|
|
84
137
|
var src_default = plugin;
|
|
85
138
|
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAqCA;AAAwC,cAA3B,MAA2B,EAAA,CAAA,iBAAA,gBAAA,GAAmB,gBAAnB,CAAA,CAAA,OAAA,CAAA,EAC7B,gBAD6B,EAAA,
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAqCA;AAAwC,cAA3B,MAA2B,EAAA,CAAA,iBAAA,gBAAA,GAAmB,gBAAnB,CAAA,CAAA,OAAA,CAAA,EAC7B,gBAD6B,EAAA,GAsGjC,MAtGiC,CAsG1B,QAtG0B,CAAA,EAAA"}
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAqCA;AAAwC,cAA3B,MAA2B,EAAA,CAAA,iBAAA,gBAAA,GAAmB,gBAAnB,CAAA,CAAA,OAAA,CAAA,EAC7B,gBAD6B,EAAA,
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAqCA;AAAwC,cAA3B,MAA2B,EAAA,CAAA,iBAAA,gBAAA,GAAmB,gBAAnB,CAAA,CAAA,OAAA,CAAA,EAC7B,gBAD6B,EAAA,GAsGjC,MAtGiC,CAsG1B,QAtG0B,CAAA,EAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import { BannerFunctionDeclaration } from "./components/banner-function-declaration.mjs";
|
|
2
|
+
import "./components/index.mjs";
|
|
1
3
|
import { getDefaultOptions } from "./helpers/get-default-options.mjs";
|
|
2
|
-
import { createComponent, createIntrinsic
|
|
4
|
+
import { createComponent, createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
3
5
|
import { For, Show, code } from "@alloy-js/core";
|
|
4
6
|
import { VarDeclaration } from "@alloy-js/typescript";
|
|
5
7
|
import { render } from "@powerlines/plugin-alloy/render";
|
|
6
|
-
import { getCommandTree } from "@shell-shock/core/plugin-utils";
|
|
7
8
|
import theme from "@shell-shock/plugin-theme";
|
|
8
9
|
import { BinEntry } from "@shell-shock/preset-script/components/bin-entry";
|
|
9
10
|
import { CommandEntry } from "@shell-shock/preset-script/components/command-entry";
|
|
10
11
|
import { CommandRouter } from "@shell-shock/preset-script/components/command-router";
|
|
11
12
|
import { ConsoleBuiltin } from "@shell-shock/preset-script/components/console-builtin";
|
|
13
|
+
import { HelpInvoke } from "@shell-shock/preset-script/components/help";
|
|
12
14
|
import { UtilsBuiltin } from "@shell-shock/preset-script/components/utils-builtin";
|
|
13
15
|
import { VirtualCommandEntry } from "@shell-shock/preset-script/components/virtual-command-entry";
|
|
14
16
|
|
|
@@ -17,66 +19,117 @@ import { VirtualCommandEntry } from "@shell-shock/preset-script/components/virtu
|
|
|
17
19
|
* The Shell Shock base plugin.
|
|
18
20
|
*/
|
|
19
21
|
const plugin = (options = {}) => {
|
|
20
|
-
return [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
return [
|
|
23
|
+
theme({ theme: options.theme }),
|
|
24
|
+
{
|
|
25
|
+
name: "shell-shock:cli-preset",
|
|
26
|
+
config() {
|
|
27
|
+
this.debug("Providing default configuration for the Shell Shock `cli` preset.");
|
|
28
|
+
return {
|
|
29
|
+
defaultOptions: getDefaultOptions,
|
|
30
|
+
isCaseSensitive: false,
|
|
31
|
+
...options
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
configResolved() {
|
|
35
|
+
this.dependencies.didyoumean2 = "^7.0.4";
|
|
36
|
+
},
|
|
37
|
+
async prepare() {
|
|
38
|
+
this.debug("Rendering built-in modules for the Shell Shock `cli` preset.");
|
|
39
|
+
return render(this, [createComponent(UtilsBuiltin, {}), createComponent(ConsoleBuiltin, {})]);
|
|
40
|
+
}
|
|
29
41
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
{
|
|
43
|
+
name: "shell-shock:cli-preset:generate-entrypoint",
|
|
44
|
+
prepare: {
|
|
45
|
+
order: "post",
|
|
46
|
+
async handler() {
|
|
47
|
+
const _self$ = this;
|
|
48
|
+
this.debug("Rendering entrypoint modules for the Shell Shock `cli` preset.");
|
|
49
|
+
return render(this, [createComponent(BinEntry, {
|
|
50
|
+
builtinImports: {
|
|
51
|
+
console: [
|
|
52
|
+
"divider",
|
|
53
|
+
"stripAnsi",
|
|
54
|
+
"writeLine",
|
|
55
|
+
"splitText",
|
|
56
|
+
"colors",
|
|
57
|
+
"help"
|
|
58
|
+
],
|
|
59
|
+
utils: ["getArgs", "isMinimal"],
|
|
60
|
+
env: ["isCI"]
|
|
61
|
+
},
|
|
62
|
+
get prefix() {
|
|
63
|
+
return [
|
|
64
|
+
createComponent(BannerFunctionDeclaration, {}),
|
|
65
|
+
createIntrinsic("hbr", {}),
|
|
66
|
+
createIntrinsic("hbr", {})
|
|
67
|
+
];
|
|
39
68
|
},
|
|
40
69
|
get children() {
|
|
41
70
|
return [
|
|
42
|
-
createComponent(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
71
|
+
createComponent(Show, {
|
|
72
|
+
get when() {
|
|
73
|
+
return Object.keys(_self$.commands).length > 0;
|
|
74
|
+
},
|
|
75
|
+
get children() {
|
|
76
|
+
return [
|
|
77
|
+
createComponent(VarDeclaration, {
|
|
78
|
+
"const": true,
|
|
79
|
+
name: "args",
|
|
80
|
+
type: "string[]",
|
|
81
|
+
initializer: code`getArgs();`
|
|
82
|
+
}),
|
|
83
|
+
createIntrinsic("hbr", {}),
|
|
84
|
+
createComponent(CommandRouter, {
|
|
85
|
+
path: [],
|
|
86
|
+
get commands() {
|
|
87
|
+
return _self$.commands ?? {};
|
|
88
|
+
}
|
|
89
|
+
}),
|
|
90
|
+
createIntrinsic("hbr", {})
|
|
91
|
+
];
|
|
92
|
+
}
|
|
47
93
|
}),
|
|
48
94
|
createIntrinsic("hbr", {}),
|
|
49
|
-
createComponent(
|
|
50
|
-
|
|
95
|
+
createComponent(HelpInvoke, {
|
|
96
|
+
get options() {
|
|
97
|
+
return _self$.options;
|
|
98
|
+
},
|
|
51
99
|
get commands() {
|
|
52
100
|
return _self$.commands ?? {};
|
|
53
101
|
}
|
|
54
102
|
})
|
|
55
103
|
];
|
|
56
104
|
}
|
|
57
|
-
})
|
|
58
|
-
} }),
|
|
59
|
-
createComponent(For, {
|
|
60
|
-
get each() {
|
|
61
|
-
return Object.values(commands);
|
|
62
|
-
},
|
|
63
|
-
children: (child) => createComponent(Show, {
|
|
105
|
+
}), createComponent(Show, {
|
|
64
106
|
get when() {
|
|
65
|
-
return
|
|
66
|
-
},
|
|
67
|
-
get fallback() {
|
|
68
|
-
return createComponent(CommandEntry, { command: child });
|
|
107
|
+
return Object.values(_self$.commands).length > 0;
|
|
69
108
|
},
|
|
70
109
|
get children() {
|
|
71
|
-
return createComponent(
|
|
110
|
+
return createComponent(For, {
|
|
111
|
+
get each() {
|
|
112
|
+
return Object.values(_self$.commands);
|
|
113
|
+
},
|
|
114
|
+
doubleHardline: true,
|
|
115
|
+
children: (child) => createComponent(Show, {
|
|
116
|
+
get when() {
|
|
117
|
+
return child.isVirtual;
|
|
118
|
+
},
|
|
119
|
+
get fallback() {
|
|
120
|
+
return createComponent(CommandEntry, { command: child });
|
|
121
|
+
},
|
|
122
|
+
get children() {
|
|
123
|
+
return createComponent(VirtualCommandEntry, { command: child });
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
});
|
|
72
127
|
}
|
|
73
|
-
})
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
createComponent(ConsoleBuiltin, {})
|
|
77
|
-
]);
|
|
128
|
+
})]);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
78
131
|
}
|
|
79
|
-
|
|
132
|
+
];
|
|
80
133
|
};
|
|
81
134
|
var src_default = plugin;
|
|
82
135
|
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["code","For","Show","VarDeclaration","render","
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["code","For","Show","VarDeclaration","render","theme","BinEntry","CommandEntry","CommandRouter","ConsoleBuiltin","HelpInvoke","UtilsBuiltin","VirtualCommandEntry","BannerFunctionDeclaration","getDefaultOptions","plugin","options","name","config","debug","defaultOptions","isCaseSensitive","configResolved","dependencies","didyoumean2","prepare","_$createComponent","order","handler","_self$","builtinImports","console","utils","env","prefix","_$createIntrinsic","children","when","Object","keys","commands","length","type","initializer","path","values","each","doubleHardline","child","isVirtual","fallback","command"],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, For, Show } from \"@alloy-js/core\";\nimport { VarDeclaration } from \"@alloy-js/typescript\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport theme from \"@shell-shock/plugin-theme\";\nimport { BinEntry } from \"@shell-shock/preset-script/components/bin-entry\";\nimport { CommandEntry } from \"@shell-shock/preset-script/components/command-entry\";\nimport { CommandRouter } from \"@shell-shock/preset-script/components/command-router\";\nimport { ConsoleBuiltin } from \"@shell-shock/preset-script/components/console-builtin\";\nimport { HelpInvoke } from \"@shell-shock/preset-script/components/help\";\nimport { UtilsBuiltin } from \"@shell-shock/preset-script/components/utils-builtin\";\nimport { VirtualCommandEntry } from \"@shell-shock/preset-script/components/virtual-command-entry\";\nimport type { Plugin } from \"powerlines/types/plugin\";\nimport { BannerFunctionDeclaration } from \"./components\";\nimport { getDefaultOptions } from \"./helpers/get-default-options\";\nimport type { CLIPresetContext, CLIPresetOptions } from \"./types/plugin\";\n\n/**\n * The Shell Shock base plugin.\n */\nexport const plugin = <TContext extends CLIPresetContext = CLIPresetContext>(\n options: CLIPresetOptions = {}\n) => {\n return [\n theme({\n theme: options.theme\n }),\n {\n name: \"shell-shock:cli-preset\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `cli` preset.\"\n );\n\n return {\n defaultOptions: getDefaultOptions,\n isCaseSensitive: false,\n ...options\n };\n },\n configResolved() {\n this.dependencies.didyoumean2 = \"^7.0.4\";\n },\n async prepare() {\n this.debug(\n \"Rendering built-in modules for the Shell Shock `cli` preset.\"\n );\n\n return render(\n this,\n <>\n <UtilsBuiltin />\n <ConsoleBuiltin />\n </>\n );\n }\n },\n {\n name: \"shell-shock:cli-preset:generate-entrypoint\",\n prepare: {\n order: \"post\",\n async handler() {\n this.debug(\n \"Rendering entrypoint modules for the Shell Shock `cli` preset.\"\n );\n\n return render(\n this,\n <>\n <BinEntry\n builtinImports={{\n console: [\n \"divider\",\n \"stripAnsi\",\n \"writeLine\",\n \"splitText\",\n \"colors\",\n \"help\"\n ],\n utils: [\"getArgs\", \"isMinimal\"],\n env: [\"isCI\"]\n }}\n prefix={\n <>\n <BannerFunctionDeclaration />\n <hbr />\n <hbr />\n </>\n }>\n <Show when={Object.keys(this.commands).length > 0}>\n <VarDeclaration\n const\n name=\"args\"\n type=\"string[]\"\n initializer={code`getArgs();`}\n />\n <hbr />\n <CommandRouter path={[]} commands={this.commands ?? {}} />\n <hbr />\n </Show>\n <hbr />\n <HelpInvoke\n options={this.options}\n commands={this.commands ?? {}}\n />\n </BinEntry>\n <Show when={Object.values(this.commands).length > 0}>\n <For each={Object.values(this.commands)} doubleHardline>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </Show>\n </>\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqCA,MAAae,UACXC,UAA4B,EAAE,KAC3B;AACH,QAAO;EACLX,MAAM,EACJA,OAAOW,QAAQX,OAChB,CAAC;EACF;GACEY,MAAM;GACNC,SAAS;AACP,SAAKC,MACH,oEACD;AAED,WAAO;KACLC,gBAAgBN;KAChBO,iBAAiB;KACjB,GAAGL;KACJ;;GAEHM,iBAAiB;AACf,SAAKC,aAAaC,cAAc;;GAElC,MAAMC,UAAU;AACd,SAAKN,MACH,+DACD;AAED,WAAOf,OACL,MAAI,CAAAsB,gBAEDf,cAAY,EAAA,CAAA,EAAAe,gBACZjB,gBAAc,EAAA,CAAA,CAEnB,CAAC;;GAEJ;EACD;GACEQ,MAAM;GACNQ,SAAS;IACPE,OAAO;IACP,MAAMC,UAAU;KAAA,MAAAC,SAAA;AACd,UAAKV,MACH,iEACD;AAED,YAAOf,OACL,MAAI,CAAAsB,gBAEDpB,UAAQ;MACPwB,gBAAgB;OACdC,SAAS;QACP;QACA;QACA;QACA;QACA;QACA;QACD;OACDC,OAAO,CAAC,WAAW,YAAY;OAC/BC,KAAK,C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EAACuC,SAASH,OAAK,CAAA;;SAAA,CAAA;QAEtC,CAAA;;MAAA,CAAA,CAIT,CAAC;;IAEL;GACD;EACF;;AAGH,kBAAejC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shell-shock/preset-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Shell Shock plugin to generate source code given a list design tokens.",
|
|
6
6
|
"repository": {
|
|
@@ -69,18 +69,18 @@
|
|
|
69
69
|
"default": "./dist/components/index.mjs"
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
-
"./components/banner": {
|
|
72
|
+
"./components/banner-function-declaration": {
|
|
73
73
|
"require": {
|
|
74
|
-
"types": "./dist/components/banner.d.cts",
|
|
75
|
-
"default": "./dist/components/banner.cjs"
|
|
74
|
+
"types": "./dist/components/banner-function-declaration.d.cts",
|
|
75
|
+
"default": "./dist/components/banner-function-declaration.cjs"
|
|
76
76
|
},
|
|
77
77
|
"import": {
|
|
78
|
-
"types": "./dist/components/banner.d.mts",
|
|
79
|
-
"default": "./dist/components/banner.mjs"
|
|
78
|
+
"types": "./dist/components/banner-function-declaration.d.mts",
|
|
79
|
+
"default": "./dist/components/banner-function-declaration.mjs"
|
|
80
80
|
},
|
|
81
81
|
"default": {
|
|
82
|
-
"types": "./dist/components/banner.d.mts",
|
|
83
|
-
"default": "./dist/components/banner.mjs"
|
|
82
|
+
"types": "./dist/components/banner-function-declaration.d.mts",
|
|
83
|
+
"default": "./dist/components/banner-function-declaration.mjs"
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
"./package.json": "./package.json",
|
|
@@ -122,21 +122,20 @@
|
|
|
122
122
|
"storm-software"
|
|
123
123
|
],
|
|
124
124
|
"dependencies": {
|
|
125
|
-
"@alloy-js/core": "0.22.0",
|
|
125
|
+
"@alloy-js/core": "^0.22.0",
|
|
126
126
|
"@alloy-js/typescript": "^0.22.0",
|
|
127
|
-
"@powerlines/deepkit": "^0.6.
|
|
128
|
-
"@powerlines/plugin-alloy": "^0.20.
|
|
129
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
130
|
-
"@shell-shock/core": "^0.
|
|
131
|
-
"@shell-shock/plugin-theme": "^0.0.
|
|
132
|
-
"@shell-shock/preset-script": "^0.3.
|
|
133
|
-
"@stryke/string-format": "^0.13.7",
|
|
127
|
+
"@powerlines/deepkit": "^0.6.50",
|
|
128
|
+
"@powerlines/plugin-alloy": "^0.20.14",
|
|
129
|
+
"@powerlines/plugin-plugin": "^0.12.221",
|
|
130
|
+
"@shell-shock/core": "^0.5.0",
|
|
131
|
+
"@shell-shock/plugin-theme": "^0.0.13",
|
|
132
|
+
"@shell-shock/preset-script": "^0.3.3",
|
|
134
133
|
"cfonts": "^3.3.1",
|
|
135
|
-
"powerlines": "^0.38.
|
|
134
|
+
"powerlines": "^0.38.37"
|
|
136
135
|
},
|
|
137
136
|
"devDependencies": {
|
|
138
137
|
"@babel/core": "^7.29.0",
|
|
139
|
-
"@types/node": "^22.19.
|
|
138
|
+
"@types/node": "^22.19.9",
|
|
140
139
|
"@types/react": "^19.2.13"
|
|
141
140
|
},
|
|
142
141
|
"publishConfig": {
|
|
@@ -163,5 +162,5 @@
|
|
|
163
162
|
}
|
|
164
163
|
},
|
|
165
164
|
"types": "./dist/index.d.cts",
|
|
166
|
-
"gitHead": "
|
|
165
|
+
"gitHead": "533bcb80b1bcd7b3419e062287bedf4afed8a449"
|
|
167
166
|
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
3
|
-
let __alloy_js_core = require("@alloy-js/core");
|
|
4
|
-
let __alloy_js_typescript = require("@alloy-js/typescript");
|
|
5
|
-
let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
6
|
-
let __powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
7
|
-
let __shell_shock_preset_script_contexts_theme = require("@shell-shock/preset-script/contexts/theme");
|
|
8
|
-
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
9
|
-
let cfonts = require("cfonts");
|
|
10
|
-
|
|
11
|
-
//#region src/components/banner.tsx
|
|
12
|
-
/**
|
|
13
|
-
* The `banner` handler function declaration code for the Shell Shock project.
|
|
14
|
-
*/
|
|
15
|
-
function BannerFunctionDeclaration(props) {
|
|
16
|
-
const { title: propTitle, description: propDescription } = props;
|
|
17
|
-
const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
18
|
-
const theme = (0, __shell_shock_preset_script_contexts_theme.useTheme)();
|
|
19
|
-
const title = propTitle || (0, __stryke_string_format_title_case.titleCase)(context.config.title);
|
|
20
|
-
const description = propDescription || context.config.description;
|
|
21
|
-
const renderedTitle = (0, cfonts.render)(title, {
|
|
22
|
-
font: "tiny",
|
|
23
|
-
align: "left",
|
|
24
|
-
colors: ["system"],
|
|
25
|
-
background: "transparent",
|
|
26
|
-
letterSpacing: 1,
|
|
27
|
-
lineHeight: 1,
|
|
28
|
-
gradient: false,
|
|
29
|
-
transitionGradient: false,
|
|
30
|
-
env: "node"
|
|
31
|
-
});
|
|
32
|
-
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
33
|
-
heading: `Write the application banner display to the console.`,
|
|
34
|
-
get children() {
|
|
35
|
-
return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This function should be run at the start of an application and should identify the current application/command to the user.` });
|
|
36
|
-
}
|
|
37
|
-
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
|
|
38
|
-
name: "banner",
|
|
39
|
-
get children() {
|
|
40
|
-
return __alloy_js_core.code`
|
|
41
|
-
writeLine(colors.border.banner.outline.primary("${theme.borderStyles.banner.outline.primary.topLeft}") + colors.border.banner.outline.primary("${theme.borderStyles.banner.outline.primary.top}".repeat(Math.max(process.stdout.columns - ${(Math.max(theme.padding.app, 0) + Math.max(theme.padding.banner, 0)) * 2 + theme.borderStyles.banner.outline.primary.topLeft.length + theme.borderStyles.banner.outline.primary.topRight.length}, 0) / ${theme.borderStyles.banner.outline.primary.top.length ?? 1})) + colors.border.banner.outline.primary("${theme.borderStyles.banner.outline.primary.topRight}"), { consoleFn: console.info });
|
|
42
|
-
|
|
43
|
-
${renderedTitle ? renderedTitle.array.map((line) => `writeLine(colors.border.banner.outline.primary("${theme.borderStyles.banner.outline.primary.left}") +
|
|
44
|
-
" ".repeat(Math.max(theme.padding.banner, 0)) +
|
|
45
|
-
colors.text.banner.title("${line}") +
|
|
46
|
-
" ".repeat(Math.max(theme.padding.banner, 0)) +
|
|
47
|
-
colors.border.banner.outline.primary("${theme.borderStyles.banner.outline.primary.right}"), { consoleFn: console.info });`).join(`\n`) : ""}
|
|
48
|
-
|
|
49
|
-
splitText(
|
|
50
|
-
${description ? __alloy_js_core.code`"${description.replace(/"/g, "\\\"")}"` : "''"},
|
|
51
|
-
Math.max(process.stdout.columns - ${(Math.max(theme.padding.app, 0) + Math.max(theme.padding.banner, 0)) * 2 + theme.borderStyles.banner.outline.primary.left.length + theme.borderStyles.banner.outline.primary.right.length}, 0)
|
|
52
|
-
).forEach((line) => {
|
|
53
|
-
writeLine(colors.border.banner.outline.primary("${theme.borderStyles.banner.outline.primary.left + " ".repeat(Math.max(theme.padding.banner, 0))}") + colors.text.banner.description(line) + colors.border.banner.outline.primary("${" ".repeat(Math.max(theme.padding.banner, 0)) + theme.borderStyles.banner.outline.primary.right}"), { consoleFn: console.info });
|
|
54
|
-
});
|
|
55
|
-
writeLine(colors.border.banner.outline.primary("${theme.borderStyles.banner.outline.primary.bottomLeft}") + colors.border.banner.outline.primary("$"{
|
|
56
|
-
theme.borderStyles.banner.outline.primary.bottom
|
|
57
|
-
}".repeat(Math.max(process.stdout.columns - ${(Math.max(theme.padding.app, 0) + Math.max(theme.padding.banner, 0)) * 2 + theme.borderStyles.banner.outline.primary.bottomLeft.length + theme.borderStyles.banner.outline.primary.bottomRight.length}, 0) / ${theme.borderStyles.banner.outline.primary.bottom.length ?? 1})) + colors.border.banner.outline.primary("${theme.borderStyles.banner.outline.primary.bottomRight}"), { consoleFn: console.info });
|
|
58
|
-
`;
|
|
59
|
-
}
|
|
60
|
-
})];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
//#endregion
|
|
64
|
-
exports.BannerFunctionDeclaration = BannerFunctionDeclaration;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
-
|
|
3
|
-
//#region src/components/banner.d.ts
|
|
4
|
-
interface BannerFunctionDeclarationProps {
|
|
5
|
-
/**
|
|
6
|
-
* The title to display in the banner.
|
|
7
|
-
*
|
|
8
|
-
* @remarks
|
|
9
|
-
* If not provided, the application title from the configuration will be used.
|
|
10
|
-
*/
|
|
11
|
-
title?: string;
|
|
12
|
-
/**
|
|
13
|
-
* The sub-title text to display in the banner.
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* This will be displayed in small text below the title.
|
|
17
|
-
*/
|
|
18
|
-
subTitle?: string;
|
|
19
|
-
/**
|
|
20
|
-
* The description of the command/application to display in the banner.
|
|
21
|
-
*
|
|
22
|
-
* @remarks
|
|
23
|
-
* This text will be displayed in small text below the title.
|
|
24
|
-
*/
|
|
25
|
-
description?: string;
|
|
26
|
-
/**
|
|
27
|
-
* An optional header to display above the banner. If not provided, the application's name and version will be displayed. If set to `false`, no header will be displayed.
|
|
28
|
-
*
|
|
29
|
-
* @remarks
|
|
30
|
-
* This can be used to provide additional context or information before the banner. It will be displayed in the border surrounding the banner.
|
|
31
|
-
*/
|
|
32
|
-
header?: string | false;
|
|
33
|
-
/**
|
|
34
|
-
* An optional footer to display below the banner. If not provided, the organization name or workspace name will be used. If set to `false`, no footer will be displayed.
|
|
35
|
-
*
|
|
36
|
-
* @remarks
|
|
37
|
-
* This can be used to provide additional context or information after the banner. It will be displayed in the border surrounding the banner.
|
|
38
|
-
*/
|
|
39
|
-
footer?: string | false;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* The `banner` handler function declaration code for the Shell Shock project.
|
|
43
|
-
*/
|
|
44
|
-
declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps): _alloy_js_core0.Children;
|
|
45
|
-
//#endregion
|
|
46
|
-
export { BannerFunctionDeclaration, BannerFunctionDeclarationProps };
|
|
47
|
-
//# sourceMappingURL=banner.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.cts","names":[],"sources":["../../src/components/banner.tsx"],"sourcesContent":[],"mappings":";;;UAkCiB,8BAAA;;;AAAjB;AA6CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,yBAAA,QACP,iCAA8B,eAAA,CAAA"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
-
|
|
3
|
-
//#region src/components/banner.d.ts
|
|
4
|
-
interface BannerFunctionDeclarationProps {
|
|
5
|
-
/**
|
|
6
|
-
* The title to display in the banner.
|
|
7
|
-
*
|
|
8
|
-
* @remarks
|
|
9
|
-
* If not provided, the application title from the configuration will be used.
|
|
10
|
-
*/
|
|
11
|
-
title?: string;
|
|
12
|
-
/**
|
|
13
|
-
* The sub-title text to display in the banner.
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* This will be displayed in small text below the title.
|
|
17
|
-
*/
|
|
18
|
-
subTitle?: string;
|
|
19
|
-
/**
|
|
20
|
-
* The description of the command/application to display in the banner.
|
|
21
|
-
*
|
|
22
|
-
* @remarks
|
|
23
|
-
* This text will be displayed in small text below the title.
|
|
24
|
-
*/
|
|
25
|
-
description?: string;
|
|
26
|
-
/**
|
|
27
|
-
* An optional header to display above the banner. If not provided, the application's name and version will be displayed. If set to `false`, no header will be displayed.
|
|
28
|
-
*
|
|
29
|
-
* @remarks
|
|
30
|
-
* This can be used to provide additional context or information before the banner. It will be displayed in the border surrounding the banner.
|
|
31
|
-
*/
|
|
32
|
-
header?: string | false;
|
|
33
|
-
/**
|
|
34
|
-
* An optional footer to display below the banner. If not provided, the organization name or workspace name will be used. If set to `false`, no footer will be displayed.
|
|
35
|
-
*
|
|
36
|
-
* @remarks
|
|
37
|
-
* This can be used to provide additional context or information after the banner. It will be displayed in the border surrounding the banner.
|
|
38
|
-
*/
|
|
39
|
-
footer?: string | false;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* The `banner` handler function declaration code for the Shell Shock project.
|
|
43
|
-
*/
|
|
44
|
-
declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps): _alloy_js_core0.Children;
|
|
45
|
-
//#endregion
|
|
46
|
-
export { BannerFunctionDeclaration, BannerFunctionDeclarationProps };
|
|
47
|
-
//# sourceMappingURL=banner.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.mts","names":[],"sources":["../../src/components/banner.tsx"],"sourcesContent":[],"mappings":";;;UAkCiB,8BAAA;;;AAAjB;AA6CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,yBAAA,QACP,iCAA8B,eAAA,CAAA"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { code } from "@alloy-js/core";
|
|
3
|
-
import { FunctionDeclaration } from "@alloy-js/typescript";
|
|
4
|
-
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
5
|
-
import { TSDoc, TSDocRemarks } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
|
|
6
|
-
import { useTheme } from "@shell-shock/preset-script/contexts/theme";
|
|
7
|
-
import { titleCase } from "@stryke/string-format/title-case";
|
|
8
|
-
import { render } from "cfonts";
|
|
9
|
-
|
|
10
|
-
//#region src/components/banner.tsx
|
|
11
|
-
/**
|
|
12
|
-
* The `banner` handler function declaration code for the Shell Shock project.
|
|
13
|
-
*/
|
|
14
|
-
function BannerFunctionDeclaration(props) {
|
|
15
|
-
const { title: propTitle, description: propDescription } = props;
|
|
16
|
-
const context = usePowerlines();
|
|
17
|
-
const theme = useTheme();
|
|
18
|
-
const title = propTitle || titleCase(context.config.title);
|
|
19
|
-
const description = propDescription || context.config.description;
|
|
20
|
-
const renderedTitle = render(title, {
|
|
21
|
-
font: "tiny",
|
|
22
|
-
align: "left",
|
|
23
|
-
colors: ["system"],
|
|
24
|
-
background: "transparent",
|
|
25
|
-
letterSpacing: 1,
|
|
26
|
-
lineHeight: 1,
|
|
27
|
-
gradient: false,
|
|
28
|
-
transitionGradient: false,
|
|
29
|
-
env: "node"
|
|
30
|
-
});
|
|
31
|
-
return [createComponent(TSDoc, {
|
|
32
|
-
heading: `Write the application banner display to the console.`,
|
|
33
|
-
get children() {
|
|
34
|
-
return createComponent(TSDocRemarks, { children: `This function should be run at the start of an application and should identify the current application/command to the user.` });
|
|
35
|
-
}
|
|
36
|
-
}), createComponent(FunctionDeclaration, {
|
|
37
|
-
name: "banner",
|
|
38
|
-
get children() {
|
|
39
|
-
return code`
|
|
40
|
-
writeLine(colors.border.banner.outline.primary("${theme.borderStyles.banner.outline.primary.topLeft}") + colors.border.banner.outline.primary("${theme.borderStyles.banner.outline.primary.top}".repeat(Math.max(process.stdout.columns - ${(Math.max(theme.padding.app, 0) + Math.max(theme.padding.banner, 0)) * 2 + theme.borderStyles.banner.outline.primary.topLeft.length + theme.borderStyles.banner.outline.primary.topRight.length}, 0) / ${theme.borderStyles.banner.outline.primary.top.length ?? 1})) + colors.border.banner.outline.primary("${theme.borderStyles.banner.outline.primary.topRight}"), { consoleFn: console.info });
|
|
41
|
-
|
|
42
|
-
${renderedTitle ? renderedTitle.array.map((line) => `writeLine(colors.border.banner.outline.primary("${theme.borderStyles.banner.outline.primary.left}") +
|
|
43
|
-
" ".repeat(Math.max(theme.padding.banner, 0)) +
|
|
44
|
-
colors.text.banner.title("${line}") +
|
|
45
|
-
" ".repeat(Math.max(theme.padding.banner, 0)) +
|
|
46
|
-
colors.border.banner.outline.primary("${theme.borderStyles.banner.outline.primary.right}"), { consoleFn: console.info });`).join(`\n`) : ""}
|
|
47
|
-
|
|
48
|
-
splitText(
|
|
49
|
-
${description ? code`"${description.replace(/"/g, "\\\"")}"` : "''"},
|
|
50
|
-
Math.max(process.stdout.columns - ${(Math.max(theme.padding.app, 0) + Math.max(theme.padding.banner, 0)) * 2 + theme.borderStyles.banner.outline.primary.left.length + theme.borderStyles.banner.outline.primary.right.length}, 0)
|
|
51
|
-
).forEach((line) => {
|
|
52
|
-
writeLine(colors.border.banner.outline.primary("${theme.borderStyles.banner.outline.primary.left + " ".repeat(Math.max(theme.padding.banner, 0))}") + colors.text.banner.description(line) + colors.border.banner.outline.primary("${" ".repeat(Math.max(theme.padding.banner, 0)) + theme.borderStyles.banner.outline.primary.right}"), { consoleFn: console.info });
|
|
53
|
-
});
|
|
54
|
-
writeLine(colors.border.banner.outline.primary("${theme.borderStyles.banner.outline.primary.bottomLeft}") + colors.border.banner.outline.primary("$"{
|
|
55
|
-
theme.borderStyles.banner.outline.primary.bottom
|
|
56
|
-
}".repeat(Math.max(process.stdout.columns - ${(Math.max(theme.padding.app, 0) + Math.max(theme.padding.banner, 0)) * 2 + theme.borderStyles.banner.outline.primary.bottomLeft.length + theme.borderStyles.banner.outline.primary.bottomRight.length}, 0) / ${theme.borderStyles.banner.outline.primary.bottom.length ?? 1})) + colors.border.banner.outline.primary("${theme.borderStyles.banner.outline.primary.bottomRight}"), { consoleFn: console.info });
|
|
57
|
-
`;
|
|
58
|
-
}
|
|
59
|
-
})];
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
//#endregion
|
|
63
|
-
export { BannerFunctionDeclaration };
|
|
64
|
-
//# sourceMappingURL=banner.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"banner.mjs","names":["code","FunctionDeclaration","usePowerlines","TSDoc","TSDocRemarks","useTheme","titleCase","render","BannerFunctionDeclaration","props","title","propTitle","description","propDescription","context","theme","config","renderedTitle","font","align","colors","background","letterSpacing","lineHeight","gradient","transitionGradient","env","_$createComponent","heading","children","name","borderStyles","banner","outline","primary","topLeft","top","Math","max","padding","app","length","topRight","array","map","line","left","right","join","replace","repeat","bottomLeft","bottomRight","bottom"],"sources":["../../src/components/banner.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code } from \"@alloy-js/core\";\nimport { FunctionDeclaration } from \"@alloy-js/typescript\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n TSDoc,\n TSDocRemarks\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { useTheme } from \"@shell-shock/preset-script/contexts/theme\";\nimport type { ScriptPresetContext } from \"@shell-shock/preset-script/types/plugin\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { render } from \"cfonts\";\n// import {\n// getOrganizationName,\n// getWorkspaceName\n// } from \"powerlines/plugin-utils/context-helpers\";\n\nexport interface BannerFunctionDeclarationProps {\n /**\n * The title to display in the banner.\n *\n * @remarks\n * If not provided, the application title from the configuration will be used.\n */\n title?: string;\n\n /**\n * The sub-title text to display in the banner.\n *\n * @remarks\n * This will be displayed in small text below the title.\n */\n subTitle?: string;\n\n /**\n * The description of the command/application to display in the banner.\n *\n * @remarks\n * This text will be displayed in small text below the title.\n */\n description?: string;\n\n /**\n * An optional header to display above the banner. If not provided, the application's name and version will be displayed. If set to `false`, no header will be displayed.\n *\n * @remarks\n * This can be used to provide additional context or information before the banner. It will be displayed in the border surrounding the banner.\n */\n header?: string | false;\n\n /**\n * An optional footer to display below the banner. If not provided, the organization name or workspace name will be used. If set to `false`, no footer will be displayed.\n *\n * @remarks\n * This can be used to provide additional context or information after the banner. It will be displayed in the border surrounding the banner.\n */\n footer?: string | false;\n}\n\n/**\n * The `banner` handler function declaration code for the Shell Shock project.\n */\nexport function BannerFunctionDeclaration(\n props: BannerFunctionDeclarationProps\n) {\n const { title: propTitle, description: propDescription } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n const theme = useTheme();\n\n const title = propTitle || titleCase(context.config.title);\n const description = propDescription || context.config.description;\n // const header =\n // propHeader !== false\n // ? propHeader ||\n // `${title} ${context.packageJson?.version ? `v${context.packageJson.version}` : \"\"}`.trim()\n // : undefined;\n // const footer =\n // propFooter !== false\n // ? propFooter ||\n // titleCase(getOrganizationName(context) || getWorkspaceName(context))\n // : undefined;\n\n const renderedTitle = render(title, {\n font: \"tiny\",\n align: \"left\",\n colors: [\"system\"],\n background: \"transparent\",\n letterSpacing: 1,\n lineHeight: 1,\n gradient: false,\n transitionGradient: false,\n env: \"node\"\n });\n\n return (\n <>\n <TSDoc heading={`Write the application banner display to the console.`}>\n <TSDocRemarks>\n {`This function should be run at the start of an application and should identify the current application/command to the user.`}\n </TSDocRemarks>\n </TSDoc>\n <FunctionDeclaration name=\"banner\">\n {code`\n writeLine(colors.border.banner.outline.primary(\"${\n theme.borderStyles.banner.outline.primary.topLeft\n }\") + colors.border.banner.outline.primary(\"${\n theme.borderStyles.banner.outline.primary.top\n }\".repeat(Math.max(process.stdout.columns - ${\n (Math.max(theme.padding.app, 0) + Math.max(theme.padding.banner, 0)) *\n 2 +\n theme.borderStyles.banner.outline.primary.topLeft.length +\n theme.borderStyles.banner.outline.primary.topRight.length\n }, 0) / ${\n theme.borderStyles.banner.outline.primary.top.length ?? 1\n })) + colors.border.banner.outline.primary(\"${\n theme.borderStyles.banner.outline.primary.topRight\n }\"), { consoleFn: console.info });\n\n ${\n renderedTitle\n ? renderedTitle.array\n .map(\n line =>\n `writeLine(colors.border.banner.outline.primary(\"${\n theme.borderStyles.banner.outline.primary.left\n }\") +\n \" \".repeat(Math.max(theme.padding.banner, 0)) +\n colors.text.banner.title(\"${line}\") +\n \" \".repeat(Math.max(theme.padding.banner, 0)) +\n colors.border.banner.outline.primary(\"${\n theme.borderStyles.banner.outline.primary.right\n }\"), { consoleFn: console.info });`\n )\n .join(`\\n`)\n : \"\"\n }\n\n splitText(\n ${description ? code`\"${description.replace(/\"/g, '\\\\\"')}\"` : \"''\"},\n Math.max(process.stdout.columns - ${\n (Math.max(theme.padding.app, 0) +\n Math.max(theme.padding.banner, 0)) *\n 2 +\n theme.borderStyles.banner.outline.primary.left.length +\n theme.borderStyles.banner.outline.primary.right.length\n }, 0)\n ).forEach((line) => {\n writeLine(colors.border.banner.outline.primary(\"${\n theme.borderStyles.banner.outline.primary.left +\n \" \".repeat(Math.max(theme.padding.banner, 0))\n }\") + colors.text.banner.description(line) + colors.border.banner.outline.primary(\"${\n \" \".repeat(Math.max(theme.padding.banner, 0)) +\n theme.borderStyles.banner.outline.primary.right\n }\"), { consoleFn: console.info });\n });\n writeLine(colors.border.banner.outline.primary(\"${\n theme.borderStyles.banner.outline.primary.bottomLeft\n }\") + colors.border.banner.outline.primary(\"$\"{\n theme.borderStyles.banner.outline.primary.bottom\n }\".repeat(Math.max(process.stdout.columns - ${\n (Math.max(theme.padding.app, 0) + Math.max(theme.padding.banner, 0)) *\n 2 +\n theme.borderStyles.banner.outline.primary.bottomLeft.length +\n theme.borderStyles.banner.outline.primary.bottomRight.length\n }, 0) / ${\n theme.borderStyles.banner.outline.primary.bottom.length ?? 1\n })) + colors.border.banner.outline.primary(\"${\n theme.borderStyles.banner.outline.primary.bottomRight\n }\"), { consoleFn: console.info });\n`}\n </FunctionDeclaration>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA+EA,SAAgBQ,0BACdC,OACA;CACA,MAAM,EAAEC,OAAOC,WAAWC,aAAaC,oBAAoBJ;CAE3D,MAAMK,UAAUZ,eAAoC;CACpD,MAAMa,QAAQV,UAAU;CAExB,MAAMK,QAAQC,aAAaL,UAAUQ,QAAQE,OAAON,MAAM;CAC1D,MAAME,cAAcC,mBAAmBC,QAAQE,OAAOJ;CAYtD,MAAMK,gBAAgBV,OAAOG,OAAO;EAClCQ,MAAM;EACNC,OAAO;EACPC,QAAQ,CAAC,SAAS;EAClBC,YAAY;EACZC,eAAe;EACfC,YAAY;EACZC,UAAU;EACVC,oBAAoB;EACpBC,KAAK;EACN,CAAC;AAEF,QAAA,CAAAC,gBAEKxB,OAAK;EAACyB,SAAS;EAAsD,IAAAC,WAAA;AAAA,UAAAF,gBACnEvB,cAAY,EAAAyB,UACV,+HAA6H,CAAA;;EAAA,CAAA,EAAAF,gBAGjI1B,qBAAmB;EAAC6B,MAAI;EAAA,IAAAD,WAAA;AAAA,UACtB7B,IAAI;0DAEHe,MAAMgB,aAAaC,OAAOC,QAAQC,QAAQC,QAAO,6CAEjDpB,MAAMgB,aAAaC,OAAOC,QAAQC,QAAQE,IAAG,8CAE5CC,KAAKC,IAAIvB,MAAMwB,QAAQC,KAAK,EAAE,GAAGH,KAAKC,IAAIvB,MAAMwB,QAAQP,QAAQ,EAAE,IACjE,IACFjB,MAAMgB,aAAaC,OAAOC,QAAQC,QAAQC,QAAQM,SAClD1B,MAAMgB,aAAaC,OAAOC,QAAQC,QAAQQ,SAASD,OAAM,SAEzD1B,MAAMgB,aAAaC,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