Skip to content

Commit

Permalink
chore: replace chalk with picocolors (#715)
Browse files Browse the repository at this point in the history
  • Loading branch information
notsatvrn committed Feb 26, 2022
1 parent f5ef5f5 commit b666c39
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
"arg": "^5.0.1",
"bumpp": "^7.1.1",
"caller-path": "^3.0.0",
"chalk": "^4.1.0",
"color-string": "^1.9.0",
"cross-env": "^7.0.3",
"diff": "^5.0.0",
Expand All @@ -144,6 +143,7 @@
"mini-svg-data-uri": "^1.4.3",
"minimatch": "^3.0.4",
"nyc": "^15.1.0",
"picocolors": "^1.0.0",
"pirates": "^4.0.4",
"rollup": "^2.61.1",
"sucrase": "^3.20.3",
Expand Down
8 changes: 6 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions test/snapshot.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { basename, dirname, join } from 'path';
import fs from 'fs-extra';
import yaml from 'js-yaml';
import chalk from 'chalk';
import colors from 'picocolors';
import { diffLines } from 'diff';

/**
Expand Down Expand Up @@ -40,10 +40,10 @@ export function compareDiff<T extends string>(
}

const diff = diffLines(expected, actual);
let messages = chalk.yellow(reason) + '\n\n';
let messages = colors.yellow(reason) + '\n\n';
diff.forEach((part) => {
const color = part.added ? 'green' : part.removed ? 'red' : 'gray';
messages += chalk.gray[color](part.value);
messages += colors.gray[color](part.value);
});
return {
pass: false,
Expand Down

0 comments on commit b666c39

Please sign in to comment.