jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.26k stars 508 forks source link

disable progress-estimator logging (for `lerna run --stream build` or CI) #689

Open langpavel opened 4 years ago

langpavel commented 4 years ago

In CI environment or with lerna run --stream build it is desired to not clean line. This is caused by fancy logger (from progress-estimator)

Current Behavior

Fancy progress estimator appear in console on tsdx build. This is not as cool as it should be in some cases, it may overwrites output of different process run in parallel i.e. with lerna --stream

Desired Behavior

Possibility to turn on no line-destructive logger

Suggested Solution

Replace fancy progress-estimator with primitive console.log if:

Who does this impact? Who is this for?

agilgur5 commented 4 years ago

This sounds like a reasonable feature to have. Alternatively, would a --silent config option work for you? All of TSDX's tests run in parallel as well and it makes for quite messy output, so I've been thinking of adding a silencing option for that alone.

--silent might be preferred for CI too (if you like clean logs). But yea we could check for non-TTY env (process.stdout.isTTY) or for CI env(process.env.CI) to auto-set this or a console.log option.

I'm not sure what a console.log alternative would be called; should be more generic than --no-estimate but I can't think of it off the top of my head (I feel like there's a term for this).

langpavel commented 4 years ago

@agilgur5 --silent is not what I'm looking for. Build and test output is quite useful. (You may send everything to /dev/null and result will be the same :-) )

I'm not using tsdx test runner in monorepo, only in one package if needed (for monorepo I have global jest config) Sad is all the fancy logging output without respect to stupid terminals and text logs.

I can possibly prepare PR with --no-estimate

helt commented 4 years ago

lerna uses a global --no-progress flag, hence i suppose to stick with their naming convention.