-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathbundle.ts
548 lines (545 loc) · 15.7 KB
/
bundle.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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
const gemfileGemsGenerator: Fig.Generator = {
script: ["bundle", "list", "--name-only"],
postProcess: (out) => {
return out.split("\n").map((gem) => {
return {
name: gem,
icon: "📦",
description: "Gem",
};
});
},
};
const completionSpec: Fig.Spec = {
name: "bundle",
description: "Ruby Dependency Management",
subcommands: [
// Primary Commands
{
name: "install",
description: "Install the gems specified by the Gemfile or Gemfile.lock",
options: [
{
name: "--binstubs",
args: { template: "folders" },
description: "Create binstubs in dir",
},
{ name: "--clean", description: "Remove unused gems after install" },
{ name: "--deployment", description: "For Production and CI use" },
{
name: ["--force", "--redownload"],
description: "Redownload all gems",
},
{ name: "--frozen", description: "Do not allow lock file to update" },
{ name: "--full-index", description: "Cache the full index locally" },
{
name: "--gemfile",
args: { template: "filepaths" },
description: "The gemfile to use",
},
{
name: "--jobs",
args: {},
description: "Maximum number of parallel installs",
},
{
name: "--local",
description: "Use only gems already downloaded or cached",
},
{ name: "--no-cache", description: "Do not use vendor/cache" },
{ name: "--no-prune", description: "Do not remove stale gems" },
{
name: "--path",
args: { template: "folders" },
description: "Path the install gems too",
},
{ name: "--quiet", description: "Do not print to stdout" },
{
name: "--retry",
args: {},
description: "Retry failed network requests N times",
},
{
name: "--shebang",
args: {},
description: "Uses the specified ruby executable for binstubs",
},
{
name: "--standalone",
args: {},
description:
"Makes a bundle that can work without depending on Rubygems or Bundler at runtime",
},
{ name: "--system", description: "Use system Rubygems location" },
{
name: "--trust-policy",
args: {},
description: "Apply the Rubygems security policy",
},
{ name: "--with", args: {}, description: "Groups to install" },
{ name: "--without", args: {}, description: "Groups to NOT install" },
],
},
{
name: "update",
description: "Update dependencies to their latest versions",
args: {
name: "gem",
generators: gemfileGemsGenerator,
isOptional: true,
},
options: [
{
name: "--all",
description: "Update all gems specified in Gemfile",
},
{
name: ["--group", "-g"],
description: "Only update the gems in the specified group",
args: {},
},
{
name: "--source",
description: "The name of a :git or :path source used in the Gemfile",
args: {},
},
{
name: "--local",
description: "Use only gems already downloaded or cached",
},
{
name: "--ruby",
description:
"Update the locked version of Ruby to the current version of Ruby",
},
{
name: "--bundler",
description:
"Update the locked version of bundler to the invoked bundler version",
},
{
name: "--full-index",
description: "Fall back to using the single-file index of all gems",
},
{
name: ["--jobs", "-j"],
description:
"Specify the number of jobs to run in parallel. The default is 1",
args: {},
},
{
name: "--retry",
description: "Retry failed network or git requests for number times",
args: {},
},
{ name: "--quiet", description: "Only output warnings and errors" },
{
name: ["--force", "--redownload"],
description: "Force downloading every gem",
},
{
name: "--patch",
description: "Prefer updating only to next patch version",
},
{
name: "--minor",
description: "Prefer updating only to next minor version",
},
{
name: "--major",
description: "Prefer updating to next major version (default)",
},
{
name: "--strict",
description:
"Do not allow any gem to be updated past latest --patch | --minor | --major",
},
{
name: "--conservative",
description: "Do not allow shared dependencies to be updated",
},
],
},
{
name: "package",
description:
"Package the .gem files required by your application into the vendor/cache directory",
},
{
name: "exec",
description: "Execute a command in the context of the bundle",
options: [
{
name: "--keep-file-descriptors",
description: "Pass all file descriptors to the new process",
},
],
args: { isCommand: true },
},
{ name: "config", args: {} },
{ name: "help" },
// Utility Commands
{
name: "add",
description: "Add gem to the Gemfile and run bundle install",
args: {},
options: [
{
name: ["--version", "-v"],
description: "Specify version requirements",
},
{
name: ["--group", "-g"],
description: "Specify the group(s) for the added gem",
},
{
name: ["--source", "-s"],
description: "Specify the source",
},
{
name: "--skip-install",
description: "Adds the gem to the Gemfile but does not install it",
},
{
name: "--optimistic",
description: "Adds optimistic declaration of version",
},
{
name: "--strict",
description: "Adds strict declaration of version",
},
],
},
{
name: "binstubs",
description: "Install the binstubs of the listed gems",
args: {},
options: [
{
name: "--force",
description: "Overwrite existing binstubs",
},
{
name: "--path",
description: "The location to install the specified binstubs to",
},
{
name: "--standalone",
description:
"Makes binstubs that can work without depending on Rubygems or Bundler at runtime",
},
{
name: "--shebang",
description:
"Specify a different shebang executable name than the default",
},
],
},
{
name: "check",
description:
"Determine whether the requirements for your application are installed and available to Bundler",
options: [
{
name: "--dry-run",
description: "Locks the Gemfile before running the command",
},
{
name: "--gemfile",
description: "Use the specified gemfile instead of the Gemfile",
},
{
name: "--path",
description: "Specify a different path than the system default",
},
],
},
{
name: "show",
description: "Show the source location of a particular gem in the bundle",
args: {
name: "gem",
generators: gemfileGemsGenerator,
isOptional: true,
},
options: [
{
name: "--paths",
description:
"List the paths of all gems that are required by your Gemfile",
},
],
},
{
name: "outdated",
description: "Show all of the outdated gems in the current bundle",
options: [
{
name: "--local",
description:
"Do not attempt to fetch gems remotely and use the gem cache instead",
},
{ name: "--pre", description: "Check for newer pre-release gems" },
{ name: "--source", description: "Check against a specific source" },
{
name: "--strict",
description:
"Only list newer versions allowed by your Gemfile requirements",
},
{
name: ["--parseable", "--porcelain"],
description: "Use minimal formatting for more parseable output",
},
{ name: "--group", description: "List gems from a specific group" },
{ name: "--groups", description: "List gems organized by groups" },
{
name: "--update-strict",
description:
"Strict conservative resolution, do not allow any gem to be updated past latest --patch | --minor| --major",
},
{
name: "--minor",
description: "Prefer updating only to next minor version",
},
{
name: "--major",
description: "Prefer updating to next major version (default)",
},
{
name: "--patch",
description: "Prefer updating only to next patch version",
},
{
name: "--filter-major",
description: "Only list major newer versions",
},
{
name: "--filter-minor",
description: "Only list minor newer versions",
},
{
name: "--filter-patch",
description: "Only list patch newer versions",
},
{
name: "--only-explicit",
description:
"Only list gems specified in your Gemfile, not their dependencies",
},
],
},
{
name: "console",
description: "Start an IRB session in the current bundle",
},
{
name: "open",
description: "Open an installed gem in the editor",
args: {
name: "gem",
generators: gemfileGemsGenerator,
},
},
{
name: "lock",
description: "Generate a lockfile for your dependencies",
options: [
{
name: "--update",
description: "Ignores the existing lockfile",
args: {},
},
{
name: "--local",
description: "Do not attempt to connect to rubygems.org",
},
{
name: "--print",
description:
"Prints the lockfile to STDOUT instead of writing to the file\n system",
},
{
name: "--lockfile",
description: "The path where the lockfile should be written to",
args: { name: "path" },
},
{
name: "--full-index",
description: "Fall back to using the single-file index of all gems",
},
{
name: "--add-platform",
description:
"Add a new platform to the lockfile, re-resolving for the addi-\n tion of that platform",
},
{
name: "--remove-platform",
description: "Remove a platform from the lockfile",
},
{
name: "--patch",
description:
"If updating, prefer updating only to next patch version",
},
{
name: "--minor",
description:
"If updating, prefer updating only to next minor version",
},
{
name: "--major",
description:
"If updating, prefer updating to next major version (default)",
},
{
name: "--strict",
description:
"If updating, do not allow any gem to be updated past latest --patch | --minor | --major",
},
{
name: "--conservative",
description:
"If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated",
},
],
},
{
name: "viz",
description: "Generate a visual representation of your dependencies",
options: [
{
name: ["--file", "-f"],
description:
"The name to use for the generated file. See --format option",
},
{
name: ["--format", "-F"],
description: "This is output format option",
},
{
name: ["--requirements", "-R"],
description: "Set to show the version of each required dependency",
},
{
name: ["--version", "-v"],
description: "Set to show each gem version",
},
{
name: ["--without", "-W"],
description:
"Exclude gems that are part of the specified named group",
},
],
},
{
name: "init",
description: "Generate a simple Gemfile, placed in the current directory",
options: [
{
name: "--gemspec",
description: "Use the specified .gemspec to create the Gemfile",
},
],
},
{
name: "gem",
description: "Create a simple gem, suitable for development with Bundler",
options: [
{
name: ["--exe", "-b", "--bin"],
description: "Specify that Bundler should create a binary executable",
},
{
name: "--no-exe",
description: "Do not create a binary",
},
{
name: "--coc",
description:
"Add a CODE_OF_CONDUCT.md file to the root of the generated project",
},
{
name: "--no-coc",
description: "Do not create a CODE_OF_CONDUCT.md",
},
{
name: "--ext",
description:
"Add boilerplate for C extension code to the generated project",
},
{
name: "--no-ext",
description: "Do not add C extension code",
},
{
name: "--mit",
description: "Add an MIT license",
},
{
name: "--no-mit",
description: "Do not create a LICENSE.txt",
},
{
name: ["-t", "--test"],
description: "Specify the test framework that Bundler should use",
args: {},
},
{
name: ["-e", "--edit"],
description: "Open the resulting gemspec in EDITOR",
args: {},
},
],
},
{
name: "platform",
description: "Display platform compatibility information",
options: [
{
name: "--ruby",
description:
"It will display the ruby directive information so you don't have to parse it from the Gemfile",
},
],
},
{
name: "clean",
description: "Clean up unused gems in your Bundler directory",
options: [
{
name: "--dry-run",
description: "Print the changes, but do not clean the unused gems",
},
{
name: "--force",
description: "Force a clean even if --path is not set",
},
],
},
{
name: "doctor",
description: "Display warnings about common problems",
options: [
{ name: "--quiet", description: "Only output warnings and errors" },
{
name: "--gemfile",
description: "The location of the Gemfile which Bundler should use",
args: {},
},
],
},
],
options: [
{ name: "--no-color", description: "Print all output without color" },
{
name: ["--retry", "-r"],
description:
"Specify the number of times you wish to attempt network commands",
},
{
name: ["--verbose", "-V"],
description: "Print out additional logging information",
},
],
};
export default completionSpec;