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 and chalk with ansis #935

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

webdiscus
Copy link
Contributor

Description

Hello @antfu,

This PR replaces two packages picocolors (6.4 kB) and chalk (43 kB) with one ansis (6.6 kB) that supports truecolor with fallback, like as Chalk.

Test

Before test run pnpm run build.

Run pnpm test:

Test Files

Run pnpm run report-engine-js:

 esno scriptsreport-engine-js-compat ts

Testing the Chalk replacement

Run cd packages/cli/ && ./bin.mjs src/code-to-ansi.ts --lang=ts:

Outputs in truecolor (via ansis.hex() function):

Pasted Graphic 11

Copy link

netlify bot commented Feb 16, 2025

Deploy Preview for shiki-matsu ready!

Name Link
🔨 Latest commit 2a2c66f
🔍 Latest deploy log https://app.netlify.com/sites/shiki-matsu/deploys/67b245ee11fe060007be56d0
😎 Deploy Preview https://deploy-preview-935--shiki-matsu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 16, 2025

Deploy Preview for shiki-next ready!

Name Link
🔨 Latest commit 2a2c66f
🔍 Latest deploy log https://app.netlify.com/sites/shiki-next/deploys/67b245eec1f5b2000867faf5
😎 Deploy Preview https://deploy-preview-935--shiki-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -7,7 +7,7 @@
"lint": "eslint . --cache",
"release": "bumpp",
"publish:ci": "pnpm -r publish --access public --no-git-checks",
"test": "vitest",
"test": "FORCE_COLOR=3 && vitest",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "FORCE_COLOR=3" required to enable color output in console, since vitest is not TTY.

@antfu antfu merged commit ecc4a66 into shikijs:main Feb 17, 2025
11 of 12 checks passed
@webdiscus webdiscus deleted the feat-switch-to-ansis branch February 17, 2025 09:44
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