-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
112 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Contributing | ||
|
||
First of all, thanks for taking time to contribute to Cup! This guide will help you set up a development environment and make your first contribution. | ||
|
||
## Setting up a development environment | ||
|
||
Requirements: | ||
- A computer running Linux | ||
- Rust (usually installed from https://rustup.rs/) | ||
- Node.js 22+ and Bun 1+ | ||
|
||
1. Fork the repository. This is where you'll be pushing your changes before you create a pull request. Make sure to _create a new branch_ for your changes. | ||
2. Clone your fork with `git clone https://github.com/<YOUR_USERNAME>/cup` (if you use SSH, `git clone [email protected]:<YOUR_USERNAME>/cup`) and open your editor | ||
3. Switch to your newly created branch (e.g. if your branch is called `improve-logging`, run `git checkout improve-logging`) | ||
4. Run `bun install` in `web/` and `./build.sh` to set up the frontend | ||
|
||
You're ready to go! | ||
|
||
## Project architecture | ||
|
||
Cup can be run in 2 modes: CLI and server. | ||
|
||
All CLI specific functionality is located in `src/formatting.rs` and some other files in functions prefixed with `#[cfg(feature = "cli")]`. | ||
|
||
All server specific functionality is located in `src/server.rs` and `web/`. | ||
|
||
## Important notes | ||
|
||
- When making any changes, always make sure to write optimize your code for: | ||
+ Performance: You should always benchmark Cup before making changes and after your changes to make sure there is none (or a very small) difference in time. Profiling old and new code is also good. | ||
+ Readability: Include comments describing any new functions you create, give descriptive names to variables and when making a design decision or a compromise, ALWAYS include a comment explaining what you did and why. | ||
|
||
- If you plan on developing the frontend without making backend changes, it is highly recommended to run `cup serve` in the background and start the frontend in development mode from `web/` with `bun dev`. | ||
|
||
- If you make changes to the frontend, always remember to prefix your build command with the `build.sh` script which takes care of rebuilding the frontend. For example: `./build.sh cargo build -r` | ||
|
||
- When adding new features to Cup (e.g. configuration options), make sure to update the documentation (located in `docs/`). Refer to other pages in the documentation, or to the [official docs](https://nextra.site) for any questions you may have. The docs use `pnpm` as their package manager. | ||
|
||
- If you need help with finishing something (e.g. you've made some commits and need help with writing docs, you want some feedback about a design decision, etc.), you can open a draft PR and ask for help there. | ||
|
||
## Submitting a PR | ||
|
||
To have your changes included in Cup, you will need to create a pull request. | ||
|
||
Before doing so, please make sure you have run `cargo clippy` and resolved all warnings related to your changes and have formatted your code with `cargo fmt`. This ensures Cup's codebase is consistent and uses good practices for code. | ||
|
||
After you're done with that, commit your changes and push them to your branch. | ||
|
||
Next, open your fork on Github and create a pull request. Make sure to include the changes you made, which issues it addresses (if any) and any other info you think is important. | ||
|
||
Happy contributing! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
nodejs 21.6.2 | ||
nodejs 22.8.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,6 @@ | |
"autoprefixer": "^10.4.19", | ||
"postcss": "^8.4.39", | ||
"tailwindcss": "^3.4.5" | ||
} | ||
} | ||
}, | ||
"packageManager": "[email protected]+sha512.73a29afa36a0d092ece5271de5177ecbf8318d454ecd701343131b8ebc0c1a91c487da46ab77c8e596d6acf1461e3594ced4becedf8921b074fbd8653ed7051c" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,8 @@ | |
}, | ||
"nightly": { | ||
"title": "Using the latest version" | ||
}, | ||
"contributing": { | ||
"title": "Contributing" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Contributing | ||
|
||
First of all, thanks for taking time to contribute to Cup! This guide will help you set up a development environment and make your first contribution. | ||
|
||
## Setting up a development environment | ||
|
||
Requirements: | ||
- A computer running Linux | ||
- Rust (usually installed from https://rustup.rs/) | ||
- Node.js 22+ and Bun 1+ | ||
|
||
1. Fork the repository. This is where you'll be pushing your changes before you create a pull request. Make sure to _create a new branch_ for your changes. | ||
2. Clone your fork with `git clone https://github.com/<YOUR_USERNAME>/cup` (if you use SSH, `git clone [email protected]:<YOUR_USERNAME>/cup`) and open your editor | ||
3. Switch to your newly created branch (e.g. if your branch is called `improve-logging`, run `git checkout improve-logging`) | ||
4. Run `bun install` in `web/` and `./build.sh` to set up the frontend | ||
|
||
You're ready to go! | ||
|
||
## Project architecture | ||
|
||
Cup can be run in 2 modes: CLI and server. | ||
|
||
All CLI specific functionality is located in `src/formatting.rs` and some other files in functions prefixed with `#[cfg(feature = "cli")]`. | ||
|
||
All server specific functionality is located in `src/server.rs` and `web/`. | ||
|
||
## Important notes | ||
|
||
- When making any changes, always make sure to write optimize your code for: | ||
+ Performance: You should always benchmark Cup before making changes and after your changes to make sure there is none (or a very small) difference in time. Profiling old and new code is also good. | ||
+ Readability: Include comments describing any new functions you create, give descriptive names to variables and when making a design decision or a compromise, ALWAYS include a comment explaining what you did and why. | ||
|
||
- If you plan on developing the frontend without making backend changes, it is highly recommended to run `cup serve` in the background and start the frontend in development mode from `web/` with `bun dev`. | ||
|
||
- If you make changes to the frontend, always remember to prefix your build command with the `build.sh` script which takes care of rebuilding the frontend. For example: `./build.sh cargo build -r` | ||
|
||
- When adding new features to Cup (e.g. configuration options), make sure to update the documentation (located in `docs/`). Refer to other pages in the documentation, or to the [official docs](https://nextra.site) for any questions you may have. The docs use `pnpm` as their package manager. | ||
|
||
- If you need help with finishing something (e.g. you've made some commits and need help with writing docs, you want some feedback about a design decision, etc.), you can open a draft PR and ask for help there. | ||
|
||
## Submitting a PR | ||
|
||
To have your changes included in Cup, you will need to create a pull request. | ||
|
||
Before doing so, please make sure you have run `cargo clippy` and resolved all warnings related to your changes and have formatted your code with `cargo fmt`. This ensures Cup's codebase is consistent and uses good practices for code. | ||
|
||
After you're done with that, commit your changes and push them to your branch. | ||
|
||
Next, open your fork on Github and create a pull request. Make sure to include the changes you made, which issues it addresses (if any) and any other info you think is important. | ||
|
||
Happy contributing! |