@shell-shock/preset-script 0.6.60 → 0.6.61
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/components/command-entry.cjs +3 -4
- package/dist/components/command-entry.cjs.map +1 -1
- package/dist/components/command-entry.d.cts.map +1 -1
- package/dist/components/command-entry.d.mts.map +1 -1
- package/dist/components/command-entry.mjs +3 -4
- package/dist/components/command-entry.mjs.map +1 -1
- package/package.json +12 -12
|
@@ -25,7 +25,7 @@ let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case
|
|
|
25
25
|
//#region src/components/command-entry.tsx
|
|
26
26
|
function CommandInvocation(props) {
|
|
27
27
|
const { command } = props;
|
|
28
|
-
return [(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code` return withCommand("${command.path}", [${command.segments.map((segment) => (0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? (0, _stryke_string_format_camel_case.camelCase)((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment)) : `"${segment}"`).join(", ")}], [options${command.args.length > 0 ?
|
|
28
|
+
return [(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code` return withCommand("${command.path}", [${command.segments.map((segment) => (0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? (0, _stryke_string_format_camel_case.camelCase)((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment)) : `"${segment}"`).join(", ")}], [${Object.keys(command.options).length > 0 ? `options` : ""}${command.args.length > 0 ? `${Object.keys(command.options).length > 0 ? ", " : ""}${command.args.map((arg) => (0, _stryke_string_format_camel_case.camelCase)(arg.name)).join(", ")}` : ""}], handle${(0, _stryke_string_format_pascal_case.pascalCase)(command.name)}); `), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* A component that generates the `handler` function declaration for a command.
|
|
@@ -84,18 +84,17 @@ function CommandHandlerDeclaration(props) {
|
|
|
84
84
|
children: banner
|
|
85
85
|
}),
|
|
86
86
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
87
|
+
_alloy_js_core.code`writeLine("");`,
|
|
87
88
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
88
89
|
get condition() {
|
|
89
90
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_core_components_helpers.IsDebug, {});
|
|
90
91
|
},
|
|
91
92
|
get children() {
|
|
92
|
-
return _alloy_js_core.code`writeLine("");
|
|
93
|
-
writeLine(textColors.body.tertiary("Debug mode is enabled. Additional debug information may be logged to the console."));
|
|
93
|
+
return _alloy_js_core.code`writeLine(textColors.body.tertiary("Debug mode is enabled. Additional debug information may be logged to the console."));
|
|
94
94
|
writeLine("");
|
|
95
95
|
debug(\`Command path: ${command.segments.map((segment) => (0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? `\${${(0, _stryke_string_format_camel_case.camelCase)((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment))}}` : segment).join(" / ")} \\n\\nOptions: \\n${Object.values(command.options).map((option) => ` - ${(0, _stryke_string_format_kebab_case.kebabCase)(option.name)}: \${options.${(0, _stryke_string_format_camel_case.camelCase)(option.name)} === undefined ? "" : JSON.stringify(options.${(0, _stryke_string_format_camel_case.camelCase)(option.name)})}`).join("\\n")}${command.args.length > 0 ? ` \\n\\nArguments: \\n${command.args.map((arg) => ` - ${(0, _stryke_string_format_kebab_case.kebabCase)(arg.name)}: \${${(0, _stryke_string_format_camel_case.camelCase)(arg.name)} === undefined ? "" : JSON.stringify(${(0, _stryke_string_format_camel_case.camelCase)(arg.name)})}`).join("\\n")}` : ""}\`); `;
|
|
96
96
|
}
|
|
97
97
|
}),
|
|
98
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseClause, { children: _alloy_js_core.code`writeLine("");` }),
|
|
99
98
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
100
99
|
children,
|
|
101
100
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-entry.cjs","names":[],"sources":["../../src/components/command-entry.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, computed, For, Show } from \"@alloy-js/core\";\nimport {\n ElseClause,\n FunctionDeclaration,\n IfStatement\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\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 {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocTitle\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport type { CommandTree } from \"@shell-shock/core\";\nimport { CommandValidationLogic } from \"@shell-shock/core/components/command-validation-logic\";\nimport { IsDebug } from \"@shell-shock/core/components/helpers\";\nimport {\n CommandParserLogic,\n OptionsInterfaceDeclaration\n} from \"@shell-shock/core/components/options-parser-logic\";\nimport {\n getAppBin,\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport { findFilePath, relativePath } from \"@stryke/path/find\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replaceExtension } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\nimport { VirtualCommandEntry } from \"./virtual-command-entry\";\n\nexport function CommandInvocation(props: { command: CommandTree }) {\n const { command } = props;\n\n return (\n <>\n {code` return withCommand(\"${command.path}\", [${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? camelCase(getDynamicPathSegmentName(segment))\n : `\"${segment}\"`\n )\n .join(\", \")}], [options${\n command.args.length > 0\n ? `, ${command.args.map(arg => camelCase(arg.name)).join(\", \")}`\n : \"\"\n }], handle${pascalCase(command.name)}); `}\n <hbr />\n </>\n );\n}\n\nexport interface CommandHandlerDeclarationProps {\n command: CommandTree;\n banner?: Children;\n children?: Children;\n}\n\n/**\n * A component that generates the `handler` function declaration for a command.\n */\nexport function CommandHandlerDeclaration(\n props: CommandHandlerDeclarationProps\n) {\n const { command, banner, children } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <OptionsInterfaceDeclaration command={command} />\n <Spacing />\n <TSDoc\n heading={`The ${command.title} (${getAppBin(context)} ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `[${constantCase(getDynamicPathSegmentName(segment))}]`\n : segment\n )\n .join(\" \")}) command.`}>\n <TSDocRemarks>{`${command.description.replace(/\\.+$/, \"\")}.`}</TSDocRemarks>\n <hbr />\n <TSDocTitle>{command.title}</TSDocTitle>\n <TSDocParam name=\"args\">{`The command-line arguments passed to the command.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"handler\"\n parameters={[{ name: \"args\", type: \"string[]\", default: \"useArgs()\" }]}>\n <CommandParserLogic\n command={command}\n appSpecificEnvPrefix={context.config.appSpecificEnvPrefix}\n isCaseSensitive={context.config.isCaseSensitive}\n />\n <Spacing />\n <Show when={Boolean(banner)}>{banner}</Show>\n <Spacing />\n <IfStatement condition={<IsDebug />}>\n {code`writeLine(\"\");\n writeLine(textColors.body.tertiary(\"Debug mode is enabled. Additional debug information may be logged to the console.\"));\n writeLine(\"\");\n debug(\\`Command path: ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `\\${${camelCase(getDynamicPathSegmentName(segment))}}`\n : segment\n )\n .join(\" / \")} \\\\n\\\\nOptions: \\\\n${Object.values(command.options)\n .map(\n option =>\n ` - ${kebabCase(option.name)}: \\${options.${camelCase(\n option.name\n )} === undefined ? \"\" : JSON.stringify(options.${camelCase(\n option.name\n )})}`\n )\n .join(\"\\\\n\")}${\n command.args.length > 0\n ? ` \\\\n\\\\nArguments: \\\\n${command.args\n .map(\n arg =>\n ` - ${kebabCase(arg.name)}: \\${${camelCase(\n arg.name\n )} === undefined ? \"\" : JSON.stringify(${camelCase(\n arg.name\n )})}`\n )\n .join(\"\\\\n\")}`\n : \"\"\n }\\`); `}\n </IfStatement>\n <ElseClause>{code`writeLine(\"\");`}</ElseClause>\n <Spacing />\n {children}\n <Spacing />\n <IfStatement condition={code`options.help`}>\n {code`return showHelp(); `}\n </IfStatement>\n <ElseClause>\n <hbr />\n <CommandInvocation command={command} />\n </ElseClause>\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface CommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The command entry point for the Shell Shock project.\n */\nexport function CommandEntry(props: CommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n const commandSourcePath = computed(() =>\n replaceExtension(\n relativePath(\n joinPaths(context.entryPath, findFilePath(filePath.value)),\n command.entry.input?.file || command.entry.file\n )\n )\n );\n const typeDefinition = computed(() => ({\n ...command.entry,\n output: command.id\n }));\n\n return (\n <>\n <EntryFile\n {...rest}\n path={filePath.value}\n typeDefinition={typeDefinition.value}\n imports={defu(imports ?? {}, {\n [commandSourcePath.value.startsWith(\".\")\n ? commandSourcePath.value\n : `./${commandSourcePath.value}`]:\n `handle${pascalCase(command.name)}`\n })}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"env\", \"isDevelopment\", \"isDebug\"],\n console: [\"debug\", \"warn\", \"error\", \"writeLine\", \"textColors\"],\n utils: [\"isMinimal\", \"isUnicodeSupported\"],\n state: [\n \"useGlobal\",\n \"GlobalOptions\",\n \"useGlobalOptions\",\n \"useArgs\",\n \"hasFlag\",\n \"withCommand\"\n ],\n [joinPaths(\n \"help\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showHelp\"],\n [joinPaths(\n \"banner\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showBanner\"]\n })}>\n <Spacing />\n <OptionsInterfaceDeclaration command={command} />\n <Spacing />\n <CommandHandlerDeclaration\n command={command}\n banner={code`await showBanner(); `}>\n <CommandValidationLogic command={command} />\n <IfStatement condition={code`failures.length > 0`}>\n {code`error(\\`The following validation failures were found while processing the user provided input, and must be corrected before the \\${italic(\"${\n command.title\n }\")} command can be executed: \\\\n\\\\n\\${failures.map(failure => \" - \" + failure).join(\"\\\\n\")}\\`);\n options.help = true; `}\n </IfStatement>\n </CommandHandlerDeclaration>\n </EntryFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;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,CAAM;;;AAGF,2DAAC,8DAAA,EACJ,SAAA,OACE,CAAA;;GAEF,CAAC;EACH,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"command-entry.cjs","names":[],"sources":["../../src/components/command-entry.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, computed, For, Show } from \"@alloy-js/core\";\nimport {\n ElseClause,\n FunctionDeclaration,\n IfStatement\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\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 {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocTitle\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport type { CommandTree } from \"@shell-shock/core\";\nimport { CommandValidationLogic } from \"@shell-shock/core/components/command-validation-logic\";\nimport { IsDebug } from \"@shell-shock/core/components/helpers\";\nimport {\n CommandParserLogic,\n OptionsInterfaceDeclaration\n} from \"@shell-shock/core/components/options-parser-logic\";\nimport {\n getAppBin,\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport { findFilePath, relativePath } from \"@stryke/path/find\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replaceExtension } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\nimport { VirtualCommandEntry } from \"./virtual-command-entry\";\n\nexport function CommandInvocation(props: { command: CommandTree }) {\n const { command } = props;\n\n return (\n <>\n {code` return withCommand(\"${command.path}\", [${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? camelCase(getDynamicPathSegmentName(segment))\n : `\"${segment}\"`\n )\n .join(\", \")}], [${\n Object.keys(command.options).length > 0 ? `options` : \"\"\n }${\n command.args.length > 0\n ? `${\n Object.keys(command.options).length > 0 ? \", \" : \"\"\n }${command.args.map(arg => camelCase(arg.name)).join(\", \")}`\n : \"\"\n }], handle${pascalCase(command.name)}); `}\n <hbr />\n </>\n );\n}\n\nexport interface CommandHandlerDeclarationProps {\n command: CommandTree;\n banner?: Children;\n children?: Children;\n}\n\n/**\n * A component that generates the `handler` function declaration for a command.\n */\nexport function CommandHandlerDeclaration(\n props: CommandHandlerDeclarationProps\n) {\n const { command, banner, children } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <OptionsInterfaceDeclaration command={command} />\n <Spacing />\n <TSDoc\n heading={`The ${command.title} (${getAppBin(context)} ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `[${constantCase(getDynamicPathSegmentName(segment))}]`\n : segment\n )\n .join(\" \")}) command.`}>\n <TSDocRemarks>{`${command.description.replace(/\\.+$/, \"\")}.`}</TSDocRemarks>\n <hbr />\n <TSDocTitle>{command.title}</TSDocTitle>\n <TSDocParam name=\"args\">{`The command-line arguments passed to the command.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"handler\"\n parameters={[{ name: \"args\", type: \"string[]\", default: \"useArgs()\" }]}>\n <CommandParserLogic\n command={command}\n appSpecificEnvPrefix={context.config.appSpecificEnvPrefix}\n isCaseSensitive={context.config.isCaseSensitive}\n />\n <Spacing />\n <Show when={Boolean(banner)}>{banner}</Show>\n <Spacing />\n {code`writeLine(\"\");`}\n <IfStatement condition={<IsDebug />}>\n {code`writeLine(textColors.body.tertiary(\"Debug mode is enabled. Additional debug information may be logged to the console.\"));\n writeLine(\"\");\n debug(\\`Command path: ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `\\${${camelCase(getDynamicPathSegmentName(segment))}}`\n : segment\n )\n .join(\" / \")} \\\\n\\\\nOptions: \\\\n${Object.values(command.options)\n .map(\n option =>\n ` - ${kebabCase(option.name)}: \\${options.${camelCase(\n option.name\n )} === undefined ? \"\" : JSON.stringify(options.${camelCase(\n option.name\n )})}`\n )\n .join(\"\\\\n\")}${\n command.args.length > 0\n ? ` \\\\n\\\\nArguments: \\\\n${command.args\n .map(\n arg =>\n ` - ${kebabCase(arg.name)}: \\${${camelCase(\n arg.name\n )} === undefined ? \"\" : JSON.stringify(${camelCase(\n arg.name\n )})}`\n )\n .join(\"\\\\n\")}`\n : \"\"\n }\\`); `}\n </IfStatement>\n <Spacing />\n {children}\n <Spacing />\n <IfStatement condition={code`options.help`}>\n {code`return showHelp(); `}\n </IfStatement>\n <ElseClause>\n <hbr />\n <CommandInvocation command={command} />\n </ElseClause>\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface CommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The command entry point for the Shell Shock project.\n */\nexport function CommandEntry(props: CommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n const commandSourcePath = computed(() =>\n replaceExtension(\n relativePath(\n joinPaths(context.entryPath, findFilePath(filePath.value)),\n command.entry.input?.file || command.entry.file\n )\n )\n );\n const typeDefinition = computed(() => ({\n ...command.entry,\n output: command.id\n }));\n\n return (\n <>\n <EntryFile\n {...rest}\n path={filePath.value}\n typeDefinition={typeDefinition.value}\n imports={defu(imports ?? {}, {\n [commandSourcePath.value.startsWith(\".\")\n ? commandSourcePath.value\n : `./${commandSourcePath.value}`]:\n `handle${pascalCase(command.name)}`\n })}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"env\", \"isDevelopment\", \"isDebug\"],\n console: [\"debug\", \"warn\", \"error\", \"writeLine\", \"textColors\"],\n utils: [\"isMinimal\", \"isUnicodeSupported\"],\n state: [\n \"useGlobal\",\n \"GlobalOptions\",\n \"useGlobalOptions\",\n \"useArgs\",\n \"hasFlag\",\n \"withCommand\"\n ],\n [joinPaths(\n \"help\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showHelp\"],\n [joinPaths(\n \"banner\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showBanner\"]\n })}>\n <Spacing />\n <OptionsInterfaceDeclaration command={command} />\n <Spacing />\n <CommandHandlerDeclaration\n command={command}\n banner={code`await showBanner(); `}>\n <CommandValidationLogic command={command} />\n <IfStatement condition={code`failures.length > 0`}>\n {code`error(\\`The following validation failures were found while processing the user provided input, and must be corrected before the \\${italic(\"${\n command.title\n }\")} command can be executed: \\\\n\\\\n\\${failures.map(failure => \" - \" + failure).join(\"\\\\n\")}\\`);\n options.help = true; `}\n </IfStatement>\n </CommandHandlerDeclaration>\n </EntryFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,SAAO,kBAAA,OAEL;CACA,MAAA,EACA,YACI;AACN,QAAS,4CAAY,mBAAM,wBAAkB,Q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;GAEJ,IAAA,WAAA;AACD,2DAAA,8DAAA,EACK,SAAA,OACD,CAAA;;GAEF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-entry.d.cts","names":[],"sources":["../../src/components/command-entry.tsx"],"mappings":";;;;;iBA0DgB,iBAAA,CAAkB,KAAA;EAAS,OAAA,EAAS,WAAA;AAAA,IAAa,QAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"command-entry.d.cts","names":[],"sources":["../../src/components/command-entry.tsx"],"mappings":";;;;;iBA0DgB,iBAAA,CAAkB,KAAA;EAAS,OAAA,EAAS,WAAA;AAAA,IAAa,QAAA;AAAA,UAyBhD,8BAAA;EACf,OAAA,EAAS,WAAA;EACT,MAAA,GAAS,QAAA;EACT,QAAA,GAAW,QAAA;AAAA;;;;iBAMG,yBAAA,CACd,KAAA,EAAO,8BAAA,GAA8B,QAAA;AAAA,UAqFtB,iBAAA,SAA0B,IAAA,CACzC,cAAA;EAGA,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,YAAA,CAAa,KAAA,EAAO,iBAAA,GAAiB,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-entry.d.mts","names":[],"sources":["../../src/components/command-entry.tsx"],"mappings":";;;;;iBA0DgB,iBAAA,CAAkB,KAAA;EAAS,OAAA,EAAS,WAAA;AAAA,IAAa,QAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"command-entry.d.mts","names":[],"sources":["../../src/components/command-entry.tsx"],"mappings":";;;;;iBA0DgB,iBAAA,CAAkB,KAAA;EAAS,OAAA,EAAS,WAAA;AAAA,IAAa,QAAA;AAAA,UAyBhD,8BAAA;EACf,OAAA,EAAS,WAAA;EACT,MAAA,GAAS,QAAA;EACT,QAAA,GAAW,QAAA;AAAA;;;;iBAMG,yBAAA,CACd,KAAA,EAAO,8BAAA,GAA8B,QAAA;AAAA,UAqFtB,iBAAA,SAA0B,IAAA,CACzC,cAAA;EAGA,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,YAAA,CAAa,KAAA,EAAO,iBAAA,GAAiB,QAAA"}
|
|
@@ -22,7 +22,7 @@ import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
|
22
22
|
//#region src/components/command-entry.tsx
|
|
23
23
|
function CommandInvocation(props) {
|
|
24
24
|
const { command } = props;
|
|
25
|
-
return [memo(() => code` return withCommand("${command.path}", [${command.segments.map((segment) => isDynamicPathSegment(segment) ? camelCase(getDynamicPathSegmentName(segment)) : `"${segment}"`).join(", ")}], [options${command.args.length > 0 ?
|
|
25
|
+
return [memo(() => code` return withCommand("${command.path}", [${command.segments.map((segment) => isDynamicPathSegment(segment) ? camelCase(getDynamicPathSegmentName(segment)) : `"${segment}"`).join(", ")}], [${Object.keys(command.options).length > 0 ? `options` : ""}${command.args.length > 0 ? `${Object.keys(command.options).length > 0 ? ", " : ""}${command.args.map((arg) => camelCase(arg.name)).join(", ")}` : ""}], handle${pascalCase(command.name)}); `), createIntrinsic("hbr", {})];
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* A component that generates the `handler` function declaration for a command.
|
|
@@ -81,18 +81,17 @@ function CommandHandlerDeclaration(props) {
|
|
|
81
81
|
children: banner
|
|
82
82
|
}),
|
|
83
83
|
createComponent(Spacing, {}),
|
|
84
|
+
code`writeLine("");`,
|
|
84
85
|
createComponent(IfStatement, {
|
|
85
86
|
get condition() {
|
|
86
87
|
return createComponent(IsDebug, {});
|
|
87
88
|
},
|
|
88
89
|
get children() {
|
|
89
|
-
return code`writeLine("");
|
|
90
|
-
writeLine(textColors.body.tertiary("Debug mode is enabled. Additional debug information may be logged to the console."));
|
|
90
|
+
return code`writeLine(textColors.body.tertiary("Debug mode is enabled. Additional debug information may be logged to the console."));
|
|
91
91
|
writeLine("");
|
|
92
92
|
debug(\`Command path: ${command.segments.map((segment) => isDynamicPathSegment(segment) ? `\${${camelCase(getDynamicPathSegmentName(segment))}}` : segment).join(" / ")} \\n\\nOptions: \\n${Object.values(command.options).map((option) => ` - ${kebabCase(option.name)}: \${options.${camelCase(option.name)} === undefined ? "" : JSON.stringify(options.${camelCase(option.name)})}`).join("\\n")}${command.args.length > 0 ? ` \\n\\nArguments: \\n${command.args.map((arg) => ` - ${kebabCase(arg.name)}: \${${camelCase(arg.name)} === undefined ? "" : JSON.stringify(${camelCase(arg.name)})}`).join("\\n")}` : ""}\`); `;
|
|
93
93
|
}
|
|
94
94
|
}),
|
|
95
|
-
createComponent(ElseClause, { children: code`writeLine("");` }),
|
|
96
95
|
createComponent(Spacing, {}),
|
|
97
96
|
children,
|
|
98
97
|
createComponent(Spacing, {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-entry.mjs","names":[],"sources":["../../src/components/command-entry.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, computed, For, Show } from \"@alloy-js/core\";\nimport {\n ElseClause,\n FunctionDeclaration,\n IfStatement\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\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 {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocTitle\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport type { CommandTree } from \"@shell-shock/core\";\nimport { CommandValidationLogic } from \"@shell-shock/core/components/command-validation-logic\";\nimport { IsDebug } from \"@shell-shock/core/components/helpers\";\nimport {\n CommandParserLogic,\n OptionsInterfaceDeclaration\n} from \"@shell-shock/core/components/options-parser-logic\";\nimport {\n getAppBin,\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport { findFilePath, relativePath } from \"@stryke/path/find\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replaceExtension } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\nimport { VirtualCommandEntry } from \"./virtual-command-entry\";\n\nexport function CommandInvocation(props: { command: CommandTree }) {\n const { command } = props;\n\n return (\n <>\n {code` return withCommand(\"${command.path}\", [${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? camelCase(getDynamicPathSegmentName(segment))\n : `\"${segment}\"`\n )\n .join(\", \")}], [options${\n command.args.length > 0\n ? `, ${command.args.map(arg => camelCase(arg.name)).join(\", \")}`\n : \"\"\n }], handle${pascalCase(command.name)}); `}\n <hbr />\n </>\n );\n}\n\nexport interface CommandHandlerDeclarationProps {\n command: CommandTree;\n banner?: Children;\n children?: Children;\n}\n\n/**\n * A component that generates the `handler` function declaration for a command.\n */\nexport function CommandHandlerDeclaration(\n props: CommandHandlerDeclarationProps\n) {\n const { command, banner, children } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <OptionsInterfaceDeclaration command={command} />\n <Spacing />\n <TSDoc\n heading={`The ${command.title} (${getAppBin(context)} ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `[${constantCase(getDynamicPathSegmentName(segment))}]`\n : segment\n )\n .join(\" \")}) command.`}>\n <TSDocRemarks>{`${command.description.replace(/\\.+$/, \"\")}.`}</TSDocRemarks>\n <hbr />\n <TSDocTitle>{command.title}</TSDocTitle>\n <TSDocParam name=\"args\">{`The command-line arguments passed to the command.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"handler\"\n parameters={[{ name: \"args\", type: \"string[]\", default: \"useArgs()\" }]}>\n <CommandParserLogic\n command={command}\n appSpecificEnvPrefix={context.config.appSpecificEnvPrefix}\n isCaseSensitive={context.config.isCaseSensitive}\n />\n <Spacing />\n <Show when={Boolean(banner)}>{banner}</Show>\n <Spacing />\n <IfStatement condition={<IsDebug />}>\n {code`writeLine(\"\");\n writeLine(textColors.body.tertiary(\"Debug mode is enabled. Additional debug information may be logged to the console.\"));\n writeLine(\"\");\n debug(\\`Command path: ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `\\${${camelCase(getDynamicPathSegmentName(segment))}}`\n : segment\n )\n .join(\" / \")} \\\\n\\\\nOptions: \\\\n${Object.values(command.options)\n .map(\n option =>\n ` - ${kebabCase(option.name)}: \\${options.${camelCase(\n option.name\n )} === undefined ? \"\" : JSON.stringify(options.${camelCase(\n option.name\n )})}`\n )\n .join(\"\\\\n\")}${\n command.args.length > 0\n ? ` \\\\n\\\\nArguments: \\\\n${command.args\n .map(\n arg =>\n ` - ${kebabCase(arg.name)}: \\${${camelCase(\n arg.name\n )} === undefined ? \"\" : JSON.stringify(${camelCase(\n arg.name\n )})}`\n )\n .join(\"\\\\n\")}`\n : \"\"\n }\\`); `}\n </IfStatement>\n <ElseClause>{code`writeLine(\"\");`}</ElseClause>\n <Spacing />\n {children}\n <Spacing />\n <IfStatement condition={code`options.help`}>\n {code`return showHelp(); `}\n </IfStatement>\n <ElseClause>\n <hbr />\n <CommandInvocation command={command} />\n </ElseClause>\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface CommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The command entry point for the Shell Shock project.\n */\nexport function CommandEntry(props: CommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n const commandSourcePath = computed(() =>\n replaceExtension(\n relativePath(\n joinPaths(context.entryPath, findFilePath(filePath.value)),\n command.entry.input?.file || command.entry.file\n )\n )\n );\n const typeDefinition = computed(() => ({\n ...command.entry,\n output: command.id\n }));\n\n return (\n <>\n <EntryFile\n {...rest}\n path={filePath.value}\n typeDefinition={typeDefinition.value}\n imports={defu(imports ?? {}, {\n [commandSourcePath.value.startsWith(\".\")\n ? commandSourcePath.value\n : `./${commandSourcePath.value}`]:\n `handle${pascalCase(command.name)}`\n })}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"env\", \"isDevelopment\", \"isDebug\"],\n console: [\"debug\", \"warn\", \"error\", \"writeLine\", \"textColors\"],\n utils: [\"isMinimal\", \"isUnicodeSupported\"],\n state: [\n \"useGlobal\",\n \"GlobalOptions\",\n \"useGlobalOptions\",\n \"useArgs\",\n \"hasFlag\",\n \"withCommand\"\n ],\n [joinPaths(\n \"help\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showHelp\"],\n [joinPaths(\n \"banner\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showBanner\"]\n })}>\n <Spacing />\n <OptionsInterfaceDeclaration command={command} />\n <Spacing />\n <CommandHandlerDeclaration\n command={command}\n banner={code`await showBanner(); `}>\n <CommandValidationLogic command={command} />\n <IfStatement condition={code`failures.length > 0`}>\n {code`error(\\`The following validation failures were found while processing the user provided input, and must be corrected before the \\${italic(\"${\n command.title\n }\")} command can be executed: \\\\n\\\\n\\${failures.map(failure => \" - \" + failure).join(\"\\\\n\")}\\`);\n options.help = true; `}\n </IfStatement>\n </CommandHandlerDeclaration>\n </EntryFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0CA,SAAO,kBAAA,OAEL;CACA,MAAA,EACA,YACI;AACN,QAAS,CAAA,WAAY,IAAM,wBAAkB,QAAA,KAAA,MAAA,QAAA,SAAA,KAAA,YAAA,qBAAA,QAAA,GAAA,UAAA,0BAAA,QAAA,CAAA,GAAA,IAAA,QAAA,GAAA,CAAA,KAAA,KAAA,CAAA,aAAA,QAAA,KAAA,SAAA,IAAA,KAAA,QAAA,KAAA,KAAA,QAAA,UAAA,IAAA,KAAA,CAAA,CAAA,KAAA,KAAA,KAAA,GAAA,WAAA,WAAA,QAAA,KAAA,CAAA,KAAA,EAAA,gBAAA,OAAA,EAAA,CAAA,CAAA;;;;;AAW7C,SAAU,0BAAiB,OAAA;SAEzB,SACE,QACA,aACE;CACJ,MAAM,UAAE,eAA4B;AACpC,QAAO;EAAC,gBAAc,6BAAiC,EAC5C,SACV,CAAC;EAAE,gBAAE,SAAA,EAAA,CAAA;EAAA,gBAAA,OAAA;GACJ,IAAI,UAAU;AACZ,WAAE,OAAY,QAAQ,MAAE,IAAA,UAAA,QAAA,CAAA,GAAA,QAAA,SAAA,KAAA,YAAA,qBAAA,QAAA,GAAA,IAAA,aAAA,0BAAA,QAAA,CAAA,CAAA,KAAA,QAAA,CAAA,KAAA,IAAA,CAAA;;GAE1B,IAAI,WAAK;AACP,WAAI;KAAA,gBAAmB,cAAiB,EACvC,IAAK,WAAA;AACN,aAAA,GAAA,QAAA,YAAA,QAAA,QAAA,GAAA,CAAA;QAEN,CAAA;KAAA,gBAAA,OAAA,EAAA,CAAA;KAAA,gBAAA,YAAA;AAEO,aAAU,QAAA;QAEf,CAAM;KAAE,gBAAS,YAAA;MACjB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AAA;IAAA,gBAAA,SAAA,EAAA,CAAA;IAAA,gBAAA,6BAAA,EACS,SACX,CAAA;IAAA,gBAAA,SAAA,EAAA,CAAA;IAAA,gBAAA,2BAAA;;KAEE,QAAA,IAAA;KACK,IAAA,WAAc;AACnB,aAAA,CAAA,gBAAA,wBAAA,EACc,SACN,CAAA,EAAA,gBAAkB,aAAiB;;OAErC,IAAQ,WAAE;AACV,eAAW,IAAA,8IAAa,QAAA,MAAA;;;OAGvB,CAAA,CAAA;;KAEF,CAAA;IAAA;;EAEJ,CAAA,CAAA,EAAA,gBAAA,KAAA;EACD,IAAM,OAAA;AACJ,UAAA,OAAgB,OAAA,QAAA,SAAA;;EAEhB,WAAI,UAAU,gBAAmB,MAAA;GAC/B,IAAE,OAAQ;AACV,WAAA,MAAA;;GAEH,IAAA,WAAA;AACK,WAAA,gBAAyB,cAAQ,EAClC,SAAQ,OACX,CAAM;;;AAGF,WAAC,gBAAA,qBAAA,EACJ,SAAA,OACE,CAAA;;GAEF,CAAC;EACH,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"command-entry.mjs","names":[],"sources":["../../src/components/command-entry.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, computed, For, Show } from \"@alloy-js/core\";\nimport {\n ElseClause,\n FunctionDeclaration,\n IfStatement\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\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 {\n TSDoc,\n TSDocParam,\n TSDocRemarks,\n TSDocTitle\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport type { CommandTree } from \"@shell-shock/core\";\nimport { CommandValidationLogic } from \"@shell-shock/core/components/command-validation-logic\";\nimport { IsDebug } from \"@shell-shock/core/components/helpers\";\nimport {\n CommandParserLogic,\n OptionsInterfaceDeclaration\n} from \"@shell-shock/core/components/options-parser-logic\";\nimport {\n getAppBin,\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"@shell-shock/core/plugin-utils\";\nimport { findFilePath, relativePath } from \"@stryke/path/find\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replaceExtension } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport defu from \"defu\";\nimport type { ScriptPresetContext } from \"../types/plugin\";\nimport { VirtualCommandEntry } from \"./virtual-command-entry\";\n\nexport function CommandInvocation(props: { command: CommandTree }) {\n const { command } = props;\n\n return (\n <>\n {code` return withCommand(\"${command.path}\", [${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? camelCase(getDynamicPathSegmentName(segment))\n : `\"${segment}\"`\n )\n .join(\", \")}], [${\n Object.keys(command.options).length > 0 ? `options` : \"\"\n }${\n command.args.length > 0\n ? `${\n Object.keys(command.options).length > 0 ? \", \" : \"\"\n }${command.args.map(arg => camelCase(arg.name)).join(\", \")}`\n : \"\"\n }], handle${pascalCase(command.name)}); `}\n <hbr />\n </>\n );\n}\n\nexport interface CommandHandlerDeclarationProps {\n command: CommandTree;\n banner?: Children;\n children?: Children;\n}\n\n/**\n * A component that generates the `handler` function declaration for a command.\n */\nexport function CommandHandlerDeclaration(\n props: CommandHandlerDeclarationProps\n) {\n const { command, banner, children } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n\n return (\n <>\n <OptionsInterfaceDeclaration command={command} />\n <Spacing />\n <TSDoc\n heading={`The ${command.title} (${getAppBin(context)} ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `[${constantCase(getDynamicPathSegmentName(segment))}]`\n : segment\n )\n .join(\" \")}) command.`}>\n <TSDocRemarks>{`${command.description.replace(/\\.+$/, \"\")}.`}</TSDocRemarks>\n <hbr />\n <TSDocTitle>{command.title}</TSDocTitle>\n <TSDocParam name=\"args\">{`The command-line arguments passed to the command.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"handler\"\n parameters={[{ name: \"args\", type: \"string[]\", default: \"useArgs()\" }]}>\n <CommandParserLogic\n command={command}\n appSpecificEnvPrefix={context.config.appSpecificEnvPrefix}\n isCaseSensitive={context.config.isCaseSensitive}\n />\n <Spacing />\n <Show when={Boolean(banner)}>{banner}</Show>\n <Spacing />\n {code`writeLine(\"\");`}\n <IfStatement condition={<IsDebug />}>\n {code`writeLine(textColors.body.tertiary(\"Debug mode is enabled. Additional debug information may be logged to the console.\"));\n writeLine(\"\");\n debug(\\`Command path: ${command.segments\n .map(segment =>\n isDynamicPathSegment(segment)\n ? `\\${${camelCase(getDynamicPathSegmentName(segment))}}`\n : segment\n )\n .join(\" / \")} \\\\n\\\\nOptions: \\\\n${Object.values(command.options)\n .map(\n option =>\n ` - ${kebabCase(option.name)}: \\${options.${camelCase(\n option.name\n )} === undefined ? \"\" : JSON.stringify(options.${camelCase(\n option.name\n )})}`\n )\n .join(\"\\\\n\")}${\n command.args.length > 0\n ? ` \\\\n\\\\nArguments: \\\\n${command.args\n .map(\n arg =>\n ` - ${kebabCase(arg.name)}: \\${${camelCase(\n arg.name\n )} === undefined ? \"\" : JSON.stringify(${camelCase(\n arg.name\n )})}`\n )\n .join(\"\\\\n\")}`\n : \"\"\n }\\`); `}\n </IfStatement>\n <Spacing />\n {children}\n <Spacing />\n <IfStatement condition={code`options.help`}>\n {code`return showHelp(); `}\n </IfStatement>\n <ElseClause>\n <hbr />\n <CommandInvocation command={command} />\n </ElseClause>\n </FunctionDeclaration>\n </>\n );\n}\n\nexport interface CommandEntryProps extends Omit<\n EntryFileProps,\n \"path\" | \"typeDefinition\"\n> {\n command: CommandTree;\n}\n\n/**\n * The command entry point for the Shell Shock project.\n */\nexport function CommandEntry(props: CommandEntryProps) {\n const { command, imports, builtinImports, ...rest } = props;\n\n const context = usePowerlines<ScriptPresetContext>();\n const filePath = computed(() =>\n joinPaths(\n command.segments\n .filter(segment => !isDynamicPathSegment(segment))\n .join(\"/\"),\n \"index.ts\"\n )\n );\n const commandSourcePath = computed(() =>\n replaceExtension(\n relativePath(\n joinPaths(context.entryPath, findFilePath(filePath.value)),\n command.entry.input?.file || command.entry.file\n )\n )\n );\n const typeDefinition = computed(() => ({\n ...command.entry,\n output: command.id\n }));\n\n return (\n <>\n <EntryFile\n {...rest}\n path={filePath.value}\n typeDefinition={typeDefinition.value}\n imports={defu(imports ?? {}, {\n [commandSourcePath.value.startsWith(\".\")\n ? commandSourcePath.value\n : `./${commandSourcePath.value}`]:\n `handle${pascalCase(command.name)}`\n })}\n builtinImports={defu(builtinImports ?? {}, {\n env: [\"env\", \"isDevelopment\", \"isDebug\"],\n console: [\"debug\", \"warn\", \"error\", \"writeLine\", \"textColors\"],\n utils: [\"isMinimal\", \"isUnicodeSupported\"],\n state: [\n \"useGlobal\",\n \"GlobalOptions\",\n \"useGlobalOptions\",\n \"useArgs\",\n \"hasFlag\",\n \"withCommand\"\n ],\n [joinPaths(\n \"help\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showHelp\"],\n [joinPaths(\n \"banner\",\n ...command.segments.filter(\n segment => !isDynamicPathSegment(segment)\n )\n )]: [\"showBanner\"]\n })}>\n <Spacing />\n <OptionsInterfaceDeclaration command={command} />\n <Spacing />\n <CommandHandlerDeclaration\n command={command}\n banner={code`await showBanner(); `}>\n <CommandValidationLogic command={command} />\n <IfStatement condition={code`failures.length > 0`}>\n {code`error(\\`The following validation failures were found while processing the user provided input, and must be corrected before the \\${italic(\"${\n command.title\n }\")} command can be executed: \\\\n\\\\n\\${failures.map(failure => \" - \" + failure).join(\"\\\\n\")}\\`);\n options.help = true; `}\n </IfStatement>\n </CommandHandlerDeclaration>\n </EntryFile>\n <For each={Object.values(command.children)}>\n {child => (\n <Show\n when={child.isVirtual}\n fallback={<CommandEntry command={child} />}>\n <VirtualCommandEntry command={child} />\n </Show>\n )}\n </For>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0CA,SAAO,kBAAA,OAEL;CACA,MAAA,EACA,YACI;AACN,QAAS,CAAA,WAAY,IAAM,wBAAkB,QAAA,KAAA,MAAA,QAAA,SAAA,KAAA,YAAA,qBAAA,QAAA,GAAA,UAAA,0BAAA,QAAA,CAAA,GAAA,IAAA,QAAA,GAAA,CAAA,KAAA,KAAA,CAAA,MAAA,OAAA,KAAA,QAAA,QAAA,CAAA,SAAA,IAAA,YAAA,KAAA,QAAA,KAAA,SAAA,IAAA,GAAA,OAAA,KAAA,QAAA,QAAA,CAAA,SAAA,IAAA,OAAA,KAAA,QAAA,KAAA,KAAA,QAAA,UAAA,IAAA,KAAA,CAAA,CAAA,KAAA,KAAA,KAAA,GAAA,WAAA,WAAA,QAAA,KAAA,CAAA,KAAA,EAAA,gBAAA,OAAA,EAAA,CAAA,CAAA;;;;;AAW7C,SAAU,0BAAiB,OAAA;SAEzB,SACE,QACA,aACE;CACJ,MAAM,UAAE,eAA4B;AACpC,QAAO;EAAC,gBAAc,6BAAiC,EAC5C,SACV,CAAC;EAAE,gBAAE,SAAA,EAAA,CAAA;EAAA,gBAAA,OAAA;GACJ,IAAI,UAAU;AACZ,WAAE,OAAY,QAAQ,MAAA,IAAS,UAA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EAAA;IACV,KAAC;KAAA;KAAY;KAAgB;KAAQ;IACrC,SAAQ;KAAA;KAAO;KAAY;KAAC;KAAA;KAAA;IAC5B,OAAE,CAAA,aAAW,qBAAA;IACb,OAAC;KAAA;KAAU;KAAA;KAAA;KAAA;KAAA;KAAA;KACV,UAAO,QAAA,GAAA,QAAA,SAAA,QAAA,YAAA,CAAA,qBAAA,QAAA,CAAA,CAAA,GAAA,CAAA,WAAA;KACP,UAAE,UAAkB,GAAA,QAAS,SAAU,QAAA,YAAA,CAAA,qBAAA,QAAA,CAAA,CAAA,GAAA,CAAA,aAAA;IACzC,CAAC;;EAEJ,IAAE,WAAA;AACH,UAAA;IAAA,gBAAA,SAAA,EAAA,CAAA;IAAA,gBAAA,6BAAA,EACH;;;KAEiB;KACf,QAAc,IAAA;KACR,IAAI,WAAA;AACV,aAAA,CAAA,gBAAA,wBAAA,EACS,SACX,CAAA,EAAA,gBAAA,aAAA;;OAEE,IAAA,WAAA;AACY,eAAO,IAAA,8IAAiC,QAAA,MAAA;;;OAG5C,CAAA,CAAA;;KAEH,CAAC;IAAA;;EAEL,CAAC,CAAA,EAAA,gBAAS,KAAA;EACT,IAAE,OAAQ;AACR,UAAG,OAAO,OAAW,QAAC,SAAA;;EAExB,WAAS,UAAE,gBAAA,MAAA;GACX,IAAA,OAAA;AACD,WAAA,MAAA;;GAEC,IAAA,WAAgB;AACd,WAAA,gBAAY,cAAA,EACV,SAAU,OACV,CAAA;;GAEJ,IAAA,WAAA;AACD,WAAA,gBAAA,qBAAA,EACK,SAAA,OACD,CAAA;;GAEF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shell-shock/preset-script",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.61",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Shell Shock preset that generates a fully-featured script application.",
|
|
6
6
|
"keywords": [
|
|
@@ -195,25 +195,25 @@
|
|
|
195
195
|
"dependencies": {
|
|
196
196
|
"@alloy-js/core": "0.23.0-dev.8",
|
|
197
197
|
"@alloy-js/typescript": "0.23.0-dev.4",
|
|
198
|
-
"@powerlines/deepkit": "^0.8.
|
|
199
|
-
"@powerlines/plugin-alloy": "^0.26.
|
|
200
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
201
|
-
"@shell-shock/core": "^0.17.
|
|
202
|
-
"@shell-shock/plugin-banner": "^0.1.
|
|
203
|
-
"@shell-shock/plugin-help": "^0.2.
|
|
204
|
-
"@shell-shock/plugin-console": "^0.2.
|
|
205
|
-
"@shell-shock/plugin-theme": "^0.4.
|
|
198
|
+
"@powerlines/deepkit": "^0.8.2",
|
|
199
|
+
"@powerlines/plugin-alloy": "^0.26.18",
|
|
200
|
+
"@powerlines/plugin-plugin": "^0.12.350",
|
|
201
|
+
"@shell-shock/core": "^0.17.6",
|
|
202
|
+
"@shell-shock/plugin-banner": "^0.1.33",
|
|
203
|
+
"@shell-shock/plugin-help": "^0.2.24",
|
|
204
|
+
"@shell-shock/plugin-console": "^0.2.10",
|
|
205
|
+
"@shell-shock/plugin-theme": "^0.4.19",
|
|
206
206
|
"@stryke/helpers": "^0.10.8",
|
|
207
207
|
"@stryke/path": "^0.27.4",
|
|
208
208
|
"@stryke/string-format": "^0.17.9",
|
|
209
209
|
"defu": "^6.1.7",
|
|
210
|
-
"powerlines": "^0.42.
|
|
210
|
+
"powerlines": "^0.42.40"
|
|
211
211
|
},
|
|
212
212
|
"devDependencies": {
|
|
213
213
|
"@babel/core": "^7.29.0",
|
|
214
|
-
"@powerlines/plugin-alloy": "^0.26.
|
|
214
|
+
"@powerlines/plugin-alloy": "^0.26.18",
|
|
215
215
|
"@types/node": "^25.6.0"
|
|
216
216
|
},
|
|
217
217
|
"publishConfig": { "access": "public" },
|
|
218
|
-
"gitHead": "
|
|
218
|
+
"gitHead": "592aee8162fccb2d8547f6cf31b820aca3ae13ec"
|
|
219
219
|
}
|