@shell-shock/plugin-completions 0.2.3 → 0.2.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 (47) hide show
  1. package/dist/_virtual/_rolldown/runtime.mjs +3 -0
  2. package/dist/components/bash-command.cjs +59 -58
  3. package/dist/components/bash-command.d.cts +2 -2
  4. package/dist/components/bash-command.d.cts.map +1 -1
  5. package/dist/components/bash-command.d.mts +2 -2
  6. package/dist/components/bash-command.d.mts.map +1 -1
  7. package/dist/components/bash-command.mjs.map +1 -1
  8. package/dist/components/fish-command.cjs +124 -123
  9. package/dist/components/fish-command.d.cts +2 -2
  10. package/dist/components/fish-command.d.cts.map +1 -1
  11. package/dist/components/fish-command.d.mts.map +1 -1
  12. package/dist/components/fish-command.mjs.map +1 -1
  13. package/dist/components/index.cjs +1 -0
  14. package/dist/components/powershell-command.cjs +82 -81
  15. package/dist/components/powershell-command.d.cts.map +1 -1
  16. package/dist/components/powershell-command.d.mts +2 -2
  17. package/dist/components/powershell-command.d.mts.map +1 -1
  18. package/dist/components/powershell-command.mjs +1 -1
  19. package/dist/components/powershell-command.mjs.map +1 -1
  20. package/dist/components/zsh-command.cjs +91 -90
  21. package/dist/components/zsh-command.d.cts.map +1 -1
  22. package/dist/components/zsh-command.d.mts.map +1 -1
  23. package/dist/components/zsh-command.mjs.map +1 -1
  24. package/dist/helpers/complete-command.cjs +1 -0
  25. package/dist/helpers/complete-command.d.cts.map +1 -1
  26. package/dist/helpers/complete-command.d.mts.map +1 -1
  27. package/dist/helpers/complete-command.mjs.map +1 -1
  28. package/dist/helpers/completion-directive-constants.cjs +1 -0
  29. package/dist/helpers/completion-directive-constants.d.cts.map +1 -1
  30. package/dist/helpers/completion-directive-constants.d.mts.map +1 -1
  31. package/dist/helpers/completion-directive-constants.mjs.map +1 -1
  32. package/dist/helpers/index.cjs +1 -0
  33. package/dist/index.cjs +22 -23
  34. package/dist/index.d.cts +0 -1
  35. package/dist/index.d.cts.map +1 -1
  36. package/dist/index.d.mts +0 -1
  37. package/dist/index.d.mts.map +1 -1
  38. package/dist/index.mjs +1 -2
  39. package/dist/index.mjs.map +1 -1
  40. package/dist/types/index.cjs +1 -0
  41. package/dist/types/plugin.d.cts.map +1 -1
  42. package/dist/types/plugin.d.mts.map +1 -1
  43. package/dist/types/shell-type.cjs +1 -0
  44. package/dist/types/shell-type.d.cts.map +1 -1
  45. package/dist/types/shell-type.d.mts.map +1 -1
  46. package/dist/types/shell-type.mjs.map +1 -1
  47. package/package.json +12 -12
@@ -1 +1 @@
1
- {"version":3,"file":"zsh-command.mjs","names":["code","FunctionDeclaration","IfStatement","InterfaceDeclaration","VarDeclaration","ReflectionKind","Spacing","usePowerlines","InterfaceMember","TypescriptFile","TSDoc","TSDocDefaultValue","TSDocRemarks","getAppBin","getAppTitle","joinPaths","snakeCase","exec","CompletionDirective","ZshCompletionsCommand","context","_$createComponent","path","entryPath","imports","builtinImports","children","heading","name","type","string","defaultValue","optional","async","parameters","initializer","CompletionDirectiveError","CompletionDirectiveNoSpace","CompletionDirectiveNoFileComp","CompletionDirectiveFilterFileExt","CompletionDirectiveFilterDirs","CompletionDirectiveKeepOrder","condition","_$memo"],"sources":["../../src/components/zsh-command.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 } from \"@alloy-js/core\";\nimport {\n FunctionDeclaration,\n IfStatement,\n InterfaceDeclaration,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n InterfaceMember,\n TypescriptFile\n} from \"@powerlines/plugin-alloy/typescript\";\nimport {\n TSDoc,\n TSDocDefaultValue,\n TSDocRemarks\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { getAppBin, getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport { snakeCase } from \"@stryke/string-format\";\nimport { exec } from \"../helpers/complete-command\";\nimport { CompletionDirective } from \"../helpers/completion-directive-constants\";\nimport type { CompletionsPluginContext } from \"../types/plugin\";\n\n/**\n * The Zsh Completions commands' handler wrapper for the Shell Shock project.\n */\nexport function ZshCompletionsCommand() {\n const context = usePowerlines<CompletionsPluginContext>();\n\n return (\n <TypescriptFile\n path={joinPaths(context.entryPath, \"completions\", \"zsh\", \"command.ts\")}\n imports={{\n \"node:os\": [\"os\"],\n \"node:fs/promises\": [\"readFile\", \"writeFile\"]\n }}\n builtinImports={{\n \"shell-shock:console\": [\n \"colors\",\n \"writeLine\",\n \"success\",\n \"warn\",\n \"stripAnsi\"\n ]\n }}>\n <TSDoc heading=\"Options for the Zsh completions command.\" />\n <InterfaceDeclaration export name=\"ZshCompletionsOptions\">\n <TSDoc heading=\"The path to write the completion script to.\">\n <TSDocRemarks>{`If no extension is provided, the \\`.zsh\\` extension will be used.`}</TSDocRemarks>\n <TSDocDefaultValue\n type={ReflectionKind.string}\n defaultValue={`${getAppBin(context)}-completions.zsh`}\n />\n </TSDoc>\n <InterfaceMember name=\"script\" optional type=\"string | true\" />\n <Spacing />\n <TSDoc heading=\"The Zsh configuration file to append the completion script to.\">\n <TSDocRemarks>{`The generated completion script will be appended to the specified configuration file. Possible values for the Zsh configuration file include: \\\\n- \\`~/.zshrc\\` \\\\n- \\`~/.zprofile\\``}</TSDocRemarks>\n <TSDocDefaultValue\n type={ReflectionKind.string}\n defaultValue=\"~/.zshrc\"\n />\n </TSDoc>\n <InterfaceMember name=\"config\" optional type=\"string | true\" />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Handler logic for the \\`completions zsh\\` command.\"></TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[{ name: \"options\", type: \"ZshCompletionsOptions\" }]}>\n <VarDeclaration\n const\n name=\"completions\"\n type=\"string\"\n initializer={code`#compdef ${getAppBin(context)}\ncompdef _${snakeCase(getAppBin(context))} ${getAppBin(context)}\n\n# zsh completion for ${getAppTitle(context)} -*- shell-script -*-\n\n__${snakeCase(getAppBin(context))}_debug() {\n local file=\"$BASH_COMP_DEBUG_FILE\"\n if [[ -n \\${file} ]]; then\n echo \"$*\" >> \"\\${file}\"\n fi\n}\n\n_${getAppBin(context)}() {\n local shellCompDirectiveError=${\n CompletionDirective.CompletionDirectiveError\n }\n local shellCompDirectiveNoSpace=${\n CompletionDirective.CompletionDirectiveNoSpace\n }\n local shellCompDirectiveNoFileComp=${\n CompletionDirective.CompletionDirectiveNoFileComp\n }\n local shellCompDirectiveFilterFileExt=${\n CompletionDirective.CompletionDirectiveFilterFileExt\n }\n local shellCompDirectiveFilterDirs=${\n CompletionDirective.CompletionDirectiveFilterDirs\n }\n local shellCompDirectiveKeepOrder=${\n CompletionDirective.CompletionDirectiveKeepOrder\n }\n\n local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder\n local -a completions\n\n __${snakeCase(getAppBin(context))}_debug \"\\\\n========= starting completion logic ==========\"\n __${snakeCase(getAppBin(context))}_debug \"CURRENT: \\${CURRENT}, words[*]: \\${words[*]}\"\n\n # The user could have moved the cursor backwards on the command-line.\n # We need to trigger completion from the $CURRENT location, so we need\n # to truncate the command-line ($words) up to the $CURRENT location.\n # (We cannot use $CURSOR as its value does not work when a command is an alias.)\n words=( \"\\${=words[1,CURRENT]}\" )\n __${snakeCase(getAppBin(context))}_debug \"Truncated words[*]: \\${words[*]},\"\n\n lastParam=\\${words[-1]}\n lastChar=\\${lastParam[-1]}\n __${snakeCase(getAppBin(context))}_debug \"lastParam: \\${lastParam}, lastChar: \\${lastChar}\"\n # For zsh, when completing a flag with an = (e.g., ${getAppBin(\n context\n )} -n=<TAB>)\n # completions must be prefixed with the flag\n setopt local_options BASH_REMATCH\n if [[ \"\\${lastParam}\" =~ '-.*=' ]]; then\n # We are dealing with a flag with an =\n flagPrefix=\"-P \\${BASH_REMATCH}\"\n fi\n\n # Prepare the command to obtain completions, ensuring arguments are quoted for eval\n local -a args_to_quote=(\"\\${(@)words[2,-1]}\")\n if [ \"\\${lastChar}\" = \"\" ]; then\n # If the last parameter is complete (there is a space following it)\n # We add an extra empty parameter so we can indicate this to the go completion code.\n __${snakeCase(getAppBin(context))}_debug \"Adding extra empty parameter\"\n args_to_quote+=(\"\")\n fi\n\n # Use Zsh's (q) flag to quote each argument safely for eval\n local quoted_args=(\"\\${(@q)args_to_quote}\")\n\n # Join the main command and the quoted arguments into a single string for eval\n requestComp=\"${exec} complete -- \\${quoted_args[*]}\"\n\n __${snakeCase(getAppBin(context))}_debug \"About to call: eval \\${requestComp}\"\n\n # Use eval to handle any environment variables and such\n out=$(eval \\${requestComp} 2>/dev/null)\n __${snakeCase(getAppBin(context))}_debug \"completion output: \\${out}\"\n\n # Extract the directive integer following a : from the last line\n local lastLine\n while IFS='\\n' read -r line; do\n lastLine=\\${line}\n done < <(printf \"%s\\n\" \"\\${out[@]}\")\n __${snakeCase(getAppBin(context))}_debug \"last line: \\${lastLine}\"\n\n if [ \"\\${lastLine[1]}\" = : ]; then\n directive=\\${lastLine[2,-1]}\n # Remove the directive including the : and the newline\n local suffix\n (( suffix=\\${#lastLine}+2))\n out=\\${out[1,-$suffix]}\n else\n # There is no directive specified. Leave $out as is.\n __${snakeCase(getAppBin(context))}_debug \"No directive found. Setting to default\"\n directive=0\n fi\n\n __${snakeCase(getAppBin(context))}_debug \"directive: \\${directive}\"\n __${snakeCase(getAppBin(context))}_debug \"completions: \\${out}\"\n __${snakeCase(getAppBin(context))}_debug \"flagPrefix: \\${flagPrefix}\"\n\n if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then\n __${snakeCase(getAppBin(context))}_debug \"Completion received error. Ignoring completions.\"\n return\n fi\n\n local activeHelpMarker=\"%\"\n local endIndex=\\${#activeHelpMarker}\n local startIndex=$((\\${#activeHelpMarker}+1))\n local hasActiveHelp=0\n while IFS='\\n' read -r comp; do\n # Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker)\n if [ \"\\${comp[1,$endIndex]}\" = \"$activeHelpMarker\" ];then\n __${snakeCase(getAppBin(context))}_debug \"ActiveHelp found: $comp\"\n comp=\"\\${comp[$startIndex,-1]}\"\n if [ -n \"$comp\" ]; then\n compadd -x \"\\${comp}\"\n __${snakeCase(getAppBin(context))}_debug \"ActiveHelp will need delimiter\"\n hasActiveHelp=1\n fi\n continue\n fi\n\n if [ -n \"$comp\" ]; then\n # If requested, completions are returned with a description.\n # The description is preceded by a TAB character.\n # For zsh's _describe, we need to use a : instead of a TAB.\n # We first need to escape any : as part of the completion itself.\n comp=\\${comp//:/\\\\:}\n\n local tab=\"$(printf '\\\\t')\"\n comp=\\${comp//$tab/:}\n\n __${snakeCase(getAppBin(context))}_debug \"Adding completion: \\${comp}\"\n completions+=\\${comp}\n lastComp=$comp\n fi\n done < <(printf \"%s\\n\" \"\\${out[@]}\")\n\n # Add a delimiter after the activeHelp statements, but only if:\n # - there are completions following the activeHelp statements, or\n # - file completion will be performed (so there will be choices after the activeHelp)\n if [ $hasActiveHelp -eq 1 ]; then\n if [ \\${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then\n __${snakeCase(getAppBin(context))}_debug \"Adding activeHelp delimiter\"\n compadd -x \"--\"\n hasActiveHelp=0\n fi\n fi\n\n if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then\n __${snakeCase(getAppBin(context))}_debug \"Activating nospace.\"\n noSpace=\"-S ''\"\n fi\n\n if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then\n __${snakeCase(getAppBin(context))}_debug \"Activating keep order.\"\n keepOrder=\"-V\"\n fi\n\n if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then\n # File extension filtering\n local filteringCmd\n filteringCmd='_files'\n for filter in \\${completions[@]}; do\n if [ \\${filter[1]} != '*' ]; then\n # zsh requires a glob pattern to do file filtering\n filter=\"\\\\*.$filter\"\n fi\n filteringCmd+=\" -g $filter\"\n done\n filteringCmd+=\" \\${flagPrefix}\"\n\n __${snakeCase(getAppBin(context))}_debug \"File filtering command: $filteringCmd\"\n _arguments '*:filename:'\"$filteringCmd\"\n elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then\n # File completion for directories only\n local subdir\n subdir=\"\\${completions[1]}\"\n if [ -n \"$subdir\" ]; then\n __${snakeCase(getAppBin(context))}_debug \"Listing directories in $subdir\"\n pushd \"\\${subdir}\" >/dev/null 2>&1\n else\n __${snakeCase(getAppBin(context))}_debug \"Listing directories in .\"\n fi\n\n local result\n _arguments '*:dirname:_files -/'\" \\${flagPrefix}\"\n result=$?\n if [ -n \"$subdir\" ]; then\n popd >/dev/null 2>&1\n fi\n return $result\n else\n __${snakeCase(getAppBin(context))}_debug \"Calling _describe\"\n if eval _describe $keepOrder \"completions\" completions -Q \\${flagPrefix} \\${noSpace}; then\n __${snakeCase(getAppBin(context))}_debug \"_describe found some completions\"\n\n # Return the success of having called _describe\n return 0\n else\n __${snakeCase(getAppBin(context))}_debug \"_describe did not find completions.\"\n __${snakeCase(getAppBin(context))}_debug \"Checking if we should do file completion.\"\n if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then\n __${snakeCase(getAppBin(context))}_debug \"deactivating file completion\"\n\n # Return 0 to indicate completion is finished and prevent zsh from\n # trying other completion algorithms (which could cause hanging).\n # We use NoFileComp directive to explicitly disable file completion.\n return 0\n else\n # Perform file completion\n __${snakeCase(getAppBin(context))}_debug \"Activating file completion\"\n\n # We must return the result of this command, so it must be the\n # last command, or else we must store its result to return it.\n _arguments '*:filename:_files'\" \\${flagPrefix}\"\n fi\n fi\n fi\n}\n\n# don't run the completion function when being sourced or eval-ed\nif [ \"\\${funcstack[1]}\" = \"_${snakeCase(getAppBin(context))}\" ]; then\n _${snakeCase(getAppBin(context))}\nfi\n\\`);`}\n />\n <Spacing />\n <IfStatement condition={code`options.config`}>\n <VarDeclaration\n let\n name=\"configFilePath\"\n type=\"string\"\n initializer={code`options.config === true ? \"~/.zshrc\" : options.config`}\n />\n <Spacing />\n <IfStatement condition={code`configFilePath.startsWith(\"~\")`}>\n {code`configFilePath = join(os.homedir(), configFilePath.replace(\"~\", \"\")); `}\n </IfStatement>\n <Spacing />\n <VarDeclaration\n let\n name=\"configFileContent\"\n type=\"string\"\n initializer={code`\"\";`}\n />\n <Spacing />\n {code`try {\n configFileContent = await readFile(configFilePath, \"utf8\");\n } catch (error) {\n if (error.code === \"ENOENT\") {\n // If the file doesn't exist, we can create it later when writing the completion script.\n warn(\\`Configuration file \\${colors.bold(configFilePath)} does not exist. It will be created when the completion script is written.\\`);\n } else {\n return { error };\n }\n }\n\n await writeFile(configFilePath, \\`\\${configFileContent}\\\\n\\\\n\\${stripAnsi(completions)}\\`);\n\n success(\\`${getAppTitle(context)} Zsh completion script has been generated and appended to \\${colors.bold(configFilePath)}. Please restart your terminal or run \\`source \\${configFilePath}\\` to apply the changes.\\`); `}\n </IfStatement>\n <Spacing />\n <IfStatement condition={code`options.script`}>\n {code`const outputPath = options.script === true ? \"${getAppBin(context)}-completions.zsh\" : options.script;\n await writeFile(outputPath, stripAnsi(completions));\n\n success(\\`${getAppTitle(context)} Zsh completion script has been generated at \\${colors.bold(outputPath)}.\\`);`}\n </IfStatement>\n <Spacing />\n <IfStatement condition={code`!options.config && !options.script`}>\n {code`writeLine(\" ------------------------------------------------- \");\n writeLine(completions);\n writeLine(\" ------------------------------------------------- \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,OAAA;WAEbwB,MAAI;WACJC,MAAI;WACJM,aAAanC,IAAI;WAAuD,CAAA;UAAAqB,gBAEzEf,SAAO,EAAA,CAAA;UAAAe,gBACPnB,aAAW;WAACwC,WAAW1C,IAAI;WAAgC0B,UACzD1B,IAAI;WAAwE,CAAA;UAAAqB,gBAE9Ef,SAAO,EAAA,CAAA;UAAAe,gBACPjB,gBAAc;WAAA,OAAA;WAEbwB,MAAI;WACJC,MAAI;WACJM,aAAanC,IAAI;WAAK,CAAA;UAAAqB,gBAEvBf,SAAO,EAAA,CAAA;UAAAqC,WACP3C,IAAI;;;;;;;;;;;;;sBAaOc,YAAYM,QAAQ,CAAA,yLAAyL;UAAA;;QAAA,CAAA;OAAAC,gBAE1Nf,SAAO,EAAA,CAAA;OAAAe,gBACPnB,aAAW;QAACwC,WAAW1C,IAAI;QAAgB,IAAA0B,WAAA;AAAA,gBACzC1B,IAAI,iDAAiDa,UAAUO,QAAQ,CAAA;;;sBAG5DN,YAAYM,QAAQ,CAAA;;QAA+E,CAAA;OAAAC,gBAEhHf,SAAO,EAAA,CAAA;OAAAe,gBACPnB,aAAW;QAACwC,WAAW1C,IAAI;QAAoC0B,UAC7D1B,IAAI;;;QAE6D,CAAA;OAAA;;KAAA,CAAA;IAAA;;EAAA,CAAA"}
1
+ {"version":3,"file":"zsh-command.mjs","names":[],"sources":["../../src/components/zsh-command.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 } from \"@alloy-js/core\";\nimport {\n FunctionDeclaration,\n IfStatement,\n InterfaceDeclaration,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n InterfaceMember,\n TypescriptFile\n} from \"@powerlines/plugin-alloy/typescript\";\nimport {\n TSDoc,\n TSDocDefaultValue,\n TSDocRemarks\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { getAppBin, getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport { snakeCase } from \"@stryke/string-format\";\nimport { exec } from \"../helpers/complete-command\";\nimport { CompletionDirective } from \"../helpers/completion-directive-constants\";\nimport type { CompletionsPluginContext } from \"../types/plugin\";\n\n/**\n * The Zsh Completions commands' handler wrapper for the Shell Shock project.\n */\nexport function ZshCompletionsCommand() {\n const context = usePowerlines<CompletionsPluginContext>();\n\n return (\n <TypescriptFile\n path={joinPaths(context.entryPath, \"completions\", \"zsh\", \"command.ts\")}\n imports={{\n \"node:os\": [\"os\"],\n \"node:fs/promises\": [\"readFile\", \"writeFile\"]\n }}\n builtinImports={{\n \"shell-shock:console\": [\n \"colors\",\n \"writeLine\",\n \"success\",\n \"warn\",\n \"stripAnsi\"\n ]\n }}>\n <TSDoc heading=\"Options for the Zsh completions command.\" />\n <InterfaceDeclaration export name=\"ZshCompletionsOptions\">\n <TSDoc heading=\"The path to write the completion script to.\">\n <TSDocRemarks>{`If no extension is provided, the \\`.zsh\\` extension will be used.`}</TSDocRemarks>\n <TSDocDefaultValue\n type={ReflectionKind.string}\n defaultValue={`${getAppBin(context)}-completions.zsh`}\n />\n </TSDoc>\n <InterfaceMember name=\"script\" optional type=\"string | true\" />\n <Spacing />\n <TSDoc heading=\"The Zsh configuration file to append the completion script to.\">\n <TSDocRemarks>{`The generated completion script will be appended to the specified configuration file. Possible values for the Zsh configuration file include: \\\\n- \\`~/.zshrc\\` \\\\n- \\`~/.zprofile\\``}</TSDocRemarks>\n <TSDocDefaultValue\n type={ReflectionKind.string}\n defaultValue=\"~/.zshrc\"\n />\n </TSDoc>\n <InterfaceMember name=\"config\" optional type=\"string | true\" />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Handler logic for the \\`completions zsh\\` command.\"></TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[{ name: \"options\", type: \"ZshCompletionsOptions\" }]}>\n <VarDeclaration\n const\n name=\"completions\"\n type=\"string\"\n initializer={code`#compdef ${getAppBin(context)}\ncompdef _${snakeCase(getAppBin(context))} ${getAppBin(context)}\n\n# zsh completion for ${getAppTitle(context)} -*- shell-script -*-\n\n__${snakeCase(getAppBin(context))}_debug() {\n local file=\"$BASH_COMP_DEBUG_FILE\"\n if [[ -n \\${file} ]]; then\n echo \"$*\" >> \"\\${file}\"\n fi\n}\n\n_${getAppBin(context)}() {\n local shellCompDirectiveError=${\n CompletionDirective.CompletionDirectiveError\n }\n local shellCompDirectiveNoSpace=${\n CompletionDirective.CompletionDirectiveNoSpace\n }\n local shellCompDirectiveNoFileComp=${\n CompletionDirective.CompletionDirectiveNoFileComp\n }\n local shellCompDirectiveFilterFileExt=${\n CompletionDirective.CompletionDirectiveFilterFileExt\n }\n local shellCompDirectiveFilterDirs=${\n CompletionDirective.CompletionDirectiveFilterDirs\n }\n local shellCompDirectiveKeepOrder=${\n CompletionDirective.CompletionDirectiveKeepOrder\n }\n\n local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder\n local -a completions\n\n __${snakeCase(getAppBin(context))}_debug \"\\\\n========= starting completion logic ==========\"\n __${snakeCase(getAppBin(context))}_debug \"CURRENT: \\${CURRENT}, words[*]: \\${words[*]}\"\n\n # The user could have moved the cursor backwards on the command-line.\n # We need to trigger completion from the $CURRENT location, so we need\n # to truncate the command-line ($words) up to the $CURRENT location.\n # (We cannot use $CURSOR as its value does not work when a command is an alias.)\n words=( \"\\${=words[1,CURRENT]}\" )\n __${snakeCase(getAppBin(context))}_debug \"Truncated words[*]: \\${words[*]},\"\n\n lastParam=\\${words[-1]}\n lastChar=\\${lastParam[-1]}\n __${snakeCase(getAppBin(context))}_debug \"lastParam: \\${lastParam}, lastChar: \\${lastChar}\"\n # For zsh, when completing a flag with an = (e.g., ${getAppBin(\n context\n )} -n=<TAB>)\n # completions must be prefixed with the flag\n setopt local_options BASH_REMATCH\n if [[ \"\\${lastParam}\" =~ '-.*=' ]]; then\n # We are dealing with a flag with an =\n flagPrefix=\"-P \\${BASH_REMATCH}\"\n fi\n\n # Prepare the command to obtain completions, ensuring arguments are quoted for eval\n local -a args_to_quote=(\"\\${(@)words[2,-1]}\")\n if [ \"\\${lastChar}\" = \"\" ]; then\n # If the last parameter is complete (there is a space following it)\n # We add an extra empty parameter so we can indicate this to the go completion code.\n __${snakeCase(getAppBin(context))}_debug \"Adding extra empty parameter\"\n args_to_quote+=(\"\")\n fi\n\n # Use Zsh's (q) flag to quote each argument safely for eval\n local quoted_args=(\"\\${(@q)args_to_quote}\")\n\n # Join the main command and the quoted arguments into a single string for eval\n requestComp=\"${exec} complete -- \\${quoted_args[*]}\"\n\n __${snakeCase(getAppBin(context))}_debug \"About to call: eval \\${requestComp}\"\n\n # Use eval to handle any environment variables and such\n out=$(eval \\${requestComp} 2>/dev/null)\n __${snakeCase(getAppBin(context))}_debug \"completion output: \\${out}\"\n\n # Extract the directive integer following a : from the last line\n local lastLine\n while IFS='\\n' read -r line; do\n lastLine=\\${line}\n done < <(printf \"%s\\n\" \"\\${out[@]}\")\n __${snakeCase(getAppBin(context))}_debug \"last line: \\${lastLine}\"\n\n if [ \"\\${lastLine[1]}\" = : ]; then\n directive=\\${lastLine[2,-1]}\n # Remove the directive including the : and the newline\n local suffix\n (( suffix=\\${#lastLine}+2))\n out=\\${out[1,-$suffix]}\n else\n # There is no directive specified. Leave $out as is.\n __${snakeCase(getAppBin(context))}_debug \"No directive found. Setting to default\"\n directive=0\n fi\n\n __${snakeCase(getAppBin(context))}_debug \"directive: \\${directive}\"\n __${snakeCase(getAppBin(context))}_debug \"completions: \\${out}\"\n __${snakeCase(getAppBin(context))}_debug \"flagPrefix: \\${flagPrefix}\"\n\n if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then\n __${snakeCase(getAppBin(context))}_debug \"Completion received error. Ignoring completions.\"\n return\n fi\n\n local activeHelpMarker=\"%\"\n local endIndex=\\${#activeHelpMarker}\n local startIndex=$((\\${#activeHelpMarker}+1))\n local hasActiveHelp=0\n while IFS='\\n' read -r comp; do\n # Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker)\n if [ \"\\${comp[1,$endIndex]}\" = \"$activeHelpMarker\" ];then\n __${snakeCase(getAppBin(context))}_debug \"ActiveHelp found: $comp\"\n comp=\"\\${comp[$startIndex,-1]}\"\n if [ -n \"$comp\" ]; then\n compadd -x \"\\${comp}\"\n __${snakeCase(getAppBin(context))}_debug \"ActiveHelp will need delimiter\"\n hasActiveHelp=1\n fi\n continue\n fi\n\n if [ -n \"$comp\" ]; then\n # If requested, completions are returned with a description.\n # The description is preceded by a TAB character.\n # For zsh's _describe, we need to use a : instead of a TAB.\n # We first need to escape any : as part of the completion itself.\n comp=\\${comp//:/\\\\:}\n\n local tab=\"$(printf '\\\\t')\"\n comp=\\${comp//$tab/:}\n\n __${snakeCase(getAppBin(context))}_debug \"Adding completion: \\${comp}\"\n completions+=\\${comp}\n lastComp=$comp\n fi\n done < <(printf \"%s\\n\" \"\\${out[@]}\")\n\n # Add a delimiter after the activeHelp statements, but only if:\n # - there are completions following the activeHelp statements, or\n # - file completion will be performed (so there will be choices after the activeHelp)\n if [ $hasActiveHelp -eq 1 ]; then\n if [ \\${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then\n __${snakeCase(getAppBin(context))}_debug \"Adding activeHelp delimiter\"\n compadd -x \"--\"\n hasActiveHelp=0\n fi\n fi\n\n if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then\n __${snakeCase(getAppBin(context))}_debug \"Activating nospace.\"\n noSpace=\"-S ''\"\n fi\n\n if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then\n __${snakeCase(getAppBin(context))}_debug \"Activating keep order.\"\n keepOrder=\"-V\"\n fi\n\n if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then\n # File extension filtering\n local filteringCmd\n filteringCmd='_files'\n for filter in \\${completions[@]}; do\n if [ \\${filter[1]} != '*' ]; then\n # zsh requires a glob pattern to do file filtering\n filter=\"\\\\*.$filter\"\n fi\n filteringCmd+=\" -g $filter\"\n done\n filteringCmd+=\" \\${flagPrefix}\"\n\n __${snakeCase(getAppBin(context))}_debug \"File filtering command: $filteringCmd\"\n _arguments '*:filename:'\"$filteringCmd\"\n elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then\n # File completion for directories only\n local subdir\n subdir=\"\\${completions[1]}\"\n if [ -n \"$subdir\" ]; then\n __${snakeCase(getAppBin(context))}_debug \"Listing directories in $subdir\"\n pushd \"\\${subdir}\" >/dev/null 2>&1\n else\n __${snakeCase(getAppBin(context))}_debug \"Listing directories in .\"\n fi\n\n local result\n _arguments '*:dirname:_files -/'\" \\${flagPrefix}\"\n result=$?\n if [ -n \"$subdir\" ]; then\n popd >/dev/null 2>&1\n fi\n return $result\n else\n __${snakeCase(getAppBin(context))}_debug \"Calling _describe\"\n if eval _describe $keepOrder \"completions\" completions -Q \\${flagPrefix} \\${noSpace}; then\n __${snakeCase(getAppBin(context))}_debug \"_describe found some completions\"\n\n # Return the success of having called _describe\n return 0\n else\n __${snakeCase(getAppBin(context))}_debug \"_describe did not find completions.\"\n __${snakeCase(getAppBin(context))}_debug \"Checking if we should do file completion.\"\n if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then\n __${snakeCase(getAppBin(context))}_debug \"deactivating file completion\"\n\n # Return 0 to indicate completion is finished and prevent zsh from\n # trying other completion algorithms (which could cause hanging).\n # We use NoFileComp directive to explicitly disable file completion.\n return 0\n else\n # Perform file completion\n __${snakeCase(getAppBin(context))}_debug \"Activating file completion\"\n\n # We must return the result of this command, so it must be the\n # last command, or else we must store its result to return it.\n _arguments '*:filename:_files'\" \\${flagPrefix}\"\n fi\n fi\n fi\n}\n\n# don't run the completion function when being sourced or eval-ed\nif [ \"\\${funcstack[1]}\" = \"_${snakeCase(getAppBin(context))}\" ]; then\n _${snakeCase(getAppBin(context))}\nfi\n\\`);`}\n />\n <Spacing />\n <IfStatement condition={code`options.config`}>\n <VarDeclaration\n let\n name=\"configFilePath\"\n type=\"string\"\n initializer={code`options.config === true ? \"~/.zshrc\" : options.config`}\n />\n <Spacing />\n <IfStatement condition={code`configFilePath.startsWith(\"~\")`}>\n {code`configFilePath = join(os.homedir(), configFilePath.replace(\"~\", \"\")); `}\n </IfStatement>\n <Spacing />\n <VarDeclaration\n let\n name=\"configFileContent\"\n type=\"string\"\n initializer={code`\"\";`}\n />\n <Spacing />\n {code`try {\n configFileContent = await readFile(configFilePath, \"utf8\");\n } catch (error) {\n if (error.code === \"ENOENT\") {\n // If the file doesn't exist, we can create it later when writing the completion script.\n warn(\\`Configuration file \\${colors.bold(configFilePath)} does not exist. It will be created when the completion script is written.\\`);\n } else {\n return { error };\n }\n }\n\n await writeFile(configFilePath, \\`\\${configFileContent}\\\\n\\\\n\\${stripAnsi(completions)}\\`);\n\n success(\\`${getAppTitle(context)} Zsh completion script has been generated and appended to \\${colors.bold(configFilePath)}. Please restart your terminal or run \\`source \\${configFilePath}\\` to apply the changes.\\`); `}\n </IfStatement>\n <Spacing />\n <IfStatement condition={code`options.script`}>\n {code`const outputPath = options.script === true ? \"${getAppBin(context)}-completions.zsh\" : options.script;\n await writeFile(outputPath, stripAnsi(completions));\n\n success(\\`${getAppTitle(context)} Zsh completion script has been generated at \\${colors.bold(outputPath)}.\\`);`}\n </IfStatement>\n <Spacing />\n <IfStatement condition={code`!options.config && !options.script`}>\n {code`writeLine(\" ------------------------------------------------- \");\n writeLine(completions);\n writeLine(\" ------------------------------------------------- \");`}\n </IfStatement>\n </FunctionDeclaration>\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAoCA,SAAS,wBAAwB;CACjC,MAAQ,UAAU,eAAwC;AAC1D,QAAS,gBAAkB,gBAAa;EACxC,IAAQ,OAAC;AACH,UAAO,UAAU,QAAE,WAAiB,eAAQ,OAAA,aAAA;;EAElD,SAAa;;GAEX,oBAAA,CAAA,YAAA,YAAA;GACC;EACD,gBAAA,EACI,uBAAU;GAAA;GAAwB;GAAA;GAAA;GAAA;GAAA,EACtC;;AAEA,UAAO;IAAA,gBAAA,OAAA,EACJ,SAAA,4CACC,CAAA;IAAI,gBAAY,sBAAoB;KACpC,UAAS;KACP,MAAM;KACN,IAAC,WAAQ;AACV,aAAA;OAAA,gBAAA,OAAA;QACD,SAAe;QACZ,IAAM,WAAM;AACV,gBAAO,CAAA,gBAAA,cAAA,EACP,UAAU,qEACV,CAAA,EAAO,gBAAC,mBAAA;UACH,IAAA,OAAA;AACL,kBAAS,eAAA;;UAEZ,IAAA,eAAA;AACK,kBAAS,GAAA,UAAgB,QAAI,CAAA;;UAE3B,CAAA,CAAA;;QAEJ,CAAA;OAAA,gBAAA,iBAAA;QACC,MAAM;QACN,UAAA;QACD,MAAA;QACD,CAAA;OAAA,gBAAK,SAAA,EAAA,CAAA;OAAA,gBAAA,OAAA;QACN,SAAA;QACA,IAAO,WAAE;AACJ,gBAAC,CAAO,gBAAU,cAAsB,EAC3C,UAAe,wLACf,CAAA,EAAA,gBAAA,mBAAA;UACK,IAAE,OAAA;AACN,kBAAa,eAAS;;UAEnB,cAAA;UACN,CAAA,CAAA;;QAEF,CAAA;OAAO,gBAAE,iBAAA;QACJ,MAAC;QACN,UAAA;QACC,MAAA;QACA,CAAA;OAAA;;KAED,CAAC;IAAA,gBAAa,SAAA,EAAA,CAAA;IAAA,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,aAAA;QAC1C,WAAW,IAAA;QACZ,UAAM,IAAU;;;QAGhB,CAAA;OAAA;;KAEH,CAAC;IAAC;;EAEN,CAAC"}
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
 
2
3
  //#region src/helpers/complete-command.ts
3
4
  function quoteIfNeeded(path) {
@@ -1 +1 @@
1
- {"version":3,"file":"complete-command.d.cts","names":[],"sources":["../../src/helpers/complete-command.ts"],"sourcesContent":[],"mappings":";cA4Ba"}
1
+ {"version":3,"file":"complete-command.d.cts","names":[],"sources":["../../src/helpers/complete-command.ts"],"mappings":";cA4Ba,IAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"complete-command.d.mts","names":[],"sources":["../../src/helpers/complete-command.ts"],"sourcesContent":[],"mappings":";cA4Ba"}
1
+ {"version":3,"file":"complete-command.d.mts","names":[],"sources":["../../src/helpers/complete-command.ts"],"mappings":";cA4Ba,IAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"complete-command.mjs","names":["quoteIfNeeded","path","includes","execPath","process","processArgs","argv","slice","quotedExecPath","quotedProcessArgs","map","quotedProcessExecArgs","execArgv","exec","join"],"sources":["../../src/helpers/complete-command.ts"],"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\nfunction quoteIfNeeded(path: string): string {\n return path.includes(\" \") ? `'${path}'` : path;\n}\n\nconst execPath = process.execPath;\nconst processArgs = process.argv.slice(1);\nconst quotedExecPath = quoteIfNeeded(execPath);\nconst quotedProcessArgs = processArgs.map(quoteIfNeeded);\nconst quotedProcessExecArgs = process.execArgv.map(quoteIfNeeded);\n\nexport const exec = `${quotedExecPath} ${quotedProcessExecArgs.join(\" \")} ${\n quotedProcessArgs[0]\n}`;\n"],"mappings":";AAkBA,SAASA,cAAcC,MAAsB;AAC3C,QAAOA,KAAKC,SAAS,IAAI,GAAG,IAAID,KAAI,KAAMA;;AAG5C,MAAME,WAAWC,QAAQD;AACzB,MAAME,cAAcD,QAAQE,KAAKC,MAAM,EAAE;AACzC,MAAMC,iBAAiBR,cAAcG,SAAS;AAC9C,MAAMM,oBAAoBJ,YAAYK,IAAIV,cAAc;AACxD,MAAMW,wBAAwBP,QAAQQ,SAASF,IAAIV,cAAc;AAEjE,MAAaa,OAAO,GAAGL,eAAc,GAAIG,sBAAsBG,KAAK,IAAI,CAAA,GACtEL,kBAAkB"}
1
+ {"version":3,"file":"complete-command.mjs","names":[],"sources":["../../src/helpers/complete-command.ts"],"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\nfunction quoteIfNeeded(path: string): string {\n return path.includes(\" \") ? `'${path}'` : path;\n}\n\nconst execPath = process.execPath;\nconst processArgs = process.argv.slice(1);\nconst quotedExecPath = quoteIfNeeded(execPath);\nconst quotedProcessArgs = processArgs.map(quoteIfNeeded);\nconst quotedProcessExecArgs = process.execArgv.map(quoteIfNeeded);\n\nexport const exec = `${quotedExecPath} ${quotedProcessExecArgs.join(\" \")} ${\n quotedProcessArgs[0]\n}`;\n"],"mappings":";AAkBA,SAAS,cAAc,MAAsB;AAC3C,QAAO,KAAK,SAAS,IAAI,GAAG,IAAI,KAAK,KAAK;;AAG5C,MAAM,WAAW,QAAQ;AACzB,MAAM,cAAc,QAAQ,KAAK,MAAM,EAAE;AACzC,MAAM,iBAAiB,cAAc,SAAS;AAC9C,MAAM,oBAAoB,YAAY,IAAI,cAAc;AACxD,MAAM,wBAAwB,QAAQ,SAAS,IAAI,cAAc;AAEjE,MAAa,OAAO,GAAG,eAAe,GAAG,sBAAsB,KAAK,IAAI,CAAC,GACvE,kBAAkB"}
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
 
2
3
  //#region src/helpers/completion-directive-constants.ts
3
4
  const CompletionDirective = {
@@ -1 +1 @@
1
- {"version":3,"file":"completion-directive-constants.d.cts","names":[],"sources":["../../src/helpers/completion-directive-constants.ts"],"sourcesContent":[],"mappings":";cAkBa;EAAA,wBASZ,EAAA,MAAA"}
1
+ {"version":3,"file":"completion-directive-constants.d.cts","names":[],"sources":["../../src/helpers/completion-directive-constants.ts"],"mappings":";cAkBa,mBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"completion-directive-constants.d.mts","names":[],"sources":["../../src/helpers/completion-directive-constants.ts"],"sourcesContent":[],"mappings":";cAkBa;EAAA,wBASZ,EAAA,MAAA"}
1
+ {"version":3,"file":"completion-directive-constants.d.mts","names":[],"sources":["../../src/helpers/completion-directive-constants.ts"],"mappings":";cAkBa,mBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"completion-directive-constants.mjs","names":["CompletionDirective","CompletionDirectiveError","CompletionDirectiveNoSpace","CompletionDirectiveNoFileComp","CompletionDirectiveFilterFileExt","CompletionDirectiveFilterDirs","CompletionDirectiveKeepOrder","CompletionDirectiveMaxValue","CompletionDirectiveDefault"],"sources":["../../src/helpers/completion-directive-constants.ts"],"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\nexport const CompletionDirective = {\n CompletionDirectiveError: 1 << 0,\n CompletionDirectiveNoSpace: 1 << 1,\n CompletionDirectiveNoFileComp: 1 << 2,\n CompletionDirectiveFilterFileExt: 1 << 3,\n CompletionDirectiveFilterDirs: 1 << 4,\n CompletionDirectiveKeepOrder: 1 << 5,\n CompletionDirectiveMaxValue: 1 << 6,\n CompletionDirectiveDefault: 0\n};\n"],"mappings":";AAkBA,MAAaA,sBAAsB;CACjCC,0BAA0B;CAC1BC,4BAA4B;CAC5BC,+BAA+B;CAC/BC,kCAAkC;CAClCC,+BAA+B;CAC/BC,8BAA8B;CAC9BC,6BAA6B;CAC7BC,4BAA4B;CAC7B"}
1
+ {"version":3,"file":"completion-directive-constants.mjs","names":[],"sources":["../../src/helpers/completion-directive-constants.ts"],"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\nexport const CompletionDirective = {\n CompletionDirectiveError: 1 << 0,\n CompletionDirectiveNoSpace: 1 << 1,\n CompletionDirectiveNoFileComp: 1 << 2,\n CompletionDirectiveFilterFileExt: 1 << 3,\n CompletionDirectiveFilterDirs: 1 << 4,\n CompletionDirectiveKeepOrder: 1 << 5,\n CompletionDirectiveMaxValue: 1 << 6,\n CompletionDirectiveDefault: 0\n};\n"],"mappings":";AAkBA,MAAa,sBAAsB;CACjC,0BAA0B;CAC1B,4BAA4B;CAC5B,+BAA+B;CAC/B,kCAAkC;CAClC,+BAA+B;CAC/B,8BAA8B;CAC9B,6BAA6B;CAC7B,4BAA4B;CAC7B"}
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
  const require_helpers_complete_command = require('./complete-command.cjs');
2
3
  const require_helpers_completion_directive_constants = require('./completion-directive-constants.cjs');
3
4
 
package/dist/index.cjs CHANGED
@@ -1,15 +1,15 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
2
  const require_components_bash_command = require('./components/bash-command.cjs');
3
3
  const require_components_fish_command = require('./components/fish-command.cjs');
4
4
  const require_components_powershell_command = require('./components/powershell-command.cjs');
5
5
  const require_components_zsh_command = require('./components/zsh-command.cjs');
6
6
  require('./components/index.cjs');
7
7
  const require_types_shell_type = require('./types/shell-type.cjs');
8
- let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
9
- let __powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
10
- let __shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
11
- let __stryke_path = require("@stryke/path");
12
- let __stryke_path_join = require("@stryke/path/join");
8
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
9
+ let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
10
+ let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
11
+ let _stryke_path = require("@stryke/path");
12
+ let _stryke_path_join = require("@stryke/path/join");
13
13
 
14
14
  //#region src/index.tsx
15
15
  /**
@@ -36,72 +36,71 @@ const plugin = (options = {}) => {
36
36
  path: "completions",
37
37
  segments: ["completions"],
38
38
  title: "CLI Completions",
39
- description: `Commands for generating shell completion scripts for ${(0, __shell_shock_core_plugin_utils.getAppTitle)(this)}.`,
40
- entry: { file: (0, __stryke_path_join.joinPaths)(this.entryPath, "completions", "command.ts") },
39
+ description: `Commands for generating shell completion scripts for ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this)}.`,
40
+ entry: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "command.ts") },
41
41
  isVirtual: true
42
42
  });
43
43
  if (this.config.completions.shells.includes("bash")) if (this.inputs.some((input) => input.id === "completions-bash")) this.info("The `completions-bash` command already exists in the commands list. If you would like the completions-bash command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
44
44
  else this.inputs.push({
45
45
  id: "completions-bash",
46
46
  name: "bash",
47
- description: `Generate a Bash completion script for the ${(0, __shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
47
+ description: `Generate a Bash completion script for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
48
48
  alias: [],
49
49
  path: "completions/bash",
50
50
  segments: ["completions", "bash"],
51
51
  title: "CLI Completions - Bash Shell",
52
- entry: { file: (0, __stryke_path_join.joinPaths)(this.entryPath, "completions", "bash", "command.ts") },
52
+ entry: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "bash", "command.ts") },
53
53
  isVirtual: false
54
54
  });
55
55
  if (this.config.completions.shells.includes("zsh")) if (this.inputs.some((input) => input.id === "completions-zsh")) this.info("The `completions-zsh` command already exists in the commands list. If you would like the completions-zsh command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
56
56
  else this.inputs.push({
57
57
  id: "completions-zsh",
58
58
  name: "zsh",
59
- description: `Generate a Zsh completion script for the ${(0, __shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
59
+ description: `Generate a Zsh completion script for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
60
60
  alias: [],
61
61
  path: "completions/zsh",
62
62
  segments: ["completions", "zsh"],
63
63
  title: "CLI Completions - Zsh Shell",
64
- entry: { file: (0, __stryke_path.relativePath)(this.commandsPath, (0, __stryke_path_join.joinPaths)(this.entryPath, "completions", "zsh", "command.ts")) },
64
+ entry: { file: (0, _stryke_path.relativePath)(this.commandsPath, (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "zsh", "command.ts")) },
65
65
  isVirtual: false
66
66
  });
67
67
  if (this.config.completions.shells.includes("powershell")) if (this.inputs.some((input) => input.id === "completions-powershell")) this.info("The `completions-powershell` command already exists in the commands list. If you would like the completions-powershell command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
68
68
  else this.inputs.push({
69
69
  id: "completions-powershell",
70
70
  name: "powershell",
71
- description: `Generate a PowerShell completion script for the ${(0, __shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
71
+ description: `Generate a PowerShell completion script for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
72
72
  alias: [],
73
73
  path: "completions/powershell",
74
74
  segments: ["completions", "powershell"],
75
75
  title: "CLI Completions - PowerShell",
76
- entry: { file: (0, __stryke_path.relativePath)(this.commandsPath, (0, __stryke_path_join.joinPaths)(this.entryPath, "completions", "powershell", "command.ts")) },
76
+ entry: { file: (0, _stryke_path.relativePath)(this.commandsPath, (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "powershell", "command.ts")) },
77
77
  isVirtual: false
78
78
  });
79
79
  if (this.config.completions.shells.includes("fish")) if (this.inputs.some((input) => input.id === "completions-fish")) this.info("The `completions-fish` command already exists in the commands list. If you would like the completions-fish command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
80
80
  else this.inputs.push({
81
81
  id: "completions-fish",
82
82
  name: "fish",
83
- description: `Generate a Fish completion script for the ${(0, __shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
83
+ description: `Generate a Fish completion script for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
84
84
  alias: [],
85
85
  path: "completions/fish",
86
86
  segments: ["completions", "fish"],
87
87
  title: "CLI Completions - Fish Shell",
88
- entry: { file: (0, __stryke_path.relativePath)(this.commandsPath, (0, __stryke_path_join.joinPaths)(this.entryPath, "completions", "fish", "command.ts")) },
88
+ entry: { file: (0, _stryke_path.relativePath)(this.commandsPath, (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "fish", "command.ts")) },
89
89
  isVirtual: false
90
90
  });
91
91
  },
92
92
  async prepare() {
93
93
  this.debug("Rendering command handling modules for the Shell Shock `completions` plugin.");
94
- return (0, __powerlines_plugin_alloy_render.render)(this, [
95
- (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_bash_command.BashCompletionsCommand, {}),
96
- (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_zsh_command.ZshCompletionsCommand, {}),
97
- (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_powershell_command.PowerShellCompletionsCommand, {}),
98
- (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_fish_command.FishCompletionsCommand, {})
94
+ return (0, _powerlines_plugin_alloy_render.render)(this, [
95
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_bash_command.BashCompletionsCommand, {}),
96
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_zsh_command.ZshCompletionsCommand, {}),
97
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_powershell_command.PowerShellCompletionsCommand, {}),
98
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_fish_command.FishCompletionsCommand, {})
99
99
  ]);
100
100
  }
101
101
  }];
102
102
  };
103
- var src_default = plugin;
104
103
 
105
104
  //#endregion
106
- exports.default = src_default;
105
+ exports.default = plugin;
107
106
  exports.plugin = plugin;
package/dist/index.d.cts CHANGED
@@ -3,7 +3,6 @@ import { CompletionsPluginContext, CompletionsPluginOptions, CompletionsPluginRe
3
3
  import { Plugin } from "powerlines";
4
4
 
5
5
  //#region src/index.d.ts
6
-
7
6
  /**
8
7
  * The Completions - Shell Shock plugin to add completion commands to a Shell Shock application.
9
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAwCA;AACmB,cADN,MACM,EAAA,CAAA,iBAAA,wBAAA,GAA2B,wBAA3B,CAAA,CAAA,OAAA,CAAA,EAER,wBAFQ,EAAA,GAGhB,MAHgB,CAGT,QAHS,CAAA,EAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;AAwCA;cAAa,MAAA,oBACM,wBAAA,GAA2B,wBAAA,EAE5C,OAAA,GAAS,wBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.d.mts CHANGED
@@ -3,7 +3,6 @@ import { CompletionsPluginContext, CompletionsPluginOptions, CompletionsPluginRe
3
3
  import { Plugin } from "powerlines";
4
4
 
5
5
  //#region src/index.d.ts
6
-
7
6
  /**
8
7
  * The Completions - Shell Shock plugin to add completion commands to a Shell Shock application.
9
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAwCA;AACmB,cADN,MACM,EAAA,CAAA,iBAAA,wBAAA,GAA2B,wBAA3B,CAAA,CAAA,OAAA,CAAA,EAER,wBAFQ,EAAA,GAGhB,MAHgB,CAGT,QAHS,CAAA,EAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;AAwCA;cAAa,MAAA,oBACM,wBAAA,GAA2B,wBAAA,EAE5C,OAAA,GAAS,wBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.mjs CHANGED
@@ -99,8 +99,7 @@ const plugin = (options = {}) => {
99
99
  }
100
100
  }];
101
101
  };
102
- var src_default = plugin;
103
102
 
104
103
  //#endregion
105
- export { src_default as default, plugin };
104
+ export { plugin as default, plugin };
106
105
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["render","getAppTitle","relativePath","joinPaths","BashCompletionsCommand","FishCompletionsCommand","PowerShellCompletionsCommand","ZshCompletionsCommand","SHELL_TYPES","plugin","options","name","config","debug","completions","shells","configResolved","inputs","some","input","id","info","push","alias","path","segments","title","description","entry","file","entryPath","isVirtual","includes","commandsPath","prepare","_$createComponent"],"sources":["../src/index.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 { render } from \"@powerlines/plugin-alloy/render\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { relativePath } from \"@stryke/path\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport type { Plugin } from \"powerlines\";\nimport {\n BashCompletionsCommand,\n FishCompletionsCommand,\n PowerShellCompletionsCommand,\n ZshCompletionsCommand\n} from \"./components\";\nimport type {\n CompletionsPluginContext,\n CompletionsPluginOptions\n} from \"./types/plugin\";\nimport { SHELL_TYPES } from \"./types/shell-type\";\n\nexport type * from \"./types\";\n\n/**\n * The Completions - Shell Shock plugin to add completion commands to a Shell Shock application.\n */\nexport const plugin = <\n TContext extends CompletionsPluginContext = CompletionsPluginContext\n>(\n options: CompletionsPluginOptions = {}\n): Plugin<TContext>[] => {\n return [\n {\n name: \"shell-shock:completions\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `completions` plugin.\"\n );\n\n return {\n completions: { shells: SHELL_TYPES, ...options }\n };\n },\n configResolved() {\n this.debug(\n \"Adding the CLI completion commands to the application context.\"\n );\n\n this.inputs ??= [];\n if (this.inputs.some(input => input.id === \"completions\")) {\n this.info(\n \"The `completions` command already exists in the commands list. If you would like the completions command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions\",\n name: \"completions\",\n alias: [\"completion\"],\n path: \"completions\",\n segments: [\"completions\"],\n title: \"CLI Completions\",\n description: `Commands for generating shell completion scripts for ${getAppTitle(\n this\n )}.`,\n entry: {\n file: joinPaths(this.entryPath, \"completions\", \"command.ts\")\n },\n isVirtual: true\n });\n }\n\n if (this.config.completions.shells.includes(\"bash\")) {\n if (this.inputs.some(input => input.id === \"completions-bash\")) {\n this.info(\n \"The `completions-bash` command already exists in the commands list. If you would like the completions-bash command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-bash\",\n name: \"bash\",\n description: `Generate a Bash completion script for the ${getAppTitle(\n this,\n true\n )} command-line interface.`,\n alias: [],\n path: \"completions/bash\",\n segments: [\"completions\", \"bash\"],\n title: \"CLI Completions - Bash Shell\",\n entry: {\n file: joinPaths(\n this.entryPath,\n \"completions\",\n \"bash\",\n \"command.ts\"\n )\n },\n isVirtual: false\n });\n }\n }\n\n if (this.config.completions.shells.includes(\"zsh\")) {\n if (this.inputs.some(input => input.id === \"completions-zsh\")) {\n this.info(\n \"The `completions-zsh` command already exists in the commands list. If you would like the completions-zsh command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-zsh\",\n name: \"zsh\",\n description: `Generate a Zsh completion script for the ${getAppTitle(\n this,\n true\n )} command-line interface.`,\n alias: [],\n path: \"completions/zsh\",\n segments: [\"completions\", \"zsh\"],\n title: \"CLI Completions - Zsh Shell\",\n entry: {\n file: relativePath(\n this.commandsPath,\n joinPaths(this.entryPath, \"completions\", \"zsh\", \"command.ts\")\n )\n },\n isVirtual: false\n });\n }\n }\n\n if (this.config.completions.shells.includes(\"powershell\")) {\n if (\n this.inputs.some(input => input.id === \"completions-powershell\")\n ) {\n this.info(\n \"The `completions-powershell` command already exists in the commands list. If you would like the completions-powershell command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-powershell\",\n name: \"powershell\",\n description: `Generate a PowerShell completion script for the ${getAppTitle(\n this,\n true\n )} command-line interface.`,\n alias: [],\n path: \"completions/powershell\",\n segments: [\"completions\", \"powershell\"],\n title: \"CLI Completions - PowerShell\",\n entry: {\n file: relativePath(\n this.commandsPath,\n joinPaths(\n this.entryPath,\n \"completions\",\n \"powershell\",\n \"command.ts\"\n )\n )\n },\n isVirtual: false\n });\n }\n }\n\n if (this.config.completions.shells.includes(\"fish\")) {\n if (this.inputs.some(input => input.id === \"completions-fish\")) {\n this.info(\n \"The `completions-fish` command already exists in the commands list. If you would like the completions-fish command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-fish\",\n name: \"fish\",\n description: `Generate a Fish completion script for the ${getAppTitle(\n this,\n true\n )} command-line interface.`,\n alias: [],\n path: \"completions/fish\",\n segments: [\"completions\", \"fish\"],\n title: \"CLI Completions - Fish Shell\",\n entry: {\n file: relativePath(\n this.commandsPath,\n joinPaths(this.entryPath, \"completions\", \"fish\", \"command.ts\")\n )\n },\n isVirtual: false\n });\n }\n }\n },\n async prepare() {\n this.debug(\n \"Rendering command handling modules for the Shell Shock `completions` plugin.\"\n );\n\n return render(\n this,\n <>\n <BashCompletionsCommand />\n <ZshCompletionsCommand />\n <PowerShellCompletionsCommand />\n <FishCompletionsCommand />\n </>\n );\n }\n }\n ];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;AAwCA,MAAaS,UAGXC,UAAoC,EAAE,KACf;AACvB,QAAO,CACL;EACEC,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H,kBAAeI"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.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 { render } from \"@powerlines/plugin-alloy/render\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { relativePath } from \"@stryke/path\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport type { Plugin } from \"powerlines\";\nimport {\n BashCompletionsCommand,\n FishCompletionsCommand,\n PowerShellCompletionsCommand,\n ZshCompletionsCommand\n} from \"./components\";\nimport type {\n CompletionsPluginContext,\n CompletionsPluginOptions\n} from \"./types/plugin\";\nimport { SHELL_TYPES } from \"./types/shell-type\";\n\nexport type * from \"./types\";\n\n/**\n * The Completions - Shell Shock plugin to add completion commands to a Shell Shock application.\n */\nexport const plugin = <\n TContext extends CompletionsPluginContext = CompletionsPluginContext\n>(\n options: CompletionsPluginOptions = {}\n): Plugin<TContext>[] => {\n return [\n {\n name: \"shell-shock:completions\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `completions` plugin.\"\n );\n\n return {\n completions: { shells: SHELL_TYPES, ...options }\n };\n },\n configResolved() {\n this.debug(\n \"Adding the CLI completion commands to the application context.\"\n );\n\n this.inputs ??= [];\n if (this.inputs.some(input => input.id === \"completions\")) {\n this.info(\n \"The `completions` command already exists in the commands list. If you would like the completions command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions\",\n name: \"completions\",\n alias: [\"completion\"],\n path: \"completions\",\n segments: [\"completions\"],\n title: \"CLI Completions\",\n description: `Commands for generating shell completion scripts for ${getAppTitle(\n this\n )}.`,\n entry: {\n file: joinPaths(this.entryPath, \"completions\", \"command.ts\")\n },\n isVirtual: true\n });\n }\n\n if (this.config.completions.shells.includes(\"bash\")) {\n if (this.inputs.some(input => input.id === \"completions-bash\")) {\n this.info(\n \"The `completions-bash` command already exists in the commands list. If you would like the completions-bash command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-bash\",\n name: \"bash\",\n description: `Generate a Bash completion script for the ${getAppTitle(\n this,\n true\n )} command-line interface.`,\n alias: [],\n path: \"completions/bash\",\n segments: [\"completions\", \"bash\"],\n title: \"CLI Completions - Bash Shell\",\n entry: {\n file: joinPaths(\n this.entryPath,\n \"completions\",\n \"bash\",\n \"command.ts\"\n )\n },\n isVirtual: false\n });\n }\n }\n\n if (this.config.completions.shells.includes(\"zsh\")) {\n if (this.inputs.some(input => input.id === \"completions-zsh\")) {\n this.info(\n \"The `completions-zsh` command already exists in the commands list. If you would like the completions-zsh command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-zsh\",\n name: \"zsh\",\n description: `Generate a Zsh completion script for the ${getAppTitle(\n this,\n true\n )} command-line interface.`,\n alias: [],\n path: \"completions/zsh\",\n segments: [\"completions\", \"zsh\"],\n title: \"CLI Completions - Zsh Shell\",\n entry: {\n file: relativePath(\n this.commandsPath,\n joinPaths(this.entryPath, \"completions\", \"zsh\", \"command.ts\")\n )\n },\n isVirtual: false\n });\n }\n }\n\n if (this.config.completions.shells.includes(\"powershell\")) {\n if (\n this.inputs.some(input => input.id === \"completions-powershell\")\n ) {\n this.info(\n \"The `completions-powershell` command already exists in the commands list. If you would like the completions-powershell command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-powershell\",\n name: \"powershell\",\n description: `Generate a PowerShell completion script for the ${getAppTitle(\n this,\n true\n )} command-line interface.`,\n alias: [],\n path: \"completions/powershell\",\n segments: [\"completions\", \"powershell\"],\n title: \"CLI Completions - PowerShell\",\n entry: {\n file: relativePath(\n this.commandsPath,\n joinPaths(\n this.entryPath,\n \"completions\",\n \"powershell\",\n \"command.ts\"\n )\n )\n },\n isVirtual: false\n });\n }\n }\n\n if (this.config.completions.shells.includes(\"fish\")) {\n if (this.inputs.some(input => input.id === \"completions-fish\")) {\n this.info(\n \"The `completions-fish` command already exists in the commands list. If you would like the completions-fish command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-fish\",\n name: \"fish\",\n description: `Generate a Fish completion script for the ${getAppTitle(\n this,\n true\n )} command-line interface.`,\n alias: [],\n path: \"completions/fish\",\n segments: [\"completions\", \"fish\"],\n title: \"CLI Completions - Fish Shell\",\n entry: {\n file: relativePath(\n this.commandsPath,\n joinPaths(this.entryPath, \"completions\", \"fish\", \"command.ts\")\n )\n },\n isVirtual: false\n });\n }\n }\n },\n async prepare() {\n this.debug(\n \"Rendering command handling modules for the Shell Shock `completions` plugin.\"\n );\n\n return render(\n this,\n <>\n <BashCompletionsCommand />\n <ZshCompletionsCommand />\n <PowerShellCompletionsCommand />\n <FishCompletionsCommand />\n </>\n );\n }\n }\n ];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;AAgCA,MAAU,UAAa,UAAA,EAAA,KAAA;AACvB,QAAS,CAAA;;EAET,SAAa;;AAEX,UAAA,EACK,aAAc;IACnB,QAAA;IACK,GAAM;IACX,EACD;;EAEE,iBAAkB;AACnB,QAAO,MAAA,iEAAA;AACL,QAAA,WAAA,EAAA;AACE,OAAI,KAAG,OAAM,MAAM,UAAW,MAAC,OAAA,cAAA,CAC/B,MAAO,KAAE,gNAAA;OAEP,MAAG,OAAS,KAAC;IACZ,IAAA;;IAED,OAAO,CAAA,aA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AA,CAAA,EAC/C;IACD,WAAS;IACV,CAAC;AAGN,OAAI,KAAE,OAAK,YAAY,OAAA,SAAA,OAAA,CACrB,KAAI,KAAK,OAAE,MAAA,UAAgB,MAAA,OAAA,mBAAA,CACzB,MAAI,KAAM,0NAAK;OAEf,MAAK,OAAK,KAAA;IACR,IAAI;IACJ,MAAK;IACL,aAAW,6CAAA,YAAA,MAAA,KAAA,CAAA;IACX,OAAO,EAAE;IACT,MAAE;IACF,UAAU,CAAA,eAAgB,OAAM;IAChC,OAAO;IACP,OAAI,EACF,MAAI,aAAK,KAAY,cAAA,YAAA,KAAA,WAAA,eAAA,QAAA,aAAA,CAAA,EACtB;IACD,WAAI;IACL,CAAC;;EAIR,MAAI,UAAA;;AAEF,UAAM,OAAK,MAAO;IAAA,gBAAmB,wBAAwB,EAAA,CAAA;IAAA,gBAAA,uBAAA,EAAA,CAAA;IAAA,gBAAA,8BAAA,EAAA,CAAA;IAAA,gBAAA,wBAAA,EAAA,CAAA;IAAA,CAAA;;EAEhE,CAAC"}
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
  const require_types_shell_type = require('./shell-type.cjs');
2
3
 
3
4
  exports.SHELL_TYPES = require_types_shell_type.SHELL_TYPES;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;UAyBiB,wBAAA;;AAAjB;AAcA;;;;;AAOA;;;EAIe,MAAA,CAAA,EAdJ,SAcI,EAAA;;AAGH,KAdA,2BAAA,GAA8B,UAcN,GAAA;EACV;;;EAEtB,WAAA,EAbW,QAaX,CAboB,wBAapB,CAAA;CAAO;KAVC,+BAAA,GAAkC;;;;eAI/B,SAAS;;KAGZ,iDACc,kCACtB,mCACA,QAAQ"}
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;UAyBiB,wBAAA;;AAAjB;;;;;AAcA;;;;EAHE,MAAA,GAAS,SAAA;AAAA;AAAA,KAGC,2BAAA,GAA8B,UAAA;EAInB;;;EAArB,WAAA,EAAa,QAAA,CAAS,wBAAA;AAAA;AAAA,KAGZ,+BAAA,GAAkC,cAAA;EAHE;AAGhD;;EAIE,WAAA,EAAa,QAAA,CAAS,wBAAA;AAAA;AAAA,KAGZ,wBAAA,yBACc,+BAAA,GACtB,+BAAA,IACA,OAAA,CAAQ,eAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;UAyBiB,wBAAA;;AAAjB;AAcA;;;;;AAOA;;;EAIe,MAAA,CAAA,EAdJ,SAcI,EAAA;;AAGH,KAdA,2BAAA,GAA8B,UAcN,GAAA;EACV;;;EAEtB,WAAA,EAbW,QAaX,CAboB,wBAapB,CAAA;CAAO;KAVC,+BAAA,GAAkC;;;;eAI/B,SAAS;;KAGZ,iDACc,kCACtB,mCACA,QAAQ"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;UAyBiB,wBAAA;;AAAjB;;;;;AAcA;;;;EAHE,MAAA,GAAS,SAAA;AAAA;AAAA,KAGC,2BAAA,GAA8B,UAAA;EAInB;;;EAArB,WAAA,EAAa,QAAA,CAAS,wBAAA;AAAA;AAAA,KAGZ,+BAAA,GAAkC,cAAA;EAHE;AAGhD;;EAIE,WAAA,EAAa,QAAA,CAAS,wBAAA;AAAA;AAAA,KAGZ,wBAAA,yBACc,+BAAA,GACtB,+BAAA,IACA,OAAA,CAAQ,eAAA"}
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
 
2
3
  //#region src/types/shell-type.ts
3
4
  const SHELL_TYPES = [
@@ -1 +1 @@
1
- {"version":3,"file":"shell-type.d.cts","names":[],"sources":["../../src/types/shell-type.ts"],"sourcesContent":[],"mappings":";KAkBY,SAAA;AAAA,cAEC,WAFQ,EAAA,SAEc,SAFd,EAAA"}
1
+ {"version":3,"file":"shell-type.d.cts","names":[],"sources":["../../src/types/shell-type.ts"],"mappings":";KAkBY,SAAA;AAAA,cAEC,WAAA,WAAsB,SAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"shell-type.d.mts","names":[],"sources":["../../src/types/shell-type.ts"],"sourcesContent":[],"mappings":";KAkBY,SAAA;AAAA,cAEC,WAFQ,EAAA,SAEc,SAFd,EAAA"}
1
+ {"version":3,"file":"shell-type.d.mts","names":[],"sources":["../../src/types/shell-type.ts"],"mappings":";KAkBY,SAAA;AAAA,cAEC,WAAA,WAAsB,SAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"shell-type.mjs","names":["SHELL_TYPES"],"sources":["../../src/types/shell-type.ts"],"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\nexport type ShellType = \"bash\" | \"fish\" | \"zsh\" | \"powershell\";\n\nexport const SHELL_TYPES: readonly ShellType[] = [\n \"bash\",\n \"fish\",\n \"zsh\",\n \"powershell\"\n] as const;\n"],"mappings":";AAoBA,MAAaA,cAAoC;CAC/C;CACA;CACA;CACA;CACQ"}
1
+ {"version":3,"file":"shell-type.mjs","names":[],"sources":["../../src/types/shell-type.ts"],"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\nexport type ShellType = \"bash\" | \"fish\" | \"zsh\" | \"powershell\";\n\nexport const SHELL_TYPES: readonly ShellType[] = [\n \"bash\",\n \"fish\",\n \"zsh\",\n \"powershell\"\n] as const;\n"],"mappings":";AAoBA,MAAa,cAAoC;CAC/C;CACA;CACA;CACA;CACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/plugin-completions",
3
- "version": "0.2.3",
3
+ "version": "0.2.7",
4
4
  "type": "module",
5
5
  "description": "A package containing a Shell Shock plugin to generate source code given a list design tokens.",
6
6
  "repository": {
@@ -55,7 +55,6 @@
55
55
  "default": "./dist/index.mjs"
56
56
  }
57
57
  },
58
- "./*": "./*",
59
58
  "./components": {
60
59
  "require": {
61
60
  "types": "./dist/components/index.d.cts",
@@ -168,6 +167,7 @@
168
167
  "default": "./dist/helpers/completion-directive-constants.mjs"
169
168
  }
170
169
  },
170
+ "./package.json": "./package.json",
171
171
  "./types": {
172
172
  "require": {
173
173
  "types": "./dist/types/index.d.cts",
@@ -224,17 +224,17 @@
224
224
  "dependencies": {
225
225
  "@alloy-js/core": "0.23.0-dev.8",
226
226
  "@alloy-js/typescript": "0.23.0-dev.4",
227
- "@powerlines/deepkit": "^0.6.90",
228
- "@powerlines/plugin-alloy": "^0.24.2",
229
- "@powerlines/plugin-plugin": "^0.12.262",
230
- "@shell-shock/core": "^0.12.0",
231
- "@stryke/path": "^0.26.12",
232
- "@stryke/string-format": "^0.14.8",
233
- "powerlines": "^0.39.19"
227
+ "@powerlines/deepkit": "^0.6.134",
228
+ "@powerlines/plugin-alloy": "^0.25.41",
229
+ "@powerlines/plugin-plugin": "^0.12.306",
230
+ "@shell-shock/core": "^0.13.1",
231
+ "@stryke/path": "^0.27.2",
232
+ "@stryke/string-format": "^0.17.6",
233
+ "powerlines": "^0.41.20"
234
234
  },
235
235
  "devDependencies": {
236
- "@powerlines/plugin-deepkit": "^0.11.190",
237
- "@types/node": "^25.3.3"
236
+ "@powerlines/plugin-deepkit": "^0.11.234",
237
+ "@types/node": "^25.5.0"
238
238
  },
239
239
  "publishConfig": {
240
240
  "access": "public",
@@ -251,5 +251,5 @@
251
251
  "./package.json": "./package.json"
252
252
  }
253
253
  },
254
- "gitHead": "c38d304433a296936fb8ca58aa138a0039918931"
254
+ "gitHead": "86c55189ed02d126fb583cf6d2555266f00d0f3a"
255
255
  }