Thank you for your interest in contributing to TurboMediator! This document describes how to set up your development environment, submit changes, and follow the project conventions.
- Code of Conduct
- Prerequisites
- Project Structure
- Building the Project
- Running Tests
- Making Changes
- Pull Request Guidelines
- Code Style
- Adding a New Package
- Documentation
Please be respectful and constructive in all interactions. We follow the Contributor Covenant code of conduct.
- .NET 8 SDK or later
- Node.js 18+ (only required for documentation changes)
- Git
/
├── src/ # Library source code
│ ├── TurboMediator/ # Core library + source generator host
│ ├── TurboMediator.Abstractions/ # Public interfaces and base types
│ ├── TurboMediator.SourceGenerator/ # Roslyn source generator
│ ├── TurboMediator.Resilience/
│ ├── TurboMediator.Observability/
│ ├── TurboMediator.Caching/
│ ├── TurboMediator.Validation/
│ ├── TurboMediator.Enterprise/
│ ├── TurboMediator.FluentValidation/
│ ├── TurboMediator.Persistence/
│ ├── TurboMediator.Persistence.EF/
│ ├── TurboMediator.RateLimiting/
│ ├── TurboMediator.FeatureFlags/
│ ├── TurboMediator.FeatureFlags.FeatureManagement/
│ ├── TurboMediator.Saga/
│ ├── TurboMediator.Saga.EntityFramework/
│ ├── TurboMediator.Batching/
│ ├── TurboMediator.Testing/
│ └── TurboMediator.Cli/
├── tests/
│ └── TurboMediator.Tests/ # Unit and integration tests
├── samples/ # Runnable sample projects
└── docs/ # Documentation website (Next.js)
Clone the repository and restore dependencies:
git clone https://github.com/marcocestari/TurboMediator.git
cd TurboMediator
dotnet restoreBuild the entire solution:
dotnet build TurboMediator.slnBuild a specific project:
dotnet build src/TurboMediator/TurboMediator.csprojRun the full test suite:
dotnet test tests/TurboMediator.Tests/TurboMediator.Tests.csprojRun tests with a filter:
dotnet test tests/TurboMediator.Tests/TurboMediator.Tests.csproj --filter "Category=Pipeline"Run a specific sample to verify end-to-end behavior:
dotnet run --project samples/Sample.RealWorld/Sample.RealWorld.csprojAll tests must pass before a pull request can be merged. New features and bug fixes must include corresponding tests.
-
Fork the repository and create a new branch from
main:git checkout -b feat/my-feature
-
Make your changes following the code style guidelines below.
-
Add or update tests for the behavior you changed.
-
Build and test locally before pushing:
dotnet build TurboMediator.sln dotnet test tests/TurboMediator.Tests/TurboMediator.Tests.csproj -
Commit using clear, conventional commit messages (see below).
-
Push your branch and open a pull request.
Follow Conventional Commits:
<type>(<scope>): <short description>
[optional body]
[optional footer]
Types: feat, fix, docs, test, refactor, perf, chore, ci
Examples:
feat(resilience): add hedging policy support
fix(saga): correct compensation rollback order
docs(observability): add OpenTelemetry setup guide
test(batching): add concurrency test for auto-batching
- Keep PRs focused on a single concern.
- Reference related issues using
Closes #<issue>in the PR description. - Ensure the CI pipeline passes (build + tests).
- Add a clear description of what the PR changes and why.
- If the change is user-facing, update or add the relevant documentation under
docs/content/. - Avoid unrelated whitespace or formatting changes in the diff.
- Follow standard C# conventions (Microsoft C# Coding Conventions).
- Use
async/awaitthroughout; avoid.Resultor.Wait(). - Keep public APIs minimal — expose only what is necessary.
- All public types and members must have XML doc comments (
///). - Use
CancellationTokenin all async methods. - Source generator code lives exclusively in
TurboMediator.SourceGenerator; do not use reflection in any other project. - New optional features must be placed in their own package under
src/and must not add mandatory dependencies toTurboMediatororTurboMediator.Abstractions.
- Create a new project under
src/TurboMediator.<Feature>/. - Reference
TurboMediator.Abstractions; avoid referencingTurboMediatordirectly unless strictly necessary. - Add the project to
TurboMediator.sln. - Add a corresponding sample under
samples/Sample.<Feature>/. - Update README.md to list the new package under Optional packages.
- Add documentation pages under
docs/content/docs/.
The documentation website lives in /docs and is built with Next.js and Fumadocs.
To run it locally:
cd docs
npm install
npm run devThe site will be available at http://localhost:3000.
Documentation source files are MDX files under docs/content/docs/. When adding a new feature, create or update the relevant .mdx file and link it in the sidebar configuration (docs/source.config.ts).
If you have questions, feel free to open a GitHub Discussion or file an issue. We're happy to help!