@oclif/core 4.0.9 → 4.0.11

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/command.js CHANGED
@@ -27,7 +27,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.Command = void 0;
30
- const ansis_1 = __importDefault(require("ansis"));
31
30
  const node_url_1 = require("node:url");
32
31
  const node_util_1 = require("node:util");
33
32
  const cache_1 = __importDefault(require("./cache"));
@@ -171,7 +170,7 @@ class Command {
171
170
  if (!err.message)
172
171
  throw err;
173
172
  try {
174
- ux_1.ux.action.stop(ansis_1.default.bold.red('!'));
173
+ ux_1.ux.action.stop(ux_1.ux.colorize('bold', ux_1.ux.colorize('red', '!')));
175
174
  }
176
175
  catch { }
177
176
  throw err;
@@ -5,13 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CLIError = void 0;
7
7
  exports.addOclifExitCode = addOclifExitCode;
8
- const ansis_1 = __importDefault(require("ansis"));
9
8
  const clean_stack_1 = __importDefault(require("clean-stack"));
10
9
  const indent_string_1 = __importDefault(require("indent-string"));
11
10
  const wrap_ansi_1 = __importDefault(require("wrap-ansi"));
12
11
  const cache_1 = __importDefault(require("../../cache"));
13
12
  const screen_1 = require("../../screen");
14
13
  const settings_1 = require("../../settings");
14
+ const theme_1 = require("../../ux/theme");
15
15
  /**
16
16
  * properties specific to internal oclif error handling
17
17
  */
@@ -36,7 +36,7 @@ class CLIError extends Error {
36
36
  }
37
37
  get bang() {
38
38
  try {
39
- return ansis_1.default.red(process.platform === 'win32' ? '»' : '›');
39
+ return (0, theme_1.colorize)('red', process.platform === 'win32' ? '»' : '›');
40
40
  }
41
41
  catch { }
42
42
  }
@@ -68,7 +68,7 @@ exports.CLIError = CLIError;
68
68
  }
69
69
  get bang() {
70
70
  try {
71
- return ansis_1.default.yellow(process.platform === 'win32' ? '»' : '›');
71
+ return (0, theme_1.colorize)('yellow', process.platform === 'win32' ? '»' : '›');
72
72
  }
73
73
  catch { }
74
74
  }
@@ -155,7 +155,7 @@ class CommandHelp extends formatter_1.HelpFormatter {
155
155
  if (flag.type === 'option') {
156
156
  let value = docopts_1.DocOpts.formatUsageType(flag, this.opts.showFlagNameInTitle ?? false, this.opts.showFlagOptionsInTitle ?? showOptions);
157
157
  if (!value.includes('|'))
158
- value = ansis_1.default.underline(value);
158
+ value = (0, theme_1.colorize)('underline', value);
159
159
  label += `=${value}`;
160
160
  }
161
161
  return (0, theme_1.colorize)(this.config.theme?.flag, label);
@@ -154,7 +154,7 @@ class HelpFormatter {
154
154
  .map(([left, right]) => [this.render(left), right && this.render(right)]);
155
155
  }
156
156
  const output = [
157
- (0, theme_1.colorize)(this.config?.theme?.sectionHeader, ansis_1.default.bold(header)),
157
+ (0, theme_1.colorize)(this.config?.theme?.sectionHeader, (0, theme_1.colorize)('bold', header)),
158
158
  (0, theme_1.colorize)(this.config?.theme?.sectionDescription, this.indent(Array.isArray(newBody) ? this.renderList(newBody, { indentation: 2, stripAnsi: this.opts.stripAnsi }) : newBody)),
159
159
  ].join('\n');
160
160
  return this.opts.stripAnsi ? ansis_1.default.strip(output) : output;
@@ -7,7 +7,7 @@ export type { HelpOptions } from './help';
7
7
  export type { Hook, Hooks } from './hooks';
8
8
  export type { Logger } from './logger';
9
9
  export type { Manifest } from './manifest';
10
- export type { Arg, ArgInput, BooleanFlag, CustomOptions, Deprecation, Flag, FlagDefinition, FlagInput, Input, OptionFlag, OutputArgs, OutputFlags, ParserOutput, } from './parser';
10
+ export type { Arg, ArgDefinition, ArgInput, BooleanFlag, CustomOptions, Deprecation, Flag, FlagDefinition, FlagInput, Input, OptionFlag, OutputArgs, OutputFlags, ParserOutput, } from './parser';
11
11
  export type { LinkedPlugin, OclifConfiguration, PJSON, S3, S3Templates, UserPJSON, UserPlugin } from './pjson';
12
12
  export type { Options, Plugin, PluginOptions } from './plugin';
13
13
  export type { S3Manifest } from './s3-manifest';
@@ -4,11 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.FailedFlagValidationError = exports.ArgInvalidOptionError = exports.FlagInvalidOptionError = exports.NonExistentFlagsError = exports.UnexpectedArgsError = exports.RequiredArgsError = exports.InvalidArgsSpecError = exports.CLIParseError = exports.CLIError = void 0;
7
- const ansis_1 = __importDefault(require("ansis"));
8
7
  const cache_1 = __importDefault(require("../cache"));
9
8
  const errors_1 = require("../errors");
10
9
  const util_1 = require("../util/util");
11
10
  const list_1 = __importDefault(require("../ux/list"));
11
+ const theme_1 = require("../ux/theme");
12
12
  var errors_2 = require("../errors");
13
13
  Object.defineProperty(exports, "CLIError", { enumerable: true, get: function () { return errors_2.CLIError; } });
14
14
  class CLIParseError extends errors_1.CLIError {
@@ -97,7 +97,7 @@ class FailedFlagValidationError extends CLIParseError {
97
97
  const reasons = failed.map((r) => r.reason);
98
98
  const deduped = (0, util_1.uniq)(reasons);
99
99
  const errString = deduped.length === 1 ? 'error' : 'errors';
100
- const message = `The following ${errString} occurred:\n ${ansis_1.default.dim(deduped.join('\n '))}`;
100
+ const message = `The following ${errString} occurred:\n ${(0, theme_1.colorize)('dim', deduped.join('\n '))}`;
101
101
  super({ exit: cache_1.default.getInstance().get('exitCodes')?.failedFlagValidation ?? exit, message, parse });
102
102
  }
103
103
  }
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.flagUsage = flagUsage;
7
4
  exports.flagUsages = flagUsages;
8
- const ansis_1 = __importDefault(require("ansis"));
9
5
  const util_1 = require("../util/util");
6
+ const ux_1 = require("../ux");
10
7
  function flagUsage(flag, options = {}) {
11
8
  const label = [];
12
9
  if (flag.helpLabel) {
@@ -22,7 +19,7 @@ function flagUsage(flag, options = {}) {
22
19
  let description = flag.summary || flag.description || '';
23
20
  if (options.displayRequired && flag.required)
24
21
  description = `(required) ${description}`;
25
- description = description ? ansis_1.default.dim(description) : undefined;
22
+ description = description ? (0, ux_1.colorize)('dim', description) : undefined;
26
23
  return [` ${label.join(',').trim()}${usage}`, description];
27
24
  }
28
25
  function flagUsages(flags, options = {}) {
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": "4.0.9",
4
+ "version": "4.0.11",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {