Skip to content

Commit b2b0344

Browse files
committed
Replace chalk with picocolors
Already used in latest postcss, autoprefixer and browserslist versions. See https://github.com/alexeyraspopov/picocolors
1 parent 4860957 commit b2b0344

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

package-lock.json

+12-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
},
6868
"dependencies": {
6969
"arg": "^5.0.1",
70-
"chalk": "^4.1.2",
7170
"chokidar": "^3.5.2",
7271
"color-name": "^1.1.4",
7372
"cosmiconfig": "^7.0.1",
@@ -79,6 +78,7 @@
7978
"is-glob": "^4.0.3",
8079
"normalize-path": "^3.0.0",
8180
"object-hash": "^2.2.0",
81+
"picocolors": "^1.0.0",
8282
"postcss-js": "^3.0.3",
8383
"postcss-load-config": "^3.1.0",
8484
"postcss-nested": "5.0.6",

src/featureFlags.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import chalk from 'chalk'
1+
import colors from 'picocolors'
22
import log from './util/log'
33

44
let defaults = {
@@ -41,7 +41,7 @@ export function issueFlagNotices(config) {
4141

4242
if (experimentalFlagsEnabled(config).length > 0) {
4343
let changes = experimentalFlagsEnabled(config)
44-
.map((s) => chalk.yellow(s))
44+
.map((s) => colors.yellow(s))
4545
.join(', ')
4646

4747
log.warn('experimental-flags-enabled', [

src/util/log.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
import chalk from 'chalk'
1+
import colors from 'picocolors'
22

33
let alreadyShown = new Set()
44

5-
function log(chalk, messages, key) {
5+
function log(type, messages, key) {
66
if (process.env.JEST_WORKER_ID !== undefined) return
77

88
if (key && alreadyShown.has(key)) return
99
if (key) alreadyShown.add(key)
1010

1111
console.warn('')
12-
messages.forEach((message) => console.warn(chalk, '-', message))
12+
messages.forEach((message) => console.warn(type, '-', message))
1313
}
1414

1515
export default {
1616
info(key, messages) {
17-
log(chalk.bold.cyan('info'), ...(Array.isArray(key) ? [key] : [messages, key]))
17+
log(colors.bold(colors.cyan('info')), ...(Array.isArray(key) ? [key] : [messages, key]))
1818
},
1919
warn(key, messages) {
20-
log(chalk.bold.yellow('warn'), ...(Array.isArray(key) ? [key] : [messages, key]))
20+
log(colors.bold(colors.yellow('warn')), ...(Array.isArray(key) ? [key] : [messages, key]))
2121
},
2222
risk(key, messages) {
23-
log(chalk.bold.magenta('risk'), ...(Array.isArray(key) ? [key] : [messages, key]))
23+
log(colors.bold(colors.magenta('risk')), ...(Array.isArray(key) ? [key] : [messages, key]))
2424
},
2525
}

0 commit comments

Comments
 (0)