Closed mbostock closed 3 weeks ago
It works in local tests (with say, yarn docs:build | tee build.log
), but doesn't work at all on cloud: my logs are full of color codes.
https://observablehq.com/projects/@observablehq/pangea/deploys/e9b695e6f5001670
When I look at the source code, the logic is defaulting to using colors when !!env.CI
. In other words, it is expected that CI always supports ANSI colors.
https://github.com/alexeyraspopov/picocolors/blob/7249f8c5d4825550f70bc1ea98652639933d3bbd/picocolors.js#L4
I think it's a fair assumption, and that we should merge this in nonetheless, when we're ready.
That’s a pre-existing problem with Cloud logs, right? E.g., this oss-analytics deploy. This makes it worse, but seems like something that shouldn’t block this PR.
OK then!
Replaces our hand-rolled version with the popular picocolors, offering support for
NO_COLOR
and relying on picocolor’s own color support detection. As an alternative, we could also use yoctocolors which already useshasColors
… but I figured picocolors is nice because it’s already a dependency of clack.Related #1764.