Skip to content

correct how we import chalk in cli.ts #6026

@Adam-it

Description

@Adam-it

here we made a small mistake
3b7cd6f#diff-25768f5853544984f9e0188641fe6d70f0e5d5245c9317d80be7d3d32a71dd44

We should not import chalk at the top globally but rather inline only when needed.
We already have it done like this in other places, for example:

const chalk = (await import('chalk')).default;
await logger.logToStderr(chalk.green('DONE'));

We only need chalk when we write colors, ie. log errors. Since we typically don't do it, we don't load chalk by default, which improves performance of the CLI.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions