4.9 KiB
4.9 KiB
Contributing to The Order
Thank you for your interest in contributing to The Order! This document provides guidelines and instructions for contributing.
Code of Conduct
By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors.
Getting Started
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/the-order.git - Create a branch:
git checkout -b feature/your-feature-name - Install dependencies:
pnpm install - Make your changes
- Test your changes:
pnpm test && pnpm lint - Commit your changes (see Commit Guidelines)
- Push to your fork:
git push origin feature/your-feature-name - Open a Pull Request
Development Setup
Prerequisites
- Node.js >= 18.0.0
- pnpm >= 8.0.0
- Docker (for local services)
- Git
Local Development
# Install dependencies
pnpm install
# Start development servers
pnpm dev
# Run tests
pnpm test
# Run linting
pnpm lint
# Type check
pnpm type-check
Environment Setup
- Copy
.env.exampleto.env.localin the workspace you're working on - Configure required environment variables
- For secrets, use SOPS (see Security Policy)
Commit Guidelines
We use Conventional Commits for commit messages:
<type>(<scope>): <subject>
<body>
<footer>
Types
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Test additions or changeschore: Build process or auxiliary tool changesperf: Performance improvementsci: CI/CD changesrevert: Revert a previous commit
Examples
feat(auth): add OIDC provider support
Implement OAuth2/OIDC flow with support for multiple providers.
Adds configuration for eIDAS integration.
Closes #123
fix(intake): resolve OCR parsing issue with PDFs
Fixes character encoding problems when processing multi-page PDFs.
Adds proper error handling for corrupted documents.
Fixes #456
Pull Request Process
- Update Documentation: Update relevant documentation for your changes
- Add Tests: Include tests for new features or bug fixes
- Update Changelog: Add entry to CHANGELOG.md (if applicable)
- Ensure Tests Pass: All CI checks must pass
- Request Review: Request review from relevant code owners (see CODEOWNERS)
PR Title Format
Use the same format as commit messages:
feat(scope): brief description
PR Description Template
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
How was this tested?
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Comments added for complex code
- [ ] Documentation updated
- [ ] Tests added/updated
- [ ] All tests pass
- [ ] No new warnings
Code Style
TypeScript
- Use strict TypeScript configuration
- Prefer type over interface for unions/intersections
- Use explicit return types for public functions
- Avoid
anytype
Formatting
- Use Prettier for code formatting
- Run
pnpm formatbefore committing - ESLint rules must pass
Naming Conventions
- Variables:
camelCase - Functions:
camelCase - Classes:
PascalCase - Constants:
UPPER_SNAKE_CASE - Files:
kebab-casefor utilities,PascalCasefor components
Testing
Unit Tests
- Write unit tests for all new features
- Aim for >80% code coverage
- Use descriptive test names
- Follow AAA pattern (Arrange, Act, Assert)
Integration Tests
- Write integration tests for API endpoints
- Test error cases and edge cases
- Use test fixtures from
packages/test-utils
E2E Tests
- E2E tests for critical user flows
- Use Playwright or similar framework
- Run in CI/CD pipeline
Documentation
Code Documentation
- Document all public APIs
- Use JSDoc for functions and classes
- Include examples for complex usage
Architecture Documentation
- Update ADRs for significant architectural decisions
- Document new services in
docs/architecture/ - Update data flow diagrams if applicable
Code Review
For Authors
- Keep PRs focused and small
- Respond to feedback promptly
- Be open to suggestions
- Update PR based on feedback
For Reviewers
- Be constructive and respectful
- Focus on code, not the person
- Suggest improvements, don't just point out issues
- Approve when satisfied
Release Process
- Create release branch from
main - Update version numbers
- Update CHANGELOG.md
- Create release PR
- After approval, tag release
- CI/CD automatically deploys
Questions?
- Open an issue for questions
- Check existing documentation
- Ask in discussions