Skip to content

Commit b202ed6

Browse files
authored
chore(dts-plugin): replace chalk with native styleText (#4594)
1 parent 7ff9563 commit b202ed6

3 files changed

Lines changed: 518 additions & 872 deletions

File tree

packages/dts-plugin/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"adm-zip": "^0.5.10",
7373
"ansi-colors": "^4.1.3",
7474
"axios": "^1.13.5",
75-
"chalk": "3.0.0",
7675
"fs-extra": "9.1.0",
7776
"isomorphic-ws": "5.0.0",
7877
"lodash.clonedeepwith": "4.5.0",

packages/dts-plugin/src/server/utils/logTransform.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import chalk from 'chalk';
1+
import { styleText } from 'node:util';
22
import { BrokerExitLog, PublisherRegisteredLog, LogKind } from '../message/Log';
33

44
function transformBrokerExitLog(log: BrokerExitLog): string {
5-
return chalk`{bold {cyan [ Broker Exit ]}
6-
{grey LEVEL} {white ${log.level}}}`;
5+
return `${styleText(['bold', 'cyan'], '[ Broker Exit ]')}\n ${styleText(['bold', 'gray'], 'LEVEL')} ${styleText(['bold', 'white'], log.level)}`;
76
}
87

98
function transformPublisherRegisteredLog(log: PublisherRegisteredLog): string {
10-
return chalk`{bold {cyan [ Publisher Registered ]} {grey LEVEL} {white ${log.level}}}`;
9+
return `${styleText(['bold', 'cyan'], '[ Publisher Registered ]')} ${styleText(['bold', 'gray'], 'LEVEL')} ${styleText(['bold', 'white'], log.level)}`;
1110
}
1211

1312
export type Log = BrokerExitLog | PublisherRegisteredLog;

0 commit comments

Comments
 (0)