@shell-shock/preset-cli 0.8.4 → 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.
Files changed (54) hide show
  1. package/README.md +1 -1
  2. package/dist/components/{banner-function-declaration.cjs → banner-builtin.cjs} +47 -36
  3. package/dist/components/banner-builtin.d.cts +23 -0
  4. package/dist/components/banner-builtin.d.cts.map +1 -0
  5. package/dist/components/banner-builtin.d.mts +23 -0
  6. package/dist/components/banner-builtin.d.mts.map +1 -0
  7. package/dist/components/banner-builtin.mjs +88 -0
  8. package/dist/components/banner-builtin.mjs.map +1 -0
  9. package/dist/components/command-entry.cjs +182 -186
  10. package/dist/components/command-entry.d.cts +1 -1
  11. package/dist/components/command-entry.d.cts.map +1 -1
  12. package/dist/components/command-entry.d.mts.map +1 -1
  13. package/dist/components/command-entry.mjs +182 -186
  14. package/dist/components/command-entry.mjs.map +1 -1
  15. package/dist/components/command-router.cjs +1 -1
  16. package/dist/components/command-router.mjs +1 -1
  17. package/dist/components/command-router.mjs.map +1 -1
  18. package/dist/components/index.cjs +3 -2
  19. package/dist/components/index.d.cts +2 -2
  20. package/dist/components/index.d.mts +2 -2
  21. package/dist/components/index.mjs +2 -2
  22. package/dist/components/virtual-command-entry.cjs +18 -22
  23. package/dist/components/virtual-command-entry.d.cts +1 -1
  24. package/dist/components/virtual-command-entry.d.cts.map +1 -1
  25. package/dist/components/virtual-command-entry.d.mts.map +1 -1
  26. package/dist/components/virtual-command-entry.mjs +18 -22
  27. package/dist/components/virtual-command-entry.mjs.map +1 -1
  28. package/dist/index.cjs +37 -7
  29. package/dist/index.d.cts.map +1 -1
  30. package/dist/index.d.mts.map +1 -1
  31. package/dist/index.mjs +38 -8
  32. package/dist/index.mjs.map +1 -1
  33. package/dist/plugin-banner/dist/components/banner-builtin.cjs +63 -0
  34. package/dist/plugin-banner/dist/components/banner-builtin.mjs +62 -0
  35. package/dist/plugin-banner/dist/components/banner-builtin.mjs.map +1 -0
  36. package/dist/plugin-banner/dist/components/banner-function-declaration.cjs +135 -0
  37. package/dist/plugin-banner/dist/components/banner-function-declaration.d.cts +45 -0
  38. package/dist/plugin-banner/dist/components/banner-function-declaration.d.cts.map +1 -0
  39. package/dist/plugin-banner/dist/components/banner-function-declaration.d.mts +45 -0
  40. package/dist/plugin-banner/dist/components/banner-function-declaration.d.mts.map +1 -0
  41. package/dist/plugin-banner/dist/components/banner-function-declaration.mjs +133 -0
  42. package/dist/plugin-banner/dist/components/banner-function-declaration.mjs.map +1 -0
  43. package/dist/plugin-help/dist/components/display.cjs +14 -0
  44. package/dist/plugin-help/dist/components/display.mjs +14 -0
  45. package/dist/plugin-help/dist/components/display.mjs.map +1 -1
  46. package/dist/plugin-help/dist/index.cjs +1 -1
  47. package/dist/plugin-help/dist/index.mjs +1 -1
  48. package/package.json +19 -19
  49. package/dist/components/banner-function-declaration.d.cts +0 -11
  50. package/dist/components/banner-function-declaration.d.cts.map +0 -1
  51. package/dist/components/banner-function-declaration.d.mts +0 -11
  52. package/dist/components/banner-function-declaration.d.mts.map +0 -1
  53. package/dist/components/banner-function-declaration.mjs +0 -78
  54. 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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,IAAI,cAAc;AACjB,YAAO,YAAY;;IAEpB,IAAI,SAAS;AACZ,YAAO,OAAO;;IAEf;IACA;IACA;IACA,4BAA4B;IAC5B;IACA;IACA,CAAC;;EAEH,CAAC"}
@@ -1,4 +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.41/node_modules/@stryke/type-checks/dist/is-set-string.cjs');
2
3
  const require_kebab_case = require('../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.cjs');
3
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");
@@ -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,3 +1,4 @@
1
+ import { isSetString } from "../node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.mjs";
1
2
  import { kebabCase } from "../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs";
2
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";
@@ -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.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];\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,KAAK,SAAS,IAAI,IAAI,QAAQ,KAAK,KAAK,QAAQ,+BAA+B,WAAW,IAAI,SAAS,sBAAsB,UAAU,IAAI,SAAS,sBAAsB,WAAW,IAAI,WAAW,IAAI,QAAQ,SAAS,IAAI,IAAI,QAAQ,KAAK,IAAI,GAAG,IAAI,SAAS,sBAAsB,UAAU,IAAI,SAAS,IAAI,SAAS,IAAI,KAAK,IAAI,IAAI,S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AK,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,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,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B,OAAO;CAClC,MAAM,EAAE,YAAY;CACpB,MAAM,UAAU,eAAe;AAC/B,QAAO;EACN,IAAI;EACJ,gBAAgB,SAAS,EAAE,CAAC;EAC5B,gBAAgB,iBAAiB;GAChC;GACA,qBAAqB;GACrB,CAAC;EACF,IAAI;EACJ,gBAAgB,SAAS,EAAE,CAAC;EAC5B,gBAAgB,MAAM;GACrB,IAAI,OAAO;AACV,WAAO,OAAO,KAAK,QAAQ,SAAS,CAAC,SAAS;;GAE/C,IAAI,WAAW;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"}
@@ -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");
@@ -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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/preset-cli",
3
- "version": "0.8.4",
3
+ "version": "0.8.5",
4
4
  "private": false,
5
5
  "description": "A package containing a Shell Shock plugin to generate source code given a list design tokens.",
6
6
  "keywords": [
@@ -73,18 +73,18 @@
73
73
  "default": "./dist/components/index.mjs"
74
74
  }
75
75
  },
76
- "./components/banner-function-declaration": {
76
+ "./components/banner-builtin": {
77
77
  "require": {
78
- "types": "./dist/components/banner-function-declaration.d.cts",
79
- "default": "./dist/components/banner-function-declaration.cjs"
78
+ "types": "./dist/components/banner-builtin.d.cts",
79
+ "default": "./dist/components/banner-builtin.cjs"
80
80
  },
81
81
  "import": {
82
- "types": "./dist/components/banner-function-declaration.d.mts",
83
- "default": "./dist/components/banner-function-declaration.mjs"
82
+ "types": "./dist/components/banner-builtin.d.mts",
83
+ "default": "./dist/components/banner-builtin.mjs"
84
84
  },
85
85
  "default": {
86
- "types": "./dist/components/banner-function-declaration.d.mts",
87
- "default": "./dist/components/banner-function-declaration.mjs"
86
+ "types": "./dist/components/banner-builtin.d.mts",
87
+ "default": "./dist/components/banner-builtin.mjs"
88
88
  }
89
89
  },
90
90
  "./components/command-entry": {
@@ -181,20 +181,20 @@
181
181
  "dependencies": {
182
182
  "@alloy-js/core": "0.23.0-dev.8",
183
183
  "@alloy-js/typescript": "0.23.0-dev.4",
184
- "@powerlines/deepkit": "^0.6.134",
185
- "@powerlines/plugin-alloy": "^0.25.41",
186
- "@powerlines/plugin-plugin": "^0.12.306",
187
- "@shell-shock/core": "^0.13.1",
188
- "@shell-shock/plugin-console": "^0.1.12",
189
- "@shell-shock/plugin-prompts": "^0.3.13",
190
- "@shell-shock/plugin-theme": "^0.3.16",
191
- "@shell-shock/plugin-upgrade": "^0.1.18",
192
- "@shell-shock/preset-script": "^0.6.27",
184
+ "@powerlines/deepkit": "^0.6.146",
185
+ "@powerlines/plugin-alloy": "^0.25.53",
186
+ "@powerlines/plugin-plugin": "^0.12.318",
187
+ "@shell-shock/core": "^0.13.2",
188
+ "@shell-shock/plugin-console": "^0.1.13",
189
+ "@shell-shock/plugin-prompts": "^0.3.14",
190
+ "@shell-shock/plugin-theme": "^0.3.17",
191
+ "@shell-shock/plugin-upgrade": "^0.1.19",
192
+ "@shell-shock/preset-script": "^0.6.28",
193
193
  "@stryke/path": "^0.27.2",
194
194
  "@stryke/string-format": "^0.17.6",
195
195
  "cfonts": "^3.3.1",
196
196
  "defu": "^6.1.4",
197
- "powerlines": "^0.41.20"
197
+ "powerlines": "^0.42.8"
198
198
  },
199
199
  "devDependencies": {
200
200
  "@babel/core": "^7.29.0",
@@ -224,5 +224,5 @@
224
224
  "./package.json": "./package.json"
225
225
  }
226
226
  },
227
- "gitHead": "86c55189ed02d126fb583cf6d2555266f00d0f3a"
227
+ "gitHead": "64e1ac187a12cd18acfd8134768bb793bbda3947"
228
228
  }
