@oclif/core 1.26.0 → 1.26.2
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 +1 -0
- package/lib/config/config.js +11 -0
- package/lib/help/util.js +1 -1
- package/package.json +2 -2
package/lib/config/config.d.ts
CHANGED
|
@@ -131,5 +131,6 @@ export declare class Config implements IConfig {
|
|
|
131
131
|
* @returns command instance {Command.Loadable} or undefined
|
|
132
132
|
*/
|
|
133
133
|
private determinePriority;
|
|
134
|
+
private insertLegacyPlugins;
|
|
134
135
|
}
|
|
135
136
|
export declare function toCached(c: Command.Class, plugin?: IPlugin): Promise<Command>;
|
package/lib/config/config.js
CHANGED
|
@@ -240,6 +240,9 @@ class Config {
|
|
|
240
240
|
await withTimeout(timeout, search(module).call(context, { ...opts, config: this })) :
|
|
241
241
|
await search(module).call(context, { ...opts, config: this });
|
|
242
242
|
final.successes.push({ plugin: p, result });
|
|
243
|
+
if (p.name === '@oclif/plugin-legacy' && event === 'init') {
|
|
244
|
+
this.insertLegacyPlugins(result);
|
|
245
|
+
}
|
|
243
246
|
debug('done');
|
|
244
247
|
}
|
|
245
248
|
catch (error) {
|
|
@@ -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/lib/help/util.js
CHANGED
|
@@ -45,7 +45,7 @@ function collateSpacedCmdIDFromArgs(argv, config) {
|
|
|
45
45
|
if (!id)
|
|
46
46
|
return false;
|
|
47
47
|
const cmd = config.findCommand(id);
|
|
48
|
-
return Boolean(cmd && (cmd.strict === false || cmd.args
|
|
48
|
+
return Boolean(cmd && (cmd.strict === false || Object.values(cmd.args ?? {}).length > 0));
|
|
49
49
|
};
|
|
50
50
|
for (const arg of argv) {
|
|
51
51
|
if (idPresent(finalizeId(arg)))
|
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": "1.26.
|
|
4
|
+
"version": "1.26.2",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/oclif/core/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -114,4 +114,4 @@
|
|
|
114
114
|
"pretest": "yarn build --noEmit && tsc -p test --noEmit --skipLibCheck"
|
|
115
115
|
},
|
|
116
116
|
"types": "lib/index.d.ts"
|
|
117
|
-
}
|
|
117
|
+
}
|