From d7c70f75f3b209740e04c6b8dc79442980eb332a Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti <24919330+marcalexiei@users.noreply.github.com> Date: Sat, 23 Nov 2024 21:04:01 +0100 Subject: [PATCH] =?UTF-8?q?docs(CONTRIBUTING):=20add=20=E2=80=9CLocal=20de?= =?UTF-8?q?velopment=E2=80=9D=20(#136)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/sidebar/sidebar.tsx | 11 +- .../documentation/contributing/index.mdx | 57 +++++++++ .../contributing/local-development.mdx | 113 ++++++++++++++++++ 3 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 apps/documentation/src/routes/documentation/contributing/index.mdx create mode 100644 apps/documentation/src/routes/documentation/contributing/local-development.mdx diff --git a/apps/documentation/src/components/sidebar/sidebar.tsx b/apps/documentation/src/components/sidebar/sidebar.tsx index cc966ed4..9d6f0a66 100644 --- a/apps/documentation/src/components/sidebar/sidebar.tsx +++ b/apps/documentation/src/components/sidebar/sidebar.tsx @@ -90,12 +90,19 @@ export default function Sidebar({ close }: SidebarProps): JSX.Element { onClick={close} /> + + onClick={close} + > + + ) } diff --git a/apps/documentation/src/routes/documentation/contributing/index.mdx b/apps/documentation/src/routes/documentation/contributing/index.mdx new file mode 100644 index 00000000..8baf51b8 --- /dev/null +++ b/apps/documentation/src/routes/documentation/contributing/index.mdx @@ -0,0 +1,57 @@ +import MetaTags from '../../../components/meta-tags' + + + +import Breadcrumbs, { Element } from '../../../components/breadcrumbs' + + + +# Contributing + +## TL;DR + +The project is massive - if you like it, do consider contributing! + +## Getting started + +The `tuono` project can mostly be split into the following subdomains: + +- The CLI +- The Rust backend +- The React frontend +- The documentation website (which is written with tuono 🚀) + +To check what the knowledge requirements are for each domain, check the +[requirements](#requirements) section below. + +Currently, I'm keeping a private dashboard to prioritize new features and bug fixes, but if you +want to propose something, please open a new issue on GitHub or reach out to me using +my email address [valerioageno@yahoo.it](mailto:valerioageno@yahoo.it). I'm also available +on Twitter (X) DMs `@valerioageno`, [Linkedin](https://www.linkedin.com/in/valerioageno) +and discord `@__v__v__`. + +## Requirements + +It's not strictly required to know both React (& typescript) and Rust (even though it +would be a great nice to have). + +Without taking into account specific cases, we can mostly split the domain requirements by: + +- The `CLI` needs Rust knowledge (even though a couple of scenarios might also need Typescript) +- The Backend needs just `Rust` +- The Frontend needs just `React` & `Typescript` +- The documentation website needs just `React` & `Typescript` (or even less, since most of the + code is markdown). + +import NavigationButtons from '../../../components/navigation-buttons' + + diff --git a/apps/documentation/src/routes/documentation/contributing/local-development.mdx b/apps/documentation/src/routes/documentation/contributing/local-development.mdx new file mode 100644 index 00000000..4e9717a3 --- /dev/null +++ b/apps/documentation/src/routes/documentation/contributing/local-development.mdx @@ -0,0 +1,113 @@ +import MetaTags from '../../../components/meta-tags' + + + +import Breadcrumbs, { Element } from '../../../components/breadcrumbs' + + + +# 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](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo): + +```sh +git clone https://github.com//tuono +cd tuono +``` + +### Rust tool chain + +Install the Rust programming language tool chain (`rust` and `cargo`). +Follows instructions in the official [docs](https://rustup.rs/) + +### Node.js — runtime + +Install `Node.js`. +You can follow the instructions from the [Node official site](https://nodejs.org/en/download/package-manager) + +> 💡 This project has a `.nvmrc` file to specify the node version used in development. +> +> Consider to use [nvm](https://github.com/nvm-sh/nvm) so you can run +> +> ```sh +> nvm use +> ``` +> +> to simply pick up the correct version! + +### Node.js — package manager + +We use [`pnpm`](https://pnpm.io) 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: + +```sh +turbo run check-all +cargo build +``` + +## Tuono development + +1. Start tuono frontend build using + + ```sh + turbo run dev + ``` + +2. In another terminal run + + ```sh + cargo build + ``` + + To automatically rebuild crates on code change, consider using `cargo-watch` crate + + ```sh + cargo watch -x build -w crates/ + ``` + +3. You can now use the binary inside `/target/debug/tuono` in another folder on your local machine + + > Consider adding an alias to your shell setup file + > + > ```sh + > alias t="/path-to-repo/target/debug/tuono" + > ``` + +## Documentation development + +1. Change the current working directory to the documentation folder: + + ```sh + cd apps/documentation + ``` + +2. Run + + ```sh + tuono dev + ``` + +3. 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.