Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup(misc): migrate rollup to picocolors #28186

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)}`);
},
};
}