@shell-shock/core 0.17.5 → 0.17.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +1 -1
  2. package/dist/components/command-validation-logic.cjs +214 -152
  3. package/dist/components/command-validation-logic.mjs +213 -152
  4. package/dist/components/command-validation-logic.mjs.map +1 -1
  5. package/dist/components/docs.cjs +113 -9
  6. package/dist/components/docs.mjs +109 -9
  7. package/dist/components/docs.mjs.map +1 -1
  8. package/dist/components/exec-builtin.cjs +36 -1
  9. package/dist/components/exec-builtin.d.cts.map +1 -1
  10. package/dist/components/exec-builtin.d.mts.map +1 -1
  11. package/dist/components/exec-builtin.mjs +35 -1
  12. package/dist/components/exec-builtin.mjs.map +1 -1
  13. package/dist/components/helpers.cjs +51 -2
  14. package/dist/components/helpers.mjs +50 -2
  15. package/dist/components/helpers.mjs.map +1 -1
  16. package/dist/components/index.cjs +17 -1
  17. package/dist/components/index.mjs +9 -9
  18. package/dist/components/options-parser-logic.cjs +411 -174
  19. package/dist/components/options-parser-logic.d.cts.map +1 -1
  20. package/dist/components/options-parser-logic.d.mts.map +1 -1
  21. package/dist/components/options-parser-logic.mjs +405 -174
  22. package/dist/components/options-parser-logic.mjs.map +1 -1
  23. package/dist/components/state-builtin.cjs +61 -5
  24. package/dist/components/state-builtin.mjs +60 -5
  25. package/dist/components/state-builtin.mjs.map +1 -1
  26. package/dist/components/usage.cjs +46 -3
  27. package/dist/components/usage.mjs +45 -3
  28. package/dist/components/usage.mjs.map +1 -1
  29. package/dist/components/utils-builtin.cjs +68 -3
  30. package/dist/components/utils-builtin.mjs +67 -3
  31. package/dist/components/utils-builtin.mjs.map +1 -1
  32. package/dist/helpers/automd.cjs +28 -13
  33. package/dist/helpers/automd.mjs +28 -13
  34. package/dist/helpers/automd.mjs.map +1 -1
  35. package/dist/index.cjs +11 -0
  36. package/dist/index.d.cts +2 -2
  37. package/dist/index.d.mts +2 -2
  38. package/dist/index.mjs +2 -2
  39. package/dist/plugin-utils/compute-bin.cjs +50 -0
  40. package/dist/plugin-utils/compute-bin.d.cts +13 -0
  41. package/dist/plugin-utils/compute-bin.d.cts.map +1 -0
  42. package/dist/plugin-utils/compute-bin.d.mts +13 -0
  43. package/dist/plugin-utils/compute-bin.d.mts.map +1 -0
  44. package/dist/plugin-utils/compute-bin.mjs +50 -0
  45. package/dist/plugin-utils/compute-bin.mjs.map +1 -0
  46. package/dist/plugin-utils/get-command-tree.cjs +50 -0
  47. package/dist/plugin-utils/get-command-tree.d.cts +15 -1
  48. package/dist/plugin-utils/get-command-tree.d.cts.map +1 -1
  49. package/dist/plugin-utils/get-command-tree.d.mts +15 -1
  50. package/dist/plugin-utils/get-command-tree.d.mts.map +1 -1
  51. package/dist/plugin-utils/get-command-tree.mjs +49 -1
  52. package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
  53. package/dist/plugin-utils/index.cjs +4 -0
  54. package/dist/plugin-utils/index.d.cts +3 -2
  55. package/dist/plugin-utils/index.d.mts +3 -2
  56. package/dist/plugin-utils/index.mjs +3 -2
  57. package/dist/plugin.cjs +170 -52
  58. package/dist/plugin.mjs +170 -52
  59. package/dist/plugin.mjs.map +1 -1
  60. package/dist/resolver/deepkit.cjs +1 -1
  61. package/dist/resolver/deepkit.mjs +1 -1
  62. package/dist/resolver/deepkit.mjs.map +1 -1
  63. package/dist/types/command.cjs +120 -10
  64. package/dist/types/command.d.cts +95 -8
  65. package/dist/types/command.d.cts.map +1 -1
  66. package/dist/types/command.d.mts +95 -8
  67. package/dist/types/command.d.mts.map +1 -1
  68. package/dist/types/command.mjs +109 -10
  69. package/dist/types/command.mjs.map +1 -1
  70. package/dist/types/index.cjs +12 -1
  71. package/dist/types/index.d.cts +2 -2
  72. package/dist/types/index.d.mts +2 -2
  73. package/dist/types/index.mjs +2 -2
  74. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"options-parser-logic.mjs","names":[],"sources":["../../src/components/options-parser-logic.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 ElseClause,\n ElseIfClause,\n IfStatement,\n InterfaceDeclaration,\n InterfaceMember,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport type { PartialKeys } from \"@stryke/types/base\";\nimport { computedOptions } from \"../contexts/options\";\nimport {\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"../plugin-utils/context-helpers\";\nimport type {\n BooleanCommandOption,\n CommandOption,\n CommandTree,\n NumberCommandParameter,\n StringCommandParameter\n} from \"../types/command\";\nimport { CommandParameterKinds } from \"../types/command\";\nimport { BooleanInputParserLogic, CommandParameterType } from \"./helpers\";\n\nexport interface DynamicSegmentsParserLogicProps {\n /**\n * The command to generate the dynamic path segments parser logic for. This is used to access the command options and parameters when generating the parser logic for dynamic path segments.\n */\n command: CommandTree;\n\n /**\n * Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.\n */\n isCaseSensitive: boolean;\n}\n\nexport function DynamicSegmentsParserLogic(\n props: DynamicSegmentsParserLogicProps\n) {\n const { command } = props;\n\n return (\n <For each={command.segments ?? []}>\n {(segment, index) => (\n <Show when={isDynamicPathSegment(segment)}>\n <VarDeclaration\n let\n name={camelCase(getDynamicPathSegmentName(segment))}\n type=\"string | undefined\"\n />\n <hbr />\n <IfStatement\n condition={code`args.length > ${2 + index} && args[${2 + index}]`}>\n {code`${camelCase(\n getDynamicPathSegmentName(segment)\n )} = args[${2 + index}];`}\n </IfStatement>\n <hbr />\n <hbr />\n </Show>\n )}\n </For>\n );\n}\n\nexport interface ArgumentsParserLogicProps {\n /**\n * The command to generate the positional parameters parser logic for.\n */\n command: CommandTree;\n\n /**\n * The environment variable prefix to use for options that have an associated environment variable. This prefix will be used in the generated code to access the environment variables (e.g., `env.${appSpecificEnvPrefix}_OPTION_NAME`).\n */\n appSpecificEnvPrefix: string;\n\n /**\n * Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.\n */\n isCaseSensitive: boolean;\n}\n\nexport function ArgumentsParserLogic(props: ArgumentsParserLogicProps) {\n const { command, appSpecificEnvPrefix, isCaseSensitive } = props;\n\n return (\n <Show when={command.args && command.args.length > 0}>\n <VarDeclaration\n let\n name=\"optionsIndex\"\n type=\"number\"\n initializer={code`Math.max(0, args.slice(${\n command.segments.length + 1\n }).findIndex(arg => arg.startsWith(\"-\") && /^(${Object.values(\n command.options ?? {}\n )\n .map(\n option =>\n `${\n isCaseSensitive || option.name.length === 1\n ? option.name\n : option.name\n .toLowerCase()\n .replaceAll(\"-\", \"\")\n .replaceAll(\"_\", \"\")\n }${option.alias && option.alias.length > 0 ? \"|\" : \"\"}${option.alias\n ?.map(a =>\n (isCaseSensitive || option.name.length === 1\n ? a\n : a\n .toLowerCase()\n .replaceAll(\"-\", \"\")\n .replaceAll(\"_\", \"\")) === \"?\"\n ? \"\\\\?\"\n : isCaseSensitive || option.name.length === 1\n ? a\n : a.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")\n )\n .join(\"|\")}`\n )\n .join(\"|\")})=?.*$/.test(arg${\n isCaseSensitive\n ? \"\"\n : '.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'\n }))) + ${command.segments.length + 1};`}\n />\n <Spacing />\n <VarDeclaration\n let\n name=\"argsIndex\"\n type=\"number\"\n initializer={code`optionsIndex > ${\n command.segments.length + 1\n } ? ${command.segments.length + 1} : (Math.max(0, args.slice(optionsIndex).findLastIndex(arg => arg.startsWith(\"-\") && /^(${Object.values(\n command.options ?? {}\n )\n .map(\n option =>\n `${\n isCaseSensitive || option.name.length === 1\n ? option.name\n : option.name\n .toLowerCase()\n .replaceAll(\"-\", \"\")\n .replaceAll(\"_\", \"\")\n }${option.alias && option.alias.length > 0 ? \"|\" : \"\"}${option.alias\n ?.map(a =>\n (isCaseSensitive || option.name.length === 1\n ? a\n : a\n .toLowerCase()\n .replaceAll(\"-\", \"\")\n .replaceAll(\"_\", \"\")) === \"?\"\n ? \"\\\\?\"\n : isCaseSensitive || option.name.length === 1\n ? a\n : a.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")\n )\n .join(\"|\")}`\n )\n .join(\"|\")})=?.*$/.test(arg${\n isCaseSensitive\n ? \"\"\n : '.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'\n }))) + ${command.segments.length + 1});`}\n />\n <Spacing />\n <For each={command.args ?? []} hardline>\n {(arg, index) => (\n <>\n <Show\n when={\n isSetString(arg.env) ||\n arg.default !== undefined ||\n ((arg.kind === CommandParameterKinds.string ||\n arg.kind === CommandParameterKinds.number) &&\n arg.variadic)\n }\n fallback={\n <>\n {code`let ${camelCase(arg.name)}!: `}\n <CommandParameterType parameter={arg} />\n {code`; `}\n </>\n }>\n <VarDeclaration\n let\n name={camelCase(arg.name)}\n type={<CommandParameterType parameter={arg} />}\n initializer={\n <>\n {code` ( `}\n <Show when={isSetString(arg.env)}>\n {code`env.${appSpecificEnvPrefix}_${constantCase(String(arg.env))} ?? `}\n </Show>\n <Show\n when={arg.default !== undefined}\n fallback={arg.variadic ? code`[]` : code`undefined`}>\n {arg.kind === CommandParameterKinds.string\n ? code`\"${arg.default}\"`\n : code`${arg.default}`}\n </Show>\n {code`) as `}\n <CommandParameterType parameter={arg} />\n {code`; `}\n </>\n }\n />\n </Show>\n <Spacing />\n <IfStatement\n condition={code`argsIndex + ${index} < args.length && argsIndex + ${index} !== optionsIndex`}>\n {code`${camelCase(arg.name)} = `}\n <Show\n when={\n arg.kind === CommandParameterKinds.string ||\n arg.kind === CommandParameterKinds.number\n }\n fallback={\n <BooleanInputParserLogic\n name={`args[argsIndex + ${index}] `}\n />\n }>\n <Show\n when={arg.variadic}\n fallback={\n <Show\n when={arg.kind === CommandParameterKinds.number}\n fallback={code`args[argsIndex + ${index}] `}>\n {code`Number(args[argsIndex + ${index}]) `}\n </Show>\n }>\n {code`args.slice(argsIndex + ${\n index\n }, (optionsIndex > argsIndex ? optionsIndex : args.length) - ${\n command.args.length - index\n }).join(\" \").split(\",\").map(item => item.trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")).filter(Boolean)`}\n </Show>\n </Show>\n {code` as `}\n <CommandParameterType parameter={arg} />\n {code`; `}\n </IfStatement>\n <Spacing />\n </>\n )}\n </For>\n </Show>\n );\n}\n\n/**\n * The command option interface property.\n */\nexport function OptionsMember({ option }: { option: CommandOption }) {\n const doc = option.description || `The ${option.title} command option.`;\n\n return (\n <>\n <Show when={Boolean(option.name)}>\n <Show when={option.kind === CommandParameterKinds.string}>\n <InterfaceMember\n name={option.name}\n doc={doc}\n type={<CommandParameterType parameter={option} />}\n optional={option.optional}\n />\n </Show>\n <Show when={option.kind === CommandParameterKinds.number}>\n <InterfaceMember\n name={option.name}\n doc={doc}\n type={<CommandParameterType parameter={option} />}\n optional={option.optional}\n />\n </Show>\n <Show when={option.kind === CommandParameterKinds.boolean}>\n <InterfaceMember\n name={option.name}\n doc={doc}\n type={<CommandParameterType parameter={option} />}\n optional={option.optional}\n />\n </Show>\n </Show>\n </>\n );\n}\n\nexport interface OptionsMemberParserLogicProps {\n /**\n * The option name to generate the parser logic for.\n */\n name: string;\n\n /**\n * The command option to generate the parser logic for.\n */\n option: CommandOption;\n\n /**\n * Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.\n *\n * @defaultValue false\n */\n isCaseSensitive: boolean;\n}\n\n/**\n * The command option property parser logic.\n */\nexport function OptionsMemberParserLogic(props: OptionsMemberParserLogicProps) {\n const { name, option, isCaseSensitive } = props;\n\n const equalsRegex = `/^--?(${\n isCaseSensitive || name.length === 1\n ? name\n : name.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")\n }${option.alias && option.alias.length > 0 ? \"|\" : \"\"}${option.alias\n ?.map(a =>\n (isCaseSensitive || name.length === 1\n ? a\n : a.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")) === \"?\"\n ? \"\\\\?\"\n : isCaseSensitive || name.length === 1\n ? a\n : a.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")\n )\n .join(\"|\")})=/`;\n\n return (\n <>\n <Show\n when={\n option.kind === CommandParameterKinds.string ||\n option.kind === CommandParameterKinds.number\n }>\n <Show\n when={\n (option as StringCommandParameter | NumberCommandParameter).variadic\n }>\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name} ??= []; `}>\n {code`options[\"${name}\"] ??= []; `}\n </Show>\n <hbr />\n <IfStatement\n condition={`${equalsRegex}.test(${\n isCaseSensitive\n ? \"arg\"\n : '\"-\" + arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'\n })`}>\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name}.push(`}>\n {code`options[\"${name}\"].push(`}\n </Show>\n <Show when={option.kind === CommandParameterKinds.string}>\n {code`...arg.replace(${equalsRegex}, \"\").split(\",\").map(item => item.trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")).filter(Boolean) `}\n </Show>\n <Show when={option.kind === CommandParameterKinds.number}>\n {code`...arg.replace(${equalsRegex}, \"\").split(\",\").map(item => item.trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")).filter(Boolean).map(Number).filter(value => !Number.isNaN(value)) `}\n </Show>\n <Show\n when={\n (option.kind === CommandParameterKinds.string ||\n option.kind === CommandParameterKinds.number) &&\n option.choices &&\n option.choices.length > 0\n }>\n {code` as ${(\n option as StringCommandParameter | NumberCommandParameter\n ).choices\n ?.map(choice => (isSetString(choice) ? `\"${choice}\"` : choice))\n .join(\" | \")} `}\n </Show>\n {code`); `}\n </IfStatement>\n <ElseIfClause condition={`args.length > i + 1`}>\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name}.push(`}>\n {code`options[\"${name}\"].push(`}\n </Show>\n <Show when={option.kind === CommandParameterKinds.string}>\n {code`...args[++i].split(\",\").map(item => item.trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")).filter(Boolean) `}\n </Show>\n <Show when={option.kind === CommandParameterKinds.number}>\n {code`...args[++i].split(\",\").map(item => item.trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")).filter(Boolean).map(Number).filter(value => !Number.isNaN(value)) `}\n </Show>\n <Show\n when={\n (option.kind === CommandParameterKinds.string ||\n option.kind === CommandParameterKinds.number) &&\n option.choices &&\n option.choices.length > 0\n }>\n {code` as ${(\n option as StringCommandParameter | NumberCommandParameter\n ).choices\n ?.map(choice => (isSetString(choice) ? `\"${choice}\"` : choice))\n .join(\" | \")} `}\n </Show>\n {code`); `}\n </ElseIfClause>\n </Show>\n <Show\n when={\n !(option as StringCommandParameter | NumberCommandParameter)\n .variadic\n }>\n <IfStatement\n condition={`${equalsRegex}.test(${isCaseSensitive ? \"arg\" : '\"-\" + arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'})`}>\n <Show when={option.kind === CommandParameterKinds.string}>\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name}`}>\n {code`options[\"${name}\"]`}\n </Show>\n {code` = arg.replace(${equalsRegex}, \"\").trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")`}\n <Show\n when={\n (option as StringCommandParameter).choices &&\n (option as StringCommandParameter).choices!.length > 0\n }>\n {code` as ${(option as StringCommandParameter).choices\n ?.map(choice => `\"${choice}\"`)\n .join(\" | \")}`}\n </Show>\n {code`; `}\n </Show>\n <Show when={option.kind === CommandParameterKinds.number}>\n <VarDeclaration\n const\n name=\"value\"\n initializer={code` Number(arg.replace(${equalsRegex}, \"\").trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")); `}\n />\n <hbr />\n <IfStatement condition={`!Number.isNaN(value)`}>\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name}`}>\n {code`options[\"${name}\"]`}\n </Show>\n {code` = value`}\n <Show\n when={\n (option as NumberCommandParameter).choices &&\n (option as NumberCommandParameter).choices!.length > 0\n }>\n {code` as ${(option as NumberCommandParameter).choices?.join(\" | \")}`}\n </Show>\n {code`; `}\n </IfStatement>\n </Show>\n </IfStatement>\n <ElseIfClause condition={`args.length > i + 1`}>\n <Show when={option.kind === CommandParameterKinds.string}>\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name}`}>\n {code`options[\"${name}\"]`}\n </Show>\n {code` = args[++i].trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")`}\n <Show\n when={\n (option as StringCommandParameter).choices &&\n (option as StringCommandParameter).choices!.length > 0\n }>\n {code` as ${(option as StringCommandParameter).choices?.map(choice => `\"${choice}\"`).join(\" | \")}`}\n </Show>\n {code`; `}\n </Show>\n <Show when={option.kind === CommandParameterKinds.number}>\n <VarDeclaration\n const\n name=\"value\"\n initializer={code` Number(args[++i].trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")); `}\n />\n <hbr />\n <IfStatement condition={`!Number.isNaN(value)`}>\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name}`}>\n {code`options[\"${name}\"]`}\n </Show>\n {code` = value`}\n <Show\n when={\n (option as NumberCommandParameter).choices &&\n (option as NumberCommandParameter).choices!.length > 0\n }>\n {code` as ${(option as NumberCommandParameter).choices?.join(\" | \")}`}\n </Show>\n {code`; `}\n </IfStatement>\n </Show>\n </ElseIfClause>\n <hbr />\n </Show>\n </Show>\n <Show when={option.kind === CommandParameterKinds.boolean}>\n <IfStatement\n condition={`${equalsRegex}.test(${isCaseSensitive ? \"arg\" : '\"-\" + arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'})`}>\n <VarDeclaration\n const\n name=\"value\"\n initializer={code` arg.replace(${equalsRegex}, \"\").trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\").toLowerCase(); `}\n />\n <hbr />\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name} = `}>\n {code`options[\"${name}\"] = `}\n </Show>\n <BooleanInputParserLogic name=\"value\" />\n </IfStatement>\n <ElseClause>\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name} = true; `}>\n {code`options[\"${name}\"] = true; `}\n </Show>\n </ElseClause>\n <Show when={Boolean((option as BooleanCommandOption).isNegativeOf)}>\n <hbr />\n <Show\n when={\n (option as BooleanCommandOption).isNegativeOf!.includes(\"?\") ||\n (option as BooleanCommandOption).isNegativeOf!.includes(\"-\")\n }\n fallback={code`options.${(option as BooleanCommandOption).isNegativeOf} = false; `}>\n {code`options[\"${(option as BooleanCommandOption).isNegativeOf}\"] = false; `}\n </Show>\n </Show>\n </Show>\n </>\n );\n}\n\nexport interface OptionsMemberParserConditionProps {\n /**\n * The option name to generate the parser logic for.\n */\n name: string;\n\n /**\n * Aliases for the option, which will also be parsed in the generated code. This will affect how the generated code compares command-line arguments to option names and aliases.\n */\n alias?: string[];\n\n /**\n * Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.\n *\n * @defaultValue false\n */\n isCaseSensitive: boolean;\n}\n\nexport function OptionsMemberParserCondition(\n props: OptionsMemberParserConditionProps\n) {\n const { name, alias: aliasProp, isCaseSensitive } = props;\n\n return (\n <>\n {code`${\n isCaseSensitive\n ? 'arg.startsWith(\"--'\n : 'arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\").startsWith(\"'\n }${isCaseSensitive ? name : name.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")}=\") || ${\n isCaseSensitive\n ? \"arg\"\n : 'arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'\n } === \"${\n isCaseSensitive\n ? name\n : name.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")\n }\" || ${\n isCaseSensitive\n ? 'arg.startsWith(\"-'\n : 'arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\").startsWith(\"'\n }${isCaseSensitive ? name : name.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")}=\") || ${\n isCaseSensitive\n ? \"arg\"\n : 'arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'\n } === \"${\n isCaseSensitive\n ? name\n : name.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")\n }\"`}\n <Show when={aliasProp && aliasProp.length > 0}>\n <For each={aliasProp ?? []}>\n {alias =>\n code` || ${\n isCaseSensitive || alias.length === 1\n ? 'arg.startsWith(\"--'\n : 'arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\").startsWith(\"'\n }${isCaseSensitive || alias.length === 1 ? alias : alias.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")}=\") || ${\n isCaseSensitive || alias.length === 1\n ? \"arg\"\n : 'arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'\n } === \"${\n isCaseSensitive || alias.length === 1\n ? alias\n : alias.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")\n }\" || ${\n isCaseSensitive || alias.length === 1\n ? 'arg.startsWith(\"-'\n : 'arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\").startsWith(\"'\n }${isCaseSensitive || alias.length === 1 ? alias : alias.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")}=\") || ${\n isCaseSensitive || alias.length === 1\n ? \"arg\"\n : 'arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'\n } === \"${\n isCaseSensitive || alias.length === 1\n ? alias\n : alias.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")\n }\"`\n }\n </For>\n </Show>\n </>\n );\n}\n\nexport function OptionsInterfaceDeclaration(props: { command: CommandTree }) {\n const { command } = props;\n\n const options = computed(() =>\n computedOptions(\n Object.entries(command.options).map(([name, option]) => ({\n ...option,\n name\n }))\n )\n );\n\n return (\n <InterfaceDeclaration\n export\n name={`${pascalCase(command.name)}Options`}\n extends=\"GlobalOptions\">\n <For each={Object.values(options.value)} hardline>\n {option => <OptionsMember option={option} />}\n </For>\n </InterfaceDeclaration>\n );\n}\n\nexport interface OptionsParserLogicProps extends PartialKeys<\n Pick<CommandTree, \"segments\" | \"options\" | \"name\">,\n \"segments\" | \"name\"\n> {\n /**\n * The environment variable prefix to use for options that have an associated environment variable. This prefix will be used in the generated code to access the environment variables (e.g., `env.${appSpecificEnvPrefix}_OPTION_NAME`).\n */\n appSpecificEnvPrefix: string;\n\n /**\n * Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.\n *\n * @defaultValue false\n */\n isCaseSensitive?: boolean;\n}\n\n/**\n * The command options parser logic.\n */\nexport function OptionsParserLogic(props: OptionsParserLogicProps) {\n const {\n segments = [],\n options: _options,\n name: _name,\n appSpecificEnvPrefix,\n isCaseSensitive = false\n } = props;\n\n const options = computed(() =>\n computedOptions(\n Object.entries(_options).map(([name, option]) => ({\n ...option,\n name\n }))\n )\n );\n\n return (\n <>\n <VarDeclaration\n const\n name=\"options\"\n initializer={code` {\n ${\n segments.length > 0 ? \"...useGlobalOptions(), \" : \"\"\n }${Object.entries(options.value)\n .filter(\n ([, option]) =>\n option.env ||\n option.default !== undefined ||\n ((option.kind === CommandParameterKinds.string ||\n option.kind === CommandParameterKinds.number) &&\n option.variadic)\n )\n .map(([name, option]) => {\n if (option.kind === CommandParameterKinds.string) {\n return ` ${\n name.includes(\"?\") || name.includes(\"-\")\n ? `\"${name}\"`\n : `${name}`\n }: ${\n option.env ? `env.${appSpecificEnvPrefix}_${option.env}` : \"\"\n }${\n option.variadic\n ? option.default !== undefined\n ? `${\n option.env ? \" ?? \" : \"\"\n }${JSON.stringify(option.default)}`\n : option.env\n ? \" ?? []\"\n : \"[]\"\n : option.default !== undefined\n ? `${option.env ? \" ?? \" : \"\"}\"${option.default}\"`\n : \"\"\n }, `;\n } else if (option.kind === CommandParameterKinds.number) {\n return ` ${name.includes(\"?\") || name.includes(\"-\") ? `\"${name}\"` : `${name}`}: ${\n option.env ? `env.${appSpecificEnvPrefix}_${option.env}` : \"\"\n }${\n option.variadic\n ? option.default && Array.isArray(option.default)\n ? `${\n option.env ? \" ?? \" : \"\"\n }${JSON.stringify(option.default)}`\n : option.env\n ? \" ?? []\"\n : \"[]\"\n : option.default !== undefined\n ? `${option.env ? \" ?? \" : \"\"}${option.default}`\n : \"\"\n }, `;\n } else if (option.kind === CommandParameterKinds.boolean) {\n return ` ${name.includes(\"?\") || name.includes(\"-\") ? `\"${name}\"` : `${name}`}: ${\n option.env\n ? `env.${appSpecificEnvPrefix}_${option.env} ?? `\n : \"\"\n }${option.default ? \"true\" : \"false\"},`;\n }\n\n return \"\";\n })\n .join(\"\")}\n } as unknown as ${segments.length > 0 ? pascalCase(_name) : \"Global\"}Options;`}\n />\n <Spacing />\n {code`for (let i = 0; i < args.slice(${\n segments.filter(segment => isDynamicPathSegment(segment)).length\n }).length; i++) { `}\n <hbr />\n <VarDeclaration\n const\n name=\"arg\"\n type=\"string\"\n initializer={code` args[i].length > 3 && args[i].startsWith(\"--\")\n ? \\`--\\${args[i].slice(2).replaceAll(\"-\", \"\")${\n isCaseSensitive\n ? \"\"\n : '.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'\n }}\\`\n : args[i].length > 2 && args[i].startsWith(\"-\")\n ? \\`-\\${args[i].slice(1).replaceAll(\"-\", \"\")}\\`\n : args[i]; `}\n />\n <hbr />\n <For each={Object.entries(options.value)} hardline>\n {([name, option], i) => (\n <Show\n when={i === 0}\n fallback={\n <ElseIfClause\n condition={\n <>\n <OptionsMemberParserCondition\n name={name}\n alias={option.alias}\n isCaseSensitive={isCaseSensitive}\n />\n </>\n }>\n <OptionsMemberParserLogic\n name={name}\n option={option}\n isCaseSensitive={isCaseSensitive}\n />\n </ElseIfClause>\n }>\n <IfStatement\n condition={\n <OptionsMemberParserCondition\n name={name}\n alias={option.alias}\n isCaseSensitive={isCaseSensitive}\n />\n }>\n <OptionsMemberParserLogic\n name={name}\n option={option}\n isCaseSensitive={isCaseSensitive}\n />\n </IfStatement>\n </Show>\n )}\n </For>\n <hbr />\n {code` } `}\n <hbr />\n </>\n );\n}\n\nexport interface CommandParserLogicProps {\n /**\n * The command to generate the parser logic for.\n */\n command: CommandTree;\n\n /**\n * The environment variable prefix to use for options that have an associated environment variable. This prefix will be used in the generated code to access the environment variables (e.g., `env.${appSpecificEnvPrefix}_OPTION_NAME`).\n */\n appSpecificEnvPrefix: string;\n\n /**\n * Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.\n *\n * @defaultValue false\n */\n isCaseSensitive?: boolean;\n}\n\n/**\n * The command parser logic, which includes parsing dynamic path segments, positional parameters, and options.\n */\nexport function CommandParserLogic(props: CommandParserLogicProps) {\n const { command, appSpecificEnvPrefix, isCaseSensitive = false } = props;\n\n return (\n <>\n <DynamicSegmentsParserLogic\n command={command}\n isCaseSensitive={isCaseSensitive}\n />\n <Spacing />\n <OptionsParserLogic\n name={command.name}\n options={command.options}\n segments={command.segments}\n appSpecificEnvPrefix={appSpecificEnvPrefix}\n isCaseSensitive={isCaseSensitive}\n />\n <Spacing />\n <ArgumentsParserLogic\n command={command}\n appSpecificEnvPrefix={appSpecificEnvPrefix}\n isCaseSensitive={isCaseSensitive}\n />\n <Spacing />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AA2CA,SAAE,2BAAA,OAAA;CACA,MAAM,EACR,YACM;;EAEN,IAAO,OAAA;AACH,UAAA,QAAA,YAAA,EAAA;;EAEA,WAAA,SAAA,UAAA,gBAAA,MAAA;GACF,IAAQ,OAAC;;;GAGN,IAAA,WAAY;AACb,WAAA;KAAA,gBAAA,gBAAA;MACF,OAAe;MACjB,IAAA,OAAA;;;MAGS,MAAA;MACP,CAAA;KAAA,gBAAA,OAAA,EAAA,CAAA;KAAA,gBAAA,aAAA;MACQ,WAAW,IAAC,iBAAK,IAAA,MAAA,WAAA,IAAA,MAAA;;AAElB,cAAA,IAAA,GAAA,UAAA,0BAAA,QAAA,CAAA,CAAA,UAAA,IAAA,MAAA;;MAED,CAAA;KAAA,gBAAmB,OAAA,EAAA,CAAA;KAAA,gBAAA,OAAA,EAAA,CAAA;KAAA;;GAEtB,CAAC;EACH,CAAC;;;CAmBJ,MAAO,EACH,SACA,sBACA,oBACF;;EAEE,IAAA,OAAA;AACC,UAAI,QAAY,QAAQ,QAAQ,KAAG,SAAQ;;EAE9C,IAAA,WAAA;;;KAEE,OAAA;KACC,MAAQ;KACT,MAAA;KACF,IAAA,cAAwB;AAC1B,aAAA,IAAA,0BAAA,QAAA,SAAA,SAAA,EAAA,+CAAA,OAAA,OAAA,QAAA,WAAA,EAAA,CAAA,CAAA,KAAA,WAAA,GAAA,mBAAA,OAAA,KAAA,WAAA,IAAA,OAAA,OAAA,OAAA,KAAA,aAAA,CAAA,WAAA,KAAA,GAAA,CAAA,WAAA,KAAA,GAA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EI;GACL;GACjB,CAAC;EAAE,gBAAkB,SAAQ,EAAA,CAAI;EAAE,gBAAG,sBAA+B;GAC3D;GACY;GACJ;GAClB,CAAC;EAAE,gBAAiB,SAAA,EAAA,CAAA;EAAA"}
