@shell-shock/plugin-completions 0.4.16 → 0.4.19

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 (113) hide show
  1. package/dist/components/bash-config-command.cjs +116 -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 +115 -6
  7. package/dist/components/bash-config-command.mjs.map +1 -1
  8. package/dist/components/bash-script-command.cjs +101 -5
  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 +100 -5
  14. package/dist/components/bash-script-command.mjs.map +1 -1
  15. package/dist/components/bash-shared.cjs +77 -13
  16. package/dist/components/bash-shared.d.cts +1 -3
  17. package/dist/components/bash-shared.d.cts.map +1 -1
  18. package/dist/components/bash-shared.d.mts +1 -3
  19. package/dist/components/bash-shared.d.mts.map +1 -1
  20. package/dist/components/bash-shared.mjs +76 -13
  21. package/dist/components/bash-shared.mjs.map +1 -1
  22. package/dist/components/fish-config-command.cjs +116 -6
  23. package/dist/components/fish-config-command.d.cts +1 -3
  24. package/dist/components/fish-config-command.d.cts.map +1 -1
  25. package/dist/components/fish-config-command.d.mts +1 -3
  26. package/dist/components/fish-config-command.d.mts.map +1 -1
  27. package/dist/components/fish-config-command.mjs +115 -6
  28. package/dist/components/fish-config-command.mjs.map +1 -1
  29. package/dist/components/fish-script-command.cjs +100 -4
  30. package/dist/components/fish-script-command.d.cts +1 -3
  31. package/dist/components/fish-script-command.d.cts.map +1 -1
  32. package/dist/components/fish-script-command.d.mts +1 -3
  33. package/dist/components/fish-script-command.d.mts.map +1 -1
  34. package/dist/components/fish-script-command.mjs +99 -4
  35. package/dist/components/fish-script-command.mjs.map +1 -1
  36. package/dist/components/fish-shared.cjs +141 -77
  37. package/dist/components/fish-shared.d.cts +1 -3
  38. package/dist/components/fish-shared.d.cts.map +1 -1
  39. package/dist/components/fish-shared.d.mts +1 -3
  40. package/dist/components/fish-shared.d.mts.map +1 -1
  41. package/dist/components/fish-shared.mjs +140 -77
  42. package/dist/components/fish-shared.mjs.map +1 -1
  43. package/dist/components/index.cjs +26 -1
  44. package/dist/components/index.mjs +14 -1
  45. package/dist/components/powershell-config-command.cjs +112 -6
  46. package/dist/components/powershell-config-command.d.cts +1 -3
  47. package/dist/components/powershell-config-command.d.cts.map +1 -1
  48. package/dist/components/powershell-config-command.d.mts +1 -3
  49. package/dist/components/powershell-config-command.d.mts.map +1 -1
  50. package/dist/components/powershell-config-command.mjs +111 -6
  51. package/dist/components/powershell-config-command.mjs.map +1 -1
  52. package/dist/components/powershell-script-command.cjs +100 -4
  53. package/dist/components/powershell-script-command.d.cts +1 -3
  54. package/dist/components/powershell-script-command.d.cts.map +1 -1
  55. package/dist/components/powershell-script-command.d.mts +1 -3
  56. package/dist/components/powershell-script-command.d.mts.map +1 -1
  57. package/dist/components/powershell-script-command.mjs +99 -4
  58. package/dist/components/powershell-script-command.mjs.map +1 -1
  59. package/dist/components/powershell-shared.cjs +101 -37
  60. package/dist/components/powershell-shared.d.cts +1 -3
  61. package/dist/components/powershell-shared.d.cts.map +1 -1
  62. package/dist/components/powershell-shared.d.mts +1 -3
  63. package/dist/components/powershell-shared.d.mts.map +1 -1
  64. package/dist/components/powershell-shared.mjs +100 -37
  65. package/dist/components/powershell-shared.mjs.map +1 -1
  66. package/dist/components/zsh-config-command.cjs +116 -6
  67. package/dist/components/zsh-config-command.d.cts +1 -3
  68. package/dist/components/zsh-config-command.d.cts.map +1 -1
  69. package/dist/components/zsh-config-command.d.mts +1 -3
  70. package/dist/components/zsh-config-command.d.mts.map +1 -1
  71. package/dist/components/zsh-config-command.mjs +115 -6
  72. package/dist/components/zsh-config-command.mjs.map +1 -1
  73. package/dist/components/zsh-script-command.cjs +104 -6
  74. package/dist/components/zsh-script-command.d.cts +1 -3
  75. package/dist/components/zsh-script-command.d.cts.map +1 -1
  76. package/dist/components/zsh-script-command.d.mts +1 -3
  77. package/dist/components/zsh-script-command.d.mts.map +1 -1
  78. package/dist/components/zsh-script-command.mjs +103 -6
  79. package/dist/components/zsh-script-command.mjs.map +1 -1
  80. package/dist/components/zsh-shared.cjs +106 -42
  81. package/dist/components/zsh-shared.d.cts +1 -3
  82. package/dist/components/zsh-shared.d.cts.map +1 -1
  83. package/dist/components/zsh-shared.d.mts +1 -3
  84. package/dist/components/zsh-shared.d.mts.map +1 -1
  85. package/dist/components/zsh-shared.mjs +105 -42
  86. package/dist/components/zsh-shared.mjs.map +1 -1
  87. package/dist/helpers/complete-command.cjs +10 -1
  88. package/dist/helpers/complete-command.d.mts.map +1 -1
  89. package/dist/helpers/complete-command.mjs +8 -1
  90. package/dist/helpers/complete-command.mjs.map +1 -1
  91. package/dist/helpers/completion-directive-constants.cjs +16 -1
  92. package/dist/helpers/completion-directive-constants.d.mts.map +1 -1
  93. package/dist/helpers/completion-directive-constants.mjs +14 -1
  94. package/dist/helpers/completion-directive-constants.mjs.map +1 -1
  95. package/dist/helpers/index.cjs +6 -1
  96. package/dist/helpers/index.mjs +4 -1
  97. package/dist/index.cjs +290 -1
  98. package/dist/index.d.cts +2 -2
  99. package/dist/index.d.mts +2 -2
  100. package/dist/index.d.mts.map +1 -1
  101. package/dist/index.mjs +288 -1
  102. package/dist/index.mjs.map +1 -1
  103. package/dist/types/index.cjs +4 -1
  104. package/dist/types/index.mjs +3 -1
  105. package/dist/types/plugin.d.cts.map +1 -1
  106. package/dist/types/plugin.d.mts.map +1 -1
  107. package/dist/types/plugin.mjs +1 -1
  108. package/dist/types/shell-type.cjs +12 -1
  109. package/dist/types/shell-type.d.cts.map +1 -1
  110. package/dist/types/shell-type.d.mts.map +1 -1
  111. package/dist/types/shell-type.mjs +10 -1
  112. package/dist/types/shell-type.mjs.map +1 -1
  113. package/package.json +13 -13
@@ -1,4 +1,99 @@
1
- import{createComponent as e,memo as t}from"@alloy-js/core/jsx-runtime";import{getAppTitle as n}from"@shell-shock/core/plugin-utils";import{code as r}from"@alloy-js/core";import{ElseClause as i,FunctionDeclaration as a,IfStatement as o,InterfaceDeclaration as s,InterfaceMember as c,VarDeclaration as l}from"@alloy-js/typescript";import{ReflectionKind as u}from"@powerlines/deepkit/vendor/type";import{Spacing as d}from"@powerlines/plugin-alloy/core";import{usePowerlines as f}from"@powerlines/plugin-alloy/core/contexts/context";import{TSDoc as p,TSDocDefaultValue as m}from"@powerlines/plugin-alloy/typescript";import{joinPaths as h}from"@stryke/path";import{TypescriptFile as g}from"@powerlines/plugin-alloy/typescript/components/typescript-file";function _(){let _=f();return e(g,{get path(){return h(_.entryPath,`completions`,`fish`,`config`,`command.ts`)},imports:{"node:os":`os`,"node:path":[`join`],"node:fs/promises":[`readFile`,`writeFile`],"../shared":[`SHELL_COMPLETIONS`,`SHELL_COMPLETIONS_DISPLAY`]},builtinImports:{console:[`bold`,`inlineCode`,`writeLine`,`success`,`warn`,`help`]},get children(){return[e(p,{heading:`Options for the Fish Completions - Configuration command.`}),e(s,{export:!0,name:`FishConfigCompletionsOptions`,get children(){return[e(p,{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.`,get children(){return e(m,{get type(){return u.boolean},defaultValue:!1})}}),e(c,{name:`display`,optional:!0,type:`boolean`})]}}),e(d,{}),e(p,{heading:"Handler logic for the \\`completions fish config\\` command."}),e(a,{export:!0,default:!0,async:!0,name:`handler`,parameters:[{name:`options`,type:`FishConfigCompletionsOptions`,default:`{}`},{name:`path`,type:`string`,default:`"~/.config/fish/config.fish"`}],get children(){return[e(o,{condition:r`options.display !== true`,get children(){return[e(l,{let:!0,name:`configPath`,type:`string`,initializer:r` path.includes(".") ? path : join(path, ".config", "fish", "config.fish");`}),e(d,{}),e(o,{condition:r`configPath.startsWith("~")`,children:r`configPath = join(os.homedir(), configPath.replace("~", "")); `}),e(d,{}),e(l,{let:!0,name:`content`,type:`string`,initializer:r`"";`}),e(d,{}),t(()=>r`try {
1
+ import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
2
+ import { getAppTitle } from "@shell-shock/core/plugin-utils";
3
+ import { code } from "@alloy-js/core";
4
+ import { ElseClause, FunctionDeclaration, IfStatement, VarDeclaration } from "@alloy-js/typescript";
5
+ import { Spacing } from "@powerlines/plugin-alloy/core";
6
+ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
7
+ import { InterfaceDeclaration as InterfaceDeclaration$1, InterfaceMember, TSDoc, TSDocDefaultValue } from "@powerlines/plugin-alloy/typescript";
8
+ import { joinPaths } from "@stryke/path";
9
+ import { TypescriptFile as TypescriptFile$1 } from "@powerlines/plugin-alloy/typescript/components/typescript-file";
10
+
11
+ //#region src/components/fish-config-command.tsx
12
+ /**
13
+ * The Fish Completions - Configuration command's handler wrapper for the Shell Shock project.
14
+ */
15
+ function FishConfigCompletionsCommand() {
16
+ const context = usePowerlines();
17
+ return createComponent(TypescriptFile$1, {
18
+ get path() {
19
+ return joinPaths(context.entryPath, "completions", "fish", "config", "command.ts");
20
+ },
21
+ imports: {
22
+ "node:os": "os",
23
+ "node:path": ["join"],
24
+ "node:fs/promises": ["readFile", "writeFile"],
25
+ "../shared": ["SHELL_COMPLETIONS", "SHELL_COMPLETIONS_DISPLAY"]
26
+ },
27
+ builtinImports: { console: [
28
+ "bold",
29
+ "inlineCode",
30
+ "writeLine",
31
+ "success",
32
+ "warn",
33
+ "help"
34
+ ] },
35
+ get children() {
36
+ return [
37
+ createComponent(TSDoc, { heading: "Options for the Fish Completions - Configuration command." }),
38
+ createComponent(InterfaceDeclaration$1, {
39
+ "export": true,
40
+ name: "FishConfigCompletionsOptions",
41
+ get children() {
42
+ return [createComponent(TSDoc, {
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.",
44
+ get children() {
45
+ return createComponent(TSDocDefaultValue, {
46
+ type: "boolean",
47
+ defaultValue: false
48
+ });
49
+ }
50
+ }), createComponent(InterfaceMember, {
51
+ name: "display",
52
+ type: "boolean"
53
+ })];
54
+ }
55
+ }),
56
+ createComponent(Spacing, {}),
57
+ createComponent(TSDoc, { heading: "Handler logic for the \\`completions fish config\\` command." }),
58
+ createComponent(FunctionDeclaration, {
59
+ "export": true,
60
+ "default": true,
61
+ async: true,
62
+ name: "handler",
63
+ parameters: [{
64
+ name: "options",
65
+ type: "FishConfigCompletionsOptions",
66
+ default: "{}"
67
+ }, {
68
+ name: "path",
69
+ type: "string",
70
+ default: `"~/.config/fish/config.fish"`
71
+ }],
72
+ get children() {
73
+ return [createComponent(IfStatement, {
74
+ condition: code`options.display !== true`,
75
+ get children() {
76
+ return [
77
+ createComponent(VarDeclaration, {
78
+ "let": true,
79
+ name: "configPath",
80
+ type: "string",
81
+ initializer: code` path.includes(".") ? path : join(path, ".config", "fish", "config.fish");`
82
+ }),
83
+ createComponent(Spacing, {}),
84
+ createComponent(IfStatement, {
85
+ condition: code`configPath.startsWith("~")`,
86
+ children: code`configPath = join(os.homedir(), configPath.replace("~", "")); `
87
+ }),
88
+ createComponent(Spacing, {}),
89
+ createComponent(VarDeclaration, {
90
+ "let": true,
91
+ name: "content",
92
+ type: "string",
93
+ initializer: code`"";`
94
+ }),
95
+ createComponent(Spacing, {}),
96
+ memo(() => code`try {
2
97
  content = await readFile(configPath, "utf8");
3
98
  } catch (error) {
4
99
  if (typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT") {
@@ -9,15 +104,19 @@ import{createComponent as e,memo as t}from"@alloy-js/core/jsx-runtime";import{ge
9
104
  }
10
105
  }
11
106
 
12
- await writeFile(configPath, \`\${content}\\n\\n### Begin - ${n(_)} Fish Completions ###\\n\\n\${SHELL_COMPLETIONS} \\n\\n### End - ${n(_)} Fish Completions ###\`);
107
+ await writeFile(configPath, \`\${content}\\n\\n### Begin - ${getAppTitle(context)} Fish Completions ###\\n\\n\${SHELL_COMPLETIONS} \\n\\n### End - ${getAppTitle(context)} Fish Completions ###\`);
13
108
 
14
- success(\`${n(_)} shell completions have been applied to Fish configuration file at \${bold(configPath)}. Please restart your terminal or run \${inlineCode(\`source \${configPath}\`)} for the changes to take effect.\`); `)]}}),e(i,{get children(){return r`writeLine(" ------------------------------------------------- ");
109
+ success(\`${getAppTitle(context)} shell completions have been applied to Fish configuration file at \${bold(configPath)}. Please restart your terminal or run \${inlineCode(\`source \${configPath}\`)} for the changes to take effect.\`); `)
110
+ ];
111
+ }
112
+ }), createComponent(ElseClause, { get children() {
113
+ return code`writeLine(" ------------------------------------------------- ");
15
114
  writeLine("");
16
- writeLine(\`### Begin - ${n(_)} Fish Completions ###\`);
115
+ writeLine(\`### Begin - ${getAppTitle(context)} Fish Completions ###\`);
17
116
  writeLine("");
18
117
  SHELL_COMPLETIONS_DISPLAY.split("\\n").map(line => writeLine(line));
19
118
  writeLine("");
20
- writeLine(\`### End - ${n(_)} Fish Completions ###\`);
119
+ writeLine(\`### End - ${getAppTitle(context)} Fish Completions ###\`);
21
120
  writeLine("");
22
121
  writeLine(" ------------------------------------------------- ");
23
122
 
@@ -25,5 +124,15 @@ import{createComponent as e,memo as t}from"@alloy-js/core/jsx-runtime";import{ge
25
124
  help(\`To enable these completions, perform one of the following actions:
26
125
 
27
126
  1) Copy and paste the above script into your shell configuration file (e.g., ~/.config/fish/config.fish)
28
- 2) Save the above script to a file and source it from your shell configuration file \`); `}})]}})]}})}export{_ as FishConfigCompletionsCommand};
127
+ 2) Save the above script to a file and source it from your shell configuration file \`); `;
128
+ } })];
129
+ }
130
+ })
131
+ ];
132
+ }
133
+ });
134
+ }
135
+
136
+ //#endregion
137
+ export { FishConfigCompletionsCommand };
29
138
  //# sourceMappingURL=fish-config-command.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"fish-config-command.mjs","names":[],"sources":["../../src/components/fish-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 { TSDoc, TSDocDefaultValue } from \"@powerlines/plugin-alloy/typescript\";\nimport { TypescriptFile } from \"@powerlines/plugin-alloy/typescript/components/typescript-file\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport type { CompletionsPluginContext } from \"../types/plugin\";\n\n/**\n * The Fish Completions - Configuration command's handler wrapper for the Shell Shock project.\n */\nexport function FishConfigCompletionsCommand() {\n const context = usePowerlines<CompletionsPluginContext>();\n\n return (\n <TypescriptFile\n path={joinPaths(\n context.entryPath,\n \"completions\",\n \"fish\",\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 Fish Completions - Configuration command.\" />\n <InterfaceDeclaration export name=\"FishConfigCompletionsOptions\">\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 fish config\\` command.\"></TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[\n {\n name: \"options\",\n type: \"FishConfigCompletionsOptions\",\n default: \"{}\"\n },\n {\n name: \"path\",\n type: \"string\",\n default: `\"~/.config/fish/config.fish\"`\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, \".config\", \"fish\", \"config.fish\");`}\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)} Fish Completions ###\\\\n\\\\n\\${SHELL_COMPLETIONS} \\\\n\\\\n### End - ${getAppTitle(\n context\n )} Fish Completions ###\\`);\n\n success(\\`${getAppTitle(\n context\n )} shell completions have been applied to Fish 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)} Fish Completions ###\\`);\n writeLine(\"\");\n SHELL_COMPLETIONS_DISPLAY.split(\"\\\\n\").map(line => writeLine(line));\n writeLine(\"\");\n writeLine(\\`### End - ${getAppTitle(context)} Fish 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/fish/config.fish)\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":"6uBA+BA,SAAS,GAAmC,CAC5C,IAAQ,EAAC,GAAqB,CAC9B,OAAS,EAAkB,EAAa,CACxC,IAAO,MAAO,mEAGX,QAAS,CACV,UAAA,KACI,YAAU,CAAA,OAAA,CACd,mBAAgB,CAAA,WAAc,YAAA,+DAE9B,CACE,eAAC,CACC,QAAM,CAAA,OAAS,aAAA,YAAA,UAAA,OAAA,OAAA,CAChB,CACD,IAAI,UAAC,CACH,MAAO,CAAC,EAAA,EAAA,CACN,QAAQ,4DACT,CAAC,CAAC,EAAU,EAAA,CACZ,OAAA,GACD,KAAQ,+BACN,IAAC,UAAc,CACd,MAAK,CAAI,EAAW,EAAA,CACpB,QAAQ,6LACL,IAAA,UAAW,CAChB,OAAA,EAAA,EAAA,CACD,IAAc,MAAE,CACJ,OAAO,EAAe,SAE3B,aAAiB,GACvB,CAAA,EAEI,CAAA,CAAA,EAAA,EAAA,CACC,KAAM,UACN,SAAA,GACD,KAAA,UACD,CAAA,CAAA,EAEH,CAAC,CAAA,EAAoB,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACrB,QAAS,+DACT,CAAA,CAAA,EAAe,EAAwB,CACvC,OAAA,GACC,QAAA,GACA,MAAA,GACA,KAAA,UACA,WAAM,CAAO,CACb,KAAA,UACE,KAAA,+BACA,QAAS,KACV,CAAE,CACD,KAAE,OACF,KAAC,SACD,QAAA,+BACD,CAAC,CACF,IAAI,UAAO,CACT,MAAE,CAAA,EAAqB,EAAgB,CACvC,UAAA,CAAA,2BACA,IAAA,UAAA,CACD,MAAY,CAAA,EAAgB,EAAmB,CAC7C,IAAA,GACC,KAAA,aACI,KAAE,SACF,YAAQ,CAAA,6EACZ,CAAA,CAAA,EAAwB,EAAS,EAAE,CAAC,CAAE,EAAkB,EAAa,CACtE,UAAA,CAAA,6BACA,SAAS,CAAA,iEACT,CAAA,CAAA,EAAuB,EAAK,EAAA,CAAA,CAAW,EAAiB,EAAA,CACtD,IAAK,GACN,KAAA,UACD,KAAS,SACT,YAAA,CAAA,MACC,CAAA,CAAA,EAAA,EAAA,EAAA,CAAA,CAAA,MAAA,CAAA;;;;;;;;;;;uEAW0D,EAAU,EAAQ,CAAA,mEAAiD,EAAA,EAAA,CAAA;;sBAEnH,EAAQ,EAAA,CAAA,6MAAA,CAAA,EAEpB,CAAA,CAAA,EAAA,EAAA,CAAA,IAAA,UAAA,CAEA,MAAM,EAAS;;sCAEW,EAAA,EAAA,CAAA;;;;oCAIA,EAAY,EAAQ,CAAC;;;;;;;;wGAU9C,CAAC,CAAA,MAIT,CAAC"}
1
+ {"version":3,"file":"fish-config-command.mjs","names":[],"sources":[],"mappings":""}
@@ -1,8 +1,94 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@shell-shock/core/plugin-utils`),n=require(`@alloy-js/core`),r=require(`@alloy-js/typescript`),i=require(`@powerlines/deepkit/vendor/type`),a=require(`@powerlines/plugin-alloy/core`),o=require(`@powerlines/plugin-alloy/core/contexts/context`),s=require(`@powerlines/plugin-alloy/typescript`),c=require(`@powerlines/plugin-alloy/typescript/components/tsdoc`),l=require(`@stryke/path`);function u(){let u=(0,o.usePowerlines)(),d=(0,n.computed)(()=>(0,t.getAppBin)(u));return(0,e.createComponent)(s.TypescriptFile,{get path(){return(0,l.joinPaths)(u.entryPath,`completions`,`fish`,`script`,`command.ts`)},imports:{"node:os":`os`,"node:path":[`join`],"node:fs/promises":[`readFile`,`writeFile`],"../shared":[`SHELL_COMPLETIONS`,`SHELL_COMPLETIONS_DISPLAY`]},builtinImports:{console:[`bold`,`writeLine`,`success`,`warn`,`help`]},get children(){return[(0,e.createComponent)(c.TSDoc,{heading:`Options for the Fish Completions - Script command.`}),(0,e.createComponent)(r.InterfaceDeclaration,{export:!0,name:`FishScriptCompletionsOptions`,get children(){return[(0,e.createComponent)(c.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.`,get children(){return(0,e.createComponent)(c.TSDocDefaultValue,{get type(){return i.ReflectionKind.boolean},defaultValue:!1})}}),(0,e.createComponent)(s.InterfaceMember,{name:`display`,optional:!0,type:`boolean`})]}}),(0,e.createComponent)(a.Spacing,{}),(0,e.createComponent)(c.TSDoc,{heading:"Handler logic for the \\`completions fish script\\` command."}),(0,e.createComponent)(r.FunctionDeclaration,{export:!0,default:!0,async:!0,name:`handler`,get parameters(){return[{name:`options`,type:`FishScriptCompletionsOptions`,default:`{}`},{name:`path`,type:`string`,default:`"./${d.value}-completions.fish"`}]},get children(){return[(0,e.createComponent)(r.IfStatement,{condition:n.code`options.display !== true`,get children(){return[(0,e.createComponent)(r.VarDeclaration,{const:!0,name:`scriptPath`,type:`string`,initializer:n.code` path.includes(".") ? \`\${path}.fish\` : path;`}),(0,e.memo)(()=>n.code`await writeFile(scriptPath, \`# Fish script to add completions for ${(0,t.getAppTitle)(u)}\\n\\n\${SHELL_COMPLETIONS}\`);
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
+ let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
4
+ let _alloy_js_core = require("@alloy-js/core");
5
+ let _alloy_js_typescript = require("@alloy-js/typescript");
6
+ let _powerlines_plugin_alloy_core = require("@powerlines/plugin-alloy/core");
7
+ let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
8
+ let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
9
+ let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
10
+ let _stryke_path = require("@stryke/path");
2
11
 
3
- success(\`${(0,t.getAppTitle)(u)} Fish completion script has been generated at \${bold(scriptPath)}.\`);`)]}}),(0,e.createComponent)(r.ElseClause,{get children(){return n.code`writeLine(" ------------------------------------------------- ");
12
+ //#region src/components/fish-script-command.tsx
13
+ /**
14
+ * The Fish Completions - Script command's handler wrapper for the Shell Shock project.
15
+ */
16
+ function FishScriptCompletionsCommand() {
17
+ const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
18
+ const bin = (0, _alloy_js_core.computed)(() => (0, _shell_shock_core_plugin_utils.getAppBin)(context));
19
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TypescriptFile, {
20
+ get path() {
21
+ return (0, _stryke_path.joinPaths)(context.entryPath, "completions", "fish", "script", "command.ts");
22
+ },
23
+ imports: {
24
+ "node:os": "os",
25
+ "node:path": ["join"],
26
+ "node:fs/promises": ["readFile", "writeFile"],
27
+ "../shared": ["SHELL_COMPLETIONS", "SHELL_COMPLETIONS_DISPLAY"]
28
+ },
29
+ builtinImports: { console: [
30
+ "bold",
31
+ "writeLine",
32
+ "success",
33
+ "warn",
34
+ "help"
35
+ ] },
36
+ get children() {
37
+ return [
38
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Options for the Fish Completions - Script command." }),
39
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
40
+ "export": true,
41
+ name: "FishScriptCompletionsOptions",
42
+ get children() {
43
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
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.",
45
+ get children() {
46
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
47
+ type: "boolean",
48
+ defaultValue: false
49
+ });
50
+ }
51
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
52
+ name: "display",
53
+ type: "boolean"
54
+ })];
55
+ }
56
+ }),
57
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
58
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Handler logic for the \\`completions fish script\\` command." }),
59
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
60
+ "export": true,
61
+ "default": true,
62
+ async: true,
63
+ name: "handler",
64
+ get parameters() {
65
+ return [{
66
+ name: "options",
67
+ type: "FishScriptCompletionsOptions",
68
+ default: "{}"
69
+ }, {
70
+ name: "path",
71
+ type: "string",
72
+ default: `"./${bin.value}-completions.fish"`
73
+ }];
74
+ },
75
+ get children() {
76
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
77
+ condition: _alloy_js_core.code`options.display !== true`,
78
+ get children() {
79
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
80
+ "const": true,
81
+ name: "scriptPath",
82
+ type: "string",
83
+ initializer: _alloy_js_core.code` path.includes(".") ? \`\${path}.fish\` : path;`
84
+ }), (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`await writeFile(scriptPath, \`# Fish script to add completions for ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)}\\n\\n\${SHELL_COMPLETIONS}\`);
85
+
86
+ success(\`${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)} Fish completion script has been generated at \${bold(scriptPath)}.\`);`)];
87
+ }
88
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseClause, { get children() {
89
+ return _alloy_js_core.code`writeLine(" ------------------------------------------------- ");
4
90
  writeLine("");
5
- writeLine(\`# Fish completion for ${(0,t.getAppTitle)(u)}\`);
91
+ writeLine(\`# Fish completion for ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)}\`);
6
92
  writeLine("");
7
93
  SHELL_COMPLETIONS_DISPLAY.split("\\n").map(line => writeLine(line));
8
94
  writeLine("");
@@ -12,4 +98,14 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
12
98
  help(\`To enable these completions, perform one of the following actions:
13
99
 
14
100
  1) Copy and paste the above script into your shell configuration file (e.g., ~/.config/fish/config.fish)
15
- 2) Save the above script to a file and source it from your shell configuration file \`); `}})]}})]}})}exports.FishScriptCompletionsCommand=u;
101
+ 2) Save the above script to a file and source it from your shell configuration file \`); `;
102
+ } })];
103
+ }
104
+ })
105
+ ];
106
+ }
107
+ });
108
+ }
109
+
110
+ //#endregion
111
+ exports.FishScriptCompletionsCommand = FishScriptCompletionsCommand;
@@ -1,10 +1,8 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
-
3
1
  //#region src/components/fish-script-command.d.ts
