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 to your local.
main-> Rsbuild v1.xv0.x-> Rsbuild v0.x
Use the latest Node.js LTS version. For installation instructions, see Install Node.js.
Enable pnpm with corepack:
npm i corepack@latest -g
corepack enableInstall dependencies:
pnpm installWhat this will do:
- Install all dependencies
- Create symlinks between packages in the monorepo
- Run the
preparescript to build all packages, powered by nx.
Please make sure you have your email set up in <https://github.com/settings/emails>. This will be needed later when you want to submit a pull request.
Check that your git client is already configured the email:
git config --list | grep emailSet the email to global config:
git config --global user.email "SOME_EMAIL@example.com"Set the email for local repo:
git config user.email "SOME_EMAIL@example.com"Once you have set up the local development environment in your forked repo, we can start development.
It is recommended to develop on a new branch, as it will make things easier later when you submit a pull request:
git checkout -b MY_BRANCH_NAMEUse nx build to build the package you want to change:
npx nx build @rsbuild/coreBuild all packages:
pnpm run buildIf you've fixed a bug or added code that should be tested, then add some tests.
You can add unit test cases in the <PACKAGE_DIR>/tests folder. The test runner is based on Rstest.
Before submitting a pull request, it's important to make sure that the changes haven't introduced any regressions or bugs. You can run the unit tests for the project by executing the following command:
pnpm testYou can also run the unit tests of single package:
pnpm test coreRsbuild uses playwright to run end-to-end tests.
You can run the e2e command to run E2E tests:
pnpm run e2eIf you need to run a specified test, you can add keywords to filter:
# Only run test cases which contains `vue` keyword in file path with Rspack
pnpm e2e:rspack vue
# Only run test cases which contains `vue` keyword in test name with Rspack
pnpm e2e:rspack -g vueTo help maintain consistency and readability of the codebase, we use Biome to lint the codes.
You can run the linters by executing the following command:
pnpm run lintFor VS Code users, you can install the Biome 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