@shell-shock/plugin-completions 0.2.22 → 0.2.24
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/README.md +1 -1
- package/dist/components/bash-command.cjs +21 -18
- package/dist/components/bash-command.mjs +23 -20
- package/dist/components/bash-command.mjs.map +1 -1
- package/dist/components/fish-command.cjs +80 -76
- package/dist/components/fish-command.mjs +82 -78
- package/dist/components/fish-command.mjs.map +1 -1
- package/dist/components/powershell-command.cjs +45 -39
- package/dist/components/powershell-command.d.cts.map +1 -1
- package/dist/components/powershell-command.d.mts.map +1 -1
- package/dist/components/powershell-command.mjs +47 -41
- package/dist/components/powershell-command.mjs.map +1 -1
- package/dist/components/zsh-command.cjs +80 -77
- package/dist/components/zsh-command.mjs +82 -79
- package/dist/components/zsh-command.mjs.map +1 -1
- package/dist/helpers/complete-command.cjs +2 -7
- package/dist/helpers/complete-command.d.cts +2 -2
- package/dist/helpers/complete-command.d.cts.map +1 -1
- package/dist/helpers/complete-command.d.mts +2 -2
- package/dist/helpers/complete-command.d.mts.map +1 -1
- package/dist/helpers/complete-command.mjs +2 -7
- package/dist/helpers/complete-command.mjs.map +1 -1
- package/dist/helpers/index.cjs +1 -1
- package/dist/helpers/index.d.cts +2 -2
- package/dist/helpers/index.d.mts +2 -2
- package/dist/helpers/index.mjs +2 -2
- package/dist/index.cjs +37 -15
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +38 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -4
package/dist/index.cjs
CHANGED
|
@@ -8,7 +8,6 @@ const require_types_shell_type = require('./types/shell-type.cjs');
|
|
|
8
8
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
9
9
|
let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
|
|
10
10
|
let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
11
|
-
let _stryke_path = require("@stryke/path");
|
|
12
11
|
let _stryke_path_join = require("@stryke/path/join");
|
|
13
12
|
|
|
14
13
|
//#region src/index.tsx
|
|
@@ -21,7 +20,7 @@ const plugin = (options = {}) => {
|
|
|
21
20
|
config() {
|
|
22
21
|
this.debug("Providing default configuration for the Shell Shock `completions` plugin.");
|
|
23
22
|
return { completions: {
|
|
24
|
-
shells: require_types_shell_type.SHELL_TYPES,
|
|
23
|
+
shells: [...require_types_shell_type.SHELL_TYPES],
|
|
25
24
|
...options
|
|
26
25
|
} };
|
|
27
26
|
},
|
|
@@ -36,8 +35,12 @@ const plugin = (options = {}) => {
|
|
|
36
35
|
path: "completions",
|
|
37
36
|
segments: ["completions"],
|
|
38
37
|
title: "CLI Completions",
|
|
38
|
+
tags: ["Utility"],
|
|
39
39
|
description: `Commands for generating shell completion scripts for ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this)}.`,
|
|
40
|
-
entry: {
|
|
40
|
+
entry: {
|
|
41
|
+
file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "index.ts"),
|
|
42
|
+
input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "command.ts") }
|
|
43
|
+
},
|
|
41
44
|
isVirtual: true
|
|
42
45
|
});
|
|
43
46
|
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.");
|
|
@@ -49,7 +52,11 @@ const plugin = (options = {}) => {
|
|
|
49
52
|
path: "completions/bash",
|
|
50
53
|
segments: ["completions", "bash"],
|
|
51
54
|
title: "CLI Completions - Bash Shell",
|
|
52
|
-
|
|
55
|
+
tags: ["Utility"],
|
|
56
|
+
entry: {
|
|
57
|
+
file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "bash", "index.ts"),
|
|
58
|
+
input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "bash", "command.ts") }
|
|
59
|
+
},
|
|
53
60
|
isVirtual: false
|
|
54
61
|
});
|
|
55
62
|
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.");
|
|
@@ -61,7 +68,11 @@ const plugin = (options = {}) => {
|
|
|
61
68
|
path: "completions/zsh",
|
|
62
69
|
segments: ["completions", "zsh"],
|
|
63
70
|
title: "CLI Completions - Zsh Shell",
|
|
64
|
-
|
|
71
|
+
tags: ["Utility"],
|
|
72
|
+
entry: {
|
|
73
|
+
file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "zsh", "index.ts"),
|
|
74
|
+
input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "zsh", "command.ts") }
|
|
75
|
+
},
|
|
65
76
|
isVirtual: false
|
|
66
77
|
});
|
|
67
78
|
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.");
|
|
@@ -73,7 +84,11 @@ const plugin = (options = {}) => {
|
|
|
73
84
|
path: "completions/powershell",
|
|
74
85
|
segments: ["completions", "powershell"],
|
|
75
86
|
title: "CLI Completions - PowerShell",
|
|
76
|
-
|
|
87
|
+
tags: ["Utility"],
|
|
88
|
+
entry: {
|
|
89
|
+
file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "powershell", "index.ts"),
|
|
90
|
+
input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "powershell", "command.ts") }
|
|
91
|
+
},
|
|
77
92
|
isVirtual: false
|
|
78
93
|
});
|
|
79
94
|
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.");
|
|
@@ -85,18 +100,25 @@ const plugin = (options = {}) => {
|
|
|
85
100
|
path: "completions/fish",
|
|
86
101
|
segments: ["completions", "fish"],
|
|
87
102
|
title: "CLI Completions - Fish Shell",
|
|
88
|
-
|
|
103
|
+
tags: ["Utility"],
|
|
104
|
+
entry: {
|
|
105
|
+
file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "fish", "index.ts"),
|
|
106
|
+
input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "completions", "fish", "command.ts") }
|
|
107
|
+
},
|
|
89
108
|
isVirtual: false
|
|
90
109
|
});
|
|
91
110
|
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
(
|
|
96
|
-
(0,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
111
|
+
prepare: {
|
|
112
|
+
order: "pre",
|
|
113
|
+
async handler() {
|
|
114
|
+
this.debug("Rendering command handling modules for the Shell Shock `completions` plugin.");
|
|
115
|
+
return (0, _powerlines_plugin_alloy_render.render)(this, [
|
|
116
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_bash_command.BashCompletionsCommand, {}),
|
|
117
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_zsh_command.ZshCompletionsCommand, {}),
|
|
118
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_powershell_command.PowerShellCompletionsCommand, {}),
|
|
119
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_fish_command.FishCompletionsCommand, {})
|
|
120
|
+
]);
|
|
121
|
+
}
|
|
100
122
|
}
|
|
101
123
|
}];
|
|
102
124
|
};
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;;cAuCa,MAAA,oBACM,wBAAA,GAA2B,wBAAA,EAE5C,OAAA,GAAS,wBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;;cAuCa,MAAA,oBACM,wBAAA,GAA2B,wBAAA,EAE5C,OAAA,GAAS,wBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -7,8 +7,7 @@ import { SHELL_TYPES } from "./types/shell-type.mjs";
|
|
|
7
7
|
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
8
8
|
import { render } from "@powerlines/plugin-alloy/render";
|
|
9
9
|
import { getAppTitle } from "@shell-shock/core/plugin-utils";
|
|
10
|
-
import {
|
|
11
|
-
import { joinPaths as joinPaths$1 } from "@stryke/path/join";
|
|
10
|
+
import { joinPaths } from "@stryke/path/join";
|
|
12
11
|
|
|
13
12
|
//#region src/index.tsx
|
|
14
13
|
/**
|
|
@@ -20,7 +19,7 @@ const plugin = (options = {}) => {
|
|
|
20
19
|
config() {
|
|
21
20
|
this.debug("Providing default configuration for the Shell Shock `completions` plugin.");
|
|
22
21
|
return { completions: {
|
|
23
|
-
shells: SHELL_TYPES,
|
|
22
|
+
shells: [...SHELL_TYPES],
|
|
24
23
|
...options
|
|
25
24
|
} };
|
|
26
25
|
},
|
|
@@ -35,8 +34,12 @@ const plugin = (options = {}) => {
|
|
|
35
34
|
path: "completions",
|
|
36
35
|
segments: ["completions"],
|
|
37
36
|
title: "CLI Completions",
|
|
37
|
+
tags: ["Utility"],
|
|
38
38
|
description: `Commands for generating shell completion scripts for ${getAppTitle(this)}.`,
|
|
39
|
-
entry: {
|
|
39
|
+
entry: {
|
|
40
|
+
file: joinPaths(this.entryPath, "completions", "index.ts"),
|
|
41
|
+
input: { file: joinPaths(this.entryPath, "completions", "command.ts") }
|
|
42
|
+
},
|
|
40
43
|
isVirtual: true
|
|
41
44
|
});
|
|
42
45
|
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.");
|
|
@@ -48,7 +51,11 @@ const plugin = (options = {}) => {
|
|
|
48
51
|
path: "completions/bash",
|
|
49
52
|
segments: ["completions", "bash"],
|
|
50
53
|
title: "CLI Completions - Bash Shell",
|
|
51
|
-
|
|
54
|
+
tags: ["Utility"],
|
|
55
|
+
entry: {
|
|
56
|
+
file: joinPaths(this.entryPath, "completions", "bash", "index.ts"),
|
|
57
|
+
input: { file: joinPaths(this.entryPath, "completions", "bash", "command.ts") }
|
|
58
|
+
},
|
|
52
59
|
isVirtual: false
|
|
53
60
|
});
|
|
54
61
|
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.");
|
|
@@ -60,7 +67,11 @@ const plugin = (options = {}) => {
|
|
|
60
67
|
path: "completions/zsh",
|
|
61
68
|
segments: ["completions", "zsh"],
|
|
62
69
|
title: "CLI Completions - Zsh Shell",
|
|
63
|
-
|
|
70
|
+
tags: ["Utility"],
|
|
71
|
+
entry: {
|
|
72
|
+
file: joinPaths(this.entryPath, "completions", "zsh", "index.ts"),
|
|
73
|
+
input: { file: joinPaths(this.entryPath, "completions", "zsh", "command.ts") }
|
|
74
|
+
},
|
|
64
75
|
isVirtual: false
|
|
65
76
|
});
|
|
66
77
|
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.");
|
|
@@ -72,7 +83,11 @@ const plugin = (options = {}) => {
|
|
|
72
83
|
path: "completions/powershell",
|
|
73
84
|
segments: ["completions", "powershell"],
|
|
74
85
|
title: "CLI Completions - PowerShell",
|
|
75
|
-
|
|
86
|
+
tags: ["Utility"],
|
|
87
|
+
entry: {
|
|
88
|
+
file: joinPaths(this.entryPath, "completions", "powershell", "index.ts"),
|
|
89
|
+
input: { file: joinPaths(this.entryPath, "completions", "powershell", "command.ts") }
|
|
90
|
+
},
|
|
76
91
|
isVirtual: false
|
|
77
92
|
});
|
|
78
93
|
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.");
|
|
@@ -84,18 +99,25 @@ const plugin = (options = {}) => {
|
|
|
84
99
|
path: "completions/fish",
|
|
85
100
|
segments: ["completions", "fish"],
|
|
86
101
|
title: "CLI Completions - Fish Shell",
|
|
87
|
-
|
|
102
|
+
tags: ["Utility"],
|
|
103
|
+
entry: {
|
|
104
|
+
file: joinPaths(this.entryPath, "completions", "fish", "index.ts"),
|
|
105
|
+
input: { file: joinPaths(this.entryPath, "completions", "fish", "command.ts") }
|
|
106
|
+
},
|
|
88
107
|
isVirtual: false
|
|
89
108
|
});
|
|
90
109
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
110
|
+
prepare: {
|
|
111
|
+
order: "pre",
|
|
112
|
+
async handler() {
|
|
113
|
+
this.debug("Rendering command handling modules for the Shell Shock `completions` plugin.");
|
|
114
|
+
return render(this, [
|
|
115
|
+
createComponent(BashCompletionsCommand, {}),
|
|
116
|
+
createComponent(ZshCompletionsCommand, {}),
|
|
117
|
+
createComponent(PowerShellCompletionsCommand, {}),
|
|
118
|
+
createComponent(FishCompletionsCommand, {})
|
|
119
|
+
]);
|
|
120
|
+
}
|
|
99
121
|
}
|
|
100
122
|
}];
|
|
101
123
|
};
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { relativePath } from \"@stryke/path\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport type { Plugin } from \"powerlines\";\nimport {\n BashCompletionsCommand,\n FishCompletionsCommand,\n PowerShellCompletionsCommand,\n ZshCompletionsCommand\n} from \"./components\";\nimport type {\n CompletionsPluginContext,\n CompletionsPluginOptions\n} from \"./types/plugin\";\nimport { SHELL_TYPES } from \"./types/shell-type\";\n\nexport type * from \"./types\";\n\n/**\n * The Completions - Shell Shock plugin to add completion commands to a Shell Shock application.\n */\nexport const plugin = <\n TContext extends CompletionsPluginContext = CompletionsPluginContext\n>(\n options: CompletionsPluginOptions = {}\n): Plugin<TContext>[] => {\n return [\n {\n name: \"shell-shock:completions\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `completions` plugin.\"\n );\n\n return {\n completions: { shells: SHELL_TYPES, ...options }\n };\n },\n configResolved() {\n this.debug(\n \"Adding the CLI completion commands to the application context.\"\n );\n\n this.inputs ??= [];\n if (this.inputs.some(input => input.id === \"completions\")) {\n this.info(\n \"The `completions` command already exists in the commands list. If you would like the completions command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions\",\n name: \"completions\",\n alias: [\"completion\"],\n path: \"completions\",\n segments: [\"completions\"],\n title: \"CLI Completions\",\n description: `Commands for generating shell completion scripts for ${getAppTitle(\n this\n )}.`,\n entry: {\n file: joinPaths(this.entryPath, \"completions\", \"command.ts\")\n },\n isVirtual: true\n });\n }\n\n if (this.config.completions.shells.includes(\"bash\")) {\n if (this.inputs.some(input => input.id === \"completions-bash\")) {\n this.info(\n \"The `completions-bash` command already exists in the commands list. If you would like the completions-bash command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-bash\",\n name: \"bash\",\n description: `Generate a Bash completion script for the ${getAppTitle(\n this,\n true\n )} command-line interface.`,\n alias: [],\n path: \"completions/bash\",\n segments: [\"completions\", \"bash\"],\n title: \"CLI Completions - Bash Shell\",\n entry: {\n file: joinPaths(\n this.entryPath,\n \"completions\",\n \"bash\",\n \"command.ts\"\n )\n },\n isVirtual: false\n });\n }\n }\n\n if (this.config.completions.shells.includes(\"zsh\")) {\n if (this.inputs.some(input => input.id === \"completions-zsh\")) {\n this.info(\n \"The `completions-zsh` command already exists in the commands list. If you would like the completions-zsh command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-zsh\",\n name: \"zsh\",\n description: `Generate a Zsh completion script for the ${getAppTitle(\n this,\n true\n )} command-line interface.`,\n alias: [],\n path: \"completions/zsh\",\n segments: [\"completions\", \"zsh\"],\n title: \"CLI Completions - Zsh Shell\",\n entry: {\n file: relativePath(\n this.commandsPath,\n joinPaths(this.entryPath, \"completions\", \"zsh\", \"command.ts\")\n )\n },\n isVirtual: false\n });\n }\n }\n\n if (this.config.completions.shells.includes(\"powershell\")) {\n if (\n this.inputs.some(input => input.id === \"completions-powershell\")\n ) {\n this.info(\n \"The `completions-powershell` command already exists in the commands list. If you would like the completions-powershell command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-powershell\",\n name: \"powershell\",\n description: `Generate a PowerShell completion script for the ${getAppTitle(\n this,\n true\n )} command-line interface.`,\n alias: [],\n path: \"completions/powershell\",\n segments: [\"completions\", \"powershell\"],\n title: \"CLI Completions - PowerShell\",\n entry: {\n file: relativePath(\n this.commandsPath,\n joinPaths(\n this.entryPath,\n \"completions\",\n \"powershell\",\n \"command.ts\"\n )\n )\n },\n isVirtual: false\n });\n }\n }\n\n if (this.config.completions.shells.includes(\"fish\")) {\n if (this.inputs.some(input => input.id === \"completions-fish\")) {\n this.info(\n \"The `completions-fish` command already exists in the commands list. If you would like the completions-fish command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions-fish\",\n name: \"fish\",\n description: `Generate a Fish completion script for the ${getAppTitle(\n this,\n true\n )} command-line interface.`,\n alias: [],\n path: \"completions/fish\",\n segments: [\"completions\", \"fish\"],\n title: \"CLI Completions - Fish Shell\",\n entry: {\n file: relativePath(\n this.commandsPath,\n joinPaths(this.entryPath, \"completions\", \"fish\", \"command.ts\")\n )\n },\n isVirtual: false\n });\n }\n }\n },\n async prepare() {\n this.debug(\n \"Rendering command handling modules for the Shell Shock `completions` plugin.\"\n );\n\n return render(\n this,\n <>\n <BashCompletionsCommand />\n <ZshCompletionsCommand />\n <PowerShellCompletionsCommand />\n <FishCompletionsCommand />\n </>\n );\n }\n }\n ];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;AAgCA,MAAU,UAAa,UAAA,EAAA,KAAA;AACvB,QAAS,CAAA;;EAET,SAAa;;AAEX,UAAA,EACK,aAAc;IACnB,QAAA;IACK,GAAM;IACX,EACD;;EAEE,iBAAkB;AACnB,QAAO,MAAA,iEAAA;AACL,QAAA,WAAA,EAAA;AACE,OAAI,KAAG,OAAM,MAAM,UAAW,MAAC,OAAA,cAA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AA,aAAA;IACF,OAAA;aAEI,MAAK,aAAO,KAAY,cAAgB,YAAQ,KAAA,WAAA,eAAA,cAAA,aAAA,CAAA,EAC/C;IACD,WAAS;IACV,CAAC;AAGN,OAAI,KAAE,OAAK,YAAY,OAAA,SAAA,OAAA,CACrB,KAAI,KAAK,OAAE,MAAA,UAAgB,MAAA,OAAA,mBAAA,CACzB,MAAI,KAAM,0NAAK;OAEf,MAAK,OAAK,KAAA;IACR,IAAI;IACJ,MAAK;IACL,aAAW,6CAAA,YAAA,MAAA,KAAA,CAAA;IACX,OAAO,EAAE;IACT,MAAE;IACF,UAAU,CAAA,eAAgB,OAAM;IAChC,OAAO;IACP,OAAI,EACF,MAAI,aAAK,KAAY,cAAA,YAAA,KAAA,WAAA,eAAA,QAAA,aAAA,CAAA,EACtB;IACD,WAAI;IACL,CAAC;;EAIR,MAAI,UAAA;;AAEF,UAAM,OAAK,MAAO;IAAA,gBAAmB,wBAAwB,EAAA,CAAA;IAAA,gBAAA,uBAAA,EAAA,CAAA;IAAA,gBAAA,8BAAA,EAAA,CAAA;IAAA,gBAAA,wBAAA,EAAA,CAAA;IAAA,CAAA;;EAEhE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport type { Plugin } from \"powerlines\";\nimport {\n BashCompletionsCommand,\n FishCompletionsCommand,\n PowerShellCompletionsCommand,\n ZshCompletionsCommand\n} from \"./components\";\nimport type {\n CompletionsPluginContext,\n CompletionsPluginOptions\n} from \"./types/plugin\";\nimport { SHELL_TYPES } from \"./types/shell-type\";\n\nexport type * from \"./types\";\n\n/**\n * The Completions - Shell Shock plugin to add completion commands to a Shell Shock application.\n */\nexport const plugin = <\n TContext extends CompletionsPluginContext = CompletionsPluginContext\n>(\n options: CompletionsPluginOptions = {}\n): Plugin<TContext>[] => {\n return [\n {\n name: \"shell-shock:completions\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `completions` plugin.\"\n );\n\n return {\n completions: { shells: [...SHELL_TYPES], ...options }\n };\n },\n configResolved() {\n this.debug(\n \"Adding the CLI completion commands to the application context.\"\n );\n\n this.inputs ??= [];\n if (this.inputs.some(input => input.id === \"completions\")) {\n this.info(\n \"The `completions` command already exists in the commands list. If you would like the completions command to be managed by the `@shell-shock/plugin-completions` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: \"completions\",\n name: \"completions\",\n alias: [\"completion\"],\n path: \"completions\",\n segments: [\"completions\"],\n title: \"CLI Completions\",\n tags: [\"Utility\"],\n description: `Commands for generating shell completion scripts for ${getAppTitle(\n this\n )}.`,\n entry: {\n file: joinPaths(this.entryPath, \"completions\", \"index.ts\"),\n input: {\n file: joinPaths(this.entryPath, \"completions\", \"command.ts\")\n }\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 tags: [\"Utility\"],\n entry: {\n file: joinPaths(\n this.entryPath,\n \"completions\",\n \"bash\",\n \"index.ts\"\n ),\n input: {\n file: joinPaths(\n this.entryPath,\n \"completions\",\n \"bash\",\n \"command.ts\"\n )\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 tags: [\"Utility\"],\n entry: {\n file: joinPaths(\n this.entryPath,\n \"completions\",\n \"zsh\",\n \"index.ts\"\n ),\n input: {\n file: joinPaths(\n this.entryPath,\n \"completions\",\n \"zsh\",\n \"command.ts\"\n )\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 tags: [\"Utility\"],\n entry: {\n file: joinPaths(\n this.entryPath,\n \"completions\",\n \"powershell\",\n \"index.ts\"\n ),\n input: {\n file: 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 tags: [\"Utility\"],\n entry: {\n file: joinPaths(\n this.entryPath,\n \"completions\",\n \"fish\",\n \"index.ts\"\n ),\n input: {\n file: joinPaths(\n this.entryPath,\n \"completions\",\n \"fish\",\n \"command.ts\"\n )\n }\n },\n isVirtual: false\n });\n }\n }\n },\n prepare: {\n order: \"pre\",\n async handler() {\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};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;AA+BA,MAAU,UAAa,UAAA,EAAA,KAAA;AACvB,QAAS,CAAA;;EAET,SAAa;;AAEX,UAAA,EACK,aAAc;IACnB,QAAA,CAAA,GAAA,YAAA;IACK,GAAM;IACX,EACD;;EAEE,iBAAkB;AACnB,QAAO,MAAA,iEAAA;AACL,QAAA,WAAA,EAAA;AACE,OAAI,KAAG,OAAM,MAAM,UAAW,MAAC,OAAA,cAAA,CAC/B,MAAO,KAAE,gNAAA;OAEP,MAAG,OAAS,KAAC;IACZ,IAAA;;IAED,OAAO,CAAA,aAAA;IACL,MAAA;IACD,UAAA,CAAA,cAAA;IACF,OAAA;IACD,MAAA,CAAA,UAAiB;IACf,aAAU,wDAAA,YAAA,KAAA,CAAA;IACR,OAAO;KACR,MAAA,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AAA,CAAA;IACJ,OAAG,EAAA;IACH,MAAE;IACF,UAAE,CAAA,eAAA,aAAA;IACJ,OAAA;IACF,MAAA,CAAA,UAAA;;KAEI,MAAK,UAAO,KAAW,WAAQ,eAAiB,cAAA,WAAA;KAC9C,OAAK,EACH,MAAK,UAAA,KAAA,WAAA,eAAA,cAAA,aAAA,EACN;KACF;IACD,WAAK;IACN,CAAC;AAGN,OAAI,KAAI,OAAA,YAAc,OAAW,SAAI,OAAW,CAC9C,KAAI,KAAI,OAAI,MAAA,UAAA,MAAA,OAAA,mBAAA,CACV,MAAK,KAAC,0NAAA;OAEN,MAAI,OAAQ,KAAC;IACX,IAAE;IACF,MAAE;IACF,aAAa,6CAAyB,YAAA,MAAA,KAAA,CAAA;IACtC,OAAO,EAAE;IACT,MAAE;IACF,UAAU,CAAA,eAAS,OAAA;IACnB,OAAM;IACN,MAAM,CAAC,UAAA;IACP,OAAO;KACL,MAAK,UAAQ,KAAA,WAAA,eAAA,QAAA,WAAA;KACb,OAAG,EACD,MAAM,UAAC,KAAA,WAAA,eAAA,QAAA,aAAA,EACR;KACF;IACD,WAAS;IACV,CAAC;;EAIR,SAAS;GACP,OAAO;GACP,MAAM,UAAE;AACN,SAAE,MAAA,+EAAA;AACF,WAAA,OAAA,MAAA;KAAA,gBAAA,wBAAA,EAAA,CAAA;KAAA,gBAAA,uBAAA,EAAA,CAAA;KAAA,gBAAA,8BAAA,EAAA,CAAA;KAAA,gBAAA,wBAAA,EAAA,CAAA;KAAA,CAAA;;GAEH;EACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shell-shock/plugin-completions",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.24",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Shell Shock plugin to generate source code given a list design tokens.",
|
|
6
6
|
"repository": {
|
|
@@ -215,7 +215,6 @@
|
|
|
215
215
|
"typings": "dist/index.d.mts",
|
|
216
216
|
"files": ["dist/**/*"],
|
|
217
217
|
"keywords": [
|
|
218
|
-
"style-dictionary",
|
|
219
218
|
"shell-shock",
|
|
220
219
|
"shell-shock-plugin",
|
|
221
220
|
"powerlines",
|
|
@@ -227,7 +226,7 @@
|
|
|
227
226
|
"@powerlines/deepkit": "^0.6.162",
|
|
228
227
|
"@powerlines/plugin-alloy": "^0.25.70",
|
|
229
228
|
"@powerlines/plugin-plugin": "^0.12.334",
|
|
230
|
-
"@shell-shock/core": "^0.14.
|
|
229
|
+
"@shell-shock/core": "^0.14.3",
|
|
231
230
|
"@stryke/path": "^0.27.3",
|
|
232
231
|
"@stryke/string-format": "^0.17.7",
|
|
233
232
|
"powerlines": "^0.42.24"
|
|
@@ -251,5 +250,5 @@
|
|
|
251
250
|
"./package.json": "./package.json"
|
|
252
251
|
}
|
|
253
252
|
},
|
|
254
|
-
"gitHead": "
|
|
253
|
+
"gitHead": "27a9e457bd50dd3576a1edf1882f43d82a402743"
|
|
255
254
|
}
|