Local development
Thanks for your interest! In this page, you find the instructions to set up tuono
on your local environment!
Setup
Fork and clone repository
After forking the repo on GitHub:
For the next steps, you can either set up the environment directly on your computer or use a ready-to-use Docker image (go to the Docker setup part).
Local setup
Rust tool chain
Install the Rust programming language tool chain (rust
and cargo
).
Follows instructions in the official docs
Node.js — runtime
Install Node.js
.
You can follow the instructions from the Node official site
💡 This project has a
.nvmrc
file to specify the node version used in development.Consider to use nvm so you can run
to simply pick up the correct version!
Node.js — package manager
We use pnpm
as Node.js package manager.
You can see which version of yarn we use by checking the packageManager
field in the root package.json
.
Pre-flight checks
To check that everything is working properly, run:
Docker setup
Introduction
Docker takes care of configuring the development environment, so you don’t need to worry about installing specific versions of packages like Node.js or pnpm. The Docker image handles this for you! Using Docker, the only operations you’ll need to manage on your host machine are related to git. (don't use pnpm, cargo, ... from your host machine) Some IDEs (such as vscode with the Dev Containers extension) allow you to connect directly to the Docker container.
Before proceeding with this guide, make sure that the node_modules
and target
directories are either absent or empty in the subprojects of Tuono from your host machine where you want to contribute.
This ensures a clean and consistent environment when using Docker.
Build the Tuono's Docker Container
First, ensure Docker is installed on your machine by following the instructions on the Docker official site.
Once Docker is installed, use the following command to build the image into a container named tuono-source-container:
To verify that everything is working as expected, run the following command:
Or on Windows:
You should see the image named tuono-source-image and the container tuono-source-container. The container's status should be "up".
Use the following command to connect to the container:
Tuono development
-
Start tuono frontend build using
-
In another terminal run
To automatically rebuild crates on code change, consider using
cargo-watch
crate -
You can now use the binary inside
/target/debug/tuono
in another folder on your local machineConsider adding an alias to your shell setup file
Documentation development
-
Change the current working directory to the documentation folder:
-
Run
-
Open the localhost URL.
On the documentation remember that
tuono
npm
package is installed from the registry and it is not linked to the repository.
Validate your changes
The following checks are all run on pull requests automatically.
You can also perform them locally.
Formatting
For the typescript part you can run:
For the rust codebase run:
Linting
For the typescript part you can run:
For the rust codebase run:
Tests
For the typescript part you can run:
For the rust codebase run: