Skip to content

Latest commit

 

History

History
78 lines (52 loc) · 2.29 KB

File metadata and controls

78 lines (52 loc) · 2.29 KB

Contributing to the Project

Thanks A lof for your interest in contributing to this project! We welcome contributions from everyone. Below are some guidelines to help you get started.

Rspack-Resolver is built using Rust and NAPI-RS, then released as both npm package and Rust crate.

Prerequisites

Rspack is built using Rust and NAPI-RS, then released as Node.js packages.

Setup Rust

  • Install Rust using rustup.
  • If you are using VS Code, we recommend installing the rust-analyzer extension.

Setup Node.js

Install Node.js

We recommend using the LTS version of Node.js 22.

Check the current Node.js version with the following command:

node -v

If you do not have Node.js installed in your current environment, you can use nvm or fnm to install it.

Here is an example of how to install via nvm:

# Install Node.js LTS
nvm install 22 --lts

# Switch to Node.js LTS
nvm use 22

Building and Testing

# Build @rspack/resolver's node release binding.
npm run build
# or
npm run build:release

You can switch to profiling and debug profile by npm run build:profiling and npm run build:debug respectively.

# Run all Rust tests
cargo test
# Run all Node.js tests
npm run test

Releasing

Publish Crate

  1. create a release branch as release/x.y.z
  2. Bump version in Cargo.toml
  3. Commit and push the release branch
  4. Run the release-plz.yml workflow in GitHub Actions to publish the crate to crates.io.

Publish NPM Package

In most cases, We publish @rspack/resolver npm package after rspack-resolver crate.

  1. Bump version by ./x version <major|minor|patch> in the root directory
  2. Commit and push the release branch
  3. Run the release-npm.yml workflow in GitHub Actions to publish the package to npm.