1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.color = exports.CustomColors = void 0;
|
4 | const ansiStyles = require("ansi-styles");
|
5 | const supports = require("supports-color");
|
6 | const chalk = require('chalk');
|
7 | const dim = process.env.ConEmuANSI === 'ON' ? chalk.gray : chalk.dim;
|
8 | exports.CustomColors = {
|
9 | supports,
|
10 |
|
11 | gray: dim,
|
12 | grey: dim,
|
13 | dim,
|
14 | attachment: chalk.cyan,
|
15 | addon: chalk.yellow,
|
16 | configVar: chalk.green,
|
17 | release: chalk.blue.bold,
|
18 | cmd: chalk.cyan.bold,
|
19 | pipeline: chalk.green.bold,
|
20 | app: (s) => chalk.level > 0 ? exports.color.heroku(`⬢ ${s}`) : s,
|
21 | heroku: (s) => {
|
22 | if (chalk.level === 0)
|
23 | return s;
|
24 | if (!exports.color.supports)
|
25 | return s;
|
26 | let has256 = exports.color.supportsColor.has256 || (process.env.TERM || '').indexOf('256') !== -1;
|
27 | return has256 ? '\u001b[38;5;104m' + s + ansiStyles.reset.open : chalk.magenta(s);
|
28 | },
|
29 | };
|
30 | exports.color = new Proxy(chalk, {
|
31 | get: (chalk, name) => {
|
32 | if (exports.CustomColors[name])
|
33 | return exports.CustomColors[name];
|
34 | return chalk[name];
|
35 | },
|
36 | set: (chalk, name, value) => {
|
37 | switch (name) {
|
38 | case 'enabled':
|
39 | if (value)
|
40 | chalk.level = 2;
|
41 | else
|
42 | chalk.level = 0;
|
43 | break;
|
44 | default:
|
45 | throw new Error(`cannot set property ${name.toString()}`);
|
46 | }
|
47 | return true;
|
48 | },
|
49 | });
|
50 | exports.default = exports.color;
|