@@ -1,11 +0,0 @@
1
- import * as _alloy_js_core0 from "@alloy-js/core";
2
- import { BannerFunctionDeclarationProps } from "@shell-shock/preset-script/components/banner-function-declaration";
3
-
4
- //#region src/components/banner-function-declaration.d.ts
5
- /**
6
- * A component to generate the `banner` function in the `shell-shock:console` builtin module.
7
- */
8
- declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps): _alloy_js_core0.Children;
9
- //#endregion
10
- export { BannerFunctionDeclaration };
11
- //# sourceMappingURL=banner-function-declaration.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"banner-function-declaration.d.cts","names":[],"sources":["../../src/components/banner-function-declaration.tsx"],"mappings":";;;;;;;iBA+BgB,yBAAA,CACd,KAAA,EAAO,8BAAA,GAA8B,eAAA,CAAA,QAAA"}
@@ -1,11 +0,0 @@
1
- import * as _alloy_js_core0 from "@alloy-js/core";
2
- import { BannerFunctionDeclarationProps } from "@shell-shock/preset-script/components/banner-function-declaration";
3
-
4
- //#region src/components/banner-function-declaration.d.ts
5
- /**
6
- * A component to generate the `banner` function in the `shell-shock:console` builtin module.
7
- */
8
- declare function BannerFunctionDeclaration(props: BannerFunctionDeclarationProps): _alloy_js_core0.Children;
9
- //#endregion
10
- export { BannerFunctionDeclaration };
11
- //# sourceMappingURL=banner-function-declaration.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"banner-function-declaration.d.mts","names":[],"sources":["../../src/components/banner-function-declaration.tsx"],"mappings":";;;;;;;iBA+BgB,yBAAA,CACd,KAAA,EAAO,8BAAA,GAA8B,eAAA,CAAA,QAAA"}
@@ -1,78 +0,0 @@
1
- import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
2
- import { 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 { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
6
- import { useTheme } from "@shell-shock/plugin-theme/contexts/theme";
7
- import { BannerFunctionBodyDeclaration } from "@shell-shock/preset-script/components/banner-function-declaration";
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", command } = props;
16
- const theme = useTheme();
17
- const context = usePowerlines();
18
- const header = computed(() => `${theme.labels.banner.header[variant] || getAppTitle(context)} v${context.packageJson.version || "1.0.0"}`);
19
- const footer = computed(() => theme.labels.banner.footer[variant]);
20
- const title = computed(() => getAppTitle(context, true).replace(`v${context.packageJson.version || "1.0.0"}`, ""));
21
- const description = computed(() => command?.description || getAppDescription(context));
22
- const titleLines = computed(() => {
23
- const result = render(getAppTitle(context, true), {
24
- font: "tiny",
25
- align: "left",
26
- background: "transparent",
27
- letterSpacing: 1,
28
- lineHeight: 1,
29
- gradient: false,
30
- transitionGradient: false,
31
- env: "node"
32
- });
33
- if (!result) return [`${getAppTitle(context, true)} Command-Line Interface`];
34
- return result.array;
35
- });
36
- const bannerPadding = computed(() => Math.max(theme.padding.app, 0) * 2 + theme.borderStyles.banner.outline[variant].left.length + theme.borderStyles.banner.outline[variant].right.length);
37
- const totalPadding = computed(() => Math.max(theme.padding.banner, 0) * 2 + bannerPadding.value);
38
- return [createComponent(FunctionDeclaration, {
39
- async: true,
40
- name: "banner",
41
- get doc() {
42
- return `Write the ${getAppTitle(context, true)} application banner ${command ? `for the ${command.title} command ` : ""}to the console.`;
43
- },
44
- parameters: [{
45
- name: "pause",
46
- type: "number",
47
- default: 500
48
- }],
49
- get children() {
50
- return [createComponent(BannerFunctionBodyDeclaration, {
51
- get header() {
52
- return header.value;
53
- },
54
- get description() {
55
- return description.value;
56
- },
57
- get footer() {
58
- return footer.value;
59
- },
60
- variant,
61
- consoleFnName,
62
- command,
63
- insertNewlineAfterDescription: true,
64
- get children() {
65
- return code`const titleLines = [${titleLines.value.map((line) => JSON.stringify(line.trim())).join(", ")}];
66
- const title = Math.max(...titleLines.map(line => stripAnsi(line).length)) > Math.max(process.stdout.columns - ${totalPadding.value}, 0) ? "${title.value}" : \`\\n\${titleLines.join("\\n")}\\n\`; `;
67
- }
68
- }), createComponent(IfStatement, {
69
- condition: code`isInteractive && !isHelp`,
70
- children: code`await sleep(pause);`
71
- })];
72
- }
73
- })];
74
- }
75
-
76
- //#endregion
77
- export { BannerFunctionDeclaration };
78
- //# sourceMappingURL=banner-function-declaration.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"banner-function-declaration.mjs","names":[],"sources":["../../src/components/banner-function-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed } from \"@alloy-js/core\";\nimport { FunctionDeclaration, IfStatement } from \"@alloy-js/typescript\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { getAppDescription, getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { useTheme } from \"@shell-shock/plugin-theme/contexts/theme\";\nimport type { BannerFunctionDeclarationProps } from \"@shell-shock/preset-script/components/banner-function-declaration\";\nimport { BannerFunctionBodyDeclaration } from \"@shell-shock/preset-script/components/banner-function-declaration\";\nimport { render } from \"cfonts\";\nimport type { CLIPresetContext } from \"../types/plugin\";\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 { consoleFnName = \"log\", variant = \"primary\", command } = props;\n\n const theme = useTheme();\n const context = usePowerlines<CLIPresetContext>();\n\n const header = computed(\n () =>\n `${theme.labels.banner.header[variant] || getAppTitle(context)} v${\n context.packageJson.version || \"1.0.0\"\n }`\n );\n const footer = computed(() => theme.labels.banner.footer[variant]);\n const title = computed(() =>\n getAppTitle(context, true).replace(\n `v${context.packageJson.version || \"1.0.0\"}`,\n \"\"\n )\n );\n const description = computed(\n () => command?.description || getAppDescription(context)\n );\n\n const titleLines = computed(() => {\n const result = render(getAppTitle(context, true), {\n font: \"tiny\",\n align: \"left\",\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, true)} Command-Line Interface`];\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 async\n name=\"banner\"\n doc={`Write the ${getAppTitle(context, true)} application banner ${\n command ? `for the ${command.title} command ` : \"\"\n }to the console.`}\n parameters={[{ name: \"pause\", type: \"number\", default: 500 }]}>\n <BannerFunctionBodyDeclaration\n header={header.value}\n description={description.value}\n footer={footer.value}\n variant={variant}\n consoleFnName={consoleFnName}\n command={command}\n insertNewlineAfterDescription>\n {code`const titleLines = [${titleLines.value\n .map(line => JSON.stringify(line.trim()))\n .join(\", \")}];\n const title = Math.max(...titleLines.map(line => stripAnsi(line).length)) > Math.max(process.stdout.columns - ${\n totalPadding.value\n }, 0) ? \"${title.value}\" : \\`\\\\n\\${titleLines.join(\"\\\\n\")}\\\\n\\`; `}\n </BannerFunctionBodyDeclaration>\n <IfStatement condition={code`isInteractive && !isHelp`}>\n {code`await sleep(pause);`}\n </IfStatement>\n </FunctionDeclaration>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAgCA,SAAS,0BAAA,OAAA;CACP,MAAA,EACA,gBAAQ,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