Thank you for your interest in contributing to Rsbuild! Before you start your contribution, please take a moment to read the following guidelines.
Fork this repository to your own GitHub account and then clone it locally.
Use the Node.js version specified in .node-version. For installation instructions, see Install Node.js.
Use the pnpm version specified by packageManager in package.json. Enable pnpm with Corepack and install dependencies:
npm i corepack@latest -g
corepack enable
pnpm installKeep shared dependency versions in the catalogs in pnpm-workspace.yaml.
Create a dedicated branch for your changes:
git checkout -b MY_BRANCH_NAMEBuild the package you want to change:
pnpm --filter core run buildBuild everything:
pnpm run buildRun pnpm build once before running unit or end-to-end tests, including focused runs. The tests depend on built workspace packages.
Add focused tests for bug fixes and features. Prefer end-to-end tests for build and dev server behavior, and unit tests for individual functions. Update all affected snapshots when behavior changes.
Unit tests live in <PACKAGE_DIR>/tests and use Rstest.
Run all unit tests:
pnpm testRun a single package:
pnpm test coreRun end-to-end tests with Rstest as the test runner and Playwright for browser automation:
pnpm run e2eIf you need to run a specified test, you can add keywords to filter:
# Only run test cases which contains `css` keyword in file path
pnpm e2e cssRun the unified Rstack checks to lint with Rslint, type-check TypeScript, and verify formatting:
pnpm run checkTo fix formatting issues:
pnpm run formatInstall the Rslint VS Code extension to see lints while typing.
You can find the Rsbuild documentation in the website folder.
Commit your changes to your forked repo, and create a pull request.
Normally, the commits in a PR will be squashed into one commit, so you don't need to rebase locally.
The format of PR titles follow Conventional Commits.
An example:
feat(core): Add `myOption` config
^ ^ ^
| | |__ Subject
| |_______ Scope
|____________ Type
Repository maintainers can publish a new version of changed packages to npm.
- Use the
release-coreskill for@rsbuild/coreandcreate-rsbuild, orrelease-plugin-packagefor an official plugin, to prepare the version changes and release pull request. - Run the release action to publish packages to npm.
- Merge the release pull request to
main. - Generate the release notes via
create-draft-release-notesskill.