Skip to content

Commit

Permalink
chore: replace chalk with picocolors (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound committed Dec 20, 2021
1 parent cf57571 commit f124628
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/launch-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const fs = require('fs')
const os = require('os')
const path = require('path')
const chalk = require('chalk')
const colors = require('picocolors')
const childProcess = require('child_process')

const guessEditor = require('./guess')
Expand All @@ -21,14 +21,14 @@ function wrapErrorCallback (cb) {
return (fileName, errorMessage) => {
console.log()
console.log(
chalk.red('Could not open ' + path.basename(fileName) + ' in the editor.')
colors.red('Could not open ' + path.basename(fileName) + ' in the editor.')
)
if (errorMessage) {
if (errorMessage[errorMessage.length - 1] !== '.') {
errorMessage += '.'
}
console.log(
chalk.red('The editor process exited with an error: ' + errorMessage)
colors.red('The editor process exited with an error: ' + errorMessage)
)
}
console.log()
Expand Down
2 changes: 1 addition & 1 deletion packages/launch-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"homepage": "https://github.com/yyx990803/launch-editor#readme",
"dependencies": {
"chalk": "^2.3.0",
"picocolors": "^1.0.0",
"shell-quote": "^1.6.1"
}
}
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3:
strip-ansi "^3.0.0"
supports-color "^2.0.0"

chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0:
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba"
dependencies:
Expand Down Expand Up @@ -1798,6 +1798,11 @@ path-type@^2.0.0:
dependencies:
pify "^2.0.0"

picocolors@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==

pify@^2.0.0, pify@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
Expand Down

0 comments on commit f124628

Please sign in to comment.