Thanks for your interest in contributing to Turbo!
- Contributing to Turbo
- LLD (LLVM Linker), as it's not installed by default on many Linux distributions (e.g.
apt install lld).
Dependencies
-
Install turborepo crate build requirements
-
Run
pnpm installat root
Building
- Building
turboCLI:cargo build -p turbo - Using
turboto buildturboCLI:./turbow.js
Turborepo uses reqwest, a Rust HTTP client, to make requests to the Turbo API. reqwest supports two TLS
implementations: rustls and native-tls. rustls is a pure Rust implementation of TLS, while native-tls
is a wrapper around OpenSSL. Turborepo allows users to select which implementation they want with the native-tls
and rustls-tls features. By default, the rustls-tls feature is selected---this is done so that cargo build works
out of the box. If you wish to select native-tls, you may do so by passing --no-default-features --features native-tls
to the build command.
Install dependencies
On macOS:
brew install jq zstdFirst: npm install -g turbo.
Then from the root directory, you can run:
-
Go unit tests
pnpm test -- --filter=cli -
A single Go unit test (see more in the Go docs)
cd cli && go test ./[path/to/package/]
-
Rust unit tests (install
nextestfirst)cargo nextest run -p turborepo-lib --features rustls-tls
You can also use the built in
cargo testdirectly withcargo test -p turborepo-lib. -
CLI Integration tests
pnpm test -- --filter=turborepo-tests-integration -
A single Integration test e.g to run everything in
tests/run-summary:# build first because the next command doesn't run through turbo pnpm -- turbo run build --filter=cli pnpm test -F turborepo-tests-integration -- "run-summary"Note: this is not through turbo, so you'll have to build turbo yourself first.
-
Example tests
pnpm test -- --filter=turborepo-tests-examples -- <example-name> <packagemanager>
- Install
go install github.com/go-delve/delve/cmd/dlv@latest - In VS Code's "Run and Debug" tab, select
Build Basicto start debugging the initial launch ofturboagainst thebuildtarget of the Basic Example. This task is configured in launch.json.
Follow the instructions in the benchmark/README.md.
You might need to update packages/turbo in order to support a new platform. When you do that you will need to link the module in order to be able to continue working. As an example, with npm link:
cd ~/repos/vercel/turbo/packages/turbo
npm link
# Run your build, e.g. `go build ./cmd/turbo` if you're on the platform you're adding.
cd ~/repos/vercel/turbo/cli
go build ./cmd/turbo
# You can then run the basic example specifying the build asset path.
cd ~/repos/vercel/turbo/examples/basic
TURBO_BINARY_PATH=~/repos/vercel/turbo/cli/turbo.exe npm install
TURBO_BINARY_PATH=~/repos/vercel/turbo/cli/turbo.exe npm link turboIf you're using a different package manager replace npm accordingly.
Before releasing, it's recommended to test the turbo binary manually.
Here's a checklist of testing strategies to cover:
- Test
login,logout,login --sso-team,link,unlink - Test
prune(Noteturbohere is the unreleased turbo binary)pnpm dlx create-turbo@latest prune-test --package-manager pnpm && cd prune-testturbo --skip-infer prune docs && cd out && pnpm install --frozen-lockfileturbo --skip-infer build
- Test
--dry-runand--graph. - Test with and without daemon.
There are also multiple installation scenarios worth testing:
- Global-only.
turbois installed as global binary, no localturboin repository. - Local-only.
turbois installed as local binary, no globalturboin PATH. turbo` is invoked via a root package script. - Global + local.
turbois installed as global binary, and localturboin repository. Globalturbodelegates to localturbo
Here are a few repositories that you can test on:
These lists are by no means exhaustive. Feel free to add to them with other strategies.
See the publishing guide.
Creating a new release post can be done via a turborepo generator. Run the following command from anywhere within the repo:
turbo generate run "blog - release post"This will walk you through creating a new blog post from start to finish.
NOTE: If you would like to update the stats (github stars / npm downloads / time saved) for an existing blog post that has yet to be published (useful if time has passed since the blog post was created, and up to date stats are required before publishing) - run:
turbo generate run "blog - "blog - update release post stats"and choose the blog post you would like to update.
See Troubleshooting.