Skip to content

Commit

Permalink
cleanup(web): migrate to picocolors (#28039)
Browse files Browse the repository at this point in the history
(cherry picked from commit 246494a)
  • Loading branch information
43081j authored and FrozenPandaz committed Sep 25, 2024
1 parent 0a7dc0c commit 6c37333
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion packages/web/.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"],
Expand Down
2 changes: 1 addition & 1 deletion packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"migrations": "./migrations.json"
},
"dependencies": {
"chalk": "^4.1.0",
"detect-port": "^1.5.1",
"http-server": "^14.1.0",
"picocolors": "^1.1.0",
"tslib": "^2.3.0",
"@nx/devkit": "file:../devkit",
"@nx/js": "file:../js"
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/executors/file-server/file-server.impl.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { execFileSync, fork } from 'child_process';
import * as chalk from 'chalk';
import * as pc from 'picocolors';
import {
ExecutorContext,
output,
Expand Down Expand Up @@ -176,7 +176,7 @@ export default async function* fileServerExecutor(
});
} catch {
throw new Error(
`Build target failed: ${chalk.bold(options.buildTarget)}`
`Build target failed: ${pc.bold(options.buildTarget)}`
);
} finally {
process.env.NX_SERVE_STATIC_BUILD_RUNNING = undefined;
Expand Down

0 comments on commit 6c37333

Please sign in to comment.