@oclif/core 3.23.0 → 3.24.0

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/cache.js CHANGED
@@ -22,7 +22,6 @@ class Cache extends Map {
22
22
  }
23
23
  getOclifCoreMeta() {
24
24
  try {
25
- // eslint-disable-next-line node/no-extraneous-require
26
25
  return { name: '@oclif/core', version: require('@oclif/core/package.json').version };
27
26
  }
28
27
  catch {
@@ -21,7 +21,7 @@ async function _flush() {
21
21
  return;
22
22
  return p;
23
23
  }
24
- async function flush(ms = 10000) {
24
+ async function flush(ms = 10_000) {
25
25
  await timeout(_flush(), ms);
26
26
  }
27
27
  exports.flush = flush;
@@ -69,7 +69,7 @@ class ux {
69
69
  static async done() {
70
70
  config_1.config.action.stop();
71
71
  }
72
- static async flush(ms = 10000) {
72
+ static async flush(ms = 10_000) {
73
73
  await (0, flush_1.flush)(ms);
74
74
  }
75
75
  static info(format, ...args) {
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.handle = exports.Exit = void 0;
7
- /* eslint-disable no-process-exit */
8
7
  const clean_stack_1 = __importDefault(require("clean-stack"));
9
8
  const config_1 = require("./config");
10
9
  const cli_1 = require("./errors/cli");
@@ -17,6 +16,7 @@ const pretty_print_1 = __importDefault(require("./errors/pretty-print"));
17
16
  */
18
17
  exports.Exit = {
19
18
  exit(code = 0) {
19
+ // eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit
20
20
  process.exit(code);
21
21
  },
22
22
  };
@@ -58,7 +58,8 @@ class CommandHelp extends formatter_1.HelpFormatter {
58
58
  if (args.filter((a) => a.description).length === 0)
59
59
  return;
60
60
  return args.map((a) => {
61
- const name = a.name.toUpperCase();
61
+ // Add ellipsis to indicate that the argument takes multiple values if strict is false
62
+ const name = this.command.strict === false ? `${a.name.toUpperCase()}...` : a.name.toUpperCase();
62
63
  let description = a.description || '';
63
64
  if (a.default)
64
65
  description = `${(0, theme_1.colorize)(this.config?.theme?.flagDefaultValue, `[default: ${a.default}]`)} ${description}`;
@@ -295,13 +296,14 @@ class CommandHelp extends formatter_1.HelpFormatter {
295
296
  usage() {
296
297
  const { id, usage } = this.command;
297
298
  const standardId = (0, ids_1.toStandardizedId)(id, this.config);
299
+ const configuredId = (0, ids_1.toConfiguredId)(id, this.config);
298
300
  const body = (usage ? (0, util_1.castArray)(usage) : [this.defaultUsage()])
299
301
  .map((u) => {
300
302
  const allowedSpacing = this.opts.maxWidth - this.indentSpacing;
301
303
  const dollarSign = (0, theme_1.colorize)(this.config?.theme?.dollarSign, '$');
302
304
  const bin = (0, theme_1.colorize)(this.config?.theme?.bin, this.config.bin);
303
305
  const command = (0, theme_1.colorize)(this.config?.theme?.command, '<%= command.id %>');
304
- const commandDescription = (0, theme_1.colorize)(this.config?.theme?.sectionDescription, u.replace('<%= command.id %>', '').replace(standardId, '').trim());
306
+ const commandDescription = (0, theme_1.colorize)(this.config?.theme?.sectionDescription, u.replace('<%= command.id %>', '').replace(standardId, '').replace(configuredId, '').trim());
305
307
  const line = `${dollarSign} ${bin} ${command} ${commandDescription}`.trim();
306
308
  if (line.length > allowedSpacing) {
307
309
  const splitIndex = line.slice(0, Math.max(0, allowedSpacing)).lastIndexOf(' ');
@@ -59,8 +59,8 @@ export declare class DocOpts {
59
59
  private cmd;
60
60
  private flagList;
61
61
  private flagMap;
62
- constructor(cmd: Command.Cached | Command.Class | Command.Loadable);
63
- static generate(cmd: Command.Cached | Command.Class | Command.Loadable): string;
62
+ constructor(cmd: Command.Loadable);
63
+ static generate(cmd: Command.Loadable): string;
64
64
  toString(): string;
65
65
  private combineElementsToFlag;
66
66
  private generateElements;
@@ -79,7 +79,9 @@ class DocOpts {
79
79
  toString() {
80
80
  const opts = ['<%= command.id %>'];
81
81
  if (this.cmd.args) {
82
- const a = Object.values((0, ensure_arg_object_1.ensureArgObject)(this.cmd.args)).map((arg) => arg.required ? arg.name.toUpperCase() : `[${arg.name.toUpperCase()}]`) || [];
82
+ // If strict is false, add ellipsis to indicate that the argument takes multiple values
83
+ const suffix = this.cmd.strict === false ? '...' : '';
84
+ const a = Object.values((0, ensure_arg_object_1.ensureArgObject)(this.cmd.args)).map((arg) => arg.required ? `${arg.name.toUpperCase()}${suffix}` : `[${arg.name.toUpperCase()}${suffix}]`) || [];
83
85
  opts.push(...a);
84
86
  }
85
87
  try {
@@ -89,7 +89,7 @@ function maybeRequirePnpApi(root) {
89
89
  if (pnp)
90
90
  return pnp;
91
91
  try {
92
- // eslint-disable-next-line node/no-missing-require
92
+ // eslint-disable-next-line n/no-missing-require
93
93
  pnp = require(require.resolve('pnpapi', { paths: [root] }));
94
94
  return pnp;
95
95
  }
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": "3.23.0",
4
+ "version": "3.24.0",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {
@@ -65,10 +65,10 @@
65
65
  "commitlint": "^17.8.1",
66
66
  "cross-env": "^7.0.3",
67
67
  "eslint": "^8.57.0",
68
- "eslint-config-oclif": "^5.0.4",
69
- "eslint-config-oclif-typescript": "^3.0.48",
68
+ "eslint-config-oclif": "^5.1.0",
69
+ "eslint-config-oclif-typescript": "^3.1.0",
70
70
  "eslint-config-prettier": "^9.1.0",
71
- "fancy-test": "^3.0.11",
71
+ "fancy-test": "^3.0.12",
72
72
  "globby": "^11.1.0",
73
73
  "husky": "^8",
74
74
  "lint-staged": "^14.0.1",