jorgebucaran / colorette

🌈Easily set your terminal text color & styles
MIT License
1.61k stars 51 forks source link

Support for CI environments is lacking #61

Closed kibertoad closed 3 years ago

kibertoad commented 3 years ago

Current implementation doesn't reliably determine colour support in CI environments, resulting e. g. in CI for https://github.com/pinojs/pino-pretty/tree/feat/colorette breaking.

I think these lines from supports-colour should be included:

    if ('CI' in env) {
        if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
            return 1;
        }

        return min;
    }
kibertoad commented 3 years ago

@jorgebucaran Would you accept a PR for this?

jorgebucaran commented 3 years ago

Of course. Do you think we can simplify this expression to check for only the main services (GitHub, CircleCI)?

kibertoad commented 3 years ago

@jorgebucaran Sure, although I would also include GitLab there, lots of major players are using it.

jorgebucaran commented 3 years ago

Makes sense. 👌

kibertoad commented 3 years ago

@jorgebucaran Any chance you could publish a new version?

jorgebucaran commented 3 years ago

Yes, sorry, will do! 🙇‍♂️

jorgebucaran commented 3 years ago

Published as @1.3.0. I didn't include #60 because it doesn't really block you.