@oclif/core 3.11.1-dev.0 → 3.11.1-dev.1

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.
@@ -1,4 +1,3 @@
1
- import * as Color from 'color';
2
1
  import { StandardChalk, Theme, Themes } from '../interfaces/theme';
3
2
  /**
4
3
  * Add color to text.
@@ -6,7 +5,7 @@ import { StandardChalk, Theme, Themes } from '../interfaces/theme';
6
5
  * @param text string to colorize
7
6
  * @returns colorized string
8
7
  */
9
- export declare function colorize(color: Color | StandardChalk | undefined, text: string): string;
8
+ export declare function colorize(color: string | StandardChalk | undefined, text: string): string;
10
9
  export declare function parseTheme(theme: Themes): Theme;
11
- export declare function getColor(color: string): Color;
10
+ export declare function getColor(color: string): string;
12
11
  export declare function getColor(color: StandardChalk): StandardChalk;
@@ -42,7 +42,7 @@ function isStandardChalk(color) {
42
42
  function colorize(color, text) {
43
43
  if (isStandardChalk(color))
44
44
  return chalk_1.default[color](text);
45
- return color ? chalk_1.default.hex(color.hex())(text) : text;
45
+ return color ? chalk_1.default.hex(color)(text) : text;
46
46
  }
47
47
  exports.colorize = colorize;
48
48
  function parseTheme(theme) {
@@ -56,7 +56,7 @@ exports.parseTheme = parseTheme;
56
56
  function getColor(color) {
57
57
  try {
58
58
  // eslint-disable-next-line new-cap
59
- return isStandardChalk(color) ? color : new Color.default(color);
59
+ return isStandardChalk(color) ? color : new Color.default(color).hex();
60
60
  }
61
61
  catch { }
62
62
  }
@@ -1,25 +1,24 @@
1
- import * as Color from 'color';
2
1
  export declare const STANDARD_CHALK: readonly ["white", "black", "blue", "yellow", "green", "red", "magenta", "cyan", "gray", "blackBright", "redBright", "greenBright", "yellowBright", "blueBright", "magentaBright", "cyanBright", "whiteBright", "bgBlack", "bgRed", "bgGreen", "bgYellow", "bgBlue", "bgMagenta", "bgCyan", "bgWhite", "bgGray", "bgBlackBright", "bgRedBright", "bgGreenBright", "bgYellowBright", "bgBlueBright", "bgMagentaBright", "bgCyanBright", "bgWhiteBright", "bold", "underline", "dim", "italic", "strikethrough"];
3
2
  export type StandardChalk = (typeof STANDARD_CHALK)[number];
4
3
  export declare const THEME_KEYS: readonly ["alias", "bin", "command", "commandSummary", "dollarSign", "flag", "flagDefaultValue", "flagOptions", "flagRequired", "flagSeparator", "flagType", "sectionDescription", "sectionHeader", "topic", "version"];
5
4
  export type ThemeKey = (typeof THEME_KEYS)[number];
6
5
  export type Theme = {
7
- [key: string | ThemeKey]: Color | StandardChalk | undefined;
8
- alias?: Color | StandardChalk;
9
- bin?: Color | StandardChalk;
10
- command?: Color | StandardChalk;
11
- commandSummary?: Color | StandardChalk;
12
- dollarSign?: Color | StandardChalk;
13
- flag?: Color | StandardChalk;
14
- flagDefaultValue?: Color | StandardChalk;
15
- flagOptions?: Color | StandardChalk;
16
- flagRequired?: Color | StandardChalk;
17
- flagSeparator?: Color | StandardChalk;
18
- flagType?: Color | StandardChalk;
19
- sectionDescription?: Color | StandardChalk;
20
- sectionHeader?: Color | StandardChalk;
21
- topic?: Color | StandardChalk;
22
- version?: Color | StandardChalk;
6
+ [key: string | ThemeKey]: string | StandardChalk | undefined;
7
+ alias?: string | StandardChalk;
8
+ bin?: string | StandardChalk;
9
+ command?: string | StandardChalk;
10
+ commandSummary?: string | StandardChalk;
11
+ dollarSign?: string | StandardChalk;
12
+ flag?: string | StandardChalk;
13
+ flagDefaultValue?: string | StandardChalk;
14
+ flagOptions?: string | StandardChalk;
15
+ flagRequired?: string | StandardChalk;
16
+ flagSeparator?: string | StandardChalk;
17
+ flagType?: string | StandardChalk;
18
+ sectionDescription?: string | StandardChalk;
19
+ sectionHeader?: string | StandardChalk;
20
+ topic?: string | StandardChalk;
21
+ version?: string | StandardChalk;
23
22
  };
24
23
  export type Themes = {
25
24
  selected?: string;
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.11.1-dev.0",
4
+ "version": "3.11.1-dev.1",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {