feat(plugin-stylus): compatible with Rsbuild v1#7056
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary of ChangesHello @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 introduces backward compatibility for Rsbuild v1 within the Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
The pull request successfully adds compatibility for Rsbuild v1 in the @rsbuild/plugin-stylus by introducing version-aware logic for rule IDs and updating dependencies. The changes are well-implemented and include appropriate test cases and documentation updates. The approach of using a getRule helper function to abstract version-specific rule retrieval is robust and maintains code clarity.
Deploying rsbuild with
|
| Latest commit: |
b935357
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fba4fa9b.rsbuild-v2.pages.dev |
| Branch Preview URL: | https://plugin-stylus-0126.rsbuild-v2.pages.dev |
There was a problem hiding this comment.
Pull request overview
Adds Rsbuild v1 compatibility to @rsbuild/plugin-stylus by detecting the running Rsbuild major version and mapping bundler-chain rule IDs so Stylus handling works across v1 and v2.
Changes:
- Update
plugin-stylusbundler-chain rule wiring to support Rsbuild v1/v2 ID differences. - Add Rsbuild v1 test coverage via an aliased
@rsbuild/core-v1devDependency and new snapshots. - Update CHAIN_ID docs (EN/ZH) and adjust core CHAIN_ID definitions accordingly.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/zh/config/tools/bundler-chain.mdx | Updates documented CHAIN_ID.ONE_OF entries (notably removing Stylus oneOf IDs). |
| website/docs/en/config/tools/bundler-chain.mdx | Same as ZH doc update for CHAIN_ID.ONE_OF. |
| pnpm-lock.yaml | Adds lock entries for the aliased @rsbuild/core-v1 dependency. |
| packages/plugin-stylus/tests/index.test.ts | Adds a new test that runs the plugin against Rsbuild v1. |
| packages/plugin-stylus/tests/snapshots/index.test.ts.snap | Updates snapshots and adds a new snapshot for Rsbuild v1 behavior. |
| packages/plugin-stylus/src/index.ts | Implements v1/v2 detection and rule-ID mapping for Stylus rules/branches. |
| packages/plugin-stylus/package.json | Adds @rsbuild/core-v1 devDependency and bumps @rsbuild/core peer range. |
| packages/core/src/configChain.ts | Removes Stylus-specific CHAIN_ID.ONE_OF identifiers from core constants. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Added support for Rsbuild v1 in
@rsbuild/plugin-stylusby detecting the version and mapping rule IDs accordingly, ensuring that Stylus processing works seamlessly across Rsbuild v1 and v2.Related Links
Checklist