oxc/CONTRIBUTING.md
Angelo Annunziata 53cf1f520e
docs: Update CONTRIBUTING.md (#288)
Makes clear which project submodules will be installed and explicit move step before rustup show command
2023-04-17 10:12:12 +08:00

1.7 KiB

Installation

Clone Repo

git clone --recurse-submodules git@github.com:Boshen/oxc.git

The --recurse-submodules flag will install the following submodules:

  • babel registered for path tasks/coverage/babel
  • test262 registered for path tasks/coverage/test262
  • typescript registered for path tasks/coverage/typescript

New to Rust

Install Rust

# https://rustup.rs/
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# move to the cloned repository
cd oxc
# rust toolchain
rustup show

rustup show reads the ./rust-toolchain.toml file and installs the correct Rust toolchain and components for this project.

Cargo Tools

Additional Rust tools can be installed by cargo install. They are stored under ~/.cargo/bin.

cargo binstall provides a low-complexity mechanism for installing rust binaries as an alternative to building from source via the slower cargo install.

You can download the pre-compiled binary or install via cargo install cargo-binstall

Required tools

cargo binstall just -y
  • just is a handy way to save and run project-specific commands

To initialize all the required tools, run

just init

This installs:

  • cargo nextest, a faster test runner compared to cargo test
  • cargo watch, for watching and running commands
  • cargo insta, for snapshot testing

Commands

Run just for the list of available commands.