Skip to content

Comments

perf(deps): replace picocolors with styleText from node:util#7126

Merged
chenjiahan merged 3 commits intomainfrom
style_text_0203
Feb 3, 2026
Merged

perf(deps): replace picocolors with styleText from node:util#7126
chenjiahan merged 3 commits intomainfrom
style_text_0203

Conversation

@chenjiahan
Copy link
Member

Summary

  • Removed the picocolors package
  • Added a new internal color utility in using Node.js's styleText

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings February 3, 2026 05:49
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @chenjiahan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on optimizing project dependencies and improving performance by replacing the third-party picocolors library with a custom color utility that utilizes Node.js's native styleText function. This change streamlines console output styling, reduces external dependencies, and aligns with a more lightweight approach to utility functions within the project.

Highlights

  • Dependency Removal: The external picocolors library has been removed from the project dependencies, reducing the overall package footprint.
  • Internal Color Utility: A new internal color utility (packages/core/src/helpers/color.ts) has been introduced, leveraging Node.js's built-in node:util.styleText for console text styling.
  • Code Refactoring: All files previously importing picocolors have been updated to use the newly created internal color utility, ensuring consistent and native-based text styling.
  • Minor Logic Improvement: A small refinement was made in packages/core/src/cli/commands.ts to ensure that command titles are only colored if they exist, preventing potential issues with undefined values.
Changelog
  • packages/core/package.json
    • Removed picocolors from dependencies.
  • packages/core/src/cli/commands.ts
    • Modified conditional logic to ensure section.title exists before applying cyan color styling.
  • packages/core/src/helpers/color.ts
    • Added new file to implement a custom color utility using node:util.styleText for various text styles (e.g., red, yellow, green, bold, underline).
  • packages/core/src/helpers/format.ts
    • Replaced import of picocolors with the new internal color utility from ./color.
  • packages/core/src/helpers/index.ts
    • Replaced import of picocolors with the new internal color utility from ./color.
  • packages/core/src/helpers/stats.ts
    • Replaced import of picocolors with the new internal color utility from ./color.
  • packages/core/src/logger.ts
    • Replaced import of picocolors with the new internal color utility from ./helpers/color.
Activity
  • No specific activity (comments, reviews, progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request replaces the picocolors dependency with the native Node.js styleText utility for coloring console output. This is a great move for reducing dependencies. The implementation of the new color utility is clean, and the replacement is done correctly across the codebase. I've also noticed a nice bug fix in the CLI help message generation. I have one suggestion to improve the maintainability of the new color utility by reducing some code duplication.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves performance by replacing the picocolors dependency with Node.js's built-in styleText utility from the node:util module. This reduces the package dependency footprint while maintaining the same color formatting functionality.

Changes:

  • Created a new internal color utility (packages/core/src/helpers/color.ts) that wraps Node.js's styleText API
  • Updated all imports across the codebase to use the new internal color utility
  • Removed the picocolors dependency from packages/core/package.json
  • Added a defensive null check in CLI commands to prevent potential issues with undefined section titles

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/core/src/helpers/color.ts New internal color utility wrapping Node.js's styleText with the same API as picocolors
packages/core/src/logger.ts Updated import to use internal color utility
packages/core/src/helpers/stats.ts Updated import to use internal color utility
packages/core/src/helpers/index.ts Updated import to use internal color utility
packages/core/src/helpers/format.ts Updated import to use internal color utility
packages/core/src/cli/commands.ts Updated import and added defensive null check for section titles
packages/core/package.json Removed picocolors dependency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 3, 2026 05:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan chenjiahan merged commit b4016c0 into main Feb 3, 2026
11 checks passed
@chenjiahan chenjiahan deleted the style_text_0203 branch February 3, 2026 06:00
@chenjiahan chenjiahan mentioned this pull request Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant