arethetypeswrong / arethetypeswrong.github.io

Tool for analyzing TypeScript types of npm packages

Home Page:https://arethetypeswrong.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uneven edge of the CLI table

RobinTail opened this issue · comments

Not a big issue, but I was wondering why it looks like this having so advanced libraries used for the CLI formatting and colorizing.
My best guess is that emojies are UTF-16, while the tool making paddings only accepts UTF-8.
Perhaps there should be some special method that can figure out UTF-16 string length in order to make correct paddings.

image

It's also interesting that the space after green circle is only visible when I copy/paste the text from the console.
I'm using iTerm2.

┌───────────────────┬───────────────────┐
│                   │ "express-zod-api" │
├───────────────────┼───────────────────┤
│ node10            │ 🟢                │
├───────────────────┼───────────────────┤
│ node16 (from CJS) │ 🟢 (CJS)          │
├───────────────────┼───────────────────┤
│ node16 (from ESM) │ 🟢 (ESM)          │
├───────────────────┼───────────────────┤
│ bundler           │ 🟢                │
└───────────────────┴───────────────────┘

I have also noticed this and it bugs me, but not enough to try to track down a fix in cli-table3. https://github.com/cli-table/cli-table3. Maybe a small repro there would gain some traction. I’d love to pick up a fix but don’t have time to do it myself.

Fixed in v0.13.0, @andrewbranch

image

Huhmmm, if that’s true, I guess it wasn’t cli-table3 because they haven’t had any new releases: https://github.com/cli-table/cli-table3/releases. In 0.13 I switched to pnpm and wiped the npm lockfile, so I have no idea what it was!