@shell-shock/plugin-completions 0.4.16 → 0.4.18

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 (56) hide show
  1. package/dist/components/bash-config-command.cjs +120 -6
  2. package/dist/components/bash-config-command.mjs +119 -6
  3. package/dist/components/bash-config-command.mjs.map +1 -1
  4. package/dist/components/bash-script-command.cjs +105 -5
  5. package/dist/components/bash-script-command.mjs +104 -5
  6. package/dist/components/bash-script-command.mjs.map +1 -1
  7. package/dist/components/bash-shared.cjs +77 -13
  8. package/dist/components/bash-shared.mjs +76 -13
  9. package/dist/components/bash-shared.mjs.map +1 -1
  10. package/dist/components/fish-config-command.cjs +120 -6
  11. package/dist/components/fish-config-command.mjs +119 -6
  12. package/dist/components/fish-config-command.mjs.map +1 -1
  13. package/dist/components/fish-script-command.cjs +104 -4
  14. package/dist/components/fish-script-command.mjs +103 -4
  15. package/dist/components/fish-script-command.mjs.map +1 -1
  16. package/dist/components/fish-shared.cjs +141 -77
  17. package/dist/components/fish-shared.mjs +140 -77
  18. package/dist/components/fish-shared.mjs.map +1 -1
  19. package/dist/components/index.cjs +26 -1
  20. package/dist/components/index.mjs +14 -1
  21. package/dist/components/powershell-config-command.cjs +116 -6
  22. package/dist/components/powershell-config-command.mjs +115 -6
  23. package/dist/components/powershell-config-command.mjs.map +1 -1
  24. package/dist/components/powershell-script-command.cjs +104 -4
  25. package/dist/components/powershell-script-command.mjs +103 -4
  26. package/dist/components/powershell-script-command.mjs.map +1 -1
  27. package/dist/components/powershell-shared.cjs +101 -37
  28. package/dist/components/powershell-shared.mjs +100 -37
  29. package/dist/components/powershell-shared.mjs.map +1 -1
  30. package/dist/components/zsh-config-command.cjs +120 -6
  31. package/dist/components/zsh-config-command.mjs +119 -6
  32. package/dist/components/zsh-config-command.mjs.map +1 -1
  33. package/dist/components/zsh-script-command.cjs +108 -6
  34. package/dist/components/zsh-script-command.mjs +107 -6
  35. package/dist/components/zsh-script-command.mjs.map +1 -1
  36. package/dist/components/zsh-shared.cjs +106 -42
  37. package/dist/components/zsh-shared.mjs +105 -42
  38. package/dist/components/zsh-shared.mjs.map +1 -1
  39. package/dist/helpers/complete-command.cjs +10 -1
  40. package/dist/helpers/complete-command.mjs +8 -1
  41. package/dist/helpers/complete-command.mjs.map +1 -1
  42. package/dist/helpers/completion-directive-constants.cjs +16 -1
  43. package/dist/helpers/completion-directive-constants.mjs +14 -1
  44. package/dist/helpers/completion-directive-constants.mjs.map +1 -1
  45. package/dist/helpers/index.cjs +6 -1
  46. package/dist/helpers/index.mjs +4 -1
  47. package/dist/index.cjs +303 -1
  48. package/dist/index.mjs +301 -1
  49. package/dist/index.mjs.map +1 -1
  50. package/dist/types/index.cjs +4 -1
  51. package/dist/types/index.mjs +3 -1
  52. package/dist/types/plugin.mjs +1 -1
  53. package/dist/types/shell-type.cjs +12 -1
  54. package/dist/types/shell-type.mjs +10 -1
  55. package/dist/types/shell-type.mjs.map +1 -1
  56. package/package.json +10 -10
