@oclif/plugin-test-core-v3 0.1.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.
- package/README.md +415 -0
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +6 -0
- package/bin/run.cmd +3 -0
- package/bin/run.js +7 -0
- package/dist/commands/core-v3.d.ts +20 -0
- package/dist/commands/core-v3.js +31 -0
- package/dist/commands/hello/index.d.ts +12 -0
- package/dist/commands/hello/index.js +22 -0
- package/dist/commands/hello/world.d.ts +8 -0
- package/dist/commands/hello/world.js +17 -0
- package/dist/hooks/init/init.d.ts +3 -0
- package/dist/hooks/init/init.js +6 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -0
- package/oclif.manifest.json +128 -0
- package/package.json +72 -0
package/README.md
ADDED
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
@oclif/plugin-test-core-v3
|
|
2
|
+
=================
|
|
3
|
+
|
|
4
|
+
Test plugin that uses @oclif/core v3
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
[](https://oclif.io)
|
|
8
|
+
[](https://npmjs.org/package/@oclif/plugin-test-core-v3)
|
|
9
|
+
[](https://npmjs.org/package/@oclif/plugin-test-core-v3)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
<!-- toc -->
|
|
13
|
+
* [Usage](#usage)
|
|
14
|
+
* [Commands](#commands)
|
|
15
|
+
<!-- tocstop -->
|
|
16
|
+
# Usage
|
|
17
|
+
<!-- usage -->
|
|
18
|
+
```sh-session
|
|
19
|
+
$ npm install -g @oclif/plugin-test-core-v3
|
|
20
|
+
$ corev3 COMMAND
|
|
21
|
+
running command...
|
|
22
|
+
$ corev3 (--version)
|
|
23
|
+
@oclif/plugin-test-core-v3/0.1.0 linux-x64 node-v20.13.1
|
|
24
|
+
$ corev3 --help [COMMAND]
|
|
25
|
+
USAGE
|
|
26
|
+
$ corev3 COMMAND
|
|
27
|
+
...
|
|
28
|
+
```
|
|
29
|
+
<!-- usagestop -->
|
|
30
|
+
# Commands
|
|
31
|
+
<!-- commands -->
|
|
32
|
+
* [`corev3 core-v3 [OPTIONALARG] [DEFAULTARG] [DEFAULTFNARG]`](#corev3-core-v3-optionalarg-defaultarg-defaultfnarg)
|
|
33
|
+
* [`corev3 hello PERSON`](#corev3-hello-person)
|
|
34
|
+
* [`corev3 hello world`](#corev3-hello-world)
|
|
35
|
+
* [`corev3 help [COMMAND]`](#corev3-help-command)
|
|
36
|
+
* [`corev3 plugins`](#corev3-plugins)
|
|
37
|
+
* [`corev3 plugins add PLUGIN`](#corev3-plugins-add-plugin)
|
|
38
|
+
* [`corev3 plugins:inspect PLUGIN...`](#corev3-pluginsinspect-plugin)
|
|
39
|
+
* [`corev3 plugins install PLUGIN`](#corev3-plugins-install-plugin)
|
|
40
|
+
* [`corev3 plugins link PATH`](#corev3-plugins-link-path)
|
|
41
|
+
* [`corev3 plugins remove [PLUGIN]`](#corev3-plugins-remove-plugin)
|
|
42
|
+
* [`corev3 plugins reset`](#corev3-plugins-reset)
|
|
43
|
+
* [`corev3 plugins uninstall [PLUGIN]`](#corev3-plugins-uninstall-plugin)
|
|
44
|
+
* [`corev3 plugins unlink [PLUGIN]`](#corev3-plugins-unlink-plugin)
|
|
45
|
+
* [`corev3 plugins update`](#corev3-plugins-update)
|
|
46
|
+
|
|
47
|
+
## `corev3 core-v3 [OPTIONALARG] [DEFAULTARG] [DEFAULTFNARG]`
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
USAGE
|
|
51
|
+
$ corev3 core-v3 [OPTIONALARG] [DEFAULTARG] [DEFAULTFNARG] [--json] [--optionalString <value>]
|
|
52
|
+
[--defaultString <value>] [--defaultFnString <value>]
|
|
53
|
+
|
|
54
|
+
FLAGS
|
|
55
|
+
--defaultFnString=<value> [default: async fn default]
|
|
56
|
+
--defaultString=<value> [default: simple string default]
|
|
57
|
+
--optionalString=<value>
|
|
58
|
+
|
|
59
|
+
GLOBAL FLAGS
|
|
60
|
+
--json Format output as json.
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
_See code: [src/commands/core-v3.ts](https://github.com/oclif/plugin-test-core-v3/blob/v0.1.0/src/commands/core-v3.ts)_
|
|
64
|
+
|
|
65
|
+
## `corev3 hello PERSON`
|
|
66
|
+
|
|
67
|
+
Say hello
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
USAGE
|
|
71
|
+
$ corev3 hello PERSON -f <value>
|
|
72
|
+
|
|
73
|
+
ARGUMENTS
|
|
74
|
+
PERSON Person to say hello to
|
|
75
|
+
|
|
76
|
+
FLAGS
|
|
77
|
+
-f, --from=<value> (required) Who is saying hello
|
|
78
|
+
|
|
79
|
+
DESCRIPTION
|
|
80
|
+
Say hello
|
|
81
|
+
|
|
82
|
+
EXAMPLES
|
|
83
|
+
$ corev3 hello friend --from oclif
|
|
84
|
+
hello friend from oclif! (./src/commands/hello/index.ts)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
_See code: [src/commands/hello/index.ts](https://github.com/oclif/plugin-test-core-v3/blob/v0.1.0/src/commands/hello/index.ts)_
|
|
88
|
+
|
|
89
|
+
## `corev3 hello world`
|
|
90
|
+
|
|
91
|
+
Say hello world
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
USAGE
|
|
95
|
+
$ corev3 hello world
|
|
96
|
+
|
|
97
|
+
DESCRIPTION
|
|
98
|
+
Say hello world
|
|
99
|
+
|
|
100
|
+
EXAMPLES
|
|
101
|
+
$ corev3 hello world
|
|
102
|
+
hello world! (./src/commands/hello/world.ts)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
_See code: [src/commands/hello/world.ts](https://github.com/oclif/plugin-test-core-v3/blob/v0.1.0/src/commands/hello/world.ts)_
|
|
106
|
+
|
|
107
|
+
## `corev3 help [COMMAND]`
|
|
108
|
+
|
|
109
|
+
Display help for corev3.
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
USAGE
|
|
113
|
+
$ corev3 help [COMMAND...] [-n]
|
|
114
|
+
|
|
115
|
+
ARGUMENTS
|
|
116
|
+
COMMAND... Command to show help for.
|
|
117
|
+
|
|
118
|
+
FLAGS
|
|
119
|
+
-n, --nested-commands Include all nested commands in the output.
|
|
120
|
+
|
|
121
|
+
DESCRIPTION
|
|
122
|
+
Display help for corev3.
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.0.22/src/commands/help.ts)_
|
|
126
|
+
|
|
127
|
+
## `corev3 plugins`
|
|
128
|
+
|
|
129
|
+
List installed plugins.
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
USAGE
|
|
133
|
+
$ corev3 plugins [--json] [--core]
|
|
134
|
+
|
|
135
|
+
FLAGS
|
|
136
|
+
--core Show core plugins.
|
|
137
|
+
|
|
138
|
+
GLOBAL FLAGS
|
|
139
|
+
--json Format output as json.
|
|
140
|
+
|
|
141
|
+
DESCRIPTION
|
|
142
|
+
List installed plugins.
|
|
143
|
+
|
|
144
|
+
EXAMPLES
|
|
145
|
+
$ corev3 plugins
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.1.2/src/commands/plugins/index.ts)_
|
|
149
|
+
|
|
150
|
+
## `corev3 plugins add PLUGIN`
|
|
151
|
+
|
|
152
|
+
Installs a plugin into corev3.
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
USAGE
|
|
156
|
+
$ corev3 plugins add PLUGIN... [--json] [-f] [-h] [-s | -v]
|
|
157
|
+
|
|
158
|
+
ARGUMENTS
|
|
159
|
+
PLUGIN... Plugin to install.
|
|
160
|
+
|
|
161
|
+
FLAGS
|
|
162
|
+
-f, --force Force npm to fetch remote resources even if a local copy exists on disk.
|
|
163
|
+
-h, --help Show CLI help.
|
|
164
|
+
-s, --silent Silences npm output.
|
|
165
|
+
-v, --verbose Show verbose npm output.
|
|
166
|
+
|
|
167
|
+
GLOBAL FLAGS
|
|
168
|
+
--json Format output as json.
|
|
169
|
+
|
|
170
|
+
DESCRIPTION
|
|
171
|
+
Installs a plugin into corev3.
|
|
172
|
+
|
|
173
|
+
Uses bundled npm executable to install plugins into /home/runner/.local/share/corev3
|
|
174
|
+
|
|
175
|
+
Installation of a user-installed plugin will override a core plugin.
|
|
176
|
+
|
|
177
|
+
Use the COREV3_NPM_LOG_LEVEL environment variable to set the npm loglevel.
|
|
178
|
+
Use the COREV3_NPM_REGISTRY environment variable to set the npm registry.
|
|
179
|
+
|
|
180
|
+
ALIASES
|
|
181
|
+
$ corev3 plugins add
|
|
182
|
+
|
|
183
|
+
EXAMPLES
|
|
184
|
+
Install a plugin from npm registry.
|
|
185
|
+
|
|
186
|
+
$ corev3 plugins add myplugin
|
|
187
|
+
|
|
188
|
+
Install a plugin from a github url.
|
|
189
|
+
|
|
190
|
+
$ corev3 plugins add https://github.com/someuser/someplugin
|
|
191
|
+
|
|
192
|
+
Install a plugin from a github slug.
|
|
193
|
+
|
|
194
|
+
$ corev3 plugins add someuser/someplugin
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## `corev3 plugins:inspect PLUGIN...`
|
|
198
|
+
|
|
199
|
+
Displays installation properties of a plugin.
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
USAGE
|
|
203
|
+
$ corev3 plugins inspect PLUGIN...
|
|
204
|
+
|
|
205
|
+
ARGUMENTS
|
|
206
|
+
PLUGIN... [default: .] Plugin to inspect.
|
|
207
|
+
|
|
208
|
+
FLAGS
|
|
209
|
+
-h, --help Show CLI help.
|
|
210
|
+
-v, --verbose
|
|
211
|
+
|
|
212
|
+
GLOBAL FLAGS
|
|
213
|
+
--json Format output as json.
|
|
214
|
+
|
|
215
|
+
DESCRIPTION
|
|
216
|
+
Displays installation properties of a plugin.
|
|
217
|
+
|
|
218
|
+
EXAMPLES
|
|
219
|
+
$ corev3 plugins inspect myplugin
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.1.2/src/commands/plugins/inspect.ts)_
|
|
223
|
+
|
|
224
|
+
## `corev3 plugins install PLUGIN`
|
|
225
|
+
|
|
226
|
+
Installs a plugin into corev3.
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
USAGE
|
|
230
|
+
$ corev3 plugins install PLUGIN... [--json] [-f] [-h] [-s | -v]
|
|
231
|
+
|
|
232
|
+
ARGUMENTS
|
|
233
|
+
PLUGIN... Plugin to install.
|
|
234
|
+
|
|
235
|
+
FLAGS
|
|
236
|
+
-f, --force Force npm to fetch remote resources even if a local copy exists on disk.
|
|
237
|
+
-h, --help Show CLI help.
|
|
238
|
+
-s, --silent Silences npm output.
|
|
239
|
+
-v, --verbose Show verbose npm output.
|
|
240
|
+
|
|
241
|
+
GLOBAL FLAGS
|
|
242
|
+
--json Format output as json.
|
|
243
|
+
|
|
244
|
+
DESCRIPTION
|
|
245
|
+
Installs a plugin into corev3.
|
|
246
|
+
|
|
247
|
+
Uses bundled npm executable to install plugins into /home/runner/.local/share/corev3
|
|
248
|
+
|
|
249
|
+
Installation of a user-installed plugin will override a core plugin.
|
|
250
|
+
|
|
251
|
+
Use the COREV3_NPM_LOG_LEVEL environment variable to set the npm loglevel.
|
|
252
|
+
Use the COREV3_NPM_REGISTRY environment variable to set the npm registry.
|
|
253
|
+
|
|
254
|
+
ALIASES
|
|
255
|
+
$ corev3 plugins add
|
|
256
|
+
|
|
257
|
+
EXAMPLES
|
|
258
|
+
Install a plugin from npm registry.
|
|
259
|
+
|
|
260
|
+
$ corev3 plugins install myplugin
|
|
261
|
+
|
|
262
|
+
Install a plugin from a github url.
|
|
263
|
+
|
|
264
|
+
$ corev3 plugins install https://github.com/someuser/someplugin
|
|
265
|
+
|
|
266
|
+
Install a plugin from a github slug.
|
|
267
|
+
|
|
268
|
+
$ corev3 plugins install someuser/someplugin
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.1.2/src/commands/plugins/install.ts)_
|
|
272
|
+
|
|
273
|
+
## `corev3 plugins link PATH`
|
|
274
|
+
|
|
275
|
+
Links a plugin into the CLI for development.
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
USAGE
|
|
279
|
+
$ corev3 plugins link PATH [-h] [--install] [-v]
|
|
280
|
+
|
|
281
|
+
ARGUMENTS
|
|
282
|
+
PATH [default: .] path to plugin
|
|
283
|
+
|
|
284
|
+
FLAGS
|
|
285
|
+
-h, --help Show CLI help.
|
|
286
|
+
-v, --verbose
|
|
287
|
+
--[no-]install Install dependencies after linking the plugin.
|
|
288
|
+
|
|
289
|
+
DESCRIPTION
|
|
290
|
+
Links a plugin into the CLI for development.
|
|
291
|
+
Installation of a linked plugin will override a user-installed or core plugin.
|
|
292
|
+
|
|
293
|
+
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
|
|
294
|
+
command will override the user-installed or core plugin implementation. This is useful for development work.
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
EXAMPLES
|
|
298
|
+
$ corev3 plugins link myplugin
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.1.2/src/commands/plugins/link.ts)_
|
|
302
|
+
|
|
303
|
+
## `corev3 plugins remove [PLUGIN]`
|
|
304
|
+
|
|
305
|
+
Removes a plugin from the CLI.
|
|
306
|
+
|
|
307
|
+
```
|
|
308
|
+
USAGE
|
|
309
|
+
$ corev3 plugins remove [PLUGIN...] [-h] [-v]
|
|
310
|
+
|
|
311
|
+
ARGUMENTS
|
|
312
|
+
PLUGIN... plugin to uninstall
|
|
313
|
+
|
|
314
|
+
FLAGS
|
|
315
|
+
-h, --help Show CLI help.
|
|
316
|
+
-v, --verbose
|
|
317
|
+
|
|
318
|
+
DESCRIPTION
|
|
319
|
+
Removes a plugin from the CLI.
|
|
320
|
+
|
|
321
|
+
ALIASES
|
|
322
|
+
$ corev3 plugins unlink
|
|
323
|
+
$ corev3 plugins remove
|
|
324
|
+
|
|
325
|
+
EXAMPLES
|
|
326
|
+
$ corev3 plugins remove myplugin
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## `corev3 plugins reset`
|
|
330
|
+
|
|
331
|
+
Remove all user-installed and linked plugins.
|
|
332
|
+
|
|
333
|
+
```
|
|
334
|
+
USAGE
|
|
335
|
+
$ corev3 plugins reset [--hard] [--reinstall]
|
|
336
|
+
|
|
337
|
+
FLAGS
|
|
338
|
+
--hard Delete node_modules and package manager related files in addition to uninstalling plugins.
|
|
339
|
+
--reinstall Reinstall all plugins after uninstalling.
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.1.2/src/commands/plugins/reset.ts)_
|
|
343
|
+
|
|
344
|
+
## `corev3 plugins uninstall [PLUGIN]`
|
|
345
|
+
|
|
346
|
+
Removes a plugin from the CLI.
|
|
347
|
+
|
|
348
|
+
```
|
|
349
|
+
USAGE
|
|
350
|
+
$ corev3 plugins uninstall [PLUGIN...] [-h] [-v]
|
|
351
|
+
|
|
352
|
+
ARGUMENTS
|
|
353
|
+
PLUGIN... plugin to uninstall
|
|
354
|
+
|
|
355
|
+
FLAGS
|
|
356
|
+
-h, --help Show CLI help.
|
|
357
|
+
-v, --verbose
|
|
358
|
+
|
|
359
|
+
DESCRIPTION
|
|
360
|
+
Removes a plugin from the CLI.
|
|
361
|
+
|
|
362
|
+
ALIASES
|
|
363
|
+
$ corev3 plugins unlink
|
|
364
|
+
$ corev3 plugins remove
|
|
365
|
+
|
|
366
|
+
EXAMPLES
|
|
367
|
+
$ corev3 plugins uninstall myplugin
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.1.2/src/commands/plugins/uninstall.ts)_
|
|
371
|
+
|
|
372
|
+
## `corev3 plugins unlink [PLUGIN]`
|
|
373
|
+
|
|
374
|
+
Removes a plugin from the CLI.
|
|
375
|
+
|
|
376
|
+
```
|
|
377
|
+
USAGE
|
|
378
|
+
$ corev3 plugins unlink [PLUGIN...] [-h] [-v]
|
|
379
|
+
|
|
380
|
+
ARGUMENTS
|
|
381
|
+
PLUGIN... plugin to uninstall
|
|
382
|
+
|
|
383
|
+
FLAGS
|
|
384
|
+
-h, --help Show CLI help.
|
|
385
|
+
-v, --verbose
|
|
386
|
+
|
|
387
|
+
DESCRIPTION
|
|
388
|
+
Removes a plugin from the CLI.
|
|
389
|
+
|
|
390
|
+
ALIASES
|
|
391
|
+
$ corev3 plugins unlink
|
|
392
|
+
$ corev3 plugins remove
|
|
393
|
+
|
|
394
|
+
EXAMPLES
|
|
395
|
+
$ corev3 plugins unlink myplugin
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
## `corev3 plugins update`
|
|
399
|
+
|
|
400
|
+
Update installed plugins.
|
|
401
|
+
|
|
402
|
+
```
|
|
403
|
+
USAGE
|
|
404
|
+
$ corev3 plugins update [-h] [-v]
|
|
405
|
+
|
|
406
|
+
FLAGS
|
|
407
|
+
-h, --help Show CLI help.
|
|
408
|
+
-v, --verbose
|
|
409
|
+
|
|
410
|
+
DESCRIPTION
|
|
411
|
+
Update installed plugins.
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.1.2/src/commands/plugins/update.ts)_
|
|
415
|
+
<!-- commandsstop -->
|
package/bin/dev.cmd
ADDED
package/bin/dev.js
ADDED
package/bin/run.cmd
ADDED
package/bin/run.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Command, Interfaces } from '@oclif/core';
|
|
2
|
+
type Result = {
|
|
3
|
+
args: Interfaces.InferredArgs<typeof CoreV3.args>;
|
|
4
|
+
flags: Interfaces.InferredFlags<typeof CoreV3.flags>;
|
|
5
|
+
};
|
|
6
|
+
export default class CoreV3 extends Command {
|
|
7
|
+
static args: {
|
|
8
|
+
optionalArg: Interfaces.Arg<string | undefined, Record<string, unknown>>;
|
|
9
|
+
defaultArg: Interfaces.Arg<string, Record<string, unknown>>;
|
|
10
|
+
defaultFnArg: Interfaces.Arg<string, Record<string, unknown>>;
|
|
11
|
+
};
|
|
12
|
+
static enableJsonFlag: boolean;
|
|
13
|
+
static flags: {
|
|
14
|
+
optionalString: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
15
|
+
defaultString: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
16
|
+
defaultFnString: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<Result>;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable perfectionist/sort-objects */
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
class CoreV3 extends core_1.Command {
|
|
6
|
+
static args = {
|
|
7
|
+
optionalArg: core_1.Args.string(),
|
|
8
|
+
defaultArg: core_1.Args.string({
|
|
9
|
+
default: 'simple string default',
|
|
10
|
+
}),
|
|
11
|
+
defaultFnArg: core_1.Args.string({
|
|
12
|
+
default: async () => 'async fn default',
|
|
13
|
+
}),
|
|
14
|
+
};
|
|
15
|
+
static enableJsonFlag = true;
|
|
16
|
+
static flags = {
|
|
17
|
+
optionalString: core_1.Flags.string(),
|
|
18
|
+
defaultString: core_1.Flags.string({
|
|
19
|
+
default: 'simple string default',
|
|
20
|
+
}),
|
|
21
|
+
defaultFnString: core_1.Flags.string({
|
|
22
|
+
default: async () => 'async fn default',
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
async run() {
|
|
26
|
+
const { args, flags } = await this.parse(CoreV3);
|
|
27
|
+
this.log(`hello I am an @oclif/core@v3 plugin from ${this.config.root}!`);
|
|
28
|
+
return { args, flags };
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.default = CoreV3;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class Hello extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
person: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
from: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
class Hello extends core_1.Command {
|
|
5
|
+
static args = {
|
|
6
|
+
person: core_1.Args.string({ description: 'Person to say hello to', required: true }),
|
|
7
|
+
};
|
|
8
|
+
static description = 'Say hello';
|
|
9
|
+
static examples = [
|
|
10
|
+
`<%= config.bin %> <%= command.id %> friend --from oclif
|
|
11
|
+
hello friend from oclif! (./src/commands/hello/index.ts)
|
|
12
|
+
`,
|
|
13
|
+
];
|
|
14
|
+
static flags = {
|
|
15
|
+
from: core_1.Flags.string({ char: 'f', description: 'Who is saying hello', required: true }),
|
|
16
|
+
};
|
|
17
|
+
async run() {
|
|
18
|
+
const { args, flags } = await this.parse(Hello);
|
|
19
|
+
this.log(`hello ${args.person} from ${flags.from}! (./src/commands/hello/index.ts)`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = Hello;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
class World extends core_1.Command {
|
|
5
|
+
static args = {};
|
|
6
|
+
static description = 'Say hello world';
|
|
7
|
+
static examples = [
|
|
8
|
+
`<%= config.bin %> <%= command.id %>
|
|
9
|
+
hello world! (./src/commands/hello/world.ts)
|
|
10
|
+
`,
|
|
11
|
+
];
|
|
12
|
+
static flags = {};
|
|
13
|
+
async run() {
|
|
14
|
+
this.log('hello world! (./src/commands/hello/world.ts)');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = World;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { run } from '@oclif/core';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
{
|
|
2
|
+
"commands": {
|
|
3
|
+
"core-v3": {
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"args": {
|
|
6
|
+
"optionalArg": {
|
|
7
|
+
"name": "optionalArg"
|
|
8
|
+
},
|
|
9
|
+
"defaultArg": {
|
|
10
|
+
"default": "simple string default",
|
|
11
|
+
"name": "defaultArg"
|
|
12
|
+
},
|
|
13
|
+
"defaultFnArg": {
|
|
14
|
+
"default": "async fn default",
|
|
15
|
+
"name": "defaultFnArg"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"flags": {
|
|
19
|
+
"json": {
|
|
20
|
+
"description": "Format output as json.",
|
|
21
|
+
"helpGroup": "GLOBAL",
|
|
22
|
+
"name": "json",
|
|
23
|
+
"allowNo": false,
|
|
24
|
+
"type": "boolean"
|
|
25
|
+
},
|
|
26
|
+
"optionalString": {
|
|
27
|
+
"name": "optionalString",
|
|
28
|
+
"hasDynamicHelp": false,
|
|
29
|
+
"multiple": false,
|
|
30
|
+
"type": "option"
|
|
31
|
+
},
|
|
32
|
+
"defaultString": {
|
|
33
|
+
"name": "defaultString",
|
|
34
|
+
"default": "simple string default",
|
|
35
|
+
"hasDynamicHelp": false,
|
|
36
|
+
"multiple": false,
|
|
37
|
+
"type": "option"
|
|
38
|
+
},
|
|
39
|
+
"defaultFnString": {
|
|
40
|
+
"name": "defaultFnString",
|
|
41
|
+
"default": "async fn default",
|
|
42
|
+
"hasDynamicHelp": false,
|
|
43
|
+
"multiple": false,
|
|
44
|
+
"type": "option"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"hasDynamicHelp": false,
|
|
48
|
+
"hiddenAliases": [],
|
|
49
|
+
"id": "core-v3",
|
|
50
|
+
"pluginAlias": "@oclif/plugin-test-core-v3",
|
|
51
|
+
"pluginName": "@oclif/plugin-test-core-v3",
|
|
52
|
+
"pluginType": "core",
|
|
53
|
+
"strict": true,
|
|
54
|
+
"enableJsonFlag": true,
|
|
55
|
+
"isESM": false,
|
|
56
|
+
"relativePath": [
|
|
57
|
+
"dist",
|
|
58
|
+
"commands",
|
|
59
|
+
"core-v3.js"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"hello": {
|
|
63
|
+
"aliases": [],
|
|
64
|
+
"args": {
|
|
65
|
+
"person": {
|
|
66
|
+
"description": "Person to say hello to",
|
|
67
|
+
"name": "person",
|
|
68
|
+
"required": true
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"description": "Say hello",
|
|
72
|
+
"examples": [
|
|
73
|
+
"<%= config.bin %> <%= command.id %> friend --from oclif\nhello friend from oclif! (./src/commands/hello/index.ts)\n"
|
|
74
|
+
],
|
|
75
|
+
"flags": {
|
|
76
|
+
"from": {
|
|
77
|
+
"char": "f",
|
|
78
|
+
"description": "Who is saying hello",
|
|
79
|
+
"name": "from",
|
|
80
|
+
"required": true,
|
|
81
|
+
"hasDynamicHelp": false,
|
|
82
|
+
"multiple": false,
|
|
83
|
+
"type": "option"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"hasDynamicHelp": false,
|
|
87
|
+
"hiddenAliases": [],
|
|
88
|
+
"id": "hello",
|
|
89
|
+
"pluginAlias": "@oclif/plugin-test-core-v3",
|
|
90
|
+
"pluginName": "@oclif/plugin-test-core-v3",
|
|
91
|
+
"pluginType": "core",
|
|
92
|
+
"strict": true,
|
|
93
|
+
"enableJsonFlag": false,
|
|
94
|
+
"isESM": false,
|
|
95
|
+
"relativePath": [
|
|
96
|
+
"dist",
|
|
97
|
+
"commands",
|
|
98
|
+
"hello",
|
|
99
|
+
"index.js"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"hello:world": {
|
|
103
|
+
"aliases": [],
|
|
104
|
+
"args": {},
|
|
105
|
+
"description": "Say hello world",
|
|
106
|
+
"examples": [
|
|
107
|
+
"<%= config.bin %> <%= command.id %>\nhello world! (./src/commands/hello/world.ts)\n"
|
|
108
|
+
],
|
|
109
|
+
"flags": {},
|
|
110
|
+
"hasDynamicHelp": false,
|
|
111
|
+
"hiddenAliases": [],
|
|
112
|
+
"id": "hello:world",
|
|
113
|
+
"pluginAlias": "@oclif/plugin-test-core-v3",
|
|
114
|
+
"pluginName": "@oclif/plugin-test-core-v3",
|
|
115
|
+
"pluginType": "core",
|
|
116
|
+
"strict": true,
|
|
117
|
+
"enableJsonFlag": false,
|
|
118
|
+
"isESM": false,
|
|
119
|
+
"relativePath": [
|
|
120
|
+
"dist",
|
|
121
|
+
"commands",
|
|
122
|
+
"hello",
|
|
123
|
+
"world.js"
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"version": "0.1.0"
|
|
128
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oclif/plugin-test-core-v3",
|
|
3
|
+
"description": "Test plugin that uses @oclif/core v3",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"author": "Salesforce",
|
|
6
|
+
"bin": {
|
|
7
|
+
"corev3": "./bin/run.js"
|
|
8
|
+
},
|
|
9
|
+
"bugs": "https://github.com/oclif/plugin-test-core-v3/issues",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@oclif/core": "^3",
|
|
12
|
+
"@oclif/plugin-help": "^6",
|
|
13
|
+
"@oclif/plugin-plugins": "^5"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@oclif/prettier-config": "^0.2.1",
|
|
17
|
+
"@oclif/test": "^3",
|
|
18
|
+
"@types/chai": "^4",
|
|
19
|
+
"@types/mocha": "^10",
|
|
20
|
+
"@types/node": "^18",
|
|
21
|
+
"chai": "^4",
|
|
22
|
+
"eslint": "^8",
|
|
23
|
+
"eslint-config-oclif": "^5",
|
|
24
|
+
"eslint-config-oclif-typescript": "^3",
|
|
25
|
+
"eslint-config-prettier": "^9",
|
|
26
|
+
"mocha": "^10",
|
|
27
|
+
"oclif": "^4",
|
|
28
|
+
"shx": "^0.3.3",
|
|
29
|
+
"ts-node": "^10",
|
|
30
|
+
"typescript": "^5"
|
|
31
|
+
},
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=18.0.0"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"/bin",
|
|
37
|
+
"/dist",
|
|
38
|
+
"/oclif.manifest.json"
|
|
39
|
+
],
|
|
40
|
+
"homepage": "https://github.com/oclif/plugin-test-core-v3",
|
|
41
|
+
"keywords": [
|
|
42
|
+
"oclif"
|
|
43
|
+
],
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"main": "dist/index.js",
|
|
46
|
+
"oclif": {
|
|
47
|
+
"bin": "corev3",
|
|
48
|
+
"dirname": "corev3",
|
|
49
|
+
"commands": "./dist/commands",
|
|
50
|
+
"plugins": [
|
|
51
|
+
"@oclif/plugin-help",
|
|
52
|
+
"@oclif/plugin-plugins"
|
|
53
|
+
],
|
|
54
|
+
"topicSeparator": " ",
|
|
55
|
+
"topics": {
|
|
56
|
+
"hello": {
|
|
57
|
+
"description": "Say hello to the world and others"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"repository": "oclif/plugin-test-core-v3",
|
|
62
|
+
"scripts": {
|
|
63
|
+
"build": "shx rm -rf dist && tsc -b",
|
|
64
|
+
"lint": "eslint . --ext .ts",
|
|
65
|
+
"postpack": "shx rm -f oclif.manifest.json",
|
|
66
|
+
"posttest": "yarn lint",
|
|
67
|
+
"prepack": "oclif manifest && oclif readme",
|
|
68
|
+
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
69
|
+
"version": "oclif readme && git add README.md"
|
|
70
|
+
},
|
|
71
|
+
"types": "dist/index.d.ts"
|
|
72
|
+
}
|