@shell-shock/plugin-completions 0.4.18 → 0.4.20

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 (92) hide show
  1. package/dist/components/bash-config-command.cjs +2 -6
  2. package/dist/components/bash-config-command.d.cts +1 -3
  3. package/dist/components/bash-config-command.d.cts.map +1 -1
  4. package/dist/components/bash-config-command.d.mts +1 -3
  5. package/dist/components/bash-config-command.d.mts.map +1 -1
  6. package/dist/components/bash-config-command.mjs +5 -9
  7. package/dist/components/bash-config-command.mjs.map +1 -1
  8. package/dist/components/bash-script-command.cjs +2 -6
  9. package/dist/components/bash-script-command.d.cts +1 -3
  10. package/dist/components/bash-script-command.d.cts.map +1 -1
  11. package/dist/components/bash-script-command.d.mts +1 -3
  12. package/dist/components/bash-script-command.d.mts.map +1 -1
  13. package/dist/components/bash-script-command.mjs +5 -9
  14. package/dist/components/bash-script-command.mjs.map +1 -1
  15. package/dist/components/bash-shared.d.cts +1 -3
  16. package/dist/components/bash-shared.d.cts.map +1 -1
  17. package/dist/components/bash-shared.d.mts +1 -3
  18. package/dist/components/bash-shared.d.mts.map +1 -1
  19. package/dist/components/bash-shared.mjs.map +1 -1
  20. package/dist/components/fish-config-command.cjs +3 -7
  21. package/dist/components/fish-config-command.d.cts +1 -3
  22. package/dist/components/fish-config-command.d.cts.map +1 -1
  23. package/dist/components/fish-config-command.d.mts +1 -3
  24. package/dist/components/fish-config-command.d.mts.map +1 -1
  25. package/dist/components/fish-config-command.mjs +4 -8
  26. package/dist/components/fish-config-command.mjs.map +1 -1
  27. package/dist/components/fish-script-command.cjs +1 -5
  28. package/dist/components/fish-script-command.d.cts +1 -3
  29. package/dist/components/fish-script-command.d.cts.map +1 -1
  30. package/dist/components/fish-script-command.d.mts +1 -3
  31. package/dist/components/fish-script-command.d.mts.map +1 -1
  32. package/dist/components/fish-script-command.mjs +3 -7
  33. package/dist/components/fish-script-command.mjs.map +1 -1
  34. package/dist/components/fish-shared.d.cts +1 -3
  35. package/dist/components/fish-shared.d.cts.map +1 -1
  36. package/dist/components/fish-shared.d.mts +1 -3
  37. package/dist/components/fish-shared.d.mts.map +1 -1
  38. package/dist/components/fish-shared.mjs.map +1 -1
  39. package/dist/components/powershell-config-command.cjs +2 -6
  40. package/dist/components/powershell-config-command.d.cts +1 -3
  41. package/dist/components/powershell-config-command.d.cts.map +1 -1
  42. package/dist/components/powershell-config-command.d.mts +1 -3
  43. package/dist/components/powershell-config-command.d.mts.map +1 -1
  44. package/dist/components/powershell-config-command.mjs +3 -7
  45. package/dist/components/powershell-config-command.mjs.map +1 -1
  46. package/dist/components/powershell-script-command.cjs +2 -6
  47. package/dist/components/powershell-script-command.d.cts +1 -3
  48. package/dist/components/powershell-script-command.d.cts.map +1 -1
  49. package/dist/components/powershell-script-command.d.mts +1 -3
  50. package/dist/components/powershell-script-command.d.mts.map +1 -1
  51. package/dist/components/powershell-script-command.mjs +5 -9
  52. package/dist/components/powershell-script-command.mjs.map +1 -1
  53. package/dist/components/powershell-shared.d.cts +1 -3
  54. package/dist/components/powershell-shared.d.cts.map +1 -1
  55. package/dist/components/powershell-shared.d.mts +1 -3
  56. package/dist/components/powershell-shared.d.mts.map +1 -1
  57. package/dist/components/powershell-shared.mjs.map +1 -1
  58. package/dist/components/zsh-config-command.cjs +2 -6
  59. package/dist/components/zsh-config-command.d.cts +1 -3
  60. package/dist/components/zsh-config-command.d.cts.map +1 -1
  61. package/dist/components/zsh-config-command.d.mts +1 -3
  62. package/dist/components/zsh-config-command.d.mts.map +1 -1
  63. package/dist/components/zsh-config-command.mjs +5 -9
  64. package/dist/components/zsh-config-command.mjs.map +1 -1
  65. package/dist/components/zsh-script-command.cjs +2 -6
  66. package/dist/components/zsh-script-command.d.cts +1 -3
  67. package/dist/components/zsh-script-command.d.cts.map +1 -1
  68. package/dist/components/zsh-script-command.d.mts +1 -3
  69. package/dist/components/zsh-script-command.d.mts.map +1 -1
  70. package/dist/components/zsh-script-command.mjs +5 -9
  71. package/dist/components/zsh-script-command.mjs.map +1 -1
  72. package/dist/components/zsh-shared.d.cts +1 -3
  73. package/dist/components/zsh-shared.d.cts.map +1 -1
  74. package/dist/components/zsh-shared.d.mts +1 -3
  75. package/dist/components/zsh-shared.d.mts.map +1 -1
  76. package/dist/components/zsh-shared.mjs.map +1 -1
  77. package/dist/helpers/complete-command.d.mts.map +1 -1
  78. package/dist/helpers/complete-command.mjs.map +1 -1
  79. package/dist/helpers/completion-directive-constants.d.mts.map +1 -1
  80. package/dist/helpers/completion-directive-constants.mjs.map +1 -1
  81. package/dist/index.cjs +16 -29
  82. package/dist/index.d.cts +2 -2
  83. package/dist/index.d.mts +2 -2
  84. package/dist/index.d.mts.map +1 -1
  85. package/dist/index.mjs +16 -29
  86. package/dist/index.mjs.map +1 -1
  87. package/dist/types/plugin.d.cts.map +1 -1
  88. package/dist/types/plugin.d.mts.map +1 -1
  89. package/dist/types/shell-type.d.cts.map +1 -1
  90. package/dist/types/shell-type.d.mts.map +1 -1
  91. package/dist/types/shell-type.mjs.map +1 -1
  92. package/package.json +13 -13
