Nest: Remove cli-color dependency

Created on 23 Sep 2020  路  4Comments  路  Source: nestjs/nest

Bug Report

Current behavior


Currently dependency on cli-color is pulling up some legacy stuff(es5 shims etc.) causing crash when compiling with NCC - see https://github.com/vercel/ncc/issues/594.
It creates some weird webpack bug where it requires some random module instead of correct one.

Possible Solution

https://github.com/nestjs/nest/blob/master/packages/common/services/logger.service.ts

const clc = {
  green: a => `\x1B[32m${a}\x1B[39m`,
  yellow: a => `\x1B[33m${a}\x1B[39m`,
  red: a => `\x1B[31m${a}\x1B[39m`,
  magentaBright: a => `\x1B[95m${a}\x1B[39m`,
  cyanBright: a => `\x1B[96m${a}\x1B[39m`
}
const yellow = a => `\x1B[38;5;3m${a}\x1B[39m`; // xterm(3)
needs triage

Most helpful comment

Sounds good to me :) Let's keep them together in a separate file and we should be fine

All 4 comments

Would you like to create a PR for this issue?

@kamilmysliwiec sure :D would it be fine with you if I were to hardcode only the needed colors, similar to above?

Sounds good to me :) Let's keep them together in a separate file and we should be fine

Removed in 7.5.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anyx picture anyx  路  3Comments

mishelashala picture mishelashala  路  3Comments

janckerchen picture janckerchen  路  3Comments

yanshuf0 picture yanshuf0  路  3Comments

KamGor picture KamGor  路  3Comments