Skip to content

Commit

Permalink
Docs changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sergi0g committed Sep 17, 2024
1 parent 5bf7269 commit 6b15d8d
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 4 deletions.
51 changes: 51 additions & 0 deletions CONTRIBUTING.md
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!
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Cup is the easiest way to check for container image updates.

![Demo](screenshots/cup.gif)

_If you like this project and/or use Cup, please consider starring the project ⭐. It motivates me to continue working on it and imrpoving it. Plus, you get updates for new releases!_

## Screenshots

![Cup web in light mode](screenshots/web_light.png)
Expand Down Expand Up @@ -44,7 +46,7 @@ Here are some ideas to get you started:
- Help optimize Cup and make it even better!
- Add more features to the web UI

To contribute, fork the repository, make your changes and the submit a pull request.
For more information, check the [docs](https://sergi0g.github.io/cup/docs/contributing)!

## Support

Expand Down
2 changes: 1 addition & 1 deletion docs/.tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 21.6.2
nodejs 22.8.0
5 changes: 3 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"autoprefixer": "^10.4.19",
"postcss": "^8.4.39",
"tailwindcss": "^3.4.5"
}
}
},
"packageManager": "[email protected]+sha512.73a29afa36a0d092ece5271de5177ecbf8318d454ecd701343131b8ebc0c1a91c487da46ab77c8e596d6acf1461e3594ced4becedf8921b074fbd8653ed7051c"
}
3 changes: 3 additions & 0 deletions docs/pages/docs/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
},
"nightly": {
"title": "Using the latest version"
},
"contributing": {
"title": "Contributing"
}
}
51 changes: 51 additions & 0 deletions docs/pages/docs/contributing.mdx
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!

0 comments on commit 6b15d8d

Please sign in to comment.