@@ -1 +1 @@
1
- {"version":3,"file":"fish-shared.d.mts","names":[],"sources":["../../src/components/fish-shared.tsx"],"mappings":";;;;;;iBAiCgB,qBAAA,CAAA,GAAqB,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"fish-shared.d.mts","names":[],"sources":["../../src/components/fish-shared.tsx"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"fish-shared.mjs","names":[],"sources":["../../src/components/fish-shared.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 } from \"@alloy-js/core\";\nimport { VarDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript\";\nimport { getAppBin } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport { snakeCase } from \"@stryke/string-format/snake-case\";\nimport { CompletionDirective } from \"../helpers\";\nimport { EXEC_COMMAND } from \"../helpers/complete-command\";\nimport type { CompletionsPluginContext } from \"../types/plugin\";\n\n/**\n * The Fish Completions generation for the Shell Shock project.\n */\nexport function FishCompletionsShared() {\n const context = usePowerlines<CompletionsPluginContext>();\n\n const bin = computed(() => getAppBin(context));\n const name = computed(() => snakeCase(bin.value));\n\n return (\n <TypescriptFile\n path={joinPaths(context.entryPath, \"completions\", \"fish\", \"shared.ts\")}\n builtinImports={{\n console: [\n \"white\",\n \"green\",\n \"red\",\n \"bold\",\n \"cyan\",\n \"gray\",\n \"magenta\",\n \"magentaBright\",\n \"greenBright\",\n \"redBright\",\n \"cyanBright\",\n \"dim\"\n ]\n }}>\n <Spacing />\n <VarDeclaration\n const\n export\n name=\"SHELL_COMPLETIONS\"\n initializer={code` \\`function __${name.value}_debug\n set -l file \"$BASH_COMP_DEBUG_FILE\"\n if test -n \"$file\"\n echo \"$argv\" >> $file\n end\nend\n\nfunction __${name.value}_perform_completion\n __${name.value}_debug \"Starting __${name.value}_perform_completion\"\n\n # Extract all args except the last one\n set -l args (commandline -opc)\n # Extract the last arg and escape it in case it is a space or wildcard\n set -l lastArg (string escape -- (commandline -ct))\n\n __${name.value}_debug \"args: $args\"\n __${name.value}_debug \"last arg: $lastArg\"\n\n # Build the completion request command\n set -l requestComp \"${EXEC_COMMAND} complete -- (string join ' ' -- (string escape -- $args[2..-1])) $lastArg\"\n\n __${name.value}_debug \"Calling $requestComp\"\n set -l results (eval $requestComp 2> /dev/null)\n\n # Some programs may output extra empty lines after the directive.\n # Let's ignore them or else it will break completion.\n # Ref: https://github.com/spf13/cobra/issues/1279\n for line in $results[-1..1]\n if test (string trim -- $line) = \"\"\n # Found an empty line, remove it\n set results $results[1..-2]\n else\n # Found non-empty line, we have our proper output\n break\n end\n end\n\n set -l comps $results[1..-2]\n set -l directiveLine $results[-1]\n\n # For Fish, when completing a flag with an = (e.g., <program> -n=<TAB>)\n # completions must be prefixed with the flag\n set -l flagPrefix (string match -r -- '-.*=' \"$lastArg\")\n\n __${name.value}_debug \"Comps: $comps\"\n __${name.value}_debug \"DirectiveLine: $directiveLine\"\n __${name.value}_debug \"flagPrefix: $flagPrefix\"\n\n for comp in $comps\n printf \"%s%s\\\\n\" \"$flagPrefix\" \"$comp\"\n end\n\n printf \"%s\\\\n\" \"$directiveLine\"\nend\n\n# This function limits calls to __${\n name.value\n }_perform_completion, by caching the result\nfunction __${name.value}_perform_completion_once\n __${name.value}_debug \"Starting __${name.value}_perform_completion_once\"\n\n if test -n \"$__${name.value}_perform_completion_once_result\"\n __${name.value}_debug \"Seems like a valid result already exists, skipping __${name.value}_perform_completion\"\n return 0\n end\n\n set --global __${name.value}_perform_completion_once_result (__${\n name.value\n }_perform_completion)\n if test -z \"$__${name.value}_perform_completion_once_result\"\n __${name.value}_debug \"No completions, probably due to a failure\"\n return 1\n end\n\n __${name.value}_debug \"Performed completions and set __${\n name.value\n }_perform_completion_once_result\"\n return 0\nend\n\n# This function is used to clear the cached result after completions are run\nfunction __${name.value}_clear_perform_completion_once_result\n __${name.value}_debug \"\"\n __${name.value}_debug \"========= clearing previously set __${\n name.value\n }_perform_completion_once_result variable ==========\"\n set --erase __${name.value}_perform_completion_once_result\n __${name.value}_debug \"Successfully erased the variable __${\n name.value\n }_perform_completion_once_result\"\nend\n\nfunction __${name.value}_requires_order_preservation\n __${name.value}_debug \"\"\n __${name.value}_debug \"========= checking if order preservation is required ==========\"\n\n __${name.value}_perform_completion_once\n if test -z \"$__${name.value}_perform_completion_once_result\"\n __${name.value}_debug \"Error determining if order preservation is required\"\n return 1\n end\n\n set -l directive (string sub --start 2 $__${\n name.value\n }_perform_completion_once_result[-1])\n __${name.value}_debug \"Directive is: $directive\"\n\n set -l shellCompDirectiveKeepOrder ${\n CompletionDirective.CompletionDirectiveKeepOrder\n }\n set -l keeporder (math (math --scale 0 $directive / $shellCompDirectiveKeepOrder) % 2)\n __${name.value}_debug \"Keeporder is: $keeporder\"\n\n if test $keeporder -ne 0\n __${name.value}_debug \"This does require order preservation\"\n return 0\n end\n\n __${name.value}_debug \"This doesn't require order preservation\"\n return 1\nend\n\n# This function does two things:\n# - Obtain the completions and store them in the global __${\n name.value\n }_comp_results\n# - Return false if file completion should be performed\nfunction __${name.value}_prepare_completions\n __${name.value}_debug \"\"\n __${name.value}_debug \"========= starting completion logic ==========\"\n\n # Start fresh\n set --erase __${name.value}_comp_results\n\n __${name.value}_perform_completion_once\n __${name.value}_debug \"Completion results: $__${\n name.value\n }_perform_completion_once_result\"\n\n if test -z \"$__${name.value}_perform_completion_once_result\"\n __${name.value}_debug \"No completion, probably due to a failure\"\n # Might as well do file completion, in case it helps\n return 1\n end\n\n set -l directive (string sub --start 2 $__${\n name.value\n }_perform_completion_once_result[-1])\n set --global __${name.value}_comp_results $__${\n name.value\n }_perform_completion_once_result[1..-2]\n\n __${name.value}_debug \"Completions are: $__${name.value}_comp_results\"\n __${name.value}_debug \"Directive is: $directive\"\n\n set -l shellCompDirectiveError ${\n CompletionDirective.CompletionDirectiveError\n }\n set -l shellCompDirectiveNoSpace ${\n CompletionDirective.CompletionDirectiveNoSpace\n }\n set -l shellCompDirectiveNoFileComp ${\n CompletionDirective.CompletionDirectiveNoFileComp\n }\n set -l shellCompDirectiveFilterFileExt ${\n CompletionDirective.CompletionDirectiveFilterFileExt\n }\n set -l shellCompDirectiveFilterDirs ${\n CompletionDirective.CompletionDirectiveFilterDirs\n }\n if test -z \"$directive\"\n set directive 0\n end\n\n set -l compErr (math (math --scale 0 $directive / $shellCompDirectiveError) % 2)\n if test $compErr -eq 1\n __${name.value}_debug \"Received error directive: aborting.\"\n # Might as well do file completion, in case it helps\n return 1\n end\n\n set -l filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) % 2)\n set -l dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) % 2)\n if test $filefilter -eq 1; or test $dirfilter -eq 1\n __${name.value}_debug \"File extension filtering or directory filtering not supported\"\n # Do full file completion instead\n return 1\n end\n\n set -l nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) % 2)\n set -l nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) % 2)\n\n __${name.value}_debug \"nospace: $nospace, nofiles: $nofiles\"\n\n # If we want to prevent a space, or if file completion is NOT disabled,\n # we need to count the number of valid completions.\n # To do so, we will filter on prefix as the completions we have received\n # may not already be filtered so as to allow fish to match on different\n # criteria than the prefix.\n if test $nospace -ne 0; or test $nofiles -eq 0\n set -l prefix (commandline -t | string escape --style=regex)\n __${name.value}_debug \"prefix: $prefix\"\n\n set -l completions (string match -r -- \"^$prefix.*\" $__${\n name.value\n }_comp_results)\n set --global __${name.value}_comp_results $completions\n __${name.value}_debug \"Filtered completions are: $__${\n name.value\n }_comp_results\"\n\n # Important not to quote the variable for count to work\n set -l numComps (count $__${name.value}_comp_results)\n __${name.value}_debug \"numComps: $numComps\"\n\n if test $numComps -eq 1; and test $nospace -ne 0\n # We must first split on \\\\t to get rid of the descriptions to be\n # able to check what the actual completion will be.\n # We don't need descriptions anyway since there is only a single\n # real completion which the shell will expand immediately.\n set -l split (string split --max 1 \"\\\\t\" $__${\n name.value\n }_comp_results[1])\n\n # Fish won't add a space if the completion ends with any\n # of the following characters: @=/:.,\n set -l lastChar (string sub -s -1 -- $split)\n if not string match -r -q \"[@=/:.,]\" -- \"$lastChar\"\n # In other cases, to support the \"nospace\" directive we trick the shell\n # by outputting an extra, longer completion.\n __${name.value}_debug \"Adding second completion to perform nospace directive\"\n set --global __${name.value}_comp_results $split[1] $split[1].\n __${name.value}_debug \"Completions are now: $__${\n name.value\n }_comp_results\"\n end\n end\n\n if test $numComps -eq 0; and test $nofiles -eq 0\n # To be consistent with bash and zsh, we only trigger file\n # completion when there are no other completions\n __${name.value}_debug \"Requesting file completion\"\n return 1\n end\n end\n\n return 0\nend\n\n# Since Fish completions are only loaded once the user triggers them, we trigger them ourselves\n# so we can properly delete any completions provided by another script.\n# Only do this if the program can be found, or else fish may print some errors; besides,\n# the existing completions will only be loaded if the program can be found.\nif type -q \"${bin.value}\"\n # The space after the program name is essential to trigger completion for the program\n # and not completion of the program name itself.\n # Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish.\n complete --do-complete \"${bin.value} \" > /dev/null 2>&1\nend\n\n# Remove any pre-existing completions for the program since we will be handling all of them.\ncomplete -c ${bin.value} -e\n# This will get called after the two calls below and clear the cached result\ncomplete -c ${bin.value} -n '__${name.value}_clear_perform_completion_once_result'\n# The call to __${name.value}_prepare_completions will setup __${\n name.value\n }_comp_results\n# which provides the program's completion choices.\n# If this doesn't require order preservation, we don't use the -k flag\ncomplete -c ${getAppBin(\n context\n )} -n 'not __${name.value}_requires_order_preservation && __${\n name.value\n }_prepare_completions' -f -a '$__${name.value}_comp_results'\n# Otherwise we use the -k flag\ncomplete -k -c ${bin.value} -n '__${name.value}_requires_order_preservation && __${\n name.value\n }_prepare_completions' -f -a '$__${name.value}_comp_results'\n\\`; `}\n />\n <Spacing />\n <VarDeclaration\n export\n const\n name=\"SHELL_COMPLETIONS_DISPLAY\"\n initializer={code` SHELL_COMPLETIONS.split(\"\\\\n\").map(line => {\n if (!line.trim()) {\n return \"\";\n }\n if (line.trim().startsWith(\"#\")) {\n return \\`\\${dim(line)}\\`;\n }\n\n return white(line).replaceAll(/(?<=\\\\\\$(\\\\{|\\\\()).*(?=(\\\\}\\\\)))/g, green(\"$&\"))\n .replaceAll(/(\\\\\"|\\\\').*(\\\\\"|\\\\')/g, cyan(\"$&\"))\n .replaceAll(/(\\\\[|\\\\]|\\\\(|\\\\)|\\\\||<|>|\\\\$\\\\(|\\\\$?\\\\{|\\\\}|\\\\+|=|;|:)/g, bold(gray(\"$&\")))\n .replaceAll(/(function|complete)\\\\s+/g, green(\"$&\"))\n .replaceAll(/(?<=(function|complete)\\\\s+)\\\\w/g, bold(greenBright(\"$&\")))\n .replaceAll(/set\\\\s+/g, red(\"$&\"))\n .replaceAll(/(?<=set\\\\s+)\\\\w/g, bold(redBright(\"$&\")))\n .replaceAll(/while\\\\s+/g, cyan(\"$&\"))\n .replaceAll(/(?<=while\\\\s+)\\\\w/g, bold(cyanBright(\"$&\")))\n .replaceAll(/(if|fi|else|elif|then|done)\\\\s+/g, green(\"$&\"))\n .replaceAll(/\\\\s__\\\\w/g, bold(magentaBright(\"$&\")))\n .replaceAll(/(?<=\\\\s)(-\\\\w|--\\\\w[\\\\w-]*)(?=\\\\s|$)/g, bold(magenta(\"$&\")));\n\n }).join(\"\\\\n\"); `}\n />\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,SAAE,wBAAA;CACF,MAAO,UAAS,eAAA;CACd,MAAM,MAAA,eAAU,UAAc,QAAA,CAAA;;AAE9B,QAAM,gBAAmB,gBAAY;EACrC,IAAM,OAAO;;;EAGX,gBAAC,EACC,SAAM;GAAA;GAAU;GAAQ;GAAW;GAAC;GAAe;GAAQ;GAAW;GAAA;GAAA;GAAA;GAAA;GAAA,EACvE;EACD,IAAI,WAAS;AACX,UAAK;IAAA,gBAAM,SAAA,EAAA,CAAA;IAAA,gBAAA,gBAAA;KACT,SAAS;KACT,UAAO;KACP,MAAG;KACH,IAAG,cAAK;AACN,aAAM,IAAA,iBAAA,KAAA,MAAA;;;;;;;aAOR,KAAA,MAAA;QACA,KAAA,MAAA,qBAAA,KAAA,MAAA;;;;;;;QAOA,KAAG,MAAO;QACX,KAAM,MAAI;;;;;QAKT,KAAK,MAAK;;;;;;;;;;;;;;;;;;;;;;;QAuBV,KAAI,MAAI;QACR,KAAA,MAAA;QACA,KAAK,MAAM;;;;;;;;;oCASgB,KAAK,MAAI;aACjC,KAAA,MAAY;;;qBAGJ,KAAO,MAAC;YACf,KAAC,MAAM,+DAA+B,KAAA,MAAA;;;;qBAI9C,KAAA,MAAA,qCAAA,KAAA,MAAA;;YAEQ,KAAK,MAAI;;;;QAIb,KAAE,MAAK,0CAAA,KAAA,MAAA;;;;;aAKF,KAAI,MAAI;QACb,KAAI,MAAK;QACT,KAAA,MAAO,8CAAA,KAAA,MAAA;oBACX,KAAA,MAAA;;;;aAIC,KAAA,MAAmB;QACjB,KAAM,MAAM;QACX,KAAI,MAAK;;QAEb,KAAA,MAAA;;YAEQ,KAAC,MAAM;;;;;;;yCAOK,oBAAA,6BAAA;;QAEhB,KAAK,MAAM;;;YAGT,KAAM,MAAI;;;;QAIpB,KAAA,MAAA;;;;;;;aAOa,KAAI,MAAI;QACb,KAAI,MAAK;QACT,KAAA,MAAO;;;oBAGK,KAAE,MAAO;;QAExB,KAAA,MAAA;QACG,KAAK,MAAM,iCAAgC,KAAA,MAAA;;qBAExC,KAAA,MAAA;YACL,KAAA,MAAA;;;;;gDAKqB,KAAA,MAAA;qBACV,KAAM,MAAQ,mBAAkB,KAAM,MAAA;;QAEnD,KAAA,MAAA,8BAAA,KAAA,MAAA;;;qCAGO,oBAAA,yBAAA;;;6CAGoB,oBAAA,iCAAA;0CACW,oBAAiB,8BAAA;;;;;;;;;;;;;;;;;;;;;;;QAuBrD,KAAK,MAAA;;;;;;;;;YASA,KAAA,MAAA;;iEAEP,KAAA,MAAA;yBACO,KAAA,MAAyB;YAC9B,KAAA,MAAA,uCAAoB,KAAA,MAAA;;;oCAGA,KAAA,MAAA;YACtB,KAAA,MAAA;;;;;;;0DAOsB,KAAA,MAAA;;;;;;;;oBAQX,KAAA,MAAA;iCACX,KAAA,MAAA;;;;;;;;gBAQA,KAAA,MAAA;;;;;;;;;;;;cAYS,IAAA,MAAW;;;;8BAII,IAAM,MAAM;;;;cAI5B,IAAK,MAAM;;cAEd,IAAA,MAAa,SAAA,KAAA,MAAA;;;;cAIV,UAAW,QAAQ,CAAA,aAAW,KAAQ,MAAA,oCAAA,KAAA,MAAA,kCAAA,KAAA,MAAA;;iBAEjC,IAAA,MAAU,SAAS,KAAK,MAAE,oCAAY,KAAA,MAAA,kCAAA,KAAA,MAAA;;;KAGhD,CAAC;IAAE,gBAAkB,SAAA,EAAA,CAAY;IAAC,gBAAmB,gBAAU;KAC9D,UAAU;KACV,SAAS;KACT,MAAM;KACN,aAAK,IAAA;;;;;;;;;;;;;;;;;;;;;;KAsBT,CAAA;IAAA;;EAED,CAAC"}
1
+ {"version":3,"file":"fish-shared.mjs","names":[],"sources":[],"mappings":""}
@@ -3,7 +3,6 @@ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
3
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
4
4
  let _alloy_js_core = require("@alloy-js/core");