1
+ {"version":3,"file":"options-parser-logic.mjs","names":[],"sources":["../../src/components/options-parser-logic.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 ElseClause,\n ElseIfClause,\n IfStatement,\n InterfaceDeclaration,\n InterfaceMember,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { constantCase } from \"@stryke/string-format/constant-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport type { PartialKeys } from \"@stryke/types/base\";\nimport { computedOptions } from \"../contexts/options\";\nimport {\n getDynamicPathSegmentName,\n isDynamicPathSegment\n} from \"../plugin-utils/context-helpers\";\nimport type {\n BaseVariadicCommandParameter,\n BooleanCommandOption,\n CommandOption,\n CommandTree,\n NumberCommandParameter,\n StringCommandParameter\n} from \"../types/command\";\nimport { CommandParameterKinds } from \"../types/command\";\nimport { BooleanInputParserLogic, CommandParameterType } from \"./helpers\";\n\nexport interface DynamicSegmentsParserLogicProps {\n /**\n * The command to generate the dynamic path segments parser logic for. This is used to access the command options and parameters when generating the parser logic for dynamic path segments.\n */\n command: CommandTree;\n\n /**\n * Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.\n */\n isCaseSensitive: boolean;\n}\n\nexport function DynamicSegmentsParserLogic(\n props: DynamicSegmentsParserLogicProps\n) {\n const { command } = props;\n\n return (\n <For each={command.segments ?? []}>\n {(segment, index) => (\n <Show when={isDynamicPathSegment(segment)}>\n <VarDeclaration\n let\n name={camelCase(getDynamicPathSegmentName(segment))}\n type=\"string | undefined\"\n />\n <hbr />\n <IfStatement\n condition={code`args.length > ${2 + index} && args[${2 + index}]`}>\n {code`${camelCase(\n getDynamicPathSegmentName(segment)\n )} = args[${2 + index}];`}\n </IfStatement>\n <hbr />\n <hbr />\n </Show>\n )}\n </For>\n );\n}\n\nexport interface ArgumentsParserLogicProps {\n /**\n * The command to generate the positional parameters parser logic for.\n */\n command: CommandTree;\n\n /**\n * The environment variable prefix to use for options that have an associated environment variable. This prefix will be used in the generated code to access the environment variables (e.g., `env.${appSpecificEnvPrefix}_OPTION_NAME`).\n */\n appSpecificEnvPrefix: string;\n\n /**\n * Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.\n */\n isCaseSensitive: boolean;\n}\n\nexport function ArgumentsParserLogic(props: ArgumentsParserLogicProps) {\n const { command, appSpecificEnvPrefix, isCaseSensitive } = props;\n\n return (\n <Show when={command.args && command.args.length > 0}>\n <VarDeclaration\n let\n name=\"optionsIndex\"\n type=\"number\"\n initializer={code`Math.max(0, args.slice(${\n command.segments.length + 1\n }).findIndex(arg => arg.startsWith(\"-\") && /^(${Object.values(\n command.options ?? {}\n )\n .map(\n option =>\n `${\n isCaseSensitive || option.name.length === 1\n ? option.name\n : option.name\n .toLowerCase()\n .replaceAll(\"-\", \"\")\n .replaceAll(\"_\", \"\")\n }${option.alias && option.alias.length > 0 ? \"|\" : \"\"}${option.alias\n ?.map(a =>\n (isCaseSensitive || option.name.length === 1\n ? a\n : a\n .toLowerCase()\n .replaceAll(\"-\", \"\")\n .replaceAll(\"_\", \"\")) === \"?\"\n ? \"\\\\?\"\n : isCaseSensitive || option.name.length === 1\n ? a\n : a.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")\n )\n .join(\"|\")}`\n )\n .join(\"|\")})=?.*$/.test(arg${\n isCaseSensitive\n ? \"\"\n : '.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'\n }))) + ${command.segments.length + 1};`}\n />\n <Spacing />\n <VarDeclaration\n let\n name=\"argsIndex\"\n type=\"number\"\n initializer={code`optionsIndex > ${\n command.segments.length + 1\n } ? ${command.segments.length + 1} : (Math.max(0, args.slice(optionsIndex).findLastIndex(arg => arg.startsWith(\"-\") && /^(${Object.values(\n command.options ?? {}\n )\n .map(\n option =>\n `${\n isCaseSensitive || option.name.length === 1\n ? option.name\n : option.name\n .toLowerCase()\n .replaceAll(\"-\", \"\")\n .replaceAll(\"_\", \"\")\n }${option.alias && option.alias.length > 0 ? \"|\" : \"\"}${option.alias\n ?.map(a =>\n (isCaseSensitive || option.name.length === 1\n ? a\n : a\n .toLowerCase()\n .replaceAll(\"-\", \"\")\n .replaceAll(\"_\", \"\")) === \"?\"\n ? \"\\\\?\"\n : isCaseSensitive || option.name.length === 1\n ? a\n : a.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")\n )\n .join(\"|\")}`\n )\n .join(\"|\")})=?.*$/.test(arg${\n isCaseSensitive\n ? \"\"\n : '.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'\n }))) + ${command.segments.length + 1});`}\n />\n <Spacing />\n <For each={command.args ?? []} hardline>\n {(arg, index) => (\n <>\n <Show\n when={\n isSetString(arg.env) ||\n arg.default !== undefined ||\n arg.variadic\n }\n fallback={\n <>\n {code`let ${camelCase(arg.name)}!: `}\n <CommandParameterType parameter={arg} />\n {code`; `}\n </>\n }>\n <VarDeclaration\n let\n name={camelCase(arg.name)}\n type={<CommandParameterType parameter={arg} />}\n initializer={\n <>\n {code` ( `}\n <Show when={isSetString(arg.env)}>\n {code`env.${appSpecificEnvPrefix}_${constantCase(String(arg.env))} ?? `}\n </Show>\n <Show\n when={\n arg.default !== undefined &&\n (!arg.variadic ||\n (arg as BaseVariadicCommandParameter).default!\n .length > 0)\n }\n fallback={\n <Show when={arg.variadic} fallback={code`undefined`}>\n {code`[]`}\n </Show>\n }>\n <Show\n when={arg.variadic}\n fallback={\n arg.kind === CommandParameterKinds.string\n ? code`\"${arg.default}\"`\n : code`${arg.default}`\n }>\n {code`[${(arg as BaseVariadicCommandParameter).default\n ?.map(value =>\n arg.kind === CommandParameterKinds.string\n ? `\"${value}\"`\n : value\n )\n .join(\", \")}]`}\n </Show>\n </Show>\n {code`) as `}\n <CommandParameterType parameter={arg} />\n {code`; `}\n </>\n }\n />\n </Show>\n <Spacing />\n <IfStatement\n condition={code`argsIndex + ${index} < args.length && argsIndex + ${index} !== optionsIndex`}>\n {code`${camelCase(arg.name)} = `}\n <Show\n when={\n arg.kind === CommandParameterKinds.string ||\n arg.kind === CommandParameterKinds.number\n }\n fallback={\n <BooleanInputParserLogic\n name={`args[argsIndex + ${index}] `}\n />\n }>\n <Show\n when={arg.variadic}\n fallback={\n <Show\n when={arg.kind === CommandParameterKinds.number}\n fallback={code`args[argsIndex + ${index}] `}>\n {code`Number(args[argsIndex + ${index}]) `}\n </Show>\n }>\n {code`args.slice(argsIndex + ${\n index\n }, (optionsIndex > argsIndex ? optionsIndex : args.length) - ${\n command.args.length - index\n }).join(\" \").split(\",\").map(item => item.trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")).filter(Boolean)`}\n </Show>\n </Show>\n {code` as `}\n <CommandParameterType parameter={arg} />\n {code`; `}\n </IfStatement>\n <Spacing />\n </>\n )}\n </For>\n </Show>\n );\n}\n\n/**\n * The command option interface property.\n */\nexport function OptionsMember({ option }: { option: CommandOption }) {\n const doc = option.description || `The ${option.title} command option.`;\n\n return (\n <>\n <Show when={Boolean(option.name)}>\n <Show when={option.kind === CommandParameterKinds.string}>\n <InterfaceMember\n name={option.name}\n doc={doc}\n type={<CommandParameterType parameter={option} />}\n optional={option.optional}\n />\n </Show>\n <Show when={option.kind === CommandParameterKinds.number}>\n <InterfaceMember\n name={option.name}\n doc={doc}\n type={<CommandParameterType parameter={option} />}\n optional={option.optional}\n />\n </Show>\n <Show when={option.kind === CommandParameterKinds.boolean}>\n <InterfaceMember\n name={option.name}\n doc={doc}\n type={<CommandParameterType parameter={option} />}\n optional={option.optional}\n />\n </Show>\n </Show>\n </>\n );\n}\n\nexport interface OptionsMemberParserLogicProps {\n /**\n * The option name to generate the parser logic for.\n */\n name: string;\n\n /**\n * The command option to generate the parser logic for.\n */\n option: CommandOption;\n\n /**\n * Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.\n *\n * @defaultValue false\n */\n isCaseSensitive: boolean;\n}\n\n/**\n * The command option property parser logic.\n */\nexport function OptionsMemberParserLogic(props: OptionsMemberParserLogicProps) {\n const { name, option, isCaseSensitive } = props;\n\n const equalsRegex = `/^--?(${\n isCaseSensitive || name.length === 1\n ? name\n : name.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")\n }${option.alias && option.alias.length > 0 ? \"|\" : \"\"}${option.alias\n ?.map(a =>\n (isCaseSensitive || name.length === 1\n ? a\n : a.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")) === \"?\"\n ? \"\\\\?\"\n : isCaseSensitive || name.length === 1\n ? a\n : a.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")\n )\n .join(\"|\")})=/`;\n\n return (\n <>\n <Show\n when={\n option.kind === CommandParameterKinds.string ||\n option.kind === CommandParameterKinds.number\n }>\n <Show\n when={\n (option as StringCommandParameter | NumberCommandParameter).variadic\n }>\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name} ??= []; `}>\n {code`options[\"${name}\"] ??= []; `}\n </Show>\n <hbr />\n <IfStatement\n condition={`${equalsRegex}.test(${\n isCaseSensitive\n ? \"arg\"\n : '\"-\" + arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'\n })`}>\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name}.push(`}>\n {code`options[\"${name}\"].push(`}\n </Show>\n <Show when={option.kind === CommandParameterKinds.string}>\n {code`...arg.replace(${equalsRegex}, \"\").split(\",\").map(item => item.trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")).filter(Boolean) `}\n </Show>\n <Show when={option.kind === CommandParameterKinds.number}>\n {code`...arg.replace(${equalsRegex}, \"\").split(\",\").map(item => item.trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")).filter(Boolean).map(Number).filter(value => !Number.isNaN(value)) `}\n </Show>\n <Show\n when={\n (option.kind === CommandParameterKinds.string ||\n option.kind === CommandParameterKinds.number) &&\n option.choices &&\n option.choices.length > 0\n }>\n {code` as ${(\n option as StringCommandParameter | NumberCommandParameter\n ).choices\n ?.map(choice => (isSetString(choice) ? `\"${choice}\"` : choice))\n .join(\" | \")} `}\n </Show>\n {code`); `}\n </IfStatement>\n <ElseIfClause condition={`args.length > i + 1`}>\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name}.push(`}>\n {code`options[\"${name}\"].push(`}\n </Show>\n <Show when={option.kind === CommandParameterKinds.string}>\n {code`...args[++i].split(\",\").map(item => item.trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")).filter(Boolean) `}\n </Show>\n <Show when={option.kind === CommandParameterKinds.number}>\n {code`...args[++i].split(\",\").map(item => item.trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")).filter(Boolean).map(Number).filter(value => !Number.isNaN(value)) `}\n </Show>\n <Show\n when={\n (option.kind === CommandParameterKinds.string ||\n option.kind === CommandParameterKinds.number) &&\n option.choices &&\n option.choices.length > 0\n }>\n {code` as ${(\n option as StringCommandParameter | NumberCommandParameter\n ).choices\n ?.map(choice => (isSetString(choice) ? `\"${choice}\"` : choice))\n .join(\" | \")} `}\n </Show>\n {code`); `}\n </ElseIfClause>\n </Show>\n <Show\n when={\n !(option as StringCommandParameter | NumberCommandParameter)\n .variadic\n }>\n <IfStatement\n condition={`${equalsRegex}.test(${\n isCaseSensitive\n ? \"arg\"\n : '\"-\" + arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'\n })`}>\n <Show when={option.kind === CommandParameterKinds.string}>\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name}`}>\n {code`options[\"${name}\"]`}\n </Show>\n {code` = arg.replace(${equalsRegex}, \"\").trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")`}\n <Show\n when={\n (option as StringCommandParameter).choices &&\n (option as StringCommandParameter).choices!.length > 0\n }>\n {code` as ${(option as StringCommandParameter).choices\n ?.map(choice => `\"${choice}\"`)\n .join(\" | \")}`}\n </Show>\n {code`; `}\n </Show>\n <Show when={option.kind === CommandParameterKinds.number}>\n <VarDeclaration\n const\n name=\"value\"\n initializer={code` Number(arg.replace(${equalsRegex}, \"\").trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")); `}\n />\n <hbr />\n <IfStatement condition={`!Number.isNaN(value)`}>\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name}`}>\n {code`options[\"${name}\"]`}\n </Show>\n {code` = value`}\n <Show\n when={\n (option as NumberCommandParameter).choices &&\n (option as NumberCommandParameter).choices!.length > 0\n }>\n {code` as ${(option as NumberCommandParameter).choices?.join(\" | \")}`}\n </Show>\n {code`; `}\n </IfStatement>\n </Show>\n </IfStatement>\n <ElseIfClause condition={`args.length > i + 1`}>\n <Show when={option.kind === CommandParameterKinds.string}>\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name}`}>\n {code`options[\"${name}\"]`}\n </Show>\n {code` = args[++i].trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")`}\n <Show\n when={\n (option as StringCommandParameter).choices &&\n (option as StringCommandParameter).choices!.length > 0\n }>\n {code` as ${(option as StringCommandParameter).choices?.map(choice => `\"${choice}\"`).join(\" | \")}`}\n </Show>\n {code`; `}\n </Show>\n <Show when={option.kind === CommandParameterKinds.number}>\n <VarDeclaration\n const\n name=\"value\"\n initializer={code` Number(args[++i].trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\")); `}\n />\n <hbr />\n <IfStatement condition={`!Number.isNaN(value)`}>\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name}`}>\n {code`options[\"${name}\"]`}\n </Show>\n {code` = value`}\n <Show\n when={\n (option as NumberCommandParameter).choices &&\n (option as NumberCommandParameter).choices!.length > 0\n }>\n {code` as ${(option as NumberCommandParameter).choices?.join(\" | \")}`}\n </Show>\n {code`; `}\n </IfStatement>\n </Show>\n </ElseIfClause>\n <hbr />\n </Show>\n </Show>\n <Show when={option.kind === CommandParameterKinds.boolean}>\n <IfStatement\n condition={`${equalsRegex}.test(${isCaseSensitive ? \"arg\" : '\"-\" + arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'})`}>\n <VarDeclaration\n const\n name=\"value\"\n initializer={code` arg.replace(${equalsRegex}, \"\").trim().replace(/^(\"|')/, \"\").replace(/(\"|')$/, \"\").toLowerCase(); `}\n />\n <hbr />\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name} = `}>\n {code`options[\"${name}\"] = `}\n </Show>\n <BooleanInputParserLogic name=\"value\" />\n </IfStatement>\n <ElseClause>\n <Show\n when={name.includes(\"?\") || name.includes(\"-\")}\n fallback={code`options.${name} = true; `}>\n {code`options[\"${name}\"] = true; `}\n </Show>\n </ElseClause>\n <Show when={Boolean((option as BooleanCommandOption).isNegativeOf)}>\n <hbr />\n <Show\n when={\n (option as BooleanCommandOption).isNegativeOf!.includes(\"?\") ||\n (option as BooleanCommandOption).isNegativeOf!.includes(\"-\")\n }\n fallback={code`options.${(option as BooleanCommandOption).isNegativeOf} = false; `}>\n {code`options[\"${(option as BooleanCommandOption).isNegativeOf}\"] = false; `}\n </Show>\n </Show>\n </Show>\n </>\n );\n}\n\nexport interface OptionsMemberParserConditionProps {\n /**\n * The option name to generate the parser logic for.\n */\n name: string;\n\n /**\n * Aliases for the option, which will also be parsed in the generated code. This will affect how the generated code compares command-line arguments to option names and aliases.\n */\n alias?: string[];\n\n /**\n * Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.\n *\n * @defaultValue false\n */\n isCaseSensitive: boolean;\n}\n\nexport function OptionsMemberParserCondition(\n props: OptionsMemberParserConditionProps\n) {\n const { name, alias: aliasProp, isCaseSensitive } = props;\n\n return (\n <>\n {code`${\n isCaseSensitive\n ? 'arg.startsWith(\"--'\n : 'arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\").startsWith(\"'\n }${isCaseSensitive ? name : name.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")}=\") || ${\n isCaseSensitive\n ? \"arg\"\n : 'arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'\n } === \"${\n isCaseSensitive\n ? name\n : name.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")\n }\" || ${\n isCaseSensitive\n ? 'arg.startsWith(\"-'\n : 'arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\").startsWith(\"'\n }${isCaseSensitive ? name : name.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")}=\") || ${\n isCaseSensitive\n ? \"arg\"\n : 'arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'\n } === \"${\n isCaseSensitive\n ? name\n : name.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")\n }\"`}\n <Show when={aliasProp && aliasProp.length > 0}>\n <For each={aliasProp ?? []}>\n {alias =>\n code` || ${\n isCaseSensitive || alias.length === 1\n ? 'arg.startsWith(\"--'\n : 'arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\").startsWith(\"'\n }${isCaseSensitive || alias.length === 1 ? alias : alias.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")}=\") || ${\n isCaseSensitive || alias.length === 1\n ? \"arg\"\n : 'arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'\n } === \"${\n isCaseSensitive || alias.length === 1\n ? alias\n : alias.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")\n }\" || ${\n isCaseSensitive || alias.length === 1\n ? 'arg.startsWith(\"-'\n : 'arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\").startsWith(\"'\n }${isCaseSensitive || alias.length === 1 ? alias : alias.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")}=\") || ${\n isCaseSensitive || alias.length === 1\n ? \"arg\"\n : 'arg.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'\n } === \"${\n isCaseSensitive || alias.length === 1\n ? alias\n : alias.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")\n }\"`\n }\n </For>\n </Show>\n </>\n );\n}\n\nexport function OptionsInterfaceDeclaration(props: { command: CommandTree }) {\n const { command } = props;\n\n const options = computed(() =>\n computedOptions(\n Object.entries(command.options).map(([name, option]) => ({\n ...option,\n name\n }))\n )\n );\n\n return (\n <InterfaceDeclaration\n export\n name={`${pascalCase(command.name)}Options`}\n extends=\"GlobalOptions\">\n <For each={Object.values(options.value)} hardline>\n {option => <OptionsMember option={option} />}\n </For>\n </InterfaceDeclaration>\n );\n}\n\nexport interface OptionsParserLogicProps extends PartialKeys<\n Pick<CommandTree, \"segments\" | \"options\" | \"name\">,\n \"segments\" | \"name\"\n> {\n /**\n * The environment variable prefix to use for options that have an associated environment variable. This prefix will be used in the generated code to access the environment variables (e.g., `env.${appSpecificEnvPrefix}_OPTION_NAME`).\n */\n appSpecificEnvPrefix: string;\n\n /**\n * Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.\n *\n * @defaultValue false\n */\n isCaseSensitive?: boolean;\n}\n\n/**\n * The command options parser logic.\n */\nexport function OptionsParserLogic(props: OptionsParserLogicProps) {\n const {\n segments = [],\n options: _options,\n name: _name,\n appSpecificEnvPrefix,\n isCaseSensitive = false\n } = props;\n\n const options = computed(() =>\n computedOptions(\n Object.entries(_options).map(([name, option]) => ({\n ...option,\n name\n }))\n )\n );\n\n return (\n <>\n <VarDeclaration\n const\n name=\"options\"\n initializer={code` {\n ${\n segments.length > 0 ? \"...useGlobalOptions(), \" : \"\"\n }${Object.entries(options.value)\n .filter(\n ([, option]) =>\n option.env ||\n option.default !== undefined ||\n ((option.kind === CommandParameterKinds.string ||\n option.kind === CommandParameterKinds.number) &&\n option.variadic)\n )\n .map(([name, option]) => {\n if (option.kind === CommandParameterKinds.string) {\n return ` ${\n name.includes(\"?\") || name.includes(\"-\")\n ? `\"${name}\"`\n : `${name}`\n }: ${\n option.env ? `env.${appSpecificEnvPrefix}_${option.env}` : \"\"\n }${\n option.variadic\n ? option.default !== undefined\n ? `${\n option.env ? \" ?? \" : \"\"\n }${JSON.stringify(option.default)}`\n : option.env\n ? \" ?? []\"\n : \"[]\"\n : option.default !== undefined\n ? `${option.env ? \" ?? \" : \"\"}\"${option.default}\"`\n : \"\"\n }, `;\n } else if (option.kind === CommandParameterKinds.number) {\n return ` ${name.includes(\"?\") || name.includes(\"-\") ? `\"${name}\"` : `${name}`}: ${\n option.env ? `env.${appSpecificEnvPrefix}_${option.env}` : \"\"\n }${\n option.variadic\n ? option.default && Array.isArray(option.default)\n ? `${\n option.env ? \" ?? \" : \"\"\n }${JSON.stringify(option.default)}`\n : option.env\n ? \" ?? []\"\n : \"[]\"\n : option.default !== undefined\n ? `${option.env ? \" ?? \" : \"\"}${option.default}`\n : \"\"\n }, `;\n } else if (option.kind === CommandParameterKinds.boolean) {\n return ` ${name.includes(\"?\") || name.includes(\"-\") ? `\"${name}\"` : `${name}`}: ${\n option.env\n ? `env.${appSpecificEnvPrefix}_${option.env} ?? `\n : \"\"\n }${option.default ? \"true\" : \"false\"},`;\n }\n\n return \"\";\n })\n .join(\"\")}\n } as unknown as ${segments.length > 0 ? pascalCase(_name) : \"Global\"}Options;`}\n />\n <Spacing />\n {code`for (let i = 0; i < args.slice(${\n segments.filter(segment => isDynamicPathSegment(segment)).length\n }).length; i++) { `}\n <hbr />\n <VarDeclaration\n const\n name=\"arg\"\n type=\"string\"\n initializer={code` args[i].length > 3 && args[i].startsWith(\"--\")\n ? \\`--\\${args[i].slice(2).replaceAll(\"-\", \"\")${\n isCaseSensitive\n ? \"\"\n : '.toLowerCase().replaceAll(\"-\", \"\").replaceAll(\"_\", \"\")'\n }}\\`\n : args[i].length > 2 && args[i].startsWith(\"-\")\n ? \\`-\\${args[i].slice(1).replaceAll(\"-\", \"\")}\\`\n : args[i]; `}\n />\n <hbr />\n <For each={Object.entries(options.value)} hardline>\n {([name, option], i) => (\n <Show\n when={i === 0}\n fallback={\n <ElseIfClause\n condition={\n <>\n <OptionsMemberParserCondition\n name={name}\n alias={option.alias}\n isCaseSensitive={isCaseSensitive}\n />\n </>\n }>\n <OptionsMemberParserLogic\n name={name}\n option={option}\n isCaseSensitive={isCaseSensitive}\n />\n </ElseIfClause>\n }>\n <IfStatement\n condition={\n <OptionsMemberParserCondition\n name={name}\n alias={option.alias}\n isCaseSensitive={isCaseSensitive}\n />\n }>\n <OptionsMemberParserLogic\n name={name}\n option={option}\n isCaseSensitive={isCaseSensitive}\n />\n </IfStatement>\n </Show>\n )}\n </For>\n <hbr />\n {code` } `}\n <hbr />\n </>\n );\n}\n\nexport interface CommandParserLogicProps {\n /**\n * The command to generate the parser logic for.\n */\n command: CommandTree;\n\n /**\n * The environment variable prefix to use for options that have an associated environment variable. This prefix will be used in the generated code to access the environment variables (e.g., `env.${appSpecificEnvPrefix}_OPTION_NAME`).\n */\n appSpecificEnvPrefix: string;\n\n /**\n * Whether the command options should be parsed in a case-sensitive manner. This will affect how the generated code compares command-line arguments to option names and aliases.\n *\n * @defaultValue false\n */\n isCaseSensitive?: boolean;\n}\n\n/**\n * The command parser logic, which includes parsing dynamic path segments, positional parameters, and options.\n */\nexport function CommandParserLogic(props: CommandParserLogicProps) {\n const { command, appSpecificEnvPrefix, isCaseSensitive = false } = props;\n\n return (\n <>\n <DynamicSegmentsParserLogic\n command={command}\n isCaseSensitive={isCaseSensitive}\n />\n <Spacing />\n <OptionsParserLogic\n name={command.name}\n options={command.options}\n segments={command.segments}\n appSpecificEnvPrefix={appSpecificEnvPrefix}\n isCaseSensitive={isCaseSensitive}\n />\n <Spacing />\n <ArgumentsParserLogic\n command={command}\n appSpecificEnvPrefix={appSpecificEnvPrefix}\n isCaseSensitive={isCaseSensitive}\n />\n <Spacing />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAEE,IAAG,SAAS;;;AA+Bd,MAAM,qCAA8B;CAAQ;CAAS;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAErD,SAAE,2BAAyB,OAAA;CACzB,MAAA,EACA,YACI;AACJ,QAAA,gBAAA,KAA4B;EAC5B,IAAA,OAAA;AACA,UAAA,QAAa,YAAA,EAAA;;EAEb,IAAA,WAAA;AACA,UAAA,cAAA,SAAA,UAAA,gBAAA,MAAA;IACM,IAAG,OAAM;AACR,YAAA,qBAA6B,QAAI;;;AAGnC,YAAU;MAAA,gBAAA,gBAAgC;OAC7C,OAAA;OACK,IAAO,OAAI;AAChB,eAAA,UAAA,0BAAA,QAAA,CAAA;;;OAGA,CAAA;MAAA,gBAAA,OAAA,EAAA,CAAA;MAAA,gBAAA,aAAA;OACQ,WAAK,IAAQ,iBAAkB,IAAA,MAAW,WAAM,IAAS,MAAC;O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AA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;;;;AAKH,SAAe,mBAAmB,OAAM;CACtC,MAAI,EACF,SACA,sBACA,kBAAO,UACL;AACJ,QAAC;EAAA,gBAAA,4BAAA;GACH;;GAEA,CAAA;EAAM,gBAAW,SAAA,EAAA,CAAA;EAAA,gBAAgC,oBAAW;GAC1D,IAAK,OAAA;AACJ,WAAU,QAAO;;GAEhB,IAAA,UAAA;AACC,WAAI,QAAY;;GAEnB,IAAA,WAAA;;;GAGuB;GACtB;GACA,CAAC;EAAE,gBAAa,SAAA,EAAA,CAAA;EAAA,gBAAA,sBAAA;GACf;GACgB;GACpB;;;;;AAGA,mBAAe,SAAQ;OAAY;CAAA;CAAA;CAAA;CAAA;CAAA"}
@@ -15,8 +15,32 @@ let _powerlines_plugin_alloy_typescript_components_builtin_file = require("@powe
15
15
  let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
16
16
 
17
17
  //#region src/components/state-builtin.tsx
18
+ const __ΩOmit = [
19
+ "T",
20
+ "K",
21
+ () => __ΩPick,
22
+ () => __ΩExclude,
23
+ "Omit",
24
+ "b!b\"e!!e!!ge!\"o$#o##w%y"
25
+ ];
26
+ const __ΩPick = [
27
+ "T",
28
+ "K",
29
+ "Pick",
30
+ "l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
31
+ ];
32
+ const __ΩExclude = [
33
+ "T",
34
+ "U",
35
+ "Exclude",
36
+ "l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
37
+ ];
38
+ function __assignType(fn, args) {
39
+ fn.__type = args;
40
+ return fn;
41
+ }
18
42
  function GlobalTypeDefinitions() {
19
- const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
43
+ const context = (_powerlines_plugin_alloy_core_contexts_context.usePowerlines.Ω = [["Context", "\"w!"]], (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)());
20
44
  const options = (0, _alloy_js_core.computed)(() => require_contexts_options.computedOptions(context.options));
21
45
  return [
22
46
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { get heading() {
@@ -31,7 +55,13 @@ function GlobalTypeDefinitions() {
31
55
  return Object.values(options.value);
32
56
  },
33
57
  hardline: true,
34
- children: (option) => (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_options_parser_logic.OptionsMember, { option })
58
+ get children() {
59
+ return __assignType((option) => (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_options_parser_logic.OptionsMember, { option }), [
60
+ "option",
61
+ "",
62
+ "P\"2!\"/\""
63
+ ]);
64
+ }
35
65
  });
36
66
  }
37
67
  }),
@@ -143,6 +173,7 @@ function GlobalTypeDefinitions() {
143
173
  })
144
174
  ];
145
175
  }
176
+ GlobalTypeDefinitions.__type = ["GlobalTypeDefinitions", "P\"/!"];
146
177
  /**
147
178
  * Generates utilities for detecting terminal color support.
148
179
  */
@@ -164,9 +195,18 @@ function ArgsUtilities() {
164
195
  children: _alloy_js_core.code`return ((globalThis as { Deno?: { args: string[] } })?.Deno?.args ?? process.argv ?? []) as string[];`
165
196
  })];
166
197
  }
198
+ ArgsUtilities.__type = [
199
+ "ArgsUtilities",
200
+ "Generates utilities for detecting terminal color support.",
201
+ "P\"/!?\""
202
+ ];
167
203
  function ContextUtilities() {
168
- const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
169
- const options = (0, _alloy_js_core.computed)(() => Object.fromEntries(context.options.map((option) => [option.name, option])));
204
+ const context = (_powerlines_plugin_alloy_core_contexts_context.usePowerlines.Ω = [["Context", "\"w!"]], (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)());
205
+ const options = (0, _alloy_js_core.computed)(() => Object.fromEntries(context.options.map(__assignType((option) => [option.name, option], [
206
+ "option",
207
+ "",
208
+ "P\"2!\"/\""
209
+ ]))));
170
210
  return [
171
211
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
172
212
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
@@ -549,6 +589,14 @@ return result;`;
549
589
  })
550
590
  ];
551
591
  }
592
+ ContextUtilities.__type = ["ContextUtilities", "P\"/!"];
593
+ const __ΩStateBuiltinProps = [
594
+ () => __ΩOmit,
595
+ "id",
596
+ "description",
597
+ "StateBuiltinProps",
598
+ "P!P.\".#Jo!#Mw$y"
599
+ ];
552
600
  /**
553
601
  * A built-in module for handling application state utilities in Shell Shock.
554
602
  */
@@ -585,9 +633,17 @@ function StateBuiltin(props) {
585
633
  }
586
634
  }));
587
635
  }
636
+ StateBuiltin.__type = [
637
+ () => __ΩStateBuiltinProps,
638
+ "props",
639
+ "StateBuiltin",
640
+ "A built-in module for handling application state utilities in Shell Shock.",
641
+ "Pn!2\"\"/#?$"
642
+ ];
588
643
 
589
644
  //#endregion
590
645
  exports.ArgsUtilities = ArgsUtilities;
591
646
  exports.ContextUtilities = ContextUtilities;
592
647
  exports.GlobalTypeDefinitions = GlobalTypeDefinitions;
593
- exports.StateBuiltin = StateBuiltin;
648
+ exports.StateBuiltin = StateBuiltin;
649
+ exports.__ΩStateBuiltinProps = __ΩStateBuiltinProps;
@@ -12,8 +12,32 @@ import { BuiltinFile } from "@powerlines/plugin-alloy/typescript/components/buil
12
12
  import { TSDoc, TSDocInternal, TSDocLink, TSDocParam, TSDocRemarks, TSDocReturns } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
13
13
 
14
14
  //#region src/components/state-builtin.tsx
15
+ const __ΩOmit = [
16
+ "T",
17
+ "K",
18
+ () => __ΩPick,
19
+ () => __ΩExclude,
20
+ "Omit",
21
+ "b!b\"e!!e!!ge!\"o$#o##w%y"
22
+ ];
23
+ const __ΩPick = [
24
+ "T",
25
+ "K",
26
+ "Pick",
27
+ "l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
28
+ ];
29
+ const __ΩExclude = [
30
+ "T",
31
+ "U",
32
+ "Exclude",
33
+ "l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
34
+ ];
35
+ function __assignType(fn, args) {
36
+ fn.__type = args;
37
+ return fn;
38
+ }
15
39
  function GlobalTypeDefinitions() {
16
- const context = usePowerlines();
40
+ const context = (usePowerlines.Ω = [["Context", "\"w!"]], usePowerlines());
17
41
  const options = computed(() => computedOptions(context.options));
18
42
  return [
19
43
  createComponent(TSDoc, { get heading() {
@@ -28,7 +52,13 @@ function GlobalTypeDefinitions() {
28
52
  return Object.values(options.value);
29
53
  },
30
54
  hardline: true,
31
- children: (option) => createComponent(OptionsMember, { option })
55
+ get children() {
56
+ return __assignType((option) => createComponent(OptionsMember, { option }), [
57
+ "option",
58
+ "",
59
+ "P\"2!\"/\""
60
+ ]);
61
+ }
32
62
  });
33
63
  }
34
64
  }),
@@ -140,6 +170,7 @@ function GlobalTypeDefinitions() {
140
170
  })
141
171
  ];
142
172
  }
173
+ GlobalTypeDefinitions.__type = ["GlobalTypeDefinitions", "P\"/!"];
143
174
  /**
144
175
  * Generates utilities for detecting terminal color support.
145
176
  */
@@ -161,9 +192,18 @@ function ArgsUtilities() {
161
192
  children: code`return ((globalThis as { Deno?: { args: string[] } })?.Deno?.args ?? process.argv ?? []) as string[];`
162
193
  })];
163
194
  }
195
+ ArgsUtilities.__type = [
196
+ "ArgsUtilities",
197
+ "Generates utilities for detecting terminal color support.",
198
+ "P\"/!?\""
199
+ ];
164
200
  function ContextUtilities() {
165
- const context = usePowerlines();
166
- const options = computed(() => Object.fromEntries(context.options.map((option) => [option.name, option])));
201
+ const context = (usePowerlines.Ω = [["Context", "\"w!"]], usePowerlines());
202
+ const options = computed(() => Object.fromEntries(context.options.map(__assignType((option) => [option.name, option], [
203
+ "option",
204
+ "",
205
+ "P\"2!\"/\""
206
+ ]))));
167
207
  return [
168
208
  createComponent(Spacing, {}),
169
209
  createComponent(TSDoc, {
@@ -546,6 +586,14 @@ return result;`;
546
586
  })
547
587
  ];
548
588
  }
589
+ ContextUtilities.__type = ["ContextUtilities", "P\"/!"];
590
+ const __ΩStateBuiltinProps = [
591
+ () => __ΩOmit,
592
+ "id",
593
+ "description",
594
+ "StateBuiltinProps",
595
+ "P!P.\".#Jo!#Mw$y"
596
+ ];
549
597
  /**
550
598
  * A built-in module for handling application state utilities in Shell Shock.
551
599
  */
@@ -582,7 +630,14 @@ function StateBuiltin(props) {
582
630
  }
583
631
  }));
584
632
  }
633
+ StateBuiltin.__type = [
634
+ () => __ΩStateBuiltinProps,
635
+ "props",
636
+ "StateBuiltin",
637
+ "A built-in module for handling application state utilities in Shell Shock.",
638
+ "Pn!2\"\"/#?$"
639
+ ];
585
640
 
586
641
  //#endregion
587
- export { ArgsUtilities, ContextUtilities, GlobalTypeDefinitions, StateBuiltin };
642
+ export { ArgsUtilities, ContextUtilities, GlobalTypeDefinitions, StateBuiltin, __ΩStateBuiltinProps };
588
643
  //# sourceMappingURL=state-builtin.mjs.map