oclif 3.4.6 → 3.6.0

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.
@@ -1 +1,483 @@
1
- {"version":"3.4.6","commands":{"generate":{"id":"generate","description":"generate a new CLI\nThis will clone the template repo 'oclif/hello-world' and update package properties","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"name","description":"directory name of new project","required":true}]},"manifest":{"id":"manifest","description":"generates plugin manifest json","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"path","description":"path to plugin","default":"."}]},"promote":{"id":"promote","description":"promote CLI builds to a S3 release channel","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to the oclif CLI project root","required":true,"multiple":false,"default":"."},"version":{"name":"version","type":"option","description":"semantic version of the CLI to promote","required":true,"multiple":false},"sha":{"name":"sha","type":"option","description":"7-digit short git commit SHA of the CLI to promote","required":true,"multiple":false},"channel":{"name":"channel","type":"option","description":"which channel to promote to","required":true,"multiple":false,"default":"stable"},"targets":{"name":"targets","type":"option","char":"t","description":"comma-separated targets to promote (e.g.: linux-arm,win32-x64)","multiple":false},"deb":{"name":"deb","type":"boolean","char":"d","description":"promote debian artifacts","allowNo":false},"macos":{"name":"macos","type":"boolean","char":"m","description":"promote macOS pkg","allowNo":false},"win":{"name":"win","type":"boolean","char":"w","description":"promote Windows exe","allowNo":false},"max-age":{"name":"max-age","type":"option","char":"a","description":"cache control max-age in seconds","multiple":false,"default":"86400"},"xz":{"name":"xz","type":"boolean","description":"also upload xz","allowNo":true},"indexes":{"name":"indexes","type":"boolean","description":"append the promoted urls into the index files","allowNo":false}},"args":[]},"readme":{"id":"readme","description":"adds commands to README.md in current directory\nThe readme must have any of the following tags inside of it for it to be replaced or else it will do nothing:\n# Usage\n<!-- usage -->\n# Commands\n<!-- commands -->\n# Table of contents\n<!-- toc -->\n\nCustomize the code URL prefix by setting oclif.repositoryPrefix in package.json.\n","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"dir":{"name":"dir","type":"option","description":"output directory for multi docs","required":true,"multiple":false,"default":"docs"},"multi":{"name":"multi","type":"boolean","description":"create a different markdown page for each topic","allowNo":false},"aliases":{"name":"aliases","type":"boolean","description":"include aliases in the command list","allowNo":true}},"args":[]},"generate:command":{"id":"generate:command","description":"add a command to an existing CLI or plugin","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","description":"overwrite existing files","allowNo":false}},"args":[{"name":"name","description":"name of command","required":true}]},"generate:hook":{"id":"generate:hook","description":"add a hook to an existing CLI or plugin","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","description":"overwrite existing files","allowNo":false},"event":{"name":"event","type":"option","description":"event to run hook on","multiple":false,"default":"init"}},"args":[{"name":"name","description":"name of hook (snake_case)","required":true}]},"pack:deb":{"id":"pack:deb","description":"pack CLI into debian package","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."},"tarball":{"name":"tarball","type":"option","char":"t","description":"optionally specify a path to a tarball already generated by NPM","required":false,"multiple":false}},"args":[]},"pack:macos":{"id":"pack:macos","description":"pack CLI into macOS .pkg","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."},"additional-cli":{"name":"additional-cli","type":"option","description":"an Oclif CLI other than the one listed in config.bin that should be made available to the user\nthe CLI should already exist in a directory named after the CLI that is the root of the tarball produced by \"oclif pack:tarballs\"","hidden":true,"multiple":false},"tarball":{"name":"tarball","type":"option","char":"t","description":"optionally specify a path to a tarball already generated by NPM","required":false,"multiple":false},"targets":{"name":"targets","type":"option","description":"comma-separated targets to pack (e.g.: darwin-x64,darwin-arm64)","multiple":false}},"args":[]},"pack:tarballs":{"id":"pack:tarballs","description":"packages oclif CLI into tarballs\n\nThis can be used to create oclif CLIs that use the system node or that come preloaded with a node binary.\n","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."},"targets":{"name":"targets","type":"option","char":"t","description":"comma-separated targets to pack (e.g.: linux-arm,win32-x64)","multiple":false},"xz":{"name":"xz","type":"boolean","description":"also build xz","allowNo":true},"parallel":{"name":"parallel","type":"boolean","description":"build tarballs in parallel","allowNo":false},"tarball":{"name":"tarball","type":"option","char":"l","description":"optionally specify a path to a tarball already generated by NPM","required":false,"multiple":false}},"args":[]},"pack:win":{"id":"pack:win","description":"create windows installer from oclif CLI\n\n This command requires WINDOWS_SIGNING (prefixed with the name of your executable, e.g. OCLIF_WINDOWS_SIGNING_PASS) to be set in the environment","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."},"additional-cli":{"name":"additional-cli","type":"option","description":"an Oclif CLI other than the one listed in config.bin that should be made available to the user\nthe CLI should already exist in a directory named after the CLI that is the root of the tarball produced by \"oclif pack:tarballs\"","hidden":true,"multiple":false},"tarball":{"name":"tarball","type":"option","char":"t","description":"optionally specify a path to a tarball already generated by NPM","required":false,"multiple":false}},"args":[]},"upload:deb":{"id":"upload:deb","description":"upload deb package built with pack:deb","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."}},"args":[]},"upload:macos":{"id":"upload:macos","description":"upload macos installers built with pack:macos","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."},"targets":{"name":"targets","type":"option","char":"t","description":"comma-separated targets to upload (e.g.: darwin-x64,darwin-arm64)","multiple":false}},"args":[]},"upload:tarballs":{"id":"upload:tarballs","description":"upload an oclif CLI to S3\n\n\"aws-sdk\" will need to be installed as a devDependency to upload.\n","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."},"targets":{"name":"targets","type":"option","char":"t","description":"comma-separated targets to upload (e.g.: linux-arm,win32-x64)","multiple":false},"xz":{"name":"xz","type":"boolean","description":"also upload xz","allowNo":true}},"args":[]},"upload:win":{"id":"upload:win","description":"upload windows installers built with pack:win","strict":true,"pluginName":"oclif","pluginAlias":"oclif","pluginType":"core","aliases":[],"flags":{"root":{"name":"root","type":"option","char":"r","description":"path to oclif CLI root","required":true,"multiple":false,"default":"."}},"args":[]}}}
1
+ {
2
+ "version": "3.6.0",
3
+ "commands": {
4
+ "generate": {
5
+ "id": "generate",
6
+ "description": "generate a new CLI\nThis will clone the template repo 'oclif/hello-world' and update package properties",
7
+ "strict": true,
8
+ "pluginName": "oclif",
9
+ "pluginAlias": "oclif",
10
+ "pluginType": "core",
11
+ "aliases": [],
12
+ "flags": {},
13
+ "args": {
14
+ "name": {
15
+ "name": "name",
16
+ "description": "directory name of new project",
17
+ "required": true
18
+ }
19
+ }
20
+ },
21
+ "manifest": {
22
+ "id": "manifest",
23
+ "description": "generates plugin manifest json",
24
+ "strict": true,
25
+ "pluginName": "oclif",
26
+ "pluginAlias": "oclif",
27
+ "pluginType": "core",
28
+ "aliases": [],
29
+ "flags": {
30
+ "jit": {
31
+ "name": "jit",
32
+ "type": "boolean",
33
+ "summary": "append commands from JIT plugins in manifest",
34
+ "allowNo": true
35
+ }
36
+ },
37
+ "args": {
38
+ "path": {
39
+ "name": "path",
40
+ "description": "path to plugin",
41
+ "default": "."
42
+ }
43
+ }
44
+ },
45
+ "promote": {
46
+ "id": "promote",
47
+ "description": "promote CLI builds to a S3 release channel",
48
+ "strict": true,
49
+ "pluginName": "oclif",
50
+ "pluginAlias": "oclif",
51
+ "pluginType": "core",
52
+ "aliases": [],
53
+ "flags": {
54
+ "root": {
55
+ "name": "root",
56
+ "type": "option",
57
+ "char": "r",
58
+ "description": "path to the oclif CLI project root",
59
+ "required": true,
60
+ "multiple": false,
61
+ "default": "."
62
+ },
63
+ "version": {
64
+ "name": "version",
65
+ "type": "option",
66
+ "description": "semantic version of the CLI to promote",
67
+ "required": true,
68
+ "multiple": false
69
+ },
70
+ "sha": {
71
+ "name": "sha",
72
+ "type": "option",
73
+ "description": "7-digit short git commit SHA of the CLI to promote",
74
+ "required": true,
75
+ "multiple": false
76
+ },
77
+ "channel": {
78
+ "name": "channel",
79
+ "type": "option",
80
+ "description": "which channel to promote to",
81
+ "required": true,
82
+ "multiple": false,
83
+ "default": "stable"
84
+ },
85
+ "targets": {
86
+ "name": "targets",
87
+ "type": "option",
88
+ "char": "t",
89
+ "description": "comma-separated targets to promote (e.g.: linux-arm,win32-x64)",
90
+ "multiple": false
91
+ },
92
+ "deb": {
93
+ "name": "deb",
94
+ "type": "boolean",
95
+ "char": "d",
96
+ "description": "promote debian artifacts",
97
+ "allowNo": false
98
+ },
99
+ "macos": {
100
+ "name": "macos",
101
+ "type": "boolean",
102
+ "char": "m",
103
+ "description": "promote macOS pkg",
104
+ "allowNo": false
105
+ },
106
+ "win": {
107
+ "name": "win",
108
+ "type": "boolean",
109
+ "char": "w",
110
+ "description": "promote Windows exe",
111
+ "allowNo": false
112
+ },
113
+ "max-age": {
114
+ "name": "max-age",
115
+ "type": "option",
116
+ "char": "a",
117
+ "description": "cache control max-age in seconds",
118
+ "multiple": false,
119
+ "default": "86400"
120
+ },
121
+ "xz": {
122
+ "name": "xz",
123
+ "type": "boolean",
124
+ "description": "also upload xz",
125
+ "allowNo": true
126
+ },
127
+ "indexes": {
128
+ "name": "indexes",
129
+ "type": "boolean",
130
+ "description": "append the promoted urls into the index files",
131
+ "allowNo": false
132
+ }
133
+ },
134
+ "args": {}
135
+ },
136
+ "readme": {
137
+ "id": "readme",
138
+ "description": "adds commands to README.md in current directory\nThe readme must have any of the following tags inside of it for it to be replaced or else it will do nothing:\n# Usage\n<!-- usage -->\n# Commands\n<!-- commands -->\n# Table of contents\n<!-- toc -->\n\nCustomize the code URL prefix by setting oclif.repositoryPrefix in package.json.\n",
139
+ "strict": true,
140
+ "pluginName": "oclif",
141
+ "pluginAlias": "oclif",
142
+ "pluginType": "core",
143
+ "aliases": [],
144
+ "flags": {
145
+ "dir": {
146
+ "name": "dir",
147
+ "type": "option",
148
+ "description": "output directory for multi docs",
149
+ "required": true,
150
+ "multiple": false,
151
+ "default": "docs"
152
+ },
153
+ "multi": {
154
+ "name": "multi",
155
+ "type": "boolean",
156
+ "description": "create a different markdown page for each topic",
157
+ "allowNo": false
158
+ },
159
+ "aliases": {
160
+ "name": "aliases",
161
+ "type": "boolean",
162
+ "description": "include aliases in the command list",
163
+ "allowNo": true
164
+ }
165
+ },
166
+ "args": {}
167
+ },
168
+ "generate:command": {
169
+ "id": "generate:command",
170
+ "description": "add a command to an existing CLI or plugin",
171
+ "strict": true,
172
+ "pluginName": "oclif",
173
+ "pluginAlias": "oclif",
174
+ "pluginType": "core",
175
+ "aliases": [],
176
+ "flags": {
177
+ "force": {
178
+ "name": "force",
179
+ "type": "boolean",
180
+ "description": "overwrite existing files",
181
+ "allowNo": false
182
+ }
183
+ },
184
+ "args": {
185
+ "name": {
186
+ "name": "name",
187
+ "description": "name of command",
188
+ "required": true
189
+ }
190
+ }
191
+ },
192
+ "generate:hook": {
193
+ "id": "generate:hook",
194
+ "description": "add a hook to an existing CLI or plugin",
195
+ "strict": true,
196
+ "pluginName": "oclif",
197
+ "pluginAlias": "oclif",
198
+ "pluginType": "core",
199
+ "aliases": [],
200
+ "flags": {
201
+ "force": {
202
+ "name": "force",
203
+ "type": "boolean",
204
+ "description": "overwrite existing files",
205
+ "allowNo": false
206
+ },
207
+ "event": {
208
+ "name": "event",
209
+ "type": "option",
210
+ "description": "event to run hook on",
211
+ "multiple": false,
212
+ "default": "init"
213
+ }
214
+ },
215
+ "args": {
216
+ "name": {
217
+ "name": "name",
218
+ "description": "name of hook (snake_case)",
219
+ "required": true
220
+ }
221
+ }
222
+ },
223
+ "pack:deb": {
224
+ "id": "pack:deb",
225
+ "description": "pack CLI into debian package",
226
+ "strict": true,
227
+ "pluginName": "oclif",
228
+ "pluginAlias": "oclif",
229
+ "pluginType": "core",
230
+ "aliases": [],
231
+ "flags": {
232
+ "root": {
233
+ "name": "root",
234
+ "type": "option",
235
+ "char": "r",
236
+ "description": "path to oclif CLI root",
237
+ "required": true,
238
+ "multiple": false,
239
+ "default": "."
240
+ },
241
+ "tarball": {
242
+ "name": "tarball",
243
+ "type": "option",
244
+ "char": "t",
245
+ "description": "optionally specify a path to a tarball already generated by NPM",
246
+ "required": false,
247
+ "multiple": false
248
+ }
249
+ },
250
+ "args": {}
251
+ },
252
+ "pack:macos": {
253
+ "id": "pack:macos",
254
+ "description": "pack CLI into macOS .pkg",
255
+ "strict": true,
256
+ "pluginName": "oclif",
257
+ "pluginAlias": "oclif",
258
+ "pluginType": "core",
259
+ "aliases": [],
260
+ "flags": {
261
+ "root": {
262
+ "name": "root",
263
+ "type": "option",
264
+ "char": "r",
265
+ "description": "path to oclif CLI root",
266
+ "required": true,
267
+ "multiple": false,
268
+ "default": "."
269
+ },
270
+ "additional-cli": {
271
+ "name": "additional-cli",
272
+ "type": "option",
273
+ "description": "an Oclif CLI other than the one listed in config.bin that should be made available to the user\nthe CLI should already exist in a directory named after the CLI that is the root of the tarball produced by \"oclif pack:tarballs\"",
274
+ "hidden": true,
275
+ "multiple": false
276
+ },
277
+ "tarball": {
278
+ "name": "tarball",
279
+ "type": "option",
280
+ "char": "t",
281
+ "description": "optionally specify a path to a tarball already generated by NPM",
282
+ "required": false,
283
+ "multiple": false
284
+ },
285
+ "targets": {
286
+ "name": "targets",
287
+ "type": "option",
288
+ "description": "comma-separated targets to pack (e.g.: darwin-x64,darwin-arm64)",
289
+ "multiple": false
290
+ }
291
+ },
292
+ "args": {}
293
+ },
294
+ "pack:tarballs": {
295
+ "id": "pack:tarballs",
296
+ "description": "packages oclif CLI into tarballs\n\nThis can be used to create oclif CLIs that use the system node or that come preloaded with a node binary.\n",
297
+ "strict": true,
298
+ "pluginName": "oclif",
299
+ "pluginAlias": "oclif",
300
+ "pluginType": "core",
301
+ "aliases": [],
302
+ "flags": {
303
+ "root": {
304
+ "name": "root",
305
+ "type": "option",
306
+ "char": "r",
307
+ "description": "path to oclif CLI root",
308
+ "required": true,
309
+ "multiple": false,
310
+ "default": "."
311
+ },
312
+ "targets": {
313
+ "name": "targets",
314
+ "type": "option",
315
+ "char": "t",
316
+ "description": "comma-separated targets to pack (e.g.: linux-arm,win32-x64)",
317
+ "multiple": false
318
+ },
319
+ "xz": {
320
+ "name": "xz",
321
+ "type": "boolean",
322
+ "description": "also build xz",
323
+ "allowNo": true
324
+ },
325
+ "parallel": {
326
+ "name": "parallel",
327
+ "type": "boolean",
328
+ "description": "build tarballs in parallel",
329
+ "allowNo": false
330
+ },
331
+ "tarball": {
332
+ "name": "tarball",
333
+ "type": "option",
334
+ "char": "l",
335
+ "description": "optionally specify a path to a tarball already generated by NPM",
336
+ "required": false,
337
+ "multiple": false
338
+ }
339
+ },
340
+ "args": {}
341
+ },
342
+ "pack:win": {
343
+ "id": "pack:win",
344
+ "description": "create windows installer from oclif CLI\n\n This command requires WINDOWS_SIGNING (prefixed with the name of your executable, e.g. OCLIF_WINDOWS_SIGNING_PASS) to be set in the environment",
345
+ "strict": true,
346
+ "pluginName": "oclif",
347
+ "pluginAlias": "oclif",
348
+ "pluginType": "core",
349
+ "aliases": [],
350
+ "flags": {
351
+ "root": {
352
+ "name": "root",
353
+ "type": "option",
354
+ "char": "r",
355
+ "description": "path to oclif CLI root",
356
+ "required": true,
357
+ "multiple": false,
358
+ "default": "."
359
+ },
360
+ "additional-cli": {
361
+ "name": "additional-cli",
362
+ "type": "option",
363
+ "description": "an Oclif CLI other than the one listed in config.bin that should be made available to the user\nthe CLI should already exist in a directory named after the CLI that is the root of the tarball produced by \"oclif pack:tarballs\"",
364
+ "hidden": true,
365
+ "multiple": false
366
+ },
367
+ "tarball": {
368
+ "name": "tarball",
369
+ "type": "option",
370
+ "char": "t",
371
+ "description": "optionally specify a path to a tarball already generated by NPM",
372
+ "required": false,
373
+ "multiple": false
374
+ }
375
+ },
376
+ "args": {}
377
+ },
378
+ "upload:deb": {
379
+ "id": "upload:deb",
380
+ "description": "upload deb package built with pack:deb",
381
+ "strict": true,
382
+ "pluginName": "oclif",
383
+ "pluginAlias": "oclif",
384
+ "pluginType": "core",
385
+ "aliases": [],
386
+ "flags": {
387
+ "root": {
388
+ "name": "root",
389
+ "type": "option",
390
+ "char": "r",
391
+ "description": "path to oclif CLI root",
392
+ "required": true,
393
+ "multiple": false,
394
+ "default": "."
395
+ }
396
+ },
397
+ "args": {}
398
+ },
399
+ "upload:macos": {
400
+ "id": "upload:macos",
401
+ "description": "upload macos installers built with pack:macos",
402
+ "strict": true,
403
+ "pluginName": "oclif",
404
+ "pluginAlias": "oclif",
405
+ "pluginType": "core",
406
+ "aliases": [],
407
+ "flags": {
408
+ "root": {
409
+ "name": "root",
410
+ "type": "option",
411
+ "char": "r",
412
+ "description": "path to oclif CLI root",
413
+ "required": true,
414
+ "multiple": false,
415
+ "default": "."
416
+ },
417
+ "targets": {
418
+ "name": "targets",
419
+ "type": "option",
420
+ "char": "t",
421
+ "description": "comma-separated targets to upload (e.g.: darwin-x64,darwin-arm64)",
422
+ "multiple": false
423
+ }
424
+ },
425
+ "args": {}
426
+ },
427
+ "upload:tarballs": {
428
+ "id": "upload:tarballs",
429
+ "description": "upload an oclif CLI to S3\n\n\"aws-sdk\" will need to be installed as a devDependency to upload.\n",
430
+ "strict": true,
431
+ "pluginName": "oclif",
432
+ "pluginAlias": "oclif",
433
+ "pluginType": "core",
434
+ "aliases": [],
435
+ "flags": {
436
+ "root": {
437
+ "name": "root",
438
+ "type": "option",
439
+ "char": "r",
440
+ "description": "path to oclif CLI root",
441
+ "required": true,
442
+ "multiple": false,
443
+ "default": "."
444
+ },
445
+ "targets": {
446
+ "name": "targets",
447
+ "type": "option",
448
+ "char": "t",
449
+ "description": "comma-separated targets to upload (e.g.: linux-arm,win32-x64)",
450
+ "multiple": false
451
+ },
452
+ "xz": {
453
+ "name": "xz",
454
+ "type": "boolean",
455
+ "description": "also upload xz",
456
+ "allowNo": true
457
+ }
458
+ },
459
+ "args": {}
460
+ },
461
+ "upload:win": {
462
+ "id": "upload:win",
463
+ "description": "upload windows installers built with pack:win",
464
+ "strict": true,
465
+ "pluginName": "oclif",
466
+ "pluginAlias": "oclif",
467
+ "pluginType": "core",
468
+ "aliases": [],
469
+ "flags": {
470
+ "root": {
471
+ "name": "root",
472
+ "type": "option",
473
+ "char": "r",
474
+ "description": "path to oclif CLI root",
475
+ "required": true,
476
+ "multiple": false,
477
+ "default": "."
478
+ }
479
+ },
480
+ "args": {}
481
+ }
482
+ }
483
+ }
@@ -5,9 +5,7 @@ export default class GenerateCommand extends CommandBase {
5
5
  force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
6
6
  };
7
7
  static args: {
8
- name: string;
9
- description: string;
10
- required: boolean;
11
- }[];
8
+ name: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
9
+ };
12
10
  run(): Promise<void>;
13
11
  }
@@ -16,6 +16,6 @@ GenerateCommand.description = 'add a command to an existing CLI or plugin';
16
16
  GenerateCommand.flags = {
17
17
  force: core_1.Flags.boolean({ description: 'overwrite existing files' }),
18
18
  };
19
- GenerateCommand.args = [
20
- { name: 'name', description: 'name of command', required: true },
21
- ];
19
+ GenerateCommand.args = {
20
+ name: core_1.Args.string({ description: 'name of command', required: true }),
21
+ };
@@ -3,12 +3,10 @@ export default class GenerateHook extends CommandBase {
3
3
  static description: string;
4
4
  static flags: {
5
5
  force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
6
- event: import("@oclif/core/lib/interfaces").OptionFlag<string>;
6
+ event: import("@oclif/core/lib/interfaces").OptionFlag<string, Record<string, unknown>>;
7
7
  };
8
8
  static args: {
9
- name: string;
10
- description: string;
11
- required: boolean;
12
- }[];
9
+ name: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
10
+ };
13
11
  run(): Promise<void>;
14
12
  }
@@ -18,6 +18,6 @@ GenerateHook.flags = {
18
18
  force: core_1.Flags.boolean({ description: 'overwrite existing files' }),
19
19
  event: core_1.Flags.string({ description: 'event to run hook on', default: 'init' }),
20
20
  };
