cli-width icon indicating copy to clipboard operation
cli-width copied to clipboard

feat: drop node < 18, es module, update testing to use vitest

Open knownasilya opened this issue 1 year ago • 2 comments

BREAKING CHANGE: drop node < 18, es modules and cjs

Not that big of a change, mostly lockfile bloating the numbers

knownasilya avatar Feb 10 '24 20:02 knownasilya

@SBoudrias I was wondering on the dual version and if it was needed, this answers my question. Any suggestions on how to do the dual variant?

knownasilya avatar Feb 12 '24 19:02 knownasilya

I found it not too complicated to put together with Typescript (if you don't mind using it for cli-width.) Not sure how I'd approach it just with raw JS.

But you can see I generate 2 tsconfig (tsconfig.json/tsconfig.cjs.json.) And then I compile both output at build time. And lastly, there's a "bug" in TS where the output isn't clear... So last step is run a little script to fix the files imports.

The extension issue maybe could be fixed if I didn't use .mts, but that caused some other issues. So that ended up being easier for me (without having to rely on another build-tool middle layer I need to learn, configure and maintain.)

Hope this help - esm/cjs is far from easy today unfortunately 😞

SBoudrias avatar Feb 12 '24 19:02 SBoudrias