@@ -1,4 +1,104 @@
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)();return(0,e.createComponent)(s.TypescriptFile,{get path(){return(0,l.joinPaths)(u.entryPath,`completions`,`bash`,`config`,`command.ts`)},imports:{"node:os":`os`,"node:path":[`join`],"node:fs/promises":[`readFile`,`writeFile`],"../shared":[`SHELL_COMPLETIONS_DISPLAY`,`SHELL_COMPLETIONS`]},builtinImports:{console:[`bold`,`inlineCode`,`writeLine`,`success`,`warn`,`help`]},get children(){return[(0,e.createComponent)(c.TSDoc,{heading:`Options for the Bash Completions - Configuration command.`}),(0,e.createComponent)(r.InterfaceDeclaration,{export:!0,name:`BashConfigCompletionsOptions`,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 bash config\\` command."}),(0,e.createComponent)(r.FunctionDeclaration,{export:!0,default:!0,async:!0,name:`handler`,parameters:[{name:`options`,type:`BashConfigCompletionsOptions`,default:`{}`},{name:`path`,type:`string`,default:`"~/.bashrc"`}],get children(){return[(0,e.createComponent)(r.IfStatement,{condition:n.code`options.display !== true`,get children(){return[(0,e.createComponent)(r.VarDeclaration,{let:!0,name:`configPath`,type:`string`,initializer:n.code` path.includes(".") ? path : join(path, ".bashrc");`}),(0,e.createComponent)(a.Spacing,{}),(0,e.createComponent)(r.IfStatement,{condition:n.code`configPath.startsWith("~")`,children:n.code`configPath = join(os.homedir(), configPath.replace("~", "")); `}),(0,e.createComponent)(a.Spacing,{}),(0,e.createComponent)(r.VarDeclaration,{let:!0,name:`content`,type:`string`,initializer:n.code`"";`}),(0,e.createComponent)(a.Spacing,{}),(0,e.memo)(()=>n.code`try {
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_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
7
+ let _powerlines_plugin_alloy_core = require("@powerlines/plugin-alloy/core");
8
+ let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
9
+ let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
10
+ let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
11
+ let _stryke_path = require("@stryke/path");
12
+
13
+ //#region src/components/bash-config-command.tsx
14
+ /**
15
+ * The Bash Completions - Configuration command's handler wrapper for the Shell Shock project.
16
+ */
17
+ function BashConfigCompletionsCommand() {
18
+ const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
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", "bash", "config", "command.ts");
22
+ },
23
+ imports: {
24
+ "node:os": "os",
25
+ "node:path": ["join"],
26
+ "node:fs/promises": ["readFile", "writeFile"],
27
+ "../shared": ["SHELL_COMPLETIONS_DISPLAY", "SHELL_COMPLETIONS"]
28
+ },
29
+ builtinImports: { console: [
30
+ "bold",
31
+ "inlineCode",
32
+ "writeLine",
33
+ "success",
34
+ "warn",
35
+ "help"
36
+ ] },
37
+ get children() {
38
+ return [
39
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Options for the Bash Completions - Configuration command." }),
40
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
41
+ "export": true,
42
+ name: "BashConfigCompletionsOptions",
43
+ get children() {
44
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
45
+ 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
+ get children() {
47
+ 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
+ },
51
+ defaultValue: false
52
+ });
53
+ }
54
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
55
+ name: "display",
56
+ optional: true,
57
+ type: "boolean"
58
+ })];
59
+ }
60
+ }),
61
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
62
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Handler logic for the \\`completions bash config\\` command." }),
63
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
64
+ "export": true,
65
+ "default": true,
66
+ async: true,
67
+ name: "handler",
68
+ parameters: [{
69
+ name: "options",
70
+ type: "BashConfigCompletionsOptions",
71
+ default: "{}"
72
+ }, {
73
+ name: "path",
74
+ type: "string",
75
+ default: `"~/.bashrc"`
76
+ }],
77
+ get children() {
78
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
79
+ condition: _alloy_js_core.code`options.display !== true`,
80
+ get children() {
81
+ return [
82
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
83
+ "let": true,
84
+ name: "configPath",
85
+ type: "string",
86
+ initializer: _alloy_js_core.code` path.includes(".") ? path : join(path, ".bashrc");`
87
+ }),
88
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
89
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
90
+ condition: _alloy_js_core.code`configPath.startsWith("~")`,
91
+ children: _alloy_js_core.code`configPath = join(os.homedir(), configPath.replace("~", "")); `
92
+ }),
93
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
94
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
95
+ "let": true,
96
+ name: "content",
97
+ type: "string",
98
+ initializer: _alloy_js_core.code`"";`
99
+ }),
100
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
101
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`try {
2
102
  content = await readFile(configPath, "utf8");
3
103
  } catch (error) {
4
104
  if (typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT") {
@@ -9,15 +109,19 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
9
109
  }
10
110
  }
11
111
 
12
- await writeFile(configPath, \`\${content}\\n\\n### Begin - ${(0,t.getAppTitle)(u)} Shell Completions ###\\n\\n\${SHELL_COMPLETIONS} \\n\\n### End - ${(0,t.getAppTitle)(u)} Bash Completions ###\`);
112
+ await writeFile(configPath, \`\${content}\\n\\n### Begin - ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)} Shell Completions ###\\n\\n\${SHELL_COMPLETIONS} \\n\\n### End - ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)} Bash Completions ###\`);
13
113
 
14
- success(\`${(0,t.getAppTitle)(u)} shell completions have been applied to Bash configuration file at \${bold(configPath)}. Please restart your terminal or run \${inlineCode(\`source \${configPath}\`)} for the changes to take effect.\`); `)]}}),(0,e.createComponent)(r.ElseClause,{get children(){return n.code`writeLine(" ------------------------------------------------- ");
114
+ success(\`${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)} shell completions have been applied to Bash configuration file at \${bold(configPath)}. Please restart your terminal or run \${inlineCode(\`source \${configPath}\`)} for the changes to take effect.\`); `)
115
+ ];
116
+ }
117
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseClause, { get children() {
118
+ return _alloy_js_core.code`writeLine(" ------------------------------------------------- ");
15
119
  writeLine("");
16
- writeLine(\`### Begin - ${(0,t.getAppTitle)(u)} Bash Completions ###\`);
120
+ writeLine(\`### Begin - ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)} Bash Completions ###\`);
17
121
  writeLine("");
18
122
  SHELL_COMPLETIONS_DISPLAY.split("\\n").map(line => writeLine(line));
19
123
  writeLine("");
20
- writeLine(\`### End - ${(0,t.getAppTitle)(u)} Bash Completions ###\`);
124
+ writeLine(\`### End - ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)} Bash Completions ###\`);
21
125
  writeLine("");
22
126
  writeLine(" ------------------------------------------------- ");
23
127
 
@@ -25,4 +129,14 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
25
129
  help(\`To enable these completions, perform one of the following actions:
26
130
 
27
131
  1) Copy and paste the above script into your shell configuration file (e.g., ~/.bashrc)
28
- 2) Save the above script to a file and source it from your shell configuration file \`); `}})]}})]}})}exports.BashConfigCompletionsCommand=u;
132
+ 2) Save the above script to a file and source it from your shell configuration file \`); `;
133
+ } })];
134
+ }
135
+ })
136
+ ];
137
+ }
138
+ });
139
+ }
140
+
141
+ //#endregion
142
+ exports.BashConfigCompletionsCommand = BashConfigCompletionsCommand;
@@ -1,4 +1,103 @@
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,VarDeclaration as c}from"@alloy-js/typescript";import{ReflectionKind as l}from"@powerlines/deepkit/vendor/type";import{Spacing as u}from"@powerlines/plugin-alloy/core";import{usePowerlines as d}from"@powerlines/plugin-alloy/core/contexts/context";import{InterfaceMember as f,TypescriptFile as p}from"@powerlines/plugin-alloy/typescript";import{TSDoc as m,TSDocDefaultValue as h}from"@powerlines/plugin-alloy/typescript/components/tsdoc";import{joinPaths as g}from"@stryke/path";function _(){let _=d();return e(p,{get path(){return g(_.entryPath,`completions`,`bash`,`config`,`command.ts`)},imports:{"node:os":`os`,"node:path":[`join`],"node:fs/promises":[`readFile`,`writeFile`],"../shared":[`SHELL_COMPLETIONS_DISPLAY`,`SHELL_COMPLETIONS`]},builtinImports:{console:[`bold`,`inlineCode`,`writeLine`,`success`,`warn`,`help`]},get children(){return[e(m,{heading:`Options for the Bash Completions - Configuration command.`}),e(s,{export:!0,name:`BashConfigCompletionsOptions`,get children(){return[e(m,{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(h,{get type(){return l.boolean},defaultValue:!1})}}),e(f,{name:`display`,optional:!0,type:`boolean`})]}}),e(u,{}),e(m,{heading:"Handler logic for the \\`completions bash config\\` command."}),e(a,{export:!0,default:!0,async:!0,name:`handler`,parameters:[{name:`options`,type:`BashConfigCompletionsOptions`,default:`{}`},{name:`path`,type:`string`,default:`"~/.bashrc"`}],get children(){return[e(o,{condition:r`options.display !== true`,get children(){return[e(c,{let:!0,name:`configPath`,type:`string`,initializer:r` path.includes(".") ? path : join(path, ".bashrc");`}),e(u,{}),e(o,{condition:r`configPath.startsWith("~")`,children:r`configPath = join(os.homedir(), configPath.replace("~", "")); `}),e(u,{}),e(c,{let:!0,name:`content`,type:`string`,initializer:r`"";`}),e(u,{}),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, InterfaceDeclaration, VarDeclaration } from "@alloy-js/typescript";
5
+ import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
6
+ import { Spacing } from "@powerlines/plugin-alloy/core";
7
+ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
8
+ import { InterfaceMember as InterfaceMember$1, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
9
+ import { TSDoc as TSDoc$1, TSDocDefaultValue as TSDocDefaultValue$1 } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
10
+ import { joinPaths } from "@stryke/path";
11
+
12
+ //#region src/components/bash-config-command.tsx
13
+ /**
14
+ * The Bash Completions - Configuration command's handler wrapper for the Shell Shock project.
15
+ */
16
+ function BashConfigCompletionsCommand() {
17
+ const context = usePowerlines();
18
+ return createComponent(TypescriptFile, {
19
+ get path() {
20
+ return joinPaths(context.entryPath, "completions", "bash", "config", "command.ts");
21
+ },
22
+ imports: {
23
+ "node:os": "os",
24
+ "node:path": ["join"],
25
+ "node:fs/promises": ["readFile", "writeFile"],
26
+ "../shared": ["SHELL_COMPLETIONS_DISPLAY", "SHELL_COMPLETIONS"]
27
+ },
28
+ builtinImports: { console: [
29
+ "bold",
30
+ "inlineCode",
31
+ "writeLine",
32
+ "success",
33
+ "warn",
34
+ "help"
35
+ ] },
36
+ get children() {
37
+ return [
38
+ createComponent(TSDoc$1, { heading: "Options for the Bash Completions - Configuration command." }),
39
+ createComponent(InterfaceDeclaration, {
40
+ "export": true,
41
+ name: "BashConfigCompletionsOptions",
42
+ get children() {
43
+ return [createComponent(TSDoc$1, {
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 createComponent(TSDocDefaultValue$1, {
47
+ get type() {
48
+ return ReflectionKind.boolean;
49
+ },
50
+ defaultValue: false
51
+ });
52
+ }
53
+ }), createComponent(InterfaceMember$1, {
54
+ name: "display",
55
+ optional: true,
56
+ type: "boolean"
57
+ })];
58
+ }
59
+ }),
60
+ createComponent(Spacing, {}),
61
+ createComponent(TSDoc$1, { heading: "Handler logic for the \\`completions bash config\\` command." }),
62
+ createComponent(FunctionDeclaration, {
63
+ "export": true,
64
+ "default": true,
65
+ async: true,
66
+ name: "handler",
67
+ parameters: [{
68
+ name: "options",
69
+ type: "BashConfigCompletionsOptions",
70
+ default: "{}"
71
+ }, {
72
+ name: "path",
73
+ type: "string",
74
+ default: `"~/.bashrc"`
75
+ }],
76
+ get children() {
77
+ return [createComponent(IfStatement, {
78
+ condition: code`options.display !== true`,
79
+ get children() {
80
+ return [
81
+ createComponent(VarDeclaration, {
82
+ "let": true,
83
+ name: "configPath",
84
+ type: "string",
85
+ initializer: code` path.includes(".") ? path : join(path, ".bashrc");`
86
+ }),
87
+ createComponent(Spacing, {}),
88
+ createComponent(IfStatement, {
89
+ condition: code`configPath.startsWith("~")`,
90
+ children: code`configPath = join(os.homedir(), configPath.replace("~", "")); `
91
+ }),
92
+ createComponent(Spacing, {}),
93
+ createComponent(VarDeclaration, {
94
+ "let": true,
95
+ name: "content",
96
+ type: "string",
97
+ initializer: code`"";`
98
+ }),
99
+ createComponent(Spacing, {}),
100
+ memo(() => code`try {
2
101
  content = await readFile(configPath, "utf8");
3
102
  } catch (error) {
4
103
  if (typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT") {
@@ -9,15 +108,19 @@ import{createComponent as e,memo as t}from"@alloy-js/core/jsx-runtime";import{ge
9
108
  }
10
109
  }
11
110
 
12
- await writeFile(configPath, \`\${content}\\n\\n### Begin - ${n(_)} Shell Completions ###\\n\\n\${SHELL_COMPLETIONS} \\n\\n### End - ${n(_)} Bash Completions ###\`);
111
+ await writeFile(configPath, \`\${content}\\n\\n### Begin - ${getAppTitle(context)} Shell Completions ###\\n\\n\${SHELL_COMPLETIONS} \\n\\n### End - ${getAppTitle(context)} Bash Completions ###\`);
13
112
 
14
- success(\`${n(_)} shell completions have been applied to Bash 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(" ------------------------------------------------- ");
113
+ success(\`${getAppTitle(context)} shell completions have been applied to Bash configuration file at \${bold(configPath)}. Please restart your terminal or run \${inlineCode(\`source \${configPath}\`)} for the changes to take effect.\`); `)
114
+ ];
115
+ }
116
+ }), createComponent(ElseClause, { get children() {
117
+ return code`writeLine(" ------------------------------------------------- ");
15
118
  writeLine("");
16
- writeLine(\`### Begin - ${n(_)} Bash Completions ###\`);
119
+ writeLine(\`### Begin - ${getAppTitle(context)} Bash Completions ###\`);
17
120
  writeLine("");
18
121
  SHELL_COMPLETIONS_DISPLAY.split("\\n").map(line => writeLine(line));
19
122
  writeLine("");
20
- writeLine(\`### End - ${n(_)} Bash Completions ###\`);
123
+ writeLine(\`### End - ${getAppTitle(context)} Bash Completions ###\`);
21
124
  writeLine("");
22
125
  writeLine(" ------------------------------------------------- ");
23
126
 
@@ -25,5 +128,15 @@ import{createComponent as e,memo as t}from"@alloy-js/core/jsx-runtime";import{ge
25
128
  help(\`To enable these completions, perform one of the following actions:
26
129
 
27
130
  1) Copy and paste the above script into your shell configuration file (e.g., ~/.bashrc)
28
- 2) Save the above script to a file and source it from your shell configuration file \`); `}})]}})]}})}export{_ as BashConfigCompletionsCommand};
131
+ 2) Save the above script to a file and source it from your shell configuration file \`); `;
132
+ } })];
133
+ }
134
+ })
135
+ ];
136
+ }
137
+ });
138
+ }
139
+
140
+ //#endregion
141
+ export { BashConfigCompletionsCommand };
29
142
  //# sourceMappingURL=bash-config-command.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"bash-config-command.mjs","names":[],"sources":["../../src/components/bash-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 Bash Completions - Configuration command's handler wrapper for the Shell Shock project.\n */\nexport function BashConfigCompletionsCommand() {\n const context = usePowerlines<CompletionsPluginContext>();\n\n return (\n <TypescriptFile\n path={joinPaths(\n context.entryPath,\n \"completions\",\n \"bash\",\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_DISPLAY\", \"SHELL_COMPLETIONS\"]\n }}\n builtinImports={{\n console: [\"bold\", \"inlineCode\", \"writeLine\", \"success\", \"warn\", \"help\"]\n }}>\n <TSDoc heading=\"Options for the Bash Completions - Configuration command.\" />\n <InterfaceDeclaration export name=\"BashConfigCompletionsOptions\">\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 bash config\\` command.\"></TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[\n {\n name: \"options\",\n type: \"BashConfigCompletionsOptions\",\n default: \"{}\"\n },\n {\n name: \"path\",\n type: \"string\",\n default: `\"~/.bashrc\"`\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, \".bashrc\");`}\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 )} Bash Completions ###\\`);\n\n success(\\`${getAppTitle(\n context\n )} shell completions have been applied to Bash 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)} Bash Completions ###\\`);\n writeLine(\"\");\n SHELL_COMPLETIONS_DISPLAY.split(\"\\\\n\").map(line => writeLine(line));\n writeLine(\"\");\n writeLine(\\`### End - ${getAppTitle(context)} Bash 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., ~/.bashrc)\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":"muBA+BA,SAAE,GAAA,CACA,IAAM,EAAC,GAAwB,CACjC,OAAO,EAAA,EAAA,CACL,IAAK,MAAA,CACL,OAAA,EAAA,EAAA,UAAA,cAAA,OAAA,SAAA,aAAA,EAEF,QAAS,CACH,UAAG,KACH,YAAQ,CAAA,OAAA,6CAEZ,YAAA,CAAA,4BAAA,oBAAA,CACC,CACD,eAAA,CACI,QAAS,CAAC,OAAA,aAAA,YAA+B,UAAA,OAAA,OAAA,CAC7C,gBAEA,MAAO,CAAA,EAAA,EAAA,CACJ,QAAA,4DACC,CAAA,CAAI,EAAW,EAAA,CACb,OAAQ,GACR,KAAC,+BACD,IAAC,UAAK,CACL,MAAO,CAAA,EAAA,EAAA,CACP,QAAU,6LACZ,IAAA,UAAA,CACO,OAAC,EAAA,EAAA,CACC,IAAI,MAAG,CACL,OAAK,EAAM,SAEjB,aAAW,GAChB,CAAA,EAEC,CAAA,CAAA,EAAmB,EAAc,CACjC,KAAA,UACI,SAAU,GACf,KAAA,UACE,CAAA,CAAA,EAEF,CAAC,CAAE,EAAQ,EAAe,EAAA,CAAO,CAAA,EAAA,EAAA,CAChC,QAAI,+DACL,CAAC,CAAE,EAAC,EAAA,CACH,OAAO,GACP,QAAC,GACD,MAAA,GACD,KAAO,UACP,WAAa,CAAC,CACd,KAAA,UACC,KAAA,+BACA,QAAA,KACA,CAAA,CACA,KAAM,OACN,KAAA,SACE,QAAA,cACD,CAAC,CACF,IAAI,UAAO,CACT,MAAE,CAAA,EAAY,EAAA,CACb,UAAA,CAAA,2BACD,IAAA,UAAA,CACE,MAAO,CAAA,EAAK,EAAA,CACR,IAAG,GACP,KAAU,aACZ,KAAA,SACA,YAAA,CAAA,sDACD,CAAA,CAAA,EAA2B,EAAS,EAAA,CAAA,CAAA,EAAkB,EAAA,CACpD,UAAA,CAAA,6BACC,SAAA,CAAA,iEACA,CAAI,CAAE,EAAU,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACZ,IAAE,GACN,KAAA,UACD,KAAA,SACA,YAAS,CAAA,MACT,CAAA,CAAA,EAAuB,EAAK,EAAA,CAAA,CAAW,MAAa,CAAI;;;;;;;;;;;uEAW/C,EAAA,EAAA,CAAA,oEAAA,EAAA,EAAA,CAAA;;sBAED,EAAO,EAAA,CAAA,6MAAA,CAAA,EAEf,CAAC,CAAE,EAAe,EAAe,CAChC,IAAE,UAAO,CACP,MAAK,EAAA;;oCAEP,EAAA,EAAA,CAAA;;;;kCAIA,EAAA,EAAA,CAAA;;;;;;;;sGAUF,CAAA,CAAA,EAEH,CAAC,CAAC,EAEN,CAAC"}