4
2
  /**
5
3
  * The Fish Completions - Script command's handler wrapper for the Shell Shock project.
6
4
  */
7
- declare function FishScriptCompletionsCommand(): _$_alloy_js_core0.Children;
5
+ declare function FishScriptCompletionsCommand(): import("@alloy-js/core").Children;
8
6
  //#endregion
9
7
  export { FishScriptCompletionsCommand };
10
8
  //# sourceMappingURL=fish-script-command.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fish-script-command.d.cts","names":[],"sources":["../../src/components/fish-script-command.tsx"],"mappings":";;;;;;iBA4CgB,4BAAA,CAAA,GAA4B,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"fish-script-command.d.cts","names":[],"sources":["../../src/components/fish-script-command.tsx"],"mappings":";;AA2CA;;iBAAgB,4BAAA,6BAA4B,QAAA"}
@@ -1,10 +1,8 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
-
3
1
  //#region src/components/fish-script-command.d.ts
4
2
  /**
5
3
  * The Fish Completions - Script command's handler wrapper for the Shell Shock project.
6
4
  */
7
- declare function FishScriptCompletionsCommand(): _$_alloy_js_core0.Children;
5
+ declare function FishScriptCompletionsCommand(): import("@alloy-js/core").Children;
8
6
  //#endregion
