Skip to content

Commit

Permalink
chore(jest-resolve): replace chalk with picocolors
Browse files Browse the repository at this point in the history
  • Loading branch information
ishon19 committed Jul 23, 2024
1 parent 87fb3f3 commit 0fd1645
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/jest-resolve/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
"./package.json": "./package.json"
},
"dependencies": {
"chalk": "^4.0.0",
"graceful-fs": "^4.2.9",
"jest-haste-map": "workspace:*",
"jest-pnp-resolver": "^1.2.2",
"jest-util": "workspace:*",
"jest-validate": "workspace:*",
"picocolors": "^1.0.1",
"resolve": "^1.20.0",
"resolve.exports": "^2.0.0",
"slash": "^3.0.0"
Expand Down
12 changes: 6 additions & 6 deletions packages/jest-resolve/src/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import * as path from 'path';
import chalk = require('chalk');
import * as pico from 'picocolors';
import slash = require('slash');
import type {IModuleMap} from 'jest-haste-map';
import {tryRealpath} from 'jest-util';
Expand Down Expand Up @@ -838,17 +838,17 @@ const createNoMappedModuleFoundError = (
: mappedModuleName;

const error = new Error(
chalk.red(`${chalk.bold('Configuration error')}:
pico.red(`${pico.bold('Configuration error')}:
Could not locate module ${chalk.bold(moduleName)} mapped as:
${chalk.bold(mappedAs)}.
Could not locate module ${pico.bold(moduleName)} mapped as:
${pico.bold(mappedAs)}.
Please check your configuration for these entries:
{
"moduleNameMapper": {
"${regex.toString()}": "${chalk.bold(original)}"
"${regex.toString()}": "${pico.bold(original)}"
},
"resolver": ${chalk.bold(String(resolver))}
"resolver": ${pico.bold(String(resolver))}
}`),
);

Expand Down
10 changes: 5 additions & 5 deletions packages/jest-resolve/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
*/

import * as path from 'path';
import chalk = require('chalk');
import * as pico from 'picocolors';
import {ValidationError} from 'jest-validate';
import Resolver from './resolver';

const BULLET: string = chalk.bold('\u25CF ');
const DOCUMENTATION_NOTE = ` ${chalk.bold('Configuration Documentation:')}
const BULLET: string = pico.bold('\u25CF ');
const DOCUMENTATION_NOTE = ` ${pico.bold('Configuration Documentation:')}
https://jestjs.io/docs/configuration
`;

Expand Down Expand Up @@ -73,9 +73,9 @@ const resolveWithPrefix = (
} catch {}

throw createValidationError(
` ${humanOptionName} ${chalk.bold(
` ${humanOptionName} ${pico.bold(
fileName,
)} cannot be found. Make sure the ${chalk.bold(
)} cannot be found. Make sure the ${pico.bold(
optionName,
)} configuration option points to an existing node module.`,
);
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13398,12 +13398,12 @@ __metadata:
"@types/graceful-fs": ^4.1.3
"@types/pnpapi": ^0.0.5
"@types/resolve": ^1.20.2
chalk: ^4.0.0
graceful-fs: ^4.2.9
jest-haste-map: "workspace:*"
jest-pnp-resolver: ^1.2.2
jest-util: "workspace:*"
jest-validate: "workspace:*"
picocolors: ^1.0.1
resolve: ^1.20.0
resolve.exports: ^2.0.0
slash: ^3.0.0
Expand Down

0 comments on commit 0fd1645

Please sign in to comment.