@shell-shock/preset-script 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +264 -0
- package/dist/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/components/builtin/console.cjs +1232 -0
- package/dist/components/builtin/console.cjs.map +1 -0
- package/dist/components/builtin/console.d.cts +37 -0
- package/dist/components/builtin/console.d.mts +37 -0
- package/dist/components/builtin/console.mjs +1225 -0
- package/dist/components/builtin/console.mjs.map +1 -0
- package/dist/components/builtin/index.cjs +9 -0
- package/dist/components/builtin/index.d.cts +2 -0
- package/dist/components/builtin/index.d.mts +2 -0
- package/dist/components/builtin/index.mjs +3 -0
- package/dist/components/command-router.cjs +103 -0
- package/dist/components/command-router.cjs.map +1 -0
- package/dist/components/command-router.d.cts +8 -0
- package/dist/components/command-router.d.mts +8 -0
- package/dist/components/command-router.mjs +101 -0
- package/dist/components/command-router.mjs.map +1 -0
- package/dist/components/entry/bin.cjs +92 -0
- package/dist/components/entry/bin.cjs.map +1 -0
- package/dist/components/entry/bin.d.cts +15 -0
- package/dist/components/entry/bin.d.mts +15 -0
- package/dist/components/entry/bin.mjs +91 -0
- package/dist/components/entry/bin.mjs.map +1 -0
- package/dist/components/entry/command.cjs +54 -0
- package/dist/components/entry/command.cjs.map +1 -0
- package/dist/components/entry/command.d.cts +15 -0
- package/dist/components/entry/command.d.mts +15 -0
- package/dist/components/entry/command.mjs +53 -0
- package/dist/components/entry/command.mjs.map +1 -0
- package/dist/components/entry/index.cjs +3 -0
- package/dist/components/entry/index.d.cts +2 -0
- package/dist/components/entry/index.d.mts +2 -0
- package/dist/components/entry/index.mjs +3 -0
- package/dist/components/index.cjs +19 -0
- package/dist/components/index.d.cts +7 -0
- package/dist/components/index.d.mts +7 -0
- package/dist/components/index.mjs +8 -0
- package/dist/components/shutdown.cjs +93 -0
- package/dist/components/shutdown.cjs.map +1 -0
- package/dist/components/shutdown.d.cts +14 -0
- package/dist/components/shutdown.d.mts +14 -0
- package/dist/components/shutdown.mjs +91 -0
- package/dist/components/shutdown.mjs.map +1 -0
- package/dist/contexts/command.cjs +21 -0
- package/dist/contexts/command.cjs.map +1 -0
- package/dist/contexts/command.mjs +19 -0
- package/dist/contexts/command.mjs.map +1 -0
- package/dist/contexts/theme.cjs +29 -0
- package/dist/contexts/theme.cjs.map +1 -0
- package/dist/contexts/theme.mjs +27 -0
- package/dist/contexts/theme.mjs.map +1 -0
- package/dist/helpers/ansi-utils.cjs +484 -0
- package/dist/helpers/ansi-utils.cjs.map +1 -0
- package/dist/helpers/ansi-utils.mjs +483 -0
- package/dist/helpers/ansi-utils.mjs.map +1 -0
- package/dist/helpers/get-default-options.cjs +57 -0
- package/dist/helpers/get-default-options.cjs.map +1 -0
- package/dist/helpers/get-default-options.mjs +56 -0
- package/dist/helpers/get-default-options.mjs.map +1 -0
- package/dist/index.cjs +65 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +12 -0
- package/dist/index.d.mts +12 -0
- package/dist/index.mjs +59 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/index.cjs +0 -0
- package/dist/types/index.d.cts +2 -0
- package/dist/types/index.d.mts +2 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/plugin.cjs +0 -0
- package/dist/types/plugin.d.cts +32 -0
- package/dist/types/plugin.d.mts +32 -0
- package/dist/types/plugin.mjs +1 -0
- package/package.json +181 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console.mjs","names":["code","For","Show","FunctionDeclaration","IfStatement","InterfaceDeclaration","InterfaceMember","TypeDeclaration","VarDeclaration","ReflectionKind","BuiltinFile","TSDoc","TSDocDefaultValue","TSDocExample","TSDocParam","TSDocRemarks","TSDocReturns","useColors","useTheme","ColorFunction","ansi16","ansi256","ansi16m","open","close","ColorsDeclaration","colors","_$createComponent","name","children","each","Object","keys","filter","color","idx","heading","type","initializer","_$createIntrinsic","comma","doubleHardline","enderPunctuation","theme","text","banner","title","header","footer","command","description","primary","secondary","tertiary","body","link","message","help","success","info","warning","danger","error","usage","bin","subcommand","options","params","border","outline","divider","app","WriteLineFunction","doc","optional","method","defaultValue","parameters","default","padding","MessageFunction","props","when","Boolean","WrapAnsiFunction","StripAnsiFunction","LinkFunction","condition","ConsoleBuiltin","id","builtinImports","utils"],"sources":["../../../src/components/builtin/console.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, For, Show } from \"@alloy-js/core\";\nimport type { ParameterDescriptor } from \"@alloy-js/typescript\";\nimport {\n FunctionDeclaration,\n IfStatement,\n InterfaceDeclaration,\n InterfaceMember,\n TypeDeclaration,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { BuiltinFile } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport {\n TSDoc,\n TSDocDefaultValue,\n TSDocExample,\n TSDocParam,\n TSDocRemarks,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { useColors, useTheme } from \"../../contexts/theme\";\nimport type {\n AnsiWrappers,\n BaseAnsiStylesKeys\n} from \"../../helpers/ansi-utils\";\n\n/**\n * A component to generate a console message function in a Shell Shock project.\n */\nfunction ColorFunction({\n ansi16,\n ansi256,\n ansi16m\n}: Record<\"ansi16\" | \"ansi256\" | \"ansi16m\", AnsiWrappers>) {\n return code` (text: string) => {\n try {\n if (!isColorSupported) {\n return String(text);\n }\n\n if (colorSupportLevels.stdout === 1) {\n return wrapAnsi(text, \"${ansi16.open}\", \"${ansi16.close}\");\n } else if (colorSupportLevels.stdout === 2) {\n return wrapAnsi(text, \"${ansi256.open}\", \"${ansi256.close}\");\n }\n\n return wrapAnsi(text, \"${ansi16m.open}\", \"${ansi16m.close}\");\n } catch {\n return String(text);\n }\n }\n`;\n}\n\n/**\n * A component to generate an object containing functions for coloring text in a Shell Shock project.\n */\nexport function ColorsDeclaration() {\n const colors = useColors();\n\n return (\n <>\n <TypeDeclaration export name=\"AnsiColor\">\n <For\n each={Object.keys(colors.ansi16).filter(color => color !== \"theme\")}>\n {(color, idx) => `${idx > 0 ? \" | \" : \"\"}\"${color}\"`}\n </For>\n </TypeDeclaration>\n\n {code`export type ThemeColors<T> = T extends object ? { [K in keyof T]: ThemeColor<T[K]>; } : ((text: string) => string); `}\n\n <TypeDeclaration export name=\"Colors\">\n {code`Record<AnsiColor, (text: string) => string> & ThemeColors<ThemeColorsConfig>`}\n </TypeDeclaration>\n\n <TSDoc heading=\"An object containing functions for coloring console applications. Each function corresponds to a terminal color. See {@link Colors} for available colors.\" />\n <VarDeclaration\n const\n export\n name=\"colors\"\n type=\"Colors\"\n initializer={\n <>\n {code` {\n `}\n <hbr />\n <For\n each={Object.keys(colors.ansi16).filter(\n color => color !== \"theme\"\n )}\n comma\n doubleHardline\n enderPunctuation>\n {color => (\n <>\n {code`${color}: `}\n <ColorFunction\n ansi16={colors.ansi16[color as BaseAnsiStylesKeys]}\n ansi256={colors.ansi256[color as BaseAnsiStylesKeys]}\n ansi16m={colors.ansi16m[color as BaseAnsiStylesKeys]}\n />\n </>\n )}\n </For>\n <hbr />\n {code`theme: {\n text: {\n banner: {\n title: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.banner.title}\n ansi256={colors.ansi256.theme.text.banner.title}\n ansi16m={colors.ansi16m.theme.text.banner.title}\n />\n )},\n header: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.banner.header}\n ansi256={colors.ansi256.theme.text.banner.header}\n ansi16m={colors.ansi16m.theme.text.banner.header}\n />\n )},\n footer: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.banner.footer}\n ansi256={colors.ansi256.theme.text.banner.footer}\n ansi16m={colors.ansi16m.theme.text.banner.footer}\n />\n )},\n command: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.banner.command}\n ansi256={colors.ansi256.theme.text.banner.command}\n ansi16m={colors.ansi16m.theme.text.banner.command}\n />\n )},\n description: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.banner.description}\n ansi256={\n colors.ansi256.theme.text.banner.description\n }\n ansi16m={\n colors.ansi16m.theme.text.banner.description\n }\n />\n )}\n },\n heading: {\n primary: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.heading.primary}\n ansi256={colors.ansi256.theme.text.heading.primary}\n ansi16m={colors.ansi16m.theme.text.heading.primary}\n />\n )},\n secondary: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.heading.secondary}\n ansi256={\n colors.ansi256.theme.text.heading.secondary\n }\n ansi16m={\n colors.ansi16m.theme.text.heading.secondary\n }\n />\n )},\n tertiary: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.heading.tertiary}\n ansi256={colors.ansi256.theme.text.heading.tertiary}\n ansi16m={colors.ansi16m.theme.text.heading.tertiary}\n />\n )}\n },\n body: {\n primary: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.body.primary}\n ansi256={colors.ansi256.theme.text.body.primary}\n ansi16m={colors.ansi16m.theme.text.body.primary}\n />\n )},\n secondary: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.body.secondary}\n ansi256={colors.ansi256.theme.text.body.secondary}\n ansi16m={colors.ansi16m.theme.text.body.secondary}\n />\n )},\n tertiary: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.body.tertiary}\n ansi256={colors.ansi256.theme.text.body.tertiary}\n ansi16m={colors.ansi16m.theme.text.body.tertiary}\n />\n )},\n link: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.body.link}\n ansi256={colors.ansi256.theme.text.body.link}\n ansi16m={colors.ansi16m.theme.text.body.link}\n />\n )}\n },\n message: {\n link: {\n help: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.link.help\n }\n ansi256={\n colors.ansi256.theme.text.message.link.help\n }\n ansi16m={\n colors.ansi16m.theme.text.message.link.help\n }\n />\n )},\n success: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.link.success\n }\n ansi256={\n colors.ansi256.theme.text.message.link.success\n }\n ansi16m={\n colors.ansi16m.theme.text.message.link.success\n }\n />\n )},\n info: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.link.info\n }\n ansi256={\n colors.ansi256.theme.text.message.link.info\n }\n ansi16m={\n colors.ansi16m.theme.text.message.link.info\n }\n />\n )},\n warning: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.link.warning\n }\n ansi256={\n colors.ansi256.theme.text.message.link.warning\n }\n ansi16m={\n colors.ansi16m.theme.text.message.link.warning\n }\n />\n )},\n danger: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.link.danger\n }\n ansi256={\n colors.ansi256.theme.text.message.link.danger\n }\n ansi16m={\n colors.ansi16m.theme.text.message.link.danger\n }\n />\n )},\n error: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.link.error\n }\n ansi256={\n colors.ansi256.theme.text.message.link.error\n }\n ansi16m={\n colors.ansi16m.theme.text.message.link.error\n }\n />\n )}\n },\n header: {\n help: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.header.help\n }\n ansi256={\n colors.ansi256.theme.text.message.header.help\n }\n ansi16m={\n colors.ansi16m.theme.text.message.header.help\n }\n />\n )},\n success: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.header.success\n }\n ansi256={\n colors.ansi256.theme.text.message.header.success\n }\n ansi16m={\n colors.ansi16m.theme.text.message.header.success\n }\n />\n )},\n info: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.header.info\n }\n ansi256={\n colors.ansi256.theme.text.message.header.info\n }\n ansi16m={\n colors.ansi16m.theme.text.message.header.info\n }\n />\n )},\n warning: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.header.warning\n }\n ansi256={\n colors.ansi256.theme.text.message.header.warning\n }\n ansi16m={\n colors.ansi16m.theme.text.message.header.warning\n }\n />\n )},\n danger: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.header.danger\n }\n ansi256={\n colors.ansi256.theme.text.message.header.danger\n }\n ansi16m={\n colors.ansi16m.theme.text.message.header.danger\n }\n />\n )},\n error: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.header.error\n }\n ansi256={\n colors.ansi256.theme.text.message.header.error\n }\n ansi16m={\n colors.ansi16m.theme.text.message.header.error\n }\n />\n )}\n },\n footer: {\n help: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.footer.help\n }\n ansi256={\n colors.ansi256.theme.text.message.footer.help\n }\n ansi16m={\n colors.ansi16m.theme.text.message.footer.help\n }\n />\n )},\n success: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.footer.success\n }\n ansi256={\n colors.ansi256.theme.text.message.footer.success\n }\n ansi16m={\n colors.ansi16m.theme.text.message.footer.success\n }\n />\n )},\n info: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.footer.info\n }\n ansi256={\n colors.ansi256.theme.text.message.footer.info\n }\n ansi16m={\n colors.ansi16m.theme.text.message.footer.info\n }\n />\n )},\n warning: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.footer.warning\n }\n ansi256={\n colors.ansi256.theme.text.message.footer.warning\n }\n ansi16m={\n colors.ansi16m.theme.text.message.footer.warning\n }\n />\n )},\n danger: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.footer.danger\n }\n ansi256={\n colors.ansi256.theme.text.message.footer.danger\n }\n ansi16m={\n colors.ansi16m.theme.text.message.footer.danger\n }\n />\n )},\n error: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.footer.error\n }\n ansi256={\n colors.ansi256.theme.text.message.footer.error\n }\n ansi16m={\n colors.ansi16m.theme.text.message.footer.error\n }\n />\n )}\n },\n description: {\n help: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.description\n .help\n }\n ansi256={\n colors.ansi256.theme.text.message.description\n .help\n }\n ansi16m={\n colors.ansi16m.theme.text.message.description\n .help\n }\n />\n )},\n success: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.description\n .success\n }\n ansi256={\n colors.ansi256.theme.text.message.description\n .success\n }\n ansi16m={\n colors.ansi16m.theme.text.message.description\n .success\n }\n />\n )},\n info: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.description\n .info\n }\n ansi256={\n colors.ansi256.theme.text.message.description\n .info\n }\n ansi16m={\n colors.ansi16m.theme.text.message.description\n .info\n }\n />\n )},\n warning: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.description\n .warning\n }\n ansi256={\n colors.ansi256.theme.text.message.description\n .warning\n }\n ansi16m={\n colors.ansi16m.theme.text.message.description\n .warning\n }\n />\n )},\n danger: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.description\n .danger\n }\n ansi256={\n colors.ansi256.theme.text.message.description\n .danger\n }\n ansi16m={\n colors.ansi16m.theme.text.message.description\n .danger\n }\n />\n )},\n error: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.text.message.description\n .error\n }\n ansi256={\n colors.ansi256.theme.text.message.description\n .error\n }\n ansi16m={\n colors.ansi16m.theme.text.message.description\n .error\n }\n />\n )}\n }\n },\n usage: {\n bin: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.usage.bin}\n ansi256={colors.ansi256.theme.text.usage.bin}\n ansi16m={colors.ansi16m.theme.text.usage.bin}\n />\n )},\n command: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.usage.command}\n ansi256={colors.ansi256.theme.text.usage.command}\n ansi16m={colors.ansi16m.theme.text.usage.command}\n />\n )},\n subcommand: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.usage.subcommand}\n ansi256={colors.ansi256.theme.text.usage.subcommand}\n ansi16m={colors.ansi16m.theme.text.usage.subcommand}\n />\n )},\n options: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.usage.options}\n ansi256={colors.ansi256.theme.text.usage.options}\n ansi16m={colors.ansi16m.theme.text.usage.options}\n />\n )},\n params: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.usage.params}\n ansi256={colors.ansi256.theme.text.usage.params}\n ansi16m={colors.ansi16m.theme.text.usage.params}\n />\n )},\n description: ${(\n <ColorFunction\n ansi16={colors.ansi16.theme.text.usage.description}\n ansi256={\n colors.ansi256.theme.text.usage.description\n }\n ansi16m={\n colors.ansi16m.theme.text.usage.description\n }\n />\n )}\n }\n },\n border: {\n banner: {\n outline: {\n primary: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.banner.outline\n .primary\n }\n ansi256={\n colors.ansi256.theme.border.banner.outline\n .primary\n }\n ansi16m={\n colors.ansi16m.theme.border.banner.outline\n .primary\n }\n />\n )},\n secondary: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.banner.outline\n .secondary\n }\n ansi256={\n colors.ansi256.theme.border.banner.outline\n .secondary\n }\n ansi16m={\n colors.ansi16m.theme.border.banner.outline\n .secondary\n }\n />\n )},\n tertiary: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.banner.outline\n .tertiary\n }\n ansi256={\n colors.ansi256.theme.border.banner.outline\n .tertiary\n }\n ansi16m={\n colors.ansi16m.theme.border.banner.outline\n .tertiary\n }\n />\n )}\n },\n divider: {\n primary: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.banner.divider\n .primary\n }\n ansi256={\n colors.ansi256.theme.border.banner.divider\n .primary\n }\n ansi16m={\n colors.ansi16m.theme.border.banner.divider\n .primary\n }\n />\n )},\n secondary: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.banner.divider\n .secondary\n }\n ansi256={\n colors.ansi256.theme.border.banner.divider\n .secondary\n }\n ansi16m={\n colors.ansi16m.theme.border.banner.divider\n .secondary\n }\n />\n )},\n tertiary: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.banner.divider\n .tertiary\n }\n ansi256={\n colors.ansi256.theme.border.banner.divider\n .tertiary\n }\n ansi16m={\n colors.ansi16m.theme.border.banner.divider\n .tertiary\n }\n />\n )}\n }\n },\n app: {\n outline: {\n primary: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.app.outline.primary\n }\n ansi256={\n colors.ansi256.theme.border.app.outline.primary\n }\n ansi16m={\n colors.ansi16m.theme.border.app.outline.primary\n }\n />\n )},\n secondary: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.app.outline.secondary\n }\n ansi256={\n colors.ansi256.theme.border.app.outline.secondary\n }\n ansi16m={\n colors.ansi16m.theme.border.app.outline.secondary\n }\n />\n )},\n tertiary: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.app.outline.tertiary\n }\n ansi256={\n colors.ansi256.theme.border.app.outline.tertiary\n }\n ansi16m={\n colors.ansi16m.theme.border.app.outline.tertiary\n }\n />\n )}\n },\n divider: {\n primary: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.app.divider.primary\n }\n ansi256={\n colors.ansi256.theme.border.app.divider.primary\n }\n ansi16m={\n colors.ansi16m.theme.border.app.divider.primary\n }\n />\n )},\n secondary: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.app.divider.secondary\n }\n ansi256={\n colors.ansi256.theme.border.app.divider.secondary\n }\n ansi16m={\n colors.ansi16m.theme.border.app.divider.secondary\n }\n />\n )},\n tertiary: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.app.divider.tertiary\n }\n ansi256={\n colors.ansi256.theme.border.app.divider.tertiary\n }\n ansi16m={\n colors.ansi16m.theme.border.app.divider.tertiary\n }\n />\n )}\n }\n },\n message: {\n outline: {\n help: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.message.outline.help\n }\n ansi256={\n colors.ansi256.theme.border.message.outline.help\n }\n ansi16m={\n colors.ansi16m.theme.border.message.outline.help\n }\n />\n )},\n success: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.message.outline.success\n }\n ansi256={\n colors.ansi256.theme.border.message.outline\n .success\n }\n ansi16m={\n colors.ansi16m.theme.border.message.outline\n .success\n }\n />\n )},\n info: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.message.outline.info\n }\n ansi256={\n colors.ansi256.theme.border.message.outline.info\n }\n ansi16m={\n colors.ansi16m.theme.border.message.outline.info\n }\n />\n )},\n warning: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.message.outline.warning\n }\n ansi256={\n colors.ansi256.theme.border.message.outline\n .warning\n }\n ansi16m={\n colors.ansi16m.theme.border.message.outline\n .warning\n }\n />\n )},\n danger: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.message.outline.danger\n }\n ansi256={\n colors.ansi256.theme.border.message.outline.danger\n }\n ansi16m={\n colors.ansi16m.theme.border.message.outline.danger\n }\n />\n )},\n error: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.message.outline.error\n }\n ansi256={\n colors.ansi256.theme.border.message.outline.error\n }\n ansi16m={\n colors.ansi16m.theme.border.message.outline.error\n }\n />\n )}\n },\n divider: {\n help: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.message.divider.help\n }\n ansi256={\n colors.ansi256.theme.border.message.divider.help\n }\n ansi16m={\n colors.ansi16m.theme.border.message.divider.help\n }\n />\n )},\n success: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.message.divider.success\n }\n ansi256={\n colors.ansi256.theme.border.message.divider\n .success\n }\n ansi16m={\n colors.ansi16m.theme.border.message.divider\n .success\n }\n />\n )},\n info: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.message.divider.info\n }\n ansi256={\n colors.ansi256.theme.border.message.divider.info\n }\n ansi16m={\n colors.ansi16m.theme.border.message.divider.info\n }\n />\n )},\n warning: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.message.divider.warning\n }\n ansi256={\n colors.ansi256.theme.border.message.divider\n .warning\n }\n ansi16m={\n colors.ansi16m.theme.border.message.divider\n .warning\n }\n />\n )},\n danger: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.message.divider.danger\n }\n ansi256={\n colors.ansi256.theme.border.message.divider.danger\n }\n ansi16m={\n colors.ansi16m.theme.border.message.divider.danger\n }\n />\n )},\n error: ${(\n <ColorFunction\n ansi16={\n colors.ansi16.theme.border.message.divider.error\n }\n ansi256={\n colors.ansi256.theme.border.message.divider.error\n }\n ansi16m={\n colors.ansi16m.theme.border.message.divider.error\n }\n />\n )}\n }\n }\n }\n }\n }\n`}\n </>\n }\n />\n </>\n );\n}\n\n/**\n * A component to generate the `writeLine` function in the `shell-shock:console` builtin module.\n */\nexport function WriteLineFunction() {\n const theme = useTheme();\n\n return (\n <>\n <InterfaceDeclaration export name=\"WriteLineOptions\">\n <InterfaceMember\n doc={\n <TSDoc heading=\"Padding to apply to the line\">\n <TSDocRemarks>\n {`The amount of padding (in spaces) to apply to the line when writing to the console. This value is applied to both the left and right sides of the line. If not specified, the default padding defined in the current theme configuration will be used.`}\n </TSDocRemarks>\n </TSDoc>\n }\n name=\"padding\"\n optional\n type=\"number\"\n />\n <InterfaceMember\n doc={\n <TSDoc heading=\"Console function to use for writing the line\">\n <TSDocRemarks>\n {`The console function to use for writing the line. If not specified, the default console function \\`console.log\\` will be used.`}\n </TSDocRemarks>\n <TSDocDefaultValue\n type={ReflectionKind.method}\n defaultValue={`\\`console.log\\``}\n />\n </TSDoc>\n }\n name=\"consoleFn\"\n optional\n type=\"(text: string) => void\"\n />\n </InterfaceDeclaration>\n\n <TSDoc heading=\"Write a line to the console.\">\n <TSDocRemarks>\n {`This function writes a line to the console, applying the appropriate padding as defined in the current theme configuration and wrapping as needed.`}\n </TSDocRemarks>\n\n <TSDocParam name=\"text\">\n {`The line text to write to the console.`}\n </TSDocParam>\n <TSDocParam name=\"padding\">{`Padding to apply to the line`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n name={\"writeLine\"}\n parameters={[\n {\n name: \"text\",\n type: \"string | number | boolean | null\",\n optional: true\n },\n {\n name: \"options\",\n type: \"WriteLineOptions\",\n default: \"{}\"\n }\n ]}>\n {code`const consoleFn = options.consoleFn ?? console.log;\nif (text === undefined || text === null || text === \"\") {\n consoleFn(\"\");\n return;\n}\n\nconst str = String(text);\nconst padding = Math.max(options.padding ?? ${theme.padding.app}, 0);\n\nif (stripAnsi(str).length + padding * 2 <= process.stdout.columns) {\n consoleFn(\\`\\${\" \".repeat(padding)}\\${str}\\`);\n} else {\n const words = str.split(\" \");\n let line = \"\";\n for (let i = 0; i < words.length; i++) {\n const word = words[i]!;\n if (line.length + stripAnsi(word).length + 1 <= process.stdout.columns - padding * 2) {\n line += (line ? \" \" : \"\") + word;\n } else {\n consoleFn(\\`\\${\" \".repeat(padding)}\\${line}\\`);\n line = word;\n }\n }\n\n if (line && stripAnsi(line).length > 0) {\n consoleFn(\\`\\${\" \".repeat(padding)}\\${line}\\`);\n }\n}\n`}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface MessageFunctionProps {\n type?:\n | \"success\"\n | \"help\"\n | \"info\"\n | \"verbose\"\n | \"warning\"\n | \"danger\"\n | \"error\";\n}\n\n/**\n * A component to generate the message functions in the `shell-shock:console` builtin module.\n */\nexport function MessageFunction(props: MessageFunctionProps) {\n const { type } = props;\n\n return (\n <>\n <TSDoc\n heading={`Write ${\n type === \"error\" || type === \"info\" ? \"an\" : \"a\"\n } ${type ? (type === \"info\" ? \"informational\" : type) : \"\"} message to the console.`}>\n <TSDocRemarks>\n {`This function initializes the Powerlines environment configuration object.`}\n </TSDocRemarks>\n\n <Show when={!type}>\n <TSDocParam name=\"type\">\n {`The type of message to write to the console.`}\n </TSDocParam>\n </Show>\n <TSDocParam name=\"message\">\n {`The message(s) to write to the console.`}\n </TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n name={type || \"message\"}\n parameters={\n [\n !type && {\n name: \"type\",\n type: `\"success\" | \"help\" | \"info\" | \"verbose\" | \"warning\" | \"danger\" | \"error\"`,\n optional: false\n },\n {\n name: \"message\",\n type: \"string\",\n optional: false\n }\n ].filter(Boolean) as ParameterDescriptor[]\n }>\n {code`writeLine(message, { consoleFn: console.${\n type === \"warning\"\n ? \"warn\"\n : type === \"error\" || type === \"danger\"\n ? \"error\"\n : type === \"info\"\n ? \"info\"\n : type === \"verbose\"\n ? \"debug\"\n : \"log\"\n } });`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `wrapAnsi` function in the `shell-shock:console` builtin module.\n */\nexport function WrapAnsiFunction() {\n return (\n <>\n <TSDoc heading=\"Applies ANSI escape codes to a string.\">\n <TSDocRemarks>\n {`Split text by /\\\\\\\\u001b[\\\\[|\\\\]][0-9;]*m/ and wrap non-ANSI parts with open/closeing tags.`}\n </TSDocRemarks>\n\n <TSDocExample>\n {`const result = wrapAnsi(\"Hello\\\\\\\\u001b[31mWorld\\\\\\\\u001b[0mAgain\", \"\\\\\\\\u001b[36m\", \"\\\\\\\\u001b[39\");\\nconsole.log(result); // \"\\\\\\\\u001b[36mHello\\\\\\\\u001b[39\\\\\\\\u001b[31mWorld\\\\\\\\u001b[0m\\\\\\\\u001b[36mAgain\\\\\\\\u001b[39\"`}\n </TSDocExample>\n\n <TSDocParam name=\"text\">\n {`The text to apply ANSI codes to.`}\n </TSDocParam>\n <TSDocParam name=\"open\">{`The opening ANSI code.`}</TSDocParam>\n <TSDocParam name=\"close\">{`The closing ANSI code.`}</TSDocParam>\n <TSDocReturns>{`The text with ANSI codes applied.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"wrapAnsi\"\n parameters={[\n {\n name: \"text\",\n type: \"string | number\",\n optional: false\n },\n {\n name: \"open\",\n type: \"string\",\n optional: false\n },\n { name: \"close\", type: \"string\", optional: false }\n ]}>\n {code`const str = String(text);\n const tokens: string[] = [];\n\n let last = 0;\n let match: RegExpExecArray | null;\n while ((match = /\\\\\\\\u001b[\\\\[|\\\\]][0-9;]*m/g.exec(str)) !== null) {\n if (match.index > last) tokens.push(str.slice(last, match.index));\n tokens.push(match[0]);\n last = match.index + match[0].length;\n }\n\n if (last < str.length) {\n tokens.push(str.slice(last));\n }\n\n let result = \"\";\n for (let i = 0; i < tokens.length; i++) {\n const seg = tokens[i]!;\n if (/^\\\\\\\\u001b[\\\\[|\\\\]][0-9;]*m$/.test(seg)) {\n result += seg;\n continue;\n }\n\n if (!seg) {\n continue;\n }\n\n result += i > 0 && /^\\\\\\\\u001b[\\\\[|\\\\]][0-9;]*m$/.test(tokens[i - 1]!) && i + 1 < tokens.length && ansiExactRegex.test(tokens[i + 1]!) ? seg : \\`\\${open}\\${seg}\\${close}\\`;\n }\n\n return result;\n`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `stripAnsi` function in the `shell-shock:console` builtin module.\n */\nexport function StripAnsiFunction() {\n return (\n <>\n <TSDoc heading=\"Removes ANSI escape codes from a string.\">\n <TSDocExample>\n {`const result = stripAnsi(\"Hello\\\\\\\\u001b[31mWorld\\\\\\\\u001b[0mAgain\"); // \"HelloWorldAgain\"`}\n </TSDocExample>\n\n <TSDocParam name=\"text\">\n {`The text to strip ANSI codes from.`}\n </TSDocParam>\n <TSDocReturns>{`The text with ANSI codes removed.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"stripAnsi\"\n parameters={[\n {\n name: \"text\",\n type: \"string | number\",\n optional: false\n }\n ]}>\n {code`return String(text).replace(new RegExp([\n String.raw\\`[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)\\`,\n String.raw\\`(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]))\\`\n ].join(\"|\"), \"g\"), \"\");`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `link` function in the `shell-shock:console` builtin module.\n */\nexport function LinkFunction() {\n return (\n <>\n <TSDoc heading=\"Render a hyperlink in the console.\">\n <TSDocParam name=\"url\">\n {`The URL to render as a hyperlink.`}\n </TSDocParam>\n <TSDocParam name=\"text\">\n {`The text to display for the link. If not provided, the URL will be used as the text.`}\n </TSDocParam>\n <TSDocReturns>{`The formatted hyperlink string.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"link\"\n parameters={[\n {\n name: \"url\",\n type: \"string\",\n optional: false\n },\n { name: \"text\", type: \"string\", optional: true }\n ]}>\n <IfStatement condition={code`isHyperlinkSupported()`}>\n {code`return \\`\\\\u001b]8;;\\${url}\\\\u0007\\${text ?? url}\\\\u001b]8;;\\\\u0007\\`;`}\n </IfStatement>\n <hbr />\n <IfStatement condition={code`isColorSupported`}>\n {code`return colors.underline(colors.theme.text.body.link(\\`$\\{text ?? url\\} $\\{url\\}\\`));`}\n </IfStatement>\n <hbr />\n {code`return \\`$\\{text ?? url\\} $\\{url\\}\\`;`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A built-in console utilities module for Shell Shock.\n */\nexport function ConsoleBuiltin() {\n return (\n <BuiltinFile\n id=\"console\"\n description=\"A collection of helper utilities to assist in generating content meant for display in the console.\"\n builtinImports={{\n utils: [\n \"isColorSupported\",\n \"colorSupportLevels\",\n \"isHyperlinkSupported\"\n ]\n }}>\n <StripAnsiFunction />\n <hbr />\n <hbr />\n <WrapAnsiFunction />\n <hbr />\n <hbr />\n <ColorsDeclaration />\n <hbr />\n <hbr />\n <WriteLineFunction />\n <hbr />\n <hbr />\n <LinkFunction />\n <hbr />\n <hbr />\n <MessageFunction type=\"help\" />\n <hbr />\n <hbr />\n <MessageFunction type=\"success\" />\n <hbr />\n <hbr />\n <MessageFunction type=\"info\" />\n <hbr />\n <hbr />\n <MessageFunction type=\"verbose\" />\n <hbr />\n <hbr />\n <MessageFunction type=\"warning\" />\n <hbr />\n <hbr />\n <MessageFunction type=\"danger\" />\n <hbr />\n <hbr />\n <MessageFunction type=\"error\" />\n <hbr />\n <hbr />\n <MessageFunction />\n <hbr />\n <hbr />\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA+CA,SAASmB,cAAc,EACrBC,QACAC,SACAC,WACyD;AACzD,QAAOtB,IAAI;;;;;;;iCAOoBoB,OAAOG,KAAI,MAAOH,OAAOI,MAAK;;iCAE9BH,QAAQE,KAAI,MAAOF,QAAQG,MAAK;;;+BAGlCF,QAAQC,KAAI,MAAOD,QAAQE,MAAK;;;;;;;;;;AAW/D,SAAgBC,oBAAoB;CAClC,MAAMC,SAAST,WAAW;AAE1B,QAAA;EAAAU,gBAEKpB,iBAAe;GAAA,UAAA;GAAQqB,MAAI;GAAA,IAAAC,WAAA;AAAA,WAAAF,gBACzB1B,KAAG;KAAA,IACF6B,OAAI;AAAA,aAAEC,OAAOC,KAAKN,OAAON,OAAO,CAACa,QAAOC,UAASA,UAAU,QAAQ;;KAAAL,WACjEK,OAAOC,QAAQ,GAAGA,MAAM,IAAI,QAAQ,GAAE,GAAID,MAAK;KAAG,CAAA;;GAAA,CAAA;EAIvDlC,IAAI;EAAsH2B,gBAE1HpB,iBAAe;GAAA,UAAA;GAAQqB,MAAI;GAAAC,UACzB7B,IAAI;GAA8E,CAAA;EAA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,EAAA,CAAA;IAAAA,gBAAA,OAAA,EAAA,CAAA;IAAA;;EAAA,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const require_components_builtin_console = require('./console.cjs');
|
|
2
|
+
|
|
3
|
+
exports.ColorsDeclaration = require_components_builtin_console.ColorsDeclaration;
|
|
4
|
+
exports.ConsoleBuiltin = require_components_builtin_console.ConsoleBuiltin;
|
|
5
|
+
exports.LinkFunction = require_components_builtin_console.LinkFunction;
|
|
6
|
+
exports.MessageFunction = require_components_builtin_console.MessageFunction;
|
|
7
|
+
exports.StripAnsiFunction = require_components_builtin_console.StripAnsiFunction;
|
|
8
|
+
exports.WrapAnsiFunction = require_components_builtin_console.WrapAnsiFunction;
|
|
9
|
+
exports.WriteLineFunction = require_components_builtin_console.WriteLineFunction;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ColorsDeclaration, ConsoleBuiltin, LinkFunction, MessageFunction, MessageFunctionProps, StripAnsiFunction, WrapAnsiFunction, WriteLineFunction } from "./console.cjs";
|
|
2
|
+
export { ColorsDeclaration, ConsoleBuiltin, LinkFunction, MessageFunction, MessageFunctionProps, StripAnsiFunction, WrapAnsiFunction, WriteLineFunction };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ColorsDeclaration, ConsoleBuiltin, LinkFunction, MessageFunction, MessageFunctionProps, StripAnsiFunction, WrapAnsiFunction, WriteLineFunction } from "./console.mjs";
|
|
2
|
+
export { ColorsDeclaration, ConsoleBuiltin, LinkFunction, MessageFunction, MessageFunctionProps, StripAnsiFunction, WrapAnsiFunction, WriteLineFunction };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ColorsDeclaration, ConsoleBuiltin, LinkFunction, MessageFunction, StripAnsiFunction, WrapAnsiFunction, WriteLineFunction } from "./console.mjs";
|
|
2
|
+
|
|
3
|
+
export { ColorsDeclaration, ConsoleBuiltin, LinkFunction, MessageFunction, StripAnsiFunction, WrapAnsiFunction, WriteLineFunction };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_command = require('../contexts/command.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 __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
7
|
+
let __powerlines_plugin_alloy_typescript_components_dynamic_import_statement = require("@powerlines/plugin-alloy/typescript/components/dynamic-import-statement");
|
|
8
|
+
let __stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
|
|
9
|
+
|
|
10
|
+
//#region src/components/command-router.tsx
|
|
11
|
+
function CommandRouterRoute() {
|
|
12
|
+
const command = require_command.useCommand();
|
|
13
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
14
|
+
get when() {
|
|
15
|
+
return !command.isVirtual;
|
|
16
|
+
},
|
|
17
|
+
get fallback() {
|
|
18
|
+
return __alloy_js_core.code`return handle${(0, __stryke_string_format_pascal_case.pascalCase)(command.name)}(args);`;
|
|
19
|
+
},
|
|
20
|
+
get children() {
|
|
21
|
+
return [
|
|
22
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_dynamic_import_statement.DynamicImportStatement, {
|
|
23
|
+
get name() {
|
|
24
|
+
return `handle${(0, __stryke_string_format_pascal_case.pascalCase)(command.name)}`;
|
|
25
|
+
},
|
|
26
|
+
get importPath() {
|
|
27
|
+
return `./${command.entry.output}`;
|
|
28
|
+
},
|
|
29
|
+
exportName: "handler"
|
|
30
|
+
}),
|
|
31
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
32
|
+
(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`return handle${(0, __stryke_string_format_pascal_case.pascalCase)(command.name)}(args);`)
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function CommandRouter() {
|
|
38
|
+
const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
39
|
+
const command = require_command.useCommand();
|
|
40
|
+
const index = (0, __alloy_js_core.computed)(() => 2 + (command?.path.length ?? 0));
|
|
41
|
+
return [
|
|
42
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
43
|
+
"let": true,
|
|
44
|
+
name: "command",
|
|
45
|
+
type: "string",
|
|
46
|
+
initializer: __alloy_js_core.code`"";`
|
|
47
|
+
}),
|
|
48
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
49
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
50
|
+
get condition() {
|
|
51
|
+
return __alloy_js_core.code`args.length > ${index.value} && args[${index.value}]`;
|
|
52
|
+
},
|
|
53
|
+
get children() {
|
|
54
|
+
return __alloy_js_core.code`command = args[${index.value}];`;
|
|
55
|
+
}
|
|
56
|
+
}),
|
|
57
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
58
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
59
|
+
get each() {
|
|
60
|
+
return Object.values(command?.children ?? context?.commands ?? {});
|
|
61
|
+
},
|
|
62
|
+
children: (subcommand, idx) => (0, __alloy_js_core_jsx_runtime.createComponent)(require_command.CommandContext.Provider, {
|
|
63
|
+
value: subcommand,
|
|
64
|
+
get children() {
|
|
65
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
66
|
+
get when() {
|
|
67
|
+
return Boolean(idx);
|
|
68
|
+
},
|
|
69
|
+
get fallback() {
|
|
70
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
71
|
+
get condition() {
|
|
72
|
+
return __alloy_js_core.code`command.toLowerCase() === "${subcommand.name.toLowerCase()}"`;
|
|
73
|
+
},
|
|
74
|
+
get children() {
|
|
75
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(CommandRouterRoute, {});
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
get children() {
|
|
80
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.ElseIfClause, {
|
|
81
|
+
get condition() {
|
|
82
|
+
return __alloy_js_core.code`command.toLowerCase() === "${subcommand.name.toLowerCase()}"`;
|
|
83
|
+
},
|
|
84
|
+
get children() {
|
|
85
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(CommandRouterRoute, {});
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
}),
|
|
93
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.ElseIfClause, {
|
|
94
|
+
condition: __alloy_js_core.code`Boolean(command)`,
|
|
95
|
+
children: __alloy_js_core.code`error("Unknown command: " + command);`
|
|
96
|
+
})
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
//#endregion
|
|
101
|
+
exports.CommandRouter = CommandRouter;
|
|
102
|
+
exports.CommandRouterRoute = CommandRouterRoute;
|
|
103
|
+
//# sourceMappingURL=command-router.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-router.cjs","names":["code","computed","For","Show","ElseIfClause","IfStatement","VarDeclaration","usePowerlines","DynamicImportStatement","pascalCase","CommandContext","useCommand","CommandRouterRoute","command","_$createComponent","when","isVirtual","fallback","name","children","importPath","entry","output","exportName","_$createIntrinsic","_$memo","CommandRouter","context","index","path","length","type","initializer","condition","value","each","Object","values","commands","subcommand","idx","Provider","Boolean","toLowerCase"],"sources":["../../src/components/command-router.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, For, Show } from \"@alloy-js/core\";\nimport {\n ElseIfClause,\n IfStatement,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { DynamicImportStatement } from \"@powerlines/plugin-alloy/typescript/components/dynamic-import-statement\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { CommandContext, useCommand } from \"../contexts/command\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\n\nexport function CommandRouterRoute() {\n const command = useCommand();\n\n return (\n <Show\n when={!command.isVirtual}\n fallback={code`return handle${pascalCase(command.name)}(args);`}>\n <DynamicImportStatement\n name={`handle${pascalCase(command.name)}`}\n importPath={`./${command.entry.output}`}\n exportName=\"handler\"\n />\n <hbr />\n {code`return handle${pascalCase(command.name)}(args);`}\n </Show>\n );\n}\n\nexport function CommandRouter() {\n const context = usePowerlines<ScriptPresetContext>();\n\n const command = useCommand();\n const index = computed(() => 2 + (command?.path.length ?? 0));\n\n return (\n <>\n <VarDeclaration\n let\n name=\"command\"\n type=\"string\"\n initializer={code`\"\";`}\n />\n <hbr />\n <IfStatement\n condition={code`args.length > ${\n index.value\n } && args[${index.value}]`}>{code`command = args[${\n index.value\n }];`}</IfStatement>\n <hbr />\n <For each={Object.values(command?.children ?? context?.commands ?? {})}>\n {(subcommand, idx) => (\n <CommandContext.Provider value={subcommand}>\n <Show\n when={Boolean(idx)}\n fallback={\n <IfStatement\n condition={code`command.toLowerCase() === \"${subcommand.name.toLowerCase()}\"`}>\n <CommandRouterRoute />\n </IfStatement>\n }>\n <ElseIfClause\n condition={code`command.toLowerCase() === \"${subcommand.name.toLowerCase()}\"`}>\n <CommandRouterRoute />\n </ElseIfClause>\n </Show>\n </CommandContext.Provider>\n )}\n </For>\n <ElseIfClause\n condition={code`Boolean(command)`}>{code`error(\"Unknown command: \" + command);`}</ElseIfClause>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;AA8BA,SAAgBY,qBAAqB;CACnC,MAAMC,UAAUF,4BAAY;AAE5B,yDACGR,sBAAI;EAAA,IACHY,OAAI;AAAA,UAAE,CAACF,QAAQG;;EAAS,IACxBC,WAAQ;AAAA,UAAEjB,oBAAI,mEAA2Ba,QAAQK,KAAK,CAAA;;EAAS,IAAAC,WAAA;AAAA,UAAA;qDAC9DX,iGAAsB;KAAA,IACrBU,OAAI;AAAA,aAAE,4DAAoBL,QAAQK,KAAK;;KAAE,IACzCE,aAAU;AAAA,aAAE,KAAKP,QAAQQ,MAAMC;;KAC/BC,YAAU;KAAA,CAAA;qDAAA,OAAA,EAAA,CAAA;gDAGXvB,oBAAI,mEAA2Ba,QAAQK,KAAK,CAAA,SAAS;IAAA;;EAAA,CAAA;;AAK5D,SAAgBQ,gBAAgB;CAC9B,MAAMC,8EAA8C;CAEpD,MAAMd,UAAUF,4BAAY;CAC5B,MAAMiB,4CAAuB,KAAKf,SAASgB,KAAKC,UAAU,GAAG;AAE7D,QAAA;mDAEKxB,sCAAc;GAAA,OAAA;GAEbY,MAAI;GACJa,MAAI;GACJC,aAAahC,oBAAI;GAAK,CAAA;mDAAA,OAAA,EAAA,CAAA;mDAGvBK,mCAAW;GAAA,IACV4B,YAAS;AAAA,WAAEjC,oBAAI,iBACb4B,MAAMM,MAAK,WACDN,MAAMM,MAAK;;GAAG,IAAAf,WAAA;AAAA,WAAGnB,oBAAI,kBACjC4B,MAAMM,MAAK;;GACT,CAAA;mDAAA,OAAA,EAAA,CAAA;mDAEHhC,qBAAG;GAAA,IAACiC,OAAI;AAAA,WAAEC,OAAOC,OAAOxB,SAASM,YAAYQ,SAASW,YAAY,EAAE,CAAC;;GAAAnB,WAClEoB,YAAYC,yDACX9B,+BAAe+B,UAAQ;IAACP,OAAOK;IAAU,IAAApB,WAAA;AAAA,6DACvChB,sBAAI;MAAA,IACHY,OAAI;AAAA,cAAE2B,QAAQF,IAAI;;MAAA,IAClBvB,WAAQ;AAAA,+DACLZ,mCAAW;QAAA,IACV4B,YAAS;AAAA,gBAAEjC,oBAAI,8BAA8BuC,WAAWrB,KAAKyB,aAAa,CAAA;;QAAG,IAAAxB,WAAA;AAAA,iEAC5EP,oBAAkB,EAAA,CAAA;;QAAA,CAAA;;MAAA,IAAAO,WAAA;AAAA,+DAGtBf,oCAAY;QAAA,IACX6B,YAAS;AAAA,gBAAEjC,oBAAI,8BAA8BuC,WAAWrB,KAAKyB,aAAa,CAAA;;QAAG,IAAAxB,WAAA;AAAA,iEAC5EP,oBAAkB,EAAA,CAAA;;QAAA,CAAA;;MAAA,CAAA;;IAAA,CAAA;GAI1B,CAAA;mDAEFR,oCAAY;GACX6B,WAAWjC,oBAAI;GAAkBmB,UAAGnB,oBAAI;GAAuC,CAAA;EAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as _alloy_js_core2 from "@alloy-js/core";
|
|
2
|
+
|
|
3
|
+
//#region src/components/command-router.d.ts
|
|
4
|
+
declare function CommandRouterRoute(): _alloy_js_core2.Children;
|
|
5
|
+
declare function CommandRouter(): _alloy_js_core2.Children;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { CommandRouter, CommandRouterRoute };
|
|
8
|
+
//# sourceMappingURL=command-router.d.cts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as _alloy_js_core1 from "@alloy-js/core";
|
|
2
|
+
|
|
3
|
+
//#region src/components/command-router.d.ts
|
|
4
|
+
declare function CommandRouterRoute(): _alloy_js_core1.Children;
|
|
5
|
+
declare function CommandRouter(): _alloy_js_core1.Children;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { CommandRouter, CommandRouterRoute };
|
|
8
|
+
//# sourceMappingURL=command-router.d.mts.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { CommandContext, useCommand } from "../contexts/command.mjs";
|
|
2
|
+
import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
|
|
3
|
+
import { For, Show, code, computed } from "@alloy-js/core";
|
|
4
|
+
import { ElseIfClause, IfStatement, VarDeclaration } from "@alloy-js/typescript";
|
|
5
|
+
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
6
|
+
import { DynamicImportStatement } from "@powerlines/plugin-alloy/typescript/components/dynamic-import-statement";
|
|
7
|
+
import { pascalCase } from "@stryke/string-format/pascal-case";
|
|
8
|
+
|
|
9
|
+
//#region src/components/command-router.tsx
|
|
10
|
+
function CommandRouterRoute() {
|
|
11
|
+
const command = useCommand();
|
|
12
|
+
return createComponent(Show, {
|
|
13
|
+
get when() {
|
|
14
|
+
return !command.isVirtual;
|
|
15
|
+
},
|
|
16
|
+
get fallback() {
|
|
17
|
+
return code`return handle${pascalCase(command.name)}(args);`;
|
|
18
|
+
},
|
|
19
|
+
get children() {
|
|
20
|
+
return [
|
|
21
|
+
createComponent(DynamicImportStatement, {
|
|
22
|
+
get name() {
|
|
23
|
+
return `handle${pascalCase(command.name)}`;
|
|
24
|
+
},
|
|
25
|
+
get importPath() {
|
|
26
|
+
return `./${command.entry.output}`;
|
|
27
|
+
},
|
|
28
|
+
exportName: "handler"
|
|
29
|
+
}),
|
|
30
|
+
createIntrinsic("hbr", {}),
|
|
31
|
+
memo(() => code`return handle${pascalCase(command.name)}(args);`)
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function CommandRouter() {
|
|
37
|
+
const context = usePowerlines();
|
|
38
|
+
const command = useCommand();
|
|
39
|
+
const index = computed(() => 2 + (command?.path.length ?? 0));
|
|
40
|
+
return [
|
|
41
|
+
createComponent(VarDeclaration, {
|
|
42
|
+
"let": true,
|
|
43
|
+
name: "command",
|
|
44
|
+
type: "string",
|
|
45
|
+
initializer: code`"";`
|
|
46
|
+
}),
|
|
47
|
+
createIntrinsic("hbr", {}),
|
|
48
|
+
createComponent(IfStatement, {
|
|
49
|
+
get condition() {
|
|
50
|
+
return code`args.length > ${index.value} && args[${index.value}]`;
|
|
51
|
+
},
|
|
52
|
+
get children() {
|
|
53
|
+
return code`command = args[${index.value}];`;
|
|
54
|
+
}
|
|
55
|
+
}),
|
|
56
|
+
createIntrinsic("hbr", {}),
|
|
57
|
+
createComponent(For, {
|
|
58
|
+
get each() {
|
|
59
|
+
return Object.values(command?.children ?? context?.commands ?? {});
|
|
60
|
+
},
|
|
61
|
+
children: (subcommand, idx) => createComponent(CommandContext.Provider, {
|
|
62
|
+
value: subcommand,
|
|
63
|
+
get children() {
|
|
64
|
+
return createComponent(Show, {
|
|
65
|
+
get when() {
|
|
66
|
+
return Boolean(idx);
|
|
67
|
+
},
|
|
68
|
+
get fallback() {
|
|
69
|
+
return createComponent(IfStatement, {
|
|
70
|
+
get condition() {
|
|
71
|
+
return code`command.toLowerCase() === "${subcommand.name.toLowerCase()}"`;
|
|
72
|
+
},
|
|
73
|
+
get children() {
|
|
74
|
+
return createComponent(CommandRouterRoute, {});
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
get children() {
|
|
79
|
+
return createComponent(ElseIfClause, {
|
|
80
|
+
get condition() {
|
|
81
|
+
return code`command.toLowerCase() === "${subcommand.name.toLowerCase()}"`;
|
|
82
|
+
},
|
|
83
|
+
get children() {
|
|
84
|
+
return createComponent(CommandRouterRoute, {});
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
}),
|
|
92
|
+
createComponent(ElseIfClause, {
|
|
93
|
+
condition: code`Boolean(command)`,
|
|
94
|
+
children: code`error("Unknown command: " + command);`
|
|
95
|
+
})
|
|
96
|
+
];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
//#endregion
|
|
100
|
+
export { CommandRouter, CommandRouterRoute };
|
|
101
|
+
//# sourceMappingURL=command-router.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-router.mjs","names":["code","computed","For","Show","ElseIfClause","IfStatement","VarDeclaration","usePowerlines","DynamicImportStatement","pascalCase","CommandContext","useCommand","CommandRouterRoute","command","_$createComponent","when","isVirtual","fallback","name","children","importPath","entry","output","exportName","_$createIntrinsic","_$memo","CommandRouter","context","index","path","length","type","initializer","condition","value","each","Object","values","commands","subcommand","idx","Provider","Boolean","toLowerCase"],"sources":["../../src/components/command-router.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, For, Show } from \"@alloy-js/core\";\nimport {\n ElseIfClause,\n IfStatement,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { DynamicImportStatement } from \"@powerlines/plugin-alloy/typescript/components/dynamic-import-statement\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { CommandContext, useCommand } from \"../contexts/command\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\n\nexport function CommandRouterRoute() {\n const command = useCommand();\n\n return (\n <Show\n when={!command.isVirtual}\n fallback={code`return handle${pascalCase(command.name)}(args);`}>\n <DynamicImportStatement\n name={`handle${pascalCase(command.name)}`}\n importPath={`./${command.entry.output}`}\n exportName=\"handler\"\n />\n <hbr />\n {code`return handle${pascalCase(command.name)}(args);`}\n </Show>\n );\n}\n\nexport function CommandRouter() {\n const context = usePowerlines<ScriptPresetContext>();\n\n const command = useCommand();\n const index = computed(() => 2 + (command?.path.length ?? 0));\n\n return (\n <>\n <VarDeclaration\n let\n name=\"command\"\n type=\"string\"\n initializer={code`\"\";`}\n />\n <hbr />\n <IfStatement\n condition={code`args.length > ${\n index.value\n } && args[${index.value}]`}>{code`command = args[${\n index.value\n }];`}</IfStatement>\n <hbr />\n <For each={Object.values(command?.children ?? context?.commands ?? {})}>\n {(subcommand, idx) => (\n <CommandContext.Provider value={subcommand}>\n <Show\n when={Boolean(idx)}\n fallback={\n <IfStatement\n condition={code`command.toLowerCase() === \"${subcommand.name.toLowerCase()}\"`}>\n <CommandRouterRoute />\n </IfStatement>\n }>\n <ElseIfClause\n condition={code`command.toLowerCase() === \"${subcommand.name.toLowerCase()}\"`}>\n <CommandRouterRoute />\n </ElseIfClause>\n </Show>\n </CommandContext.Provider>\n )}\n </For>\n <ElseIfClause\n condition={code`Boolean(command)`}>{code`error(\"Unknown command: \" + command);`}</ElseIfClause>\n </>\n );\n}\n"],"mappings":";;;;;;;;;AA8BA,SAAgBY,qBAAqB;CACnC,MAAMC,UAAUF,YAAY;AAE5B,QAAAG,gBACGX,MAAI;EAAA,IACHY,OAAI;AAAA,UAAE,CAACF,QAAQG;;EAAS,IACxBC,WAAQ;AAAA,UAAEjB,IAAI,gBAAgBS,WAAWI,QAAQK,KAAK,CAAA;;EAAS,IAAAC,WAAA;AAAA,UAAA;IAAAL,gBAC9DN,wBAAsB;KAAA,IACrBU,OAAI;AAAA,aAAE,SAAST,WAAWI,QAAQK,KAAK;;KAAE,IACzCE,aAAU;A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A,gBAAEjC,IAAI,8BAA8BuC,WAAWrB,KAAKyB,aAAa,CAAA;;QAAG,IAAAxB,WAAA;AAAA,gBAAAL,gBAC5EF,oBAAkB,EAAA,CAAA;;QAAA,CAAA;;MAAA,CAAA;;IAAA,CAAA;GAI1B,CAAA;EAAAE,gBAEFV,cAAY;GACX6B,WAAWjC,IAAI;GAAkBmB,UAAGnB,IAAI;GAAuC,CAAA;EAAA"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_components_command_router = require('../command-router.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 __powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
7
|
+
let __powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
8
|
+
let __powerlines_plugin_alloy_typescript_components_entry_file = require("@powerlines/plugin-alloy/typescript/components/entry-file");
|
|
9
|
+
|
|
10
|
+
//#region src/components/entry/bin.tsx
|
|
11
|
+
/**
|
|
12
|
+
* The binary entry point for the Shell Shock project.
|
|
13
|
+
*/
|
|
14
|
+
function BinEntry(props) {
|
|
15
|
+
const { prefix, postfix, builtinImports, ...rest } = props;
|
|
16
|
+
const context = (0, __powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
17
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_entry_file.EntryFile, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
18
|
+
path: "bin",
|
|
19
|
+
get builtinImports() {
|
|
20
|
+
return {
|
|
21
|
+
console: [
|
|
22
|
+
"danger",
|
|
23
|
+
"error",
|
|
24
|
+
"verbose"
|
|
25
|
+
],
|
|
26
|
+
utils: ["hasFlag"],
|
|
27
|
+
...builtinImports ?? {}
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
get children() {
|
|
31
|
+
return [
|
|
32
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
33
|
+
get when() {
|
|
34
|
+
return Boolean(prefix);
|
|
35
|
+
},
|
|
36
|
+
children: prefix
|
|
37
|
+
}),
|
|
38
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
39
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { get heading() {
|
|
40
|
+
return `Binary entry point for the ${context?.config.title ? `${context?.config.title} ` : ""}CLI application.`;
|
|
41
|
+
} }),
|
|
42
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
|
|
43
|
+
async: true,
|
|
44
|
+
name: "main",
|
|
45
|
+
get children() {
|
|
46
|
+
return [
|
|
47
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
48
|
+
"const": true,
|
|
49
|
+
name: "args",
|
|
50
|
+
type: "string[]",
|
|
51
|
+
initializer: __alloy_js_core.code`process.argv;`
|
|
52
|
+
}),
|
|
53
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
54
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
55
|
+
condition: __alloy_js_core.code`hasFlag(["version", "v"], args)`,
|
|
56
|
+
get children() {
|
|
57
|
+
return __alloy_js_core.code`console.log(${context?.packageJson.version ? `"${context?.packageJson.version}"` : "0.0.1"});`;
|
|
58
|
+
}
|
|
59
|
+
}),
|
|
60
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.ElseClause, { get children() {
|
|
61
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_command_router.CommandRouter, {});
|
|
62
|
+
} })
|
|
63
|
+
];
|
|
64
|
+
}
|
|
65
|
+
}),
|
|
66
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
67
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
68
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
69
|
+
get when() {
|
|
70
|
+
return Boolean(postfix);
|
|
71
|
+
},
|
|
72
|
+
get fallback() {
|
|
73
|
+
return [__alloy_js_core.code`
|
|
74
|
+
try {
|
|
75
|
+
await main();
|
|
76
|
+
} catch (err) {
|
|
77
|
+
error(err);
|
|
78
|
+
process.exit(1);
|
|
79
|
+
}
|
|
80
|
+
`];
|
|
81
|
+
},
|
|
82
|
+
children: postfix
|
|
83
|
+
}),
|
|
84
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
85
|
+
];
|
|
86
|
+
}
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
//#endregion
|
|
91
|
+
exports.BinEntry = BinEntry;
|
|
92
|
+
//# sourceMappingURL=bin.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.cjs","names":["code","Show","ElseClause","FunctionDeclaration","IfStatement","VarDeclaration","usePowerlines","EntryFile","TSDoc","CommandRouter","BinEntry","props","prefix","postfix","builtinImports","rest","context","_$createComponent","_$mergeProps","path","console","utils","children","when","Boolean","_$createIntrinsic","heading","config","title","async","name","type","initializer","condition","packageJson","version","fallback"],"sources":["../../../src/components/entry/bin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Children } from \"@alloy-js/core\";\nimport { code, Show } from \"@alloy-js/core\";\nimport {\n ElseClause,\n FunctionDeclaration,\n IfStatement,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport type { EntryFileProps } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { EntryFile } from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { TSDoc } from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport type { ScriptPresetContext } from \"../../types/plugin\";\nimport { CommandRouter } from \"../command-router\";\n\nexport interface BinEntryProps\n extends Omit<EntryFileProps, \"path\" | \"hashbang\"> {\n prefix?: Children;\n postfix?: Children;\n}\n\n/**\n * The binary entry point for the Shell Shock project.\n */\nexport function BinEntry(props: BinEntryProps) {\n const { prefix, postfix, builtinImports, ...rest } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <EntryFile\n {...rest}\n path=\"bin\"\n builtinImports={{\n console: [\"danger\", \"error\", \"verbose\"],\n utils: [\"hasFlag\"],\n ...(builtinImports ?? {})\n }}>\n <Show when={Boolean(prefix)}>{prefix}</Show>\n <hbr />\n <TSDoc\n heading={`Binary entry point for the ${context?.config.title ? `${context?.config.title} ` : \"\"}CLI application.`}></TSDoc>\n <FunctionDeclaration async name=\"main\">\n <VarDeclaration\n const\n name=\"args\"\n type=\"string[]\"\n initializer={code`process.argv;`}\n />\n <hbr />\n <IfStatement condition={code`hasFlag([\"version\", \"v\"], args)`}>\n {code`console.log(${context?.packageJson.version ? `\"${context?.packageJson.version}\"` : \"0.0.1\"});`}\n </IfStatement>\n <ElseClause>\n <CommandRouter />\n </ElseClause>\n </FunctionDeclaration>\n <hbr />\n <hbr />\n <Show\n when={Boolean(postfix)}\n fallback={\n <>{code`\n try {\n await main();\n } catch (err) {\n error(err);\n process.exit(1);\n }\n `}</>\n }>\n {postfix}\n </Show>\n <hbr />\n </EntryFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA0CA,SAAgBU,SAASC,OAAsB;CAC7C,MAAM,EAAEC,QAAQC,SAASC,gBAAgB,GAAGC,SAASJ;CAErD,MAAMK,8EAA8C;AAEpD,yDACGT,kHACKQ,MAAI;EACRI,MAAI;EAAA,IACJL,iBAAc;AAAA,UAAE;IACdM,SAAS;KAAC;KAAU;KAAS;KAAU;IACvCC,OAAO,CAAC,UAAU;IAClB,GAAIP,kBAAkB,EAAE;IACzB;;EAAA,IAAAQ,WAAA;AAAA,UAAA;qDACArB,sBAAI;KAAA,IAACsB,OAAI;AAAA,aAAEC,QAAQZ,OAAO;;KAAAU,UAAGV;KAAM,CAAA;qDAAA,OAAA,EAAA,CAAA;qDAEnCJ,6DAAK,EAAA,IACJkB,UAAO;AAAA,YAAE,8BAA8BV,SAASW,OAAOC,QAAQ,GAAGZ,SAASW,OAAOC,MAAK,KAAM,GAAE;OAAkB,CAAA;qDAClHzB,2CAAmB;KAAC0B,OAAK;KAACC,MAAI;KAAA,IAAAR,WAAA;AAAA,aAAA;wDAC5BjB,sCAAc;QAAA,SAAA;QAEbyB,MAAI;QACJC,MAAI;QACJC,aAAahC,oBAAI;QAAe,CAAA;wDAAA,OAAA,EAAA,CAAA;wDAGjCI,mCAAW;QAAC6B,WAAWjC,oBAAI;QAAiC,IAAAsB,WAAA;AAAA,gBAC1DtB,oBAAI,eAAegB,SAASkB,YAAYC,UAAU,IAAInB,SAASkB,YAAYC,QAAO,KAAM,QAAO;;QAAI,CAAA;wDAErGjC,kCAAU,EAAA,IAAAoB,WAAA;AAAA,gEACRb,iDAAa,EAAA,CAAA;UAAA,CAAA;OAAA;;KAAA,CAAA;qDAAA,OAAA,EAAA,CAAA;qDAAA,OAAA,EAAA,CAAA;qDAKjBR,sBAAI;KAAA,IACHsB,OAAI;AAAA,aAAEC,QAAQX,QAAQ;;KAAA,IACtBuB,WAAQ;AAAA,aAAA,CACHpC,oBAAI;;;;;;;QAOV;;KAAAsB,UAEET;KAAO,CAAA;qDAAA,OAAA,EAAA,CAAA;IAAA;;EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Children } from "@alloy-js/core";
|
|
2
|
+
import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
|
|
3
|
+
|
|
4
|
+
//#region src/components/entry/bin.d.ts
|
|
5
|
+
interface BinEntryProps extends Omit<EntryFileProps, "path" | "hashbang"> {
|
|
6
|
+
prefix?: Children;
|
|
7
|
+
postfix?: Children;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The binary entry point for the Shell Shock project.
|
|
11
|
+
*/
|
|
12
|
+
declare function BinEntry(props: BinEntryProps): Children;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { BinEntry, BinEntryProps };
|
|
15
|
+
//# sourceMappingURL=bin.d.cts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Children } from "@alloy-js/core";
|
|
2
|
+
import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
|
|
3
|
+
|
|
4
|
+
//#region src/components/entry/bin.d.ts
|
|
5
|
+
interface BinEntryProps extends Omit<EntryFileProps, "path" | "hashbang"> {
|
|
6
|
+
prefix?: Children;
|
|
7
|
+
postfix?: Children;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The binary entry point for the Shell Shock project.
|
|
11
|
+
*/
|
|
12
|
+
declare function BinEntry(props: BinEntryProps): Children;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { BinEntry, BinEntryProps };
|
|
15
|
+
//# sourceMappingURL=bin.d.mts.map
|