@oclif/core 1.6.0 → 1.6.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,27 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.6.3](https://github.com/oclif/core/compare/v1.6.2...v1.6.3) (2022-03-23)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * use plugin alias if available ([245d841](https://github.com/oclif/core/commit/245d84197a64e55b17524c22cbc17ec025a07c08))
11
+
12
+ ### [1.6.2](https://github.com/oclif/core/compare/v1.6.1...v1.6.2) (2022-03-23)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * load correct plugin when using dynamic help ([#394](https://github.com/oclif/core/issues/394)) ([15c1fbe](https://github.com/oclif/core/commit/15c1fbe1e870b6da1372a5786a9ffb09746ce8f6))
18
+
19
+ ### [1.6.1](https://github.com/oclif/core/compare/v1.6.0...v1.6.1) (2022-03-17)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * set id to alias when adding commands ([#390](https://github.com/oclif/core/issues/390)) ([84ab722](https://github.com/oclif/core/commit/84ab7223a2196c6a33f64a3e4ba75a050b02d1c3))
25
+
5
26
  ## [1.6.0](https://github.com/oclif/core/compare/v1.5.3...v1.6.0) (2022-03-14)
6
27
 
7
28
 
@@ -517,10 +517,10 @@ class Config {
517
517
  for (const alias of (_a = command.aliases) !== null && _a !== void 0 ? _a : []) {
518
518
  if (this._commands.has(alias)) {
519
519
  const prioritizedCommand = this.determinePriority([this._commands.get(alias), command]);
520
- this._commands.set(prioritizedCommand.id, prioritizedCommand);
520
+ this._commands.set(prioritizedCommand.id, { ...prioritizedCommand, id: alias });
521
521
  }
522
522
  else {
523
- this._commands.set(alias, command);
523
+ this._commands.set(alias, { ...command, id: alias });
524
524
  }
525
525
  const aliasPermutations = this.flexibleTaxonomy ? (0, util_2.getCommandIdPermutations)(alias) : [alias];
526
526
  for (const permutation of aliasPermutations) {
package/lib/help/index.js CHANGED
@@ -87,7 +87,7 @@ class Help extends HelpBase {
87
87
  const command = this.config.findCommand(subject);
88
88
  if (command) {
89
89
  if (command.hasDynamicHelp) {
90
- const dynamicCommand = await (0, config_1.toCached)(await this.getDynamicCommand(command.id));
90
+ const dynamicCommand = await (0, config_1.toCached)(await this.getDynamicCommand(command));
91
91
  await this.showCommandHelp(dynamicCommand);
92
92
  }
93
93
  else {
@@ -110,12 +110,13 @@ class Help extends HelpBase {
110
110
  }
111
111
  (0, errors_1.error)(`Command ${subject} not found.`);
112
112
  }
113
- async getDynamicCommand(cmdName) {
114
- const plugin = new plugin_1.Plugin({ ignoreManifest: true, root: this.config.root });
113
+ async getDynamicCommand(command) {
114
+ var _a;
115
+ const plugin = new plugin_1.Plugin({ ignoreManifest: true, root: this.config.root, name: (_a = command.pluginAlias) !== null && _a !== void 0 ? _a : command.pluginName });
115
116
  await plugin.load();
116
- const cmd = await plugin.findCommand(cmdName);
117
+ const cmd = await plugin.findCommand(command.id);
117
118
  if (!cmd) {
118
- throw new Error(`Command ${cmdName} not found.`);
119
+ throw new Error(`Command ${command.id} not found.`);
119
120
  }
120
121
  return cmd;
121
122
  }
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.6.0",
4
+ "version": "1.6.3",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {