Skip to content

Commit

Permalink
cleanup(core): migrate rollup to picocolors
Browse files Browse the repository at this point in the history
Migrates from `chalk` to `picocolors`.
  • Loading branch information
43081j committed Sep 28, 2024
1 parent f221a41 commit 8d6c777
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion packages/rollup/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
"rules": {
"no-restricted-imports": [
"error",
{
"name": "chalk",
"message": "Please use `picocolors` in place of `chalk` for rendering terminal colors"
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
Expand Down
2 changes: 1 addition & 1 deletion packages/rollup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"autoprefixer": "^10.4.9",
"chalk": "^4.1.0",
"minimatch": "9.0.3",
"picocolors": "^1.1.0",
"postcss": "^8.4.38",
"rollup": "^4.14.0",
"rollup-plugin-copy": "^3.5.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/rollup/src/plugins/analyze.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as chalk from 'chalk';
import * as pc from 'picocolors';
import { logger } from '@nx/devkit';

const formatBytes = (bytes) => {
Expand All @@ -16,7 +16,7 @@ export function analyze() {
renderChunk(source, chunk) {
const sourceBytes = formatBytes(source.length);
const fileName = chunk.fileName;
logger.info(` ${chalk.bold(fileName)} ${chalk.cyan(sourceBytes)}`);
logger.info(` ${pc.bold(fileName)} ${pc.cyan(sourceBytes)}`);
},
};
}

0 comments on commit 8d6c777

Please sign in to comment.