21
- GenerateHook.args = [
22
- { name: 'name', description: 'name of hook (snake_case)', required: true },
23
- ];
21
+ GenerateHook.args = {
22
+ name: core_1.Args.string({ description: 'name of hook (snake_case)', required: true }),
23
+ };
@@ -3,9 +3,7 @@ export default class Generate extends CommandBase {
3
3
  static description: string;
4
4
  static flags: {};
5
5
  static args: {
6
- name: string;
7
- required: boolean;
8
- description: string;
9
- }[];
6
+ name: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
7
+ };
10
8
  run(): Promise<void>;
11
9
  }
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
3
4
  const command_base_1 = require("./../command-base");
4
5
  class Generate extends command_base_1.default {
5
6
  async run() {
@@ -14,6 +15,6 @@ exports.default = Generate;
14
15
  Generate.description = `generate a new CLI
15
16
  This will clone the template repo 'oclif/hello-world' and update package properties`;
16
17
  Generate.flags = {};
17
- Generate.args = [
18
- { name: 'name', required: true, description: 'directory name of new project' },
19
- ];
18
+ Generate.args = {
19
+ name: core_1.Args.string({ required: true, description: 'directory name of new project' }),
20
+ };
@@ -1,10 +1,13 @@
1
- import { Command } from '@oclif/core';
1
+ import { Command, Interfaces } from '@oclif/core';
2
2
  export default class Manifest extends Command {
3
3
  static description: string;
4
4
  static args: {
5
- name: string;
6
- description: string;
7
- default: string;
8
- }[];
5
+ path: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ jit: Interfaces.BooleanFlag<boolean>;
9
+ };
9
10
  run(): Promise<void>;
11
+ private cloneRepo;
12
+ private executeCommand;
10
13
  }
@@ -3,14 +3,53 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
4
  const fs = require("fs-extra");
5
5
  const path = require("path");
6
+ const os = require("os");
7
+ const semver = require("semver");
8
+ const shelljs_1 = require("shelljs");
9
+ async function fileExists(filePath) {
10
+ try {
11
+ await fs.access(filePath);
12
+ return true;
13
+ }
14
+ catch (_a) {
15
+ return false;
16
+ }
17
+ }
6
18
  class Manifest extends core_1.Command {
7
19
  async run() {
20
+ const { flags } = await this.parse(Manifest);
8
21
  try {
9
22
  fs.unlinkSync('oclif.manifest.json');
10
23
  }
11
24
  catch (_a) { }
12
25
  const { args } = await this.parse(Manifest);
13
26
  const root = path.resolve(args.path);
27
+ const packageJson = fs.readJSONSync('package.json');
28
+ let jitPluginManifests = [];
29
+ if (flags.jit && packageJson.oclif.jitPlugins) {
30
+ this.debug('jitPlugins: %s', packageJson.oclif.jitPlugins);
31
+ const tmpDir = os.tmpdir();
32
+ const promises = Object.entries(packageJson.oclif.jitPlugins).map(async ([jitPlugin, version]) => {
33
+ const pluginDir = jitPlugin.replace('/', '-').replace('@', '');
34
+ const repo = this.executeCommand(`npm view ${jitPlugin} repository --json`);
35
+ const stdout = JSON.parse(repo.stdout);
36
+ const repoUrl = stdout.url.replace(`${stdout.type}+`, '');
37
+ const fullPath = path.join(tmpDir, pluginDir);
38
+ if (await fileExists(fullPath))
39
+ await fs.remove(fullPath);
40
+ const versions = JSON.parse(this.executeCommand(`npm view ${jitPlugin} versions --json`).stdout);
41
+ const maxSatisfying = semver.maxSatisfying(versions, version);
42
+ this.cloneRepo(repoUrl, fullPath, maxSatisfying);
43
+ this.executeCommand('yarn', { cwd: fullPath });
44
+ this.executeCommand('yarn build', { cwd: fullPath });
45
+ const plugin = new core_1.Plugin({ root: fullPath, type: 'jit', ignoreManifest: true, errorOnManifestCreate: true });
46
+ await plugin.load();
47
+ return plugin.manifest;
48
+ });
49
+ core_1.ux.action.start('Generating JIT plugin manifests');
50
+ jitPluginManifests = await Promise.all(promises);
51
+ core_1.ux.action.stop();
52
+ }
14
53
  let plugin = new core_1.Plugin({ root, type: 'core', ignoreManifest: true, errorOnManifestCreate: true });
15
54
  if (!plugin)
16
55
  throw new Error('plugin not found');
@@ -26,12 +65,45 @@ class Manifest extends core_1.Command {
26
65
  }
27
66
  const dotfile = plugin.pjson.files.find((f) => f.endsWith('.oclif.manifest.json'));
28
67
  const file = path.join(plugin.root, `${dotfile ? '.' : ''}oclif.manifest.json`);
29
- fs.writeFileSync(file, JSON.stringify(plugin.manifest));
68
+ for (const manifest of jitPluginManifests) {
69
+ plugin.manifest.commands = Object.assign(Object.assign({}, plugin.manifest.commands), manifest.commands);
70
+ }
71
+ fs.writeFileSync(file, JSON.stringify(plugin.manifest, null, 2));
30
72
  this.log(`wrote manifest to ${file}`);
31
73
  }
74
+ cloneRepo(repoUrl, fullPath, tag) {
75
+ try {
76
+ this.executeCommand(`git clone --branch ${tag} ${repoUrl} ${fullPath} --depth 1`);
77
+ }
78
+ catch (_a) {
79
+ try {
80
+ this.executeCommand(`git clone --branch v${tag} ${repoUrl} ${fullPath} --depth 1`);
81
+ }
82
+ catch (_b) {
83
+ throw new Error(`Unable to clone repo ${repoUrl} with tag ${tag}`);
84
+ }
85
+ }
86
+ }
87
+ executeCommand(command, options) {
88
+ const debugString = (options === null || options === void 0 ? void 0 : options.cwd) ? `executing command: ${command} in ${options.cwd}` : `executing command: ${command}`;
89
+ this.debug(debugString);
90
+ const result = (0, shelljs_1.exec)(command, Object.assign(Object.assign({}, options), { silent: true, async: false }));
91
+ if (result.code !== 0) {
92
+ this.error(result.stderr);
93
+ }
94
+ this.debug(result.stdout);
95
+ return result;
96
+ }
32
97
  }
33
98
  exports.default = Manifest;
34
99
  Manifest.description = 'generates plugin manifest json';
35
- Manifest.args = [
36
- { name: 'path', description: 'path to plugin', default: '.' },
37
- ];
100
+ Manifest.args = {
101
+ path: core_1.Args.string({ description: 'path to plugin', default: '.' }),
102
+ };
103
+ Manifest.flags = {
104
+ jit: core_1.Flags.boolean({
105
+ allowNo: true,
106
+ summary: 'append commands from JIT plugins in manifest',
107
+ default: true,
108
+ }),
109
+ };
@@ -3,8 +3,8 @@ import { Interfaces } from '@oclif/core';
3
3
  export default class PackDeb extends Command {
4
4
  static description: string;
5
5
  static flags: {
6
- root: Interfaces.OptionFlag<string>;
7
- tarball: Interfaces.OptionFlag<string | undefined>;
6
+ root: Interfaces.OptionFlag<string, Record<string, unknown>>;
7
+ tarball: Interfaces.OptionFlag<string | undefined, Record<string, unknown>>;
8
8
  };
9
9
  run(): Promise<void>;
10
10
  }
@@ -3,10 +3,10 @@ import { Interfaces } from '@oclif/core';
3
3
  export default class PackMacos extends Command {
4
4
  static description: string;
5
5
  static flags: {
6
- root: Interfaces.OptionFlag<string>;
7
- 'additional-cli': Interfaces.OptionFlag<string | undefined>;
8
- tarball: Interfaces.OptionFlag<string | undefined>;
9
- targets: Interfaces.OptionFlag<string | undefined>;
6
+ root: Interfaces.OptionFlag<string, Record<string, unknown>>;
7
+ 'additional-cli': Interfaces.OptionFlag<string | undefined, Record<string, unknown>>;
8
+ tarball: Interfaces.OptionFlag<string | undefined, Record<string, unknown>>;
9
+ targets: Interfaces.OptionFlag<string | undefined, Record<string, unknown>>;
10
10
  };
11
11
  run(): Promise<void>;
12
12
  }
@@ -2,11 +2,11 @@ import { Command } from '@oclif/core';
2
2
  export default class PackTarballs extends Command {
3
3
  static description: string;
4
4
  static flags: {
5
- root: import("@oclif/core/lib/interfaces").OptionFlag<string>;
6
- targets: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
5
+ root: import("@oclif/core/lib/interfaces").OptionFlag<string, Record<string, unknown>>;
6
+ targets: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, Record<string, unknown>>;
7
7
  xz: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
8
  parallel: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
- tarball: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
9
+ tarball: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, Record<string, unknown>>;
10
10
  };
11
11
  run(): Promise<void>;
12
12
  }
@@ -3,9 +3,9 @@ import { Interfaces } from '@oclif/core';
3
3
  export default class PackWin extends Command {
4
4
  static description: string;
5
5
  static flags: {
6
- root: Interfaces.OptionFlag<string>;
7
- 'additional-cli': Interfaces.OptionFlag<string | undefined>;
8
- tarball: Interfaces.OptionFlag<string | undefined>;
6
+ root: Interfaces.OptionFlag<string, Record<string, unknown>>;
7
+ 'additional-cli': Interfaces.OptionFlag<string | undefined, Record<string, unknown>>;
8
+ tarball: Interfaces.OptionFlag<string | undefined, Record<string, unknown>>;
9
9
  };
10
10
  run(): Promise<void>;
11
11
  private checkForNSIS;
@@ -2,15 +2,15 @@ import { Command } from '@oclif/core';
2
2
  export default class Promote extends Command {
3
3
  static description: string;
4
4
  static flags: {
5
- root: import("@oclif/core/lib/interfaces").OptionFlag<string>;
6
- version: import("@oclif/core/lib/interfaces").OptionFlag<string>;
7
- sha: import("@oclif/core/lib/interfaces").OptionFlag<string>;
8
- channel: import("@oclif/core/lib/interfaces").OptionFlag<string>;
9
- targets: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
5
+ root: import("@oclif/core/lib/interfaces").OptionFlag<string, Record<string, unknown>>;
6
+ version: import("@oclif/core/lib/interfaces").OptionFlag<string, Record<string, unknown>>;
7
+ sha: import("@oclif/core/lib/interfaces").OptionFlag<string, Record<string, unknown>>;
8
+ channel: import("@oclif/core/lib/interfaces").OptionFlag<string, Record<string, unknown>>;
9
+ targets: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, Record<string, unknown>>;
10
10
  deb: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
11
  macos: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
12
  win: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
- 'max-age': import("@oclif/core/lib/interfaces").OptionFlag<string>;
13
+ 'max-age': import("@oclif/core/lib/interfaces").OptionFlag<string, Record<string, unknown>>;
14
14
  xz: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
15
  indexes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
16
  };
@@ -92,7 +92,7 @@ class Promote extends core_1.Command {
92
92
  // strip version & sha so scripts can point to a static channel exe
93
93
  const unversionedExe = winPkg.replace(`-v${flags.version}-${flags.sha}`, '');
94
94
  await Promise.all([aws_1.default.s3.copyObject(Object.assign(Object.assign({}, awsDefaults), { CopySource: winCopySource, Key: cloudChannelKey(unversionedExe) }))].concat(flags.indexes ? [(0, version_indexes_1.appendToIndex)(Object.assign(Object.assign({}, indexDefaults), { originalUrl: winCopySource, filename: unversionedExe }))] : []));
95
- core_1.CliUx.ux.action.stop('successfully');
95
+ core_1.ux.action.stop('successfully');
96
96
  }));
97
97
  };