5
5
  let _alloy_js_typescript = require("@alloy-js/typescript");
6
- let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
7
6
  let _powerlines_plugin_alloy_core = require("@powerlines/plugin-alloy/core");
8
7
  let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
9
8
  let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
@@ -41,15 +40,12 @@ function PowerShellConfigCompletionsCommand() {
41
40
  heading: "Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.",
42
41
  get children() {
43
42
  return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TSDocDefaultValue, {
44
- get type() {
45
- return _powerlines_deepkit_vendor_type.ReflectionKind.boolean;
46
- },
43
+ type: "boolean",
47
44
  defaultValue: false
48
45
  });
49
46
  }
50
- }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
47
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
51
48
  name: "display",
52
- optional: true,
53
49
  type: "boolean"
54
50
  })];
55
51
  }
@@ -1,7 +1,5 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
-
3
1
  //#region src/components/powershell-config-command.d.ts
4
- declare function PowerShellConfigCompletionsCommand(): _$_alloy_js_core0.Children;
2
+ declare function PowerShellConfigCompletionsCommand(): import("@alloy-js/core").Children;
5
3
  //#endregion
6
4
  export { PowerShellConfigCompletionsCommand };
7
5
  //# sourceMappingURL=powershell-config-command.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"powershell-config-command.d.cts","names":[],"sources":["../../src/components/powershell-config-command.tsx"],"mappings":";;;iBAuCgB,kCAAA,CAAA,GAAkC,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"powershell-config-command.d.cts","names":[],"sources":["../../src/components/powershell-config-command.tsx"],"mappings":";iBAsCgB,kCAAA,6BAAkC,QAAA"}
@@ -1,7 +1,5 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
-
3
1
  //#region src/components/powershell-config-command.d.ts
4
- declare function PowerShellConfigCompletionsCommand(): _$_alloy_js_core0.Children;
2
+ declare function PowerShellConfigCompletionsCommand(): import("@alloy-js/core").Children;
5
3
  //#endregion
6
4
  export { PowerShellConfigCompletionsCommand };
7
5
  //# sourceMappingURL=powershell-config-command.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"powershell-config-command.d.mts","names":[],"sources":["../../src/components/powershell-config-command.tsx"],"mappings":";;;iBAuCgB,kCAAA,CAAA,GAAkC,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"powershell-config-command.d.mts","names":[],"sources":["../../src/components/powershell-config-command.tsx"],"mappings":""}
@@ -1,11 +1,10 @@
1
1
  import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
2
2
  import { getAppTitle } from "@shell-shock/core/plugin-utils";
3
3
  import { code } from "@alloy-js/core";
4
- import { ElseClause, FunctionDeclaration, IfStatement, InterfaceDeclaration, InterfaceMember, VarDeclaration } from "@alloy-js/typescript";
5
- import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
4
+ import { ElseClause, FunctionDeclaration, IfStatement, InterfaceDeclaration, VarDeclaration } from "@alloy-js/typescript";
6
5
  import { Spacing } from "@powerlines/plugin-alloy/core";
7
6
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
8
- import { TSDoc, TSDocDefaultValue, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
7
+ import { InterfaceMember, TSDoc, TSDocDefaultValue, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
9
8
  import { joinPaths } from "@stryke/path";
10
9
 
11
10
  //#region src/components/powershell-config-command.tsx
@@ -40,15 +39,12 @@ function PowerShellConfigCompletionsCommand() {
40
39
  heading: "Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.",
41
40
  get children() {
42
41
  return createComponent(TSDocDefaultValue, {
43
- get type() {
44
- return ReflectionKind.boolean;
45
- },
42
+ type: "boolean",
46
43
  defaultValue: false
47
44
  });
48
45
  }
49
46
  }), createComponent(InterfaceMember, {
50
47
  name: "display",
51
- optional: true,
52
48
  type: "boolean"
53
49
  })];
