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(webpack): migrate to picocolors #28315

Merged
merged 1 commit into from
Nov 5, 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/webpack/.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/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"autoprefixer": "^10.4.9",
"babel-loader": "^9.1.2",
"browserslist": "^4.21.4",
"chalk": "^4.1.0",
"picocolors": "^1.1.0",
"copy-webpack-plugin": "^10.2.4",
"css-loader": "^6.4.0",
"css-minimizer-webpack-plugin": "^5.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
readTargetOptions,
runExecutor,
} from '@nx/devkit';
import * as chalk from 'chalk';
import * as pc from 'picocolors';
import { combineAsyncIterables } from '@nx/devkit/src/utils/async-iterable';

import { WebpackExecutorOptions } from '../webpack/schema';
Expand Down Expand Up @@ -62,7 +62,7 @@ export async function* ssrDevServerExecutor(
if (nodeStarted && browserBuilt) {
await waitUntilServerIsListening(options.port);
console.log(
`[ ${chalk.green('ready')} ] on http://localhost:${options.port}`
`[ ${pc.green('ready')} ] on http://localhost:${options.port}`
);
yield {
...output,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { logger, type ProjectGraph } from '@nx/devkit';
import { registerTsProject } from '@nx/js/src/internal';
import { findMatchingProjects } from 'nx/src/utils/find-matching-projects';
import * as chalk from 'chalk';
import * as pc from 'picocolors';
import { join } from 'path';
import { existsSync, readFileSync } from 'fs';
import { ModuleFederationConfig } from './models/index';
Expand Down Expand Up @@ -107,7 +107,7 @@ export function getRemotes(
);

logger.info(
`NX Starting module federation dev-server for ${chalk.bold(
`NX Starting module federation dev-server for ${pc.bold(
context.projectName
)} with ${[...knownRemotes, ...knownDynamicRemotes].length} remotes`
);
Expand Down