@oclif/core 2.1.4 → 2.1.6

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.
@@ -132,5 +132,6 @@ export declare class Config implements IConfig {
132
132
  * @returns command instance {Command.Loadable} or undefined
133
133
  */
134
134
  private determinePriority;
135
+ private insertLegacyPlugins;
135
136
  }
136
137
  export declare function toCached(c: Command.Class, plugin?: IPlugin): Promise<Command.Cached>;
@@ -239,6 +239,9 @@ class Config {
239
239
  await withTimeout(timeout, search(module).call(context, { ...opts, config: this })) :
240
240
  await search(module).call(context, { ...opts, config: this });
241
241
  final.successes.push({ plugin: p, result });
242
+ if (p.name === '@oclif/plugin-legacy' && event === 'init') {
243
+ this.insertLegacyPlugins(result);
244
+ }
242
245
  debug('done');
243
246
  }
244
247
  catch (error) {
@@ -548,7 +551,7 @@ class Config {
548
551
  for (const alias of command.aliases ?? []) {
549
552
  if (this._commands.has(alias)) {
550
553
  const prioritizedCommand = this.determinePriority([this._commands.get(alias), command]);
551
- this._commands.set(prioritizedCommand.id, { ...prioritizedCommand, id: alias });
554
+ this._commands.set(alias, { ...prioritizedCommand, id: alias });
552
555
  }
553
556
  else {
554
557
  this._commands.set(alias, { ...command, id: alias });
@@ -639,6 +642,14 @@ class Config {
639
642
  });
640
643
  return commandPlugins[0];
641
644
  }
645
+ insertLegacyPlugins(plugins) {
646
+ for (const plugin of plugins) {
647
+ const idx = this.plugins.findIndex(p => p.name === plugin.name);
648
+ if (idx !== -1)
649
+ this.plugins = this.plugins.splice(idx, 1, plugin);
650
+ this.loadCommands(plugin);
651
+ }
652
+ }
642
653
  }
643
654
  exports.Config = Config;
644
655
  // when no manifest exists, the default is calculated. This may throw, so we need to catch it
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.1.4",
4
+ "version": "2.1.6",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {