chore: contribution guide

This commit is contained in:
Bereket Engida
2024-09-27 13:24:07 +03:00
parent 2b3e592678
commit 9d37638b56
3 changed files with 77 additions and 32 deletions

57
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,57 @@
# Contributing to Better Auth
Thanks for taking the time to improve Better Auth! This is a small document to get you started. Before submitting a new issue or PR, check if it already exists in issues or PRs.
### Areas you can contribute
**Issues**
Probably the best way to get going is to see if there is open issues acknowledge by the team. Feel free to open an issue if you found a bug or a missing feature you'd like to work on, and there aren't any issues mentioning it.
**Framework Integrations**
We aim to support as many frameworks as possible in the JavaScript ecosystem. If you'd like to integrate one we don't already cover, start by adding documentation. Since the core is designed to be flexible, a simple doc should work for most frameworks. If we believe the integration should go further to reduce friction, we might ask you to contribute or handle it ourselves.
In general, we avoid framework-specific solutions unless it's a thin layer, especially on the server side. If there's a way to make it work without tying it to a specific framework, and it still works well, we'd prefer that.
Right now, everything you need—framework integrations, plugins, and all the necessary glue code—is bundled into a single package. Since our current integrations are minimal, we dont plan on splitting them into separate packages for the time being.
**Plugins**
If you plant to contribute a new core plugin open an issue first. If we see fit with the plans we have in mind we'll give you a green light. If not you can still publish your plugins yourself.
Make sure to read the plugin documentation before you start developing one.
**New Core Features**
Before you start working on a new core feature it's better to open an issue first. Once you have a green light you can get started.If you start working on something larger, it's a good idea to create a draft (WIP) PR at an early stage so that we can guide you to the right direction.
**Security Issues**
If you see any security issue we prefer, you should disclose it via an email (security@better-auth.com). All reports will be promptly addressed, and you'll be credited accordingly.
### A Few Guidelines to keep in mind
- Rather than extensive configurations, focus instead on providing opinionated, best-practice defaults.
- Try to make a consistent and predictable API across all supported frameworks
- Everything should be type-safe and embrace typescript magic when necessary.
## Development
1. Fork the repo
2. clone your fork.
3. install node.js (preferable latest LTS).
4. run pnpm i in your terminal to install dependencies.
5. create a branch.
6. create a draft pull request. link the relevant issue by referring to it in the PR's description. Eg.closes #123 will link the PR to issue/pull request #123.
7. implement your changes.
## Testing
At the moment, we're only focusing on unit tests. Before we reach v1, we'll expand to include extensive integration testing. For now, please follow these guidelines:
- Add your tests in the same place as your functionality—no need to create separate folders.
- Avoid mocking unless absolutely necessary.
- Only use vitest for testing.
- If you need an auth instance, use getTestInstance instead of creating one manually, unless there's a specific reason to do so.

View File

@@ -1,4 +1,4 @@
<!-- <p align="center">
<p align="center">
<picture>
<source srcset="./banner-dark.png" media="(prefers-color-scheme: dark)">
<source srcset="./banner.png" media="(prefers-color-scheme: light)">
@@ -20,7 +20,7 @@
·
<a href="https://github.com/better-auth/better-auth/issues">Issues</a>
</p>
</p> -->
</p>
[![npm](https://img.shields.io/npm/dm/better-auth)](https://www.npmjs.com/package/better-auth)
[![GitHub stars](https://img.shields.io/github/stars/better-auth/better-auth)](https://github.com/better-auth/better-auth/stargazers)
@@ -39,42 +39,32 @@
### Goals
****
- **Be Comprehensive**: The goal is to save users from reinventing the wheel for anything related auth.
- **Prioritize Best Practices**: provide best practices rather than overwhelming users with configuration options.
- **Framework Agnostic**: Support most frameworks.
- **Be Comprehensive**: Save users from reinventing the wheel for anything related auth.
- **Prioritize Best Practices**: provide best practices rather than overwhelming configuration options.
- **Framework Agnostic**: Support most frameworks and avoid framework specific features and solutions if possible.
- **Consistency**: Provide a consistent and predictable API across all platforms
- **Type Safety**: Value type-safety and embrace typescript magic when necessary.
### Non Goals
### Non-Goals
****
- **JWT Based Authentication**: Unless implemented by 3rd party plugin we wont be supporting jwt based auth.
- **Supporting Non Relational Databases**: No plan to support mongo db or other no relational dbs.
- **Deep Customization**: Focus instead on providing opinionated, best-practice defaults.
- **JWT-Based Authentication**: We wont support JWT-based auth unless provided by a third-party plugin.
- **Support for Non-Relational Databases**: No plans to support MongoDB or other non-relational databases.
- **Deep Customization**: Our focus is on delivering opinionated, best-practice defaults, rather than enabling deep customization.
- **Frontend UI Components**: We dont provide frontend UI components. However, feel free to use our examples for quick UI integration.
### Planned Before v1.0
****
When something is started being worked on they will have "-" status and "x" where we're done.
- [ ] Address any potential security issues
- [ ] Add guides and integration for more frameworks
- [ ] Pre Made UI Components
- [ ] User Management UI
- [ ] Email Templates
- [ ] Open API Spec and Docs for all endpoints
- [ ] Expo/React-Native Client
- [ ] Optimized Queries
- [ ] Extensive Testing
- [ ] Enhancements on existing features
> Some of these non-goals might change after we hit v1
## Contribution
We welcome contributions from the community! If you would like to contribute to Better Auth, please read our contribution guide first.
Better Auth is free and open source project licensed under the MIT License. You are free to do whatever you want with it.
You could help continuing its development by:
- [Contribute to the source code](./CONTRIBUTING.md)
- [Suggest new features and report issues](https://github.com/better-auth/better-auth/issues)
## Security
If you discover any security vulnerabilities or have concerns regarding the security of our project, you can reach out at security@better-auth.com.
If you discover a security vulnerability within Better AUth, please send an e-mail to support at better-auth.com.
All reports will be promptly addressed, and you'll be credited accordingly.

View File

@@ -7,7 +7,6 @@
"scripts": {
"build": "turbo --filter \"./packages/*\" build",
"dev": "turbo --filter \"./packages/*\" dev",
"dev:example": "turbo --filter next-js-example dev",
"clean": "turbo --filter \"./packages/*\" clean && rm -rf node_modules",
"format": "biome format . --write",
"lint": "biome check .",
@@ -15,8 +14,7 @@
"release": "turbo --filter \"./packages/*\" build && bumpp && pnpm -r publish --access public --no-git-checks",
"release:beta": "turbo --filter \"./packages/*\" build && bumpp && pnpm -r publish --access public --tag beta --no-git-checks",
"test": "turbo --filter \"./packages/*\" test",
"typecheck": "turbo --filter \"./packages/*\" typecheck",
"knip": "turbo --filter \"./packages/*\" knip"
"typecheck": "turbo --filter \"./packages/*\" typecheck"
},
"dependencies": {
"@biomejs/biome": "1.7.3",