Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: replace picocolors with ansis #160

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

webdiscus
Copy link
Contributor

Description

Hello @antfu,

This PR replaces picocolors with a better alternative ansis that supports both CJS and ESM.
Ansis supports chained syntax for clean and readable code.
Ansis is nearly as small (6.8 kB) as Picocolors (6.4 kB).

Code refactoring example:

-  console.error(c.inverse(c.red(c.bold(' ERROR '))))
+  console.error(c.inverse.red.bold` ERROR `)

Test

Before test run pnpm run build.

Run pnpm test:

• testparseDependencies test ts (5 tests) 8ms

Run node dist/cli.mjs:

taze - 1

Run node dist/cli.mjs major -w:

taze - 1 patch

Run node dist/cli.mjs -a:

Pasted Graphic 5

@antfu antfu merged commit c305650 into antfu-collective:main Feb 12, 2025
5 checks passed
@webdiscus webdiscus deleted the feat-switch-to-ansis branch February 12, 2025 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants