Skip to content

Commit e4d621a

Browse files
committed
refactor(cli): replace chalk with picocolors
1 parent ed34de4 commit e4d621a

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@
4747
"prettier": "^2.0.0"
4848
},
4949
"dependencies": {
50-
"chalk": "^4.1.2",
5150
"execa": "^4.1.0",
5251
"find-up": "^4.1.0",
5352
"ignore": "^5.3.0",
5453
"mri": "^1.2.0",
5554
"multimatch": "^5.0.0",
55+
"picocolors": "^1.0.0",
5656
"tslib": "^2.6.2"
5757
},
5858
"devDependencies": {

src/cli.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22

3-
import chalk from 'chalk'
43
import mri from 'mri'
4+
import picocolors from 'picocolors'
55

66
import prettyQuick from '.'
77

@@ -16,36 +16,36 @@ const prettyQuickResult = prettyQuick(process.cwd(), {
1616
...args,
1717
onFoundSinceRevision: (scm, revision) => {
1818
console.log(
19-
`🔍 Finding changed files since ${chalk.bold(scm)} revision ${chalk.bold(
20-
revision,
21-
)}.`,
19+
`🔍 Finding changed files since ${picocolors.bold(
20+
scm,
21+
)} revision ${picocolors.bold(revision)}.`,
2222
)
2323
},
2424

2525
onFoundChangedFiles: changedFiles => {
2626
console.log(
27-
`🎯 Found ${chalk.bold(changedFiles.length)} changed ${
27+
`🎯 Found ${picocolors.bold(changedFiles.length)} changed ${
2828
changedFiles.length === 1 ? 'file' : 'files'
2929
}.`,
3030
)
3131
},
3232

3333
onPartiallyStagedFile: file => {
34-
console.log(`✗ Found ${chalk.bold('partially')} staged file ${file}.`)
34+
console.log(`✗ Found ${picocolors.bold('partially')} staged file ${file}.`)
3535
},
3636

3737
onWriteFile: file => {
38-
console.log(`✍️ Fixing up ${chalk.bold(file)}.`)
38+
console.log(`✍️ Fixing up ${picocolors.bold(file)}.`)
3939
},
4040

4141
onCheckFile: (file, isFormatted) => {
4242
if (!isFormatted) {
43-
console.log(`⛔️ Check failed: ${chalk.bold(file)}`)
43+
console.log(`⛔️ Check failed: ${picocolors.bold(file)}`)
4444
}
4545
},
4646

4747
onExamineFile: file => {
48-
console.log(`🔍 Examining ${chalk.bold(file)}.`)
48+
console.log(`🔍 Examining ${picocolors.bold(file)}.`)
4949
},
5050
})
5151

@@ -55,7 +55,7 @@ if (prettyQuickResult.success) {
5555
if (prettyQuickResult.errors.includes('PARTIALLY_STAGED_FILE')) {
5656
console.log(
5757
'✗ Partially staged files were fixed up.' +
58-
` ${chalk.bold('Please update stage before committing')}.`,
58+
` ${picocolors.bold('Please update stage before committing')}.`,
5959
)
6060
}
6161
if (prettyQuickResult.errors.includes('BAIL_ON_WRITE')) {

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13730,7 +13730,6 @@ __metadata:
1373013730
"@types/jest": ^29.5.11
1373113731
"@types/mock-fs": ^4.13.4
1373213732
"@unts/patch-package": ^8.0.0
13733-
chalk: ^4.1.2
1373413733
clean-pkg-json: ^1.2.0
1373513734
eslint: ^8.56.0
1373613735
eslint-config-prettier: ^9.1.0
@@ -13745,6 +13744,7 @@ __metadata:
1374513744
mri: ^1.2.0
1374613745
multimatch: ^5.0.0
1374713746
npm-run-all: ^4.1.5
13747+
picocolors: ^1.0.0
1374813748
prettier: ^2.8.8
1374913749
pretty-quick: "link:."
1375013750
simple-git-hooks: ^2.9.0

0 commit comments

Comments
 (0)