Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

The object format of stats.color has been implemented, but the type declaration is missing.

This PR updates the type of stats.color to align with the actual implementation.

Related links

See: https://github.com/webpack/webpack/blob/main/types.d.ts#L17033-L17063

Checklist

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

Copilot AI review requested due to automatic review settings September 30, 2025 03:47
@netlify
Copy link

netlify bot commented Sep 30, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 11ef327
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68db604cbe9e1b0007548f12

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 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 StatsColorOptions interface defining available color customization properties (bold, cyan, green, magenta, red, yellow)
  • Updated StatsOptions.colors type from boolean to boolean | StatsColorOptions
  • Enhanced type safety in color handling code by properly typing the AVAILABLE_COLORS object 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.

@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Sep 30, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 30, 2025

📦 Binary Size-limit

Comparing 11ef327 to chore(deps): update swc (#11747) by renovate[bot]

❌ Size increased by 8.50KB from 47.89MB to 47.90MB (⬆️0.02%)

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 30, 2025

CodSpeed Performance Report

Merging #11797 will not alter performance

Comparing stats_color_type_0930 (11ef327) with main (637a26d)

🎉 Hooray! codspeed-rust just leveled up to 2.7.2!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 17 untouched

@chenjiahan chenjiahan changed the title fix: correct stats.color type fix: correct stats.color type to include fine-grained options Sep 30, 2025
@chenjiahan chenjiahan merged commit 7b4ecd8 into main Sep 30, 2025
46 checks passed
@chenjiahan chenjiahan deleted the stats_color_type_0930 branch September 30, 2025 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants