Skip to content

Commit 503ca47

Browse files
committed
fix: remove chalk dependency
1 parent c4bff2c commit 503ca47

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

lib/commands/base.command.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import chalk from 'chalk';
21
import { Command } from 'commander';
2+
import { Logger } from '@nestjs/common';
33

44
export abstract class BaseCommand {
55
protected program: Command;
6+
private logger = new Logger();
67

78
abstract handle(): void;
89

@@ -11,18 +12,18 @@ export abstract class BaseCommand {
1112
}
1213

1314
public success(message): void {
14-
console.log(chalk.green(message));
15+
this.logger.log(message);
1516
}
1617

1718
public error(message): void {
18-
console.log(chalk.red(message));
19+
this.logger.error(message);
1920
}
2021

2122
public info(message): void {
22-
console.log(chalk.blue(message));
23+
this.logger.log(message);
2324
}
2425

2526
public warn(message): void {
26-
console.log(chalk.yellow(message));
27+
this.logger.warn(message);
2728
}
2829
}

package-lock.json

+8-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hodfords/nestjs-command",
3-
"version": "11.0.5",
3+
"version": "11.0.6",
44
"description": "A utility for running CLI commands in NestJS apps",
55
"main": "index.js",
66
"scripts": {
@@ -56,8 +56,7 @@
5656
"commander": "13.1.0",
5757
"@nestjs/common": "*",
5858
"@nestjs/core": "*",
59-
"@nestjs/schedule": "*",
60-
"chalk": "^4.1.2"
59+
"@nestjs/schedule": "*"
6160
},
6261
"optionalDependencies": {
6362
"typeorm": "*"

0 commit comments

Comments
 (0)