@oclif/plugin-test-esm-1 0.4.11 → 0.5.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 CHANGED
@@ -18,7 +18,7 @@ $ npm install -g @oclif/plugin-test-esm-1
18
18
  $ esm1 COMMAND
19
19
  running command...
20
20
  $ esm1 (--version)
21
- @oclif/plugin-test-esm-1/0.4.11 linux-x64 node-v18.17.1
21
+ @oclif/plugin-test-esm-1/0.5.0 linux-x64 node-v18.17.1
22
22
  $ esm1 --help [COMMAND]
23
23
  USAGE
24
24
  $ esm1 COMMAND
@@ -27,7 +27,7 @@ USAGE
27
27
  <!-- usagestop -->
28
28
  # Commands
29
29
  <!-- commands -->
30
- * [`esm1 esm1`](#esm1-esm1)
30
+ * [`esm1 esm1 [OPTIONALARG] [DEFAULTARG] [DEFAULTFNARG]`](#esm1-esm1-optionalarg-defaultarg-defaultfnarg)
31
31
  * [`esm1 help [COMMANDS]`](#esm1-help-commands)
32
32
  * [`esm1 plugins`](#esm1-plugins)
33
33
  * [`esm1 plugins:install PLUGIN...`](#esm1-pluginsinstall-plugin)
@@ -39,14 +39,23 @@ USAGE
39
39
  * [`esm1 plugins:uninstall PLUGIN...`](#esm1-pluginsuninstall-plugin-2)
40
40
  * [`esm1 plugins update`](#esm1-plugins-update)
41
41
 
42
- ## `esm1 esm1`
42
+ ## `esm1 esm1 [OPTIONALARG] [DEFAULTARG] [DEFAULTFNARG]`
43
43
 
44
44
  ```
45
45
  USAGE
46
- $ esm1 esm1
46
+ $ esm1 esm1 [OPTIONALARG] [DEFAULTARG] [DEFAULTFNARG] [--optionalString <value>] [--defaultString
47
+ <value>] [--defaultFnString <value>] [--json]
48
+
49
+ FLAGS
50
+ --defaultFnString=<value> [default: async fn default]
51
+ --defaultString=<value> [default: simple string default]
52
+ --optionalString=<value>
53
+
54
+ GLOBAL FLAGS
55
+ --json Format output as json.
47
56
  ```
48
57
 
49
- _See code: [dist/commands/esm1.ts](https://github.com/oclif/plugin-test-esm-1/blob/v0.4.11/dist/commands/esm1.ts)_
58
+ _See code: [dist/commands/esm1.ts](https://github.com/oclif/plugin-test-esm-1/blob/v0.5.0/dist/commands/esm1.ts)_
50
59
 
51
60
  ## `esm1 help [COMMANDS]`
52
61
 
@@ -1,4 +1,20 @@
1
- import { Command } from '@oclif/core';
1
+ import { Command, Interfaces } from '@oclif/core';
2
+ type Result = {
3
+ args: Interfaces.InferredArgs<typeof ESM1.args>;
4
+ flags: Interfaces.InferredFlags<typeof ESM1.flags>;
5
+ };
2
6
  export default class ESM1 extends Command {
3
- run(): Promise<void>;
7
+ static flags: {
8
+ optionalString: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
9
+ defaultString: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
10
+ defaultFnString: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
11
+ };
12
+ static args: {
13
+ optionalArg: Interfaces.Arg<string | undefined, Record<string, unknown>>;
14
+ defaultArg: Interfaces.Arg<string, Record<string, unknown>>;
15
+ defaultFnArg: Interfaces.Arg<string, Record<string, unknown>>;
16
+ };
17
+ static enableJsonFlag: boolean;
18
+ run(): Promise<Result>;
4
19
  }
20
+ export {};
@@ -1,6 +1,29 @@
1
- import { Command } from '@oclif/core';
1
+ var _a;
2
+ import { Args, Command, Flags } from '@oclif/core';
2
3
  export default class ESM1 extends Command {
3
4
  async run() {
5
+ const { args, flags } = await this.parse(ESM1);
4
6
  this.log(`hello I am an ESM plugin from ${this.config.root}!`);
7
+ return { args, flags };
5
8
  }
6
9
  }
10
+ _a = ESM1;
11
+ ESM1.flags = {
12
+ optionalString: Flags.string(),
13
+ defaultString: Flags.string({
14
+ default: 'simple string default',
15
+ }),
16
+ defaultFnString: Flags.string({
17
+ default: async () => Promise.resolve('async fn default'),
18
+ }),
19
+ };
20
+ ESM1.args = {
21
+ optionalArg: Args.string(),
22
+ defaultArg: Args.string({
23
+ default: 'simple string default',
24
+ }),
25
+ defaultFnArg: Args.string({
26
+ default: async () => Promise.resolve('async fn default'),
27
+ }),
28
+ };
29
+ ESM1.enableJsonFlag = true;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.4.11",
2
+ "version": "0.5.0",
3
3
  "commands": {
4
4
  "esm1": {
5
5
  "id": "esm1",
@@ -8,8 +8,45 @@
8
8
  "pluginAlias": "@oclif/plugin-test-esm-1",
9
9
  "pluginType": "core",
10
10
  "aliases": [],
11
- "flags": {},
12
- "args": {}
11
+ "flags": {
12
+ "optionalString": {
13
+ "name": "optionalString",
14
+ "type": "option",
15
+ "multiple": false
16
+ },
17
+ "defaultString": {
18
+ "name": "defaultString",
19
+ "type": "option",
20
+ "multiple": false,
21
+ "default": "simple string default"
22
+ },
23
+ "defaultFnString": {
24
+ "name": "defaultFnString",
25
+ "type": "option",
26
+ "multiple": false,
27
+ "default": "async fn default"
28
+ },
29
+ "json": {
30
+ "name": "json",
31
+ "type": "boolean",
32
+ "description": "Format output as json.",
33
+ "helpGroup": "GLOBAL",
34
+ "allowNo": false
35
+ }
36
+ },
37
+ "args": {
38
+ "optionalArg": {
39
+ "name": "optionalArg"
40
+ },
41
+ "defaultArg": {
42
+ "name": "defaultArg",
43
+ "default": "simple string default"
44
+ },
45
+ "defaultFnArg": {
46
+ "name": "defaultFnArg",
47
+ "default": "async fn default"
48
+ }
49
+ }
13
50
  }
14
51
  }
15
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oclif/plugin-test-esm-1",
3
- "version": "0.4.11",
3
+ "version": "0.5.0",
4
4
  "description": "Test ESM plugin",
5
5
  "author": "Salesforce",
6
6
  "bin": {
@@ -31,7 +31,7 @@
31
31
  "eslint-config-oclif": "^4",
32
32
  "eslint-config-oclif-typescript": "^1.0.3",
33
33
  "mocha": "^9",
34
- "oclif": "^3.14.0",
34
+ "oclif": "^3.16.0",
35
35
  "shx": "^0.3.4",
36
36
  "ts-node": "^10.9.1",
37
37
  "tslib": "^2.6.2",