@oclif/core 2.8.6 → 2.8.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/config/config.d.ts +9 -0
- package/lib/config/config.js +14 -2
- package/package.json +1 -1
package/lib/config/config.d.ts
CHANGED
|
@@ -135,6 +135,15 @@ export declare class Config implements IConfig {
|
|
|
135
135
|
* @returns command instance {Command.Loadable} or undefined
|
|
136
136
|
*/
|
|
137
137
|
private determinePriority;
|
|
138
|
+
/**
|
|
139
|
+
* Insert legacy plugins
|
|
140
|
+
*
|
|
141
|
+
* Replace invalid CLI plugins (cli-engine plugins, mostly Heroku) loaded via `this.loadPlugins`
|
|
142
|
+
* with oclif-compatible ones returned by @oclif/plugin-legacy init hook.
|
|
143
|
+
*
|
|
144
|
+
* @param plugins array of oclif-compatible plugins
|
|
145
|
+
* @returns void
|
|
146
|
+
*/
|
|
138
147
|
private insertLegacyPlugins;
|
|
139
148
|
}
|
|
140
149
|
export declare function toCached(c: Command.Class, plugin?: IPlugin | undefined, isWritingManifest?: boolean): Promise<Command.Cached>;
|
package/lib/config/config.js
CHANGED
|
@@ -703,11 +703,23 @@ class Config {
|
|
|
703
703
|
});
|
|
704
704
|
return commandPlugins[0];
|
|
705
705
|
}
|
|
706
|
+
/**
|
|
707
|
+
* Insert legacy plugins
|
|
708
|
+
*
|
|
709
|
+
* Replace invalid CLI plugins (cli-engine plugins, mostly Heroku) loaded via `this.loadPlugins`
|
|
710
|
+
* with oclif-compatible ones returned by @oclif/plugin-legacy init hook.
|
|
711
|
+
*
|
|
712
|
+
* @param plugins array of oclif-compatible plugins
|
|
713
|
+
* @returns void
|
|
714
|
+
*/
|
|
706
715
|
insertLegacyPlugins(plugins) {
|
|
707
716
|
for (const plugin of plugins) {
|
|
708
717
|
const idx = this.plugins.findIndex(p => p.name === plugin.name);
|
|
709
|
-
if (idx !== -1)
|
|
710
|
-
|
|
718
|
+
if (idx !== -1) {
|
|
719
|
+
// invalid plugin instance found in `this.plugins`
|
|
720
|
+
// replace with the oclif-compatible one
|
|
721
|
+
this.plugins.splice(idx, 1, plugin);
|
|
722
|
+
}
|
|
711
723
|
this.loadCommands(plugin);
|
|
712
724
|
}
|
|
713
725
|
}
|