1
+ {"version":3,"file":"bash-config-command.mjs","names":[],"sources":["../../src/components/bash-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 Bash Completions - Configuration command's handler wrapper for the Shell Shock project.\n */\nexport function BashConfigCompletionsCommand() {\n const context = usePowerlines<CompletionsPluginContext>();\n\n return (\n <TypescriptFile\n path={joinPaths(\n context.entryPath,\n \"completions\",\n \"bash\",\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_DISPLAY\", \"SHELL_COMPLETIONS\"]\n }}\n builtinImports={{\n console: [\"bold\", \"inlineCode\", \"writeLine\", \"success\", \"warn\", \"help\"]\n }}>\n <TSDoc heading=\"Options for the Bash Completions - Configuration command.\" />\n <InterfaceDeclaration export name=\"BashConfigCompletionsOptions\">\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 bash config\\` command.\"></TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[\n {\n name: \"options\",\n type: \"BashConfigCompletionsOptions\",\n default: \"{}\"\n },\n {\n name: \"path\",\n type: \"string\",\n default: `\"~/.bashrc\"`\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, \".bashrc\");`}\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 )} Bash Completions ###\\`);\n\n success(\\`${getAppTitle(\n context\n )} shell completions have been applied to Bash 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)} Bash Completions ###\\`);\n writeLine(\"\");\n SHELL_COMPLETIONS_DISPLAY.split(\"\\\\n\").map(line => writeLine(line));\n writeLine(\"\");\n writeLine(\\`### End - ${getAppTitle(context)} Bash 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., ~/.bashrc)\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,+BAAA;CACA,MAAM,UAAC,eAAwB;AACjC,QAAO,gBAAA,gBAAA;EACL,IAAK,OAAA;AACL,UAAA,UAAA,QAAA,WAAA,eAAA,QAAA,UAAA,aAAA;;EAEF,SAAS;GACH,WAAG;GACH,aAAQ,CAAA,OAAA;;GAEZ,aAAA,CAAA,6BAAA,oBAAA;GACC;EACD,gBAAA,EACI,SAAS;GAAC;GAAA;GAAA;GAA+B;GAAA;GAAA;GAAA,EAC7C;;AAEA,UAAO;IAAA,gBAAA,SAAA,EACJ,SAAA,6DACC,CAAA;IAAI,gBAAW,sBAAA;KACb,UAAQ;KACR,MAAC;KACD,IAAC,WAAK;AACL,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,gEACL,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,6MAAA;SAAA;;OAEf,CAAC,EAAE,gBAAe,YAAe,EAChC,IAAE,WAAO;AACP,cAAK,IAAA;;oCAEP,YAAA,QAAA,CAAA;;;;kCAIA,YAAA,QAAA,CAAA;;;;;;;;;SAUF,CAAA,CAAA;;KAEH,CAAC;IAAC;;EAEN,CAAC"}
@@ -1,9 +1,99 @@
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`,`bash`,`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 Bash Completions - Script command.`}),(0,e.createComponent)(r.InterfaceDeclaration,{export:!0,name:`BashScriptCompletionsOptions`,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 bash script\\` command."}),(0,e.createComponent)(r.FunctionDeclaration,{export:!0,default:!0,async:!0,name:`handler`,get parameters(){return[{name:`options`,type:`BashScriptCompletionsOptions`,default:`{}`},{name:`path`,type:`string`,default:`"./${d.value}-completions.bash"`}]},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}.bash\` : path;`}),(0,e.memo)(()=>n.code`
2
- await writeFile(scriptPath, \`# Bash 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_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
7
+ let _powerlines_plugin_alloy_core = require("@powerlines/plugin-alloy/core");
8
+ let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
9
+ let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
10
+ let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
11
+ let _stryke_path = require("@stryke/path");
3
12
 
4
- success(\`${(0,t.getAppTitle)(u)} Bash completion script has been generated at \${bold(scriptPath)}.\`); `)]}}),(0,e.createComponent)(r.ElseClause,{get children(){return n.code`writeLine(" ------------------------------------------------- ");
13
+ //#region src/components/bash-script-command.tsx
14
+ /**
15
+ * The Bash Completions - Script command's handler wrapper for the Shell Shock project.
16
+ */
17
+ function BashScriptCompletionsCommand() {
18
+ const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
19
+ const bin = (0, _alloy_js_core.computed)(() => (0, _shell_shock_core_plugin_utils.getAppBin)(context));
20
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TypescriptFile, {
21
+ get path() {
22
+ return (0, _stryke_path.joinPaths)(context.entryPath, "completions", "bash", "script", "command.ts");
23
+ },
24
+ imports: {
25
+ "node:os": "os",
26
+ "node:path": ["join"],
27
+ "node:fs/promises": ["readFile", "writeFile"],
28
+ "../shared": ["SHELL_COMPLETIONS", "SHELL_COMPLETIONS_DISPLAY"]
29
+ },
30
+ builtinImports: { console: [
31
+ "bold",
32
+ "writeLine",
33
+ "success",
34
+ "warn",
35
+ "help"
36
+ ] },
37
+ get children() {
38
+ return [
39
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Options for the Bash Completions - Script command." }),
40
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
41
+ "export": true,
42
+ name: "BashScriptCompletionsOptions",
43
+ get children() {
44
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
45
+ 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
+ get children() {
47
+ 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
+ },
51
+ defaultValue: false
52
+ });
53
+ }
54
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
55
+ name: "display",
56
+ optional: true,
57
+ type: "boolean"
58
+ })];
59
+ }
60
+ }),
61
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
62
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Handler logic for the \\`completions bash script\\` command." }),
63
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
64
+ "export": true,
65
+ "default": true,
66
+ async: true,
67
+ name: "handler",
68
+ get parameters() {
69
+ return [{
70
+ name: "options",
71
+ type: "BashScriptCompletionsOptions",
72
+ default: "{}"
73
+ }, {
74
+ name: "path",
75
+ type: "string",
76
+ default: `"./${bin.value}-completions.bash"`
77
+ }];
78
+ },
79
+ get children() {
80
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
81
+ condition: _alloy_js_core.code`options.display !== true`,
82
+ get children() {
83
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
84
+ "const": true,
85
+ name: "scriptPath",
86
+ type: "string",
87
+ initializer: _alloy_js_core.code` path.includes(".") ? \`\${path}.bash\` : path;`
88
+ }), (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
89
+ await writeFile(scriptPath, \`# Bash script to add completions for ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)}\\n\\n\${SHELL_COMPLETIONS}\`);
90
+
91
+ success(\`${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)} Bash completion script has been generated at \${bold(scriptPath)}.\`); `)];
92
+ }
93
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseClause, { get children() {
94
+ return _alloy_js_core.code`writeLine(" ------------------------------------------------- ");
5
95
  writeLine("");
6
- writeLine(\`# Bash completion for ${(0,t.getAppTitle)(u)}\`);
96
+ writeLine(\`# Bash completion for ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)}\`);
7
97
  writeLine("");
8
98
  SHELL_COMPLETIONS_DISPLAY.split("\\n").map(line => writeLine(line));
9
99
  writeLine("");
@@ -13,4 +103,14 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
13
103
  help(\`To enable these completions, perform one of the following actions:
14
104
 
15
105
  1) Copy and paste the above script into your shell configuration file (e.g., ~/.bashrc)
16
- 2) Save the above script to a file and source it from your shell configuration file \`); `}})]}})]}})}exports.BashScriptCompletionsCommand=u;
106
+ 2) Save the above script to a file and source it from your shell configuration file \`); `;
107
+ } })];
108
+ }
109
+ })
110
+ ];
111
+ }
112
+ });
113
+ }
114
+
115
+ //#endregion
116
+ exports.BashScriptCompletionsCommand = BashScriptCompletionsCommand;
@@ -1,9 +1,98 @@
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`,`bash`,`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 Bash Completions - Script command.`}),e(l,{export:!0,name:`BashScriptCompletionsOptions`,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 bash script\\` command."}),e(s,{export:!0,default:!0,async:!0,name:`handler`,get parameters(){return[{name:`options`,type:`BashScriptCompletionsOptions`,default:`{}`},{name:`path`,type:`string`,default:`"./${b.value}-completions.bash"`}]},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}.bash\` : path;`}),t(()=>i`
2
- await writeFile(scriptPath, \`# Bash 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 { ReflectionKind } from "@powerlines/deepkit/vendor/type";
6
+ import { Spacing } from "@powerlines/plugin-alloy/core";
7
+ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
8
+ import { InterfaceMember as InterfaceMember$1, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
9
+ import { TSDoc as TSDoc$1, TSDocDefaultValue as TSDocDefaultValue$1 } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
10
+ import { joinPaths } from "@stryke/path";
3
11
 
4
- success(\`${r(y)} Bash completion script has been generated at \${bold(scriptPath)}.\`); `)]}}),e(o,{get children(){return i`writeLine(" ------------------------------------------------- ");
12
+ //#region src/components/bash-script-command.tsx
13
+ /**
14
+ * The Bash Completions - Script command's handler wrapper for the Shell Shock project.
15
+ */
16
+ function BashScriptCompletionsCommand() {
17
+ const context = usePowerlines();
18
+ const bin = computed(() => getAppBin(context));
19
+ return createComponent(TypescriptFile, {
20
+ get path() {
21
+ return joinPaths(context.entryPath, "completions", "bash", "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
+ createComponent(TSDoc$1, { heading: "Options for the Bash Completions - Script command." }),
39
+ createComponent(InterfaceDeclaration, {
40
+ "export": true,
41
+ name: "BashScriptCompletionsOptions",
42
+ get children() {
43
+ return [createComponent(TSDoc$1, {
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 createComponent(TSDocDefaultValue$1, {
47
+ get type() {
48
+ return ReflectionKind.boolean;
49
+ },
50
+ defaultValue: false
51
+ });
52
+ }
53
+ }), createComponent(InterfaceMember$1, {
54
+ name: "display",
55
+ optional: true,
56
+ type: "boolean"
57
+ })];
58
+ }
59
+ }),
60
+ createComponent(Spacing, {}),
61
+ createComponent(TSDoc$1, { heading: "Handler logic for the \\`completions bash script\\` command." }),
62
+ createComponent(FunctionDeclaration, {
63
+ "export": true,
64
+ "default": true,
65
+ async: true,
66
+ name: "handler",
67
+ get parameters() {
68
+ return [{
69
+ name: "options",
70
+ type: "BashScriptCompletionsOptions",
71
+ default: "{}"
72
+ }, {
73
+ name: "path",
74
+ type: "string",
75
+ default: `"./${bin.value}-completions.bash"`
76
+ }];
77
+ },
78
+ get children() {
79
+ return [createComponent(IfStatement, {
80
+ condition: code`options.display !== true`,
81
+ get children() {
82
+ return [createComponent(VarDeclaration, {
83
+ "const": true,
84
+ name: "scriptPath",
85
+ type: "string",
86
+ initializer: code` path.includes(".") ? \`\${path}.bash\` : path;`
87
+ }), memo(() => code`
88
+ await writeFile(scriptPath, \`# Bash script to add completions for ${getAppTitle(context)}\\n\\n\${SHELL_COMPLETIONS}\`);
89
+
90
+ success(\`${getAppTitle(context)} Bash completion script has been generated at \${bold(scriptPath)}.\`); `)];
91
+ }
92
+ }), createComponent(ElseClause, { get children() {
93
+ return code`writeLine(" ------------------------------------------------- ");
5
94
  writeLine("");
6
- writeLine(\`# Bash completion for ${r(y)}\`);
95
+ writeLine(\`# Bash completion for ${getAppTitle(context)}\`);
7
96
  writeLine("");
8
97
  SHELL_COMPLETIONS_DISPLAY.split("\\n").map(line => writeLine(line));
9
98
  writeLine("");
@@ -13,5 +102,15 @@ import{createComponent as e,memo as t}from"@alloy-js/core/jsx-runtime";import{ge
13
102
  help(\`To enable these completions, perform one of the following actions:
14
103
 
15
104
  1) Copy and paste the above script into your shell configuration file (e.g., ~/.bashrc)
16
- 2) Save the above script to a file and source it from your shell configuration file \`); `}})]}})]}})}export{y as BashScriptCompletionsCommand};
105
+ 2) Save the above script to a file and source it from your shell configuration file \`); `;
106
+ } })];
107
+ }
108
+ })
109
+ ];
110
+ }
111
+ });
112
+ }
113
+
114
+ //#endregion
115
+ export { BashScriptCompletionsCommand };
17
116
  //# sourceMappingURL=bash-script-command.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"bash-script-command.mjs","names":[],"sources":["../../src/components/bash-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 Bash Completions - Script command's handler wrapper for the Shell Shock project.\n */\nexport function BashScriptCompletionsCommand() {\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 \"bash\",\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 Bash Completions - Script command.\" />\n <InterfaceDeclaration export name=\"BashScriptCompletionsOptions\">\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 bash script\\` command.\"></TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[\n {\n name: \"options\",\n type: \"BashScriptCompletionsOptions\",\n default: \"{}\"\n },\n {\n name: \"path\",\n type: \"string\",\n default: `\"./${bin.value}-completions.bash\"`\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}.bash\\` : path;`}\n />\n {code`\n await writeFile(scriptPath, \\`# Bash script to add completions for ${getAppTitle(context)}\\\\n\\\\n\\${SHELL_COMPLETIONS}\\`);\n\n success(\\`${getAppTitle(\n context\n )} Bash completion script has been generated at \\${bold(scriptPath)}.\\`); `}\n </IfStatement>\n <ElseClause>\n {code`writeLine(\" ------------------------------------------------- \");\n writeLine(\"\");\n writeLine(\\`# Bash 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., ~/.bashrc)\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;+EACC,EAAA,EAAA,CAAA;;sBAEM,EAAM,EAAA,CAAA,0EAAA,CAAA,EAEb,CAAA,CAAA,EAAA,EAAA,CACA,IAAI,UAAA,CACL,MAAM,EAAS;;gDAEQ,EAAA,EAAA,CAAA;;;;;;;;;;4GAc1B,CAAC,CAAC,EAEN,CAAC"}
