|
| 1 | +# Contributing to ToolHive Cloud UI |
| 2 | + |
| 3 | +<!-- omit from toc --> |
| 4 | + |
| 5 | +First off, thank you for taking the time to contribute to ToolHive Cloud UI! :+1: :tada: |
| 6 | + |
| 7 | +ToolHive Cloud UI is released under the Apache 2.0 license. If you would like to contribute something or want to hack on the code, this document should help you get started. You can find development guidelines in the [README.md](./README.md). |
| 8 | + |
| 9 | +## Table of contents |
| 10 | + |
| 11 | +<!-- omit from toc --> |
| 12 | + |
| 13 | +- [Code of conduct](#code-of-conduct) |
| 14 | +- [Reporting security vulnerabilities](#reporting-security-vulnerabilities) |
| 15 | +- [How to contribute](#how-to-contribute) |
| 16 | + - [Using GitHub Issues](#using-github-issues) |
| 17 | + - [Not sure how to start contributing?](#not-sure-how-to-start-contributing) |
| 18 | + - [Pull request process](#pull-request-process) |
| 19 | +- [Commit message guidelines](#commit-message-guidelines) |
| 20 | + |
| 21 | +## Code of conduct |
| 22 | + |
| 23 | +This project adheres to the [Contributor Covenant](./CODE_OF_CONDUCT.md) code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [code-of-conduct@stacklok.com](mailto:code-of-conduct@stacklok.com). |
| 24 | + |
| 25 | +## Reporting security vulnerabilities |
| 26 | + |
| 27 | +If you think you have found a security vulnerability in ToolHive Cloud UI please DO NOT disclose it publicly until we've had a chance to fix it. Please don't report security vulnerabilities using GitHub issues; instead, please follow this [process](./SECURITY.md) |
| 28 | + |
| 29 | +## How to contribute |
| 30 | + |
| 31 | +### Using GitHub Issues |
| 32 | + |
| 33 | +We use GitHub issues to track bugs and enhancements. If you have a general usage question, please ask in [ToolHive's discussion forum](https://discord.gg/stacklok). |
| 34 | + |
| 35 | +If you are reporting a bug, please help to speed up problem diagnosis by providing as much information as possible. Ideally, that would include: |
| 36 | + |
| 37 | +- A clear description of the issue |
| 38 | +- Steps to reproduce |
| 39 | +- Expected vs actual behavior |
| 40 | +- Environment details (OS, Node version, browser, etc.) |
| 41 | + |
| 42 | +### Not sure how to start contributing? |
| 43 | + |
| 44 | +PRs to resolve existing issues are greatly appreciated, and issues labeled as ["good first issue"](https://github.com/stacklok/toolhive-cloud-ui/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) are a great place to start! |
| 45 | + |
| 46 | +### Pull request process |
| 47 | + |
| 48 | +- All commits must include a Signed-off-by trailer at the end of each commit message to indicate that the contributor agrees to the Developer Certificate of Origin (DCO). Use `git commit -s` to add this automatically. |
| 49 | + |
| 50 | +- Create an issue outlining the fix or feature. |
| 51 | + |
| 52 | +- Fork the ToolHive Cloud UI repository to your own GitHub account and clone it locally: |
| 53 | + |
| 54 | + ```bash |
| 55 | + git clone https://github.com/YOUR_USERNAME/toolhive-cloud-ui.git |
| 56 | + cd toolhive-cloud-ui |
| 57 | + pnpm install |
| 58 | + ``` |
| 59 | + |
| 60 | +- Hack on your changes. |
| 61 | + |
| 62 | +- Ensure code quality before committing: |
| 63 | + |
| 64 | + ```bash |
| 65 | + pnpm lint # Run linter |
| 66 | + pnpm format # Format code |
| 67 | + pnpm test # Run tests |
| 68 | + pnpm type-check # TypeScript validation |
| 69 | + ``` |
| 70 | + |
| 71 | +- Follow the project guidelines: |
| 72 | + |
| 73 | + - Use Server Components by default, Client Components only when necessary |
| 74 | + - Always use the generated hey-api client for API calls |
| 75 | + - Use `async/await` (never `.then()` promise chains) |
| 76 | + - **Never use `any` type** - use proper types or `unknown` with type guards |
| 77 | + - Use shadcn/ui components (don't create custom UI components) |
| 78 | + - Follow existing patterns in the codebase |
| 79 | + |
| 80 | + See [AGENTS.md](./AGENTS.md) and [CLAUDE.md](./CLAUDE.md) for detailed guidelines. |
| 81 | + |
| 82 | +- Correctly format your commit messages, see [Commit message guidelines](#commit-message-guidelines) below. |
| 83 | + |
| 84 | +- Open a PR with a title that follows the conventional commit format (e.g., `feat: add new feature` or `fix: resolve issue`). The PR title will be validated to ensure it follows the conventional commit specification. Ensure the description reflects the content of the PR. |
| 85 | + |
| 86 | +- Ensure that CI passes, if it fails, fix the failures. |
| 87 | + |
| 88 | +- Every pull request requires a review from the core ToolHive team before merging. |
| 89 | + |
| 90 | +- Once approved, all of your commits will be squashed into a single commit with your PR title. |
| 91 | + |
| 92 | +## Commit message guidelines |
| 93 | + |
| 94 | +We follow the [Conventional Commits](https://www.conventionalcommits.org/) specification for commit messages: |
| 95 | + |
| 96 | +```text |
| 97 | +<type>[optional scope]: <description> |
| 98 | +
|
| 99 | +[optional body] |
| 100 | +
|
| 101 | +[optional footer(s)] |
| 102 | +``` |
| 103 | + |
| 104 | +**Types:** |
| 105 | + |
| 106 | +- `feat`: A new feature |
| 107 | +- `fix`: A bug fix |
| 108 | +- `docs`: Documentation only changes |
| 109 | +- `style`: Changes that do not affect the meaning of the code (white-space, formatting, etc.) |
| 110 | +- `refactor`: A code change that neither fixes a bug nor adds a feature |
| 111 | +- `perf`: A code change that improves performance |
| 112 | +- `test`: Adding missing tests or correcting existing tests |
| 113 | +- `chore`: Changes to the build process or auxiliary tools and libraries |
| 114 | + |
| 115 | +**Examples:** |
| 116 | + |
| 117 | +- `feat: add server URL copy functionality` |
| 118 | +- `fix(ui): resolve button alignment issue in dark mode` |
| 119 | +- `docs: update installation instructions` |
| 120 | +- `test: add unit tests for authentication flow` |
| 121 | +- `chore: update dependencies` |
| 122 | + |
| 123 | +**Signed-off-by:** |
| 124 | + |
| 125 | +All commits must include a Signed-off-by line: |
| 126 | + |
| 127 | +```bash |
| 128 | +git commit -s -m "feat: add new feature" |
| 129 | +``` |
| 130 | + |
| 131 | +This certifies that you agree to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/). |
0 commit comments