-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathnest.ts
265 lines (264 loc) · 6.78 KB
/
nest.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
const options: Fig.Option[] = [
{
name: ["-d", "--dry-run"],
description:
"Report actions that would be taken without writing out results",
},
{
name: ["-p", "--project"],
description: "Project in which to generate files",
args: {
name: "project",
description: "Project in which to generate files",
},
},
{
name: "--flat",
description: "Enforce flat structure of generated element",
},
{
name: "--spec",
description: "Enforce spec files generation (default: true)",
exclusiveOn: ["--no-spec"],
},
{
name: "--no-spec",
description: "Disable spec files generation",
exclusiveOn: ["--spec"],
},
{
name: ["-c", "--collection"],
description: "Schematics collection to use",
args: {
name: "collection",
description: "The collection name",
},
},
];
const completionSpec: Fig.Spec = {
name: "nest",
description: "Nest CLI",
subcommands: [
{
name: ["new", "n"],
description: "Creates a new nest project",
args: {
name: "project",
description: "The name of the project",
},
},
{
name: ["generate", "g"],
description: "Generate and/or modifies files based on a schematic",
subcommands: [
{
name: "application",
description: "Generate a new application workspace",
args: {
name: "application",
description: "The name of the application",
},
options: options,
},
{
name: ["class", "cl"],
description: "Generate a new class",
args: {
name: "class",
description: "The name of the class",
},
options: options,
},
{
name: ["configuration", "config"],
description: "Generate a CLI configuration file",
args: {
name: "configuration",
description: "The name of the configuration",
},
options: options,
},
{
name: ["controller", "co"],
description: "Generate a controller declaration",
args: {
name: "controller",
description: "The name of the controller",
},
options: options,
},
{
name: ["decorator", "d"],
description: "Generate a custom decorator",
args: {
name: "decorator",
description: "The name of the decorator",
},
options: options,
},
{
name: ["filter", "f"],
description: "Generate a filter declaration",
args: {
name: "filter",
description: "The name of the filter",
},
options: options,
},
{
name: ["gateway", "ga"],
description: "Generate a gateway declaration",
args: {
name: "gateway",
description: "The name of the gateway",
},
options: options,
},
{
name: ["guard", "gu"],
description: "Generate a guard declaration",
args: {
name: "guard",
description: "The name of the guard",
},
options: options,
},
{
name: ["interceptor", "in"],
description: "Generate an interceptor declaration",
args: {
name: "interceptor",
description: "The name of the interceptor",
},
options: options,
},
{
name: "interface",
description: "Generate an interface",
args: {
name: "interface",
description: "The name of the interface",
},
options: options,
},
{
name: ["middleware", "mi"],
description: "Generate a middleware declaration",
args: {
name: "middleware",
description: "The name of the middleware",
},
options: options,
},
{
name: ["module", "mo"],
description: "Generate a module declaration",
args: {
name: "module",
description: "The name of the module",
},
options: options,
},
{
name: ["pipe", "p"],
description: "Generate a pipe declaration",
args: {
name: "pipe",
description: "The name of the pipe",
},
options: options,
},
{
name: ["provider", "pr"],
description: "Generate a provider declaration",
args: {
name: "provider",
description: "The name of the provider",
},
options: options,
},
{
name: ["resolver", "r"],
description: "Generate a GraphQL resolver declaration",
args: {
name: "resolver",
description: "The name of the resolver",
},
options: options,
},
{
name: ["service", "s"],
description: "Generate a service declaration",
args: {
name: "service",
description: "The name of the service",
},
options: options,
},
{
name: ["library", "lib"],
description: "Generate a new library within a monorepo",
args: {
name: "library",
description: "The name of the library",
},
options: options,
},
{
name: ["sub-app", "app"],
description: "Generate a new application within a monorepo",
args: {
name: "sub-app",
description: "The name of the sub-app",
},
options: options,
},
{
name: ["resource", "res"],
description: "Generate a new CRUD resource",
args: {
name: "resource",
description: "The name of the resource",
},
options: options,
},
],
},
{
name: "build",
description: "Builds Nest application",
options: options,
args: {
name: "app",
description: "The name of the app",
isOptional: true,
},
},
{
name: "start",
description: "Run Nest application",
options: options,
args: {
name: "app",
description: "The name of the app",
isOptional: true,
},
},
{
name: ["info", "i"],
description: "Display Nest project details",
},
{
name: ["update", "u"],
description: "Update Nest dependencies",
options: options,
},
],
options: [
{
name: ["--help", "-h"],
description: "Show help for nest",
},
],
};
export default completionSpec;