1
+ {"version":3,"file":"bash-script-command.mjs","names":[],"sources":["../../src/components/bash-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 Bash Completions - Script command's handler wrapper for the Shell Shock project.\n */\nexport function BashScriptCompletionsCommand() {\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 \"bash\",\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 Bash Completions - Script command.\" />\n <InterfaceDeclaration export name=\"BashScriptCompletionsOptions\">\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 bash script\\` command.\"></TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[\n {\n name: \"options\",\n type: \"BashScriptCompletionsOptions\",\n default: \"{}\"\n },\n {\n name: \"path\",\n type: \"string\",\n default: `\"./${bin.value}-completions.bash\"`\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}.bash\\` : path;`}\n />\n {code`\n await writeFile(scriptPath, \\`# Bash script to add completions for ${getAppTitle(context)}\\\\n\\\\n\\${SHELL_COMPLETIONS}\\`);\n\n success(\\`${getAppTitle(\n context\n )} Bash completion script has been generated at \\${bold(scriptPath)}.\\`); `}\n </IfStatement>\n <ElseClause>\n {code`writeLine(\" ------------------------------------------------- \");\n writeLine(\"\");\n writeLine(\\`# Bash 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., ~/.bashrc)\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,+BAAA;CACA,MAAM,UAAC,eAAwB;CACjC,MAAO,MAAA,eAAA,UAAA,QAAA,CAAA;AACL,QAAK,gBAAA,gBAAA;EACL,IAAA,OAAA;AACI,UAAG,UAAW,QAAO,WAAM,eAAsB,QAAM,UAAA,aAAA;;EAE7D,SAAS;GACH,WAAQ;;GAEZ,oBAAA,CAAA,YAAA,YAAA;GACI,aAAM,CAAA,qBAA6B,4BAA0B;GACjE;EACF,gBAAgB,EACd,SAAa;GAAC;GAAE;GAAc;GAAA;GAAwB;GAAG;EAEzD,IAAM,WAAM;;+BAEN,SAAC,sDACJ,CAAA;IAAA,gBAAA,sBAAA;KACC,UAAM;KACJ,MAAA;KACA,IAAC,WAAY;AACZ,aAAK,CAAA,gBAAA,SAAA;OACL,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,gEACV,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;+EACC,YAAA,QAAA,CAAA;;sBAEM,YAAM,QAAA,CAAA,0EAAA,CAAA;;OAEb,CAAA,EAAA,gBAAA,YAAA,EACA,IAAI,WAAA;AACL,cAAM,IAAS;;gDAEQ,YAAA,QAAA,CAAA;;;;;;;;;;;;;KAc1B,CAAC;IAAC;;EAEN,CAAC"}