clack icon indicating copy to clipboard operation
clack copied to clipboard

[Request] replace `picocolors` with `styleText`

Open benmccann opened this issue 6 months ago • 6 comments

Is your feature request related to a problem? Please describe.

picocolors adds a dependency https://github.com/bombshell-dev/clack/blob/94fee2a90148c5c09503e9b6d7179fa740f08d7e/packages/core/package.json#L53

Describe the solution you'd like styleText is built-in to Node and would remove the need for an extra dependency: https://nodejs.org/api/util.html#utilstyletextformat-text-options

Describe alternatives you've considered N/A

Additional context N/A

benmccann avatar May 30 '25 16:05 benmccann

its available since node 20 it seems

we don't have an engine constraint but our major users probably do. I'd be interested to know who is using clack and what their constraint is (svelte CLI? vite? )

43081j avatar Jun 01 '25 16:06 43081j

Vite specifies "node": "^20.19.0 || >=22.12.0". Svelte CLI doesn't explicitly specify engines, but I'd be happy to require Node 20 there

benmccann avatar Jun 01 '25 16:06 benmccann

In that case I'm happy 😀

Let's see what @dreyfus92 and @natemoo-re think

But seems like an easy change to me that we could do at some point

43081j avatar Jun 01 '25 20:06 43081j

This is indeed a wise move, we should be able to pull this off once #334 and #335 are merged. The only thing that worries me is that this change requires Node.js 20+, which might affect users on older versions.

dreyfus92 avatar Jun 01 '25 21:06 dreyfus92

Yeah, I waited to suggest it until Node 18 was dropped from LTS for that reason. I figured most people are running somewhat modern versions for local development even if their production or CI environments are a bit older

benmccann avatar Jun 01 '25 21:06 benmccann

I will start playing around with this before working on the multiline prompt @43081j 😁 Once I play enough with this i will roll back at you @benmccann 🤘🏻

dreyfus92 avatar Jun 10 '25 20:06 dreyfus92