Skip to content

Commit

Permalink
chore(create-jest): replace chalk with picocolors
Browse files Browse the repository at this point in the history
  • Loading branch information
ishon19 committed Jul 17, 2024
1 parent 69e103d commit 19a4639
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/create-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
},
"dependencies": {
"@jest/types": "workspace:*",
"chalk": "^4.0.0",
"exit": "^0.1.2",
"graceful-fs": "^4.2.9",
"jest-config": "workspace:*",
"jest-util": "workspace:*",
"picocolors": "^1.0.1",
"prompts": "^2.0.1"
},
"engines": {
Expand Down
12 changes: 6 additions & 6 deletions packages/create-jest/src/runCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/

import * as path from 'path';
import chalk = require('chalk');
import exit = require('exit');
import * as fs from 'graceful-fs';
import picocolors = require('picocolors');
import prompts = require('prompts');
import {constants} from 'jest-config';
import {clearLine, tryRealpath} from 'jest-util';
Expand Down Expand Up @@ -37,9 +37,9 @@ export async function runCLI(): Promise<void> {
clearLine(process.stderr);
clearLine(process.stdout);
if (error instanceof Error && Boolean(error?.stack)) {
console.error(chalk.red(error.stack));
console.error(picocolors.red(error.stack));
} else {
console.error(chalk.red(error));
console.error(picocolors.red(String(error)));
}

exit(1);
Expand Down Expand Up @@ -103,7 +103,7 @@ export async function runCreate(rootDir = process.cwd()): Promise<void> {
// Start the init process
console.log();
console.log(
chalk.underline(
picocolors.underline(
'The following questions will help Jest to create a suitable configuration for your project\n',
),
);
Expand Down Expand Up @@ -146,7 +146,7 @@ export async function runCreate(rootDir = process.cwd()): Promise<void> {
fs.writeFileSync(projectPackageJsonPath, modifiedPackageJson);

console.log('');
console.log(`✏️ Modified ${chalk.cyan(projectPackageJsonPath)}`);
console.log(`✏️ Modified ${picocolors.cyan(projectPackageJsonPath)}`);
}

const generatedConfig = generateConfigFile(
Expand All @@ -159,6 +159,6 @@ export async function runCreate(rootDir = process.cwd()): Promise<void> {

console.log('');
console.log(
`📝 Configuration file created at ${chalk.cyan(jestConfigPath)}`,
`📝 Configuration file created at ${picocolors.cyan(jestConfigPath)}`,
);
}

0 comments on commit 19a4639

Please sign in to comment.