@oclif/plugin-help 3.2.1 → 3.2.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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [3.2.2](https://github.com/oclif/plugin-help/compare/v3.2.1...v3.2.2) (2021-02-03)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * avoid recomputing topics in loop ([#189](https://github.com/oclif/plugin-help/issues/189)) ([eccb862](https://github.com/oclif/plugin-help/commit/eccb862e725f28d305de5cccde109c15abbb5f98)), closes [#101](https://github.com/oclif/plugin-help/issues/101)
7
+
1
8
  ## [3.2.1](https://github.com/oclif/plugin-help/compare/v3.2.0...v3.2.1) (2020-12-14)
2
9
 
3
10
 
package/lib/command.js CHANGED
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const chalk_1 = require("chalk");
3
+ const chalk = require("chalk");
4
4
  const indent = require("indent-string");
5
5
  const stripAnsi = require("strip-ansi");
6
6
  const list_1 = require("./list");
7
7
  const util_1 = require("./util");
8
- const { underline, bold, } = chalk_1.default;
9
- let { dim, } = chalk_1.default;
8
+ const { underline, bold, } = chalk;
9
+ let { dim, } = chalk;
10
10
  if (process.env.ConEmuANSI === 'ON') {
11
- dim = chalk_1.default.gray;
11
+ dim = chalk.gray;
12
12
  }
13
13
  const wrap = require('wrap-ansi');
14
14
  class CommandHelp {
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const errors_1 = require("@oclif/errors");
4
- const chalk_1 = require("chalk");
4
+ const chalk = require("chalk");
5
5
  const indent = require("indent-string");
6
6
  const stripAnsi = require("strip-ansi");
7
7
  const command_1 = require("./command");
@@ -12,7 +12,7 @@ const util_1 = require("./util");
12
12
  const util_2 = require("./util");
13
13
  exports.getHelpClass = util_2.getHelpClass;
14
14
  const wrap = require('wrap-ansi');
15
- const { bold, } = chalk_1.default;
15
+ const { bold, } = chalk;
16
16
  const ROOT_INDEX_CMD_ID = '';
17
17
  function getHelpSubject(args) {
18
18
  for (const arg of args) {
@@ -44,9 +44,12 @@ class Help extends HelpBase {
44
44
  * and this can be removed.
45
45
  */
46
46
  get _topics() {
47
- return this.config.topics.filter((topic) => {
47
+ // since this.config.topics is a getter that does non-trivial work, cache it outside the filter loop for
48
+ // performance benefits in the presence of large numbers of topics
49
+ const topics = this.config.topics;
50
+ return topics.filter((topic) => {
48
51
  // it is assumed a topic has a child if it has children
49
- const hasChild = this.config.topics.some(subTopic => subTopic.name.includes(`${topic.name}:`));
52
+ const hasChild = topics.some(subTopic => subTopic.name.includes(`${topic.name}:`));
50
53
  return hasChild;
51
54
  });
52
55
  }
package/lib/root.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const chalk_1 = require("chalk");
3
+ const chalk = require("chalk");
4
4
  const indent = require("indent-string");
5
5
  const stripAnsi = require("strip-ansi");
6
6
  const util_1 = require("./util");
7
7
  const wrap = require('wrap-ansi');
8
- const { bold, } = chalk_1.default;
8
+ const { bold, } = chalk;
9
9
  class RootHelp {
10
10
  constructor(config, opts) {
11
11
  this.config = config;
@@ -1 +1 @@
1
- {"version":"3.2.1","commands":{"help":{"id":"help","description":"display help for <%= config.bin %>","pluginName":"@oclif/plugin-help","pluginType":"core","aliases":[],"flags":{"all":{"name":"all","type":"boolean","description":"see all commands in CLI","allowNo":false}},"args":[{"name":"command","description":"command to show help for","required":false}]}}}
1
+ {"version":"3.2.2","commands":{"help":{"id":"help","description":"display help for <%= config.bin %>","pluginName":"@oclif/plugin-help","pluginType":"core","aliases":[],"flags":{"all":{"name":"all","type":"boolean","description":"see all commands in CLI","allowNo":false}},"args":[{"name":"command","description":"command to show help for","required":false}]}}}
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@oclif/plugin-help",
3
3
  "description": "standard help for oclif",
4
- "version": "3.2.1",
4
+ "version": "3.2.2",
5
5
  "author": "Jeff Dickey @jdxcode",
6
6
  "bugs": "https://github.com/oclif/plugin-help/issues",
7
7
  "dependencies": {
8
8
  "@oclif/command": "^1.5.20",
9
9
  "@oclif/config": "^1.15.1",
10
10
  "@oclif/errors": "^1.2.2",
11
- "chalk": "^2.4.1",
11
+ "chalk": "^4.1.0",
12
12
  "indent-string": "^4.0.0",
13
13
  "lodash.template": "^4.4.0",
14
14
  "string-width": "^4.2.0",
@@ -35,7 +35,7 @@
35
35
  "mocha": "^8.2.1",
36
36
  "nock": "^13.0.0",
37
37
  "sinon": "^9.0.1",
38
- "ts-node": "^8.8.2",
38
+ "ts-node": "^9.1.1",
39
39
  "typescript": "3.8.3"
40
40
  },
41
41
  "engines": {