Skip to content

feat(core): export config definition types - #8036

Merged
chenjiahan merged 1 commit into
mainfrom
chenjiahan/rename-rsbuild-config-definition
Jul 2, 2026
Merged

feat(core): export config definition types#8036
chenjiahan merged 1 commit into
mainfrom
chenjiahan/rename-rsbuild-config-definition

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Summary

This PR renames the config definition union type from RsbuildConfigExport to RsbuildConfigDefinition so the type better describes both config-file exports and values passed to defineConfig. It also exports RsbuildConfigDefinition, RsbuildConfigSyncFn, and RsbuildConfigAsyncFn from the @rsbuild/core entry point.

Copilot AI review requested due to automatic review settings July 2, 2026 02:29
@chenjiahan chenjiahan changed the title refactor(core): rename config definition type feat(core): export config definition types Jul 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 refactors the core config-loading types by renaming the union type used for config “definitions” and exposing the relevant config definition types from the @rsbuild/core public entry point, improving clarity for both config-file exports and defineConfig(...) inputs.

Changes:

  • Rename the config definition union type from RsbuildConfigExport to RsbuildConfigDefinition.
  • Update defineConfig overloads and config loader typing to use RsbuildConfigDefinition.
  • Re-export RsbuildConfigDefinition, RsbuildConfigSyncFn, and RsbuildConfigAsyncFn from @rsbuild/core.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/core/src/loadConfig.ts Renames the config definition union type and updates all local usages (defineConfig + loader typing).
packages/core/src/index.ts Re-exports the config definition-related types from the package entry point.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/core/src/loadConfig.ts
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 79eb7721-a53e-47dd-ac39-37207931d6d3

📥 Commits

Reviewing files that changed from the base of the PR and between 5f7a80d and e0cb928.

📒 Files selected for processing (2)
  • packages/core/src/index.ts
  • packages/core/src/loadConfig.ts

📝 Walkthrough

Walkthrough

This change renames the exported type RsbuildConfigExport to RsbuildConfigDefinition in packages/core/src/loadConfig.ts, updating the defineConfig overloads/implementation, the getConfigExport return type, the native loader wrapper's typed field, a local variable declaration, and the jiti.import generic to use the new type name. The package entry file packages/core/src/index.ts additionally re-exports RsbuildConfigAsyncFn, RsbuildConfigDefinition, and RsbuildConfigSyncFn as part of its public API.

Changes

Area Change
packages/core/src/loadConfig.ts Renamed RsbuildConfigExport to RsbuildConfigDefinition; updated defineConfig signatures, getConfigExport return type, native loader wrapper field type, local variable type, and jiti.import generic
packages/core/src/index.ts Added re-exports for RsbuildConfigAsyncFn, RsbuildConfigDefinition, RsbuildConfigSyncFn

Related PRs: None identified.

Suggested labels: type, refactor

Suggested reviewers: None identified.

Poem
A rabbit renamed a type today,
From Export to Definition, hop-hop-hooray,
Through jiti's import and configs unwrapped,
The public API's now neatly re-mapped,
Small diff, big clarity — carrots for all! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: exporting config definition types.
Description check ✅ Passed The description directly matches the refactor and new exports in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chenjiahan
chenjiahan merged commit 4d4bec6 into main Jul 2, 2026
8 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/rename-rsbuild-config-definition branch July 2, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants