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

artaommahe picture artaommahe  路  3Comments

rafal-rudnicki picture rafal-rudnicki  路  3Comments

menme95 picture menme95  路  3Comments

2233322 picture 2233322  路  3Comments

hackboy picture hackboy  路  3Comments