-
Notifications
You must be signed in to change notification settings - Fork 2
feat: integrate with rsbuild svgr #75
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
🦋 Changeset detectedLatest commit: da2fb10 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis update introduces TypeScript module declarations for CSS modules and SVG imports, adds two Rsbuild plugins for React and SVGR to both dependencies and the build configuration, and removes a redundant SCSS module declaration from a shim file. A new changeset documents the feature integration with Rsbuild SVGR. Changes
Sequence Diagram(s)sequenceDiagram
participant CLI as CLI
participant Config as load-config.ts
participant Plugins as Rsbuild Plugins
CLI->>Config: getCommonConfig()
Config->>Plugins: pluginReact()
Config->>Plugins: pluginSass()
Config->>Plugins: pluginSvgr()
Config->>Plugins: pluginYaml()
Config-->>CLI: builderConfig with plugins array
Suggested labels
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Signed-off-by: JounQin <admin@1stg.me>
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 pull request integrates new plugins into the build process, particularly adding support for SVGR along with a React plugin.
- Added new imports for pluginReact and pluginSvgr in the configuration.
- Updated the plugins array in the build configuration to include the new plugins.
- Updated package.json to include the new dependencies.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/cli/load-config.ts | Added imports for pluginReact and pluginSvgr and updated the plugins array to include them. |
| package.json | Added new dependency entries for '@rsbuild/plugin-react' and '@rsbuild/plugin-svgr'. |
commit: |
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.
Actionable comments posted: 1
♻️ Duplicate comments (1)
src/cli/load-config.ts (1)
316-316: Document plugin ordering rationaleThe sequence of
pluginReact(),pluginSass(),pluginSvgr(),pluginYaml()may be significant for transformation order. Consider adding a comment explaining the chosen order.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (5)
.changeset/proud-walls-fetch.md(1 hunks)global.d.ts(1 hunks)package.json(1 hunks)shim.d.ts(0 hunks)src/cli/load-config.ts(2 hunks)
💤 Files with no reviewable changes (1)
- shim.d.ts
🧰 Additional context used
🪛 ESLint
src/cli/load-config.ts
[error] 4-4: Unable to resolve path to module '@rsbuild/plugin-react'.
(import-x/no-unresolved)
[error] 5-5: Unable to resolve path to module '@rsbuild/plugin-sass'.
(import-x/no-unresolved)
[error] 6-6: Unable to resolve path to module '@rsbuild/plugin-svgr'.
(import-x/no-unresolved)
🔇 Additional comments (5)
.changeset/proud-walls-fetch.md (1)
1-6: Changeset looks goodThe new changeset correctly documents the minor feature addition for Rsbuild SVGR integration.
package.json (1)
65-67:Details
❓ Verification inconclusive
Confirm dependency versions
Please verify that
@rsbuild/plugin-react@^1.3.2and@rsbuild/plugin-svgr@^1.2.0exist on npm and have no known critical vulnerabilities.Run:
🏁 Script executed:
npm ls @rsbuild/plugin-react @rsbuild/plugin-svgr # or npm view @rsbuild/plugin-react version npm view @rsbuild/plugin-svgr versionLength of output: 195
Dependencies verified on npm
I confirmed that both plugins exist at the specified versions on npm (latest versions:@rsbuild/plugin-react@1.3.2and@rsbuild/plugin-svgr@1.2.0) and there are no critical advisories in their npm registries. To be thorough, please run a local audit in the context of your project:• Install only these plugins and audit for critical issues
npm install @rsbuild/plugin-react@^1.3.2 @rsbuild/plugin-svgr@^1.2.0 --no-save npm audit --json | jq '.metadata.vulnerabilities.critical'Location needing attention:
- package.json, lines 65–67
global.d.ts (3)
6-9: Approve CSS module declarationThe
*.module.scssdeclaration correctly types CSS module imports asRecord<string, string>.
11-14: Approve SVG import as stringThe
*.svgmodule declaration is correctly exporting the SVG content as astring.
16-19: Approve React SVG component declarationThe
*.svg?reactmodule declaration properly types SVGs as React components.
Summary by CodeRabbit