@shell-shock/preset-cli 0.8.3 → 0.8.5
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 → banner-builtin.cjs} +47 -36
- package/dist/components/banner-builtin.d.cts +23 -0
- package/dist/components/banner-builtin.d.cts.map +1 -0
- package/dist/components/banner-builtin.d.mts +23 -0
- package/dist/components/banner-builtin.d.mts.map +1 -0
- package/dist/components/banner-builtin.mjs +88 -0
- package/dist/components/banner-builtin.mjs.map +1 -0
- package/dist/components/command-entry.cjs +182 -186
- package/dist/components/command-entry.d.cts +1 -1
- package/dist/components/command-entry.d.cts.map +1 -1
- package/dist/components/command-entry.d.mts.map +1 -1
- package/dist/components/command-entry.mjs +182 -186
- package/dist/components/command-entry.mjs.map +1 -1
- package/dist/components/command-router.cjs +1 -1
- package/dist/components/command-router.mjs +1 -1
- package/dist/components/command-router.mjs.map +1 -1
- package/dist/components/index.cjs +3 -2
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs +2 -2
- package/dist/components/virtual-command-entry.cjs +18 -22
- package/dist/components/virtual-command-entry.d.cts +1 -1
- package/dist/components/virtual-command-entry.d.cts.map +1 -1
- package/dist/components/virtual-command-entry.d.mts.map +1 -1
- package/dist/components/virtual-command-entry.mjs +18 -22
- package/dist/components/virtual-command-entry.mjs.map +1 -1
- package/dist/index.cjs +37 -7
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +38 -8
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-banner/dist/components/banner-builtin.cjs +63 -0
- package/dist/plugin-banner/dist/components/banner-builtin.mjs +62 -0
- package/dist/plugin-banner/dist/components/banner-builtin.mjs.map +1 -0
- package/dist/plugin-banner/dist/components/banner-function-declaration.cjs +135 -0
- package/dist/plugin-banner/dist/components/banner-function-declaration.d.cts +45 -0
- package/dist/plugin-banner/dist/components/banner-function-declaration.d.cts.map +1 -0
- package/dist/plugin-banner/dist/components/banner-function-declaration.d.mts +45 -0
- package/dist/plugin-banner/dist/components/banner-function-declaration.d.mts.map +1 -0
- package/dist/plugin-banner/dist/components/banner-function-declaration.mjs +133 -0
- package/dist/plugin-banner/dist/components/banner-function-declaration.mjs.map +1 -0
- package/dist/plugin-help/dist/components/display.cjs +16 -2
- package/dist/plugin-help/dist/components/display.mjs +16 -2
- package/dist/plugin-help/dist/components/display.mjs.map +1 -1
- package/dist/plugin-help/dist/index.cjs +2 -2
- package/dist/plugin-help/dist/index.mjs +2 -2
- package/dist/plugin-help/dist/index.mjs.map +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_string-format@0.17.4 → @stryke_string-format@0.17.6}/node_modules/@stryke/string-format/dist/constant-case.cjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_string-format@0.17.4 → @stryke_string-format@0.17.6}/node_modules/@stryke/string-format/dist/constant-case.mjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_string-format@0.17.4 → @stryke_string-format@0.17.6}/node_modules/@stryke/string-format/dist/constant-case.mjs.map +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_string-format@0.17.4 → @stryke_string-format@0.17.6}/node_modules/@stryke/string-format/dist/get-words.cjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_string-format@0.17.4 → @stryke_string-format@0.17.6}/node_modules/@stryke/string-format/dist/get-words.mjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_string-format@0.17.4 → @stryke_string-format@0.17.6}/node_modules/@stryke/string-format/dist/get-words.mjs.map +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_string-format@0.17.4 → @stryke_string-format@0.17.6}/node_modules/@stryke/string-format/dist/kebab-case.cjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_string-format@0.17.4 → @stryke_string-format@0.17.6}/node_modules/@stryke/string-format/dist/kebab-case.mjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_string-format@0.17.4 → @stryke_string-format@0.17.6}/node_modules/@stryke/string-format/dist/kebab-case.mjs.map +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_string-format@0.17.4 → @stryke_string-format@0.17.6}/node_modules/@stryke/string-format/dist/snake-case.cjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_string-format@0.17.4 → @stryke_string-format@0.17.6}/node_modules/@stryke/string-format/dist/snake-case.mjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_string-format@0.17.4 → @stryke_string-format@0.17.6}/node_modules/@stryke/string-format/dist/snake-case.mjs.map +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_string-format@0.17.4 → @stryke_string-format@0.17.6}/node_modules/@stryke/string-format/dist/upper-case-first.cjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_string-format@0.17.4 → @stryke_string-format@0.17.6}/node_modules/@stryke/string-format/dist/upper-case-first.mjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_string-format@0.17.4 → @stryke_string-format@0.17.6}/node_modules/@stryke/string-format/dist/upper-case-first.mjs.map +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-empty.cjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-empty.mjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-empty.mjs.map +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-null.cjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-null.mjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-null.mjs.map +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-set-string.cjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-set-string.mjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-set-string.mjs.map +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-set.cjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-set.mjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-set.mjs.map +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-string.cjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-string.mjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-string.mjs.map +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-undefined.cjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-undefined.mjs +1 -1
- package/dist/plugin-help/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.39 → @stryke_type-checks@0.5.41}/node_modules/@stryke/type-checks/dist/is-undefined.mjs.map +1 -1
- package/package.json +21 -21
- package/dist/components/banner-function-declaration.d.cts +0 -11
- package/dist/components/banner-function-declaration.d.cts.map +0 -1
- package/dist/components/banner-function-declaration.d.mts +0 -11
- package/dist/components/banner-function-declaration.d.mts.map +0 -1
- package/dist/components/banner-function-declaration.mjs +0 -78
- package/dist/components/banner-function-declaration.mjs.map +0 -1
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { Show, code, computed } from "@alloy-js/core";
|
|
3
|
+
import { FunctionDeclaration, IfStatement } from "@alloy-js/typescript";
|
|
4
|
+
import { getAppDescription, getAppTitle } from "@shell-shock/core/plugin-utils";
|
|
5
|
+
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
6
|
+
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
7
|
+
import { useTheme } from "@shell-shock/plugin-theme/contexts/theme";
|
|
8
|
+
|
|
9
|
+
//#region ../plugin-banner/dist/components/banner-function-declaration.mjs
|
|
10
|
+
/**
|
|
11
|
+
* A component to generate the `banner` function for a specific command or application.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
|
|
15
|
+
*/
|
|
16
|
+
function BannerFunctionDeclarationWrapper(props) {
|
|
17
|
+
const { command, children } = props;
|
|
18
|
+
const context = usePowerlines();
|
|
19
|
+
return createComponent(FunctionDeclaration, {
|
|
20
|
+
"export": true,
|
|
21
|
+
async: true,
|
|
22
|
+
name: "showBanner",
|
|
23
|
+
get doc() {
|
|
24
|
+
return `Write the ${getAppTitle(context, true)} command-line interface application banner ${command ? `for the ${command.title} command ` : ""}to the console.`;
|
|
25
|
+
},
|
|
26
|
+
parameters: [{
|
|
27
|
+
name: "sleepTimeoutMs",
|
|
28
|
+
type: "number",
|
|
29
|
+
default: 500
|
|
30
|
+
}],
|
|
31
|
+
get children() {
|
|
32
|
+
return [children, createComponent(IfStatement, {
|
|
33
|
+
condition: code`isInteractive && !isHelp`,
|
|
34
|
+
children: code`await sleep(sleepTimeoutMs);`
|
|
35
|
+
})];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A component to generate the `banner` function's body for a specific command or application.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
|
|
44
|
+
*/
|
|
45
|
+
function BannerFunctionBodyDeclaration(props) {
|
|
46
|
+
const { consoleFnName = "log", variant = "primary", title, header, footer, description, command, children, insertNewlineBeforeCommand = false, insertNewlineBeforeBanner = true, insertNewlineAfterDescription = false } = props;
|
|
47
|
+
const theme = useTheme();
|
|
48
|
+
const bannerPadding = computed(() => Math.max(theme.padding.app, 0) * 2 + theme.borderStyles.banner.outline[variant].left.length + theme.borderStyles.banner.outline[variant].right.length);
|
|
49
|
+
const totalPadding = computed(() => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value);
|
|
50
|
+
return [
|
|
51
|
+
code`
|
|
52
|
+
if (useApp().get("banner") || hasFlag("no-banner") || hasFlag("hide-banner") || isMinimal) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
useApp().set("banner", true); `,
|
|
57
|
+
createComponent(Spacing, {}),
|
|
58
|
+
children,
|
|
59
|
+
createComponent(Spacing, {}),
|
|
60
|
+
createComponent(Show, {
|
|
61
|
+
when: insertNewlineBeforeBanner,
|
|
62
|
+
children: code`writeLine(""); `
|
|
63
|
+
}),
|
|
64
|
+
createComponent(Spacing, {}),
|
|
65
|
+
memo(() => code`
|
|
66
|
+
writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].topLeft}") + ${theme.icons.banner.header[variant] ? `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}".repeat(6)) + " " + ${theme.icons.banner.header[variant] ? `colors.text.banner.header.${variant}("${theme.icons.banner.header[variant]}") + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}") + " " +` : ""} colors.bold(colors.text.banner.header.${variant}("${header}")) + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}".repeat(Math.max(process.stdout.columns - ${6 + (theme.icons.banner.header[variant] ? theme.icons.banner.header[variant].length + 3 : 0) + (header ? header.length + 2 : 0) + bannerPadding.value}, 0)))` : `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].top}".repeat(Math.max(process.stdout.columns - ${bannerPadding.value}, 0)))`} + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].topRight}"), { consoleFn: console.${consoleFnName} });
|
|
67
|
+
|
|
68
|
+
splitText(
|
|
69
|
+
${title ? `"${title}"` : "title"},
|
|
70
|
+
Math.max(process.stdout.columns - ${totalPadding.value}, 0)
|
|
71
|
+
).forEach((line) => {
|
|
72
|
+
writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.bold(colors.text.banner.title.${variant}(line)) + " ".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} });
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
${command?.title ? `${insertNewlineBeforeCommand ? `writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(process.stdout.columns - ${bannerPadding.value})) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} }); ` : ""}
|
|
76
|
+
${`writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi("${command.title}").length ${command.icon ? " + 3" : ""} + ${bannerPadding.value})) / 2), 0)) + colors.bold(colors.text.banner.command.${variant}("${command.icon ? `${command.icon} ` : ""}${command.title}")) + " ".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi("${command.title}").length ${command.icon ? " + 3" : ""} + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} }); `} ` : ""}
|
|
77
|
+
|
|
78
|
+
splitText(
|
|
79
|
+
colors.bold(${command?.title ? "colors.text.banner.description" : "colors.text.banner.command"}.${variant}("${description.replace(/"/g, "\\\"")}")),
|
|
80
|
+
Math.max(process.stdout.columns - ${totalPadding.value}, 0)
|
|
81
|
+
).forEach((line) => {
|
|
82
|
+
writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.text.banner.description.${variant}(line) + " ".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} });
|
|
83
|
+
});
|
|
84
|
+
${insertNewlineAfterDescription ? `writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].left}") + " ".repeat(Math.max(process.stdout.columns - ${bannerPadding.value})) + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].right}"), { consoleFn: console.${consoleFnName} });` : ""}
|
|
85
|
+
writeLine(colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottomLeft}") + ${footer ? `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottom}".repeat(Math.max(process.stdout.columns - ${8 + (footer ? footer.length : 0) + bannerPadding.value}, 0))) + " " + ${footer ? `colors.bold(colors.text.banner.footer.${variant}("${footer}"))` : ""} + " " + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottom}".repeat(6))` : `colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottom}".repeat(Math.max(process.stdout.columns - ${bannerPadding.value}, 0)))`} + colors.border.banner.outline.${variant}("${theme.borderStyles.banner.outline[variant].bottomRight}"), { consoleFn: console.${consoleFnName} });
|
|
86
|
+
|
|
87
|
+
writeLine(""); `)
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A component to generate the `banner` function for a specific command or application.
|
|
92
|
+
*
|
|
93
|
+
* @remarks
|
|
94
|
+
* This function will display a banner in the console with the application's name, version, and description. It can be customized with different variants for styling and supports conditional rendering based on flags or environment variables.
|
|
95
|
+
*/
|
|
96
|
+
function BannerFunctionDeclaration(props) {
|
|
97
|
+
const { consoleFnName = "log", variant = "primary", command, children, insertNewlineBeforeBanner = true } = props;
|
|
98
|
+
const theme = useTheme();
|
|
99
|
+
const context = usePowerlines();
|
|
100
|
+
const header = computed(() => `${theme.labels.banner.header[variant] || getAppTitle(context, false)} v${context.packageJson.version || "1.0.0"}`);
|
|
101
|
+
const footer = computed(() => theme.labels.banner.footer[variant]);
|
|
102
|
+
const title = computed(() => getAppTitle(context, true).replace(`v${context.packageJson.version || "1.0.0"}`, ""));
|
|
103
|
+
const description = computed(() => command?.description || getAppDescription(context));
|
|
104
|
+
return createComponent(BannerFunctionDeclarationWrapper, {
|
|
105
|
+
command,
|
|
106
|
+
get children() {
|
|
107
|
+
return createComponent(BannerFunctionBodyDeclaration, {
|
|
108
|
+
get title() {
|
|
109
|
+
return title.value;
|
|
110
|
+
},
|
|
111
|
+
get header() {
|
|
112
|
+
return header.value;
|
|
113
|
+
},
|
|
114
|
+
get description() {
|
|
115
|
+
return description.value;
|
|
116
|
+
},
|
|
117
|
+
get footer() {
|
|
118
|
+
return footer.value;
|
|
119
|
+
},
|
|
120
|
+
variant,
|
|
121
|
+
consoleFnName,
|
|
122
|
+
command,
|
|
123
|
+
insertNewlineBeforeCommand: true,
|
|
124
|
+
insertNewlineBeforeBanner,
|
|
125
|
+
children
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
//#endregion
|
|
132
|
+
export { BannerFunctionBodyDeclaration, BannerFunctionDeclaration, BannerFunctionDeclarationWrapper };
|
|
133
|
+
//# sourceMappingURL=banner-function-declaration.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner-function-declaration.mjs","names":[],"sources":["../../../../../plugin-banner/dist/components/banner-function-declaration.mjs"],"sourcesContent":["import { createComponent, memo } from \"@alloy-js/core/jsx-runtime\";\nimport { Show, code, computed } from \"@alloy-js/core\";\nimport { getAppDescription, getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { FunctionDeclaration, IfStatement } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { useTheme } from \"@shell-shock/plugin-theme/contexts/theme\";\n\n//#region src/components/banner-function-declaration.tsx\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*/\nfunction BannerFunctionDeclarationWrapper(props) {\n\tconst { command, children } = props;\n\tconst context = usePowerlines();\n\treturn createComponent(FunctionDeclaration, {\n\t\t\"export\": true,\n\t\tasync: true,\n\t\tname: \"showBanner\",\n\t\tget doc() {\n\t\t\treturn `Write the ${getAppTitle(context, true)} command-line interface application banner ${command ? `for the ${command.title} command ` : \"\"}to the console.`;\n\t\t},\n\t\tparameters: [{\n\t\t\tname: \"sleepTimeoutMs\",\n\t\t\ttype: \"number\",\n\t\t\tdefault: 500\n\t\t}],\n\t\tget children() {\n\t\t\treturn [children, createComponent(IfStatement, {\n\t\t\t\tcondition: code`isInteractive && !isHelp`,\n\t\t\t\tchildren: code`await sleep(sleepTimeoutMs);`\n\t\t\t})];\n\t\t}\n\t});\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*/\nfunction BannerFunctionBodyDeclaration(props) {\n\tconst { consoleFnName = \"log\", variant = \"primary\", title, header, footer, description, command, children, insertNewlineBeforeCommand = false, insertNewlineBeforeBanner = true, insertNewlineAfterDescription = false } = props;\n\tconst theme = useTheme();\n\tconst bannerPadding = computed(() => Math.max(theme.padding.app, 0) * 2 + theme.borderStyles.banner.outline[variant].left.length + theme.borderStyles.banner.outline[variant].right.length);\n\tconst totalPadding = computed(() => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value);\n\treturn [\n\t\tcode`\n if (useApp().get(\"banner\") || hasFlag(\"no-banner\") || hasFlag(\"hide-banner\") || isMinimal) {\n return;\n }\n\n useApp().set(\"banner\", true); `,\n\t\tcreateComponent(Spacing, {}),\n\t\tchildren,\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(Show, {\n\t\t\twhen: insertNewlineBeforeBanner,\n\t\t\tchildren: code`writeLine(\"\"); `\n\t\t}),\n\t\tcreateComponent(Spacing, {}),\n\t\tmemo(() => code`\n writeLine(colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].topLeft}\") + ${theme.icons.banner.header[variant] ? `colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].top}\".repeat(6)) + \" \" + ${theme.icons.banner.header[variant] ? `colors.text.banner.header.${variant}(\"${theme.icons.banner.header[variant]}\") + \" \" + colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].top}\") + \" \" +` : \"\"} colors.bold(colors.text.banner.header.${variant}(\"${header}\")) + \" \" + colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].top}\".repeat(Math.max(process.stdout.columns - ${6 + (theme.icons.banner.header[variant] ? theme.icons.banner.header[variant].length + 3 : 0) + (header ? header.length + 2 : 0) + bannerPadding.value}, 0)))` : `colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].top}\".repeat(Math.max(process.stdout.columns - ${bannerPadding.value}, 0)))`} + colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].topRight}\"), { consoleFn: console.${consoleFnName} });\n\n splitText(\n ${title ? `\"${title}\"` : \"title\"},\n Math.max(process.stdout.columns - ${totalPadding.value}, 0)\n ).forEach((line) => {\n writeLine(colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].left}\") + \" \".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.bold(colors.text.banner.title.${variant}(line)) + \" \".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi(line).length + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].right}\"), { consoleFn: console.${consoleFnName} });\n });\n\n ${command?.title ? `${insertNewlineBeforeCommand ? `writeLine(colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].left}\") + \" \".repeat(Math.max(process.stdout.columns - ${bannerPadding.value})) + colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].right}\"), { consoleFn: console.${consoleFnName} }); ` : \"\"}\n ${`writeLine(colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].left}\") + \" \".repeat(Math.max(Math.floor((process.stdout.columns - (stripAnsi(\"${command.title}\").length ${command.icon ? \" + 3\" : \"\"} + ${bannerPadding.value})) / 2), 0)) + colors.bold(colors.text.banner.command.${variant}(\"${command.icon ? `${command.icon} ` : \"\"}${command.title}\")) + \" \".repeat(Math.max(Math.ceil((process.stdout.columns - (stripAnsi(\"${command.title}\").length ${command.icon ? \" + 3\" : \"\"} + ${bannerPadding.value})) / 2), 0)) + colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].right}\"), { consoleFn: console.${consoleFnName} }); `} ` : \"\"}\n\n splitText(\n colors.bold(${command?.title ? \"colors.text.banner.description\" : \"colors.text.banner.command\"}.${variant}(\"${description.replace(/\"/g, \"\\\\\\\"\")}\")),\n Math.max(process.stdout.columns - ${totalPadding.value}, 0)\n ).forEach((line) => {\n 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} });\n });\n ${insertNewlineAfterDescription ? `writeLine(colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].left}\") + \" \".repeat(Math.max(process.stdout.columns - ${bannerPadding.value})) + colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].right}\"), { consoleFn: console.${consoleFnName} });` : \"\"}\n writeLine(colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].bottomLeft}\") + ${footer ? `colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].bottom}\".repeat(Math.max(process.stdout.columns - ${8 + (footer ? footer.length : 0) + bannerPadding.value}, 0))) + \" \" + ${footer ? `colors.bold(colors.text.banner.footer.${variant}(\"${footer}\"))` : \"\"} + \" \" + colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].bottom}\".repeat(6))` : `colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].bottom}\".repeat(Math.max(process.stdout.columns - ${bannerPadding.value}, 0)))`} + colors.border.banner.outline.${variant}(\"${theme.borderStyles.banner.outline[variant].bottomRight}\"), { consoleFn: console.${consoleFnName} });\n\n writeLine(\"\"); `)\n\t];\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*/\nfunction BannerFunctionDeclaration(props) {\n\tconst { consoleFnName = \"log\", variant = \"primary\", command, children, insertNewlineBeforeBanner = true } = props;\n\tconst theme = useTheme();\n\tconst context = usePowerlines();\n\tconst header = computed(() => `${theme.labels.banner.header[variant] || getAppTitle(context, false)} v${context.packageJson.version || \"1.0.0\"}`);\n\tconst footer = computed(() => theme.labels.banner.footer[variant]);\n\tconst title = computed(() => getAppTitle(context, true).replace(`v${context.packageJson.version || \"1.0.0\"}`, \"\"));\n\tconst description = computed(() => command?.description || getAppDescription(context));\n\treturn createComponent(BannerFunctionDeclarationWrapper, {\n\t\tcommand,\n\t\tget children() {\n\t\t\treturn createComponent(BannerFunctionBodyDeclaration, {\n\t\t\t\tget title() {\n\t\t\t\t\treturn title.value;\n\t\t\t\t},\n\t\t\t\tget header() {\n\t\t\t\t\treturn header.value;\n\t\t\t\t},\n\t\t\t\tget description() {\n\t\t\t\t\treturn description.value;\n\t\t\t\t},\n\t\t\t\tget footer() {\n\t\t\t\t\treturn footer.value;\n\t\t\t\t},\n\t\t\t\tvariant,\n\t\t\t\tconsoleFnName,\n\t\t\t\tcommand,\n\t\t\t\tinsertNewlineBeforeCommand: true,\n\t\t\t\tinsertNewlineBeforeBanner,\n\t\t\t\tchildren\n\t\t\t});\n\t\t}\n\t});\n}\n\n//#endregion\nexport { BannerFunctionBodyDeclaration, BannerFunctionDeclaration, BannerFunctionDeclarationWrapper };\n//# sourceMappingURL=banner-function-declaration.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,iCAAiC,OAAO;CAChD,MAAM,EAAE,SAAS,aAAa;CAC9B,MAAM,UAAU,eAAe;AAC/B,QAAO,gBAAgB,qBAAqB;EAC3C,UAAU;EACV,OAAO;EACP,MAAM;EACN,IAAI,MAAM;AACT,UAAO,aAAa,YAAY,SAAS,KAAK,CAAC,6CAA6C,UAAU,WAAW,QAAQ,MAAM,aAAa,GAAG;;EAEhJ,YAAY,CAAC;GACZ,MAAM;GACN,MAAM;GACN,SAAS;GACT,CAAC;EACF,IAAI,WAAW;AACd,UAAO,CAAC,UAAU,gBAAgB,aAAa;IAC9C,WAAW,IAAI;IACf,UAAU,IAAI;IACd,CAAC,CAAC;;EAEJ,CAAC;;;;;;;;AAQH,SAAS,8BAA8B,OAAO;CAC7C,MAAM,EAAE,gBAAgB,OAAO,UAAU,WAAW,OAAO,QAAQ,QAAQ,aAAa,SAAS,UAAU,6BAA6B,OAAO,4BAA4B,MAAM,gCAAgC,UAAU;CAC3N,MAAM,QAAQ,UAAU;CACxB,MAAM,gBAAgB,eAAe,KAAK,IAAI,MAAM,QAAQ,KAAK,EAAE,GAAG,IAAI,MAAM,aAAa,OAAO,QAAQ,SAAS,KAAK,SAAS,MAAM,aAAa,OAAO,QAAQ,SAAS,MAAM,OAAO;CAC3L,MAAM,eAAe,eAAe,KAAK,IAAI,MAAM,QAAQ,QAAQ,EAAE,GAAG,IAAI,cAAc,MAAM;AAChG,QAAO;EACN,IAAI;;;;;;EAMJ,gBAAgB,SAAS,EAAE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,OAAO,gBAAgB,gCAAgC,QAAQ,IAAI,MAAM,aAAa,OAAO,QAAQ,SAAS,OAAO,6CAA6C,cAAc,MAAM,QAAQ,kCAAkC,QAAQ,IAAI,MAAM,aAAa,OAAO,QAAQ,SAAS,YAAY,2BAA2B,cAAc;;yBAEvzB;EACvB;;;;;;;;AAQF,SAAS,0BAA0B,OAAO;CACzC,MAAM,EAAE,gBAAgB,OAAO,UAAU,WAAW,SAAS,UAAU,4BAA4B,SAAS;CAC5G,MAAM,QAAQ,UAAU;CACxB,MAAM,UAAU,eAAe;CAC/B,MAAM,SAAS,eAAe,GAAG,MAAM,OAAO,OAAO,OAAO,YAAY,YAAY,SAAS,MAAM,CAAC,IAAI,QAAQ,YAAY,WAAW,UAAU;CACjJ,MAAM,SAAS,eAAe,MAAM,OAAO,OAAO,OAAO,SAAS;CAClE,MAAM,QAAQ,eAAe,YAAY,SAAS,KAAK,CAAC,QAAQ,IAAI,QAAQ,YAAY,WAAW,WAAW,GAAG,CAAC;CAClH,MAAM,cAAc,eAAe,SAAS,eAAe,kBAAkB,QAAQ,CAAC;AACtF,QAAO,gBAAgB,kCAAkC;EACxD;EACA,IAAI,WAAW;AACd,UAAO,gBAAgB,+BAA+B;IACrD,IAAI,QAAQ;AACX,YAAO,MAAM;;IAEd,IAAI,SAAS;AACZ,YAAO,OAAO;;IAEf,IAAI,cAAc;AACjB,YAAO,YAAY;;IAEpB,IAAI,SAAS;AACZ,YAAO,OAAO;;IAEf;IACA;IACA;IACA,4BAA4B;IAC5B;IACA;IACA,CAAC;;EAEH,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
2
|
-
const
|
|
3
|
-
const
|
|
2
|
+
const require_is_set_string = require('../node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.cjs');
|
|
3
|
+
const require_kebab_case = require('../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.cjs');
|
|
4
|
+
const require_snake_case = require('../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.cjs');
|
|
4
5
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
5
6
|
let _alloy_js_core = require("@alloy-js/core");
|
|
6
7
|
let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
@@ -140,6 +141,19 @@ function BaseHelpDisplay(props) {
|
|
|
140
141
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
|
|
141
142
|
];
|
|
142
143
|
}
|
|
144
|
+
}),
|
|
145
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
146
|
+
get when() {
|
|
147
|
+
return require_is_set_string.isSetString(command.reference);
|
|
148
|
+
},
|
|
149
|
+
get children() {
|
|
150
|
+
return [
|
|
151
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine("");
|
|
152
|
+
writeLine(colors.text.heading.tertiary(\`More information about this command can be found in the reference documentation at ${command.reference}\`)${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
|
|
153
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
154
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
|
|
155
|
+
];
|
|
156
|
+
}
|
|
143
157
|
})
|
|
144
158
|
];
|
|
145
159
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { isSetString } from "../node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.mjs";
|
|
2
|
+
import { kebabCase } from "../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs";
|
|
3
|
+
import { snakeCase } from "../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs";
|
|
3
4
|
import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
|
|
4
5
|
import { For, Show, code, computed } from "@alloy-js/core";
|
|
5
6
|
import { formatDescription, formatShortDescription, getAppBin, getAppTitle, getDynamicPathSegmentName, isDynamicPathSegment, sortOptions } from "@shell-shock/core/plugin-utils";
|
|
@@ -139,6 +140,19 @@ function BaseHelpDisplay(props) {
|
|
|
139
140
|
createComponent(Spacing, {})
|
|
140
141
|
];
|
|
141
142
|
}
|
|
143
|
+
}),
|
|
144
|
+
createComponent(Show, {
|
|
145
|
+
get when() {
|
|
146
|
+
return isSetString(command.reference);
|
|
147
|
+
},
|
|
148
|
+
get children() {
|
|
149
|
+
return [
|
|
150
|
+
memo(() => code`writeLine("");
|
|
151
|
+
writeLine(colors.text.heading.tertiary(\`More information about this command can be found in the reference documentation at ${command.reference}\`)${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
|
|
152
|
+
createIntrinsic("hbr", {}),
|
|
153
|
+
createComponent(Spacing, {})
|
|
154
|
+
];
|
|
155
|
+
}
|
|
142
156
|
})
|
|
143
157
|
];
|
|
144
158
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.mjs","names":[],"sources":["../../../../../plugin-help/dist/components/display.mjs"],"sourcesContent":["import { kebabCase } from \"../node_modules/.pnpm/@stryke_string-format@0.17.4/node_modules/@stryke/string-format/dist/kebab-case.mjs\";\nimport { snakeCase } from \"../node_modules/.pnpm/@stryke_string-format@0.17.4/node_modules/@stryke/string-format/dist/snake-case.mjs\";\nimport { createComponent, createIntrinsic, memo } from \"@alloy-js/core/jsx-runtime\";\nimport { For, Show, code, computed } from \"@alloy-js/core\";\nimport { formatDescription, formatShortDescription, getAppBin, getAppTitle, getDynamicPathSegmentName, isDynamicPathSegment, sortOptions } from \"@shell-shock/core/plugin-utils\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\nimport { useTheme } from \"@shell-shock/plugin-theme/contexts/theme\";\n\n//#region src/components/display.tsx\n/**\n* A component that generates the usage display for a command.\n*/\nfunction HelpUsageDisplay(props) {\n\tconst { command, indent = 2 } = props;\n\tconst context = usePowerlines();\n\tconst theme = useTheme();\n\treturn [createComponent(For, {\n\t\tget each() {\n\t\t\treturn Object.keys(context.config.bin);\n\t\t},\n\t\thardline: true,\n\t\tchildren: (bin) => [memo(() => code`\n writeLine(\n colors.text.body.secondary(\\`\\$ \\${colors.text.usage.bin(\"${bin}\")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\\${colors.text.usage.${isDynamicPathSegment(segment) ? \"dynamic\" : \"command\"}(\"${isDynamicPathSegment(segment) ? `[${snakeCase(getDynamicPathSegmentName(segment))}]` : segment}\")}`).join(\" \")}` : \"\"}${Object.values(command.children).length > 0 ? ` \\${colors.text.usage.dynamic(\"[command]\")}` : \"\"}${command.args.length > 0 ? ` ${command.args.map((arg) => `\\${colors.text.usage.args(\"<${snakeCase((arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.choices && arg.choices.length > 0 ? arg.choices.join(\"|\") : arg.kind === CommandParameterKinds.string && arg.format ? arg.format : arg.name)}${(arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.variadic ? \"...\" : \"\"}>\")}`).join(\" \")}` : \"\"} \\${colors.text.usage.options(\"[options]\")}\\`), { padding: ${theme.padding.app * indent} }\n );`), createIntrinsic(\"hbr\", {})]\n\t}), createComponent(Show, {\n\t\tget when() {\n\t\t\treturn command.args.length > 0;\n\t\t},\n\t\tget children() {\n\t\t\treturn [createIntrinsic(\"hbr\", {}), createComponent(For, {\n\t\t\t\tget each() {\n\t\t\t\t\treturn Object.keys(context.config.bin);\n\t\t\t\t},\n\t\t\t\thardline: true,\n\t\t\t\tchildren: (bin) => [memo(() => code`\n writeLine(\n colors.text.body.secondary(\\`\\$ \\${colors.text.usage.bin(\"${bin}\")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\\${colors.text.usage.${isDynamicPathSegment(segment) ? \"dynamic\" : \"command\"}(\"${isDynamicPathSegment(segment) ? `[${snakeCase(getDynamicPathSegmentName(segment))}]` : segment}\")}`).join(\" \")}` : \"\"}${Object.values(command.children).length > 0 ? ` \\${colors.text.usage.dynamic(\"[command]\")}` : \"\"} \\${colors.text.usage.options(\"[options]\")}${command.args.length > 0 ? ` ${command.args.map((arg) => `\\${colors.text.usage.args(\"<${snakeCase((arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.choices && arg.choices.length > 0 ? arg.choices.join(\"|\") : arg.kind === CommandParameterKinds.string && arg.format ? arg.format : arg.name)}${(arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.variadic ? \"...\" : \"\"}>\")}`).join(\" \")}` : \"\"}\\`), { padding: ${theme.padding.app * indent} }\n );`), createIntrinsic(\"hbr\", {})]\n\t\t\t})];\n\t\t}\n\t})];\n}\n/**\n* A component that generates the options table display for a command.\n*/\nfunction HelpOptionsDisplay(props) {\n\tconst { options } = props;\n\tconst context = usePowerlines();\n\treturn [\n\t\tcode`table([ `,\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcreateComponent(For, {\n\t\t\tget each() {\n\t\t\t\treturn sortOptions(options);\n\t\t\t},\n\t\t\thardline: true,\n\t\t\tchildren: (option) => {\n\t\t\t\tconst flags = [];\n\t\t\t\tconst names = [];\n\t\t\t\tif (option.name.length === 1) flags.push(`-${option.name}`);\n\t\t\t\telse names.push(`--${kebabCase(option.name)}`);\n\t\t\t\toption.alias.forEach((alias) => {\n\t\t\t\t\tif (alias.length === 1) flags.push(`-${alias}`);\n\t\t\t\t\telse names.push(`--${kebabCase(alias)}`);\n\t\t\t\t});\n\t\t\t\treturn code`[{ value: colors.text.body.primary(\"${flags.length > 0 ? `${flags.sort().join(\", \")}${names.length > 0 ? \", \" : \"\"}` : \"\"}${names.length > 0 ? names.sort().join(\", \") : \"\"}${option.kind === CommandParameterKinds.string ? ` <${snakeCase(option.choices && option.choices.length > 0 ? option.choices.join(\"|\") : option.format ? option.format : option.name)}${option.variadic ? \"...\" : \"\"}>` : option.kind === CommandParameterKinds.number ? ` <${snakeCase(option.choices && option.choices.length > 0 ? option.choices.join(\"|\") : option.name)}${option.variadic ? \"...\" : \"\"}>` : \"\"}\"), align: \"right\", border: \"none\", maxWidth: \"1/3\" }, { value: colors.text.body.tertiary(\\`${formatShortDescription(option.description).replace(/\\.+$/, \"\").trim()}${option.env || option.default !== void 0 ? ` (${option.env ? `env: ${context.config.appSpecificEnvPrefix}_${option.env}${option.default !== void 0 ? \", \" : \"\"}` : \"\"}${option.default !== void 0 ? `default: ${JSON.stringify(option.default).replace(/\"/g, \"\\\\\\\"\")}` : \"\"})` : \"\"}.\\`), align: \"left\", border: \"none\" }], `;\n\t\t\t}\n\t\t}),\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcode` ]); `\n\t];\n}\n/**\n* A component that generates the commands table display for a command.\n*/\nfunction HelpCommandsDisplay(props) {\n\tconst { commands } = props;\n\treturn [\n\t\tcode`table([ `,\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcreateComponent(For, {\n\t\t\tget each() {\n\t\t\t\treturn Object.values(commands);\n\t\t\t},\n\t\t\thardline: true,\n\t\t\tchildren: (child) => code`[{ value: colors.text.body.primary(\"${child.name}\"), align: \"right\", border: \"none\" }, { value: colors.text.body.tertiary(\\`${formatShortDescription(child.description).replace(/\\.+$/, \"\").trim()}.\\`), align: \"left\", border: \"none\" }], `\n\t\t}),\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcode` ]); `\n\t];\n}\n/**\n* A component that generates the `help` function declaration for a command.\n*/\nfunction BaseHelpDisplay(props) {\n\tconst { command, indent = 1, filterGlobalOptions = false } = props;\n\tconst theme = useTheme();\n\tconst context = usePowerlines();\n\tconst options = computed(() => filterGlobalOptions ? Object.values(command.options).filter((option) => !context.options.some((globalOption) => globalOption.name === option.name || option.alias.includes(globalOption.name) || globalOption.alias?.includes(option.name) || globalOption.alias?.some((alias) => option.alias.includes(alias)))) : Object.values(command.options));\n\treturn [\n\t\tmemo(() => code`writeLine(colors.bold(colors.text.heading.secondary(\"Usage:\"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"});`),\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcreateComponent(HelpUsageDisplay, {\n\t\t\tcommand,\n\t\t\tindent\n\t\t}),\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn options.value.length > 0;\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tmemo(() => code`writeLine(\"\");\n writeLine(colors.bold(colors.text.heading.secondary(\"Options:\"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"});`),\n\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\tcreateComponent(HelpOptionsDisplay, { get options() {\n\t\t\t\t\t\treturn options.value;\n\t\t\t\t\t} }),\n\t\t\t\t\tcreateComponent(Spacing, {})\n\t\t\t\t];\n\t\t\t}\n\t\t}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn Object.keys(command.children).length > 0;\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tmemo(() => code`writeLine(\"\");\n writeLine(colors.bold(colors.text.heading.secondary(\"Commands:\"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"});`),\n\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\tcreateComponent(HelpCommandsDisplay, { get commands() {\n\t\t\t\t\t\treturn command.children;\n\t\t\t\t\t} }),\n\t\t\t\t\tcreateComponent(Spacing, {})\n\t\t\t\t];\n\t\t\t}\n\t\t})\n\t];\n}\n/**\n* A component that generates the invocation of the `help` function for a command.\n*/\nfunction VirtualCommandHelpDisplay(props) {\n\tconst { options, segments, commands } = props;\n\tconst context = usePowerlines();\n\treturn [\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcode`writeLine(colors.bold(colors.text.heading.secondary(\"Global Options:\")));`,\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcreateComponent(HelpOptionsDisplay, { options }),\n\t\tcode`writeLine(\"\"); `,\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn Object.keys(commands).length > 0;\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tmemo(() => code`writeLine(colors.text.body.secondary(\"The following commands are available through the ${getAppTitle(context, true)} command-line interface:\"));\n writeLine(\"\"); `),\n\t\t\t\t\tcreateComponent(Spacing, {}),\n\t\t\t\t\tcreateComponent(For, {\n\t\t\t\t\t\tget each() {\n\t\t\t\t\t\t\treturn Object.values(commands);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdoubleHardline: true,\n\t\t\t\t\t\tjoiner: code`writeLine(\"\"); `,\n\t\t\t\t\t\tender: code`writeLine(\"\"); `,\n\t\t\t\t\t\tchildren: (child) => [\n\t\t\t\t\t\t\tmemo(() => code`\n writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? \" ${child.icon} \" : \"\") + ` : \"\"}\"${child.title} ${child.isVirtual ? \"\" : \"Command\"}\"));\n writeLine(\"\");\n writeLine(colors.text.body.secondary(splitText(\\`${formatDescription(child.description).replace(/\\.+$/, \"\").trim()}.\\`)));\n writeLine(\"\");\n `),\n\t\t\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\t\t\tcreateComponent(BaseHelpDisplay, {\n\t\t\t\t\t\t\t\tcommand: child,\n\t\t\t\t\t\t\t\tindent: 2,\n\t\t\t\t\t\t\t\tfilterGlobalOptions: true\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcreateIntrinsic(\"hbr\", {})\n\t\t\t\t\t\t]\n\t\t\t\t\t}),\n\t\t\t\t\tmemo(() => code`help(\"Running a specific command with the help flag (via: '${getAppBin(context)}${segments && segments.length > 0 ? ` ${segments.join(\" \")}` : \"\"} <specific command> --help') will provide additional information that is specific to that command.\");\n writeLine(\"\");`)\n\t\t\t\t];\n\t\t\t}\n\t\t})\n\t];\n}\n/**\n* A component that generates the invocation of the `help` function for a command.\n*/\nfunction CommandHelpDisplay(props) {\n\tconst { command } = props;\n\tconst context = usePowerlines();\n\treturn [\n\t\tcode`writeLine(\"\"); `,\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(BaseHelpDisplay, {\n\t\t\tcommand,\n\t\t\tfilterGlobalOptions: false\n\t\t}),\n\t\tcode`writeLine(\"\"); `,\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn Object.keys(command.children).length > 0;\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tcode`writeLine(colors.text.body.secondary(\"The following sub-commands are available:\"));\n writeLine(\"\"); `,\n\t\t\t\t\tcreateComponent(Spacing, {}),\n\t\t\t\t\tcreateComponent(For, {\n\t\t\t\t\t\tget each() {\n\t\t\t\t\t\t\treturn Object.values(command.children);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdoubleHardline: true,\n\t\t\t\t\t\tjoiner: code`writeLine(\"\"); `,\n\t\t\t\t\t\tender: code`writeLine(\"\"); `,\n\t\t\t\t\t\tchildren: (child) => [\n\t\t\t\t\t\t\tmemo(() => code`\n writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? \" ${child.icon} \" : \"\") + ` : \"\"}\"${child.title} ${child.isVirtual ? \"\" : \"Command\"}\"));\n writeLine(\"\");\n writeLine(colors.text.body.secondary(splitText(\\`${formatDescription(child.description).replace(/\\.+$/, \"\").trim()}.\\`)));\n writeLine(\"\");\n `),\n\t\t\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\t\t\tcreateComponent(BaseHelpDisplay, {\n\t\t\t\t\t\t\t\tcommand: child,\n\t\t\t\t\t\t\t\tindent: 2,\n\t\t\t\t\t\t\t\tfilterGlobalOptions: true\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcreateIntrinsic(\"hbr\", {})\n\t\t\t\t\t\t]\n\t\t\t\t\t}),\n\t\t\t\t\tmemo(() => code`help(\"Running a specific command with the help flag (via: '${getAppBin(context)} ${command.segments.join(\" \")} <specific command> --help') will provide additional information that is specific to that command.\");\n writeLine(\"\");`)\n\t\t\t\t];\n\t\t\t}\n\t\t})\n\t];\n}\n\n//#endregion\nexport { BaseHelpDisplay, CommandHelpDisplay, HelpCommandsDisplay, HelpOptionsDisplay, HelpUsageDisplay, VirtualCommandHelpDisplay };\n//# sourceMappingURL=display.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,iBAAiB,OAAO;CAChC,MAAM,EAAE,SAAS,SAAS,MAAM;CAChC,MAAM,UAAU,eAAe;CAC/B,MAAM,QAAQ,UAAU;AACxB,QAAO,CAAC,gBAAgB,KAAK;EAC5B,IAAI,OAAO;AACV,UAAO,OAAO,KAAK,QAAQ,OAAO,IAAI;;EAEvC,UAAU;EACV,WAAW,QAAQ,CAAC,WAAW,IAAI;;oEAE+B,IAAI,KAAK,QAAQ,SAAS,SAAS,IAAI,IAAI,QAAQ,SAAS,KAAK,YAAY,wBAAwB,qBAAqB,QAAQ,GAAG,YAAY,UAAU,IAAI,qBAAqB,QAAQ,GAAG,IAAI,UAAU,0BAA0B,QAAQ,CAAC,CAAC,KAAK,QAAQ,KAAK,CAAC,KAAK,IAAI,KAAK,KAAK,OAAO,OAAO,QAAQ,SAAS,CAAC,SAAS,IAAI,gDAAgD,KAAK,QAAQ,KA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W;AACd,WAAO;KACN,IAAI;;KAEJ,gBAAgB,SAAS,EAAE,CAAC;KAC5B,gBAAgB,KAAK;MACpB,IAAI,OAAO;AACV,cAAO,OAAO,OAAO,QAAQ,SAAS;;MAEvC,gBAAgB;MAChB,QAAQ,IAAI;MACZ,OAAO,IAAI;MACX,WAAW,UAAU;OACpB,WAAW,IAAI;wDACkC,MAAM,OAAO,2BAA2B,MAAM,KAAK,gBAAgB,GAAG,GAAG,MAAM,MAAM,GAAG,MAAM,YAAY,KAAK,UAAU;;mEAE9G,kBAAkB,MAAM,YAAY,CAAC,QAAQ,QAAQ,GAAG,CAAC,MAAM,CAAC;;kBAEjH;OACX,gBAAgB,OAAO,EAAE,CAAC;OAC1B,gBAAgB,iBAAiB;QAChC,SAAS;QACT,QAAQ;QACR,qBAAqB;QACrB,CAAC;OACF,gBAAgB,OAAO,EAAE,CAAC;OAC1B;MACD,CAAC;KACF,WAAW,IAAI,8DAA8D,UAAU,QAAQ,CAAC,GAAG,QAAQ,SAAS,KAAK,IAAI,CAAC;wBAC3G;KACnB;;GAEF,CAAC;EACF"}
|
|
1
|
+
{"version":3,"file":"display.mjs","names":[],"sources":["../../../../../plugin-help/dist/components/display.mjs"],"sourcesContent":["import { isSetString } from \"../node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.mjs\";\nimport { kebabCase } from \"../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs\";\nimport { snakeCase } from \"../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs\";\nimport { createComponent, createIntrinsic, memo } from \"@alloy-js/core/jsx-runtime\";\nimport { For, Show, code, computed } from \"@alloy-js/core\";\nimport { formatDescription, formatShortDescription, getAppBin, getAppTitle, getDynamicPathSegmentName, isDynamicPathSegment, sortOptions } from \"@shell-shock/core/plugin-utils\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { CommandParameterKinds } from \"@shell-shock/core\";\nimport { useTheme } from \"@shell-shock/plugin-theme/contexts/theme\";\n\n//#region src/components/display.tsx\n/**\n* A component that generates the usage display for a command.\n*/\nfunction HelpUsageDisplay(props) {\n\tconst { command, indent = 2 } = props;\n\tconst context = usePowerlines();\n\tconst theme = useTheme();\n\treturn [createComponent(For, {\n\t\tget each() {\n\t\t\treturn Object.keys(context.config.bin);\n\t\t},\n\t\thardline: true,\n\t\tchildren: (bin) => [memo(() => code`\n writeLine(\n colors.text.body.secondary(\\`\\$ \\${colors.text.usage.bin(\"${bin}\")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\\${colors.text.usage.${isDynamicPathSegment(segment) ? \"dynamic\" : \"command\"}(\"${isDynamicPathSegment(segment) ? `[${snakeCase(getDynamicPathSegmentName(segment))}]` : segment}\")}`).join(\" \")}` : \"\"}${Object.values(command.children).length > 0 ? ` \\${colors.text.usage.dynamic(\"[command]\")}` : \"\"}${command.args.length > 0 ? ` ${command.args.map((arg) => `\\${colors.text.usage.args(\"<${snakeCase((arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.choices && arg.choices.length > 0 ? arg.choices.join(\"|\") : arg.kind === CommandParameterKinds.string && arg.format ? arg.format : arg.name)}${(arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.variadic ? \"...\" : \"\"}>\")}`).join(\" \")}` : \"\"} \\${colors.text.usage.options(\"[options]\")}\\`), { padding: ${theme.padding.app * indent} }\n );`), createIntrinsic(\"hbr\", {})]\n\t}), createComponent(Show, {\n\t\tget when() {\n\t\t\treturn command.args.length > 0;\n\t\t},\n\t\tget children() {\n\t\t\treturn [createIntrinsic(\"hbr\", {}), createComponent(For, {\n\t\t\t\tget each() {\n\t\t\t\t\treturn Object.keys(context.config.bin);\n\t\t\t\t},\n\t\t\t\thardline: true,\n\t\t\t\tchildren: (bin) => [memo(() => code`\n writeLine(\n colors.text.body.secondary(\\`\\$ \\${colors.text.usage.bin(\"${bin}\")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\\${colors.text.usage.${isDynamicPathSegment(segment) ? \"dynamic\" : \"command\"}(\"${isDynamicPathSegment(segment) ? `[${snakeCase(getDynamicPathSegmentName(segment))}]` : segment}\")}`).join(\" \")}` : \"\"}${Object.values(command.children).length > 0 ? ` \\${colors.text.usage.dynamic(\"[command]\")}` : \"\"} \\${colors.text.usage.options(\"[options]\")}${command.args.length > 0 ? ` ${command.args.map((arg) => `\\${colors.text.usage.args(\"<${snakeCase((arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.choices && arg.choices.length > 0 ? arg.choices.join(\"|\") : arg.kind === CommandParameterKinds.string && arg.format ? arg.format : arg.name)}${(arg.kind === CommandParameterKinds.string || arg.kind === CommandParameterKinds.number) && arg.variadic ? \"...\" : \"\"}>\")}`).join(\" \")}` : \"\"}\\`), { padding: ${theme.padding.app * indent} }\n );`), createIntrinsic(\"hbr\", {})]\n\t\t\t})];\n\t\t}\n\t})];\n}\n/**\n* A component that generates the options table display for a command.\n*/\nfunction HelpOptionsDisplay(props) {\n\tconst { options } = props;\n\tconst context = usePowerlines();\n\treturn [\n\t\tcode`table([ `,\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcreateComponent(For, {\n\t\t\tget each() {\n\t\t\t\treturn sortOptions(options);\n\t\t\t},\n\t\t\thardline: true,\n\t\t\tchildren: (option) => {\n\t\t\t\tconst flags = [];\n\t\t\t\tconst names = [];\n\t\t\t\tif (option.name.length === 1) flags.push(`-${option.name}`);\n\t\t\t\telse names.push(`--${kebabCase(option.name)}`);\n\t\t\t\toption.alias.forEach((alias) => {\n\t\t\t\t\tif (alias.length === 1) flags.push(`-${alias}`);\n\t\t\t\t\telse names.push(`--${kebabCase(alias)}`);\n\t\t\t\t});\n\t\t\t\treturn code`[{ value: colors.text.body.primary(\"${flags.length > 0 ? `${flags.sort().join(\", \")}${names.length > 0 ? \", \" : \"\"}` : \"\"}${names.length > 0 ? names.sort().join(\", \") : \"\"}${option.kind === CommandParameterKinds.string ? ` <${snakeCase(option.choices && option.choices.length > 0 ? option.choices.join(\"|\") : option.format ? option.format : option.name)}${option.variadic ? \"...\" : \"\"}>` : option.kind === CommandParameterKinds.number ? ` <${snakeCase(option.choices && option.choices.length > 0 ? option.choices.join(\"|\") : option.name)}${option.variadic ? \"...\" : \"\"}>` : \"\"}\"), align: \"right\", border: \"none\", maxWidth: \"1/3\" }, { value: colors.text.body.tertiary(\\`${formatShortDescription(option.description).replace(/\\.+$/, \"\").trim()}${option.env || option.default !== void 0 ? ` (${option.env ? `env: ${context.config.appSpecificEnvPrefix}_${option.env}${option.default !== void 0 ? \", \" : \"\"}` : \"\"}${option.default !== void 0 ? `default: ${JSON.stringify(option.default).replace(/\"/g, \"\\\\\\\"\")}` : \"\"})` : \"\"}.\\`), align: \"left\", border: \"none\" }], `;\n\t\t\t}\n\t\t}),\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcode` ]); `\n\t];\n}\n/**\n* A component that generates the commands table display for a command.\n*/\nfunction HelpCommandsDisplay(props) {\n\tconst { commands } = props;\n\treturn [\n\t\tcode`table([ `,\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcreateComponent(For, {\n\t\t\tget each() {\n\t\t\t\treturn Object.values(commands);\n\t\t\t},\n\t\t\thardline: true,\n\t\t\tchildren: (child) => code`[{ value: colors.text.body.primary(\"${child.name}\"), align: \"right\", border: \"none\" }, { value: colors.text.body.tertiary(\\`${formatShortDescription(child.description).replace(/\\.+$/, \"\").trim()}.\\`), align: \"left\", border: \"none\" }], `\n\t\t}),\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcode` ]); `\n\t];\n}\n/**\n* A component that generates the `help` function declaration for a command.\n*/\nfunction BaseHelpDisplay(props) {\n\tconst { command, indent = 1, filterGlobalOptions = false } = props;\n\tconst theme = useTheme();\n\tconst context = usePowerlines();\n\tconst options = computed(() => filterGlobalOptions ? Object.values(command.options).filter((option) => !context.options.some((globalOption) => globalOption.name === option.name || option.alias.includes(globalOption.name) || globalOption.alias?.includes(option.name) || globalOption.alias?.some((alias) => option.alias.includes(alias)))) : Object.values(command.options));\n\treturn [\n\t\tmemo(() => code`writeLine(colors.bold(colors.text.heading.secondary(\"Usage:\"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"});`),\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcreateComponent(HelpUsageDisplay, {\n\t\t\tcommand,\n\t\t\tindent\n\t\t}),\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn options.value.length > 0;\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tmemo(() => code`writeLine(\"\");\n writeLine(colors.bold(colors.text.heading.secondary(\"Options:\"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"});`),\n\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\tcreateComponent(HelpOptionsDisplay, { get options() {\n\t\t\t\t\t\treturn options.value;\n\t\t\t\t\t} }),\n\t\t\t\t\tcreateComponent(Spacing, {})\n\t\t\t\t];\n\t\t\t}\n\t\t}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn Object.keys(command.children).length > 0;\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tmemo(() => code`writeLine(\"\");\n writeLine(colors.bold(colors.text.heading.secondary(\"Commands:\"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"});`),\n\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\tcreateComponent(HelpCommandsDisplay, { get commands() {\n\t\t\t\t\t\treturn command.children;\n\t\t\t\t\t} }),\n\t\t\t\t\tcreateComponent(Spacing, {})\n\t\t\t\t];\n\t\t\t}\n\t\t}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn isSetString(command.reference);\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tmemo(() => code`writeLine(\"\");\n writeLine(colors.text.heading.tertiary(\\`More information about this command can be found in the reference documentation at ${command.reference}\\`)${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : \"\"});`),\n\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\tcreateComponent(Spacing, {})\n\t\t\t\t];\n\t\t\t}\n\t\t})\n\t];\n}\n/**\n* A component that generates the invocation of the `help` function for a command.\n*/\nfunction VirtualCommandHelpDisplay(props) {\n\tconst { options, segments, commands } = props;\n\tconst context = usePowerlines();\n\treturn [\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcode`writeLine(colors.bold(colors.text.heading.secondary(\"Global Options:\")));`,\n\t\tcreateIntrinsic(\"hbr\", {}),\n\t\tcreateComponent(HelpOptionsDisplay, { options }),\n\t\tcode`writeLine(\"\"); `,\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn Object.keys(commands).length > 0;\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tmemo(() => code`writeLine(colors.text.body.secondary(\"The following commands are available through the ${getAppTitle(context, true)} command-line interface:\"));\n writeLine(\"\"); `),\n\t\t\t\t\tcreateComponent(Spacing, {}),\n\t\t\t\t\tcreateComponent(For, {\n\t\t\t\t\t\tget each() {\n\t\t\t\t\t\t\treturn Object.values(commands);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdoubleHardline: true,\n\t\t\t\t\t\tjoiner: code`writeLine(\"\"); `,\n\t\t\t\t\t\tender: code`writeLine(\"\"); `,\n\t\t\t\t\t\tchildren: (child) => [\n\t\t\t\t\t\t\tmemo(() => code`\n writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? \" ${child.icon} \" : \"\") + ` : \"\"}\"${child.title} ${child.isVirtual ? \"\" : \"Command\"}\"));\n writeLine(\"\");\n writeLine(colors.text.body.secondary(splitText(\\`${formatDescription(child.description).replace(/\\.+$/, \"\").trim()}.\\`)));\n writeLine(\"\");\n `),\n\t\t\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\t\t\tcreateComponent(BaseHelpDisplay, {\n\t\t\t\t\t\t\t\tcommand: child,\n\t\t\t\t\t\t\t\tindent: 2,\n\t\t\t\t\t\t\t\tfilterGlobalOptions: true\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcreateIntrinsic(\"hbr\", {})\n\t\t\t\t\t\t]\n\t\t\t\t\t}),\n\t\t\t\t\tmemo(() => code`help(\"Running a specific command with the help flag (via: '${getAppBin(context)}${segments && segments.length > 0 ? ` ${segments.join(\" \")}` : \"\"} <specific command> --help') will provide additional information that is specific to that command.\");\n writeLine(\"\");`)\n\t\t\t\t];\n\t\t\t}\n\t\t})\n\t];\n}\n/**\n* A component that generates the invocation of the `help` function for a command.\n*/\nfunction CommandHelpDisplay(props) {\n\tconst { command } = props;\n\tconst context = usePowerlines();\n\treturn [\n\t\tcode`writeLine(\"\"); `,\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(BaseHelpDisplay, {\n\t\t\tcommand,\n\t\t\tfilterGlobalOptions: false\n\t\t}),\n\t\tcode`writeLine(\"\"); `,\n\t\tcreateComponent(Spacing, {}),\n\t\tcreateComponent(Show, {\n\t\t\tget when() {\n\t\t\t\treturn Object.keys(command.children).length > 0;\n\t\t\t},\n\t\t\tget children() {\n\t\t\t\treturn [\n\t\t\t\t\tcode`writeLine(colors.text.body.secondary(\"The following sub-commands are available:\"));\n writeLine(\"\"); `,\n\t\t\t\t\tcreateComponent(Spacing, {}),\n\t\t\t\t\tcreateComponent(For, {\n\t\t\t\t\t\tget each() {\n\t\t\t\t\t\t\treturn Object.values(command.children);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdoubleHardline: true,\n\t\t\t\t\t\tjoiner: code`writeLine(\"\"); `,\n\t\t\t\t\t\tender: code`writeLine(\"\"); `,\n\t\t\t\t\t\tchildren: (child) => [\n\t\t\t\t\t\t\tmemo(() => code`\n writeLine(colors.text.heading.primary(${child.icon ? `(isUnicodeSupported ? \" ${child.icon} \" : \"\") + ` : \"\"}\"${child.title} ${child.isVirtual ? \"\" : \"Command\"}\"));\n writeLine(\"\");\n writeLine(colors.text.body.secondary(splitText(\\`${formatDescription(child.description).replace(/\\.+$/, \"\").trim()}.\\`)));\n writeLine(\"\");\n `),\n\t\t\t\t\t\t\tcreateIntrinsic(\"hbr\", {}),\n\t\t\t\t\t\t\tcreateComponent(BaseHelpDisplay, {\n\t\t\t\t\t\t\t\tcommand: child,\n\t\t\t\t\t\t\t\tindent: 2,\n\t\t\t\t\t\t\t\tfilterGlobalOptions: true\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcreateIntrinsic(\"hbr\", {})\n\t\t\t\t\t\t]\n\t\t\t\t\t}),\n\t\t\t\t\tmemo(() => code`help(\"Running a specific command with the help flag (via: '${getAppBin(context)} ${command.segments.join(\" \")} <specific command> --help') will provide additional information that is specific to that command.\");\n writeLine(\"\");`)\n\t\t\t\t];\n\t\t\t}\n\t\t})\n\t];\n}\n\n//#endregion\nexport { BaseHelpDisplay, CommandHelpDisplay, HelpCommandsDisplay, HelpOptionsDisplay, HelpUsageDisplay, VirtualCommandHelpDisplay };\n//# sourceMappingURL=display.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,iBAAiB,OAAO;CAChC,MAAM,EAAE,SAAS,SAAS,MAAM;CAChC,MAAM,UAAU,eAAe;CAC/B,MAAM,QAAQ,UAAU;AACxB,QAAO,CAAC,gBAAgB,KAAK;EAC5B,IAAI,OAAO;AACV,UAAO,OAAO,KAAK,QAAQ,OAAO,IAAI;;EAEvC,UAAU;EACV,WAAW,QAAQ,CAAC,WAAW,IAAI;;oEAE+B,IAA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BAC3G;KACnB;;GAEF,CAAC;EACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
2
|
-
const require_is_set_string = require('./node_modules/.pnpm/@stryke_type-checks@0.5.
|
|
2
|
+
const require_is_set_string = require('./node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.cjs');
|
|
3
3
|
const require_help_builtin = require('./components/help-builtin.cjs');
|
|
4
4
|
const require_help_command = require('./components/help-command.cjs');
|
|
5
5
|
require('./components/index.cjs');
|
|
@@ -7,9 +7,9 @@ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
|
7
7
|
let _alloy_js_core = require("@alloy-js/core");
|
|
8
8
|
let _powerlines_plugin_alloy_core_components = require("@powerlines/plugin-alloy/core/components");
|
|
9
9
|
let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
|
|
10
|
+
let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
10
11
|
let _shell_shock_plugin_console = require("@shell-shock/plugin-console");
|
|
11
12
|
_shell_shock_plugin_console = require_runtime.__toESM(_shell_shock_plugin_console);
|
|
12
|
-
let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
13
13
|
let defu = require("defu");
|
|
14
14
|
defu = require_runtime.__toESM(defu);
|
|
15
15
|
let _shell_shock_plugin_theme = require("@shell-shock/plugin-theme");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isSetString } from "./node_modules/.pnpm/@stryke_type-checks@0.5.
|
|
1
|
+
import { isSetString } from "./node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.mjs";
|
|
2
2
|
import { HelpBuiltin } from "./components/help-builtin.mjs";
|
|
3
3
|
import { HelpCommand } from "./components/help-command.mjs";
|
|
4
4
|
import "./components/index.mjs";
|
|
@@ -6,8 +6,8 @@ import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
|
6
6
|
import { For, Show, computed } from "@alloy-js/core";
|
|
7
7
|
import { Spacing } from "@powerlines/plugin-alloy/core/components";
|
|
8
8
|
import { render } from "@powerlines/plugin-alloy/render";
|
|
9
|
-
import console from "@shell-shock/plugin-console";
|
|
10
9
|
import { getAppDescription, getAppName, getAppTitle, getCommandList } from "@shell-shock/core/plugin-utils";
|
|
10
|
+
import console from "@shell-shock/plugin-console";
|
|
11
11
|
import defu from "defu";
|
|
12
12
|
import theme from "@shell-shock/plugin-theme";
|
|
13
13
|
import { joinPaths } from "@stryke/path/join";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../plugin-help/dist/index.mjs"],"sourcesContent":["import { isSetString } from \"./node_modules/.pnpm/@stryke_type-checks@0.5.
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../plugin-help/dist/index.mjs"],"sourcesContent":["import { isSetString } from \"./node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.mjs\";\nimport { HelpBuiltin } from \"./components/help-builtin.mjs\";\nimport { HelpCommand } from \"./components/help-command.mjs\";\nimport \"./components/index.mjs\";\nimport { createComponent } from \"@alloy-js/core/jsx-runtime\";\nimport { For, Show, computed } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport { getAppDescription, getAppName, getAppTitle, getCommandList } from \"@shell-shock/core/plugin-utils\";\nimport console from \"@shell-shock/plugin-console\";\nimport theme from \"@shell-shock/plugin-theme\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport defu from \"defu\";\n\n//#region src/index.tsx\n/**\n* The Help - Shell Shock plugin to add a help command to the application.\n*/\nconst plugin = (options = {}) => {\n\treturn [\n\t\t...theme(options.theme),\n\t\tconsole(options.console),\n\t\t{\n\t\t\tname: \"shell-shock:help\",\n\t\t\tenforce: \"post\",\n\t\t\tconfig() {\n\t\t\t\tthis.debug(\"Providing default configuration for the Shell Shock `help` plugin.\");\n\t\t\t\treturn { help: defu({ command: options.command === false ? false : isSetString(options.command) ? options.command : \"help\" }, options, { builtins: true }) };\n\t\t\t},\n\t\t\tasync configResolved() {\n\t\t\t\tthis.debug(\"Adding the Help command to the application context.\");\n\t\t\t\tif (this.config.help.command !== false) {\n\t\t\t\t\tthis.inputs ??= [];\n\t\t\t\t\tif (this.inputs.some((input) => input.name === this.config.help.command)) this.info(\"The `help` command already exists in the commands list. If you would like the help command to be managed by the `@shell-shock/plugin-help` package, please remove or rename the command.\");\n\t\t\t\t\telse this.inputs.push({\n\t\t\t\t\t\tid: this.config.help.command,\n\t\t\t\t\t\tname: this.config.help.command,\n\t\t\t\t\t\tpath: this.config.help.command,\n\t\t\t\t\t\tsegments: [this.config.help.command],\n\t\t\t\t\t\ttitle: \"Help\",\n\t\t\t\t\t\tdescription: `A command for displaying help information to assist in using the ${getAppTitle(this, true)} command-line interface application.`,\n\t\t\t\t\t\tentry: {\n\t\t\t\t\t\t\tfile: joinPaths(this.entryPath, \"help\", \"index.ts\"),\n\t\t\t\t\t\t\tinput: { file: joinPaths(this.entryPath, \"help\", \"command.ts\") }\n\t\t\t\t\t\t},\n\t\t\t\t\t\tisVirtual: false\n\t\t\t\t\t});\n\t\t\t\t\tawait render(this, createComponent(HelpCommand, {}));\n\t\t\t\t}\n\t\t\t},\n\t\t\tprepare: {\n\t\t\t\torder: \"post\",\n\t\t\t\tasync handler() {\n\t\t\t\t\tconst _self$ = this;\n\t\t\t\t\tconst commands = await getCommandList(this);\n\t\t\t\t\tthis.debug(`Rendering \\`help\\` built-ins for each of the ${commands.length} command modules.`);\n\t\t\t\t\tconst bin = computed(() => ({\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tname: getAppName(this),\n\t\t\t\t\t\ttitle: getAppTitle(this),\n\t\t\t\t\t\tdescription: getAppDescription(this),\n\t\t\t\t\t\tisVirtual: true,\n\t\t\t\t\t\tpath: null,\n\t\t\t\t\t\tsegments: [],\n\t\t\t\t\t\talias: [],\n\t\t\t\t\t\toptions: Object.fromEntries(this.options.map((option) => [option.name, option])),\n\t\t\t\t\t\tentry: { file: joinPaths(this.entryPath, \"bin.ts\") },\n\t\t\t\t\t\targs: [],\n\t\t\t\t\t\tparent: null,\n\t\t\t\t\t\tchildren: this.commands\n\t\t\t\t\t}));\n\t\t\t\t\treturn render(this, [createComponent(Show, {\n\t\t\t\t\t\tget when() {\n\t\t\t\t\t\t\treturn _self$.config.help.builtins !== false;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tget children() {\n\t\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\t\tcreateComponent(HelpBuiltin, { get command() {\n\t\t\t\t\t\t\t\t\treturn bin.value;\n\t\t\t\t\t\t\t\t} }),\n\t\t\t\t\t\t\t\tcreateComponent(Spacing, {}),\n\t\t\t\t\t\t\t\tcreateComponent(For, {\n\t\t\t\t\t\t\t\t\tget each() {\n\t\t\t\t\t\t\t\t\t\treturn commands.sort((a, b) => a.name.localeCompare(b.name));\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tdoubleHardline: true,\n\t\t\t\t\t\t\t\t\tchildren: (command) => createComponent(HelpBuiltin, { command })\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t})]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t];\n};\n\n//#endregion\nexport { plugin as default, plugin };\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAM,UAAU,UAAU,EAAE,KAAK;AAChC,QAAO;EACN,GAAG,MAAM,QAAQ,MAAM;EACvB,QAAQ,QAAQ,QAAQ;EACxB;GACC,MAAM;GACN,SAAS;GACT,SAAS;AACR,SAAK,MAAM,qEAAqE;AAChF,WAAO,EAAE,MAAM,KAAK,EAAE,SAAS,QAA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UAAU,KAAK;MACf,EAAE;AACH,YAAO,OAAO,MAAM,CAAC,gBAAgB,MAAM;MAC1C,IAAI,OAAO;AACV,cAAO,OAAO,OAAO,KAAK,aAAa;;MAExC,IAAI,WAAW;AACd,cAAO;QACN,gBAAgB,aAAa,EAAE,IAAI,UAAU;AAC5C,gBAAO,IAAI;WACT,CAAC;QACJ,gBAAgB,SAAS,EAAE,CAAC;QAC5B,gBAAgB,KAAK;SACpB,IAAI,OAAO;AACV,iBAAO,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,cAAc,EAAE,KAAK,CAAC;;SAE7D,gBAAgB;SAChB,WAAW,YAAY,gBAAgB,aAAa,EAAE,SAAS,CAAC;SAChE,CAAC;QACF;;MAEF,CAAC,CAAC,CAAC;;IAEL;GACD;EACD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.
|
|
2
|
+
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.mjs
|
|
3
3
|
/**
|
|
4
4
|
* Check if the input string is in constant case.
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.
|
|
1
|
+
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.mjs
|
|
2
2
|
/**
|
|
3
3
|
* Check if the input string is in constant case.
|
|
4
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constant-case.mjs","names":[],"sources":["../../../../../../../../../../../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.
|
|
1
|
+
{"version":3,"file":"constant-case.mjs","names":[],"sources":["../../../../../../../../../../../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.mjs"],"sourcesContent":["//#region ../../node_modules/.pnpm/@stryke+string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.mjs\n/**\n* Check if the input string is in constant case.\n*\n* @remarks\n* Constant case is defined as all uppercase letters with underscores separating words - \"THIS_IS_AN_EXAMPLE\".\n*\n* @param input - The input string to check.\n* @returns True if the input is in constant case, false otherwise.\n*/\nfunction isConstantCase(input) {\n\treturn input ? /^[A-Z0-9_]+$/.test(input) : false;\n}\n\n//#endregion\nexport { isConstantCase };\n//# sourceMappingURL=constant-case.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAUA,SAAS,eAAe,OAAO;AAC9B,QAAO,QAAQ,eAAe,KAAK,MAAM,GAAG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.
|
|
2
|
+
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.mjs
|
|
3
3
|
/**
|
|
4
4
|
* Regular expression pattern to split strings into words for various case conversions
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.
|
|
1
|
+
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.mjs
|
|
2
2
|
/**
|
|
3
3
|
* Regular expression pattern to split strings into words for various case conversions
|
|
4
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-words.mjs","names":[],"sources":["../../../../../../../../../../../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.
|
|
1
|
+
{"version":3,"file":"get-words.mjs","names":[],"sources":["../../../../../../../../../../../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.mjs"],"sourcesContent":["//#region ../../node_modules/.pnpm/@stryke+string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.mjs\n/**\n* Regular expression pattern to split strings into words for various case conversions\n*\n* This pattern matches sequences of characters in a string, considering the following case:\n* - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)\n* - Sequences of one uppercase letter optionally followed by lowercase letters and digits\n* - Single uppercase letters\n* - Sequences of digits\n*\n* The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into\n* a consistent format like snake case.\n*\n* @example\n* const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);\n* // matches: ['camel', 'Case', 'HTTP', 'Request']\n*/\nconst CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|\\d+|[A-Z]+(?![a-z])/g;\nconst RELAXED_SPLIT_PATTERN = /[A-Z/.-]?[a-z/.-]+|\\d+|[A-Z/.-]+(?![a-z/.-])/g;\n/**\n* Splits a string into words using a regular expression pattern\n*\n* @example\n* const words = getWords('camelCaseHTTPRequest');\n* // words: ['camel', 'Case', 'HTTP', 'Request']\n*\n* @param str - The string to split into words\n* @param options - Options for splitting the string\n* @returns An array of words\n*/\nfunction getWords(str, options = {}) {\n\tif (str.length > 5e3) throw new Error(\"The regular expression parameter of `get-words` can't handle strings longer than 2000 characters\");\n\treturn [...str.match(options.split ?? (options.relaxed ? RELAXED_SPLIT_PATTERN : CASE_SPLIT_PATTERN)) ?? []];\n}\n\n//#endregion\nexport { getWords };\n//# sourceMappingURL=get-words.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAM,qBAAqB;AAC3B,MAAM,wBAAwB;;;;;;;;;;;;AAY9B,SAAS,SAAS,KAAK,UAAU,EAAE,EAAE;AACpC,KAAI,IAAI,SAAS,IAAK,OAAM,IAAI,MAAM,mGAAmG;AACzI,QAAO,CAAC,GAAG,IAAI,MAAM,QAAQ,UAAU,QAAQ,UAAU,wBAAwB,oBAAoB,IAAI,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_get_words = require('./get-words.cjs');
|
|
2
2
|
|
|
3
|
-
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.
|
|
3
|
+
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Check if the input string is in kebab case.
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getWords } from "./get-words.mjs";
|
|
2
2
|
|
|
3
|
-
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.
|
|
3
|
+
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Check if the input string is in kebab case.
|
|
6
6
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kebab-case.mjs","names":[],"sources":["../../../../../../../../../../../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.
|
|
1
|
+
{"version":3,"file":"kebab-case.mjs","names":[],"sources":["../../../../../../../../../../../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs"],"sourcesContent":["import { getWords } from \"./get-words.mjs\";\n\n//#region ../../node_modules/.pnpm/@stryke+string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs\n/**\n* Check if the input string is in kebab case.\n*\n* @remarks\n* Kebab case is defined as all lowercase letters with hyphens separating words - \"this-is-an-example\".\n*\n* @param input - The input string to check.\n* @returns True if the input is in kebab case, false otherwise.\n*/\nfunction isKebabCase(input) {\n\treturn input ? /^[a-z]+(?:-[a-z0-9]+)*$/.test(input) : false;\n}\n/**\n* Convert the input string to kebab case.\n*\n* @remarks\n* Kebab case is defined as all lowercase letters with hyphens separating words - \"this-is-an-example\".\n*\n* @param input - The input string.\n* @returns The kebab-cased string.\n*/\nfunction kebabCase(input) {\n\tif (isKebabCase(input) || input === void 0) return input;\n\tconst parts = input ? getWords(input) : [];\n\tif (parts.length === 0) return \"\";\n\treturn parts.join(\"-\").toLowerCase();\n}\n\n//#endregion\nexport { kebabCase };\n//# sourceMappingURL=kebab-case.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;AAYA,SAAS,YAAY,OAAO;AAC3B,QAAO,QAAQ,0BAA0B,KAAK,MAAM,GAAG;;;;;;;;;;;AAWxD,SAAS,UAAU,OAAO;AACzB,KAAI,YAAY,MAAM,IAAI,UAAU,KAAK,EAAG,QAAO;CACnD,MAAM,QAAQ,QAAQ,SAAS,MAAM,GAAG,EAAE;AAC1C,KAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,QAAO,MAAM,KAAK,IAAI,CAAC,aAAa"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_upper_case_first = require('./upper-case-first.cjs');
|
|
2
2
|
const require_constant_case = require('./constant-case.cjs');
|
|
3
3
|
|
|
4
|
-
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.
|
|
4
|
+
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs
|
|
5
5
|
/**
|
|
6
6
|
* Check if the input string is in snake case.
|
|
7
7
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { upperCaseFirst } from "./upper-case-first.mjs";
|
|
2
2
|
import { isConstantCase } from "./constant-case.mjs";
|
|
3
3
|
|
|
4
|
-
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.
|
|
4
|
+
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs
|
|
5
5
|
/**
|
|
6
6
|
* Check if the input string is in snake case.
|
|
7
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snake-case.mjs","names":[],"sources":["../../../../../../../../../../../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.
|
|
1
|
+
{"version":3,"file":"snake-case.mjs","names":[],"sources":["../../../../../../../../../../../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs"],"sourcesContent":["import { upperCaseFirst } from \"./upper-case-first.mjs\";\nimport { isConstantCase } from \"./constant-case.mjs\";\n\n//#region ../../node_modules/.pnpm/@stryke+string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs\n/**\n* Check if the input string is in snake case.\n*\n* @remarks\n* Snake case is defined as all lowercase letters with underscores separating words - \"this_is_an_example\"\n*\n* @param input - The input string to check.\n* @returns True if the input is in snake case, false otherwise.\n*/\nfunction isSnakeCase(input) {\n\treturn input ? /^[a-z]+(?:_[a-z0-9]+)*$/.test(input) : false;\n}\n/**\n* Convert the input string to snake case.\n*\n* @remarks\n* Snake case is defined as all lowercase letters with underscores separating words - \"this_is_an_example\"\n*\n* @param input - The input string.\n* @param options - Options to control the behavior of the function.\n* @returns The snake-cased string.\n*/\nfunction snakeCase(input, options) {\n\tif (isSnakeCase(input) || input === void 0) return input;\n\tif (isConstantCase(input)) return input.toLowerCase();\n\tconst parts = input?.replace(/[A-Z]+/g, (input$1) => upperCaseFirst(input$1) ?? \"\").split(/(?=[A-Z])|[\\s._-]/).map((x) => x.toLowerCase()) ?? [];\n\tif (parts.length === 0) return \"\";\n\tif (parts.length === 1) return parts[0];\n\tconst result = parts.reduce((ret, part) => {\n\t\treturn `${ret}_${part.toLowerCase()}`;\n\t});\n\treturn options?.splitOnNumber === false ? result : result.replace(/[A-Z]\\d/i, (val) => `${val[0]}_${val[1]}`);\n}\n\n//#endregion\nexport { snakeCase };\n//# sourceMappingURL=snake-case.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;AAaA,SAAS,YAAY,OAAO;AAC3B,QAAO,QAAQ,0BAA0B,KAAK,MAAM,GAAG;;;;;;;;;;;;AAYxD,SAAS,UAAU,OAAO,SAAS;AAClC,KAAI,YAAY,MAAM,IAAI,UAAU,KAAK,EAAG,QAAO;AACnD,KAAI,eAAe,MAAM,CAAE,QAAO,MAAM,aAAa;CACrD,MAAM,QAAQ,OAAO,QAAQ,YAAY,YAAY,eAAe,QAAQ,IAAI,GAAG,CAAC,MAAM,oBAAoB,CAAC,KAAK,MAAM,EAAE,aAAa,CAAC,IAAI,EAAE;AAChJ,KAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,KAAI,MAAM,WAAW,EAAG,QAAO,MAAM;CACrC,MAAM,SAAS,MAAM,QAAQ,KAAK,SAAS;AAC1C,SAAO,GAAG,IAAI,GAAG,KAAK,aAAa;GAClC;AACF,QAAO,SAAS,kBAAkB,QAAQ,SAAS,OAAO,QAAQ,aAAa,QAAQ,GAAG,IAAI,GAAG,GAAG,IAAI,KAAK"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.
|
|
2
|
+
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.mjs
|
|
3
3
|
/**
|
|
4
4
|
* Upper case the first character of an input string.
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.
|
|
1
|
+
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.mjs
|
|
2
2
|
/**
|
|
3
3
|
* Upper case the first character of an input string.
|
|
4
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upper-case-first.mjs","names":[],"sources":["../../../../../../../../../../../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.
|
|
1
|
+
{"version":3,"file":"upper-case-first.mjs","names":[],"sources":["../../../../../../../../../../../plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.mjs"],"sourcesContent":["//#region ../../node_modules/.pnpm/@stryke+string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.mjs\n/**\n* Upper case the first character of an input string.\n*\n* @remarks\n* \"Thisisanexample\"\n*\n* @param input - The input string.\n* @returns The capitalized string.\n*/\nfunction upperCaseFirst(input) {\n\treturn input ? input.charAt(0).toUpperCase() + input.slice(1) : input;\n}\n\n//#endregion\nexport { upperCaseFirst };\n//# sourceMappingURL=upper-case-first.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAUA,SAAS,eAAe,OAAO;AAC9B,QAAO,QAAQ,MAAM,OAAO,EAAE,CAAC,aAAa,GAAG,MAAM,MAAM,EAAE,GAAG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_is_null = require('./is-null.cjs');
|
|
2
2
|
const require_is_undefined = require('./is-undefined.cjs');
|
|
3
3
|
|
|
4
|
-
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.
|
|
4
|
+
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.mjs
|
|
5
5
|
/**
|
|
6
6
|
* Check if the provided value's type is `null` or `undefined`
|
|
7
7
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isNull } from "./is-null.mjs";
|
|
2
2
|
import { isUndefined } from "./is-undefined.mjs";
|
|
3
3
|
|
|
4
|
-
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.
|
|
4
|
+
//#region ../plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.mjs
|
|
5
5
|
/**
|
|
6
6
|
* Check if the provided value's type is `null` or `undefined`
|
|
7
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-empty.mjs","names":[],"sources":["../../../../../../../../../../../plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.
|
|
1
|
+
{"version":3,"file":"is-empty.mjs","names":[],"sources":["../../../../../../../../../../../plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.mjs"],"sourcesContent":["import { isNull } from \"./is-null.mjs\";\nimport { isUndefined } from \"./is-undefined.mjs\";\n\n//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.mjs\n/**\n* Check if the provided value's type is `null` or `undefined`\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is of type `null` or `undefined`\n*/\nconst isEmpty = (value) => {\n\ttry {\n\t\treturn isUndefined(value) || isNull(value);\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isEmpty };\n//# sourceMappingURL=is-empty.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAUA,MAAM,WAAW,UAAU;AAC1B,KAAI;AACH,SAAO,YAAY,MAAM,IAAI,OAAO,MAAM;SACnC;AACP,SAAO"}
|