Getting Started
Teak is an open-source personal knowledge hub, and we welcome contributions from the community. This guide will help you get started with contributing to the project.Prerequisites
Before you begin, make sure you have:- Bun installed (v1.3.5 or higher)
- Git for version control
- A code editor (we recommend VS Code)
- Basic knowledge of TypeScript, React, and Node.js
Contribution Workflow
Use descriptive branch names that indicate the type of change:
feature/for new featuresfix/for bug fixesdocs/for documentation updatesrefactor/for code refactoring
Make your changes to the codebase. Follow the Code Quality Guidelines below.
See the Testing Guide for more information.
See Commit Conventions for our commit message format.
Code Quality Tools
Teak uses several tools to maintain code quality and consistency across the monorepo.Biome
Biome is our primary linter and formatter. It provides fast, reliable code formatting and linting for JavaScript and TypeScript.biome.jsonc
Ultracite
Ultracite provides additional code quality checks and integrations with Biome.TypeScript
All code must pass TypeScript type checking:Pre-commit Hooks
Teak uses simple-git-hooks to run quality checks before each commit.What Runs on Pre-commit
The pre-commit hook automatically runs:- TypeScript type checking (
typecheck) - Linting (
lint) - Build verification (
build) - Only on affected packages (using Turborepo’s
--affectedflag)
package.json
Manual Pre-commit Check
You can manually run the pre-commit checks:The
--affected flag means only packages that have changed files will be checked, making the process faster.Commit Conventions
Teak follows the Conventional Commits specification for commit messages.Commit Message Format
Types
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Code style changes (formatting, missing semicolons, etc.)refactor: Code refactoring without changing functionalityperf: Performance improvementstest: Adding or updating testschore: Build process or auxiliary tool changesci: CI/CD configuration changes
Scopes
Use the workspace or feature area as the scope:web: Web applicationmobile: Mobile applicationdesktop: Desktop applicationextension: Browser extensionconvex: Backend/Convex functionsdocs: Documentation site
Examples
CI/CD Process
Teak uses GitHub Actions for continuous integration and deployment.Pull Request Checks
When you create a pull request, the following checks run automatically:- Type Checking: Verifies all TypeScript types are correct
- Linting: Ensures code follows style guidelines
- Build: Confirms all packages build successfully
- Tests: Runs the full test suite
Required Checks
All checks must pass before a pull request can be merged:- Type check:
bun run typecheck - Lint:
bun run lint - Build:
bun run build - Test:
bun run test
Deployment
After a pull request is merged to the main branch:- The documentation site is automatically deployed
- Convex functions are deployed to production
- Web application is deployed to Vercel
Best Practices
Code Style
- Write clear, self-documenting code
- Use TypeScript types for all function parameters and return values
- Prefer functional components and hooks in React
- Keep functions small and focused on a single responsibility
- Use descriptive variable and function names
Testing
- Write tests for new features and bug fixes
- Keep tests fast and deterministic
- Update test fixtures when changing data structures
- See the Testing Guide for details
Documentation
- Update documentation when adding or changing features
- Include JSDoc comments for exported functions
- Add examples to help others understand your code
Pull Requests
- Keep pull requests focused on a single feature or fix
- Write clear descriptions explaining what and why
- Reference related issues in the description
- Respond to review feedback promptly
- Keep your branch up to date with main
Getting Help
If you need help or have questions:- Check the documentation
- Open an issue on GitHub
- Join our community discussions
When adding a feature, write or update tests and make sure
bun run test passes before submitting your pull request.