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 Node.js LTS or newer. For installation instructions, see Install Node.js.
Enable pnpm with Corepack and install dependencies:
npm i corepack@latest -g
corepack enable
pnpm installThis installs dependencies, links packages inside the monorepo, and runs the Nx-powered prepare script.
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 buildAdd tests for every bug fix or feature. 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 powered by Playwright:
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 Rslint to keep code style consistent:
pnpm run lintInstall 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.
- Checkout a new release branch, for example
release_v1.2.0 - Run
pnpm bumpin the package directory to update the version of each package. - Create a pull request, the title should be
release: v1.2.0. - Run the release action to publish packages to npm.
- Merge the release pull request to
main. - Generate the release notes via GitHub, see Automatically generated release notes