Skip to content

Commit ec5b36c

Browse files
committed
chore: replace chalk with picocolors
1 parent f23d951 commit ec5b36c

File tree

8 files changed

+26
-26
lines changed

8 files changed

+26
-26
lines changed

.github/renovate.json5

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
'typescript',
4646

4747
// ESM only
48-
'chalk',
4948
'estree-walker'
5049
]
5150
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
"@typescript-eslint/parser": "^6.7.2",
7171
"@vitest/coverage-istanbul": "^0.34.4",
7272
"@vue/consolidate": "0.17.3",
73-
"chalk": "^4.1.0",
7473
"conventional-changelog-cli": "^4.1.0",
7574
"enquirer": "^2.4.1",
7675
"esbuild": "^0.19.3",
@@ -87,6 +86,7 @@
8786
"marked": "^9.1.1",
8887
"minimist": "^1.2.8",
8988
"npm-run-all": "^4.1.5",
89+
"picocolors": "^1.0.0",
9090
"prettier": "^3.0.3",
9191
"pretty-bytes": "^6.1.1",
9292
"pug": "^3.0.2",

pnpm-lock.yaml

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

rollup.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { fileURLToPath } from 'node:url'
44
import path from 'node:path'
55
import replace from '@rollup/plugin-replace'
66
import json from '@rollup/plugin-json'
7-
import chalk from 'chalk'
7+
import pico from 'picocolors'
88
import commonJS from '@rollup/plugin-commonjs'
99
import polyfillNode from 'rollup-plugin-polyfill-node'
1010
import { nodeResolve } from '@rollup/plugin-node-resolve'
@@ -91,7 +91,7 @@ export default packageConfigs
9191

9292
function createConfig(format, output, plugins = []) {
9393
if (!output) {
94-
console.log(chalk.yellow(`invalid format: "${format}"`))
94+
console.log(pico.yellow(`invalid format: "${format}"`))
9595
process.exit(1)
9696
}
9797

scripts/build.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { existsSync, readFileSync } from 'node:fs'
2121
import path from 'node:path'
2222
import minimist from 'minimist'
2323
import { gzipSync, brotliCompressSync } from 'node:zlib'
24-
import chalk from 'chalk'
24+
import pico from 'picocolors'
2525
import { execa, execaSync } from 'execa'
2626
import { cpus } from 'node:os'
2727
import { createRequire } from 'node:module'
@@ -164,7 +164,7 @@ async function checkFileSize(filePath) {
164164
const brotli = brotliCompressSync(file)
165165

166166
console.log(
167-
`${chalk.gray(chalk.bold(fileName))} min:${prettyBytes(
167+
`${pico.gray(pico.bold(fileName))} min:${prettyBytes(
168168
file.length
169169
)} / gzip:${prettyBytes(gzipped.length)} / brotli:${prettyBytes(
170170
brotli.length

scripts/release.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import minimist from 'minimist'
33
import fs from 'node:fs'
44
import path from 'node:path'
5-
import chalk from 'chalk'
5+
import pico from 'picocolors'
66
import semver from 'semver'
77
import enquirer from 'enquirer'
88
import { execa } from 'execa'
@@ -73,16 +73,16 @@ const inc = i => semver.inc(currentVersion, i, preId)
7373
const run = (bin, args, opts = {}) =>
7474
execa(bin, args, { stdio: 'inherit', ...opts })
7575
const dryRun = (bin, args, opts = {}) =>
76-
console.log(chalk.blue(`[dryrun] ${bin} ${args.join(' ')}`), opts)
76+
console.log(pico.blue(`[dryrun] ${bin} ${args.join(' ')}`), opts)
7777
const runIfNotDry = isDryRun ? dryRun : run
7878
const getPkgRoot = pkg => path.resolve(__dirname, '../packages/' + pkg)
79-
const step = msg => console.log(chalk.cyan(msg))
79+
const step = msg => console.log(pico.cyan(msg))
8080

8181
async function main() {
8282
if (!(await isInSyncWithRemote())) {
8383
return
8484
} else {
85-
console.log(`${chalk.green(`✓`)} commit is up-to-date with rmeote.\n`)
85+
console.log(`${pico.green(`✓`)} commit is up-to-date with rmeote.\n`)
8686
}
8787

8888
let targetVersion = args._[0]
@@ -285,7 +285,7 @@ async function main() {
285285

286286
if (skippedPackages.length) {
287287
console.log(
288-
chalk.yellow(
288+
pico.yellow(
289289
`The following packages are skipped and NOT published:\n- ${skippedPackages.join(
290290
'\n- '
291291
)}`
@@ -361,7 +361,7 @@ function updateDeps(pkg, depType, version, getNewPackageName) {
361361
const newName = getNewPackageName(dep)
362362
const newVersion = newName === dep ? version : `npm:${newName}@${version}`
363363
console.log(
364-
chalk.yellow(`${pkg.name} -> ${depType} -> ${dep}@${newVersion}`)
364+
pico.yellow(`${pkg.name} -> ${depType} -> ${dep}@${newVersion}`)
365365
)
366366
deps[dep] = newVersion
367367
}
@@ -407,10 +407,10 @@ async function publishPackage(pkgName, version) {
407407
stdio: 'pipe'
408408
}
409409
)
410-
console.log(chalk.green(`Successfully published ${pkgName}@${version}`))
410+
console.log(pico.green(`Successfully published ${pkgName}@${version}`))
411411
} catch (e) {
412412
if (e.stderr.match(/previously published/)) {
413-
console.log(chalk.red(`Skipping already published: ${pkgName}`))
413+
console.log(pico.red(`Skipping already published: ${pkgName}`))
414414
} else {
415415
throw e
416416
}

scripts/utils.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22
import fs from 'node:fs'
3-
import chalk from 'chalk'
3+
import pico from 'picocolors'
44
import { createRequire } from 'node:module'
55

66
const require = createRequire(import.meta.url)
@@ -33,8 +33,8 @@ export function fuzzyMatchTarget(partialTargets, includeAllMatching) {
3333
} else {
3434
console.log()
3535
console.error(
36-
` ${chalk.bgRed.white(' ERROR ')} ${chalk.red(
37-
`Target ${chalk.underline(partialTargets)} not found!`
36+
` ${pico.white(pico.bgRed(' ERROR '))} ${pico.red(
37+
`Target ${pico.underline(partialTargets)} not found!`
3838
)}`
3939
)
4040
console.log()

scripts/verifyCommit.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @ts-check
2-
import chalk from 'chalk'
2+
import pico from 'picocolors'
33
import { readFileSync } from 'fs'
44
import path from 'path'
55

@@ -12,17 +12,17 @@ const commitRE =
1212
if (!commitRE.test(msg)) {
1313
console.log()
1414
console.error(
15-
` ${chalk.bgRed.white(' ERROR ')} ${chalk.red(
15+
` ${pico.white(pico.bgRed(' ERROR '))} ${pico.red(
1616
`invalid commit message format.`
1717
)}\n\n` +
18-
chalk.red(
18+
pico.red(
1919
` Proper commit message format is required for automated changelog generation. Examples:\n\n`
2020
) +
21-
` ${chalk.green(`feat(compiler): add 'comments' option`)}\n` +
22-
` ${chalk.green(
21+
` ${pico.green(`feat(compiler): add 'comments' option`)}\n` +
22+
` ${pico.green(
2323
`fix(v-model): handle events on blur (close #28)`
2424
)}\n\n` +
25-
chalk.red(` See .github/commit-convention.md for more details.\n`)
25+
pico.red(` See .github/commit-convention.md for more details.\n`)
2626
)
2727
process.exit(1)
2828
}

0 commit comments

Comments
 (0)