9
7
  export { FishScriptCompletionsCommand };
10
8
  //# sourceMappingURL=fish-script-command.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fish-script-command.d.mts","names":[],"sources":["../../src/components/fish-script-command.tsx"],"mappings":";;;;;;iBA4CgB,4BAAA,CAAA,GAA4B,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"fish-script-command.d.mts","names":[],"sources":["../../src/components/fish-script-command.tsx"],"mappings":""}
@@ -1,8 +1,93 @@
1
- import{createComponent as e,memo as t}from"@alloy-js/core/jsx-runtime";import{getAppBin as n,getAppTitle as r}from"@shell-shock/core/plugin-utils";import{code as i,computed as a}from"@alloy-js/core";import{ElseClause as o,FunctionDeclaration as s,IfStatement as c,InterfaceDeclaration as l,VarDeclaration as u}from"@alloy-js/typescript";import{ReflectionKind as d}from"@powerlines/deepkit/vendor/type";import{Spacing as f}from"@powerlines/plugin-alloy/core";import{usePowerlines as p}from"@powerlines/plugin-alloy/core/contexts/context";import{InterfaceMember as m,TypescriptFile as h}from"@powerlines/plugin-alloy/typescript";import{TSDoc as g,TSDocDefaultValue as _}from"@powerlines/plugin-alloy/typescript/components/tsdoc";import{joinPaths as v}from"@stryke/path";function y(){let y=p(),b=a(()=>n(y));return e(h,{get path(){return v(y.entryPath,`completions`,`fish`,`script`,`command.ts`)},imports:{"node:os":`os`,"node:path":[`join`],"node:fs/promises":[`readFile`,`writeFile`],"../shared":[`SHELL_COMPLETIONS`,`SHELL_COMPLETIONS_DISPLAY`]},builtinImports:{console:[`bold`,`writeLine`,`success`,`warn`,`help`]},get children(){return[e(g,{heading:`Options for the Fish Completions - Script command.`}),e(l,{export:!0,name:`FishScriptCompletionsOptions`,get children(){return[e(g,{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.`,get children(){return e(_,{get type(){return d.boolean},defaultValue:!1})}}),e(m,{name:`display`,optional:!0,type:`boolean`})]}}),e(f,{}),e(g,{heading:"Handler logic for the \\`completions fish script\\` command."}),e(s,{export:!0,default:!0,async:!0,name:`handler`,get parameters(){return[{name:`options`,type:`FishScriptCompletionsOptions`,default:`{}`},{name:`path`,type:`string`,default:`"./${b.value}-completions.fish"`}]},get children(){return[e(c,{condition:i`options.display !== true`,get children(){return[e(u,{const:!0,name:`scriptPath`,type:`string`,initializer:i` path.includes(".") ? \`\${path}.fish\` : path;`}),t(()=>i`await writeFile(scriptPath, \`# Fish script to add completions for ${r(y)}\\n\\n\${SHELL_COMPLETIONS}\`);
1
+ import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
2
+ import { getAppBin, getAppTitle } from "@shell-shock/core/plugin-utils";
3
+ import { code, computed } from "@alloy-js/core";
4
+ import { ElseClause, FunctionDeclaration, IfStatement, InterfaceDeclaration, VarDeclaration } from "@alloy-js/typescript";
5
+ import { Spacing } from "@powerlines/plugin-alloy/core";
6
+ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
7
+ import { InterfaceMember, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
8
+ import { TSDoc as TSDoc$1, TSDocDefaultValue as TSDocDefaultValue$1 } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
9
+ import { joinPaths } from "@stryke/path";
2
10
 
3
- success(\`${r(y)} Fish completion script has been generated at \${bold(scriptPath)}.\`);`)]}}),e(o,{get children(){return i`writeLine(" ------------------------------------------------- ");
11
+ //#region src/components/fish-script-command.tsx
12
+ /**
13
+ * The Fish Completions - Script command's handler wrapper for the Shell Shock project.
14
+ */
15
+ function FishScriptCompletionsCommand() {
16
+ const context = usePowerlines();
17
+ const bin = computed(() => getAppBin(context));
18
+ return createComponent(TypescriptFile, {
19
+ get path() {
20
+ return joinPaths(context.entryPath, "completions", "fish", "script", "command.ts");
21
+ },
22
+ imports: {
23
+ "node:os": "os",
24
+ "node:path": ["join"],
25
+ "node:fs/promises": ["readFile", "writeFile"],
26
+ "../shared": ["SHELL_COMPLETIONS", "SHELL_COMPLETIONS_DISPLAY"]
27
+ },
28
+ builtinImports: { console: [
29
+ "bold",
30
+ "writeLine",
31
+ "success",
32
+ "warn",
33
+ "help"
34
+ ] },
35
+ get children() {
36
+ return [
37
+ createComponent(TSDoc$1, { heading: "Options for the Fish Completions - Script command." }),
38
+ createComponent(InterfaceDeclaration, {
39
+ "export": true,
40
+ name: "FishScriptCompletionsOptions",
41
+ get children() {
42
+ return [createComponent(TSDoc$1, {
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.",
44
+ get children() {
45
+ return createComponent(TSDocDefaultValue$1, {
46
+ type: "boolean",
47
+ defaultValue: false
48
+ });
49
+ }
50
+ }), createComponent(InterfaceMember, {
51
+ name: "display",
52
+ type: "boolean"
53
+ })];
54
+ }
55
+ }),
56
+ createComponent(Spacing, {}),
57
+ createComponent(TSDoc$1, { heading: "Handler logic for the \\`completions fish script\\` command." }),
58
+ createComponent(FunctionDeclaration, {
59
+ "export": true,
60
+ "default": true,
61
+ async: true,
62
+ name: "handler",
63
+ get parameters() {
64
+ return [{
65
+ name: "options",
66
+ type: "FishScriptCompletionsOptions",
67
+ default: "{}"
68
+ }, {
69
+ name: "path",
70
+ type: "string",
71
+ default: `"./${bin.value}-completions.fish"`
72
+ }];
73
+ },
74
+ get children() {
75
+ return [createComponent(IfStatement, {
76
+ condition: code`options.display !== true`,
77
+ get children() {
78
+ return [createComponent(VarDeclaration, {
79
+ "const": true,
80
+ name: "scriptPath",
81
+ type: "string",
82
+ initializer: code` path.includes(".") ? \`\${path}.fish\` : path;`
83
+ }), memo(() => code`await writeFile(scriptPath, \`# Fish script to add completions for ${getAppTitle(context)}\\n\\n\${SHELL_COMPLETIONS}\`);
84
+
85
+ success(\`${getAppTitle(context)} Fish completion script has been generated at \${bold(scriptPath)}.\`);`)];
86
+ }
87
+ }), createComponent(ElseClause, { get children() {
88
+ return code`writeLine(" ------------------------------------------------- ");
4
89
  writeLine("");
5
- writeLine(\`# Fish completion for ${r(y)}\`);
90
+ writeLine(\`# Fish completion for ${getAppTitle(context)}\`);
6
91
  writeLine("");
7
92
  SHELL_COMPLETIONS_DISPLAY.split("\\n").map(line => writeLine(line));
8
93
  writeLine("");
@@ -12,5 +97,15 @@ import{createComponent as e,memo as t}from"@alloy-js/core/jsx-runtime";import{ge
12
97
  help(\`To enable these completions, perform one of the following actions:
13
98
 
14
99
  1) Copy and paste the above script into your shell configuration file (e.g., ~/.config/fish/config.fish)
15
- 2) Save the above script to a file and source it from your shell configuration file \`); `}})]}})]}})}export{y as FishScriptCompletionsCommand};
100
+ 2) Save the above script to a file and source it from your shell configuration file \`); `;
101
+ } })];
102
+ }
103
+ })
104
+ ];
105
+ }
106
+ });
107
+ }
108
+
109
+ //#endregion
110
+ export { FishScriptCompletionsCommand };
16
111
  //# sourceMappingURL=fish-script-command.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"fish-script-command.mjs","names":[],"sources":["../../src/components/fish-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 Fish Completions - Script command's handler wrapper for the Shell Shock project.\n */\nexport function FishScriptCompletionsCommand() {\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 \"fish\",\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 Fish Completions - Script command.\" />\n <InterfaceDeclaration export name=\"FishScriptCompletionsOptions\">\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 fish script\\` command.\"></TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[\n {\n name: \"options\",\n type: \"FishScriptCompletionsOptions\",\n default: \"{}\"\n },\n {\n name: \"path\",\n type: \"string\",\n default: `\"./${bin.value}-completions.fish\"`\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}.fish\\` : path;`}\n />\n {code`await writeFile(scriptPath, \\`# Fish script to add completions for ${getAppTitle(context)}\\\\n\\\\n\\${SHELL_COMPLETIONS}\\`);\n\n success(\\`${getAppTitle(\n context\n )} Fish completion script has been generated at \\${bold(scriptPath)}.\\`);`}\n </IfStatement>\n <ElseClause>\n {code`writeLine(\" ------------------------------------------------- \");\n writeLine(\"\");\n writeLine(\\`# Fish completion 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/fish/config.fish)\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":"gwBA+BA,SAAE,GAAA,CACA,IAAM,EAAC,GAAwB,CAC1B,EAAA,MAAA,EAAA,EAAA,CAAA,CACL,OAAK,EAAA,EAAA,CACL,IAAA,MAAA,CACI,OAAG,EAAW,EAAO,UAAM,cAAsB,OAAM,SAAA,aAAA,EAE7D,QAAS,CACH,UAAQ,0BAEZ,mBAAA,CAAA,WAAA,YAAA,CACI,YAAM,CAAA,oBAA6B,4BAA0B,CACjE,CACF,eAAgB,CACd,QAAa,CAAC,OAAE,YAAc,UAAA,OAAwB,OAAG,CAAA,CAEzD,IAAM,UAAM,aAEN,QAAC,qDACJ,CAAA,CAAA,EAAA,EAAA,CACC,OAAM,GACJ,KAAA,+BACA,IAAC,UAAY,CACZ,MAAK,CAAA,EAAA,EAAA,CACL,QAAO,6LACP,IAAO,UAAG,CACZ,OAAA,EAAA,EAAA,CACQ,IAAA,MAAA,CACG,OAAK,EAAA,SAEP,aAAc,GAClB,CAAA,EAEN,CAAA,CAAA,EAAgB,EAAA,CACd,KAAU,UACV,SAAA,GACI,KAAC,UACN,CAAA,CAAA,EAEA,CAAC,CAAE,EAAC,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACH,QAAS,+DACV,CAAC,CAAE,EAAgB,EAAK,CACvB,OAAG,GACH,QAAO,GACP,MAAC,GACD,KAAA,UACD,IAAA,YAAS,CACT,MAAM,CAAA,CACN,KAAA,UACC,KAAA,+BACA,QAAA,KACA,CAAA,CACI,KAAE,OACN,KAAU,SACR,QAAA,MAAA,EAAA,MAAA,oBACC,CAAC,EAEJ,IAAI,UAAW,CACb,MAAC,CAAA,EAAA,EAAA,CACD,UAAA,CAAA,2BACE,IAAI,UAAQ,CACZ,MAAO,CAAA,EAAO,EAAA,CACd,MAAa,GACf,KAAA,aACA,KAAA,SACD,YAAY,CAAW,kDACrB,CAAA,CAAA,MAAA,CAAA,sEAAA,EAAA,EAAA,CAAA;;wBAEO,EAAU,EAAA,CAAA,yEAAA,CAAA,EAEjB,CAAC,CAAA,EAAmB,EAAa,CACjC,IAAA,UAAA,CACA,MAAU,EAAC;;gDAEa,EAAA,EAAA,CAAA;;;;;;;;;;4GAc5B,CAAC,CAAC,EAEN,CAAC"}
1
+ {"version":3,"file":"fish-script-command.mjs","names":[],"sources":[],"mappings":""}