@shell-shock/plugin-completions 0.1.14 → 0.2.1
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.
- package/dist/components/bash-command.cjs +101 -25
- package/dist/components/bash-command.d.cts +2 -2
- package/dist/components/bash-command.d.cts.map +1 -1
- package/dist/components/bash-command.d.mts +2 -2
- package/dist/components/bash-command.d.mts.map +1 -1
- package/dist/components/bash-command.mjs +101 -25
- package/dist/components/bash-command.mjs.map +1 -1
- package/dist/components/fish-command.cjs +402 -0
- package/dist/components/fish-command.d.cts +10 -0
- package/dist/components/fish-command.d.cts.map +1 -0
- package/dist/components/fish-command.d.mts +10 -0
- package/dist/components/fish-command.d.mts.map +1 -0
- package/dist/components/fish-command.mjs +403 -0
- package/dist/components/fish-command.mjs.map +1 -0
- package/dist/components/index.cjs +4 -0
- package/dist/components/index.d.cts +3 -1
- package/dist/components/index.d.mts +3 -1
- package/dist/components/index.mjs +3 -1
- package/dist/components/powershell-command.cjs +418 -0
- package/dist/components/powershell-command.d.cts +10 -0
- package/dist/components/powershell-command.d.cts.map +1 -0
- package/dist/components/powershell-command.d.mts +10 -0
- package/dist/components/powershell-command.d.mts.map +1 -0
- package/dist/components/powershell-command.mjs +419 -0
- package/dist/components/powershell-command.mjs.map +1 -0
- package/dist/components/zsh-command.cjs +213 -26
- package/dist/components/zsh-command.d.cts +2 -2
- package/dist/components/zsh-command.d.cts.map +1 -1
- package/dist/components/zsh-command.d.mts.map +1 -1
- package/dist/components/zsh-command.mjs +213 -26
- package/dist/components/zsh-command.mjs.map +1 -1
- package/dist/helpers/complete-command.cjs +14 -0
- package/dist/helpers/complete-command.d.cts +5 -0
- package/dist/helpers/complete-command.d.cts.map +1 -0
- package/dist/helpers/complete-command.d.mts +5 -0
- package/dist/helpers/complete-command.d.mts.map +1 -0
- package/dist/helpers/complete-command.mjs +14 -0
- package/dist/helpers/complete-command.mjs.map +1 -0
- package/dist/helpers/completion-directive-constants.cjs +15 -0
- package/dist/helpers/completion-directive-constants.d.cts +14 -0
- package/dist/helpers/completion-directive-constants.d.cts.map +1 -0
- package/dist/helpers/completion-directive-constants.d.mts +14 -0
- package/dist/helpers/completion-directive-constants.d.mts.map +1 -0
- package/dist/helpers/completion-directive-constants.mjs +15 -0
- package/dist/helpers/completion-directive-constants.mjs.map +1 -0
- package/dist/helpers/index.cjs +5 -0
- package/dist/helpers/index.d.cts +3 -0
- package/dist/helpers/index.d.mts +3 -0
- package/dist/helpers/index.mjs +4 -0
- package/dist/index.cjs +42 -5
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +42 -5
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/plugin.d.cts +16 -3
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +16 -3
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/types/shell-type.cjs +6 -1
- package/dist/types/shell-type.d.cts +1 -1
- package/dist/types/shell-type.d.mts +1 -1
- package/dist/types/shell-type.mjs +6 -1
- package/dist/types/shell-type.mjs.map +1 -1
- package/package.json +82 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complete-command.d.cts","names":[],"sources":["../../src/helpers/complete-command.ts"],"sourcesContent":[],"mappings":";cA4Ba"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complete-command.d.mts","names":[],"sources":["../../src/helpers/complete-command.ts"],"sourcesContent":[],"mappings":";cA4Ba"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/helpers/complete-command.ts
|
|
2
|
+
function quoteIfNeeded(path) {
|
|
3
|
+
return path.includes(" ") ? `'${path}'` : path;
|
|
4
|
+
}
|
|
5
|
+
const execPath = process.execPath;
|
|
6
|
+
const processArgs = process.argv.slice(1);
|
|
7
|
+
const quotedExecPath = quoteIfNeeded(execPath);
|
|
8
|
+
const quotedProcessArgs = processArgs.map(quoteIfNeeded);
|
|
9
|
+
const quotedProcessExecArgs = process.execArgv.map(quoteIfNeeded);
|
|
10
|
+
const exec = `${quotedExecPath} ${quotedProcessExecArgs.join(" ")} ${quotedProcessArgs[0]}`;
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { exec };
|
|
14
|
+
//# sourceMappingURL=complete-command.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complete-command.mjs","names":["quoteIfNeeded","path","includes","execPath","process","processArgs","argv","slice","quotedExecPath","quotedProcessArgs","map","quotedProcessExecArgs","execArgv","exec","join"],"sources":["../../src/helpers/complete-command.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nfunction quoteIfNeeded(path: string): string {\n return path.includes(\" \") ? `'${path}'` : path;\n}\n\nconst execPath = process.execPath;\nconst processArgs = process.argv.slice(1);\nconst quotedExecPath = quoteIfNeeded(execPath);\nconst quotedProcessArgs = processArgs.map(quoteIfNeeded);\nconst quotedProcessExecArgs = process.execArgv.map(quoteIfNeeded);\n\nexport const exec = `${quotedExecPath} ${quotedProcessExecArgs.join(\" \")} ${\n quotedProcessArgs[0]\n}`;\n"],"mappings":";AAkBA,SAASA,cAAcC,MAAsB;AAC3C,QAAOA,KAAKC,SAAS,IAAI,GAAG,IAAID,KAAI,KAAMA;;AAG5C,MAAME,WAAWC,QAAQD;AACzB,MAAME,cAAcD,QAAQE,KAAKC,MAAM,EAAE;AACzC,MAAMC,iBAAiBR,cAAcG,SAAS;AAC9C,MAAMM,oBAAoBJ,YAAYK,IAAIV,cAAc;AACxD,MAAMW,wBAAwBP,QAAQQ,SAASF,IAAIV,cAAc;AAEjE,MAAaa,OAAO,GAAGL,eAAc,GAAIG,sBAAsBG,KAAK,IAAI,CAAA,GACtEL,kBAAkB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/helpers/completion-directive-constants.ts
|
|
3
|
+
const CompletionDirective = {
|
|
4
|
+
CompletionDirectiveError: 1,
|
|
5
|
+
CompletionDirectiveNoSpace: 2,
|
|
6
|
+
CompletionDirectiveNoFileComp: 4,
|
|
7
|
+
CompletionDirectiveFilterFileExt: 8,
|
|
8
|
+
CompletionDirectiveFilterDirs: 16,
|
|
9
|
+
CompletionDirectiveKeepOrder: 32,
|
|
10
|
+
CompletionDirectiveMaxValue: 64,
|
|
11
|
+
CompletionDirectiveDefault: 0
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.CompletionDirective = CompletionDirective;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/helpers/completion-directive-constants.d.ts
|
|
2
|
+
declare const CompletionDirective: {
|
|
3
|
+
CompletionDirectiveError: number;
|
|
4
|
+
CompletionDirectiveNoSpace: number;
|
|
5
|
+
CompletionDirectiveNoFileComp: number;
|
|
6
|
+
CompletionDirectiveFilterFileExt: number;
|
|
7
|
+
CompletionDirectiveFilterDirs: number;
|
|
8
|
+
CompletionDirectiveKeepOrder: number;
|
|
9
|
+
CompletionDirectiveMaxValue: number;
|
|
10
|
+
CompletionDirectiveDefault: number;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { CompletionDirective };
|
|
14
|
+
//# sourceMappingURL=completion-directive-constants.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion-directive-constants.d.cts","names":[],"sources":["../../src/helpers/completion-directive-constants.ts"],"sourcesContent":[],"mappings":";cAkBa;EAAA,wBASZ,EAAA,MAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/helpers/completion-directive-constants.d.ts
|
|
2
|
+
declare const CompletionDirective: {
|
|
3
|
+
CompletionDirectiveError: number;
|
|
4
|
+
CompletionDirectiveNoSpace: number;
|
|
5
|
+
CompletionDirectiveNoFileComp: number;
|
|
6
|
+
CompletionDirectiveFilterFileExt: number;
|
|
7
|
+
CompletionDirectiveFilterDirs: number;
|
|
8
|
+
CompletionDirectiveKeepOrder: number;
|
|
9
|
+
CompletionDirectiveMaxValue: number;
|
|
10
|
+
CompletionDirectiveDefault: number;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { CompletionDirective };
|
|
14
|
+
//# sourceMappingURL=completion-directive-constants.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion-directive-constants.d.mts","names":[],"sources":["../../src/helpers/completion-directive-constants.ts"],"sourcesContent":[],"mappings":";cAkBa;EAAA,wBASZ,EAAA,MAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/helpers/completion-directive-constants.ts
|
|
2
|
+
const CompletionDirective = {
|
|
3
|
+
CompletionDirectiveError: 1,
|
|
4
|
+
CompletionDirectiveNoSpace: 2,
|
|
5
|
+
CompletionDirectiveNoFileComp: 4,
|
|
6
|
+
CompletionDirectiveFilterFileExt: 8,
|
|
7
|
+
CompletionDirectiveFilterDirs: 16,
|
|
8
|
+
CompletionDirectiveKeepOrder: 32,
|
|
9
|
+
CompletionDirectiveMaxValue: 64,
|
|
10
|
+
CompletionDirectiveDefault: 0
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { CompletionDirective };
|
|
15
|
+
//# sourceMappingURL=completion-directive-constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion-directive-constants.mjs","names":["CompletionDirective","CompletionDirectiveError","CompletionDirectiveNoSpace","CompletionDirectiveNoFileComp","CompletionDirectiveFilterFileExt","CompletionDirectiveFilterDirs","CompletionDirectiveKeepOrder","CompletionDirectiveMaxValue","CompletionDirectiveDefault"],"sources":["../../src/helpers/completion-directive-constants.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport const CompletionDirective = {\n CompletionDirectiveError: 1 << 0,\n CompletionDirectiveNoSpace: 1 << 1,\n CompletionDirectiveNoFileComp: 1 << 2,\n CompletionDirectiveFilterFileExt: 1 << 3,\n CompletionDirectiveFilterDirs: 1 << 4,\n CompletionDirectiveKeepOrder: 1 << 5,\n CompletionDirectiveMaxValue: 1 << 6,\n CompletionDirectiveDefault: 0\n};\n"],"mappings":";AAkBA,MAAaA,sBAAsB;CACjCC,0BAA0B;CAC1BC,4BAA4B;CAC5BC,+BAA+B;CAC/BC,kCAAkC;CAClCC,+BAA+B;CAC/BC,8BAA8B;CAC9BC,6BAA6B;CAC7BC,4BAA4B;CAC7B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const require_helpers_complete_command = require('./complete-command.cjs');
|
|
2
|
+
const require_helpers_completion_directive_constants = require('./completion-directive-constants.cjs');
|
|
3
|
+
|
|
4
|
+
exports.CompletionDirective = require_helpers_completion_directive_constants.CompletionDirective;
|
|
5
|
+
exports.exec = require_helpers_complete_command.exec;
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_components_bash_command = require('./components/bash-command.cjs');
|
|
3
|
+
const require_components_fish_command = require('./components/fish-command.cjs');
|
|
4
|
+
const require_components_powershell_command = require('./components/powershell-command.cjs');
|
|
3
5
|
const require_components_zsh_command = require('./components/zsh-command.cjs');
|
|
4
6
|
require('./components/index.cjs');
|
|
7
|
+
const require_types_shell_type = require('./types/shell-type.cjs');
|
|
5
8
|
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
6
9
|
let __powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
|
|
7
10
|
let __shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
@@ -17,7 +20,10 @@ const plugin = (options = {}) => {
|
|
|
17
20
|
name: "shell-shock:completions",
|
|
18
21
|
config() {
|
|
19
22
|
this.debug("Providing default configuration for the Shell Shock `completions` plugin.");
|
|
20
|
-
return { completions:
|
|
23
|
+
return { completions: {
|
|
24
|
+
shells: require_types_shell_type.SHELL_TYPES,
|
|
25
|
+
...options
|
|
26
|
+
} };
|
|
21
27
|
},
|
|
22
28
|
configResolved() {
|
|
23
29
|
this.debug("Adding the CLI completion commands to the application context.");
|
|
@@ -30,14 +36,15 @@ const plugin = (options = {}) => {
|
|
|
30
36
|
path: "completions",
|
|
31
37
|
segments: ["completions"],
|
|
32
38
|
title: "CLI Completions",
|
|
33
|
-
description: `Commands for generating shell completion scripts for
|
|
39
|
+
description: `Commands for generating shell completion scripts for ${(0, __shell_shock_core_plugin_utils.getAppTitle)(this)}.`,
|
|
34
40
|
entry: { file: (0, __stryke_path_join.joinPaths)(this.entryPath, "completions", "command.ts") },
|
|
35
41
|
isVirtual: true
|
|
36
42
|
});
|
|
37
|
-
if (this.inputs.some((input) => input.id === "completions-bash")) this.info("The `completions-bash` command already exists in the commands list. If you would like the completions-bash command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
|
|
43
|
+
if (this.config.completions.shells.includes("bash")) if (this.inputs.some((input) => input.id === "completions-bash")) this.info("The `completions-bash` command already exists in the commands list. If you would like the completions-bash command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
|
|
38
44
|
else this.inputs.push({
|
|
39
45
|
id: "completions-bash",
|
|
40
46
|
name: "bash",
|
|
47
|
+
description: `Generate a Bash completion script for the ${(0, __shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
|
|
41
48
|
alias: [],
|
|
42
49
|
path: "completions/bash",
|
|
43
50
|
segments: ["completions", "bash"],
|
|
@@ -45,10 +52,11 @@ const plugin = (options = {}) => {
|
|
|
45
52
|
entry: { file: (0, __stryke_path_join.joinPaths)(this.entryPath, "completions", "bash", "command.ts") },
|
|
46
53
|
isVirtual: false
|
|
47
54
|
});
|
|
48
|
-
if (this.inputs.some((input) => input.id === "completions-zsh")) this.info("The `completions-zsh` command already exists in the commands list. If you would like the completions-zsh command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
|
|
55
|
+
if (this.config.completions.shells.includes("zsh")) if (this.inputs.some((input) => input.id === "completions-zsh")) this.info("The `completions-zsh` command already exists in the commands list. If you would like the completions-zsh command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
|
|
49
56
|
else this.inputs.push({
|
|
50
57
|
id: "completions-zsh",
|
|
51
58
|
name: "zsh",
|
|
59
|
+
description: `Generate a Zsh completion script for the ${(0, __shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
|
|
52
60
|
alias: [],
|
|
53
61
|
path: "completions/zsh",
|
|
54
62
|
segments: ["completions", "zsh"],
|
|
@@ -56,10 +64,39 @@ const plugin = (options = {}) => {
|
|
|
56
64
|
entry: { file: (0, __stryke_path.relativePath)(this.commandsPath, (0, __stryke_path_join.joinPaths)(this.entryPath, "completions", "zsh", "command.ts")) },
|
|
57
65
|
isVirtual: false
|
|
58
66
|
});
|
|
67
|
+
if (this.config.completions.shells.includes("powershell")) if (this.inputs.some((input) => input.id === "completions-powershell")) this.info("The `completions-powershell` command already exists in the commands list. If you would like the completions-powershell command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
|
|
68
|
+
else this.inputs.push({
|
|
69
|
+
id: "completions-powershell",
|
|
70
|
+
name: "powershell",
|
|
71
|
+
description: `Generate a PowerShell completion script for the ${(0, __shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
|
|
72
|
+
alias: [],
|
|
73
|
+
path: "completions/powershell",
|
|
74
|
+
segments: ["completions", "powershell"],
|
|
75
|
+
title: "CLI Completions - PowerShell",
|
|
76
|
+
entry: { file: (0, __stryke_path.relativePath)(this.commandsPath, (0, __stryke_path_join.joinPaths)(this.entryPath, "completions", "powershell", "command.ts")) },
|
|
77
|
+
isVirtual: false
|
|
78
|
+
});
|
|
79
|
+
if (this.config.completions.shells.includes("fish")) if (this.inputs.some((input) => input.id === "completions-fish")) this.info("The `completions-fish` command already exists in the commands list. If you would like the completions-fish command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
|
|
80
|
+
else this.inputs.push({
|
|
81
|
+
id: "completions-fish",
|
|
82
|
+
name: "fish",
|
|
83
|
+
description: `Generate a Fish completion script for the ${(0, __shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface.`,
|
|
84
|
+
alias: [],
|
|
85
|
+
path: "completions/fish",
|
|
86
|
+
segments: ["completions", "fish"],
|
|
87
|
+
title: "CLI Completions - Fish Shell",
|
|
88
|
+
entry: { file: (0, __stryke_path.relativePath)(this.commandsPath, (0, __stryke_path_join.joinPaths)(this.entryPath, "completions", "fish", "command.ts")) },
|
|
89
|
+
isVirtual: false
|
|
90
|
+
});
|
|
59
91
|
},
|
|
60
92
|
async prepare() {
|
|
61
93
|
this.debug("Rendering command handling modules for the Shell Shock `completions` plugin.");
|
|
62
|
-
return (0, __powerlines_plugin_alloy_render.render)(this, [
|
|
94
|
+
return (0, __powerlines_plugin_alloy_render.render)(this, [
|
|
95
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(require_components_bash_command.BashCompletionsCommand, {}),
|
|
96
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(require_components_zsh_command.ZshCompletionsCommand, {}),
|
|
97
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(require_components_powershell_command.PowerShellCompletionsCommand, {}),
|
|
98
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(require_components_fish_command.FishCompletionsCommand, {})
|
|
99
|
+
]);
|
|
63
100
|
}
|
|
64
101
|
}];
|
|
65
102
|
};
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAsCA;AACmB,cADN,MACM,EAAA,CAAA,iBAAA,wBAAA,GAA2B,wBAA3B,CAAA,CAAA,OAAA,CAAA,EAER,wBAFQ,EAAA,GAGhB,MAHgB,CAGT,QAHS,CAAA,EAAA"}
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAsCA;AACmB,cADN,MACM,EAAA,CAAA,iBAAA,wBAAA,GAA2B,wBAA3B,CAAA,CAAA,OAAA,CAAA,EAER,wBAFQ,EAAA,GAGhB,MAHgB,CAGT,QAHS,CAAA,EAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { BashCompletionsCommand } from "./components/bash-command.mjs";
|
|
2
|
+
import { FishCompletionsCommand } from "./components/fish-command.mjs";
|
|
3
|
+
import { PowerShellCompletionsCommand } from "./components/powershell-command.mjs";
|
|
2
4
|
import { ZshCompletionsCommand } from "./components/zsh-command.mjs";
|
|
3
5
|
import "./components/index.mjs";
|
|
6
|
+
import { SHELL_TYPES } from "./types/shell-type.mjs";
|
|
4
7
|
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
5
8
|
import { render } from "@powerlines/plugin-alloy/render";
|
|
6
9
|
import { getAppTitle } from "@shell-shock/core/plugin-utils";
|
|
@@ -16,7 +19,10 @@ const plugin = (options = {}) => {
|
|
|
16
19
|
name: "shell-shock:completions",
|
|
17
20
|
config() {
|
|
18
21
|
this.debug("Providing default configuration for the Shell Shock `completions` plugin.");
|
|
19
|
-
return { completions:
|
|
22
|
+
return { completions: {
|
|
23
|
+
shells: SHELL_TYPES,
|
|
24
|
+
...options
|
|
25
|
+
} };
|
|
20
26
|
},
|
|
21
27
|
configResolved() {
|
|
22
28
|
this.debug("Adding the CLI completion commands to the application context.");
|
|
@@ -29,14 +35,15 @@ const plugin = (options = {}) => {
|
|
|
29
35
|
path: "completions",
|
|
30
36
|
segments: ["completions"],
|
|
31
37
|
title: "CLI Completions",
|
|
32
|
-
description: `Commands for generating shell completion scripts for
|
|
38
|
+
description: `Commands for generating shell completion scripts for ${getAppTitle(this)}.`,
|
|
33
39
|
entry: { file: joinPaths$1(this.entryPath, "completions", "command.ts") },
|
|
34
40
|
isVirtual: true
|
|
35
41
|
});
|
|
36
|
-
if (this.inputs.some((input) => input.id === "completions-bash")) this.info("The `completions-bash` command already exists in the commands list. If you would like the completions-bash command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
|
|
42
|
+
if (this.config.completions.shells.includes("bash")) if (this.inputs.some((input) => input.id === "completions-bash")) this.info("The `completions-bash` command already exists in the commands list. If you would like the completions-bash command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
|
|
37
43
|
else this.inputs.push({
|
|
38
44
|
id: "completions-bash",
|
|
39
45
|
name: "bash",
|
|
46
|
+
description: `Generate a Bash completion script for the ${getAppTitle(this, true)} command-line interface.`,
|
|
40
47
|
alias: [],
|
|
41
48
|
path: "completions/bash",
|
|
42
49
|
segments: ["completions", "bash"],
|
|
@@ -44,10 +51,11 @@ const plugin = (options = {}) => {
|
|
|
44
51
|
entry: { file: joinPaths$1(this.entryPath, "completions", "bash", "command.ts") },
|
|
45
52
|
isVirtual: false
|
|
46
53
|
});
|
|
47
|
-
if (this.inputs.some((input) => input.id === "completions-zsh")) this.info("The `completions-zsh` command already exists in the commands list. If you would like the completions-zsh command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
|
|
54
|
+
if (this.config.completions.shells.includes("zsh")) if (this.inputs.some((input) => input.id === "completions-zsh")) this.info("The `completions-zsh` command already exists in the commands list. If you would like the completions-zsh command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
|
|
48
55
|
else this.inputs.push({
|
|
49
56
|
id: "completions-zsh",
|
|
50
57
|
name: "zsh",
|
|
58
|
+
description: `Generate a Zsh completion script for the ${getAppTitle(this, true)} command-line interface.`,
|
|
51
59
|
alias: [],
|
|
52
60
|
path: "completions/zsh",
|
|
53
61
|
segments: ["completions", "zsh"],
|
|
@@ -55,10 +63,39 @@ const plugin = (options = {}) => {
|
|
|
55
63
|
entry: { file: relativePath(this.commandsPath, joinPaths$1(this.entryPath, "completions", "zsh", "command.ts")) },
|
|
56
64
|
isVirtual: false
|
|
57
65
|
});
|
|
66
|
+
if (this.config.completions.shells.includes("powershell")) if (this.inputs.some((input) => input.id === "completions-powershell")) this.info("The `completions-powershell` command already exists in the commands list. If you would like the completions-powershell command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
|
|
67
|
+
else this.inputs.push({
|
|
68
|
+
id: "completions-powershell",
|
|
69
|
+
name: "powershell",
|
|
70
|
+
description: `Generate a PowerShell completion script for the ${getAppTitle(this, true)} command-line interface.`,
|
|
71
|
+
alias: [],
|
|
72
|
+
path: "completions/powershell",
|
|
73
|
+
segments: ["completions", "powershell"],
|
|
74
|
+
title: "CLI Completions - PowerShell",
|
|
75
|
+
entry: { file: relativePath(this.commandsPath, joinPaths$1(this.entryPath, "completions", "powershell", "command.ts")) },
|
|
76
|
+
isVirtual: false
|
|
77
|
+
});
|
|
78
|
+
if (this.config.completions.shells.includes("fish")) if (this.inputs.some((input) => input.id === "completions-fish")) this.info("The `completions-fish` command already exists in the commands list. If you would like the completions-fish command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.");
|
|
79
|
+
else this.inputs.push({
|
|
80
|
+
id: "completions-fish",
|
|
81
|
+
name: "fish",
|
|
82
|
+
description: `Generate a Fish completion script for the ${getAppTitle(this, true)} command-line interface.`,
|
|
83
|
+
alias: [],
|
|
84
|
+
path: "completions/fish",
|
|
85
|
+
segments: ["completions", "fish"],
|
|
86
|
+
title: "CLI Completions - Fish Shell",
|
|
87
|
+
entry: { file: relativePath(this.commandsPath, joinPaths$1(this.entryPath, "completions", "fish", "command.ts")) },
|
|
88
|
+
isVirtual: false
|
|
89
|
+
});
|
|
58
90
|
},
|
|
59
91
|
async prepare() {
|
|
60
92
|
this.debug("Rendering command handling modules for the Shell Shock `completions` plugin.");
|
|
61
|
-
return render(this, [
|
|
93
|
+
return render(this, [
|
|
94
|
+
createComponent(BashCompletionsCommand, {}),
|
|
95
|
+
createComponent(ZshCompletionsCommand, {}),
|
|
96
|
+
createComponent(PowerShellCompletionsCommand, {}),
|
|
97
|
+
createComponent(FishCompletionsCommand, {})
|
|
98
|
+
]);
|
|
62
99
|
}
|
|
63
100
|
}];
|
|
64
101
|
};
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["render","getAppTitle","relativePath","joinPaths","BashCompletionsCommand","ZshCompletionsCommand","plugin","options","name","config","debug","completions","configResolved","inputs","some","input","id","info","push","alias","path","segments","title","description","entry","file","entryPath","isVirtual","commandsPath","prepare","_$createComponent"],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { relativePath } from \"@stryke/path\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport type { Plugin } from \"powerlines\";\nimport { BashCompletionsCommand, ZshCompletionsCommand } from \"./components\";\nimport type {\n CompletionsPluginContext,\n CompletionsPluginOptions\n} from \"./types/plugin\";\n\n/**\n * The Completions - Shell Shock plugin to add completion commands to a Shell Shock application.\n */\nexport const plugin = <\n TContext extends CompletionsPluginContext = CompletionsPluginContext\n>(\n options: CompletionsPluginOptions = {}\n): Plugin<TContext>[] => {\n return [\n {\n name: \"shell-shock:completions\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `completions` plugin.\"\n );\n\n return {\n completions: options\n };\n },\n configResolved() {\n this.debug(\n \"Adding the CLI completion commands to the application context.\"\n );\n\n this.inputs ??= [];\n if (this.inputs.some(input => input.id === \"completions\")) {\n this.info(\n \"The `completions` command already exists in the commands list. If you would like the completions command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions\",\n name: \"completions\",\n alias: [\"completion\"],\n path: \"completions\",\n segments: [\"completions\"],\n title: \"CLI Completions\",\n description: `Commands for generating shell completion scripts for the ${getAppTitle(\n this\n )}.`,\n entry: {\n file: joinPaths(this.entryPath, \"completions\", \"command.ts\")\n },\n isVirtual: true\n });\n }\n\n if (this.inputs.some(input => input.id === \"completions-bash\")) {\n this.info(\n \"The `completions-bash` command already exists in the commands list. If you would like the completions-bash command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-bash\",\n name: \"bash\",\n alias: [],\n path: \"completions/bash\",\n segments: [\"completions\", \"bash\"],\n title: \"CLI Completions - Bash Shell\",\n entry: {\n file: joinPaths(\n this.entryPath,\n \"completions\",\n \"bash\",\n \"command.ts\"\n )\n },\n isVirtual: false\n });\n }\n\n if (this.inputs.some(input => input.id === \"completions-zsh\")) {\n this.info(\n \"The `completions-zsh` command already exists in the commands list. If you would like the completions-zsh command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-zsh\",\n name: \"zsh\",\n alias: [],\n path: \"completions/zsh\",\n segments: [\"completions\", \"zsh\"],\n title: \"CLI Completions - Zsh Shell\",\n entry: {\n file: relativePath(\n this.commandsPath,\n joinPaths(this.entryPath, \"completions\", \"zsh\", \"command.ts\")\n )\n },\n isVirtual: false\n });\n }\n },\n async prepare() {\n this.debug(\n \"Rendering command handling modules for the Shell Shock `completions` plugin.\"\n );\n\n return render(\n this,\n <>\n <BashCompletionsCommand />\n <ZshCompletionsCommand />\n </>\n );\n }\n }\n ];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;AAgCA,MAAaM,UAGXC,UAAoC,EAAE,KACf;AACvB,QAAO,CACL;EACEC,MAAM;EACNC,SAAS;AACP,QAAKC,MACH,4EACD;AAED,UAAO,EACLC,aAAaJ,SACd;;EAEHK,iBAAiB;AACf,QAAKF,MACH,iEACD;AAED,QAAKG,WAAW,EAAE;AAClB,OAAI,KAAKA,OAAOC,MAAKC,UAASA,MAAMC,OAAO,cAAc,CACvD,MAAKC,KACH,gNACD;OAED,MAAKJ,OAAOK,KAAK;IACfF,IAAI;IACJR,MAAM;IACNW,OAAO,CAAC,aAAa;IACrBC,MAAM;IACNC,UAAU,CAAC,cAAc;IACzBC,OAAO;IACPC,aAAa,4DAA4DtB,YACvE,KACD,CAAA;IACDuB,OAAO,EACLC,MAAMtB,YAAU,KAAKuB,WAAW,eAAe,aAAY,EAC5D;IACDC,WAAW;IACZ,CAAC;AAGJ,OAAI,KAAKd,OAAOC,MAAKC,UAASA,MAAMC,OAAO,mBAAmB,CAC5D,MAAKC,KACH,0NACD;OAED,MAAKJ,OAAOK,KAAK;IACfF,IAAI;IACJR,MAAM;IACNW,OAAO,EAAE;IACTC,MAAM;IACNC,UAAU,CAAC,eAAe,OAAO;IACjCC,OAAO;IACPE,OAAO,EACLC,MAAMtB,YACJ,KAAKuB,WACL,eACA,QACA,aACF,EACD;IACDC,WAAW;IACZ,CAAC;AAGJ,OAAI,KAAKd,OAAOC,MAAKC,UAASA,MAAMC,OAAO,kBAAkB,CAC3D,MAAKC,KACH,wNACD;OAED,MAAKJ,OAAOK,KAAK;IACfF,IAAI;IACJR,MAAM;IACNW,OAAO,EAAE;IACTC,MAAM;IACNC,UAAU,CAAC,eAAe,MAAM;IAChCC,OAAO;IACPE,OAAO,EACLC,MAAMvB,aACJ,KAAK0B,cACLzB,YAAU,KAAKuB,WAAW,eAAe,OAAO,aAClD,CAAA,EACD;IACDC,WAAW;IACZ,CAAC;;EAGN,MAAME,UAAU;AACd,QAAKnB,MACH,+EACD;AAED,UAAOV,OACL,MAAI,CAAA8B,gBAED1B,wBAAsB,EAAA,CAAA,EAAA0B,gBACtBzB,uBAAqB,EAAA,CAAA,CAE1B,CAAC;;EAEJ,CACF;;AAGH,kBAAeC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["render","getAppTitle","relativePath","joinPaths","BashCompletionsCommand","FishCompletionsCommand","PowerShellCompletionsCommand","ZshCompletionsCommand","SHELL_TYPES","plugin","options","name","config","debug","completions","shells","configResolved","inputs","some","input","id","info","push","alias","path","segments","title","description","entry","file","entryPath","isVirtual","includes","commandsPath","prepare","_$createComponent"],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { relativePath } from \"@stryke/path\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport type { Plugin } from \"powerlines\";\nimport {\n BashCompletionsCommand,\n FishCompletionsCommand,\n PowerShellCompletionsCommand,\n ZshCompletionsCommand\n} from \"./components\";\nimport type {\n CompletionsPluginContext,\n CompletionsPluginOptions\n} from \"./types/plugin\";\nimport { SHELL_TYPES } from \"./types/shell-type\";\n\n/**\n * The Completions - Shell Shock plugin to add completion commands to a Shell Shock application.\n */\nexport const plugin = <\n TContext extends CompletionsPluginContext = CompletionsPluginContext\n>(\n options: CompletionsPluginOptions = {}\n): Plugin<TContext>[] => {\n return [\n {\n name: \"shell-shock:completions\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `completions` plugin.\"\n );\n\n return {\n completions: { shells: SHELL_TYPES, ...options }\n };\n },\n configResolved() {\n this.debug(\n \"Adding the CLI completion commands to the application context.\"\n );\n\n this.inputs ??= [];\n if (this.inputs.some(input => input.id === \"completions\")) {\n this.info(\n \"The `completions` command already exists in the commands list. If you would like the completions command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions\",\n name: \"completions\",\n alias: [\"completion\"],\n path: \"completions\",\n segments: [\"completions\"],\n title: \"CLI Completions\",\n description: `Commands for generating shell completion scripts for ${getAppTitle(\n this\n )}.`,\n entry: {\n file: joinPaths(this.entryPath, \"completions\", \"command.ts\")\n },\n isVirtual: true\n });\n }\n\n if (this.config.completions.shells.includes(\"bash\")) {\n if (this.inputs.some(input => input.id === \"completions-bash\")) {\n this.info(\n \"The `completions-bash` command already exists in the commands list. If you would like the completions-bash command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-bash\",\n name: \"bash\",\n description: `Generate a Bash completion script for the ${getAppTitle(\n this,\n true\n )} command-line interface.`,\n alias: [],\n path: \"completions/bash\",\n segments: [\"completions\", \"bash\"],\n title: \"CLI Completions - Bash Shell\",\n entry: {\n file: joinPaths(\n this.entryPath,\n \"completions\",\n \"bash\",\n \"command.ts\"\n )\n },\n isVirtual: false\n });\n }\n }\n\n if (this.config.completions.shells.includes(\"zsh\")) {\n if (this.inputs.some(input => input.id === \"completions-zsh\")) {\n this.info(\n \"The `completions-zsh` command already exists in the commands list. If you would like the completions-zsh command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-zsh\",\n name: \"zsh\",\n description: `Generate a Zsh completion script for the ${getAppTitle(\n this,\n true\n )} command-line interface.`,\n alias: [],\n path: \"completions/zsh\",\n segments: [\"completions\", \"zsh\"],\n title: \"CLI Completions - Zsh Shell\",\n entry: {\n file: relativePath(\n this.commandsPath,\n joinPaths(this.entryPath, \"completions\", \"zsh\", \"command.ts\")\n )\n },\n isVirtual: false\n });\n }\n }\n\n if (this.config.completions.shells.includes(\"powershell\")) {\n if (\n this.inputs.some(input => input.id === \"completions-powershell\")\n ) {\n this.info(\n \"The `completions-powershell` command already exists in the commands list. If you would like the completions-powershell command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-powershell\",\n name: \"powershell\",\n description: `Generate a PowerShell completion script for the ${getAppTitle(\n this,\n true\n )} command-line interface.`,\n alias: [],\n path: \"completions/powershell\",\n segments: [\"completions\", \"powershell\"],\n title: \"CLI Completions - PowerShell\",\n entry: {\n file: relativePath(\n this.commandsPath,\n joinPaths(\n this.entryPath,\n \"completions\",\n \"powershell\",\n \"command.ts\"\n )\n )\n },\n isVirtual: false\n });\n }\n }\n\n if (this.config.completions.shells.includes(\"fish\")) {\n if (this.inputs.some(input => input.id === \"completions-fish\")) {\n this.info(\n \"The `completions-fish` command already exists in the commands list. If you would like the completions-fish command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-fish\",\n name: \"fish\",\n description: `Generate a Fish completion script for the ${getAppTitle(\n this,\n true\n )} command-line interface.`,\n alias: [],\n path: \"completions/fish\",\n segments: [\"completions\", \"fish\"],\n title: \"CLI Completions - Fish Shell\",\n entry: {\n file: relativePath(\n this.commandsPath,\n joinPaths(this.entryPath, \"completions\", \"fish\", \"command.ts\")\n )\n },\n isVirtual: false\n });\n }\n }\n },\n async prepare() {\n this.debug(\n \"Rendering command handling modules for the Shell Shock `completions` plugin.\"\n );\n\n return render(\n this,\n <>\n <BashCompletionsCommand />\n <ZshCompletionsCommand />\n <PowerShellCompletionsCommand />\n <FishCompletionsCommand />\n </>\n );\n }\n }\n ];\n};\n\nexport default plugin;\n"],"mappings":"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"}
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { CompletionsPluginContext, CompletionsPluginOptions, CompletionsPluginResolvedConfig, CompletionsPluginUserConfig } from "./plugin.cjs";
|
|
2
1
|
import { SHELL_TYPES, ShellType } from "./shell-type.cjs";
|
|
2
|
+
import { CompletionsPluginContext, CompletionsPluginOptions, CompletionsPluginResolvedConfig, CompletionsPluginUserConfig } from "./plugin.cjs";
|
|
3
3
|
export { CompletionsPluginContext, CompletionsPluginOptions, CompletionsPluginResolvedConfig, CompletionsPluginUserConfig, SHELL_TYPES, ShellType };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { CompletionsPluginContext, CompletionsPluginOptions, CompletionsPluginResolvedConfig, CompletionsPluginUserConfig } from "./plugin.mjs";
|
|
2
1
|
import { SHELL_TYPES, ShellType } from "./shell-type.mjs";
|
|
2
|
+
import { CompletionsPluginContext, CompletionsPluginOptions, CompletionsPluginResolvedConfig, CompletionsPluginUserConfig } from "./plugin.mjs";
|
|
3
3
|
export { CompletionsPluginContext, CompletionsPluginOptions, CompletionsPluginResolvedConfig, CompletionsPluginUserConfig, SHELL_TYPES, ShellType };
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,19 +1,32 @@
|
|
|
1
|
+
import { ShellType } from "./shell-type.cjs";
|
|
1
2
|
import { ResolvedConfig, UserConfig } from "@shell-shock/core/types/config";
|
|
2
3
|
import { Context } from "@shell-shock/core/types/context";
|
|
3
4
|
|
|
4
5
|
//#region src/types/plugin.d.ts
|
|
5
|
-
interface CompletionsPluginOptions {
|
|
6
|
+
interface CompletionsPluginOptions {
|
|
7
|
+
/**
|
|
8
|
+
* The shell types to generate completion scripts for. If not specified, completions will be generated for all supported shell types.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* The currently supported shell types include:
|
|
12
|
+
* - `bash`
|
|
13
|
+
* - `fish`
|
|
14
|
+
* - `zsh`
|
|
15
|
+
* - `powershell`
|
|
16
|
+
*/
|
|
17
|
+
shells?: ShellType[];
|
|
18
|
+
}
|
|
6
19
|
type CompletionsPluginUserConfig = UserConfig & {
|
|
7
20
|
/**
|
|
8
21
|
* Resolved completions configuration for the plugin.
|
|
9
22
|
*/
|
|
10
|
-
completions: CompletionsPluginOptions
|
|
23
|
+
completions: Required<CompletionsPluginOptions>;
|
|
11
24
|
};
|
|
12
25
|
type CompletionsPluginResolvedConfig = ResolvedConfig & {
|
|
13
26
|
/**
|
|
14
27
|
* Resolved completions configuration for the plugin.
|
|
15
28
|
*/
|
|
16
|
-
completions: CompletionsPluginOptions
|
|
29
|
+
completions: Required<CompletionsPluginOptions>;
|
|
17
30
|
};
|
|
18
31
|
type CompletionsPluginContext<TResolvedConfig extends CompletionsPluginResolvedConfig = CompletionsPluginResolvedConfig> = Context<TResolvedConfig>;
|
|
19
32
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;UAyBiB,wBAAA;;AAAjB;AAcA;;;;;AAOA;;;EAIe,MAAA,CAAA,EAdJ,SAcI,EAAA;;AAGH,KAdA,2BAAA,GAA8B,UAcN,GAAA;EACV;;;EAEtB,WAAA,EAbW,QAaX,CAboB,wBAapB,CAAA;CAAO;KAVC,+BAAA,GAAkC;;;;eAI/B,SAAS;;KAGZ,iDACc,kCACtB,mCACA,QAAQ"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,19 +1,32 @@
|
|
|
1
|
+
import { ShellType } from "./shell-type.mjs";
|
|
1
2
|
import { ResolvedConfig, UserConfig } from "@shell-shock/core/types/config";
|
|
2
3
|
import { Context } from "@shell-shock/core/types/context";
|
|
3
4
|
|
|
4
5
|
//#region src/types/plugin.d.ts
|
|
5
|
-
interface CompletionsPluginOptions {
|
|
6
|
+
interface CompletionsPluginOptions {
|
|
7
|
+
/**
|
|
8
|
+
* The shell types to generate completion scripts for. If not specified, completions will be generated for all supported shell types.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* The currently supported shell types include:
|
|
12
|
+
* - `bash`
|
|
13
|
+
* - `fish`
|
|
14
|
+
* - `zsh`
|
|
15
|
+
* - `powershell`
|
|
16
|
+
*/
|
|
17
|
+
shells?: ShellType[];
|
|
18
|
+
}
|
|
6
19
|
type CompletionsPluginUserConfig = UserConfig & {
|
|
7
20
|
/**
|
|
8
21
|
* Resolved completions configuration for the plugin.
|
|
9
22
|
*/
|
|
10
|
-
completions: CompletionsPluginOptions
|
|
23
|
+
completions: Required<CompletionsPluginOptions>;
|
|
11
24
|
};
|
|
12
25
|
type CompletionsPluginResolvedConfig = ResolvedConfig & {
|
|
13
26
|
/**
|
|
14
27
|
* Resolved completions configuration for the plugin.
|
|
15
28
|
*/
|
|
16
|
-
completions: CompletionsPluginOptions
|
|
29
|
+
completions: Required<CompletionsPluginOptions>;
|
|
17
30
|
};
|
|
18
31
|
type CompletionsPluginContext<TResolvedConfig extends CompletionsPluginResolvedConfig = CompletionsPluginResolvedConfig> = Context<TResolvedConfig>;
|
|
19
32
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;UAyBiB,wBAAA;;AAAjB;AAcA;;;;;AAOA;;;EAIe,MAAA,CAAA,EAdJ,SAcI,EAAA;;AAGH,KAdA,2BAAA,GAA8B,UAcN,GAAA;EACV;;;EAEtB,WAAA,EAbW,QAaX,CAboB,wBAapB,CAAA;CAAO;KAVC,+BAAA,GAAkC;;;;eAI/B,SAAS;;KAGZ,iDACc,kCACtB,mCACA,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell-type.mjs","names":["SHELL_TYPES"],"sources":["../../src/types/shell-type.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport type ShellType = \"bash\" | \"zsh\";\n\nexport const SHELL_TYPES: readonly ShellType[] = [\"bash\"
|
|
1
|
+
{"version":3,"file":"shell-type.mjs","names":["SHELL_TYPES"],"sources":["../../src/types/shell-type.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nexport type ShellType = \"bash\" | \"fish\" | \"zsh\" | \"powershell\";\n\nexport const SHELL_TYPES: readonly ShellType[] = [\n \"bash\",\n \"fish\",\n \"zsh\",\n \"powershell\"\n] as const;\n"],"mappings":";AAoBA,MAAaA,cAAoC;CAC/C;CACA;CACA;CACA;CACQ"}
|