docs: update contributing guide and sidebar links

This commit is contained in:
Bereket Engida
2025-03-13 09:15:06 +03:00
parent e8cbf41ce3
commit c72941299f
2 changed files with 114 additions and 101 deletions

View File

@@ -1604,46 +1604,6 @@ C0.7,239.6,62.1,0.5,62.2,0.4c0,0,54,13.8,119.9,30.8S302.1,62,302.2,62c0.2,0,0.2,
</svg> </svg>
), ),
list: [ list: [
{
title: "Contribute",
href: "/docs/reference/contribution",
icon: () => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
>
<g fill="none" stroke="currentColor" strokeWidth="2">
<circle
cx="6"
cy="6"
r="3"
fill="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
/>
<circle
cx="18"
cy="6"
r="3"
fill="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
/>
<circle
cx="12"
cy="18"
r="3"
fill="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path d="M6 9v1a2 2 0 0 0 2 2h4m6-3v1a2 2 0 0 1-2 2h-4m0 0v3" />
</g>
</svg>
),
},
{ {
title: "Options", title: "Options",
href: "/docs/reference/options", href: "/docs/reference/options",
@@ -1661,6 +1621,23 @@ C0.7,239.6,62.1,0.5,62.2,0.4c0,0,54,13.8,119.9,30.8S302.1,62,302.2,62c0.2,0,0.2,
</svg> </svg>
), ),
}, },
{
title: "Contributing",
href: "/docs/reference/contributing",
icon: () => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1.2em"
height="1.2em"
viewBox="0 0 24 24"
>
<path
fill="#888888"
d="M6 3a3 3 0 0 1 3 3c0 1.31-.83 2.42-2 2.83v6.34c1.17.41 2 1.52 2 2.83a3 3 0 0 1-3 3a3 3 0 0 1-3-3c0-1.31.83-2.42 2-2.83V8.83A2.99 2.99 0 0 1 3 6a3 3 0 0 1 3-3m0 2a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1a1 1 0 0 0-1-1m0 12a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1a1 1 0 0 0-1-1m15 1a3 3 0 0 1-3 3a3 3 0 0 1-3-3c0-1.31.83-2.42 2-2.83V7h-2v3.25L10.75 6L15 1.75V5h2a2 2 0 0 1 2 2v8.17c1.17.41 2 1.52 2 2.83m-3-1a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1a1 1 0 0 0-1-1"
></path>
</svg>
),
},
{ {
title: "Security", title: "Security",
href: "/docs/reference/security", href: "/docs/reference/security",

View File

@@ -3,49 +3,115 @@ title: Contributing to BetterAuth
description: A concise guide to contributing to BetterAuth description: A concise guide to contributing to BetterAuth
--- ---
# Contributing to BetterAuth Thank you for your interest in contributing to Better Auth! This guide is a concise guide to contributing to Better Auth.
Thank you for your interest in contributing to Better Auth! This guide will help you get started. ## Getting Started
## Quick Start Before diving in, here are a few important resources:
- Take a look at our existing <Link href="https://github.com/better-auth/better-auth/issues">issues</Link> and <Link href="https://github.com/better-auth/better-auth/pulls">pull requests</Link>
- Join our community discussions in <Link href="https://discord.gg/GYC3W7tZzb">Discord</Link>
## Development Setup
To get started with development:
<Callout type="warn">
Make sure you have <Link href="https://nodejs.org/en/download">Node.JS</Link>{" "}
installed, preferably on LTS.
</Callout>
<Steps> <Steps>
<Step> <Step>
### 1. Fork and clone ### 1. Fork the repository
Fork the [repository](https://github.com/better-auth/better-auth), then clone your fork: Visit https://github.com/better-auth/better-auth
Click the "Fork" button in the top right.
</Step>
<Step>
### 2. Clone your fork
```bash ```bash
# Replace YOUR-USERNAME with your GitHub username
git clone https://github.com/YOUR-USERNAME/better-auth.git git clone https://github.com/YOUR-USERNAME/better-auth.git
cd better-auth cd better-auth
``` ```
</Step> </Step>
<Step> <Step>
### 2. Set up development environment ### 3. Install dependencies
Make sure you have <Link href="https://pnpm.io/installation">pnpm</Link> installed!
```bash ```bash
# Install dependencies
pnpm install pnpm install
```
# Set up environment variables </Step>
<Step>
### 4. Prepare ENV files
Copy the example env file to create your new `.env` file.
```bash
cp -n ./docs/.env.example ./docs/.env cp -n ./docs/.env.example ./docs/.env
```
# Start development server </Step>
</Steps>
## Making changes
Once you have an idea of what you want to contribute, you can start making changes. Here are some steps to get started:
<Steps>
<Step>
### 1. Create a new branch
```bash
# Make sure you're on main
git checkout main
# Pull latest changes
git pull upstream main
# Create and switch to a new branch
git checkout -b feature/your-feature-name
```
</Step>
<Step>
### 2. Start development server
Start the development server:
```bash
pnpm dev pnpm dev
# Or for docs ```
To start the docs server:
```bash
pnpm -F docs dev pnpm -F docs dev
``` ```
</Step> </Step>
<Step> <Step>
### 3. Create a branch and make changes ### 3. Make Your Changes
```bash * Make your changes to the codebase.
git checkout -b feature/your-feature-name
``` * Write tests if needed. (Read more about testing <Link href="/docs/contribute/testing">here</Link>)
* Update documentation. (Read more about documenting <Link href="/docs/contribute/documenting">here</Link>)
</Step> </Step>
</Steps> </Steps>
## Ways to Contribute
### Issues and Bug Fixes ### Issues and Bug Fixes
@@ -92,48 +158,18 @@ describe("Feature", () => {
### Testing Best Practices ### Testing Best Practices
- Write descriptive test names - Write clear commit messages
- Test both success and failure cases - Update documentation to reflect your changes
- Keep tests focused and atomic - Add tests for new features
- Test edge cases and boundary conditions - Follow our coding standards
- Keep pull requests focused on a single change
## Pull Request Process ## Need Help?
<Steps> Don't hesitate to ask for help! You can:
<Step>
### 1. Ensure your code passes tests
```bash
pnpm test
```
</Step>
<Step>
### 2. Push changes and create PR
```bash
git push origin feature/your-feature-name
```
Create a pull request on GitHub with a clear description of your changes.
</Step>
<Step>
### 3. Address feedback
Be responsive to code review feedback and make necessary changes.
</Step>
</Steps>
## Code Style and Standards - Open an <Link href="https://github.com/better-auth/better-auth/issues">issue</Link> with questions
- Join our <Link href="https://discord.gg/GYC3W7tZzb">community discussions</Link>
- Follow the existing code style - Reach out to project maintainers
- Use TypeScript for type safety
- Write clear, descriptive comments
- Keep functions small and focused
## Getting Help
- Join our [Discord community](https://discord.gg/GYC3W7tZzb)
- Comment on relevant GitHub issues
- Check our [documentation](https://better-auth.dev)
Thank you for contributing to Better Auth! Thank you for contributing to Better Auth!