@shell-shock/preset-script 0.6.23 → 0.6.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -1
- package/dist/_virtual/_rolldown/runtime.mjs +3 -0
- package/dist/components/banner-function-declaration.cjs +28 -27
- package/dist/components/banner-function-declaration.cjs.map +1 -1
- package/dist/components/banner-function-declaration.d.cts.map +1 -1
- package/dist/components/banner-function-declaration.d.mts.map +1 -1
- package/dist/components/banner-function-declaration.mjs +2 -2
- package/dist/components/banner-function-declaration.mjs.map +1 -1
- package/dist/components/bin-entry.cjs +54 -45
- package/dist/components/bin-entry.cjs.map +1 -1
- package/dist/components/bin-entry.d.cts +0 -1
- package/dist/components/bin-entry.d.cts.map +1 -1
- package/dist/components/bin-entry.d.mts +0 -1
- package/dist/components/bin-entry.d.mts.map +1 -1
- package/dist/components/bin-entry.mjs +17 -9
- package/dist/components/bin-entry.mjs.map +1 -1
- package/dist/components/command-entry.cjs +76 -235
- package/dist/components/command-entry.cjs.map +1 -1
- package/dist/components/command-entry.d.cts +1 -8
- package/dist/components/command-entry.d.cts.map +1 -1
- package/dist/components/command-entry.d.mts +2 -9
- package/dist/components/command-entry.d.mts.map +1 -1
- package/dist/components/command-entry.mjs +24 -183
- package/dist/components/command-entry.mjs.map +1 -1
- package/dist/components/command-router.cjs +85 -83
- package/dist/components/command-router.cjs.map +1 -1
- package/dist/components/command-router.d.cts.map +1 -1
- package/dist/components/command-router.d.mts.map +1 -1
- package/dist/components/command-router.mjs +59 -58
- package/dist/components/command-router.mjs.map +1 -1
- package/dist/components/exit-function-declaration.cjs +38 -37
- package/dist/components/exit-function-declaration.cjs.map +1 -1
- package/dist/components/exit-function-declaration.d.cts +2 -2
- package/dist/components/exit-function-declaration.d.cts.map +1 -1
- package/dist/components/exit-function-declaration.d.mts +2 -2
- package/dist/components/exit-function-declaration.d.mts.map +1 -1
- package/dist/components/exit-function-declaration.mjs +3 -3
- package/dist/components/exit-function-declaration.mjs.map +1 -1
- package/dist/components/index.cjs +2 -9
- package/dist/components/index.d.cts +2 -3
- package/dist/components/index.d.mts +2 -3
- package/dist/components/index.mjs +2 -3
- package/dist/components/virtual-command-entry.cjs +43 -59
- package/dist/components/virtual-command-entry.cjs.map +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 +13 -30
- package/dist/components/virtual-command-entry.mjs.map +1 -1
- package/dist/helpers/get-default-options.cjs +8 -7
- package/dist/helpers/get-default-options.cjs.map +1 -1
- package/dist/helpers/get-default-options.d.cts +0 -1
- package/dist/helpers/get-default-options.d.cts.map +1 -1
- package/dist/helpers/get-default-options.d.mts +0 -1
- package/dist/helpers/get-default-options.d.mts.map +1 -1
- package/dist/helpers/get-default-options.mjs.map +1 -1
- package/dist/index.cjs +30 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +8 -20
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-help/dist/components/display.cjs +260 -0
- package/dist/plugin-help/dist/components/display.cjs.map +1 -0
- package/dist/{components/help.mjs → plugin-help/dist/components/display.mjs} +26 -30
- package/dist/plugin-help/dist/components/display.mjs.map +1 -0
- package/dist/plugin-help/dist/components/help-builtin.cjs +86 -0
- package/dist/plugin-help/dist/components/help-builtin.cjs.map +1 -0
- package/dist/plugin-help/dist/components/help-builtin.mjs +84 -0
- package/dist/plugin-help/dist/components/help-builtin.mjs.map +1 -0
- package/dist/plugin-help/dist/components/help-command.cjs +97 -0
- package/dist/plugin-help/dist/components/help-command.cjs.map +1 -0
- package/dist/plugin-help/dist/components/help-command.mjs +96 -0
- package/dist/plugin-help/dist/components/help-command.mjs.map +1 -0
- package/dist/plugin-help/dist/components/index.cjs +3 -0
- package/dist/plugin-help/dist/components/index.mjs +5 -0
- package/dist/plugin-help/dist/index.cjs +104 -0
- package/dist/plugin-help/dist/index.cjs.map +1 -0
- package/dist/plugin-help/dist/index.d.cts +2 -0
- package/dist/plugin-help/dist/index.d.mts +2 -0
- package/dist/plugin-help/dist/index.mjs +100 -0
- package/dist/plugin-help/dist/index.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.cjs +18 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.mjs +17 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/constant-case.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.cjs +39 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.mjs +38 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/get-words.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.cjs +34 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs +34 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.cjs +41 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs +41 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.cjs +18 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.mjs +17 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/upper-case-first.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.cjs +21 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.mjs +21 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-empty.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-null.cjs +13 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-null.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-null.mjs +12 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-null.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.cjs +21 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.mjs +21 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set-string.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set.cjs +20 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set.mjs +20 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-set.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-string.cjs +13 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-string.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-string.mjs +12 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-string.mjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-undefined.cjs +9 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-undefined.cjs.map +1 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-undefined.mjs +8 -0
- package/dist/plugin-help/dist/node_modules/.pnpm/@stryke_type-checks@0.5.41/node_modules/@stryke/type-checks/dist/is-undefined.mjs.map +1 -0
- package/dist/plugin-help/dist/types/plugin.d.cts +62 -0
- package/dist/plugin-help/dist/types/plugin.d.cts.map +1 -0
- package/dist/plugin-help/dist/types/plugin.d.mts +62 -0
- package/dist/plugin-help/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.d.cts +9 -9
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +9 -9
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +15 -29
- package/dist/components/help.cjs +0 -264
- package/dist/components/help.cjs.map +0 -1
- package/dist/components/help.d.cts +0 -105
- package/dist/components/help.d.cts.map +0 -1
- package/dist/components/help.d.mts +0 -105
- package/dist/components/help.d.mts.map +0 -1
- package/dist/components/help.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display.cjs","names":["For","snakeCase","CommandParameterKinds","Show","kebabCase","Spacing"],"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,6EAAyB;CAC/B,MAAM,gEAAkB;AACxB,QAAO,iDAAiBA,oBAAK;EAC5B,IAAI,OAAO;AACV,UAAO,OAAO,KAAK,QAAQ,OAAO,IAAI;;EAEvC,UAAU;EACV,WAAW,QAAQ,4CAAY,mBAAI;;oEAE+B,IAAI,KAAK,QAAQ,SAAS,SAAS,IAAI,IAAI,QAAQ,SAAS,KAAK,YAAY,iFAA6C,QAAQ,GAAG,YAAY,UAAU,6DAAyB,QAAQ,GAAG,IAAIC,2FAAo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DACT,mBAAI;wDACkC,MAAM,OAAO,2BAA2B,MAAM,KAAK,gBAAgB,GAAG,GAAG,MAAM,MAAM,GAAG,MAAM,YAAY,KAAK,UAAU;;yHAE5F,MAAM,YAAY,CAAC,QAAQ,QAAQ,GAAG,CAAC,MAAM,CAAC;;kBAEjH;uDACK,OAAO,EAAE,CAAC;uDACV,iBAAiB;QAChC,SAAS;QACT,QAAQ;QACR,qBAAqB;QACrB,CAAC;uDACc,OAAO,EAAE,CAAC;OAC1B;MACD,CAAC;gDACS,mBAAI,4GAAwE,QAAQ,CAAC,GAAG,QAAQ,SAAS,KAAK,IAAI,CAAC;wBAC3G;KACnB;;GAEF,CAAC;EACF"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
+
import { kebabCase } from "../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/kebab-case.mjs";
|
|
2
|
+
import { snakeCase } from "../node_modules/.pnpm/@stryke_string-format@0.17.6/node_modules/@stryke/string-format/dist/snake-case.mjs";
|
|
1
3
|
import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
|
|
2
4
|
import { For, Show, code, computed } from "@alloy-js/core";
|
|
5
|
+
import { formatDescription, formatShortDescription, getAppBin, getAppTitle, getDynamicPathSegmentName, isDynamicPathSegment, sortOptions } from "@shell-shock/core/plugin-utils";
|
|
3
6
|
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
4
7
|
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
5
|
-
import { formatDescription, formatShortDescription, getAppBin, getDynamicPathSegmentName, isDynamicPathSegment, sortOptions } from "@shell-shock/core/plugin-utils";
|
|
6
|
-
import { useTheme } from "@shell-shock/plugin-theme/contexts/theme";
|
|
7
8
|
import { CommandParameterKinds } from "@shell-shock/core";
|
|
8
|
-
import {
|
|
9
|
-
import { snakeCase } from "@stryke/string-format/snake-case";
|
|
9
|
+
import { useTheme } from "@shell-shock/plugin-theme/contexts/theme";
|
|
10
10
|
|
|
11
|
-
//#region
|
|
11
|
+
//#region ../plugin-help/dist/components/display.mjs
|
|
12
12
|
/**
|
|
13
13
|
* A component that generates the usage display for a command.
|
|
14
14
|
*/
|
|
15
|
-
function
|
|
15
|
+
function HelpUsageDisplay(props) {
|
|
16
16
|
const { command, indent = 2 } = props;
|
|
17
17
|
const context = usePowerlines();
|
|
18
18
|
const theme = useTheme();
|
|
@@ -46,7 +46,7 @@ function HelpUsage(props) {
|
|
|
46
46
|
/**
|
|
47
47
|
* A component that generates the options table display for a command.
|
|
48
48
|
*/
|
|
49
|
-
function
|
|
49
|
+
function HelpOptionsDisplay(props) {
|
|
50
50
|
const { options } = props;
|
|
51
51
|
const context = usePowerlines();
|
|
52
52
|
return [
|
|
@@ -76,7 +76,7 @@ function HelpOptions(props) {
|
|
|
76
76
|
/**
|
|
77
77
|
* A component that generates the commands table display for a command.
|
|
78
78
|
*/
|
|
79
|
-
function
|
|
79
|
+
function HelpCommandsDisplay(props) {
|
|
80
80
|
const { commands } = props;
|
|
81
81
|
return [
|
|
82
82
|
code`table([ `,
|
|
@@ -95,7 +95,7 @@ function HelpCommands(props) {
|
|
|
95
95
|
/**
|
|
96
96
|
* A component that generates the `help` function declaration for a command.
|
|
97
97
|
*/
|
|
98
|
-
function
|
|
98
|
+
function BaseHelpDisplay(props) {
|
|
99
99
|
const { command, indent = 1, filterGlobalOptions = false } = props;
|
|
100
100
|
const theme = useTheme();
|
|
101
101
|
const context = usePowerlines();
|
|
@@ -103,7 +103,7 @@ function BaseHelp(props) {
|
|
|
103
103
|
return [
|
|
104
104
|
memo(() => code`writeLine(colors.bold(colors.text.heading.secondary("Usage:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
|
|
105
105
|
createIntrinsic("hbr", {}),
|
|
106
|
-
createComponent(
|
|
106
|
+
createComponent(HelpUsageDisplay, {
|
|
107
107
|
command,
|
|
108
108
|
indent
|
|
109
109
|
}),
|
|
@@ -117,11 +117,10 @@ function BaseHelp(props) {
|
|
|
117
117
|
memo(() => code`writeLine("");
|
|
118
118
|
writeLine(colors.bold(colors.text.heading.secondary("Options:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
|
|
119
119
|
createIntrinsic("hbr", {}),
|
|
120
|
-
createComponent(
|
|
120
|
+
createComponent(HelpOptionsDisplay, { get options() {
|
|
121
121
|
return options.value;
|
|
122
122
|
} }),
|
|
123
|
-
|
|
124
|
-
createIntrinsic("hbr", {})
|
|
123
|
+
createComponent(Spacing, {})
|
|
125
124
|
];
|
|
126
125
|
}
|
|
127
126
|
}),
|
|
@@ -134,11 +133,10 @@ function BaseHelp(props) {
|
|
|
134
133
|
memo(() => code`writeLine("");
|
|
135
134
|
writeLine(colors.bold(colors.text.heading.secondary("Commands:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
|
|
136
135
|
createIntrinsic("hbr", {}),
|
|
137
|
-
createComponent(
|
|
136
|
+
createComponent(HelpCommandsDisplay, { get commands() {
|
|
138
137
|
return command.children;
|
|
139
138
|
} }),
|
|
140
|
-
|
|
141
|
-
createIntrinsic("hbr", {})
|
|
139
|
+
createComponent(Spacing, {})
|
|
142
140
|
];
|
|
143
141
|
}
|
|
144
142
|
})
|
|
@@ -147,14 +145,14 @@ function BaseHelp(props) {
|
|
|
147
145
|
/**
|
|
148
146
|
* A component that generates the invocation of the `help` function for a command.
|
|
149
147
|
*/
|
|
150
|
-
function
|
|
148
|
+
function VirtualCommandHelpDisplay(props) {
|
|
151
149
|
const { options, segments, commands } = props;
|
|
152
150
|
const context = usePowerlines();
|
|
153
151
|
return [
|
|
154
152
|
createIntrinsic("hbr", {}),
|
|
155
153
|
code`writeLine(colors.bold(colors.text.heading.secondary("Global Options:")));`,
|
|
156
154
|
createIntrinsic("hbr", {}),
|
|
157
|
-
createComponent(
|
|
155
|
+
createComponent(HelpOptionsDisplay, { options }),
|
|
158
156
|
code`writeLine(""); `,
|
|
159
157
|
createComponent(Spacing, {}),
|
|
160
158
|
createComponent(Show, {
|
|
@@ -163,10 +161,9 @@ function VirtualHelp(props) {
|
|
|
163
161
|
},
|
|
164
162
|
get children() {
|
|
165
163
|
return [
|
|
166
|
-
code`writeLine(colors.text.body.secondary("The following commands are available:"));
|
|
167
|
-
writeLine("");
|
|
168
|
-
|
|
169
|
-
createIntrinsic("hbr", {}),
|
|
164
|
+
memo(() => code`writeLine(colors.text.body.secondary("The following commands are available through the ${getAppTitle(context, true)} command-line interface:"));
|
|
165
|
+
writeLine(""); `),
|
|
166
|
+
createComponent(Spacing, {}),
|
|
170
167
|
createComponent(For, {
|
|
171
168
|
get each() {
|
|
172
169
|
return Object.values(commands);
|
|
@@ -182,7 +179,7 @@ function VirtualHelp(props) {
|
|
|
182
179
|
writeLine("");
|
|
183
180
|
`),
|
|
184
181
|
createIntrinsic("hbr", {}),
|
|
185
|
-
createComponent(
|
|
182
|
+
createComponent(BaseHelpDisplay, {
|
|
186
183
|
command: child,
|
|
187
184
|
indent: 2,
|
|
188
185
|
filterGlobalOptions: true
|
|
@@ -200,13 +197,13 @@ function VirtualHelp(props) {
|
|
|
200
197
|
/**
|
|
201
198
|
* A component that generates the invocation of the `help` function for a command.
|
|
202
199
|
*/
|
|
203
|
-
function
|
|
200
|
+
function CommandHelpDisplay(props) {
|
|
204
201
|
const { command } = props;
|
|
205
202
|
const context = usePowerlines();
|
|
206
203
|
return [
|
|
207
204
|
code`writeLine(""); `,
|
|
208
205
|
createComponent(Spacing, {}),
|
|
209
|
-
createComponent(
|
|
206
|
+
createComponent(BaseHelpDisplay, {
|
|
210
207
|
command,
|
|
211
208
|
filterGlobalOptions: false
|
|
212
209
|
}),
|
|
@@ -220,8 +217,7 @@ function CommandHelp(props) {
|
|
|
220
217
|
return [
|
|
221
218
|
code`writeLine(colors.text.body.secondary("The following sub-commands are available:"));
|
|
222
219
|
writeLine(""); `,
|
|
223
|
-
|
|
224
|
-
createIntrinsic("hbr", {}),
|
|
220
|
+
createComponent(Spacing, {}),
|
|
225
221
|
createComponent(For, {
|
|
226
222
|
get each() {
|
|
227
223
|
return Object.values(command.children);
|
|
@@ -237,7 +233,7 @@ function CommandHelp(props) {
|
|
|
237
233
|
writeLine("");
|
|
238
234
|
`),
|
|
239
235
|
createIntrinsic("hbr", {}),
|
|
240
|
-
createComponent(
|
|
236
|
+
createComponent(BaseHelpDisplay, {
|
|
241
237
|
command: child,
|
|
242
238
|
indent: 2,
|
|
243
239
|
filterGlobalOptions: true
|
|
@@ -254,5 +250,5 @@ function CommandHelp(props) {
|
|
|
254
250
|
}
|
|
255
251
|
|
|
256
252
|
//#endregion
|
|
257
|
-
export {
|
|
258
|
-
//# sourceMappingURL=
|
|
253
|
+
export { BaseHelpDisplay, CommandHelpDisplay, HelpCommandsDisplay, HelpOptionsDisplay, HelpUsageDisplay, VirtualCommandHelpDisplay };
|
|
254
|
+
//# sourceMappingURL=display.mjs.map
|
|
@@ -0,0 +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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kC,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"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_display = require('./display.cjs');
|
|
3
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
5
|
+
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
6
|
+
let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
7
|
+
let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
8
|
+
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
9
|
+
let defu = require("defu");
|
|
10
|
+
defu = require_runtime.__toESM(defu);
|
|
11
|
+
let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
|
|
12
|
+
let _powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
|
|
13
|
+
let _stryke_path = require("@stryke/path");
|
|
14
|
+
|
|
15
|
+
//#region ../plugin-help/dist/components/help-builtin.mjs
|
|
16
|
+
/**
|
|
17
|
+
* A built-in help module for Shell Shock.
|
|
18
|
+
*/
|
|
19
|
+
function HelpBuiltin(props) {
|
|
20
|
+
const [{ command, children }, rest] = (0, _alloy_js_core.splitProps)(props, ["command", "children"]);
|
|
21
|
+
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
22
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({
|
|
23
|
+
get id() {
|
|
24
|
+
return (0, _stryke_path.joinPaths)("help", ...command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)));
|
|
25
|
+
},
|
|
26
|
+
get description() {
|
|
27
|
+
return (0, _alloy_js_core_jsx_runtime.memo)(() => !!command.path)() ? `A collection of utility functions that assist in displaying help information for the ${command.title} command.` : `A collection of utility functions that assist in displaying help information for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} command-line interface application.`;
|
|
28
|
+
}
|
|
29
|
+
}, rest, {
|
|
30
|
+
get builtinImports() {
|
|
31
|
+
return (0, defu.default)(rest.builtinImports ?? {}, {
|
|
32
|
+
utils: ["isUnicodeSupported"],
|
|
33
|
+
console: [
|
|
34
|
+
"splitText",
|
|
35
|
+
"writeLine",
|
|
36
|
+
"colors",
|
|
37
|
+
"help",
|
|
38
|
+
"table"
|
|
39
|
+
]
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
get children() {
|
|
43
|
+
return [
|
|
44
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
45
|
+
"export": true,
|
|
46
|
+
name: "showHelp",
|
|
47
|
+
get doc() {
|
|
48
|
+
return `Display help information for the ${command.path ? `${command.title} command` : `${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} application`}.`;
|
|
49
|
+
},
|
|
50
|
+
parameters: [],
|
|
51
|
+
get children() {
|
|
52
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
53
|
+
get when() {
|
|
54
|
+
return !command.isVirtual;
|
|
55
|
+
},
|
|
56
|
+
get fallback() {
|
|
57
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_display.VirtualCommandHelpDisplay, {
|
|
58
|
+
get options() {
|
|
59
|
+
return Object.values(command.options);
|
|
60
|
+
},
|
|
61
|
+
get commands() {
|
|
62
|
+
return command.children ?? {};
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
get children() {
|
|
67
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_display.CommandHelpDisplay, { command });
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}),
|
|
72
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
73
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
74
|
+
get when() {
|
|
75
|
+
return Boolean(children);
|
|
76
|
+
},
|
|
77
|
+
children
|
|
78
|
+
})
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
//#endregion
|
|
85
|
+
exports.HelpBuiltin = HelpBuiltin;
|
|
86
|
+
//# sourceMappingURL=help-builtin.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help-builtin.cjs","names":["BuiltinFile","FunctionDeclaration","Show","VirtualCommandHelpDisplay","CommandHelpDisplay","Spacing"],"sources":["../../../../../plugin-help/dist/components/help-builtin.mjs"],"sourcesContent":["import { CommandHelpDisplay, VirtualCommandHelpDisplay } from \"./display.mjs\";\nimport { createComponent, memo, mergeProps } from \"@alloy-js/core/jsx-runtime\";\nimport { Show, code, splitProps } from \"@alloy-js/core\";\nimport { getAppTitle, isDynamicPathSegment } from \"@shell-shock/core/plugin-utils\";\nimport defu from \"defu\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { FunctionDeclaration, IfStatement } from \"@alloy-js/typescript\";\nimport { TSDoc, TSDocRemarks, TSDocReturns } from \"@powerlines/plugin-alloy/typescript\";\nimport { BuiltinFile } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport { joinPaths } from \"@stryke/path\";\n\n//#region src/components/help-builtin.tsx\n/**\n* The `updateVersionCheckFile` handler function declaration code for the Shell Shock project.\n*/\nfunction HelpFunctionDeclaration() {\n\treturn [createComponent(TSDoc, {\n\t\theading: \"A helper function that updates the version check file.\",\n\t\tget children() {\n\t\t\treturn [\n\t\t\t\tcreateComponent(TSDocRemarks, { children: `This function is used to update the version check file with the current timestamp. It can be used in the CLI upgrade command to record the last time a check for updates was performed. The function writes a \"version-check.json\" file in the data directory, which contains a timestamp of the last check for updates.` }),\n\t\t\t\tcreateComponent(Spacing, {}),\n\t\t\t\tcreateComponent(TSDocReturns, { children: `A promise that resolves to a boolean indicating whether a check for updates is required.` })\n\t\t\t];\n\t\t}\n\t}), createComponent(FunctionDeclaration, {\n\t\t\"export\": true,\n\t\tasync: true,\n\t\tname: \"updateVersionCheckFile\",\n\t\treturnType: \"void\",\n\t\tget children() {\n\t\t\treturn [createComponent(IfStatement, {\n\t\t\t\tcondition: code`!existsSync(paths.data)`,\n\t\t\t\tchildren: code`await mkdir(paths.data, { recursive: true }); `\n\t\t\t}), code`await writeFile(join(paths.data, \"version-check.json\"), JSON.stringify({ timestamp: new Date().getTime() }), \"utf8\"); `];\n\t\t}\n\t})];\n}\n/**\n* A built-in help module for Shell Shock.\n*/\nfunction HelpBuiltin(props) {\n\tconst [{ command, children }, rest] = splitProps(props, [\"command\", \"children\"]);\n\tconst context = usePowerlines();\n\treturn createComponent(BuiltinFile, mergeProps({\n\t\tget id() {\n\t\t\treturn joinPaths(\"help\", ...command.segments.filter((segment) => !isDynamicPathSegment(segment)));\n\t\t},\n\t\tget description() {\n\t\t\treturn memo(() => !!command.path)() ? `A collection of utility functions that assist in displaying help information for the ${command.title} command.` : `A collection of utility functions that assist in displaying help information for the ${getAppTitle(context, true)} command-line interface application.`;\n\t\t}\n\t}, rest, {\n\t\tget builtinImports() {\n\t\t\treturn defu(rest.builtinImports ?? {}, {\n\t\t\t\tutils: [\"isUnicodeSupported\"],\n\t\t\t\tconsole: [\n\t\t\t\t\t\"splitText\",\n\t\t\t\t\t\"writeLine\",\n\t\t\t\t\t\"colors\",\n\t\t\t\t\t\"help\",\n\t\t\t\t\t\"table\"\n\t\t\t\t]\n\t\t\t});\n\t\t},\n\t\tget children() {\n\t\t\treturn [\n\t\t\t\tcreateComponent(FunctionDeclaration, {\n\t\t\t\t\t\"export\": true,\n\t\t\t\t\tname: \"showHelp\",\n\t\t\t\t\tget doc() {\n\t\t\t\t\t\treturn `Display help information for the ${command.path ? `${command.title} command` : `${getAppTitle(context, true)} application`}.`;\n\t\t\t\t\t},\n\t\t\t\t\tparameters: [],\n\t\t\t\t\tget children() {\n\t\t\t\t\t\treturn createComponent(Show, {\n\t\t\t\t\t\t\tget when() {\n\t\t\t\t\t\t\t\treturn !command.isVirtual;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tget fallback() {\n\t\t\t\t\t\t\t\treturn createComponent(VirtualCommandHelpDisplay, {\n\t\t\t\t\t\t\t\t\tget options() {\n\t\t\t\t\t\t\t\t\t\treturn Object.values(command.options);\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tget commands() {\n\t\t\t\t\t\t\t\t\t\treturn command.children ?? {};\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tget children() {\n\t\t\t\t\t\t\t\treturn createComponent(CommandHelpDisplay, { command });\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\tcreateComponent(Spacing, {}),\n\t\t\t\tcreateComponent(Show, {\n\t\t\t\t\tget when() {\n\t\t\t\t\t\treturn Boolean(children);\n\t\t\t\t\t},\n\t\t\t\t\tchildren\n\t\t\t\t})\n\t\t\t];\n\t\t}\n\t}));\n}\n\n//#endregion\nexport { HelpBuiltin, HelpFunctionDeclaration };\n//# sourceMappingURL=help-builtin.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AA0CA,SAAS,YAAY,OAAO;CAC3B,MAAM,CAAC,EAAE,SAAS,YAAY,uCAAmB,OAAO,CAAC,WAAW,WAAW,CAAC;CAChF,MAAM,6EAAyB;AAC/B,wDAAuBA,oHAAwB;EAC9C,IAAI,KAAK;AACR,sCAAiB,QAAQ,GAAG,QAAQ,SAAS,QAAQ,YAAY,0DAAsB,QAAQ,CAAC,CAAC;;EAElG,IAAI,cAAc;AACjB,qDAAkB,CAAC,CAAC,QAAQ,KAAK,EAAE,GAAG,wFAAwF,QAAQ,MAAM,aAAa,wIAAoG,SAAS,KAAK,CAAC;;EAE7Q,EAAE,MAAM;EACR,IAAI,iBAAiB;AACpB,4BAAY,KAAK,kBAAkB,EAAE,EAAE;IACtC,OAAO,CAAC,qBAAqB;IAC7B,SAAS;KACR;KACA;KACA;KACA;KACA;KACA;IACD,CAAC;;EAEH,IAAI,WAAW;AACd,UAAO;oDACUC,0CAAqB;KACpC,UAAU;KACV,MAAM;KACN,IAAI,MAAM;AACT,aAAO,oCAAoC,QAAQ,OAAO,GAAG,QAAQ,MAAM,YAAY,mDAAe,SAAS,KAAK,CAAC,cAAc;;KAEpI,YAAY,EAAE;KACd,IAAI,WAAW;AACd,6DAAuBC,qBAAM;OAC5B,IAAI,OAAO;AACV,eAAO,CAAC,QAAQ;;OAEjB,IAAI,WAAW;AACd,+DAAuBC,2CAA2B;SACjD,IAAI,UAAU;AACb,iBAAO,OAAO,OAAO,QAAQ,QAAQ;;SAEtC,IAAI,WAAW;AACd,iBAAO,QAAQ,YAAY,EAAE;;SAE9B,CAAC;;OAEH,IAAI,WAAW;AACd,+DAAuBC,oCAAoB,EAAE,SAAS,CAAC;;OAExD,CAAC;;KAEH,CAAC;oDACcC,0DAAS,EAAE,CAAC;oDACZH,qBAAM;KACrB,IAAI,OAAO;AACV,aAAO,QAAQ,SAAS;;KAEzB;KACA,CAAC;IACF;;EAEF,CAAC,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { CommandHelpDisplay, VirtualCommandHelpDisplay } from "./display.mjs";
|
|
2
|
+
import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
3
|
+
import { Show, code, splitProps } from "@alloy-js/core";
|
|
4
|
+
import { FunctionDeclaration, IfStatement } from "@alloy-js/typescript";
|
|
5
|
+
import { getAppTitle, isDynamicPathSegment } from "@shell-shock/core/plugin-utils";
|
|
6
|
+
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
7
|
+
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
8
|
+
import defu from "defu";
|
|
9
|
+
import "@powerlines/plugin-alloy/typescript";
|
|
10
|
+
import { BuiltinFile } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
|
|
11
|
+
import { joinPaths } from "@stryke/path";
|
|
12
|
+
|
|
13
|
+
//#region ../plugin-help/dist/components/help-builtin.mjs
|
|
14
|
+
/**
|
|
15
|
+
* A built-in help module for Shell Shock.
|
|
16
|
+
*/
|
|
17
|
+
function HelpBuiltin(props) {
|
|
18
|
+
const [{ command, children }, rest] = splitProps(props, ["command", "children"]);
|
|
19
|
+
const context = usePowerlines();
|
|
20
|
+
return createComponent(BuiltinFile, mergeProps({
|
|
21
|
+
get id() {
|
|
22
|
+
return joinPaths("help", ...command.segments.filter((segment) => !isDynamicPathSegment(segment)));
|
|
23
|
+
},
|
|
24
|
+
get description() {
|
|
25
|
+
return memo(() => !!command.path)() ? `A collection of utility functions that assist in displaying help information for the ${command.title} command.` : `A collection of utility functions that assist in displaying help information for the ${getAppTitle(context, true)} command-line interface application.`;
|
|
26
|
+
}
|
|
27
|
+
}, rest, {
|
|
28
|
+
get builtinImports() {
|
|
29
|
+
return defu(rest.builtinImports ?? {}, {
|
|
30
|
+
utils: ["isUnicodeSupported"],
|
|
31
|
+
console: [
|
|
32
|
+
"splitText",
|
|
33
|
+
"writeLine",
|
|
34
|
+
"colors",
|
|
35
|
+
"help",
|
|
36
|
+
"table"
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
get children() {
|
|
41
|
+
return [
|
|
42
|
+
createComponent(FunctionDeclaration, {
|
|
43
|
+
"export": true,
|
|
44
|
+
name: "showHelp",
|
|
45
|
+
get doc() {
|
|
46
|
+
return `Display help information for the ${command.path ? `${command.title} command` : `${getAppTitle(context, true)} application`}.`;
|
|
47
|
+
},
|
|
48
|
+
parameters: [],
|
|
49
|
+
get children() {
|
|
50
|
+
return createComponent(Show, {
|
|
51
|
+
get when() {
|
|
52
|
+
return !command.isVirtual;
|
|
53
|
+
},
|
|
54
|
+
get fallback() {
|
|
55
|
+
return createComponent(VirtualCommandHelpDisplay, {
|
|
56
|
+
get options() {
|
|
57
|
+
return Object.values(command.options);
|
|
58
|
+
},
|
|
59
|
+
get commands() {
|
|
60
|
+
return command.children ?? {};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
get children() {
|
|
65
|
+
return createComponent(CommandHelpDisplay, { command });
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}),
|
|
70
|
+
createComponent(Spacing, {}),
|
|
71
|
+
createComponent(Show, {
|
|
72
|
+
get when() {
|
|
73
|
+
return Boolean(children);
|
|
74
|
+
},
|
|
75
|
+
children
|
|
76
|
+
})
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
export { HelpBuiltin };
|
|
84
|
+
//# sourceMappingURL=help-builtin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help-builtin.mjs","names":[],"sources":["../../../../../plugin-help/dist/components/help-builtin.mjs"],"sourcesContent":["import { CommandHelpDisplay, VirtualCommandHelpDisplay } from \"./display.mjs\";\nimport { createComponent, memo, mergeProps } from \"@alloy-js/core/jsx-runtime\";\nimport { Show, code, splitProps } from \"@alloy-js/core\";\nimport { getAppTitle, isDynamicPathSegment } from \"@shell-shock/core/plugin-utils\";\nimport defu from \"defu\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { FunctionDeclaration, IfStatement } from \"@alloy-js/typescript\";\nimport { TSDoc, TSDocRemarks, TSDocReturns } from \"@powerlines/plugin-alloy/typescript\";\nimport { BuiltinFile } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport { joinPaths } from \"@stryke/path\";\n\n//#region src/components/help-builtin.tsx\n/**\n* The `updateVersionCheckFile` handler function declaration code for the Shell Shock project.\n*/\nfunction HelpFunctionDeclaration() {\n\treturn [createComponent(TSDoc, {\n\t\theading: \"A helper function that updates the version check file.\",\n\t\tget children() {\n\t\t\treturn [\n\t\t\t\tcreateComponent(TSDocRemarks, { children: `This function is used to update the version check file with the current timestamp. It can be used in the CLI upgrade command to record the last time a check for updates was performed. The function writes a \"version-check.json\" file in the data directory, which contains a timestamp of the last check for updates.` }),\n\t\t\t\tcreateComponent(Spacing, {}),\n\t\t\t\tcreateComponent(TSDocReturns, { children: `A promise that resolves to a boolean indicating whether a check for updates is required.` })\n\t\t\t];\n\t\t}\n\t}), createComponent(FunctionDeclaration, {\n\t\t\"export\": true,\n\t\tasync: true,\n\t\tname: \"updateVersionCheckFile\",\n\t\treturnType: \"void\",\n\t\tget children() {\n\t\t\treturn [createComponent(IfStatement, {\n\t\t\t\tcondition: code`!existsSync(paths.data)`,\n\t\t\t\tchildren: code`await mkdir(paths.data, { recursive: true }); `\n\t\t\t}), code`await writeFile(join(paths.data, \"version-check.json\"), JSON.stringify({ timestamp: new Date().getTime() }), \"utf8\"); `];\n\t\t}\n\t})];\n}\n/**\n* A built-in help module for Shell Shock.\n*/\nfunction HelpBuiltin(props) {\n\tconst [{ command, children }, rest] = splitProps(props, [\"command\", \"children\"]);\n\tconst context = usePowerlines();\n\treturn createComponent(BuiltinFile, mergeProps({\n\t\tget id() {\n\t\t\treturn joinPaths(\"help\", ...command.segments.filter((segment) => !isDynamicPathSegment(segment)));\n\t\t},\n\t\tget description() {\n\t\t\treturn memo(() => !!command.path)() ? `A collection of utility functions that assist in displaying help information for the ${command.title} command.` : `A collection of utility functions that assist in displaying help information for the ${getAppTitle(context, true)} command-line interface application.`;\n\t\t}\n\t}, rest, {\n\t\tget builtinImports() {\n\t\t\treturn defu(rest.builtinImports ?? {}, {\n\t\t\t\tutils: [\"isUnicodeSupported\"],\n\t\t\t\tconsole: [\n\t\t\t\t\t\"splitText\",\n\t\t\t\t\t\"writeLine\",\n\t\t\t\t\t\"colors\",\n\t\t\t\t\t\"help\",\n\t\t\t\t\t\"table\"\n\t\t\t\t]\n\t\t\t});\n\t\t},\n\t\tget children() {\n\t\t\treturn [\n\t\t\t\tcreateComponent(FunctionDeclaration, {\n\t\t\t\t\t\"export\": true,\n\t\t\t\t\tname: \"showHelp\",\n\t\t\t\t\tget doc() {\n\t\t\t\t\t\treturn `Display help information for the ${command.path ? `${command.title} command` : `${getAppTitle(context, true)} application`}.`;\n\t\t\t\t\t},\n\t\t\t\t\tparameters: [],\n\t\t\t\t\tget children() {\n\t\t\t\t\t\treturn createComponent(Show, {\n\t\t\t\t\t\t\tget when() {\n\t\t\t\t\t\t\t\treturn !command.isVirtual;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tget fallback() {\n\t\t\t\t\t\t\t\treturn createComponent(VirtualCommandHelpDisplay, {\n\t\t\t\t\t\t\t\t\tget options() {\n\t\t\t\t\t\t\t\t\t\treturn Object.values(command.options);\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tget commands() {\n\t\t\t\t\t\t\t\t\t\treturn command.children ?? {};\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tget children() {\n\t\t\t\t\t\t\t\treturn createComponent(CommandHelpDisplay, { command });\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\tcreateComponent(Spacing, {}),\n\t\t\t\tcreateComponent(Show, {\n\t\t\t\t\tget when() {\n\t\t\t\t\t\treturn Boolean(children);\n\t\t\t\t\t},\n\t\t\t\t\tchildren\n\t\t\t\t})\n\t\t\t];\n\t\t}\n\t}));\n}\n\n//#endregion\nexport { HelpBuiltin, HelpFunctionDeclaration };\n//# sourceMappingURL=help-builtin.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AA0CA,SAAS,YAAY,OAAO;CAC3B,MAAM,CAAC,EAAE,SAAS,YAAY,QAAQ,WAAW,OAAO,CAAC,WAAW,WAAW,CAAC;CAChF,MAAM,UAAU,eAAe;AAC/B,QAAO,gBAAgB,aAAa,WAAW;EAC9C,IAAI,KAAK;AACR,UAAO,UAAU,QAAQ,GAAG,QAAQ,SAAS,QAAQ,YAAY,CAAC,qBAAqB,QAAQ,CAAC,CAAC;;EAElG,IAAI,cAAc;AACjB,UAAO,WAAW,CAAC,CAAC,QAAQ,KAAK,EAAE,GAAG,wFAAwF,QAAQ,MAAM,aAAa,wFAAwF,YAAY,SAAS,KAAK,CAAC;;EAE7Q,EAAE,MAAM;EACR,IAAI,iBAAiB;AACpB,UAAO,KAAK,KAAK,kBAAkB,EAAE,EAAE;IACtC,OAAO,CAAC,qBAAqB;IAC7B,SAAS;KACR;KACA;KACA;KACA;KACA;KACA;IACD,CAAC;;EAEH,IAAI,WAAW;AACd,UAAO;IACN,gBAAgB,qBAAqB;KACpC,UAAU;KACV,MAAM;KACN,IAAI,MAAM;AACT,aAAO,oCAAoC,QAAQ,OAAO,GAAG,QAAQ,MAAM,YAAY,GAAG,YAAY,SAAS,KAAK,CAAC,cAAc;;KAEpI,YAAY,EAAE;KACd,IAAI,WAAW;AACd,aAAO,gBAAgB,MAAM;OAC5B,IAAI,OAAO;AACV,eAAO,CAAC,QAAQ;;OAEjB,IAAI,WAAW;AACd,eAAO,gBAAgB,2BAA2B;SACjD,IAAI,UAAU;AACb,iBAAO,OAAO,OAAO,QAAQ,QAAQ;;SAEtC,IAAI,WAAW;AACd,iBAAO,QAAQ,YAAY,EAAE;;SAE9B,CAAC;;OAEH,IAAI,WAAW;AACd,eAAO,gBAAgB,oBAAoB,EAAE,SAAS,CAAC;;OAExD,CAAC;;KAEH,CAAC;IACF,gBAAgB,SAAS,EAAE,CAAC;IAC5B,gBAAgB,MAAM;KACrB,IAAI,OAAO;AACV,aAAO,QAAQ,SAAS;;KAEzB;KACA,CAAC;IACF;;EAEF,CAAC,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
3
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
4
|
+
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
5
|
+
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
6
|
+
let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
|
|
7
|
+
let _stryke_path = require("@stryke/path");
|
|
8
|
+
let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
9
|
+
let _powerlines_plugin_alloy_core = require("@powerlines/plugin-alloy/core");
|
|
10
|
+
let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
11
|
+
|
|
12
|
+
//#region ../plugin-help/dist/components/help-command.mjs
|
|
13
|
+
/**
|
|
14
|
+
* The Help command's handler wrapper for the Shell Shock project.
|
|
15
|
+
*/
|
|
16
|
+
function HelpCommand() {
|
|
17
|
+
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
18
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TypescriptFile, {
|
|
19
|
+
get path() {
|
|
20
|
+
return (0, _stryke_path.joinPaths)(context.entryPath, "help", "command.ts");
|
|
21
|
+
},
|
|
22
|
+
imports: {
|
|
23
|
+
"node:os": ["os"],
|
|
24
|
+
"node:fs/promises": ["readFile", "writeFile"]
|
|
25
|
+
},
|
|
26
|
+
builtinImports: { console: [
|
|
27
|
+
"colors",
|
|
28
|
+
"writeLine",
|
|
29
|
+
"success",
|
|
30
|
+
"warn",
|
|
31
|
+
"stripAnsi"
|
|
32
|
+
] },
|
|
33
|
+
get children() {
|
|
34
|
+
return [
|
|
35
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Options for the Help command." }),
|
|
36
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
|
|
37
|
+
"export": true,
|
|
38
|
+
name: "HelpOptions",
|
|
39
|
+
get children() {
|
|
40
|
+
return [
|
|
41
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
42
|
+
heading: "Whether to help to the latest version.",
|
|
43
|
+
get children() {
|
|
44
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `If set to \`true\`, the command will attempt to help to the latest version. This option takes precedence over the \`version\` option.` }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
45
|
+
get type() {
|
|
46
|
+
return _powerlines_deepkit_vendor_type.ReflectionKind.boolean;
|
|
47
|
+
},
|
|
48
|
+
defaultValue: false
|
|
49
|
+
})];
|
|
50
|
+
}
|
|
51
|
+
}),
|
|
52
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
|
|
53
|
+
name: "latest",
|
|
54
|
+
optional: true,
|
|
55
|
+
type: "boolean"
|
|
56
|
+
}),
|
|
57
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
|
|
58
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
59
|
+
heading: "A specific application version to help to.",
|
|
60
|
+
get children() {
|
|
61
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The command will attempt to help to the specified version. The version should be a valid semantic version string, or \`latest\` to help to the latest version.` }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
62
|
+
get type() {
|
|
63
|
+
return _powerlines_deepkit_vendor_type.ReflectionKind.string;
|
|
64
|
+
},
|
|
65
|
+
defaultValue: "latest"
|
|
66
|
+
})];
|
|
67
|
+
}
|
|
68
|
+
}),
|
|
69
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
|
|
70
|
+
name: "version",
|
|
71
|
+
optional: true,
|
|
72
|
+
type: "string"
|
|
73
|
+
})
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
}),
|
|
77
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
|
|
78
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Handler logic for the \\`help\\` command." }),
|
|
79
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
80
|
+
"export": true,
|
|
81
|
+
"default": true,
|
|
82
|
+
async: true,
|
|
83
|
+
name: "handler",
|
|
84
|
+
parameters: [{
|
|
85
|
+
name: "options",
|
|
86
|
+
type: "HelpOptions"
|
|
87
|
+
}],
|
|
88
|
+
children: _alloy_js_core.code` return;`
|
|
89
|
+
})
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
//#endregion
|
|
96
|
+
exports.HelpCommand = HelpCommand;
|
|
97
|
+
//# sourceMappingURL=help-command.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help-command.cjs","names":["TypescriptFile","TSDoc$1","InterfaceDeclaration","TSDocRemarks$1","TSDocDefaultValue","ReflectionKind","InterfaceMember","Spacing","FunctionDeclaration"],"sources":["../../../../../plugin-help/dist/components/help-command.mjs"],"sourcesContent":["import { createComponent } from \"@alloy-js/core/jsx-runtime\";\nimport { code } from \"@alloy-js/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { FunctionDeclaration, InterfaceDeclaration } from \"@alloy-js/typescript\";\nimport { InterfaceMember, TypescriptFile } from \"@powerlines/plugin-alloy/typescript\";\nimport { joinPaths } from \"@stryke/path\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core\";\nimport { TSDoc as TSDoc$1, TSDocDefaultValue, TSDocRemarks as TSDocRemarks$1 } from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\n\n//#region src/components/help-command.tsx\n/**\n* The Help command's handler wrapper for the Shell Shock project.\n*/\nfunction HelpCommand() {\n\tconst context = usePowerlines();\n\treturn createComponent(TypescriptFile, {\n\t\tget path() {\n\t\t\treturn joinPaths(context.entryPath, \"help\", \"command.ts\");\n\t\t},\n\t\timports: {\n\t\t\t\"node:os\": [\"os\"],\n\t\t\t\"node:fs/promises\": [\"readFile\", \"writeFile\"]\n\t\t},\n\t\tbuiltinImports: { console: [\n\t\t\t\"colors\",\n\t\t\t\"writeLine\",\n\t\t\t\"success\",\n\t\t\t\"warn\",\n\t\t\t\"stripAnsi\"\n\t\t] },\n\t\tget children() {\n\t\t\treturn [\n\t\t\t\tcreateComponent(TSDoc$1, { heading: \"Options for the Help command.\" }),\n\t\t\t\tcreateComponent(InterfaceDeclaration, {\n\t\t\t\t\t\"export\": true,\n\t\t\t\t\tname: \"HelpOptions\",\n\t\t\t\t\tget children() {\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tcreateComponent(TSDoc$1, {\n\t\t\t\t\t\t\t\theading: \"Whether to help to the latest version.\",\n\t\t\t\t\t\t\t\tget children() {\n\t\t\t\t\t\t\t\t\treturn [createComponent(TSDocRemarks$1, { children: `If set to \\`true\\`, the command will attempt to help to the latest version. This option takes precedence over the \\`version\\` option.` }), createComponent(TSDocDefaultValue, {\n\t\t\t\t\t\t\t\t\t\tget type() {\n\t\t\t\t\t\t\t\t\t\t\treturn ReflectionKind.boolean;\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tdefaultValue: false\n\t\t\t\t\t\t\t\t\t})];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcreateComponent(InterfaceMember, {\n\t\t\t\t\t\t\t\tname: \"latest\",\n\t\t\t\t\t\t\t\toptional: true,\n\t\t\t\t\t\t\t\ttype: \"boolean\"\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcreateComponent(Spacing, {}),\n\t\t\t\t\t\t\tcreateComponent(TSDoc$1, {\n\t\t\t\t\t\t\t\theading: \"A specific application version to help to.\",\n\t\t\t\t\t\t\t\tget children() {\n\t\t\t\t\t\t\t\t\treturn [createComponent(TSDocRemarks$1, { children: `The command will attempt to help to the specified version. The version should be a valid semantic version string, or \\`latest\\` to help to the latest version.` }), createComponent(TSDocDefaultValue, {\n\t\t\t\t\t\t\t\t\t\tget type() {\n\t\t\t\t\t\t\t\t\t\t\treturn ReflectionKind.string;\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tdefaultValue: \"latest\"\n\t\t\t\t\t\t\t\t\t})];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcreateComponent(InterfaceMember, {\n\t\t\t\t\t\t\t\tname: \"version\",\n\t\t\t\t\t\t\t\toptional: true,\n\t\t\t\t\t\t\t\ttype: \"string\"\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\tcreateComponent(Spacing, {}),\n\t\t\t\tcreateComponent(TSDoc$1, { heading: \"Handler logic for the \\\\`help\\\\` command.\" }),\n\t\t\t\tcreateComponent(FunctionDeclaration, {\n\t\t\t\t\t\"export\": true,\n\t\t\t\t\t\"default\": true,\n\t\t\t\t\tasync: true,\n\t\t\t\t\tname: \"handler\",\n\t\t\t\t\tparameters: [{\n\t\t\t\t\t\tname: \"options\",\n\t\t\t\t\t\ttype: \"HelpOptions\"\n\t\t\t\t\t}],\n\t\t\t\t\tchildren: code` return;`\n\t\t\t\t})\n\t\t\t];\n\t\t}\n\t});\n}\n\n//#endregion\nexport { HelpCommand };\n//# sourceMappingURL=help-command.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAcA,SAAS,cAAc;CACtB,MAAM,6EAAyB;AAC/B,wDAAuBA,oDAAgB;EACtC,IAAI,OAAO;AACV,sCAAiB,QAAQ,WAAW,QAAQ,aAAa;;EAE1D,SAAS;GACR,WAAW,CAAC,KAAK;GACjB,oBAAoB,CAAC,YAAY,YAAY;GAC7C;EACD,gBAAgB,EAAE,SAAS;GAC1B;GACA;GACA;GACA;GACA;GACA,EAAE;EACH,IAAI,WAAW;AACd,UAAO;oDACUC,4DAAS,EA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