-
-
Notifications
You must be signed in to change notification settings - Fork 746
fix: correct stats.color type to include fine-grained options
#11797
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
Conversation
✅ Deploy Preview for rspack canceled.
|
There was a problem hiding this 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 fixes the TypeScript type definition for stats.color to allow both boolean and object configurations, aligning the type with the actual implementation that supports custom color options.
- Added
StatsColorOptionsinterface defining available color customization properties (bold, cyan, green, magenta, red, yellow) - Updated
StatsOptions.colorstype frombooleantoboolean | StatsColorOptions - Enhanced type safety in color handling code by properly typing the
AVAILABLE_COLORSobject and color iteration
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/rspack/src/config/types.ts | Added StatsColorOptions interface and updated colors property type |
| packages/rspack/src/stats/DefaultStatsPrinterPlugin.ts | Improved type safety for color handling with proper typing |
| packages/rspack/src/config/adapter.ts | Updated color value handling to use Boolean conversion |
| packages/rspack/etc/core.api.md | Updated public API documentation to reflect type changes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
📦 Binary Size-limit
❌ Size increased by 8.50KB from 47.89MB to 47.90MB (⬆️0.02%) |
CodSpeed Performance ReportMerging #11797 will not alter performanceComparing 🎉 Hooray!
|
stats.color typestats.color type to include fine-grained options
Summary
The object format of
stats.colorhas been implemented, but the type declaration is missing.This PR updates the type of
stats.colorto align with the actual implementation.Related links
See: https://github.com/webpack/webpack/blob/main/types.d.ts#L17033-L17063
Checklist