Skip to content

Commit 6a8684f

Browse files
committed
fix: switch from colors to chalk
colors.js was corrupted by its developer, see https://news.ycombinator.com/item?id=29856438.
1 parent 952ef6e commit 6a8684f

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

docs/files/package.json.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"license": "MIT",
2525
"private": false,
2626
"dependencies": {
27-
"colors": "^1.4.0",
27+
"chalk": "^5.0.0",
2828
"commander": "^5.0.0",
2929
"ncp": "^2.0.0",
3030
"react": "^16.13.1",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"license": "MIT",
1212
"private": false,
1313
"dependencies": {
14-
"colors": "^1.4.0",
14+
"chalk": "^5.0.0",
1515
"commander": "^5.0.0",
1616
"ncp": "^2.0.0",
1717
"react": "^16.13.1",

src/lib/reporters/text.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Table from "terminal-table";
22
import { CoverageData } from "../getCoverage";
3-
import "colors";
3+
import chalk from "chalk";
44

55
const coverageTable = new Table({
66
leftPadding: 1,
@@ -29,16 +29,16 @@ export const generate = (
2929
): string => {
3030
let row = 1;
3131
const headers = [
32-
"filenames" + ` (${fileCounts.size})`.gray,
33-
"percent" + ` (${percentage.toFixed(2)}%)`.gray,
34-
"total" + ` (${total})`.gray,
35-
"covered" + ` (${covered})`.gray,
36-
"uncovered" + ` (${uncovered})`.gray
32+
"filenames" + chalk.gray(` (${fileCounts.size})`),
33+
"percent" + chalk.gray(` (${percentage.toFixed(2)}%)`),
34+
"total" + chalk.gray(` (${total})`),
35+
"covered" + chalk.gray(` (${covered})`),
36+
"uncovered" + chalk.gray(` (${uncovered})`)
3737
];
3838

3939
coverageTable.push(
4040
headers,
41-
headers.map(() => "---".gray)
41+
headers.map(() => chalk.gray("---"))
4242
);
4343

4444
coverageTable.attrRange(

yarn.lock

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2144,6 +2144,11 @@ chalk@^3.0.0:
21442144
ansi-styles "^4.1.0"
21452145
supports-color "^7.1.0"
21462146

2147+
chalk@^5.0.0:
2148+
version "5.0.0"
2149+
resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.0.0.tgz#bd96c6bb8e02b96e08c0c3ee2a9d90e050c7b832"
2150+
integrity sha512-/duVOqst+luxCQRKEo4bNxinsOQtMP80ZYm7mMqzuh5PociNL0PvmHFvREJ9ueYL2TxlHjBcmLCdmocx9Vg+IQ==
2151+
21472152
chardet@^0.4.0:
21482153
version "0.4.2"
21492154
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2"
@@ -2338,7 +2343,7 @@ colorette@^1.2.2:
23382343
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94"
23392344
integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==
23402345

2341-
colors@^1.0.3, colors@^1.1.2, colors@^1.4.0:
2346+
colors@^1.0.3, colors@^1.1.2:
23422347
version "1.4.0"
23432348
resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78"
23442349
integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==

0 commit comments

Comments
 (0)