refactor(helpers): avoid importing helpers via barrel files - #6309
Merged
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the helper functions organization by moving them from barrel file exports into dedicated modules (fs, path, stats, vendors) to avoid circular dependency issues when using Rstest.
- Reorganized helper functions into dedicated modules instead of a single barrel export
- Updated import statements across files to import from specific helper modules
- Removed wildcard exports from the main helpers index file
Reviewed Changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/helpers/index.ts | Removed barrel exports and kept only core exports |
| packages/core/src/server/watchFiles.ts | Updated imports to use specific helper modules |
| packages/core/src/server/socketServer.ts | Changed import to use vendors helper module |
| packages/core/src/server/proxy.ts | Updated requireCompiledPackage import path |
| packages/core/src/server/prodServer.ts | Split imports between path and vendors helpers |
| packages/core/src/server/overlay.ts | Updated toRelativePath import to path helper |
| packages/core/src/server/middlewares.ts | Split imports between main helpers and stats |
| packages/core/src/server/helper.ts | Updated getCommonParentPath import to path helper |
| packages/core/src/server/devServer.ts | Separated vendor helper imports |
| packages/core/src/server/devMiddlewares.ts | Updated requireCompiledPackage import path |
| packages/core/src/server/browserLogs.ts | Split imports between main helpers and vendors |
| packages/core/src/server/assets-middleware/setupOutputFileSystem.ts | Updated requireCompiledPackage import path |
| packages/core/src/server/assets-middleware/middleware.ts | Updated requireCompiledPackage import path |
| packages/core/src/provider/initConfigs.ts | Split imports between main helpers and path |
| packages/core/src/provider/helpers.ts | Updated stats helper exports |
| packages/core/src/provider/createCompiler.ts | Separated stats helper imports |
| packages/core/src/plugins/server.ts | Updated dedupeNestedPaths import to path helper |
| packages/core/src/plugins/manifest.ts | Updated requireCompiledPackage import path |
| packages/core/src/plugins/html.ts | Updated isFileExists import to fs helper |
| packages/core/src/plugins/fileSize.ts | Split imports between main helpers and stats |
| packages/core/src/plugins/cleanOutput.ts | Updated emptyDir import to fs helper |
| packages/core/src/plugins/cache.ts | Split imports between main helpers and fs |
| packages/core/src/plugins/bundleAnalyzer.ts | Updated requireCompiledPackage import path |
| packages/core/src/plugins/appIcon.ts | Split imports between main helpers, fs, and vendors |
| packages/core/src/pluginHelper.ts | Updated requireCompiledPackage import path |
| packages/core/src/loader/transformLoader.ts | Updated requireCompiledPackage import path |
| packages/core/src/loadEnv.ts | Split imports between main helpers and fs |
| packages/core/src/defaultConfig.ts | Split imports between main helpers and fs |
| packages/core/src/createRsbuild.ts | Updated isEmptyDir import to fs helper |
| packages/core/src/cli/init.ts | Split imports between main helpers and path |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Move helper functions into dedicated modules (fs, path, stats, vendors) to avoid importing helpers via barrel files.
This helps avoid occasional circular dependency issues when using Rstest.
Checklist