Just migrated my cli app from ora+prompts to ink and found a problem in Travis CI logs: https://travis-ci.com/dcodeteam/stylotron/jobs/184495917
This component https://github.com/dcodeteam/stylotron/blob/master/src/lint/FileLintStatus.tsx renders file details line.
Expected output in non tty environment looks like this:

Works as expected in Gitlab CI.

I'm afraid that's the issue on Travis CI's side, apparently it doesn't handle erasing lines correctly. I remember in https://github.com/avajs/ava we had to write output using regular process.stdout.write('something') without log-update. One fix for this comes to my mind is to detect CI environment and render only last frame, before CLI exits. @umidbekkarimov @sindresorhus what do you think?
One fix for this comes to my mind is to detect CI environment and render only last frame, before CLI exits.
@vadimdemedes I like this idea. Most of the times we need final output in CIs, not the progress. If this fix will provide consistent output between environments - then I'm all for it.
Also it can make easier to build dynamic components (e.g. progress bars, spinners).
Maybe dump all in Static, and last frame only if no static component in the tree? Something like that would be required for Jest (so we can render test results as the suites complete)
@SimenB Yep for sure, <Static> isn't affected by this issue, since it just writes directly to stdout, without erasing any lines.
Perfect!
If you decide to go this route, is-ci should be a configurable option so you don't have to support every use case.
Fixed in master via https://github.com/vadimdemedes/ink/commit/92f43933f04f1d40175195a931fe5588885f7c1d, will close this issue when new release is out.
@umidbekkarimov would you be able to test latest Ink via npm install vadimdemedes/ink and see if it solves your problem?
@umidbekkarimov would you be able to test latest Ink via npm install vadimdemedes/ink and see if it solves your problem?
@vadimdemedes I tried to install @vadimdemedes/ink but it's not there https://www.npmjs.com/search?q=vadimdemedes%2Fink
@umidbekkarimov not the @, he wanted you to install from github
@vadimdemedes here logs with latest ink https://travis-ci.com/dcodeteam/stylotron/jobs/188297737, works great!
New release is out - https://github.com/vadimdemedes/ink/releases/tag/v2.1.0 馃巻