@oclif/core 2.0.0-beta.5 → 2.0.0-beta.7

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/lib/command.d.ts CHANGED
@@ -105,7 +105,7 @@ export declare abstract class Command {
105
105
  /**
106
106
  * actual command run code goes here
107
107
  */
108
- abstract run(): PromiseLike<any>;
108
+ abstract run(): Promise<any>;
109
109
  protected init(): Promise<any>;
110
110
  protected warnIfFlagDeprecated(flags: Record<string, unknown>): void;
111
111
  protected warnIfCommandDeprecated(): void;
@@ -118,7 +118,7 @@ export declare abstract class Command {
118
118
  export declare namespace Command {
119
119
  type Class = typeof Command & {
120
120
  id: string;
121
- run(argv?: string[], config?: LoadOptions): PromiseLike<any>;
121
+ run(argv?: string[], config?: LoadOptions): Promise<any>;
122
122
  };
123
123
  interface Loadable extends Cached {
124
124
  load(): Promise<Command.Class>;
package/lib/command.js CHANGED
@@ -63,6 +63,11 @@ class Command {
63
63
  }
64
64
  const config = await config_1.Config.load(opts || require.main?.filename || __dirname);
65
65
  const cmd = new this(argv, config);
66
+ if (!cmd.id) {
67
+ const id = cmd.constructor.name.toLowerCase();
68
+ cmd.id = id;
69
+ cmd.ctor.id = id;
70
+ }
66
71
  return cmd._run();
67
72
  }
68
73
  static get baseFlags() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oclif/core",
3
3
  "description": "base library for oclif CLIs",
4
- "version": "2.0.0-beta.5",
4
+ "version": "2.0.0-beta.7",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {