@oclif/plugin-commands 3.3.2 → 3.3.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/README.md CHANGED
@@ -21,7 +21,7 @@ $ npm install -g @oclif/plugin-commands
21
21
  $ oclif-example COMMAND
22
22
  running command...
23
23
  $ oclif-example (--version)
24
- @oclif/plugin-commands/3.3.2 linux-x64 node-v20.12.2
24
+ @oclif/plugin-commands/3.3.3 linux-x64 node-v20.12.2
25
25
  $ oclif-example --help [COMMAND]
26
26
  USAGE
27
27
  $ oclif-example COMMAND
@@ -65,7 +65,7 @@ DESCRIPTION
65
65
  list all the commands
66
66
  ```
67
67
 
68
- _See code: [src/commands/commands.ts](https://github.com/oclif/plugin-commands/blob/v3.3.2/src/commands/commands.ts)_
68
+ _See code: [src/commands/commands.ts](https://github.com/oclif/plugin-commands/blob/v3.3.3/src/commands/commands.ts)_
69
69
  <!-- commandsstop -->
70
70
 
71
71
  # Contributing
@@ -1,8 +1,5 @@
1
1
  import { Command, Flags, toConfiguredId, ux } from '@oclif/core';
2
- import pickBy from 'lodash.pickby';
3
- import sortBy from 'lodash.sortby';
4
- import template from 'lodash.template';
5
- import uniqBy from 'lodash.uniqby';
2
+ import _ from 'lodash';
6
3
  import { EOL } from 'node:os';
7
4
  import createCommandTree from '../utils/tree.js';
8
5
  export default class Commands extends Command {
@@ -26,13 +23,13 @@ export default class Commands extends Command {
26
23
  commands = commands.filter((c) => c.state !== 'deprecated' && !deprecatedAliases.has(c.id));
27
24
  }
28
25
  const { config } = this;
29
- commands = sortBy(commands, 'id').map((command) => {
26
+ commands = _.sortBy(commands, 'id').map((command) => {
30
27
  // Template supported fields.
31
28
  command.description =
32
- (typeof command.description === 'string' && template(command.description)({ command, config })) || undefined;
29
+ (typeof command.description === 'string' && _.template(command.description)({ command, config })) || undefined;
33
30
  command.summary =
34
- (typeof command.summary === 'string' && template(command.summary)({ command, config })) || undefined;
35
- command.usage = (typeof command.usage === 'string' && template(command.usage)({ command, config })) || undefined;
31
+ (typeof command.summary === 'string' && _.template(command.summary)({ command, config })) || undefined;
32
+ command.usage = (typeof command.usage === 'string' && _.template(command.usage)({ command, config })) || undefined;
36
33
  command.id = toConfiguredId(command.id, config);
37
34
  return command;
38
35
  });
@@ -52,14 +49,14 @@ export default class Commands extends Command {
52
49
  // ES2022 will return all unset static properties on the prototype as undefined. This is different from ES2021
53
50
  // which only returns the static properties that are set by defaults. In order to prevent
54
51
  // Object.assign from overwriting the properties on the object, we need to filter out the undefined values.
55
- Object.assign(obj, pickBy(commandClass, (v) => v !== undefined));
52
+ Object.assign(obj, _.pickBy(commandClass, (v) => v !== undefined));
56
53
  }
57
54
  // The plugin property on the loaded class contains a LOT of information including all the commands again. Remove it.
58
55
  delete obj.plugin;
59
56
  // If Command classes have circular references, don't break the commands command.
60
57
  return this.removeCycles(obj);
61
58
  }));
62
- return uniqBy(formatted, 'id');
59
+ return _.uniqBy(formatted, 'id');
63
60
  }
64
61
  if (flags.tree) {
65
62
  const tree = createCommandTree(commands, config.topicSeparator);