54
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"powershell-config-command.mjs","names":[],"sources":["../../src/components/powershell-config-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 ElseClause,\n FunctionDeclaration,\n IfStatement,\n InterfaceDeclaration,\n InterfaceMember,\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 TSDoc,\n TSDocDefaultValue,\n TypescriptFile\n} from \"@powerlines/plugin-alloy/typescript\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport type { CompletionsPluginContext } from \"../types\";\n\nexport function PowerShellConfigCompletionsCommand() {\n const context = usePowerlines<CompletionsPluginContext>();\n\n return (\n <TypescriptFile\n path={joinPaths(\n context.entryPath,\n \"completions\",\n \"powershell\",\n \"config\",\n \"command.ts\"\n )}\n imports={{\n \"node:os\": \"os\",\n \"node:path\": [\"join\"],\n \"node:fs/promises\": [\"readFile\", \"writeFile\"],\n \"../shared\": [\"SHELL_COMPLETIONS\", \"SHELL_COMPLETIONS_DISPLAY\"]\n }}\n builtinImports={{\n \"shell-shock:console\": [\n \"bold\",\n \"inlineCode\",\n \"writeLine\",\n \"success\",\n \"warn\",\n \"help\"\n ]\n }}>\n <TSDoc heading=\"Options for the PowerShell Completions - Configuration command.\" />\n <InterfaceDeclaration export name=\"PowerShellConfigCompletionsOptions\">\n <TSDoc heading=\"Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.\">\n <TSDocDefaultValue\n type={ReflectionKind.boolean}\n defaultValue={false}\n />\n </TSDoc>\n <InterfaceMember name=\"display\" optional type=\"boolean\" />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Handler logic for the \\`completions powershell config\\` command.\"></TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[\n {\n name: \"options\",\n type: \"PowerShellConfigCompletionsOptions\",\n default: \"{}\"\n },\n {\n name: \"path\",\n type: \"string\",\n default: `\"~/.config/powershell/Microsoft.PowerShell_profile.ps1\"`\n }\n ]}>\n <IfStatement condition={code`options.display !== true`}>\n <VarDeclaration\n let\n name=\"configPath\"\n type=\"string\"\n initializer={code` path.includes(\".\") ? path : join(path, \"Microsoft.PowerShell_profile.ps1\");`}\n />\n <Spacing />\n <IfStatement condition={code`configPath.startsWith(\"~\")`}>\n {code`configPath = join(os.homedir(), configPath.replace(\"~\", \"\")); `}\n </IfStatement>\n <Spacing />\n <VarDeclaration\n let\n name=\"content\"\n type=\"string\"\n initializer={code`\"\";`}\n />\n <Spacing />\n {code`try {\n content = await readFile(configPath, \"utf8\");\n } catch (error) {\n if (typeof error === \"object\" && error !== null && \"code\" in error && error.code === \"ENOENT\") {\n // If the file doesn't exist, we can create it later when writing the completion script.\n warn(\\`Configuration file \\${bold(configPath)} does not exist. It will be created when the completion script is written.\\`);\n } else {\n return { error };\n }\n }\n\n await writeFile(configPath, \\`\\${content}\\\\n\\\\n### Begin - ${getAppTitle(context)} PowerShell Completions ###\\\\n\\\\n\\${SHELL_COMPLETIONS} \\\\n\\\\n### End - ${getAppTitle(\n context\n )} PowerShell Completions ###\\`);\n\n success(\\`${getAppTitle(\n context\n )} shell completions have been applied to PowerShell configuration file at \\${bold(configPath)}. Please restart your terminal or run \\${inlineCode(\\`source \\${configPath}\\`)} for the changes to take effect.\\`); `}\n </IfStatement>\n <ElseClause>\n {code`writeLine(\" ------------------------------------------------- \");\n writeLine(\"\");\n writeLine(\\`### Begin - ${getAppTitle(context)} PowerShell Completions ###\\`);\n writeLine(\"\");\n SHELL_COMPLETIONS_DISPLAY.split(\"\\\\n\").map(line => writeLine(line));\n writeLine(\"\");\n writeLine(\\`### End - ${getAppTitle(context)} PowerShell Completions ###\\`);\n writeLine(\"\");\n writeLine(\" ------------------------------------------------- \");\n\n writeLine(\"\");\n help(\\`To enable these completions, perform one of the following actions:\n\n 1) Copy and paste the above script into your shell configuration file (e.g., ~/.config/powershell/Microsoft.PowerShell_profile.ps1)\n 2) Save the above script to a file and source it from your shell configuration file \\`); `}\n </ElseClause>\n </FunctionDeclaration>\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;AA2BA,SAAS,qCAA2C;CACpD,MAAQ,UAAU,eAAQ;AAC1B,QAAS,gBAAgB,gBAAkB;EAC3C,IAAO,OAAA;AACL,UAAK,UAAA,QAAA,WAAA,eAAA,cAAA,UAAA,aAAA;;EAEL,SAAA;GACI,WAAG;GACH,aAAG,CAAW,OAAO;GACrB,oBAAoB,CAAC,YAAY,YAAC;GAClC,aAAQ,CAAA,qBAA2B,4BAAe;;EAExD,gBAAgB,EACd,uBAAgB;GAAA;GAAc;GAAA;GAA2B;GAAA;GAAA;GAAA;EAEzD,IAAM,WAAC;AACJ,UAAA;IAAA,gBAAA,OAAA,EACC,SAAM,mEACL,CAAC;IAAA,gBAAiB,sBAAA;KACjB,UAAC;KACD,MAAC;KACD,IAAC,WAAO;AACP,aAAQ,CAAA,gBAAE,OAAA;OACZ,SAAA;OACD,IAAS,WAAA;AACD,eAAM,gBAAG,mBAAA;SACT,IAAM,OAAO;AACV,iBAAQ,eAAe;;SAEjC,cAAA;SACD,CAAA;;OAEK,CAAA,EAAA,gBAAK,iBAAA;OACL,MAAA;OACA,UAAU;OACV,MAAO;OACP,CAAA,CAAA;;KAEJ,CAAC;IAAA,gBAAA,SAAA,EAAA,CAAA;IAAA,gBAAA,OAAA,EACA,SAAA,sEACD,CAAA;IAAA,gBAAe,qBAA2B;KAC1C,UAAA;KACC,WAAO;KACP,OAAG;KACH,MAAI;KACJ,YAAI,CAAA;MACF,MAAC;MACD,MAAK;MACN,SAAA;MACD,EAAA;MACD,MAAS;MACT,MAAM;MACN,SAAA;MACC,CAAA;KACA,IAAA,WAAA;AACA,aAAA,CAAA,gBAAA,aAAA;OACI,WAAS,IAAA;OACb,IAAA,WAAY;AACV,eAAA;SAAA,gBAAA,gBAAA;UACM,OAAG;UACH,MAAG;UACP,MAAU;UACX,aAAA,IAAA;UACD,CAAA;SAAA,gBAAA,SAAA,EAAA,CAAA;SAAA,gBAAA,aAAA;UACM,WAAQ,IAAA;UACR,UAAU,IAAA;UACd,CAAA;SAAA,gBAAqB,SAAW,EAAA,CAAA;SAAA,gBAAU,gBAAuB;UACnE,OAAA;UACA,MAAA;UACD,MAAY;UACV,aAAA,IAAA;UACC,CAAA;SAAA,gBAAA,SAAA,EAAA,CAAA;SAAA,WAAA,IAAA;;;;;;;;;;;uEAWA,YAAA,QAAA,CAAA,yEAAA,YAAA,QAAA,CAAA;;sBAEM,YAAM,QAAA,CAAA,mNAAA;SAAA;;OAEb,CAAA,EAAA,gBAAA,YAAA,EACA,IAAA,WAAS;AACT,cAAS,IAAA;;sCAEM,YAAA,QAAA,CAAA;;;;oCAIP,YAAA,QAAA,CAAA;;;;;;;;;SAUR,CAAC,CAAA;;KAEL,CAAC;IAAC;;EAEN,CAAC"}
1
+ {"version":3,"file":"powershell-config-command.mjs","names":[],"sources":[],"mappings":""}
@@ -3,7 +3,6 @@ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
3
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
4
4
  let _alloy_js_core = require("@alloy-js/core");
5
5
  let _alloy_js_typescript = require("@alloy-js/typescript");
6
- let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
7
6
  let _powerlines_plugin_alloy_core = require("@powerlines/plugin-alloy/core");
8
7
  let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
9
8
  let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
@@ -37,7 +36,7 @@ function PowerShellScriptCompletionsCommand() {
37
36
  get children() {
38
37
  return [
39
38
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Options for the PowerShell Completions - Script command." }),
40
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
39
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceDeclaration, {
41
40
  "export": true,
42
41
  name: "PowerShellScriptCompletionsOptions",
43
42
  get children() {
@@ -45,15 +44,12 @@ function PowerShellScriptCompletionsCommand() {
45
44
  heading: "Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.",
46
45
  get children() {
47
46
  return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
48
- get type() {
49
- return _powerlines_deepkit_vendor_type.ReflectionKind.boolean;
50
- },
47
+ type: "boolean",
51
48
  defaultValue: false
52
49
  });
53
50
  }
54
51
  }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
55
52
  name: "display",
56
- optional: true,
57
53
  type: "boolean"
58
54
  })];
59
55
  }
@@ -1,10 +1,8 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
-
3
1
  //#region src/components/powershell-script-command.d.ts
4
2
  /**
5
3
  * The PowerShell Completions - Script command's handler wrapper for the Shell Shock project.
6
4
  */
7
- declare function PowerShellScriptCompletionsCommand(): _$_alloy_js_core0.Children;
5
+ declare function PowerShellScriptCompletionsCommand(): import("@alloy-js/core").Children;
8
6
  //#endregion
9
7
  export { PowerShellScriptCompletionsCommand };
10
8
  //# sourceMappingURL=powershell-script-command.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"powershell-script-command.d.cts","names":[],"sources":["../../src/components/powershell-script-command.tsx"],"mappings":";;;;;;iBA4CgB,kCAAA,CAAA,GAAkC,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"powershell-script-command.d.cts","names":[],"sources":["../../src/components/powershell-script-command.tsx"],"mappings":";;AA2CA;;iBAAgB,kCAAA,6BAAkC,QAAA"}
@@ -1,10 +1,8 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
-
3
1
  //#region src/components/powershell-script-command.d.ts
4
2
  /**
5
3
  * The PowerShell Completions - Script command's handler wrapper for the Shell Shock project.
6
4
  */
7
- declare function PowerShellScriptCompletionsCommand(): _$_alloy_js_core0.Children;
5
+ declare function PowerShellScriptCompletionsCommand(): import("@alloy-js/core").Children;
8
6
  //#endregion
9
7
  export { PowerShellScriptCompletionsCommand };
10
8
  //# sourceMappingURL=powershell-script-command.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"powershell-script-command.d.mts","names":[],"sources":["../../src/components/powershell-script-command.tsx"],"mappings":";;;;;;iBA4CgB,kCAAA,CAAA,GAAkC,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"powershell-script-command.d.mts","names":[],"sources":["../../src/components/powershell-script-command.tsx"],"mappings":""}
@@ -1,11 +1,10 @@
1
1
  import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
2
2
  import { getAppBin, getAppTitle } from "@shell-shock/core/plugin-utils";
3
3
  import { code, computed } from "@alloy-js/core";
4
- import { ElseClause, FunctionDeclaration, IfStatement, InterfaceDeclaration, VarDeclaration } from "@alloy-js/typescript";
5
- import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
4
+ import { ElseClause, FunctionDeclaration, IfStatement, VarDeclaration } from "@alloy-js/typescript";
6
5
  import { Spacing } from "@powerlines/plugin-alloy/core";
7
6
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
8
- import { InterfaceMember as InterfaceMember$1, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
7
+ import { InterfaceDeclaration as InterfaceDeclaration$1, InterfaceMember, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
9
8
  import { TSDoc as TSDoc$1, TSDocDefaultValue as TSDocDefaultValue$1 } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
10
9
  import { joinPaths } from "@stryke/path";
11
10
 
@@ -36,7 +35,7 @@ function PowerShellScriptCompletionsCommand() {
36
35
  get children() {
37
36
  return [
38
37
  createComponent(TSDoc$1, { heading: "Options for the PowerShell Completions - Script command." }),
39
- createComponent(InterfaceDeclaration, {
38
+ createComponent(InterfaceDeclaration$1, {
40
39
  "export": true,
41
40
  name: "PowerShellScriptCompletionsOptions",
42
41
  get children() {
@@ -44,15 +43,12 @@ function PowerShellScriptCompletionsCommand() {
44
43
  heading: "Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.",
45
44
  get children() {
46
45
  return createComponent(TSDocDefaultValue$1, {
47
- get type() {
48
- return ReflectionKind.boolean;
49
- },
46
+ type: "boolean",
50
47
  defaultValue: false
51
48
  });
52
49
  }
53
- }), createComponent(InterfaceMember$1, {
50
+ }), createComponent(InterfaceMember, {
54
51
  name: "display",
55
- optional: true,
56
52
  type: "boolean"
57
53
  })];
58
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"powershell-script-command.mjs","names":[],"sources":["../../src/components/powershell-script-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, computed } from \"@alloy-js/core\";\nimport {\n ElseClause,\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} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { getAppBin, getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport type { CompletionsPluginContext } from \"../types/plugin\";\n\n/**\n * The PowerShell Completions - Script command's handler wrapper for the Shell Shock project.\n */\nexport function PowerShellScriptCompletionsCommand() {\n const context = usePowerlines<CompletionsPluginContext>();\n\n const bin = computed(() => getAppBin(context));\n\n return (\n <TypescriptFile\n path={joinPaths(\n context.entryPath,\n \"completions\",\n \"powershell\",\n \"script\",\n \"command.ts\"\n )}\n imports={{\n \"node:os\": \"os\",\n \"node:path\": [\"join\"],\n \"node:fs/promises\": [\"readFile\", \"writeFile\"],\n \"../shared\": [\"SHELL_COMPLETIONS\", \"SHELL_COMPLETIONS_DISPLAY\"]\n }}\n builtinImports={{\n console: [\"bold\", \"writeLine\", \"success\", \"warn\", \"help\"]\n }}>\n <TSDoc heading=\"Options for the PowerShell Completions - Script command.\" />\n <InterfaceDeclaration export name=\"PowerShellScriptCompletionsOptions\">\n <TSDoc heading=\"Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.\">\n <TSDocDefaultValue\n type={ReflectionKind.boolean}\n defaultValue={false}\n />\n </TSDoc>\n <InterfaceMember name=\"display\" optional type=\"boolean\" />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Handler logic for the \\`completions powershell script\\` command.\"></TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[\n {\n name: \"options\",\n type: \"PowerShellScriptCompletionsOptions\",\n default: \"{}\"\n },\n {\n name: \"path\",\n type: \"string\",\n default: `\"./${bin.value}-completions.ps1\"`\n }\n ]}>\n <IfStatement condition={code`options.display !== true`}>\n <VarDeclaration\n const\n name=\"scriptPath\"\n type=\"string\"\n initializer={code` path.includes(\".\") ? \\`\\${path}.ps1\\` : path;`}\n />\n {code`await writeFile(scriptPath, \\`# PowerShell script to add completions for ${getAppTitle(context)}\\\\n\\\\n\\${SHELL_COMPLETIONS}\\`);\n\n success(\\`${getAppTitle(\n context\n )} PowerShell completion script has been generated at \\${bold(scriptPath)}.\\`);`}\n </IfStatement>\n <ElseClause>\n {code`writeLine(\" ------------------------------------------------- \");\n writeLine(\"\");\n writeLine(\\`# PowerShell completions for ${getAppTitle(context)}\\`);\n writeLine(\"\");\n SHELL_COMPLETIONS_DISPLAY.split(\"\\\\n\").map(line => writeLine(line));\n writeLine(\"\");\n writeLine(\" ------------------------------------------------- \");\n\n writeLine(\"\");\n help(\\`To enable these completions, perform one of the following actions:\n\n 1) Copy and paste the above script into your shell configuration file (e.g., ~/.config/powershell/Microsoft.PowerShell_profile.ps1)\n 2) Save the above script to a file and source it from your shell configuration file \\`); `}\n </ElseClause>\n </FunctionDeclaration>\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+BA,SAAE,qCAAA;CACA,MAAM,UAAC,eAAwB;CACjC,MAAO,MAAA,eAAA,UAAA,QAAA,CAAA;AACL,QAAK,gBAAA,gBAAA;EACL,IAAA,OAAA;AACI,UAAG,UAAW,QAAO,WAAM,eAAsB,cAAM,UAAA,aAAA;;EAE7D,SAAS;GACH,WAAQ;;GAEZ,oBAAA,CAAA,YAAA,YAAA;GACI,aAAY,CAAA,qBAAqB,4BAA8B;GACnE;EACF,gBAAgB,EACd,SAAa;GAAC;GAAE;GAAc;GAAA;GAAwB;GAAG;EAEzD,IAAM,WAAM;;+BAEN,SAAC,4DACJ,CAAA;IAAA,gBAAA,sBAAA;KACC,UAAM;KACJ,MAAA;KACA,IAAC,WAAY;AACZ,aAAA,CAAA,gBAAW,SAAA;OACX,SAAO;OACP,IAAO,WAAG;AACZ,eAAA,gBAAA,qBAAA;SACQ,IAAA,OAAA;AACG,iBAAK,eAAA;;SAEP,cAAc;SAClB,CAAA;;OAEN,CAAA,EAAA,gBAAgB,mBAAA;OACd,MAAU;OACV,UAAA;OACI,MAAC;OACN,CAAA,CAAA;;KAEA,CAAC;IAAE,gBAAC,SAAA,EAAA,CAAA;IAAA,gBAAA,SAAA,EACH,SAAS,sEACV,CAAC;IAAE,gBAAgB,qBAAK;KACvB,UAAG;KACH,WAAO;KACP,OAAC;KACD,MAAA;KACD,IAAA,aAAS;AACT,aAAM,CAAA;OACN,MAAA;OACC,MAAA;OACA,SAAA;OACA,EAAA;OACI,MAAE;OACN,MAAU;OACR,SAAA,MAAA,IAAA,MAAA;OACC,CAAC;;KAEJ,IAAI,WAAW;AACb,aAAC,CAAA,gBAAA,aAAA;OACD,WAAA,IAAA;OACE,IAAI,WAAQ;AACZ,eAAO,CAAA,gBAAO,gBAAA;SACd,SAAa;SACf,MAAA;SACA,MAAA;SACD,aAAY,IAAW;SACrB,CAAA,EAAA,WAAA,IAAA,4EAAA,YAAA,QAAA,CAAA;;wBAEO,YAAU,QAAA,CAAA,+EAAA,CAAA;;OAEjB,CAAC,EAAA,gBAAmB,YAAa,EACjC,IAAA,WAAA;AACA,cAAU,IAAC;;uDAEa,YAAA,QAAA,CAAA;;;;;;;;;;;;;KAc5B,CAAC;IAAC;;EAEN,CAAC"}
1
+ {"version":3,"file":"powershell-script-command.mjs","names":[],"sources":[],"mappings":""}
@@ -1,10 +1,8 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
-
3
1
  //#region src/components/powershell-shared.d.ts
4
2
  /**
5
3
  * The PowerShell Completions generation for the Shell Shock project.
6
4
  */
7
- declare function PowerShellCompletionsShared(): _$_alloy_js_core0.Children;
5
+ declare function PowerShellCompletionsShared(): import("@alloy-js/core").Children;
8
6
  //#endregion
9
7
  export { PowerShellCompletionsShared };
10
8
  //# sourceMappingURL=powershell-shared.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"powershell-shared.d.cts","names":[],"sources":["../../src/components/powershell-shared.tsx"],"mappings":";;;;;;iBAiCgB,2BAAA,CAAA,GAA2B,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"powershell-shared.d.cts","names":[],"sources":["../../src/components/powershell-shared.tsx"],"mappings":";;AAiCA;;iBAAgB,2BAAA,6BAA2B,QAAA"}
@@ -1,10 +1,8 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
-
3
1
  //#region src/components/powershell-shared.d.ts
4
2
  /**
5
3
  * The PowerShell Completions generation for the Shell Shock project.
6
4
  */
7
- declare function PowerShellCompletionsShared(): _$_alloy_js_core0.Children;
5
+ declare function PowerShellCompletionsShared(): import("@alloy-js/core").Children;
8
6
  //#endregion
9
7
  export { PowerShellCompletionsShared };
10
8
  //# sourceMappingURL=powershell-shared.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"powershell-shared.d.mts","names":[],"sources":["../../src/components/powershell-shared.tsx"],"mappings":";;;;;;iBAiCgB,2BAAA,CAAA,GAA2B,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"powershell-shared.d.mts","names":[],"sources":["../../src/components/powershell-shared.tsx"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"powershell-shared.mjs","names":[],"sources":["../../src/components/powershell-shared.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 } from \"@alloy-js/core\";\nimport { VarDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript\";\nimport { getAppBin, getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { CompletionDirective } from \"../helpers\";\nimport { EXEC_COMMAND } from \"../helpers/complete-command\";\nimport type { CompletionsPluginContext } from \"../types/plugin\";\n\n/**\n * The PowerShell Completions generation for the Shell Shock project.\n */\nexport function PowerShellCompletionsShared() {\n const context = usePowerlines<CompletionsPluginContext>();\n\n const bin = computed(() => getAppBin(context));\n const name = computed(() => camelCase(bin.value));\n\n return (\n <TypescriptFile\n path={joinPaths(\n context.entryPath,\n \"completions\",\n \"powershell\",\n \"shared.ts\"\n )}\n builtinImports={{\n console: [\n \"white\",\n \"green\",\n \"red\",\n \"bold\",\n \"cyan\",\n \"gray\",\n \"magenta\",\n \"magentaBright\",\n \"greenBright\",\n \"redBright\",\n \"cyanBright\",\n \"dim\"\n ]\n }}>\n <Spacing />\n <VarDeclaration\n const\n export\n name=\"SHELL_COMPLETIONS\"\n initializer={code` \\`# powershell completion for ${getAppTitle(context)}\n\n [Console]::OutputEncoding = [System.Text.Encoding]::UTF8\n function __${name.value}_debug {\n if ($env:BASH_COMP_DEBUG_FILE) {\n \"$args\" | Out-File -Append -FilePath \"$env:BASH_COMP_DEBUG_FILE\"\n }\n }\n\n filter __${name.value}_escapeStringWithSpecialChars {\n $_ -replace '\\\\s|#|@|\\\\$|;|,|''|\\\\{|\\\\}|\\\\(|\\\\)|\"|\\\\||<|>|&','\\\\\\`$&'\n }\n\n[scriptblock]$__${name.value}CompleterBlock = {\n param(\n $WordToComplete,\n $CommandAst,\n $CursorPosition\n )\n\n # Get the current command-line and convert into a string\n $Command = $CommandAst.CommandElements\n $Command = \"$Command\"\n\n __${name.value}_debug \"\"\n __${name.value}_debug \"========= starting completion logic ==========\"\n __${name.value}_debug \"WordToComplete: $WordToComplete Command: $Command CursorPosition: $CursorPosition\"\n\n # The user could have moved the cursor backwards on the command-line.\n # We need to trigger completion from the $CursorPosition location, so we need\n # to truncate the command-line ($Command) up to the $CursorPosition location.\n # Make sure the $Command is longer then the $CursorPosition before we truncate.\n # This happens because the $Command does not include the last space.\n if ($Command.Length -gt $CursorPosition) {\n $Command = $Command.Substring(0, $CursorPosition)\n }\n __${name.value}_debug \"Truncated command: $Command\"\n\n $ShellCompDirectiveError=${CompletionDirective.CompletionDirectiveError}\n $ShellCompDirectiveNoSpace=${CompletionDirective.CompletionDirectiveNoSpace}\n $ShellCompDirectiveNoFileComp=${\n CompletionDirective.CompletionDirectiveNoFileComp\n }\n $ShellCompDirectiveFilterFileExt=${\n CompletionDirective.CompletionDirectiveFilterFileExt\n }\n $ShellCompDirectiveFilterDirs=${\n CompletionDirective.CompletionDirectiveFilterDirs\n }\n $ShellCompDirectiveKeepOrder=${\n CompletionDirective.CompletionDirectiveKeepOrder\n }\n\n # Prepare the command to request completions for the program.\n # Split the command at the first space to separate the program and arguments.\n $Program, $Arguments = $Command.Split(\" \", 2)\n\n $QuotedArgs = ($Arguments -split ' ' | ForEach-Object { \"'\" + ($_ -replace \"'\", \"''\") + \"'\" }) -join ' '\n __${name.value}_debug \"QuotedArgs: $QuotedArgs\"\n\n $RequestComp = \"& ${EXEC_COMMAND} complete '--' $QuotedArgs\"\n __${name.value}_debug \"RequestComp: $RequestComp\"\n\n # we cannot use $WordToComplete because it\n # has the wrong values if the cursor was moved\n # so use the last argument\n if ($WordToComplete -ne \"\" ) {\n $WordToComplete = $Arguments.Split(\" \")[-1]\n }\n __${name.value}_debug \"New WordToComplete: $WordToComplete\"\n\n\n # Check for flag with equal sign\n $IsEqualFlag = ($WordToComplete -Like \"--*=*\" )\n if ( $IsEqualFlag ) {\n __${name.value}_debug \"Completing equal sign flag\"\n # Remove the flag part\n $Flag, $WordToComplete = $WordToComplete.Split(\"=\", 2)\n }\n\n if ( $WordToComplete -eq \"\" -And ( -Not $IsEqualFlag )) {\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 method.\n __${name.value}_debug \"Adding extra empty parameter\"\n # PowerShell 7.2+ changed the way how the arguments are passed to executables,\n # so for pre-7.2 or when Legacy argument passing is enabled we need to use\n if ($PSVersionTable.PsVersion -lt [version]'7.2.0' -or\n ($PSVersionTable.PsVersion -lt [version]'7.3.0' -and -not [ExperimentalFeature]::IsEnabled(\"PSNativeCommandArgumentPassing\")) -or\n (($PSVersionTable.PsVersion -ge [version]'7.3.0' -or [ExperimentalFeature]::IsEnabled(\"PSNativeCommandArgumentPassing\")) -and\n $PSNativeCommandArgumentPassing -eq 'Legacy')) {\n $RequestComp=\"$RequestComp\" + ' \\\\\\`\"\\\\\\`\"'\n } else {\n $RequestComp = \"$RequestComp\" + ' \"\"'\n }\n }\n\n __${name.value}_debug \"Calling $RequestComp\"\n # First disable ActiveHelp which is not supported for Powershell\n $env:ActiveHelp = 0\n\n # call the command store the output in $out and redirect stderr and stdout to null\n # $Out is an array contains each line per element\n Invoke-Expression -OutVariable out \"$RequestComp\" 2>&1 | Out-Null\n\n # get directive from last line\n [int]$Directive = $Out[-1].TrimStart(':')\n if ($Directive -eq \"\") {\n # There is no directive specified\n $Directive = 0\n }\n __${name.value}_debug \"The completion directive is: $Directive\"\n\n # remove directive (last element) from out\n $Out = $Out | Where-Object { $_ -ne $Out[-1] }\n __${name.value}_debug \"The completions are: $Out\"\n if (($Directive -band $ShellCompDirectiveError) -ne 0 ) {\n # Error code. No completion.\n __${name.value}_debug \"Received error from custom completion go code\"\n return\n }\n\n $Longest = 0\n [Array]$Values = $Out | ForEach-Object {\n # Split the output in name and description\n $Name, $Description = $_.Split(\"\\\\\\`t\", 2)\n __${name.value}_debug \"Name: $Name Description: $Description\"\n\n # Look for the longest completion so that we can format things nicely\n if ($Longest -lt $Name.Length) {\n $Longest = $Name.Length\n }\n\n # Set the description to a one space string if there is none set.\n # This is needed because the CompletionResult does not accept an empty string as argument\n if (-Not $Description) {\n $Description = \" \"\n }\n @{ Name = \"$Name\"; Description = \"$Description\" }\n }\n\n\n $Space = \" \"\n if (($Directive -band $ShellCompDirectiveNoSpace) -ne 0 ) {\n # remove the space here\n __${name.value}_debug \"ShellCompDirectiveNoSpace is called\"\n $Space = \"\"\n }\n\n if ((($Directive -band $ShellCompDirectiveFilterFileExt) -ne 0 ) -or\n (($Directive -band $ShellCompDirectiveFilterDirs) -ne 0 )) {\n __${\n name.value\n }_debug \"ShellCompDirectiveFilterFileExt ShellCompDirectiveFilterDirs are not supported\"\n\n # return here to prevent the completion of the extensions\n return\n }\n\n $Values = $Values | Where-Object {\n # filter the result\n $_.Name -like \"$WordToComplete*\"\n\n # Join the flag back if we have an equal sign flag\n if ( $IsEqualFlag ) {\n __${\n name.value\n }_debug \"Join the equal sign flag back to the completion value\"\n $_.Name = $Flag + \"=\" + $_.Name\n }\n }\n\n # we sort the values in ascending order by name if keep order isn't passed\n if (($Directive -band $ShellCompDirectiveKeepOrder) -eq 0 ) {\n $Values = $Values | Sort-Object -Property Name\n }\n\n if (($Directive -band $ShellCompDirectiveNoFileComp) -ne 0 ) {\n __${name.value}_debug \"ShellCompDirectiveNoFileComp is called\"\n\n if ($Values.Length -eq 0) {\n # Just print an empty string here so the\n # shell does not start to complete paths.\n # We cannot use CompletionResult here because\n # it does not accept an empty string as argument.\n \"\"\n return\n }\n }\n\n # Get the current mode\n $Mode = (Get-PSReadLineKeyHandler | Where-Object { $_.Key -eq \"Tab\" }).Function\n __${name.value}_debug \"Mode: $Mode\"\n\n $Values | ForEach-Object {\n\n # store temporary because switch will overwrite $_\n $comp = $_\n\n # PowerShell supports three different completion modes\n # - TabCompleteNext (default windows style - on each key press the next option is displayed)\n # - Complete (works like bash)\n # - MenuComplete (works like zsh)\n # You set the mode with Set-PSReadLineKeyHandler -Key Tab -Function <mode>\n\n # CompletionResult Arguments:\n # 1) CompletionText text to be used as the auto completion result\n # 2) ListItemText text to be displayed in the suggestion list\n # 3) ResultType type of completion result\n # 4) ToolTip text for the tooltip with details about the object\n\n switch ($Mode) {\n\n # bash like\n \"Complete\" {\n\n if ($Values.Length -eq 1) {\n __${name.value}_debug \"Only one completion left\"\n\n # insert space after value\n [System.Management.Automation.CompletionResult]::new($($comp.Name | __${\n name.value\n }_escapeStringWithSpecialChars) + $Space, \"$($comp.Name)\", 'ParameterValue', \"$($comp.Description)\")\n\n } else {\n # Add the proper number of spaces to align the descriptions\n while($comp.Name.Length -lt $Longest) {\n $comp.Name = $comp.Name + \" \"\n }\n\n # Check for empty description and only add parentheses if needed\n if ($($comp.Description) -eq \" \" ) {\n $Description = \"\"\n } else {\n $Description = \" ($($comp.Description))\"\n }\n\n [System.Management.Automation.CompletionResult]::new(\"$($comp.Name)$Description\", \"$($comp.Name)$Description\", 'ParameterValue', \"$($comp.Description)\")\n }\n }\n\n # zsh like\n \"MenuComplete\" {\n # insert space after value\n # MenuComplete will automatically show the ToolTip of\n # the highlighted value at the bottom of the suggestions.\n [System.Management.Automation.CompletionResult]::new($($comp.Name | __${\n name.value\n }_escapeStringWithSpecialChars) + $Space, \"$($comp.Name)\", 'ParameterValue', \"$($comp.Description)\")\n }\n\n # TabCompleteNext and in case we get something unknown\n Default {\n # Like MenuComplete but we don't want to add a space here because\n # the user need to press space anyway to get the completion.\n # Description will not be shown because that's not possible with TabCompleteNext\n [System.Management.Automation.CompletionResult]::new($($comp.Name | __${\n name.value\n }_escapeStringWithSpecialChars), \"$($comp.Name)\", 'ParameterValue', \"$($comp.Description)\")\n }\n }\n }\n}\n\nRegister-ArgumentCompleter -CommandName '${bin.value}' -ScriptBlock $__${\n name.value\n }CompleterBlock\n\\`; `}\n />\n <Spacing />\n <VarDeclaration\n export\n const\n name=\"SHELL_COMPLETIONS_DISPLAY\"\n initializer={code` SHELL_COMPLETIONS.split(\"\\\\n\").map(line => {\n if (!line.trim()) {\n return \"\";\n }\n if (line.trim().startsWith(\"#\")) {\n return \\`\\${dim(line)}\\`;\n }\n\n return white(line).replaceAll(/(?<=\\\\\\$(\\\\{|\\\\()).*(?=(\\\\}\\\\)))/g, green(\"$&\"))\n .replaceAll(/\\\\\".*\\\\\"/g, cyan(\"$&\"))\n .replaceAll(/(\\\\[|\\\\]|\\\\(|\\\\)|\\\\||<|>|\\\\$\\\\(|\\\\$?\\\\{|\\\\}|\\\\+|=|;|::new|::OutputEncoding|::UTF8)/g, bold(gray(\"$&\")))\n .replaceAll(/(switch|complete)\\\\s+/g, green(\"$&\"))\n .replaceAll(/(?<=(switch|complete)\\\\s+)\\\\w/g, bold(greenBright(\"$&\")))\n .replaceAll(/(Get-PSReadLineKeyHandler|Where-Object|ExperimentalFeature|Console|ScriptBlock|Array|ForEach-Object|Register-ArgumentCompleter|System.Management.Automation.CompletionResult|$\\\\w+)\\\\s+/g, red(\"$&\"))\n .replaceAll(/(?<=(Get-PSReadLineKeyHandler|Where-Object|ExperimentalFeature|Console|ScriptBlock|Array|ForEach-Object|Register-ArgumentCompleter|System.Management.Automation.CompletionResult|$\\\\w+)\\\\s+)\\\\w/g, bold(redBright(\"$&\")))\n .replaceAll(/while\\\\s+/g, cyan(\"$&\"))\n .replaceAll(/(?<=while\\\\s+)\\\\w/g, bold(cyanBright(\"$&\")))\n .replaceAll(/(if|fi|else|elif|then|done)\\\\s+/g, green(\"$&\"))\n .replaceAll(/\\\\$?__\\\\w/g, bold(magentaBright(\"$&\")))\n .replaceAll(/(?<=\\\\s)(-\\\\w|--\\\\w[\\\\w-]*)(?=\\\\s|$)/g, bold(magenta(\"$&\")));\n\n }).join(\"\\\\n\"); `}\n />\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,SAAE,8BAAA;CACF,MAAO,UAAS,eAAA;CACd,MAAM,MAAA,eAAU,UAAc,QAAA,CAAA;;AAE9B,QAAM,gBAAmB,gBAAY;EACrC,IAAM,OAAO;;;EAGX,gBAAC,EACC,SAAM;GAAA;GAAS;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA,EAChB;EACD,IAAI,WAAC;AACH,UAAG;IAAA,gBAAW,SAAA,EAAA,CAAA;IAAA,gBAAA,gBAAA;KACZ,SAAQ;KACT,UAAA;KACD,MAAA;KACE,IAAA,cAAS;AACP,aAAO,IAAA,kCAAA,YAAA,QAAA,CAAA;;;iBAGD,KAAA,MAAA;;;;;;eAML,KAAS,MAAC;;;;kBAIb,KAAA,MAAA;;;;;;;;;;;QAWA,KAAK,MAAM;QACX,KAAA,MAAA;QACJ,KAAA,MAAA;;;;;;;;;;QAUI,KAAK,MAAA;;;iCAGiB,oBAAuB,2BAAC;oCAC3B,oBAAA,8BAAA;uCACH,oBAAA,iCAAA;;mCAEG,oBAAA,6BAAA;;;;;;;QAOrB,KAAK,MAAQ;;wBAEK,aAAK;QACrB,KAAC,MAAU;;;;;;;;QAQf,KAAA,MAAA;;;;;;YAMA,KAAA,MAAA;;;;;;;;;;;;;;;;;;;;;QAqBI,KAAK,MAAM;;;;;;;;;;;;;;QAcX,KAAI,MAAK;;;;QAIT,KAAK,MAAC;;;YAGF,KAAE,MAAA;;;;;;;;YAQL,KAAA,MAAa;;;;;;;;;;;;;;;;;;;YAmBV,KAAK,MAAM;;;;;;YAMb,KAAM,MAAI;;;;;;;;;;;;gBAYP,KAAA,MAAc;;;;;;;;;;;YAWvB,KAAA,MAAA;;;;;;;;;;;;;;QAcI,KAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;wBAyBL,KAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;wFA2BO,KAAA,MAAA;;;;;;;;wFAQQ,KAAA,MAAA;;;;;;2CAMgB,IAAI,MAAK,oBAAA,KAAA,MAAA;;;KAG7C,CAAC;IAAE,gBAAkB,SAAS,EAAC,CAAA;IAAA,gBAAqB,gBAAgB;KACnE,UAAU;KACV,SAAS;KACT,MAAM;KACN,aAAa,IAAI;;;;;;;;;;;;;;;;;;;;;;KAsBlB,CAAC;IAAC;;EAEN,CAAC"}
1
+ {"version":3,"file":"powershell-shared.mjs","names":[],"sources":[],"mappings":""}
@@ -3,7 +3,6 @@ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
3
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
4
4
  let _alloy_js_core = require("@alloy-js/core");
5
5
  let _alloy_js_typescript = require("@alloy-js/typescript");
6
- let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
7
6
  let _powerlines_plugin_alloy_core = require("@powerlines/plugin-alloy/core");
8
7
  let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
9
8
  let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
@@ -37,7 +36,7 @@ function ZshConfigCompletionsCommand() {
37
36
  get children() {
38
37
  return [
39
38
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Options for the Zsh Completions - Configuration command." }),
40
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
39
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceDeclaration, {
41
40
  "export": true,
42
41
  name: "ZshConfigCompletionsOptions",
43
42
  get children() {
@@ -45,15 +44,12 @@ function ZshConfigCompletionsCommand() {
45
44
  heading: "Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.",
46
45
  get children() {
47
46
  return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
48
- get type() {
49
- return _powerlines_deepkit_vendor_type.ReflectionKind.boolean;
50
- },
47
+ type: "boolean",
51
48
  defaultValue: false
52
49
  });
53
50
  }
54
51
  }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
55
52
  name: "display",
56
- optional: true,
57
53
  type: "boolean"
58
54
  })];
59
55
  }
@@ -1,10 +1,8 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
-
3
1
  //#region src/components/zsh-config-command.d.ts
4
2
  /**
5
3
  * The Zsh Completions - Configuration command's handler wrapper for the Shell Shock project.
6
4
  */
7
- declare function ZshConfigCompletionsCommand(): _$_alloy_js_core0.Children;
5
+ declare function ZshConfigCompletionsCommand(): import("@alloy-js/core").Children;
8
6
  //#endregion
9
7
  export { ZshConfigCompletionsCommand };
10
8
  //# sourceMappingURL=zsh-config-command.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"zsh-config-command.d.cts","names":[],"sources":["../../src/components/zsh-config-command.tsx"],"mappings":";;;;;;iBA4CgB,2BAAA,CAAA,GAA2B,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"zsh-config-command.d.cts","names":[],"sources":["../../src/components/zsh-config-command.tsx"],"mappings":";;AA2CA;;iBAAgB,2BAAA,6BAA2B,QAAA"}
@@ -1,10 +1,8 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
-
3
1
  //#region src/components/zsh-config-command.d.ts
4
2
  /**
5
3
  * The Zsh Completions - Configuration command's handler wrapper for the Shell Shock project.
6
4
  */
7
- declare function ZshConfigCompletionsCommand(): _$_alloy_js_core0.Children;
5
+ declare function ZshConfigCompletionsCommand(): import("@alloy-js/core").Children;
8
6
  //#endregion
9
7
  export { ZshConfigCompletionsCommand };
10
8
  //# sourceMappingURL=zsh-config-command.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"zsh-config-command.d.mts","names":[],"sources":["../../src/components/zsh-config-command.tsx"],"mappings":";;;;;;iBA4CgB,2BAAA,CAAA,GAA2B,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"zsh-config-command.d.mts","names":[],"sources":["../../src/components/zsh-config-command.tsx"],"mappings":""}
@@ -1,11 +1,10 @@
1
1
  import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
2
2
  import { getAppTitle } from "@shell-shock/core/plugin-utils";
3
3
  import { code } from "@alloy-js/core";
4
- import { ElseClause, FunctionDeclaration, IfStatement, InterfaceDeclaration, VarDeclaration } from "@alloy-js/typescript";
5
- import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
4
+ import { ElseClause, FunctionDeclaration, IfStatement, VarDeclaration } from "@alloy-js/typescript";
6
5
  import { Spacing } from "@powerlines/plugin-alloy/core";
7
6
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
8
- import { InterfaceMember as InterfaceMember$1, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
7
+ import { InterfaceDeclaration as InterfaceDeclaration$1, InterfaceMember, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
9
8
  import { TSDoc as TSDoc$1, TSDocDefaultValue as TSDocDefaultValue$1 } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
10
9
  import { joinPaths } from "@stryke/path";
11
10
 
@@ -36,7 +35,7 @@ function ZshConfigCompletionsCommand() {
36
35
  get children() {
37
36
  return [
38
37
  createComponent(TSDoc$1, { heading: "Options for the Zsh Completions - Configuration command." }),
39
- createComponent(InterfaceDeclaration, {
38
+ createComponent(InterfaceDeclaration$1, {
40
39
  "export": true,
41
40
  name: "ZshConfigCompletionsOptions",
42
41
  get children() {
@@ -44,15 +43,12 @@ function ZshConfigCompletionsCommand() {
44
43
  heading: "Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.",
45
44
  get children() {
46
45
  return createComponent(TSDocDefaultValue$1, {
47
- get type() {
48
- return ReflectionKind.boolean;
49
- },
46
+ type: "boolean",
50
47
  defaultValue: false
51
48
  });
52
49
  }
53
- }), createComponent(InterfaceMember$1, {
50
+ }), createComponent(InterfaceMember, {
54
51
  name: "display",
55
- optional: true,
56
52
  type: "boolean"
57
53
  })];
58
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"zsh-config-command.mjs","names":[],"sources":["../../src/components/zsh-config-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 ElseClause,\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} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport type { CompletionsPluginContext } from \"../types/plugin\";\n\n/**\n * The Zsh Completions - Configuration command's handler wrapper for the Shell Shock project.\n */\nexport function ZshConfigCompletionsCommand() {\n const context = usePowerlines<CompletionsPluginContext>();\n\n return (\n <TypescriptFile\n path={joinPaths(\n context.entryPath,\n \"completions\",\n \"zsh\",\n \"config\",\n \"command.ts\"\n )}\n imports={{\n \"node:os\": \"os\",\n \"node:path\": [\"join\"],\n \"node:fs/promises\": [\"readFile\", \"writeFile\"],\n \"../shared\": [\"SHELL_COMPLETIONS\", \"SHELL_COMPLETIONS_DISPLAY\"]\n }}\n builtinImports={{\n console: [\"bold\", \"inlineCode\", \"writeLine\", \"success\", \"warn\", \"help\"]\n }}>\n <TSDoc heading=\"Options for the Zsh Completions - Configuration command.\" />\n <InterfaceDeclaration export name=\"ZshConfigCompletionsOptions\">\n <TSDoc heading=\"Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.\">\n <TSDocDefaultValue\n type={ReflectionKind.boolean}\n defaultValue={false}\n />\n </TSDoc>\n <InterfaceMember name=\"display\" optional type=\"boolean\" />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Handler logic for the \\`completions zsh config\\` command.\"></TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[\n {\n name: \"options\",\n type: \"ZshConfigCompletionsOptions\",\n default: \"{}\"\n },\n {\n name: \"path\",\n type: \"string\",\n default: `\"~/.zshrc\"`\n }\n ]}>\n <IfStatement condition={code`options.display !== true`}>\n <VarDeclaration\n let\n name=\"configPath\"\n type=\"string\"\n initializer={code` path.includes(\".\") ? path : join(path, \".zshrc\");`}\n />\n <Spacing />\n <IfStatement condition={code`configPath.startsWith(\"~\")`}>\n {code`configPath = join(os.homedir(), configPath.replace(\"~\", \"\")); `}\n </IfStatement>\n <Spacing />\n <VarDeclaration\n let\n name=\"content\"\n type=\"string\"\n initializer={code`\"\";`}\n />\n <Spacing />\n {code`try {\n content = await readFile(configPath, \"utf8\");\n } catch (error) {\n if (typeof error === \"object\" && error !== null && \"code\" in error && error.code === \"ENOENT\") {\n // If the file doesn't exist, we can create it later when writing the completion script.\n warn(\\`Configuration file \\${bold(configPath)} does not exist. It will be created when the completion script is written.\\`);\n } else {\n return { error };\n }\n }\n\n await writeFile(configPath, \\`\\${content}\\\\n\\\\n### Begin - ${getAppTitle(context)} Shell Completions ###\\\\n\\\\n\\${SHELL_COMPLETIONS} \\\\n\\\\n### End - ${getAppTitle(\n context\n )} Zsh Completions ###\\`);\n\n success(\\`${getAppTitle(\n context\n )} shell completions have been applied to Zsh configuration file at \\${bold(configPath)}. Please restart your terminal or run \\${inlineCode(\\`source \\${configPath}\\`)} for the changes to take effect.\\`); `}\n </IfStatement>\n <ElseClause>\n {code`writeLine(\" ------------------------------------------------- \");\n writeLine(\"\");\n writeLine(\\`### Begin - ${getAppTitle(context)} Zsh Completions ###\\`);\n writeLine(\"\");\n SHELL_COMPLETIONS_DISPLAY.split(\"\\\\n\").map(line => writeLine(line));\n writeLine(\"\");\n writeLine(\\`### End - ${getAppTitle(context)} Zsh Completions ###\\`);\n writeLine(\"\");\n writeLine(\" ------------------------------------------------- \");\n\n writeLine(\"\");\n help(\\`To enable these completions, perform one of the following actions:\n\n 1) Copy and paste the above script into your shell configuration file (e.g., ~/.config/zsh/.zshrc)\n 2) Save the above script to a file and source it from your shell configuration file \\`); `}\n </ElseClause>\n </FunctionDeclaration>\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+BA,SAAE,8BAAA;CACA,MAAM,UAAC,eAAwB;AACjC,QAAO,gBAAA,gBAAA;EACL,IAAK,OAAA;AACL,UAAA,UAAA,QAAA,WAAA,eAAA,OAAA,UAAA,aAAA;;EAEF,SAAS;GACH,WAAG;GACH,aAAQ,CAAA,OAAA;;GAEZ,aAAA,CAAA,qBAAA,4BAAA;GACC;EACD,gBAAA,EACI,SAAS;GAAC;GAAA;GAAA;GAA8B;GAAA;GAAA;GAAA,EAC5C;;AAEA,UAAO;IAAA,gBAAA,SAAA,EACJ,SAAA,4DACC,CAAA;IAAI,gBAAW,sBAAA;KACb,UAAQ;KACR,MAAC;KACD,IAAI,WAAC;AACJ,aAAO,CAAA,gBAAA,SAAA;OACP,SAAU;OACZ,IAAA,WAAA;AACO,eAAC,gBAAA,qBAAA;SACC,IAAI,OAAG;AACL,iBAAK,eAAM;;SAEjB,cAAW;SAChB,CAAA;;OAEC,CAAA,EAAA,gBAAmB,mBAAc;OACjC,MAAA;OACI,UAAU;OACf,MAAA;OACE,CAAA,CAAA;;KAEF,CAAC;IAAE,gBAAQ,SAAe,EAAA,CAAO;IAAA,gBAAA,SAAA,EAChC,SAAI,+DACL,CAAC;IAAE,gBAAC,qBAAA;KACH,UAAO;KACP,WAAC;KACD,OAAA;KACD,MAAO;KACP,YAAa,CAAC;MACd,MAAA;MACC,MAAA;MACA,SAAA;MACA,EAAA;MACA,MAAM;MACN,MAAA;MACE,SAAA;MACD,CAAC;KACF,IAAI,WAAO;AACT,aAAE,CAAA,gBAAY,aAAA;OACb,WAAA,IAAA;OACD,IAAA,WAAA;AACE,eAAO;SAAA,gBAAK,gBAAA;UACR,OAAG;UACP,MAAU;UACZ,MAAA;UACA,aAAA,IAAA;UACD,CAAA;SAAA,gBAA2B,SAAS,EAAA,CAAA;SAAA,gBAAkB,aAAA;UACpD,WAAA,IAAA;UACC,UAAA,IAAA;UACA,CAAI;SAAE,gBAAU,SAAA,EAAA,CAAA;SAAA,gBAAA,gBAAA;UACZ,OAAE;UACN,MAAA;UACD,MAAA;UACA,aAAS,IAAA;UACT,CAAA;SAAA,gBAAuB,SAAK,EAAA,CAAA;SAAW,WAAa,IAAI;;;;;;;;;;;uEAW/C,YAAA,QAAA,CAAA,oEAAA,YAAA,QAAA,CAAA;;sBAED,YAAO,QAAA,CAAA,4MAAA;SAAA;;OAEf,CAAC,EAAE,gBAAe,YAAe,EAChC,IAAE,WAAO;AACP,cAAK,IAAA;;sCAEP,YAAA,QAAA,CAAA;;;;oCAIA,YAAA,QAAA,CAAA;;;;;;;;;SAUD,CAAC,CAAA;;KAEL,CAAC;IAAC;;EAEN,CAAC"}
1
+ {"version":3,"file":"zsh-config-command.mjs","names":[],"sources":[],"mappings":""}
@@ -3,7 +3,6 @@ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
3
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
4
4
  let _alloy_js_core = require("@alloy-js/core");
5
5
  let _alloy_js_typescript = require("@alloy-js/typescript");
6
- let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
7
6
  let _powerlines_plugin_alloy_core = require("@powerlines/plugin-alloy/core");
8
7
  let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
9
8
  let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
@@ -39,7 +38,7 @@ function ZshScriptCompletionsCommand() {
39
38
  get children() {
40
39
  return [
41
40
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Options for the Zsh Completions - Script command." }),
42
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
41
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceDeclaration, {
43
42
  "export": true,
44
43
  name: "ZshScriptCompletionsOptions",
45
44
  get children() {
@@ -47,15 +46,12 @@ function ZshScriptCompletionsCommand() {
47
46
  heading: "Should the generated completion script be written to console output instead of an actual file on disk? This is useful for debugging purposes or if you want to manually handle the output.",
48
47
  get children() {
49
48
  return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
50
- get type() {
51
- return _powerlines_deepkit_vendor_type.ReflectionKind.boolean;
52
- },
49
+ type: "boolean",
53
50
  defaultValue: false
54
51
  });
55
52
  }
56
53
  }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
57
54
  name: "display",
58
- optional: true,
59
55
  type: "boolean"
60
56
  })];
61
57
  }
@@ -1,10 +1,8 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
-
3
1
  //#region src/components/zsh-script-command.d.ts
4
2
  /**
5
3
  * The Zsh Completions - Script command's handler wrapper for the Shell Shock project.
6
4
  */
7
- declare function ZshScriptCompletionsCommand(): _$_alloy_js_core0.Children;
5
+ declare function ZshScriptCompletionsCommand(): import("@alloy-js/core").Children;
8
6
  //#endregion
9
7
  export { ZshScriptCompletionsCommand };
10
8
  //# sourceMappingURL=zsh-script-command.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"zsh-script-command.d.cts","names":[],"sources":["../../src/components/zsh-script-command.tsx"],"mappings":";;;;;;iBA6CgB,2BAAA,CAAA,GAA2B,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"zsh-script-command.d.cts","names":[],"sources":["../../src/components/zsh-script-command.tsx"],"mappings":";;AA4CA;;iBAAgB,2BAAA,6BAA2B,QAAA"}
@@ -1,10 +1,8 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
-
3
1
  //#region src/components/zsh-script-command.d.ts
4
2
  /**
5
3
  * The Zsh Completions - Script command's handler wrapper for the Shell Shock project.
6
4
  */
7
- declare function ZshScriptCompletionsCommand(): _$_alloy_js_core0.Children;
5
+ declare function ZshScriptCompletionsCommand(): import("@alloy-js/core").Children;
8
6
  //#endregion
9
7
  export { ZshScriptCompletionsCommand };
10
8
  //# sourceMappingURL=zsh-script-command.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"zsh-script-command.d.mts","names":[],"sources":["../../src/components/zsh-script-command.tsx"],"mappings":";;;;;;iBA6CgB,2BAAA,CAAA,GAA2B,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"zsh-script-command.d.mts","names":[],"sources":["../../src/components/zsh-script-command.tsx"],"mappings":""}