98
98
  const promoteDebianAptPackages = async () => {
@@ -2,7 +2,7 @@ import { Command, Interfaces } from '@oclif/core';
2
2
  export default class Readme extends Command {
3
3
  static description: string;
4
4
  static flags: {
5
- dir: Interfaces.OptionFlag<string>;
5
+ dir: Interfaces.OptionFlag<string, Record<string, unknown>>;
6
6
  multi: Interfaces.BooleanFlag<boolean>;
7
7
  aliases: Interfaces.BooleanFlag<boolean>;
8
8
  };
@@ -11,11 +11,11 @@ export default class Readme extends Command {
11
11
  replaceTag(readme: string, tag: string, body: string): string;
12
12
  toc(__: Interfaces.Config, readme: string): string;
13
13
  usage(config: Interfaces.Config): string;
14
- multiCommands(config: Interfaces.Config, commands: Interfaces.Command[], dir: string): string;
15
- createTopicFile(file: string, config: Interfaces.Config, topic: Interfaces.Topic, commands: Interfaces.Command[]): void;
16
- commands(config: Interfaces.Config, commands: Interfaces.Command[]): string;
17
- renderCommand(config: Interfaces.Config, c: Interfaces.Command): string;
18
- commandCode(config: Interfaces.Config, c: Interfaces.Command): string | undefined;
14
+ multiCommands(config: Interfaces.Config, commands: Command.Cached[], dir: string): string;
15
+ createTopicFile(file: string, config: Interfaces.Config, topic: Interfaces.Topic, commands: Command.Cached[]): void;
16
+ commands(config: Interfaces.Config, commands: Command.Cached[]): string;
17
+ renderCommand(config: Interfaces.Config, c: Command.Cached): string;
18
+ commandCode(config: Interfaces.Config, c: Command.Cached): string | undefined;
19
19
  private repo;
20
20
  /**
21
21
  * fetches the path to a command
@@ -209,22 +209,17 @@ USAGE
209
209
  return p;
210
210
  }
211
211
  commandUsage(config, command) {
212
- var _a, _b;
213
212
  const arg = (arg) => {
214
213
  const name = arg.name.toUpperCase();
215
214
  if (arg.required)
216
215
  return `${name}`;
217
216
  return `[${name}]`;
218
217
  };
219
- // v2 commands have args as an object, so we need to normalize it to an array for forwards compatibility
220
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
221
- // @ts-ignore
222
- const normalized = Array.isArray(command.args) ? (_a = command.args) !== null && _a !== void 0 ? _a : [] : Object.entries((_b = command.args) !== null && _b !== void 0 ? _b : {}).map(([name, arg]) => (Object.assign(Object.assign({}, arg), { name })));
223
218
  const id = (0, core_1.toConfiguredId)(command.id, config);
224
219
  const defaultUsage = () => {
225
220
  return (0, util_1.compact)([
226
221
  id,
227
- normalized.filter(a => !a.hidden).map(a => arg(a)).join(' '),
222
+ Object.values(command.args).filter(a => !a.hidden).map(a => arg(a)).join(' '),
228
223
  ]).join(' ');
229
224
  };
230
225
  const usages = (0, util_1.castArray)(command.usage);
@@ -2,7 +2,7 @@ import { Command } from '@oclif/core';
2
2
  export default class UploadDeb extends Command {
3
3
  static description: string;
4
4
  static flags: {
5
- root: import("@oclif/core/lib/interfaces").OptionFlag<string>;
5
+ root: import("@oclif/core/lib/interfaces").OptionFlag<string, Record<string, unknown>>;
6
6
  };
7
7
  run(): Promise<void>;
8
8
  }
@@ -2,8 +2,8 @@ import { Command, Interfaces } from '@oclif/core';
2
2
  export default class UploadMacos extends Command {
3
3
  static description: string;
4
4
  static flags: {
5
- root: Interfaces.OptionFlag<string>;
6
- targets: Interfaces.OptionFlag<string | undefined>;
5
+ root: Interfaces.OptionFlag<string, Record<string, unknown>>;
6
+ targets: Interfaces.OptionFlag<string | undefined, Record<string, unknown>>;
7
7
  };
8
8
  run(): Promise<void>;
9
9
  }
@@ -3,8 +3,8 @@ import { Interfaces } from '@oclif/core';
3
3
  export default class UploadTarballs extends Command {
4
4
  static description: string;
5
5
  static flags: {
6
- root: Interfaces.OptionFlag<string>;
7
- targets: Interfaces.OptionFlag<string | undefined>;
6
+ root: Interfaces.OptionFlag<string, Record<string, unknown>>;
7
+ targets: Interfaces.OptionFlag<string | undefined, Record<string, unknown>>;
8
8
  xz: Interfaces.BooleanFlag<boolean>;
9
9
  };
10
10
  run(): Promise<void>;
@@ -2,7 +2,7 @@ import { Command } from '@oclif/core';
2
2
  export default class UploadWin extends Command {
3
3
  static description: string;
4
4
  static flags: {
5
- root: import("@oclif/core/lib/interfaces").OptionFlag<string>;
5
+ root: import("@oclif/core/lib/interfaces").OptionFlag<string, Record<string, unknown>>;
6
6
  };
7
7
  run(): Promise<void>;
8
8
  }
@@ -1,11 +1,11 @@
1
- import { Interfaces, HelpBase } from '@oclif/core';
1
+ import { Command, HelpBase } from '@oclif/core';
2
2
  interface MaybeCompatibleHelp extends HelpBase {
3
- formatCommand?: (command: Interfaces.Command) => string;
4
- command?: (command: Interfaces.Command) => string;
3
+ formatCommand?: (command: Command.Cached) => string;
4
+ command?: (command: Command.Cached) => string;
5
5
  }
6
6
  export declare class HelpCompatibilityWrapper {
7
7
  inner: MaybeCompatibleHelp;
8
8
  constructor(inner: MaybeCompatibleHelp);
9
- formatCommand(command: Interfaces.Command): string;
9
+ formatCommand(command: Command.Cached): string;
10
10
  }
11
11
  export {};
package/lib/log.js CHANGED
@@ -8,6 +8,6 @@ exports.debug = require('debug')('oclif');
8
8
  exports.debug.new = (name) => require('debug')(`oclif:${name}`);
9
9
  function log(format, ...args) {
10
10
  args = args.map((arg) => (0, util_1.prettifyPaths)(arg));
11
- exports.debug.enabled ? (0, exports.debug)(format, ...args) : core_1.CliUx.ux.log(`oclif: ${util.format(format, ...args)}`);
11
+ exports.debug.enabled ? (0, exports.debug)(format, ...args) : core_1.ux.log(`oclif: ${util.format(format, ...args)}`);
12
12
  }
13
13
  exports.log = log;
@@ -41,7 +41,7 @@ async function buildConfig(root, options = {}) {
41
41
  const targets = (0, util_1.compact)(options.targets || updateConfig.node.targets || exports.TARGETS)
42
42
  .filter(t => {
43
43
  if (t === 'darwin-arm64' && semver.lt(nodeVersion, '16.0.0')) {
44
- core_1.CliUx.ux.warn('darwin-arm64 is only supported for node >=16.0.0. Skipping...');
44
+ core_1.ux.warn('darwin-arm64 is only supported for node >=16.0.0. Skipping...');
45
45
  return false;
46
46
  }
47
47
  return true;
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "oclif",
3
3
  "description": "oclif: create your own CLI",
4
- "version": "3.4.6",
4
+ "version": "3.6.0",
5
5
  "author": "Salesforce",
6
6
  "bin": {
7
7
  "oclif": "bin/run"
8
8
  },
9
9
  "bugs": "https://github.com/oclif/oclif/issues",
10
10
  "dependencies": {
11
- "@oclif/core": "^1.24.2",
11
+ "@oclif/core": "^2.0.2-beta.10",
12
12
  "@oclif/plugin-help": "^5.1.19",
13
13
  "@oclif/plugin-not-found": "^2.3.7",
14
14
  "@oclif/plugin-warn-if-update-available": "^2.0.14",
@@ -22,6 +22,7 @@
22
22
  "lodash": "^4.17.21",
23
23
  "normalize-package-data": "^3.0.3",
24
24
  "semver": "^7.3.8",
25
+ "shelljs": "^0.8.5",
25
26
  "tslib": "^2.3.1",
26
27
  "yeoman-environment": "^3.11.1",
27
28
  "yeoman-generator": "^5.6.1",
@@ -29,8 +30,9 @@
29
30
  },
30
31
  "devDependencies": {
31
32
  "@oclif/plugin-legacy": "^1.2.7",
32
- "@oclif/test": "^2.2.12",
33
+ "@oclif/test": "^2.3.0",
33
34
  "@types/chai": "^4.3.4",
35
+ "@types/cli-progress": "^3.11.0",
34
36
  "@types/execa": "^0.9.0",
35
37
  "@types/fs-extra": "^9.0",
36
38
  "@types/lodash": "^4.14.191",
@@ -55,7 +57,6 @@
55
57
  "mocha": "^9.2.2",
56
58
  "npm-run-path": "^4.0.1",
57
59
  "nps": "^5.10.0",
58
- "shelljs": "^0.8.5",
59
60
  "shx": "^0.3.4",
60
61
  "tmp": "^0.2.1",
61
62
  "ts-node": "^10.7.0",