devports 0.0.1 → 1.0.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/CHANGELOG.md +87 -0
- package/LICENSE +21 -0
- package/README.md +810 -29
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +329 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/allocate.command.d.ts +8 -0
- package/dist/commands/allocate.command.d.ts.map +1 -0
- package/dist/commands/allocate.command.js +84 -0
- package/dist/commands/allocate.command.js.map +1 -0
- package/dist/commands/base-command.d.ts +28 -0
- package/dist/commands/base-command.d.ts.map +1 -0
- package/dist/commands/base-command.js +33 -0
- package/dist/commands/base-command.js.map +1 -0
- package/dist/commands/check.command.d.ts +7 -0
- package/dist/commands/check.command.d.ts.map +1 -0
- package/dist/commands/check.command.js +44 -0
- package/dist/commands/check.command.js.map +1 -0
- package/dist/commands/completion.command.d.ts +7 -0
- package/dist/commands/completion.command.d.ts.map +1 -0
- package/dist/commands/completion.command.js +116 -0
- package/dist/commands/completion.command.js.map +1 -0
- package/dist/commands/gitignore.command.d.ts +7 -0
- package/dist/commands/gitignore.command.d.ts.map +1 -0
- package/dist/commands/gitignore.command.js +61 -0
- package/dist/commands/gitignore.command.js.map +1 -0
- package/dist/commands/index.d.ts +7 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +35 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/info.command.d.ts +7 -0
- package/dist/commands/info.command.d.ts.map +1 -0
- package/dist/commands/info.command.js +40 -0
- package/dist/commands/info.command.js.map +1 -0
- package/dist/commands/list.command.d.ts +8 -0
- package/dist/commands/list.command.d.ts.map +1 -0
- package/dist/commands/list.command.js +165 -0
- package/dist/commands/list.command.js.map +1 -0
- package/dist/commands/release.command.d.ts +8 -0
- package/dist/commands/release.command.d.ts.map +1 -0
- package/dist/commands/release.command.js +89 -0
- package/dist/commands/release.command.js.map +1 -0
- package/dist/commands/render.command.d.ts +7 -0
- package/dist/commands/render.command.d.ts.map +1 -0
- package/dist/commands/render.command.js +53 -0
- package/dist/commands/render.command.js.map +1 -0
- package/dist/commands/reserve.command.d.ts +7 -0
- package/dist/commands/reserve.command.d.ts.map +1 -0
- package/dist/commands/reserve.command.js +42 -0
- package/dist/commands/reserve.command.js.map +1 -0
- package/dist/commands/setup.command.d.ts +7 -0
- package/dist/commands/setup.command.d.ts.map +1 -0
- package/dist/commands/setup.command.js +43 -0
- package/dist/commands/setup.command.js.map +1 -0
- package/dist/commands/status.command.d.ts +7 -0
- package/dist/commands/status.command.d.ts.map +1 -0
- package/dist/commands/status.command.js +41 -0
- package/dist/commands/status.command.js.map +1 -0
- package/dist/commands/unreserve.command.d.ts +7 -0
- package/dist/commands/unreserve.command.d.ts.map +1 -0
- package/dist/commands/unreserve.command.js +38 -0
- package/dist/commands/unreserve.command.js.map +1 -0
- package/dist/commands/worktree-add.command.d.ts +7 -0
- package/dist/commands/worktree-add.command.d.ts.map +1 -0
- package/dist/commands/worktree-add.command.js +68 -0
- package/dist/commands/worktree-add.command.js.map +1 -0
- package/dist/commands/worktree-remove.command.d.ts +7 -0
- package/dist/commands/worktree-remove.command.d.ts.map +1 -0
- package/dist/commands/worktree-remove.command.js +33 -0
- package/dist/commands/worktree-remove.command.js.map +1 -0
- package/dist/completion/bash-completion-template.d.ts +5 -0
- package/dist/completion/bash-completion-template.d.ts.map +1 -0
- package/dist/completion/bash-completion-template.js +14 -0
- package/dist/completion/bash-completion-template.js.map +1 -0
- package/dist/completion/bash.sh +208 -0
- package/dist/completion/completion-data.d.ts +16 -0
- package/dist/completion/completion-data.d.ts.map +1 -0
- package/dist/completion/completion-data.js +38 -0
- package/dist/completion/completion-data.js.map +1 -0
- package/dist/completion/index.d.ts +24 -0
- package/dist/completion/index.d.ts.map +1 -0
- package/dist/completion/index.js +30 -0
- package/dist/completion/index.js.map +1 -0
- package/dist/completion/shell-config.d.ts +27 -0
- package/dist/completion/shell-config.d.ts.map +1 -0
- package/dist/completion/shell-config.js +243 -0
- package/dist/completion/shell-config.js.map +1 -0
- package/dist/completion/zsh-completion-template.d.ts +5 -0
- package/dist/completion/zsh-completion-template.d.ts.map +1 -0
- package/dist/completion/zsh-completion-template.js +14 -0
- package/dist/completion/zsh-completion-template.js.map +1 -0
- package/dist/completion/zsh.sh +164 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +111 -0
- package/dist/config.js.map +1 -0
- package/dist/devports-1.0.1.tgz +0 -0
- package/dist/execution.d.ts +31 -0
- package/dist/execution.d.ts.map +1 -0
- package/dist/execution.js +110 -0
- package/dist/execution.js.map +1 -0
- package/dist/gitignore.d.ts +22 -0
- package/dist/gitignore.d.ts.map +1 -0
- package/dist/gitignore.js +142 -0
- package/dist/gitignore.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/port-manager.d.ts +33 -0
- package/dist/port-manager.d.ts.map +1 -0
- package/dist/port-manager.js +169 -0
- package/dist/port-manager.js.map +1 -0
- package/dist/port-utils.d.ts +9 -0
- package/dist/port-utils.d.ts.map +1 -0
- package/dist/port-utils.js +38 -0
- package/dist/port-utils.js.map +1 -0
- package/dist/render.d.ts +54 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +286 -0
- package/dist/render.js.map +1 -0
- package/dist/services/lock-manager.d.ts +46 -0
- package/dist/services/lock-manager.d.ts.map +1 -0
- package/dist/services/lock-manager.js +118 -0
- package/dist/services/lock-manager.js.map +1 -0
- package/dist/services/response-formatter.d.ts +45 -0
- package/dist/services/response-formatter.d.ts.map +1 -0
- package/dist/services/response-formatter.js +102 -0
- package/dist/services/response-formatter.js.map +1 -0
- package/dist/services/validation-service.d.ts +109 -0
- package/dist/services/validation-service.d.ts.map +1 -0
- package/dist/services/validation-service.js +267 -0
- package/dist/services/validation-service.js.map +1 -0
- package/dist/setup.d.ts +20 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +245 -0
- package/dist/setup.js.map +1 -0
- package/dist/types.d.ts +29 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +18 -0
- package/dist/types.js.map +1 -0
- package/dist/validation.d.ts +69 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +344 -0
- package/dist/validation.js.map +1 -0
- package/dist/worktree.d.ts +24 -0
- package/dist/worktree.d.ts.map +1 -0
- package/dist/worktree.js +245 -0
- package/dist/worktree.js.map +1 -0
- package/package.json +90 -6
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# devports completion for bash
|
|
3
|
+
|
|
4
|
+
_devports_completion() {
|
|
5
|
+
local cur prev words cword
|
|
6
|
+
_init_completion || return
|
|
7
|
+
|
|
8
|
+
case $cword in
|
|
9
|
+
1)
|
|
10
|
+
COMPREPLY=( $(compgen -W "allocate release list status check reserve unreserve info render gitignore setup worktree completion" -- "$cur") )
|
|
11
|
+
;;
|
|
12
|
+
2)
|
|
13
|
+
case $prev in
|
|
14
|
+
allocate)
|
|
15
|
+
if [[ "$cur" != -* ]]; then
|
|
16
|
+
# Complete with project names
|
|
17
|
+
local projects=$(devports allocate --completion projects 2>/dev/null | tr '\n' ' ')
|
|
18
|
+
COMPREPLY=( $(compgen -W "$projects" -- "$cur") )
|
|
19
|
+
else
|
|
20
|
+
COMPREPLY=( $(compgen -W "--type --quiet --json" -- "$cur") )
|
|
21
|
+
fi
|
|
22
|
+
;;
|
|
23
|
+
release)
|
|
24
|
+
# Skip completion if --port flag is used
|
|
25
|
+
if [[ "${words[*]}" =~ "--port" ]] || [[ "${words[*]}" =~ " -p " ]]; then
|
|
26
|
+
COMPREPLY=( $(compgen -W "--all --port --quiet --json" -- "$cur") )
|
|
27
|
+
elif [[ "$cur" != -* ]]; then
|
|
28
|
+
# Complete with project names
|
|
29
|
+
local projects=$(devports release --completion projects 2>/dev/null | tr '\n' ' ')
|
|
30
|
+
COMPREPLY=( $(compgen -W "$projects" -- "$cur") )
|
|
31
|
+
else
|
|
32
|
+
COMPREPLY=( $(compgen -W "--all --port --quiet --json" -- "$cur") )
|
|
33
|
+
fi
|
|
34
|
+
;;
|
|
35
|
+
list)
|
|
36
|
+
COMPREPLY=( $(compgen -W "--project --type --quiet --json" -- "$cur") )
|
|
37
|
+
;;
|
|
38
|
+
status)
|
|
39
|
+
COMPREPLY=( $(compgen -W "--json" -- "$cur") )
|
|
40
|
+
;;
|
|
41
|
+
check)
|
|
42
|
+
COMPREPLY=( $(compgen -W "--quiet --json" -- "$cur") )
|
|
43
|
+
;;
|
|
44
|
+
reserve)
|
|
45
|
+
COMPREPLY=( $(compgen -W "--quiet --json" -- "$cur") )
|
|
46
|
+
;;
|
|
47
|
+
unreserve)
|
|
48
|
+
COMPREPLY=( $(compgen -W "--quiet --json" -- "$cur") )
|
|
49
|
+
;;
|
|
50
|
+
info)
|
|
51
|
+
if [[ "$cur" != -* ]]; then
|
|
52
|
+
# Complete with project names
|
|
53
|
+
local projects=$(devports list --completion projects 2>/dev/null | tr '\n' ' ')
|
|
54
|
+
COMPREPLY=( $(compgen -W "$projects" -- "$cur") )
|
|
55
|
+
else
|
|
56
|
+
COMPREPLY=( $(compgen -W "--json" -- "$cur") )
|
|
57
|
+
fi
|
|
58
|
+
;;
|
|
59
|
+
render)
|
|
60
|
+
COMPREPLY=( $(compgen -W "--project --output --json" -- "$cur") )
|
|
61
|
+
;;
|
|
62
|
+
gitignore)
|
|
63
|
+
COMPREPLY=( $(compgen -W "--clean --preview --json" -- "$cur") )
|
|
64
|
+
;;
|
|
65
|
+
setup)
|
|
66
|
+
COMPREPLY=( $(compgen -W "--template --services --force --skip-render --post-hook --json" -- "$cur") )
|
|
67
|
+
;;
|
|
68
|
+
worktree)
|
|
69
|
+
COMPREPLY=( $(compgen -W "add remove" -- "$cur") )
|
|
70
|
+
;;
|
|
71
|
+
completion)
|
|
72
|
+
COMPREPLY=( $(compgen -W "bash zsh" -- "$cur") )
|
|
73
|
+
;;
|
|
74
|
+
*)
|
|
75
|
+
;;
|
|
76
|
+
esac
|
|
77
|
+
;;
|
|
78
|
+
3)
|
|
79
|
+
case ${words[1]} in
|
|
80
|
+
allocate)
|
|
81
|
+
# Service name - no completion (new service name)
|
|
82
|
+
if [[ "$cur" == -* ]]; then
|
|
83
|
+
COMPREPLY=( $(compgen -W "--type --quiet --json" -- "$cur") )
|
|
84
|
+
fi
|
|
85
|
+
;;
|
|
86
|
+
release)
|
|
87
|
+
# Skip completion if --port flag is used
|
|
88
|
+
if [[ "${words[*]}" =~ "--port" ]] || [[ "${words[*]}" =~ " -p " ]]; then
|
|
89
|
+
return 0
|
|
90
|
+
elif [[ "$cur" != -* ]] && [[ "${words[2]}" != -* ]]; then
|
|
91
|
+
# Complete with service names for the project
|
|
92
|
+
local project=${words[2]}
|
|
93
|
+
local services=$(devports release --completion services --project "$project" 2>/dev/null | tr '\n' ' ')
|
|
94
|
+
COMPREPLY=( $(compgen -W "$services" -- "$cur") )
|
|
95
|
+
else
|
|
96
|
+
COMPREPLY=( $(compgen -W "--all --port --quiet --json" -- "$cur") )
|
|
97
|
+
fi
|
|
98
|
+
;;
|
|
99
|
+
info)
|
|
100
|
+
if [[ "$cur" != -* ]] && [[ "${words[2]}" != -* ]]; then
|
|
101
|
+
# Complete with service names for the project
|
|
102
|
+
local project=${words[2]}
|
|
103
|
+
local services=$(devports list --project "$project" --completion services 2>/dev/null | tr '\n' ' ')
|
|
104
|
+
COMPREPLY=( $(compgen -W "$services" -- "$cur") )
|
|
105
|
+
else
|
|
106
|
+
COMPREPLY=( $(compgen -W "--json" -- "$cur") )
|
|
107
|
+
fi
|
|
108
|
+
;;
|
|
109
|
+
worktree)
|
|
110
|
+
case ${words[2]} in
|
|
111
|
+
add)
|
|
112
|
+
COMPREPLY=( $(compgen -W "--branch --services --env-file --template --post-hook --no-env --json" -- "$cur") )
|
|
113
|
+
;;
|
|
114
|
+
remove)
|
|
115
|
+
COMPREPLY=( $(compgen -W "--force --json" -- "$cur") )
|
|
116
|
+
;;
|
|
117
|
+
*)
|
|
118
|
+
# Let default directory completion handle paths
|
|
119
|
+
;;
|
|
120
|
+
esac
|
|
121
|
+
;;
|
|
122
|
+
completion)
|
|
123
|
+
COMPREPLY=( $(compgen -W "--install --uninstall --check --json" -- "$cur") )
|
|
124
|
+
;;
|
|
125
|
+
*)
|
|
126
|
+
;;
|
|
127
|
+
esac
|
|
128
|
+
;;
|
|
129
|
+
*)
|
|
130
|
+
# Handle flags for all commands
|
|
131
|
+
case $prev in
|
|
132
|
+
--type|-t)
|
|
133
|
+
local types=$(devports allocate --completion types 2>/dev/null | tr '\n' ' ')
|
|
134
|
+
COMPREPLY=( $(compgen -W "$types" -- "$cur") )
|
|
135
|
+
;;
|
|
136
|
+
--project|-p)
|
|
137
|
+
local projects=$(devports list --completion projects 2>/dev/null | tr '\n' ' ')
|
|
138
|
+
COMPREPLY=( $(compgen -W "$projects" -- "$cur") )
|
|
139
|
+
;;
|
|
140
|
+
--template)
|
|
141
|
+
COMPREPLY=( $(compgen -f -X "!*.devports" -- "$cur") )
|
|
142
|
+
;;
|
|
143
|
+
--output|-o)
|
|
144
|
+
COMPREPLY=( $(compgen -f -- "$cur") )
|
|
145
|
+
;;
|
|
146
|
+
--env-file|-e)
|
|
147
|
+
COMPREPLY=( $(compgen -f -- "$cur") )
|
|
148
|
+
;;
|
|
149
|
+
--post-hook|-h)
|
|
150
|
+
COMPREPLY=( $(compgen -f -- "$cur") )
|
|
151
|
+
;;
|
|
152
|
+
*)
|
|
153
|
+
# Default flag completion
|
|
154
|
+
case ${words[1]} in
|
|
155
|
+
allocate)
|
|
156
|
+
COMPREPLY=( $(compgen -W "--type --quiet --json" -- "$cur") )
|
|
157
|
+
;;
|
|
158
|
+
release)
|
|
159
|
+
COMPREPLY=( $(compgen -W "--all --port --quiet --json" -- "$cur") )
|
|
160
|
+
;;
|
|
161
|
+
list)
|
|
162
|
+
COMPREPLY=( $(compgen -W "--project --type --quiet --json" -- "$cur") )
|
|
163
|
+
;;
|
|
164
|
+
status)
|
|
165
|
+
COMPREPLY=( $(compgen -W "--json" -- "$cur") )
|
|
166
|
+
;;
|
|
167
|
+
check)
|
|
168
|
+
COMPREPLY=( $(compgen -W "--quiet --json" -- "$cur") )
|
|
169
|
+
;;
|
|
170
|
+
reserve)
|
|
171
|
+
COMPREPLY=( $(compgen -W "--quiet --json" -- "$cur") )
|
|
172
|
+
;;
|
|
173
|
+
unreserve)
|
|
174
|
+
COMPREPLY=( $(compgen -W "--quiet --json" -- "$cur") )
|
|
175
|
+
;;
|
|
176
|
+
info)
|
|
177
|
+
COMPREPLY=( $(compgen -W "--json" -- "$cur") )
|
|
178
|
+
;;
|
|
179
|
+
render)
|
|
180
|
+
COMPREPLY=( $(compgen -W "--project --output --json" -- "$cur") )
|
|
181
|
+
;;
|
|
182
|
+
gitignore)
|
|
183
|
+
COMPREPLY=( $(compgen -W "--clean --preview --json" -- "$cur") )
|
|
184
|
+
;;
|
|
185
|
+
setup)
|
|
186
|
+
COMPREPLY=( $(compgen -W "--template --services --force --skip-render --post-hook --json" -- "$cur") )
|
|
187
|
+
;;
|
|
188
|
+
worktree)
|
|
189
|
+
case ${words[2]} in
|
|
190
|
+
add)
|
|
191
|
+
COMPREPLY=( $(compgen -W "--branch --services --env-file --template --post-hook --no-env --json" -- "$cur") )
|
|
192
|
+
;;
|
|
193
|
+
remove)
|
|
194
|
+
COMPREPLY=( $(compgen -W "--force --json" -- "$cur") )
|
|
195
|
+
;;
|
|
196
|
+
esac
|
|
197
|
+
;;
|
|
198
|
+
completion)
|
|
199
|
+
COMPREPLY=( $(compgen -W "--install --uninstall --check --json" -- "$cur") )
|
|
200
|
+
;;
|
|
201
|
+
esac
|
|
202
|
+
;;
|
|
203
|
+
esac
|
|
204
|
+
;;
|
|
205
|
+
esac
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
complete -F _devports_completion devports
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Completion data providers for shell completion system
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Get all project names for completion
|
|
6
|
+
*/
|
|
7
|
+
export declare function getProjectsForCompletion(): string[];
|
|
8
|
+
/**
|
|
9
|
+
* Get all service names for a specific project
|
|
10
|
+
*/
|
|
11
|
+
export declare function getServicesForCompletion(project: string): string[];
|
|
12
|
+
/**
|
|
13
|
+
* Get all valid service types for completion
|
|
14
|
+
*/
|
|
15
|
+
export declare function getServiceTypesForCompletion(): string[];
|
|
16
|
+
//# sourceMappingURL=completion-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion-data.d.ts","sourceRoot":"","sources":["../../src/completion/completion-data.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,EAAE,CAQnD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAQlE;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,EAAE,CAEvD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Completion data providers for shell completion system
|
|
3
|
+
*/
|
|
4
|
+
import { listAllocations } from '../port-manager.js';
|
|
5
|
+
import { VALID_PORT_TYPES } from '../types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Get all project names for completion
|
|
8
|
+
*/
|
|
9
|
+
export function getProjectsForCompletion() {
|
|
10
|
+
try {
|
|
11
|
+
const allocations = listAllocations();
|
|
12
|
+
const projects = new Set(allocations.map((a) => a.project));
|
|
13
|
+
return Array.from(projects).sort();
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get all service names for a specific project
|
|
21
|
+
*/
|
|
22
|
+
export function getServicesForCompletion(project) {
|
|
23
|
+
try {
|
|
24
|
+
const allocations = listAllocations({ project });
|
|
25
|
+
const services = new Set(allocations.map((a) => a.service));
|
|
26
|
+
return Array.from(services).sort();
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get all valid service types for completion
|
|
34
|
+
*/
|
|
35
|
+
export function getServiceTypesForCompletion() {
|
|
36
|
+
return VALID_PORT_TYPES.slice();
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=completion-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion-data.js","sourceRoot":"","sources":["../../src/completion/completion-data.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;GAEG;AACH,MAAM,UAAU,wBAAwB;IACtC,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,eAAe,EAAE,CAAC;QACtC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAC5D,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAe;IACtD,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,eAAe,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;QACjD,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAC5D,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B;IAC1C,OAAO,gBAAgB,CAAC,KAAK,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modular completion system for devports CLI
|
|
3
|
+
* Coordinates shell templates, data providers, and configuration management
|
|
4
|
+
*/
|
|
5
|
+
import { getProjectsForCompletion, getServicesForCompletion, getServiceTypesForCompletion } from './completion-data.js';
|
|
6
|
+
import { isCompletionSystemInitialized, isCompletionInstalled, setupCompletionSystem, uninstallCompletion } from './shell-config.js';
|
|
7
|
+
export interface CompletionOptions {
|
|
8
|
+
install?: boolean;
|
|
9
|
+
shell?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Generate completion script for specified shell
|
|
13
|
+
*/
|
|
14
|
+
export declare function generateCompletionScript(shell: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Install completion with automatic setup for shell configuration
|
|
17
|
+
*/
|
|
18
|
+
export declare function installCompletionWithSetup(shell: string): {
|
|
19
|
+
success: boolean;
|
|
20
|
+
message: string;
|
|
21
|
+
configFile: string;
|
|
22
|
+
};
|
|
23
|
+
export { isCompletionInstalled, getProjectsForCompletion, getServicesForCompletion, getServiceTypesForCompletion, isCompletionSystemInitialized, setupCompletionSystem, uninstallCompletion, };
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/completion/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAW9D;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG;IACzD,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAEA;AAGD,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,EAC7B,qBAAqB,EACrB,mBAAmB,GACpB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modular completion system for devports CLI
|
|
3
|
+
* Coordinates shell templates, data providers, and configuration management
|
|
4
|
+
*/
|
|
5
|
+
import { generateZshCompletion } from './zsh-completion-template.js';
|
|
6
|
+
import { generateBashCompletion } from './bash-completion-template.js';
|
|
7
|
+
import { getProjectsForCompletion, getServicesForCompletion, getServiceTypesForCompletion, } from './completion-data.js';
|
|
8
|
+
import { isCompletionSystemInitialized, isCompletionInstalled, setupCompletionSystem, uninstallCompletion, } from './shell-config.js';
|
|
9
|
+
/**
|
|
10
|
+
* Generate completion script for specified shell
|
|
11
|
+
*/
|
|
12
|
+
export function generateCompletionScript(shell) {
|
|
13
|
+
switch (shell.toLowerCase()) {
|
|
14
|
+
case 'zsh':
|
|
15
|
+
return generateZshCompletion();
|
|
16
|
+
case 'bash':
|
|
17
|
+
return generateBashCompletion();
|
|
18
|
+
default:
|
|
19
|
+
throw new Error(`Unsupported shell: ${shell}. Supported shells: bash, zsh`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Install completion with automatic setup for shell configuration
|
|
24
|
+
*/
|
|
25
|
+
export function installCompletionWithSetup(shell) {
|
|
26
|
+
return setupCompletionSystem(shell);
|
|
27
|
+
}
|
|
28
|
+
// Re-export completion functions for backward compatibility
|
|
29
|
+
export { isCompletionInstalled, getProjectsForCompletion, getServicesForCompletion, getServiceTypesForCompletion, isCompletionSystemInitialized, setupCompletionSystem, uninstallCompletion, };
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/completion/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAO3B;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAa;IACpD,QAAQ,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;QAC5B,KAAK,KAAK;YACR,OAAO,qBAAqB,EAAE,CAAC;QACjC,KAAK,MAAM;YACT,OAAO,sBAAsB,EAAE,CAAC;QAClC;YACE,MAAM,IAAI,KAAK,CACb,sBAAsB,KAAK,+BAA+B,CAC3D,CAAC;IACN,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,KAAa;IAKtD,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC;AAED,4DAA4D;AAC5D,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,EAC7B,qBAAqB,EACrB,mBAAmB,GACpB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell configuration management for completion installation
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Check if completion system is initialized for a shell
|
|
6
|
+
*/
|
|
7
|
+
export declare function isCompletionSystemInitialized(shell: string): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Check if completion is installed for a shell
|
|
10
|
+
*/
|
|
11
|
+
export declare function isCompletionInstalled(shell: string): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Setup completion system for a shell
|
|
14
|
+
*/
|
|
15
|
+
export declare function setupCompletionSystem(shell: string): {
|
|
16
|
+
success: boolean;
|
|
17
|
+
message: string;
|
|
18
|
+
configFile: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Uninstall completion from shell configuration
|
|
22
|
+
*/
|
|
23
|
+
export declare function uninstallCompletion(shell: string): {
|
|
24
|
+
success: boolean;
|
|
25
|
+
message: string;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=shell-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-config.d.ts","sourceRoot":"","sources":["../../src/completion/shell-config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAOpE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAoB5D;AAgGD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG;IACpD,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CA8DA;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CA8DA"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell configuration management for completion installation
|
|
3
|
+
*/
|
|
4
|
+
import { writeFileSync, readFileSync, existsSync, mkdirSync } from 'fs';
|
|
5
|
+
import { join } from 'path';
|
|
6
|
+
import { homedir } from 'os';
|
|
7
|
+
import { execSync } from 'child_process';
|
|
8
|
+
/**
|
|
9
|
+
* Check if completion system is initialized for a shell
|
|
10
|
+
*/
|
|
11
|
+
export function isCompletionSystemInitialized(shell) {
|
|
12
|
+
try {
|
|
13
|
+
const { hasSetup } = hasCompletionSetupInConfig(shell);
|
|
14
|
+
return hasSetup;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Check if completion is installed for a shell
|
|
22
|
+
*/
|
|
23
|
+
export function isCompletionInstalled(shell) {
|
|
24
|
+
try {
|
|
25
|
+
const home = homedir();
|
|
26
|
+
let completionPath;
|
|
27
|
+
switch (shell.toLowerCase()) {
|
|
28
|
+
case 'zsh':
|
|
29
|
+
completionPath = join(home, '.zsh', 'completions', '_devports');
|
|
30
|
+
break;
|
|
31
|
+
case 'bash':
|
|
32
|
+
completionPath = join(home, '.bash_completion.d', 'devports');
|
|
33
|
+
break;
|
|
34
|
+
default:
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
return existsSync(completionPath);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get the configuration file path for a shell
|
|
45
|
+
*/
|
|
46
|
+
function getShellConfigFile(shell) {
|
|
47
|
+
const home = homedir();
|
|
48
|
+
switch (shell) {
|
|
49
|
+
case 'zsh': {
|
|
50
|
+
// Try common zsh config files
|
|
51
|
+
const zshConfigs = ['.zshrc', '.zsh_profile', '.profile'];
|
|
52
|
+
for (const config of zshConfigs) {
|
|
53
|
+
const path = join(home, config);
|
|
54
|
+
if (existsSync(path)) {
|
|
55
|
+
return path;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Default to .zshrc if none exist
|
|
59
|
+
return join(home, '.zshrc');
|
|
60
|
+
}
|
|
61
|
+
case 'bash': {
|
|
62
|
+
// Try common bash config files
|
|
63
|
+
const bashConfigs = ['.bashrc', '.bash_profile', '.profile'];
|
|
64
|
+
for (const config of bashConfigs) {
|
|
65
|
+
const path = join(home, config);
|
|
66
|
+
if (existsSync(path)) {
|
|
67
|
+
return path;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// Default to .bashrc if none exist
|
|
71
|
+
return join(home, '.bashrc');
|
|
72
|
+
}
|
|
73
|
+
default:
|
|
74
|
+
throw new Error(`Unsupported shell: ${shell}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Check if completion setup exists in shell config
|
|
79
|
+
*/
|
|
80
|
+
function hasCompletionSetupInConfig(shell) {
|
|
81
|
+
try {
|
|
82
|
+
const configFile = getShellConfigFile(shell);
|
|
83
|
+
if (!existsSync(configFile)) {
|
|
84
|
+
return { hasSetup: false, configFile };
|
|
85
|
+
}
|
|
86
|
+
const content = readFileSync(configFile, 'utf-8');
|
|
87
|
+
const hasSetup = content.includes('# devports completion setup') ||
|
|
88
|
+
content.includes('eval "$(devports completion');
|
|
89
|
+
return { hasSetup, configFile };
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
return { hasSetup: false, configFile: '' };
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Generate shell configuration commands for completion setup
|
|
97
|
+
*/
|
|
98
|
+
function generateShellConfigCommands(shell) {
|
|
99
|
+
let commands;
|
|
100
|
+
switch (shell) {
|
|
101
|
+
case 'zsh':
|
|
102
|
+
commands = [
|
|
103
|
+
'',
|
|
104
|
+
'# devports completion setup',
|
|
105
|
+
'autoload -U compinit && compinit',
|
|
106
|
+
`eval "$(devports completion ${shell})"`,
|
|
107
|
+
'',
|
|
108
|
+
];
|
|
109
|
+
break;
|
|
110
|
+
case 'bash':
|
|
111
|
+
commands = [
|
|
112
|
+
'',
|
|
113
|
+
'# devports completion setup',
|
|
114
|
+
`eval "$(devports completion ${shell})"`,
|
|
115
|
+
'',
|
|
116
|
+
];
|
|
117
|
+
break;
|
|
118
|
+
default:
|
|
119
|
+
throw new Error(`Unsupported shell: ${shell}`);
|
|
120
|
+
}
|
|
121
|
+
return commands;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Setup completion system for a shell
|
|
125
|
+
*/
|
|
126
|
+
export function setupCompletionSystem(shell) {
|
|
127
|
+
try {
|
|
128
|
+
const configFile = getShellConfigFile(shell);
|
|
129
|
+
const { hasSetup } = hasCompletionSetupInConfig(shell);
|
|
130
|
+
if (hasSetup) {
|
|
131
|
+
return {
|
|
132
|
+
success: true,
|
|
133
|
+
message: `Completion is already configured in ${configFile}`,
|
|
134
|
+
configFile,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
// Ensure the config file exists
|
|
138
|
+
if (!existsSync(configFile)) {
|
|
139
|
+
const configDir = join(configFile, '..');
|
|
140
|
+
if (!existsSync(configDir)) {
|
|
141
|
+
mkdirSync(configDir, { recursive: true });
|
|
142
|
+
}
|
|
143
|
+
writeFileSync(configFile, '');
|
|
144
|
+
}
|
|
145
|
+
// Read existing content
|
|
146
|
+
let content = '';
|
|
147
|
+
try {
|
|
148
|
+
content = readFileSync(configFile, 'utf-8');
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
content = '';
|
|
152
|
+
}
|
|
153
|
+
// Generate completion setup commands
|
|
154
|
+
const commands = generateShellConfigCommands(shell);
|
|
155
|
+
const newContent = content + commands.join('\n');
|
|
156
|
+
// Write updated content
|
|
157
|
+
writeFileSync(configFile, newContent);
|
|
158
|
+
// Try to reload shell configuration
|
|
159
|
+
try {
|
|
160
|
+
if (shell === 'zsh') {
|
|
161
|
+
execSync(`source ${configFile}`, { stdio: 'pipe' });
|
|
162
|
+
}
|
|
163
|
+
else if (shell === 'bash') {
|
|
164
|
+
execSync(`source ${configFile}`, { stdio: 'pipe' });
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
// Reloading may fail, but that's okay - user can restart shell
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
success: true,
|
|
172
|
+
message: `Completion setup added to ${configFile}. Restart your shell or run: source ${configFile}`,
|
|
173
|
+
configFile,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
178
|
+
return {
|
|
179
|
+
success: false,
|
|
180
|
+
message: `Failed to setup completion: ${errorMessage}`,
|
|
181
|
+
configFile: '',
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Uninstall completion from shell configuration
|
|
187
|
+
*/
|
|
188
|
+
export function uninstallCompletion(shell) {
|
|
189
|
+
try {
|
|
190
|
+
const configFile = getShellConfigFile(shell);
|
|
191
|
+
if (!existsSync(configFile)) {
|
|
192
|
+
return {
|
|
193
|
+
success: true,
|
|
194
|
+
message: 'No configuration file found, completion was not installed',
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
const content = readFileSync(configFile, 'utf-8');
|
|
198
|
+
const lines = content.split('\n');
|
|
199
|
+
// Remove lines related to devports completion
|
|
200
|
+
const filteredLines = lines.filter((line) => {
|
|
201
|
+
const trimmed = line.trim();
|
|
202
|
+
return !(trimmed.includes('# devports completion setup') ||
|
|
203
|
+
trimmed.includes('eval "$(devports completion') ||
|
|
204
|
+
trimmed.includes('autoload -U compinit && compinit') ||
|
|
205
|
+
(trimmed === '' &&
|
|
206
|
+
lines[lines.indexOf(line) - 1]?.includes('devports completion')));
|
|
207
|
+
});
|
|
208
|
+
// Remove duplicate empty lines
|
|
209
|
+
const cleanedLines = [];
|
|
210
|
+
let prevEmpty = false;
|
|
211
|
+
for (const line of filteredLines) {
|
|
212
|
+
if (line.trim() === '') {
|
|
213
|
+
if (!prevEmpty) {
|
|
214
|
+
cleanedLines.push(line);
|
|
215
|
+
}
|
|
216
|
+
prevEmpty = true;
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
cleanedLines.push(line);
|
|
220
|
+
prevEmpty = false;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (cleanedLines.length === filteredLines.length) {
|
|
224
|
+
return {
|
|
225
|
+
success: true,
|
|
226
|
+
message: 'No devports completion found in configuration',
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
writeFileSync(configFile, cleanedLines.join('\n'));
|
|
230
|
+
return {
|
|
231
|
+
success: true,
|
|
232
|
+
message: `Removed devports completion from ${configFile}. Restart your shell to apply changes.`,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
237
|
+
return {
|
|
238
|
+
success: false,
|
|
239
|
+
message: `Failed to uninstall completion: ${errorMessage}`,
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
//# sourceMappingURL=shell-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-config.js","sourceRoot":"","sources":["../../src/completion/shell-config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA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,EAAE,CAAC;YACjD,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,+CAA+C;aACzD,CAAC;QACJ,CAAC;QAED,aAAa,CAAC,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAEnD,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,oCAAoC,UAAU,wCAAwC;SAChG,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,YAAY,GAChB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QAC3D,OAAO;YACL,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,mCAAmC,YAAY,EAAE;SAC3D,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zsh-completion-template.d.ts","sourceRoot":"","sources":["../../src/completion/zsh-completion-template.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,wBAAgB,qBAAqB,IAAI,MAAM,CAM9C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zsh completion template for devports CLI
|
|
3
|
+
*/
|
|
4
|
+
import { readFileSync } from 'fs';
|
|
5
|
+
import { join, dirname } from 'path';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
export function generateZshCompletion() {
|
|
8
|
+
// Read the static completion script
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = dirname(__filename);
|
|
11
|
+
const scriptPath = join(__dirname, 'zsh.sh');
|
|
12
|
+
return readFileSync(scriptPath, 'utf-8');
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=zsh-completion-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zsh-completion-template.js","sourceRoot":"","sources":["../../src/completion/zsh-completion-template.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,UAAU,qBAAqB;IACnC,oCAAoC;IACpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACtC,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC7C,OAAO,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC"}
|