diff --git a/.github/workflows/render-readme.yml b/.github/workflows/render-readme.yml new file mode 100644 index 0000000..0d6a6e2 --- /dev/null +++ b/.github/workflows/render-readme.yml @@ -0,0 +1,67 @@ +name: Render README + +on: + push: + branches: [main] + paths: + - 'data/**' + - 'scripts/render_readme.py' + pull_request: + paths: + - 'data/**' + - 'scripts/render_readme.py' + workflow_dispatch: + +jobs: + render: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pyyaml + + - name: Validate YAML schema + run: python scripts/validate_data.py + + - name: Render README.md + run: python scripts/render_readme.py + + - name: Check for changes + id: check_changes + run: | + if git diff --quiet README.md; then + echo "changed=false" >> $GITHUB_OUTPUT + else + echo "changed=true" >> $GITHUB_OUTPUT + fi + + - name: Commit and push if changed + if: steps.check_changes.outputs.changed == 'true' && github.event_name != 'pull_request' + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add README.md + git commit -m "docs: auto-render README.md from data" + git push + + - name: Comment on PR if changes needed + if: steps.check_changes.outputs.changed == 'true' && github.event_name == 'pull_request' + uses: actions/github-script@v7 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '⚠️ README.md needs to be regenerated. Please run `python scripts/render_readme.py` and commit the changes.' + }) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3160f07 --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg + +# Virtual environments +venv/ +ENV/ +env/ + +# IDEs +.vscode/ +.idea/ +*.swp +*.swo +*~ +.DS_Store + +# Temporary files +*.tmp +*.bak diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..f4bea6a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,67 @@ +# Contributing + +This repository uses a data-driven approach to maintain the list of C# Source Generators. + +## Structure + +- **`data/repositories.yml`** - The single source of truth containing all repository information +- **`scripts/render_readme.py`** - Python script that generates README.md from the YAML data +- **`scripts/validate_data.py`** - Validation script to ensure data quality +- **`scripts/extract_data.py`** - Helper script to extract data from existing README (used during migration) + +## Making Changes + +### Adding a New Repository + +1. Edit `data/repositories.yml` +2. Add your repository under the appropriate category: + +```yaml +categories: + your-category: + repositories: + - name: YourGenerator + url: https://github.com/yourusername/yourgenerator + description: Brief description of what your generator does +``` + +3. Run validation: `python scripts/validate_data.py` +4. Render README: `python scripts/render_readme.py` +5. Commit both `data/repositories.yml` and `README.md` + +### Adding a New Category + +1. Edit `data/repositories.yml` +2. Add your category: + +```yaml +categories: + your-new-category: + name: Your New Category Name + repositories: + - name: FirstRepo + url: https://github.com/... + description: ... +``` + +3. Update the table of contents in the YAML file if needed +4. Follow steps 3-5 from "Adding a New Repository" + +## Automation + +The repository includes a GitHub Actions workflow (`.github/workflows/render-readme.yml`) that: + +- **On Push**: Validates data and auto-generates README.md +- **On Pull Requests**: Validates data and comments if README needs regeneration + +## Validation + +The validation script checks for: + +- Valid GitHub URLs +- Required fields (name, url) +- Duplicate repositories +- Empty descriptions +- Proper YAML structure + +Run `python scripts/validate_data.py` before committing to ensure data quality. diff --git a/README.md b/README.md index 5e62333..1df3f6c 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,12 @@ A list of C# Source Generators (not necessarily awesome), because I haven't found a good list yet. + + **C# Source Generators** is a Roslyn compiler feature introduced in C#9/.NET 5. It lets C# developers inspect user code and generate new C# source files that can be added to a compilation. + + Add GitHub topic [`csharp-sourcegenerator`](https://github.com/topics/csharp-sourcegenerator) to your generator repo - let's get it started! ## Documentation and samples @@ -32,13 +36,13 @@ Add GitHub topic [`csharp-sourcegenerator`](https://github.com/topics/csharp-sou Categories - [Dependency Injection (IoC Container)](#dependency-injection-ioc-container) -- [Console / CLI](#console--cli) +- [Console / CLI](#console---cli) - [Mappers](#mappers) - [Communication](#communication) -- [Graphics / Drawing](#graphics--drawing) +- [Graphics / Drawing](#graphics---drawing) - [Enums](#enums) - [Functional Programming](#functional-programming) - - [Value semantic / New Type Idiom](#value-semantic--new-type-idiom) + - [Value semantic / New Type Idiom](#value-semantic---new-type-idiom) - [Immutability](#immutability) - [Discriminated Unions](#discriminated-unions) - [Serialization](#serialization) @@ -54,16 +58,18 @@ Add GitHub topic [`csharp-sourcegenerator`](https://github.com/topics/csharp-sou - [Proxy](#proxy) - [Visitor](#visitor) - [Adapter](#adapter) + - [Fluent API](#fluent-api) - [Domain Driven Design (DDD)](#domain-driven-design-ddd) - [Metaprogramming](#metaprogramming) - [Webprogramming](#webprogramming) - [Open Api](#open-api) - - [Razor / Blazor](#razor--blazor) -- [XAML / WPF / Avalonia](#xaml--wpf--avalonia) + - [Razor / Blazor](#razor---blazor) +- [XAML / WPF / Avalonia](#xaml---wpf---avalonia) - [INotifyPropertyChanged](#inotifypropertychanged) - [Model View Viewmodel (MVVM)](#model-view-viewmodel-mvvm) -- [Database / ORM](#database--orm) -- [Statically typed resources / configurations](#statically-typed-resources--configurations) +- [Database / ORM](#database---orm) +- [Statically typed resources / configurations](#statically-typed-resources---configurations) +- [Text templating](#text-templating) - [Other](#other) @@ -77,260 +83,263 @@ Add GitHub topic [`csharp-sourcegenerator`](https://github.com/topics/csharp-sou - [AutoCtor](https://github.com/distantcam/AutoCtor) - ![stars](https://img.shields.io/github/stars/distantcam/AutoCtor?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/distantcam/AutoCtor?style=flat-square&cacheSeconds=86400) AutoCtor is a Roslyn Source Generator that will automatically create a constructor for your class for use with constructor Dependency Injection. - [AutoRegisterInject](https://github.com/patrickklaeren/AutoRegisterInject) - ![stars](https://img.shields.io/github/stars/patrickklaeren/AutoRegisterInject?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/patrickklaeren/AutoRegisterInject?style=flat-square&cacheSeconds=86400) Automatically generate Microsoft Dependency Injection ServiceCollection registrations for your classes from attributes. -- [CircleDI](https://github.com/BlackWhiteYoshi/CircleDI) -![stars](https://img.shields.io/github/stars/BlackWhiteYoshi/CircleDI?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/BlackWhiteYoshi/CircleDI?style=flat-square&cacheSeconds=86400) The world only full-power circular Service Provider. It can resolve circular dependencies, has compile time safety and optimal performance. -- [DependencyInjection.SourceGenerators](https://github.com/jimmy-mll/DependencyInjection.SourceGenerators) ![stars](https://img.shields.io/github/stars/jimmy-mll/Microsoft.Extensions.DependencyInjection.SourceGenerators?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/jimmy-mll/Microsoft.Extensions.DependencyInjection.SourceGenerators?style=flat-square&cacheSeconds=86400) This project is a C# source generator designed to simplify and automate the registration of dependencies in Microsoft's Dependency Injection service collection. By using this package, developers can enhance the clarity and efficiency of their code by reducing the need for manual service registration. +- [CircleDI](https://github.com/BlackWhiteYoshi/CircleDI) - ![stars](https://img.shields.io/github/stars/BlackWhiteYoshi/CircleDI?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/BlackWhiteYoshi/CircleDI?style=flat-square&cacheSeconds=86400) The world only full-power circular Service Provider. It can resolve circular dependencies, has compile time safety and optimal performance. +- [DependencyInjection.SourceGenerators](https://github.com/jimmy-mll/DependencyInjection.SourceGenerators) - ![stars](https://img.shields.io/github/stars/jimmy-mll/DependencyInjection.SourceGenerators?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/jimmy-mll/DependencyInjection.SourceGenerators?style=flat-square&cacheSeconds=86400) This project is a C# source generator designed to simplify and automate the registration of dependencies in Microsoft's Dependency Injection service collection. By using this package, developers can enhance the clarity and efficiency of their code by reducing the need for manual service registration. - [DependencyManagement](https://github.com/essy-ecosystem/dependency-management) - ![stars](https://img.shields.io/github/stars/essy-ecosystem/dependency-management?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/essy-ecosystem/dependency-management?style=flat-square&cacheSeconds=86400) The Dependency Management is a very fast dependency injection and components container, with many interesting features, and without reflection. -- [GrpcInjection](https://github.com/juniorporfirio/grpcinjection) -![stars](https://img.shields.io/github/stars/juniorporfirio/grpcinjection?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/juniorporfirio/grpcinjection?style=flat-square&cacheSeconds=86400) - GrpcInjection is a tool that allow you to inject Services and Interceptor in time of compilation inside of GRPC Projects using C# source generator. -- [Injectio](https://github.com/loresoft/Injectio) - ![stars](https://img.shields.io/github/stars/loresoft/Injectio?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/loresoft/Injectio?style=flat-square&cacheSeconds=86400) - Source generator that helps register discovered services in the dependency injection container -- [Jab](https://github.com/pakrym/jab) -![stars](https://img.shields.io/github/stars/pakrym/jab?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/pakrym/jab?style=flat-square&cacheSeconds=86400) - Compile Time Dependency Injection -- [lambdajection](https://github.com/cythral/lambdajection) -![stars](https://img.shields.io/github/stars/cythral/lambdajection?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/cythral/lambdajection?style=flat-square&cacheSeconds=86400) Framework for building AWS Lambdas using dependency injection and aspect-oriented programming. +- [GrpcInjection](https://github.com/juniorporfirio/grpcinjection) - ![stars](https://img.shields.io/github/stars/juniorporfirio/grpcinjection?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/juniorporfirio/grpcinjection?style=flat-square&cacheSeconds=86400) GrpcInjection is a tool that allow you to inject Services and Interceptor in time of compilation inside of GRPC Projects using C# source generator. +- [Injectio](https://github.com/loresoft/Injectio) - ![stars](https://img.shields.io/github/stars/loresoft/Injectio?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/loresoft/Injectio?style=flat-square&cacheSeconds=86400) Source generator that helps register discovered services in the dependency injection container +- [Jab](https://github.com/pakrym/jab) - ![stars](https://img.shields.io/github/stars/pakrym/jab?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/pakrym/jab?style=flat-square&cacheSeconds=86400) Compile Time Dependency Injection +- [lambdajection](https://github.com/cythral/lambdajection) - ![stars](https://img.shields.io/github/stars/cythral/lambdajection?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/cythral/lambdajection?style=flat-square&cacheSeconds=86400) Framework for building AWS Lambdas using dependency injection and aspect-oriented programming. - [MrMeeseeks.DIE](https://github.com/Yeah69/MrMeeseeks.DIE) - ![stars](https://img.shields.io/github/stars/Yeah69/MrMeeseeks.DIE?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Yeah69/MrMeeseeks.DIE?style=flat-square&cacheSeconds=86400) An unambigous, convenient, flexible and feature rich compile time dependency injection container. -- [Pure.DI](https://github.com/DevTeam/Pure.DI) - ![stars](https://img.shields.io/github/stars/DevTeam/Pure.DI?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/DevTeam/Pure.DI?style=flat-square&cacheSeconds=86400) - dependency injection for .NET without any IoC/DI containers, frameworks, dependencies, and thus without any performance impact and side-effects. +- [Pure.DI](https://github.com/DevTeam/Pure.DI) - ![stars](https://img.shields.io/github/stars/DevTeam/Pure.DI?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/DevTeam/Pure.DI?style=flat-square&cacheSeconds=86400) dependency injection for .NET without any IoC/DI containers, frameworks, dependencies, and thus without any performance impact and side-effects. - [ServiceScan.SourceGenerator](https://github.com/Dreamescaper/ServiceScan.SourceGenerator) - ![stars](https://img.shields.io/github/stars/Dreamescaper/ServiceScan.SourceGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Dreamescaper/ServiceScan.SourceGenerator?style=flat-square&cacheSeconds=86400) Type scanning source generator for `Microsoft.Extensions.DependencyInjection` services registrations inspired by [Scrutor](https://github.com/khellang/Scrutor/). - [SourceDepend](https://github.com/crwsolutions/sourcedepend) - ![stars](https://img.shields.io/github/stars/crwsolutions/sourcedepend?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/crwsolutions/sourcedepend?style=flat-square&cacheSeconds=86400) Simply tag members with a `[Dependency]` attribute and those will be added to the constructor, saving you from manual coding the constructor. -- [SourceInject](https://github.com/giggio/sourceinject/) -![stars](https://img.shields.io/github/stars/giggio/sourceinject?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/giggio/sourceinject?style=flat-square&cacheSeconds=86400) A source generator that allow you to generate your services for dependencies injection during compile time. -- [StrongInject](https://github.com/YairHalberstadt/stronginject) -![stars](https://img.shields.io/github/stars/YairHalberstadt/stronginject?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/YairHalberstadt/stronginject?style=flat-square&cacheSeconds=86400) - compile time dependency injection for .NET. +- [SourceInject](https://github.com/giggio/sourceinject/) - ![stars](https://img.shields.io/github/stars/giggio/sourceinject?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/giggio/sourceinject?style=flat-square&cacheSeconds=86400) A source generator that allow you to generate your services for dependencies injection during compile time. +- [StrongInject](https://github.com/YairHalberstadt/stronginject) - ![stars](https://img.shields.io/github/stars/YairHalberstadt/stronginject?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/YairHalberstadt/stronginject?style=flat-square&cacheSeconds=86400) compile time dependency injection for .NET. - [Thunderboltloc](https://github.com/AlyElhaddad/ThunderboltIoc) - ![stars](https://img.shields.io/github/stars/AlyElhaddad/ThunderboltIoc?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/AlyElhaddad/ThunderboltIoc?style=flat-square&cacheSeconds=86400) One of the very first IoC frameworks for .Net that has no reflection. ### Console / CLI - [AutoSpectre](https://github.com/jeppevammenkristensen/auto-spectre) - ![stars](https://img.shields.io/github/stars/jeppevammenkristensen/auto-spectre?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/jeppevammenkristensen/auto-spectre?style=flat-square&cacheSeconds=86400) Generates a service for prompting and populating a class using the Spectre.Console library -- [ConsoleAppFramework](https://github.com/Cysharp/ConsoleAppFramework) - ![stars](https://img.shields.io/github/stars/Cysharp/ConsoleAppFramework?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Cysharp/ConsoleAppFramework?style=flat-square&cacheSeconds=86400) - Zero Dependency, Zero Overhead, Zero Reflection, Zero Allocation, AOT Safe CLI Framework powered by C# Source Generator. +- [ConsoleAppFramework](https://github.com/Cysharp/ConsoleAppFramework) - ![stars](https://img.shields.io/github/stars/Cysharp/ConsoleAppFramework?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Cysharp/ConsoleAppFramework?style=flat-square&cacheSeconds=86400) Zero Dependency, Zero Overhead, Zero Reflection, Zero Allocation, AOT Safe CLI Framework powered by C# Source Generator. - [docopt.net](https://github.com/docopt/docopt.net) - ![stars](https://img.shields.io/github/stars/docopt/docopt.net?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/docopt/docopt.net?style=flat-square&cacheSeconds=86400) generates C# source code that parses command-line arguments into a strong-typed arguments class (also generated), given _just_ the [POSIX-style usage in plain text](http://docopt.org/) as part of the CLI. In other words, write the help message for your program and get the entire parser generated for free! -- [Figgle](https://github.com/drewnoakes/figgle) - ![stars](https://img.shields.io/github/stars/drewnoakes/figgle?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/drewnoakes/figgle?style=flat-square&cacheSeconds=86400) - Generate ASCII banner text at compile time (or run time) using figlet fonts. +- [Figgle](https://github.com/drewnoakes/figgle) - ![stars](https://img.shields.io/github/stars/drewnoakes/figgle?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/drewnoakes/figgle?style=flat-square&cacheSeconds=86400) Generate ASCII banner text at compile time (or run time) using figlet fonts. ### Mappers -- [AutoDto](https://github.com/Ohorodnikov/AutoDto) -![stars](https://img.shields.io/github/stars/Ohorodnikov/AutoDto?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Ohorodnikov/AutoDto?style=flat-square&cacheSeconds=86400) - A source generator that generates DTO models from BL to avoid same BL and DTO models -- [Facet](https://github.com/Tim-Maes/Facet/) -![stars](https://img.shields.io/github/stars/Tim-Maes/Facet?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Tim-Maes/Facet?style=flat-square&cacheSeconds=86400) A source generator that instantly scaffolds DTOs, ViewModels and typed LINQ projections. -- [Flattening](https://github.com/Kros-sk/Kros.Generators.Flattening) - ![stars](https://img.shields.io/github/stars/Kros-sk/Kros.Generators.Flattening?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Kros-sk/Kros.Generators.Flattening?style=flat-square&cacheSeconds=86400) - C# source generator for generating flattened classes from complex domain classes. -- [GraphQL.Tools](https://github.com/MoienTajik/GraphQL.Tools) -![stars](https://img.shields.io/github/stars/MoienTajik/GraphQL.Tools?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/MoienTajik/GraphQL.Tools?style=flat-square&cacheSeconds=86400) - A GraphQL to C# compiler (code-generator) which turns your GraphQL schema into a set of C# classes, interfaces, and enums. -- [Mapperly](https://github.com/riok/mapperly) -![stars](https://img.shields.io/github/stars/riok/mapperly?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/riok/mapperly?style=flat-square&cacheSeconds=86400) - A source generator for generating object mappings. Inspired by MapStruct. -- [MappingCloningExtensions](https://github.com/musictopia2/MappingCloningExtensions) - ![stars](https://img.shields.io/github/stars/musictopia2/MappingCloningExtensions?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/musictopia2/MappingCloningExtensions?style=flat-square&cacheSeconds=86400) Generates extensions of objects for mapping and cloning using either attributes or fluent style. Also, supports deep copying and specfiying whether it can do a deep copy and the possibility of doing so safely. -- [Mapster](https://github.com/MapsterMapper/Mapster) -![stars](https://img.shields.io/github/stars/MapsterMapper/Mapster?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/MapsterMapper/Mapster?style=flat-square&cacheSeconds=86400) - A fast, fun and performant object to object Mapper. Has better performance and is more memorry efficient than Automapper. Besides code generation, supports also Fluent API. -- [MapTo](https://github.com/mrtaikandi/MapTo) -![stars](https://img.shields.io/github/stars/mrtaikandi/mapto?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/mrtaikandi/mapto?style=flat-square&cacheSeconds=86400) - A convention based object to object mapper similar to Automapper. +- [AutoDto](https://github.com/Ohorodnikov/AutoDto) - ![stars](https://img.shields.io/github/stars/Ohorodnikov/AutoDto?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Ohorodnikov/AutoDto?style=flat-square&cacheSeconds=86400) A source generator that generates DTO models from BL to avoid same BL and DTO models +- [Facet](https://github.com/Tim-Maes/Facet/) - ![stars](https://img.shields.io/github/stars/Tim-Maes/Facet?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Tim-Maes/Facet?style=flat-square&cacheSeconds=86400) A source generator that instantly scaffolds DTOs, ViewModels and typed LINQ projections. +- [Flattening](https://github.com/Kros-sk/Kros.Generators.Flattening) - ![stars](https://img.shields.io/github/stars/Kros-sk/Kros.Generators.Flattening?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Kros-sk/Kros.Generators.Flattening?style=flat-square&cacheSeconds=86400) C# source generator for generating flattened classes from complex domain classes. +- [GraphQL.Tools](https://github.com/MoienTajik/GraphQL.Tools) - ![stars](https://img.shields.io/github/stars/MoienTajik/GraphQL.Tools?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/MoienTajik/GraphQL.Tools?style=flat-square&cacheSeconds=86400) A GraphQL to C# compiler (code-generator) which turns your GraphQL schema into a set of C# classes, interfaces, and enums. +- [Mapperly](https://github.com/riok/mapperly) - ![stars](https://img.shields.io/github/stars/riok/mapperly?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/riok/mapperly?style=flat-square&cacheSeconds=86400) A source generator for generating object mappings. Inspired by MapStruct. +- [MappingCloningExtensions](https://github.com/musictopia2/MappingCloningExtensions) - ![stars](https://img.shields.io/github/stars/musictopia2/MappingCloningExtensions?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/musictopia2/MappingCloningExtensions?style=flat-square&cacheSeconds=86400) Generates extensions of objects for mapping and cloning using either attributes or fluent style. Also, supports deep copying and specfiying whether it can do a deep copy and the possibility of doing so safely. +- [Mapster](https://github.com/MapsterMapper/Mapster) - ![stars](https://img.shields.io/github/stars/MapsterMapper/Mapster?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/MapsterMapper/Mapster?style=flat-square&cacheSeconds=86400) A fast, fun and performant object to object Mapper. Has better performance and is more memorry efficient than Automapper. Besides code generation, supports also Fluent API. +- [MapTo](https://github.com/mrtaikandi/MapTo) - ![stars](https://img.shields.io/github/stars/mrtaikandi/MapTo?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/mrtaikandi/MapTo?style=flat-square&cacheSeconds=86400) A convention based object to object mapper similar to Automapper. - [NextGenMapper](https://github.com/DedAnton/NextGenMapper) - ![stars](https://img.shields.io/github/stars/DedAnton/NextGenMapper?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/DedAnton/NextGenMapper?style=flat-square&cacheSeconds=86400) Easy-to-use mapper without configuration. -- [SourceMapper](https://github.com/alekshura/SourceMapper) - ![stars](http://img.shields.io/github/stars/alekshura/SourceMapper?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/alekshura/SourceMapper?style=flat-square&cacheSeconds=86400) - generates Mappers code based on attributes used on interfaces or abstract classes. It is inspired by Java [MapStruct](https://mapstruct.org/) -- [SourceMapper](https://github.com/paiden/SourceMapper/) -![stars](https://img.shields.io/github/stars/paiden/SourceMapper?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/paiden/SourceMapper?style=flat-square&cacheSeconds=86400) A source generator that creates extension methods for cloning and mapping. +- [SourceMapper](https://github.com/alekshura/SourceMapper) - ![stars](https://img.shields.io/github/stars/alekshura/SourceMapper?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/alekshura/SourceMapper?style=flat-square&cacheSeconds=86400) generates Mappers code based on attributes used on interfaces or abstract classes. It is inspired by Java [MapStruct](https://mapstruct.org/) +- [SourceMapper](https://github.com/paiden/SourceMapper/) - ![stars](https://img.shields.io/github/stars/paiden/SourceMapper?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/paiden/SourceMapper?style=flat-square&cacheSeconds=86400) A source generator that creates extension methods for cloning and mapping. ### Communication -- [CoreWCF](https://github.com/CoreWCF/CoreWCF) -![stars](https://img.shields.io/github/stars/CoreWCF/CoreWCF?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/CoreWCF/CoreWCF?style=flat-square&cacheSeconds=86400) CoreWCF provides support of WCF server side code on .NET Core / .NET6. CoreWCF allows users to inject services into `OperationContract` implementation using a source generator to provide an `OperationContract` implementation that fits the expected `ServiceContract`. The supplied implementation fetch services from the DI container the same way the `[FromServices]` attribute works in ASP.NET core MVC Controllers. The source generator supports both a dedicated `[Injected]` attribute and the ASP.NET Core MVC `[FromServices]` attribute. -- [Imp.NET](https://github.com/DouglasDwyer/Imp.NET) -![stars](https://img.shields.io/github/stars/DouglasDwyer/Imp.NET?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/DouglasDwyer/Imp.NET?style=flat-square&cacheSeconds=86400) - a fast, high-level, object-oriented C# networking library that supports the invocation of remote methods through proxy interface objects. -- [IoTHubClientGenerator](https://github.com/alonf/IoTHubClientGenerator) - ![stars](https://img.shields.io/github/stars/alonf/IoTHubClientGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/alonf/IoTHubClientGenerator?style=flat-square&cacheSeconds=86400) Build a C# Azure IoT Device client program in seconds! +- [CoreWCF](https://github.com/CoreWCF/CoreWCF) - ![stars](https://img.shields.io/github/stars/CoreWCF/CoreWCF?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/CoreWCF/CoreWCF?style=flat-square&cacheSeconds=86400) CoreWCF provides support of WCF server side code on .NET Core / .NET6. CoreWCF allows users to inject services into `OperationContract` implementation using a source generator to provide an `OperationContract` implementation that fits the expected `ServiceContract`. The supplied implementation fetch services from the DI container the same way the `[FromServices]` attribute works in ASP.NET core MVC Controllers. The source generator supports both a dedicated `[Injected]` attribute and the ASP.NET Core MVC `[FromServices]` attribute. +- [Imp.NET](https://github.com/DouglasDwyer/Imp.NET) - ![stars](https://img.shields.io/github/stars/DouglasDwyer/Imp.NET?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/DouglasDwyer/Imp.NET?style=flat-square&cacheSeconds=86400) a fast, high-level, object-oriented C# networking library that supports the invocation of remote methods through proxy interface objects. +- [IoTHubClientGenerator](https://github.com/alonf/IoTHubClientGenerator) - ![stars](https://img.shields.io/github/stars/alonf/IoTHubClientGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/alonf/IoTHubClientGenerator?style=flat-square&cacheSeconds=86400) Build a C# Azure IoT Device client program in seconds! ### Graphics / Drawing -- [ComputeSharp](https://github.com/Sergio0694/ComputeSharp) -![stars](https://img.shields.io/github/stars/Sergio0694/ComputeSharp?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Sergio0694/ComputeSharp?style=flat-square&cacheSeconds=86400) A .NET library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute shaders, which are transpiled from C# and precompiled at build-time using source generators. -- [Svg to C# Source Generators](https://github.com/wieslawsoltes/Svg.Skia) -![stars](https://img.shields.io/github/stars/wieslawsoltes/Svg.Skia?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/wieslawsoltes/Svg.Skia?style=flat-square&cacheSeconds=86400) SVGC compiles SVG drawing markup to C# using SkiaSharp as rendering engine. SVGC can be also used as codegen for upcoming C# 9 Source Generator feature. +- [ComputeSharp](https://github.com/Sergio0694/ComputeSharp) - ![stars](https://img.shields.io/github/stars/Sergio0694/ComputeSharp?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Sergio0694/ComputeSharp?style=flat-square&cacheSeconds=86400) A .NET library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute shaders, which are transpiled from C# and precompiled at build-time using source generators. +- [Svg to C# Source Generators](https://github.com/wieslawsoltes/Svg.Skia) - ![stars](https://img.shields.io/github/stars/wieslawsoltes/Svg.Skia?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/wieslawsoltes/Svg.Skia?style=flat-square&cacheSeconds=86400) SVGC compiles SVG drawing markup to C# using SkiaSharp as rendering engine. SVGC can be also used as codegen for upcoming C# 9 Source Generator feature. ### Enums - [BetterEnums](https://github.com/Ceiridge/BetterEnums) - ![stars](https://img.shields.io/github/stars/Ceiridge/BetterEnums?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Ceiridge/BetterEnums?style=flat-square&cacheSeconds=86400) C# Enums with values and better performance as a source generator -- [Credfeto.Enumeration.Source.Generation](https://github.com/credfeto/credfeto-enum-source-generation) -![stars](https://img.shields.io/github/stars/credfeto/credfeto-enum-source-generation?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/credfeto/credfeto-enum-source-generation?style=flat-square&cacheSeconds=86400) Enum to text generator for enums - generates strongly typed enums for all enums in the assembly, and using `EnumText` attribute for third party enums. Also includes an analyzer to ensure that all enum usages use the `.GetName` extension method rather than `.ToString`. +- [Credfeto.Enumeration.Source.Generation](https://github.com/credfeto/credfeto-enum-source-generation) - ![stars](https://img.shields.io/github/stars/credfeto/credfeto-enum-source-generation?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/credfeto/credfeto-enum-source-generation?style=flat-square&cacheSeconds=86400) Enum to text generator for enums - generates strongly typed enums for all enums in the assembly, and using `EnumText` attribute for third party enums. Also includes an analyzer to ensure that all enum usages use the `.GetName` extension method rather than `.ToString`. - [Enum.Source.Generator](https://github.com/EngRajabi/Enum.Source.Generator) - ![stars](https://img.shields.io/github/stars/EngRajabi/Enum.Source.Generator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/EngRajabi/Enum.Source.Generator?style=flat-square&cacheSeconds=86400) A C# source generator to create an enumeration (enum) class from an enum type. With this package, you can work on enums very, very fast without using reflection. -- [EnumClass](https://github.com/ashenBlade/EnumClass) - ![stars](https://img.shields.io/github/stars/ashenBlade/EnumClass?style=flat-square&cacheSeconds=604800) ![last_commit](https://img.shields.io/github/last-commit/ashenBlade/EnumClass?style=flat-square&cacheSeconds=86400) Generate Kotlin's `enum class` from C# `enum` with additional features like Switch function (instead of `switch` statement). It also contains support libraries like generator for JsonConverter for generated classes -- [EnumerationClassGenerator](https://github.com/HamedFathi/EnumerationClassGenerator) -![stars](https://img.shields.io/github/stars/HamedFathi/EnumerationClassGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/HamedFathi/EnumerationClassGenerator?style=flat-square&cacheSeconds=86400) - A C# source generator to create an enumeration class from an enum type. -- [EnumFastToStringDotNet](https://github.com/Spinnernicholas/EnumFastToStringDotNet) -![stars](https://img.shields.io/github/stars/Spinnernicholas/EnumFastToStringDotNet?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Spinnernicholas/EnumFastToStringDotNet?style=flat-square&cacheSeconds=86400) - Automatically generates enum extension methods that implement a switch expression based ToString method. -- [EnumUtilitiesGenerator](https://github.com/leoformaggi/enum-utilities-generator) -![stars](https://img.shields.io/github/stars/leoformaggi/enum-utilities-generator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/leoformaggi/enum-utilities-generator?style=flat-square&cacheSeconds=86400) - A source generator to generate compile-time mapping of enums and description attributes. -- [FastEnumGenerator](https://github.com/musictopia2/FastEnumGenerator) - ![stars](https://img.shields.io/github/stars/musictopia2/FastEnumGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/musictopia2/FastEnumGenerator?style=flat-square&cacheSeconds=86400) An enum like generator where you create a partial class with private enum and it will generate an enum like record struct even including returning the words and a list. +- [EnumClass](https://github.com/ashenBlade/EnumClass) - ![stars](https://img.shields.io/github/stars/ashenBlade/EnumClass?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/ashenBlade/EnumClass?style=flat-square&cacheSeconds=86400) Generate Kotlin's `enum class` from C# `enum` with additional features like Switch function (instead of `switch` statement). It also contains support libraries like generator for JsonConverter for generated classes +- [EnumerationClassGenerator](https://github.com/HamedFathi/EnumerationClassGenerator) - ![stars](https://img.shields.io/github/stars/HamedFathi/EnumerationClassGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/HamedFathi/EnumerationClassGenerator?style=flat-square&cacheSeconds=86400) A C# source generator to create an enumeration class from an enum type. +- [EnumFastToStringDotNet](https://github.com/Spinnernicholas/EnumFastToStringDotNet) - ![stars](https://img.shields.io/github/stars/Spinnernicholas/EnumFastToStringDotNet?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Spinnernicholas/EnumFastToStringDotNet?style=flat-square&cacheSeconds=86400) Automatically generates enum extension methods that implement a switch expression based ToString method. +- [EnumUtilitiesGenerator](https://github.com/leoformaggi/enum-utilities-generator) - ![stars](https://img.shields.io/github/stars/leoformaggi/enum-utilities-generator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/leoformaggi/enum-utilities-generator?style=flat-square&cacheSeconds=86400) A source generator to generate compile-time mapping of enums and description attributes. +- [FastEnumGenerator](https://github.com/musictopia2/FastEnumGenerator) - ![stars](https://img.shields.io/github/stars/musictopia2/FastEnumGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/musictopia2/FastEnumGenerator?style=flat-square&cacheSeconds=86400) An enum like generator where you create a partial class with private enum and it will generate an enum like record struct even including returning the words and a list. - [JOS.Enumeration](https://github.com/joseftw/jos.enumeration) - ![stars](https://img.shields.io/github/stars/joseftw/jos.enumeration?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/joseftw/jos.enumeration?style=flat-square&cacheSeconds=86400) Enumeration class powered by source generation - [NetEscapades.EnumGenerators](https://github.com/andrewlock/NetEscapades.EnumGenerators) - ![stars](https://img.shields.io/github/stars/andrewlock/NetEscapades.EnumGenerators?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/andrewlock/NetEscapades.EnumGenerators?style=flat-square&cacheSeconds=86400) A source generator for generating fast "reflection" methods for enums -- [RapidEnum](https://github.com/hanachiru/RapidEnum) - ![stars](https://img.shields.io/github/stars/hanachiru/RapidEnum?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/hanachiru/RapidEnum?style=flat-square&cacheSeconds=86400) - RapidEnum is a Source Generator that provides fast-running enum utilities for C#/.NET. It is faster than the .NET API and achieves zero allocation for all methods. +- [RapidEnum](https://github.com/hanachiru/RapidEnum) - ![stars](https://img.shields.io/github/stars/hanachiru/RapidEnum?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/hanachiru/RapidEnum?style=flat-square&cacheSeconds=86400) RapidEnum is a Source Generator that provides fast-running enum utilities for C#/.NET. It is faster than the .NET API and achieves zero allocation for all methods. ### Functional Programming -#### Value semantic / New Type Idiom + +### Value semantic / New Type Idiom - [ComparisonOperatorsGenerator](https://github.com/sonnemaf/ReflectionIT.ComparisonOperatorsGenerator) - ![stars](https://img.shields.io/github/stars/sonnemaf/ReflectionIT.ComparisonOperatorsGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/sonnemaf/ReflectionIT.ComparisonOperatorsGenerator?style=flat-square&cacheSeconds=86400) A Source Generator package that generates the `>`, `>=`, `<`, `<=` operators for a `partial` type (`class`, `struct` or `record`) which implements `IComparable`. - [Generator.Equals](https://github.com/diegofrata/Generator.Equals) - ![stars](https://img.shields.io/github/stars/diegofrata/Generator.Equals?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/diegofrata/Generator.Equals?style=flat-square&cacheSeconds=86400) generates equality and hashing for classes and records, supports a number of strategies for comparing collections and properties. - [RSCG_UtilityTypes](https://github.com/ignatandrei/RSCG_UtilityTypes) - ![stars](https://img.shields.io/github/stars/ignatandrei/RSCG_UtilityTypes?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/ignatandrei/RSCG_UtilityTypes?style=flat-square&cacheSeconds=86400) Add Omit and Pick attributes to generate classes from existing class, like in TypeScript. -- [Strongly](https://github.com/lucasteles/Strongly) ![stars](https://img.shields.io/github/stars/lucasteles/Strongly?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/lucasteles/Strongly?style=flat-square&cacheSeconds=86400) - Easily generate serializable domain value types +- [Strongly](https://github.com/lucasteles/Strongly) - ![stars](https://img.shields.io/github/stars/lucasteles/Strongly?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/lucasteles/Strongly?style=flat-square&cacheSeconds=86400) Easily generate serializable domain value types - [StronglyTypedId](https://github.com/andrewlock/StronglyTypedId) - ![stars](https://img.shields.io/github/stars/andrewlock/StronglyTypedId?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/andrewlock/StronglyTypedId?style=flat-square&cacheSeconds=86400) A Rosyln-powered generator for strongly-typed IDs - [ValueObjectGenerator](https://github.com/RyotaMurohoshi/ValueObjectGenerator) - ![stars](https://img.shields.io/github/stars/RyotaMurohoshi/ValueObjectGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/RyotaMurohoshi/ValueObjectGenerator?style=flat-square&cacheSeconds=86400) C# source generator is for ValueObjects (ie.Wrapper classes). - [Vogen](https://github.com/SteveDunn/Vogen) - ![stars](https://img.shields.io/github/stars/SteveDunn/Vogen?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/SteveDunn/Vogen?style=flat-square&cacheSeconds=86400) C# source generator and code analyser that generates strongly typed domain identities. -- [WrapperValueObject](https://github.com/martinothamar/WrapperValueObject) - ![stars](https://img.shields.io/github/stars/martinothamar/WrapperValueObject?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/martinothamar/WrapperValueObject?style=flat-square&cacheSeconds=86400) - for creating simple value objects wrapping primitive types. - -#### Immutability +- [WrapperValueObject](https://github.com/martinothamar/WrapperValueObject) - ![stars](https://img.shields.io/github/stars/martinothamar/WrapperValueObject?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/martinothamar/WrapperValueObject?style=flat-square&cacheSeconds=86400) for creating simple value objects wrapping primitive types. + +### Immutability -- [Immutype](https://github.com/DevTeam/Immutype) - ![stars](https://img.shields.io/github/stars/DevTeam/Immutype?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/DevTeam/Immutype?style=flat-square&cacheSeconds=86400) - generates extension methods to support immutability. +- [Immutype](https://github.com/DevTeam/Immutype) - ![stars](https://img.shields.io/github/stars/DevTeam/Immutype?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/DevTeam/Immutype?style=flat-square&cacheSeconds=86400) generates extension methods to support immutability. - [Visor](https://github.com/leviysoft/Visor) - ![stars](https://img.shields.io/github/stars/leviysoft/Visor?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/leviysoft/Visor?style=flat-square&cacheSeconds=86400) C# optics library with incremental code generator (maintained fork of [suspended Tinkoff project](https://github.com/Tinkoff/Visor)) -#### Discriminated Unions +### Discriminated Unions - [AnyOf](https://github.com/StefH/AnyOf) - ![stars](https://img.shields.io/github/stars/StefH/AnyOf?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/StefH/AnyOf?style=flat-square&cacheSeconds=86400) The Source Generator creates a `AnyOf` type to handle multiple defined types as input parameters for methods. - [dotVariant](https://github.com/mknejp/dotvariant) - ![stars](https://img.shields.io/github/stars/mknejp/dotvariant?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/mknejp/dotvariant?style=flat-square&cacheSeconds=86400) A type-safe and space-efficient sum type for C# (comparable to discriminated unions in C or C++). -- [Dunet](https://github.com/domn1995/dunet) - ![stars](https://img.shields.io/github/stars/domn1995/dunet?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/domn1995/dunet?style=flat-square&cacheSeconds=604800) A simple source generator for [discriminated unions](https://en.wikipedia.org/wiki/Tagged_union) in C#. +- [Dunet](https://github.com/domn1995/dunet) - ![stars](https://img.shields.io/github/stars/domn1995/dunet?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/domn1995/dunet?style=flat-square&cacheSeconds=86400) A simple source generator for [discriminated unions](https://en.wikipedia.org/wiki/Tagged_union) in C#. - [Funcky Discriminated Unions](https://github.com/polyadic/funcky-discriminated-union) - ![stars](https://img.shields.io/github/stars/polyadic/funcky-discriminated-union?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/polyadic/funcky-discriminated-union?style=flat-square&cacheSeconds=86400) A source generator that generates `Match` methods for all your discriminated unions needs. ✨ Can be used with or without the functional programming library Funcky. - [N.SourceGenerators.UnionTypes](https://github.com/Ne4to/N.SourceGenerators.UnionTypes) - ![stars](https://img.shields.io/github/stars/Ne4to/N.SourceGenerators.UnionTypes?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Ne4to/N.SourceGenerators.UnionTypes?style=flat-square&cacheSeconds=86400) Discriminated union type source generator. - [Unions](https://github.com/PaulBraetz/Unions) - ![stars](https://img.shields.io/github/stars/PaulBraetz/Unions?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/PaulBraetz/Unions?style=flat-square&cacheSeconds=86400) for generating meaningful, efficient union types. ### Serialization -- [AutoDeconstructable](https://github.com/nemesissoft/Nemesis.TextParsers/tree/master/Nemesis.TextParsers.CodeGen/Deconstructable) -![stars](https://img.shields.io/github/stars/nemesissoft/Nemesis.TextParsers?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/nemesissoft/Nemesis.TextParsers?style=flat-square&cacheSeconds=86400) Generator for efficient and automatic flat text serializer/deserializer using [Deconstructable aspect](https://github.com/nemesissoft/Nemesis.TextParsers/blob/master/Specification.md#deconstructables) in [NTP](https://github.com/nemesissoft/Nemesis.TextParsers) library. -- [Azura](https://github.com/Lucina/Azura) -![stars](https://img.shields.io/github/stars/Lucina/Azura?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Lucina/Azura?style=flat-square&cacheSeconds=86400) Generates binary [de]serializers on Streams at design time. -- [Csv-CSharp](https://github.com/nuskey8/Csv-CSharp) - ![stars](https://img.shields.io/github/stars/nuskey8/Csv-CSharp?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/nuskey8/Csv-CSharp?style=flat-square&cacheSeconds=86400) - Csv-CSharp is a highly performant CSV (TSV) parser for .NET and Unity. It is designed to parse UTF-8 binaries directly and leverage Source Generators to enable serialization/deserialization between CSV (TSV) and object arrays with zero (or very low) allocation. +- [AutoDeconstructable](https://github.com/nemesissoft/Nemesis.TextParsers/tree/master/Nemesis.TextParsers.CodeGen/Deconstructable) - ![stars](https://img.shields.io/github/stars/nemesissoft/Nemesis.TextParsers?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/nemesissoft/Nemesis.TextParsers?style=flat-square&cacheSeconds=86400) Generator for efficient and automatic flat text serializer/deserializer using [Deconstructable aspect](https://github.com/nemesissoft/Nemesis.TextParsers/blob/master/Specification.md#deconstructables) in [NTP](https://github.com/nemesissoft/Nemesis.TextParsers) library. +- [Azura](https://github.com/Lucina/Azura) - ![stars](https://img.shields.io/github/stars/Lucina/Azura?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Lucina/Azura?style=flat-square&cacheSeconds=86400) Generates binary [de]serializers on Streams at design time. +- [Csv-CSharp](https://github.com/nuskey8/Csv-CSharp) - ![stars](https://img.shields.io/github/stars/nuskey8/Csv-CSharp?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/nuskey8/Csv-CSharp?style=flat-square&cacheSeconds=86400) Csv-CSharp is a highly performant CSV (TSV) parser for .NET and Unity. It is designed to parse UTF-8 binaries directly and leverage Source Generators to enable serialization/deserialization between CSV (TSV) and object arrays with zero (or very low) allocation. - [CSV-Parser-Generator](https://github.com/LokiMidgard/CSV-Parser-Generator) - ![stars](https://img.shields.io/github/stars/LokiMidgard/CSV-Parser-Generator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/LokiMidgard/CSV-Parser-Generator?style=flat-square&cacheSeconds=86400) A Parser for CSV with support for uncommon line separators (e.g. Unicode) and instantiation of read-only objects and working nullable handling. - [GenPack](https://github.com/dimohy/GenPack) - ![stars](https://img.shields.io/github/stars/dimohy/GenPack?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/dimohy/GenPack?style=flat-square&cacheSeconds=86400) is a library that uses the .NET source generator to automatically generate packets as classes once you define a schema for the packets. It's easy to use and the results are useful. -- [MemoryPack](https://github.com/REPO) - ![stars](https://img.shields.io/github/stars/Cysharp/MemoryPack?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Cysharp/MemoryPack?style=flat-square&cacheSeconds=86400) - Zero encoding extreme performance binary serializer for C# and Unity. -- [MessagePack for C#](https://github.com/MessagePack-CSharp/MessagePack-CSharp) - ![stars](https://img.shields.io/github/stars/MessagePack-CSharp/MessagePack-CSharp?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/MessagePack-CSharp/MessagePack-CSharp?style=flat-square&cacheSeconds=86400) - Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#] -- [ProtobufSourceGenerator](https://github.com/ladeak/ProtobufSourceGenerator) -![stars](https://img.shields.io/github/stars/ladeak/ProtobufSourceGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/ladeak/ProtobufSourceGenerator?style=flat-square&cacheSeconds=86400) - A source generator that generates partial helper classes where member properties are attributed with ProtoMember attribute. -- [protobuf-net](https://github.com/protobuf-net/protobuf-net) - ![stars](https://img.shields.io/github/stars/protobuf-net/protobuf-net?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/protobuf-net/protobuf-net?style=flat-square&cacheSeconds=86400) - protobuf-net is a contract based serializer for .NET code, that happens to write data in the "protocol buffers" serialization format engineered by Google. -- [SerdeDn (serde-sn)](https://github.com/agocke/serde-dn) -![stars](https://img.shields.io/github/stars/agocke/serde-dn?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/agocke/serde-dn?style=flat-square&cacheSeconds=86400) is a port of the popular [serde.rs](https://serde.rs/) Rust serialization/deserialization library to .NET. Basic cases are fully automated using a C# source generator. -- [SpreadCheetah](https://github.com/sveinungf/spreadcheetah) -![stars](https://img.shields.io/github/stars/sveinungf/spreadcheetah?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/sveinungf/spreadcheetah?style=flat-square&cacheSeconds=86400) Create Excel files with a C# Source Generator for generating the rows. -- [StackXML](https://github.com/ZingBallyhoo/StackXML) -![stars](https://img.shields.io/github/stars/ZingBallyhoo/StackXML?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/ZingBallyhoo/StackXML?style=flat-square&cacheSeconds=86400) Stack based zero-allocation XML serializer and deserializer. -- [StructPacker](https://github.com/RudolfKurka/StructPacker) -![stars](https://img.shields.io/github/stars/RudolfKurka/StructPacker?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/RudolfKurka/StructPacker?style=flat-square&cacheSeconds=86400) binary serializer that auto-generates C# serialization code to achieve peak runtime performance and efficiency. -- [Tinyhand](https://github.com/archi-Doc/Tinyhand) -![stars](https://img.shields.io/github/stars/archi-Doc/Tinyhand?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/archi-Doc/Tinyhand?style=flat-square&cacheSeconds=86400) - Tiny and simple data format/serializer using a source generator. -- [VYaml](https://github.com/hadashiA/VYaml) - ![stars](https://img.shields.io/github/stars/hadashiA/VYaml?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/hadashiA/VYaml?style=flat-square&cacheSeconds=86400) - VYaml is a pure C# YAML 1.2 implementation, which is extra fast, low memory footprint with focued on .NET and Unity. - -#### Json - -- [GeneratedJsonConverters](https://github.com/aviationexam/json-converter-source-generator) -![stars](https://img.shields.io/github/stars/aviationexam/json-converter-source-generator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/aviationexam/json-converter-source-generator?style=flat-square&cacheSeconds=86400) - generate json converters for polymorph contracts and string based enum serialization. -- [JsonByExampleGenerator](https://github.com/hermanussen/JsonByExampleGenerator) -![stars](https://img.shields.io/github/stars/hermanussen/JsonByExampleGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/hermanussen/JsonByExampleGenerator?style=flat-square&cacheSeconds=86400) - generate classes based on example json files in your project. -- [JsonDeserializeResourceSourceGenerator](https://github.com/musictopia2/JsonDeserializeResourceSourceGenerator) - ![stars](https://img.shields.io/github/stars/musictopia2/JsonDeserializeResourceSourceGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/musictopia2/JsonDeserializeResourceSourceGenerator?style=flat-square&cacheSeconds=86400) Instead of having to do embedded resource, can instead have json as additional file and it will produce a c# string and will deserialize to a type specified. -- [JsonPolymorphicGenerator](https://github.com/surgicalcoder/JsonPolymorphicGenerator) - ![stars](https://img.shields.io/github/stars/surgicalcoder/JsonPolymorphicGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/surgicalcoder/JsonPolymorphicGenerator?style=flat-square&cacheSeconds=86400) - Source Code Generator for System.Text.Json JsonDerivedType attributes on polymorphic classes -- [JsonSerializerContextGenerator](https://github.com/musictopia2/JsonSerializerContextGenerator) - ![stars](https://img.shields.io/github/stars/musictopia2/JsonSerializerContextGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/musictopia2/JsonSerializerContextGenerator?style=flat-square&cacheSeconds=86400) A source generator that produces nearly the same code as system.json.text but easier to use because you only have to put an attribute for a model class you want to produce for. Also, produces a method to register to make it easy to use that source generator when serializing/deserializing json. -- [JsonSrcGen](https://github.com/trampster/JsonSrcGen) -![stars](https://img.shields.io/github/stars/trampster/JsonSrcGen?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/trampster/JsonSrcGen?style=flat-square&cacheSeconds=86400) - compile time JSON serializer generation. +- [MemoryPack](https://github.com/Cysharp/MemoryPack) - ![stars](https://img.shields.io/github/stars/Cysharp/MemoryPack?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Cysharp/MemoryPack?style=flat-square&cacheSeconds=86400) Zero encoding extreme performance binary serializer for C# and Unity. +- [MessagePack for C#](https://github.com/MessagePack-CSharp/MessagePack-CSharp) - ![stars](https://img.shields.io/github/stars/MessagePack-CSharp/MessagePack-CSharp?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/MessagePack-CSharp/MessagePack-CSharp?style=flat-square&cacheSeconds=86400) Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#] +- [ProtobufSourceGenerator](https://github.com/ladeak/ProtobufSourceGenerator) - ![stars](https://img.shields.io/github/stars/ladeak/ProtobufSourceGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/ladeak/ProtobufSourceGenerator?style=flat-square&cacheSeconds=86400) A source generator that generates partial helper classes where member properties are attributed with ProtoMember attribute. +- [protobuf-net](https://github.com/protobuf-net/protobuf-net) - ![stars](https://img.shields.io/github/stars/protobuf-net/protobuf-net?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/protobuf-net/protobuf-net?style=flat-square&cacheSeconds=86400) protobuf-net is a contract based serializer for .NET code, that happens to write data in the "protocol buffers" serialization format engineered by Google. +- [SerdeDn (serde-sn)](https://github.com/agocke/serde-dn) - ![stars](https://img.shields.io/github/stars/agocke/serde-dn?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/agocke/serde-dn?style=flat-square&cacheSeconds=86400) is a port of the popular [serde.rs](https://serde.rs/) Rust serialization/deserialization library to .NET. Basic cases are fully automated using a C# source generator. +- [SpreadCheetah](https://github.com/sveinungf/spreadcheetah) - ![stars](https://img.shields.io/github/stars/sveinungf/spreadcheetah?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/sveinungf/spreadcheetah?style=flat-square&cacheSeconds=86400) Create Excel files with a C# Source Generator for generating the rows. +- [StackXML](https://github.com/ZingBallyhoo/StackXML) - ![stars](https://img.shields.io/github/stars/ZingBallyhoo/StackXML?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/ZingBallyhoo/StackXML?style=flat-square&cacheSeconds=86400) Stack based zero-allocation XML serializer and deserializer. +- [StructPacker](https://github.com/RudolfKurka/StructPacker) - ![stars](https://img.shields.io/github/stars/RudolfKurka/StructPacker?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/RudolfKurka/StructPacker?style=flat-square&cacheSeconds=86400) binary serializer that auto-generates C# serialization code to achieve peak runtime performance and efficiency. +- [Tinyhand](https://github.com/archi-Doc/Tinyhand) - ![stars](https://img.shields.io/github/stars/archi-Doc/Tinyhand?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/archi-Doc/Tinyhand?style=flat-square&cacheSeconds=86400) Tiny and simple data format/serializer using a source generator. +- [VYaml](https://github.com/hadashiA/VYaml) - ![stars](https://img.shields.io/github/stars/hadashiA/VYaml?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/hadashiA/VYaml?style=flat-square&cacheSeconds=86400) VYaml is a pure C# YAML 1.2 implementation, which is extra fast, low memory footprint with focued on .NET and Unity. + +### Json + +- [GeneratedJsonConverters](https://github.com/aviationexam/json-converter-source-generator) - ![stars](https://img.shields.io/github/stars/aviationexam/json-converter-source-generator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/aviationexam/json-converter-source-generator?style=flat-square&cacheSeconds=86400) generate json converters for polymorph contracts and string based enum serialization. +- [JsonByExampleGenerator](https://github.com/hermanussen/JsonByExampleGenerator) - ![stars](https://img.shields.io/github/stars/hermanussen/JsonByExampleGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/hermanussen/JsonByExampleGenerator?style=flat-square&cacheSeconds=86400) generate classes based on example json files in your project. +- [JsonDeserializeResourceSourceGenerator](https://github.com/musictopia2/JsonDeserializeResourceSourceGenerator) - ![stars](https://img.shields.io/github/stars/musictopia2/JsonDeserializeResourceSourceGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/musictopia2/JsonDeserializeResourceSourceGenerator?style=flat-square&cacheSeconds=86400) Instead of having to do embedded resource, can instead have json as additional file and it will produce a c# string and will deserialize to a type specified. +- [JsonPolymorphicGenerator](https://github.com/surgicalcoder/JsonPolymorphicGenerator) - ![stars](https://img.shields.io/github/stars/surgicalcoder/JsonPolymorphicGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/surgicalcoder/JsonPolymorphicGenerator?style=flat-square&cacheSeconds=86400) Source Code Generator for System.Text.Json JsonDerivedType attributes on polymorphic classes +- [JsonSerializerContextGenerator](https://github.com/musictopia2/JsonSerializerContextGenerator) - ![stars](https://img.shields.io/github/stars/musictopia2/JsonSerializerContextGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/musictopia2/JsonSerializerContextGenerator?style=flat-square&cacheSeconds=86400) A source generator that produces nearly the same code as system.json.text but easier to use because you only have to put an attribute for a model class you want to produce for. Also, produces a method to register to make it easy to use that source generator when serializing/deserializing json. +- [JsonSrcGen](https://github.com/trampster/JsonSrcGen) - ![stars](https://img.shields.io/github/stars/trampster/JsonSrcGen?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/trampster/JsonSrcGen?style=flat-square&cacheSeconds=86400) compile time JSON serializer generation. - [TeuJson](https://github.com/Terria-K/TeuJson) - ![stars](https://img.shields.io/github/stars/Terria-K/TeuJson?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Terria-K/TeuJson?style=flat-square&cacheSeconds=86400) A Reflection-less and Lightweight Json Library using source generator. ### Validation -- [EasyValidate](https://easy-validate.netlify.app) -![stars](https://img.shields.io/github/stars/mu-dawood/EasyValidate?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/mu-dawood/EasyValidate?style=flat-square&cacheSeconds=86400) - High-performance, type-safe .NET source generator that uses attributes to automatically generate validation for properties, fields, and method parameters. Easy Validate supports async validation, integrates with dependency injection, and includes rich analyzers and code fixers for a seamless developer experience. -- [Validly](https://github.com/Hookyns/validly) -![stars](https://img.shields.io/github/stars/Hookyns/validly?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Hookyns/validly?style=flat-square&cacheSeconds=86400) - A performant, zero-allocation, and highly customizable validation library that generates validation logic based on attributes, with usage similar to DataAnnotations. + +- [EasyValidate](https://github.com/mu-dawood/EasyValidate) - ![stars](https://img.shields.io/github/stars/mu-dawood/EasyValidate?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/mu-dawood/EasyValidate?style=flat-square&cacheSeconds=86400) High-performance, type-safe .NET source generator that uses attributes to automatically generate validation for properties, fields, and method parameters. Easy Validate supports async validation, integrates with dependency injection, and includes rich analyzers and code fixers for a seamless developer experience. +- [Validly](https://github.com/Hookyns/validly) - ![stars](https://img.shields.io/github/stars/Hookyns/validly?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Hookyns/validly?style=flat-square&cacheSeconds=86400) A performant, zero-allocation, and highly customizable validation library that generates validation logic based on attributes, with usage similar to DataAnnotations. ### Localization -- [kli.Localize](https://github.com/kl1mm/localize) - ![stars](https://img.shields.io/github/stars/kl1mm/localize?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/kl1mm/localize?style=flat-square&cacheSeconds=86400) - localize strings from json files via source code generation +- [kli.Localize](https://github.com/kl1mm/localize) - ![stars](https://img.shields.io/github/stars/kl1mm/localize?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/kl1mm/localize?style=flat-square&cacheSeconds=86400) localize strings from json files via source code generation - [MrMeeseeks.ResXToViewModelGenerator](https://github.com/Yeah69/MrMeeseeks.ResXToViewModelGenerator) - ![stars](https://img.shields.io/github/stars/Yeah69/MrMeeseeks.ResXToViewModelGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Yeah69/MrMeeseeks.ResXToViewModelGenerator?style=flat-square&cacheSeconds=86400) Takes ResX files and generates localization ViewModels for a more convenient usage of localization in MVVM projects. -- [ResXGenerator](https://github.com/ycanardeau/ResXGenerator) -![stars](https://img.shields.io/github/stars/ycanardeau/ResXGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/ycanardeau/ResXGenerator?style=flat-square&cacheSeconds=86400) Generates strongly-typed resource classes for looking up localized strings. +- [ResXGenerator](https://github.com/ycanardeau/ResXGenerator) - ![stars](https://img.shields.io/github/stars/ycanardeau/ResXGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/ycanardeau/ResXGenerator?style=flat-square&cacheSeconds=86400) Generates strongly-typed resource classes for looking up localized strings. ### Testing -- [Buildenator](https://github.com/progala2/Buildenator) -![stars](https://img.shields.io/github/stars/progala2/Buildenator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/progala2/Buildenator?style=flat-square&cacheSeconds=86400) Generate data builder classes for testing purposes (and not only) for your entities. Autofixture + Moq extensions. -- [FluentAssertions.Eventual](https://github.com/mazharenko/FluentAssertions.Eventual) - ![stars](https://img.shields.io/github/stars/mazharenko/FluentAssertions.Eventual?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/mazharenko/FluentAssertions.Eventual?style=flat-square&cacheSeconds=86400) - Generates a specialized waiting wrapper for `FluentAssertions` assertions, offering a syntax similar to plain `FluentAssertions`. -- [ScenarioTests](https://github.com/koenbeuk/ScenarioTests) -![stars](https://img.shields.io/github/stars/koenbeuk/ScenarioTests?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/koenbeuk/ScenarioTests?style=flat-square&cacheSeconds=86400) Test your code like you would write a notebook. Simply and effective +- [Buildenator](https://github.com/progala2/Buildenator) - ![stars](https://img.shields.io/github/stars/progala2/Buildenator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/progala2/Buildenator?style=flat-square&cacheSeconds=86400) Generate data builder classes for testing purposes (and not only) for your entities. Autofixture + Moq extensions. +- [FluentAssertions.Eventual](https://github.com/mazharenko/FluentAssertions.Eventual) - ![stars](https://img.shields.io/github/stars/mazharenko/FluentAssertions.Eventual?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/mazharenko/FluentAssertions.Eventual?style=flat-square&cacheSeconds=86400) Generates a specialized waiting wrapper for `FluentAssertions` assertions, offering a syntax similar to plain `FluentAssertions`. +- [ScenarioTests](https://github.com/koenbeuk/ScenarioTests) - ![stars](https://img.shields.io/github/stars/koenbeuk/ScenarioTests?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/koenbeuk/ScenarioTests?style=flat-square&cacheSeconds=86400) Test your code like you would write a notebook. Simply and effective -#### Mocking +### Mocking -- [GRPC-Mock-Server](https://github.com/cezarypiatek/GRPC-Mock-Server) -![stars](https://img.shields.io/github/stars/cezarypiatek/GRPC-Mock-Server?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/cezarypiatek/GRPC-Mock-Server?style=flat-square&cacheSeconds=86400) - A source generator for stubbing GRPC services. -- [InterfaceGenerator](https://github.com/daver32/InterfaceGenerator) - ![stars](https://img.shields.io/github/stars/daver32/InterfaceGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/daver32/InterfaceGenerator?style=flat-square&cacheSeconds=86400) - Auto generate interface definition by implementation, for when you need an abstraction for the sake of mocking. +- [GRPC-Mock-Server](https://github.com/cezarypiatek/GRPC-Mock-Server) - ![stars](https://img.shields.io/github/stars/cezarypiatek/GRPC-Mock-Server?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/cezarypiatek/GRPC-Mock-Server?style=flat-square&cacheSeconds=86400) A source generator for stubbing GRPC services. +- [InterfaceGenerator](https://github.com/daver32/InterfaceGenerator) - ![stars](https://img.shields.io/github/stars/daver32/InterfaceGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/daver32/InterfaceGenerator?style=flat-square&cacheSeconds=86400) Auto generate interface definition by implementation, for when you need an abstraction for the sake of mocking. - [MockableStaticGenerator](https://github.com/HamedFathi/MockableStaticGenerator) - ![stars](https://img.shields.io/github/stars/HamedFathi/MockableStaticGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/HamedFathi/MockableStaticGenerator?style=flat-square&cacheSeconds=86400) A C# source generator to make an interface and a class wrapper to test static/extension methods. - [MockGen](https://github.com/thomas-girotto/MockGen) - ![stars](https://img.shields.io/github/stars/thomas-girotto/MockGen?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/thomas-girotto/MockGen?style=flat-square&cacheSeconds=86400) A C# mocking library based on source generators. - [MockSourceGenerator](https://github.com/hermanussen/MockSourceGenerator) - ![stars](https://img.shields.io/github/stars/hermanussen/MockSourceGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/hermanussen/MockSourceGenerator?style=flat-square&cacheSeconds=86400) A C# mocking library that generates mocks at compile-time using a source generator. -- [ProxyInterfaceGenerator](https://github.com/StefH/ProxyInterfaceSourceGenerator) -![stars](https://img.shields.io/github/stars/StefH/ProxyInterfaceSourceGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/StefH/ProxyInterfaceSourceGenerator?style=flat-square&cacheSeconds=86400) generate an interface and a Proxy class for classes. This makes it possible to wrap external classes which do not have an interface, in a Proxy class which makes it easier to Mock and use DI. +- [ProxyInterfaceGenerator](https://github.com/StefH/ProxyInterfaceSourceGenerator) - ![stars](https://img.shields.io/github/stars/StefH/ProxyInterfaceSourceGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/StefH/ProxyInterfaceSourceGenerator?style=flat-square&cacheSeconds=86400) generate an interface and a Proxy class for classes. This makes it possible to wrap external classes which do not have an interface, in a Proxy class which makes it easier to Mock and use DI. - [Rocks](https://github.com/JasonBock/Rocks) - ![stars](https://img.shields.io/github/stars/JasonBock/Rocks?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/JasonBock/Rocks?style=flat-square&cacheSeconds=86400) A mocking library based on the Compiler APIs (Roslyn + Mocks). ### Patterns - [ActorSrcGen](https://github.com/aabs/ActorSrcGen) - ![stars](https://img.shields.io/github/stars/aabs/ActorSrcGen?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/aabs/ActorSrcGen?style=flat-square&cacheSeconds=86400) Generates boilerplate to turn simple C# classes into TPL Dataflow compatible pipelines with robust and performant asynchronous and concurrent code. -- [InlineComposition](https://github.com/BlackWhiteYoshi/InlineComposition) -![stars](https://img.shields.io/github/stars/BlackWhiteYoshi/InlineComposition?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/BlackWhiteYoshi/InlineComposition?style=flat-square&cacheSeconds=86400) A source generator that merges the content of other classes into one class. A simple workaround for struct inheritance or multiple inheritance. -- [JinShil.MixinSourceGenerator](https://github.com/JinShil/JinShil.MixinSourceGenerator) - ![stars](https://img.shields.io/github/stars/JinShil/JinShil.MixinSourceGenerator?style=flat-square&cacheSeconds=86400) ![last commit](https://img.shields.io/github/last-commit/JinShil/JinShil.MixinSourceGenerator?style=flat-square&cacheSeconds=86400) A simple, but powerful source generator that implements the mixin design pattern by copying members—along with their attributes and XML documentation comments—verbatim from one or more source classes/structs into anaother, forming a composition of said classes/structs. +- [InlineComposition](https://github.com/BlackWhiteYoshi/InlineComposition) - ![stars](https://img.shields.io/github/stars/BlackWhiteYoshi/InlineComposition?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/BlackWhiteYoshi/InlineComposition?style=flat-square&cacheSeconds=86400) A source generator that merges the content of other classes into one class. A simple workaround for struct inheritance or multiple inheritance. +- [JinShil.MixinSourceGenerator](https://github.com/JinShil/JinShil.MixinSourceGenerator) - ![stars](https://img.shields.io/github/stars/JinShil/JinShil.MixinSourceGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/JinShil/JinShil.MixinSourceGenerator?style=flat-square&cacheSeconds=86400) A simple, but powerful source generator that implements the mixin design pattern by copying members—along with their attributes and XML documentation comments—verbatim from one or more source classes/structs into anaother, forming a composition of said classes/structs. - [Lombok.NET](https://github.com/CollinAlpert/Lombok.NET) - ![stars](https://img.shields.io/github/stars/CollinAlpert/Lombok.NET?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/CollinAlpert/Lombok.NET?style=flat-square&cacheSeconds=86400) Generates boilerplate code and common code patterns. As the name suggests, it is the .NET version of Java's Lombok. -- [Minerals.AutoMixins](https://github.com/SzymonHalucha/Minerals.AutoMixins) - ![stars](https://img.shields.io/github/stars/SzymonHalucha/Minerals.AutoMixins?style=flat-square&cacheSeconds=86400) ![last commit](https://img.shields.io/github/last-commit/SzymonHalucha/Minerals.AutoMixins?style=flat-square&cacheSeconds=86400) Package for automatic mixin design pattern generation using an incremental source generator. -- [Minerals.AutoCQRS](https://github.com/SzymonHalucha/Minerals.AutoCQRS) - ![stars](https://img.shields.io/github/stars/SzymonHalucha/Minerals.AutoCQRS?style=flat-square&cacheSeconds=86400) ![last commit](https://img.shields.io/github/last-commit/SzymonHalucha/Minerals.AutoCQRS?style=flat-square&cacheSeconds=86400) NuGet package that provides interfaces for implementing the CQRS pattern (Commands, Queries, and Pipelines) along with automatic dependency injection and no MediatR package overhead. +- [Minerals.AutoMixins](https://github.com/SzymonHalucha/Minerals.AutoMixins) - ![stars](https://img.shields.io/github/stars/SzymonHalucha/Minerals.AutoMixins?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/SzymonHalucha/Minerals.AutoMixins?style=flat-square&cacheSeconds=86400) Package for automatic mixin design pattern generation using an incremental source generator. +- [Minerals.AutoCQRS](https://github.com/SzymonHalucha/Minerals.AutoCQRS) - ![stars](https://img.shields.io/github/stars/SzymonHalucha/Minerals.AutoCQRS?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/SzymonHalucha/Minerals.AutoCQRS?style=flat-square&cacheSeconds=86400) NuGet package that provides interfaces for implementing the CQRS pattern (Commands, Queries, and Pipelines) along with automatic dependency injection and no MediatR package overhead. -#### Mediator +### Mediator -- [DumplingsDevs.Pipelines](https://github.com/DumplingsDevs/Pipelines) - ![stars](https://img.shields.io/github/stars/DumplingsDevs/Pipelines?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/DumplingsDevs/Pipelines?style=flat-square&cacheSeconds=604800) The most flexible mediation implementation in the .NET ecosystem with your own types. -- [Foundatio Mediator](https://github.com/FoundatioFx/Foundatio.Mediator) -![stars](https://img.shields.io/github/stars/FoundatioFx/Foundatio.Mediator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/FoundatioFx/Foundatio.Mediator?style=flat-square&cacheSeconds=86400) - Blazingly fast, convention-based C# mediator powered by source generators and interceptors. -- [Immediate.Handlers](https://github.com/immediateplatform/Immediate.Handlers) -![stars](https://img.shields.io/github/stars/immediateplatform/Immediate.Handlers?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/immediateplatform/Immediate.Handlers?style=flat-square&cacheSeconds=86400) An implementation of the Mediator pattern in .NET using source generators, without using a central mediator instance. -- [Mediator](https://github.com/martinothamar/Mediator) -![stars](https://img.shields.io/github/stars/martinothamar/Mediator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/martinothamar/Mediator?style=flat-square&cacheSeconds=86400) - a high performance implementation of Mediator pattern in .NET using source generators. -- [MediatR controllers generator](https://github.com/Burgyn/MMLib.MediatR.Generators) -![stars](https://img.shields.io/github/stars/Burgyn/MMLib.MediatR.Generators?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Burgyn/MMLib.MediatR.Generators?style=flat-square&cacheSeconds=86400) This generator generates controllers and their methods based on your [MediatR](https://github.com/jbogard/MediatR) requests. +- [DumplingsDevs.Pipelines](https://github.com/DumplingsDevs/Pipelines) - ![stars](https://img.shields.io/github/stars/DumplingsDevs/Pipelines?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/DumplingsDevs/Pipelines?style=flat-square&cacheSeconds=86400) The most flexible mediation implementation in the .NET ecosystem with your own types. +- [Foundatio Mediator](https://github.com/FoundatioFx/Foundatio.Mediator) - ![stars](https://img.shields.io/github/stars/FoundatioFx/Foundatio.Mediator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/FoundatioFx/Foundatio.Mediator?style=flat-square&cacheSeconds=86400) Blazingly fast, convention-based C# mediator powered by source generators and interceptors. +- [Immediate.Handlers](https://github.com/immediateplatform/Immediate.Handlers) - ![stars](https://img.shields.io/github/stars/immediateplatform/Immediate.Handlers?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/immediateplatform/Immediate.Handlers?style=flat-square&cacheSeconds=86400) An implementation of the Mediator pattern in .NET using source generators, without using a central mediator instance. +- [Mediator](https://github.com/martinothamar/Mediator) - ![stars](https://img.shields.io/github/stars/martinothamar/Mediator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/martinothamar/Mediator?style=flat-square&cacheSeconds=86400) a high performance implementation of Mediator pattern in .NET using source generators. +- [MediatR controllers generator](https://github.com/Burgyn/MMLib.MediatR.Generators) - ![stars](https://img.shields.io/github/stars/Burgyn/MMLib.MediatR.Generators?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Burgyn/MMLib.MediatR.Generators?style=flat-square&cacheSeconds=86400) This generator generates controllers and their methods based on your [MediatR](https://github.com/jbogard/MediatR) requests. -#### Command +### Command -- [Plastic](https://github.com/sang-hyeon/Plastic) -![stars](https://img.shields.io/github/stars/sang-hyeon/Plastic?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/sang-hyeon/Plastic?style=flat-square&cacheSeconds=86400) This project provides encapsulation of things like Domain, Application Rules, Business Rules or Business Logic in Application. +- [Plastic](https://github.com/sang-hyeon/Plastic) - ![stars](https://img.shields.io/github/stars/sang-hyeon/Plastic?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/sang-hyeon/Plastic?style=flat-square&cacheSeconds=86400) This project provides encapsulation of things like Domain, Application Rules, Business Rules or Business Logic in Application. -#### Builder +### Builder -- [Data Builder Generator](https://github.com/dasMulli/data-builder-generator) -![stars](https://img.shields.io/github/stars/dasMulli/data-builder-generator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/dasMulli/data-builder-generator?style=flat-square&cacheSeconds=86400) Generate data builder patterns for your model classes. -- [FluentBuilder](https://github.com/StefH/FluentBuilder) - ![stars](https://img.shields.io/github/stars/StefH/FluentBuilder?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/StefH/FluentBuilder?style=flat-square&cacheSeconds=86400) - A project which uses Source Generation to create a FluentBuilder for a specified model or DTO. -- [M31.FluentAPI](https://github.com/m31coding/M31.FluentAPI) - ![stars](https://img.shields.io/github/stars/m31coding/M31.FluentAPI?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/m31coding/M31.FluentAPI?style=flat-square&cacheSeconds=86400) - Generate fluent APIs for your C# classes with ease. -- [StepwiseBuilderGenerator](https://github.com/Georgiy-Petrov/StepwiseBuilderGenerator) - ![stars](https://img.shields.io/github/stars/Georgiy-Petrov/StepwiseBuilderGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Georgiy-Petrov/StepwiseBuilderGenerator?style=flat-square&cacheSeconds=86400) - Generate stepwise (fluent) builders effortlessly. +- [Data Builder Generator](https://github.com/dasMulli/data-builder-generator) - ![stars](https://img.shields.io/github/stars/dasMulli/data-builder-generator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/dasMulli/data-builder-generator?style=flat-square&cacheSeconds=86400) Generate data builder patterns for your model classes. +- [FluentBuilder](https://github.com/StefH/FluentBuilder) - ![stars](https://img.shields.io/github/stars/StefH/FluentBuilder?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/StefH/FluentBuilder?style=flat-square&cacheSeconds=86400) A project which uses Source Generation to create a FluentBuilder for a specified model or DTO. +- [M31.FluentAPI](https://github.com/m31coding/M31.FluentAPI) - ![stars](https://img.shields.io/github/stars/m31coding/M31.FluentAPI?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/m31coding/M31.FluentAPI?style=flat-square&cacheSeconds=86400) Generate fluent APIs for your C# classes with ease. +- [StepwiseBuilderGenerator](https://github.com/Georgiy-Petrov/StepwiseBuilderGenerator) - ![stars](https://img.shields.io/github/stars/Georgiy-Petrov/StepwiseBuilderGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Georgiy-Petrov/StepwiseBuilderGenerator?style=flat-square&cacheSeconds=86400) Generate stepwise (fluent) builders effortlessly. -#### Proxy +### Proxy -- [avatar](https://github.com/kzu/avatar) -![stars](https://img.shields.io/github/stars/kzu/avatar?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/kzu/avatar?style=flat-square&cacheSeconds=86400) A modern compile-time generated interception/proxy library. -- [DudNet](https://github.com/jwshyns/DudNet) - ![stars](https://img.shields.io/github/stars/jwshyns/dudnet?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/jwshyns/dudnet?style=flat-square&cacheSeconds=604800) A C# source generator for implementing a proxy pattern. +- [avatar](https://github.com/kzu/avatar) - ![stars](https://img.shields.io/github/stars/kzu/avatar?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/kzu/avatar?style=flat-square&cacheSeconds=86400) A modern compile-time generated interception/proxy library. +- [DudNet](https://github.com/jwshyns/DudNet) - ![stars](https://img.shields.io/github/stars/jwshyns/DudNet?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/jwshyns/DudNet?style=flat-square&cacheSeconds=86400) A C# source generator for implementing a proxy pattern. -#### Visitor +### Visitor - [MrMeeseeks.Visitor](https://github.com/Yeah69/MrMeeseeks.Visitor) - ![stars](https://img.shields.io/github/stars/Yeah69/MrMeeseeks.Visitor?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Yeah69/MrMeeseeks.Visitor?style=flat-square&cacheSeconds=86400) Generates the boilerplate code for applications of the Visitor pattern. -- [Visitor.NET](https://github.com/Stepami/visitor-net) - ![stars](https://img.shields.io/github/stars/Stepami/visitor-net?style=flat-square) ![last commit](https://img.shields.io/github/last-commit/Stepami/visitor-net?style=flat-square) First-ever acyclic generic extensible typesafe implementation of Visitor pattern for .NET without any usage of dynamic cast. Implementation powered by Source Generators +- [Visitor.NET](https://github.com/Stepami/visitor-net) - ![stars](https://img.shields.io/github/stars/Stepami/visitor-net?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Stepami/visitor-net?style=flat-square&cacheSeconds=86400) First-ever acyclic generic extensible typesafe implementation of Visitor pattern for .NET without any usage of dynamic cast. Implementation powered by Source Generators + +### Adapter -#### Adapter +- [AutoInterface](https://github.com/beakona/AutoInterface) - ![stars](https://img.shields.io/github/stars/beakona/AutoInterface?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/beakona/AutoInterface?style=flat-square&cacheSeconds=86400) interface-to-member source generator. +- [Minerals.AutoInterfaces](https://github.com/SzymonHalucha/Minerals.AutoInterfaces) - ![stars](https://img.shields.io/github/stars/SzymonHalucha/Minerals.AutoInterfaces?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/SzymonHalucha/Minerals.AutoInterfaces?style=flat-square&cacheSeconds=86400) Package for automatic interface generation using an incremental source generator. -- [AutoInterface](https://github.com/beakona/AutoInterface) -![stars](https://img.shields.io/github/stars/beakona/AutoInterface?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/beakona/AutoInterface?style=flat-square&cacheSeconds=86400) interface-to-member source generator. -- [Minerals.AutoInterfaces](https://github.com/SzymonHalucha/Minerals.AutoInterfaces) - ![stars](https://img.shields.io/github/stars/SzymonHalucha/Minerals.AutoInterfaces?style=flat-square&cacheSeconds=86400) ![last commit](https://img.shields.io/github/last-commit/SzymonHalucha/Minerals.AutoInterfaces?style=flat-square&cacheSeconds=86400) Package for automatic interface generation using an incremental source generator. +### Fluent API -#### Fluent API - [SuperFluid](https://github.com/hughesjs/SuperFluid) - ![stars](https://img.shields.io/github/stars/hughesjs/SuperFluid?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/hughesjs/SuperFluid?style=flat-square&cacheSeconds=86400) Generates the interfaces to represent a fluent API with grammar ### Domain Driven Design (DDD) -- [AltaSoft.DomainPrimitives](https://github.com/altasoft/DomainPrimitives) - ![stars](https://img.shields.io/github/stars/altasoft/DomainPrimitives?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/altasoft/DomainPrimitives?style=flat-square&cacheSeconds=86400) - A C# toolkit purposefully designed to accelerate the development of domain-specific primitives within your applications. This streamlined solution empowers developers to efficiently encapsulate fundamental domain logic. Through this toolkit, you'll significantly reduce code complexity while improving the maintainability of your project. +- [AltaSoft.DomainPrimitives](https://github.com/altasoft/DomainPrimitives) - ![stars](https://img.shields.io/github/stars/altasoft/DomainPrimitives?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/altasoft/DomainPrimitives?style=flat-square&cacheSeconds=86400) A C# toolkit purposefully designed to accelerate the development of domain-specific primitives within your applications. This streamlined solution empowers developers to efficiently encapsulate fundamental domain logic. Through this toolkit, you'll significantly reduce code complexity while improving the maintainability of your project. - [Architect.DomainModeling](https://github.com/TheArchitectDev/Architect.DomainModeling) - ![stars](https://img.shields.io/github/stars/TheArchitectDev/Architect.DomainModeling?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/TheArchitectDev/Architect.DomainModeling?style=flat-square&cacheSeconds=86400) A complete Domain-Driven Design (DDD) toolset for implementing domain models, including base types and source generators for ValueObjects, WrapperValueObjects, Entities, and Identities. -- [Minerals.AutoDomain](https://github.com/SzymonHalucha/Minerals.AutoDomain) - ![stars](https://img.shields.io/github/stars/SzymonHalucha/Minerals.AutoDomain?style=flat-square&cacheSeconds=86400) ![last commit](https://img.shields.io/github/last-commit/SzymonHalucha/Minerals.AutoDomain?style=flat-square&cacheSeconds=86400) This package provides a fast method of defining domain layer components with their specific implementation, such as aggregates, entities and domain events. Package has built-in strongly typed IDs. +- [Minerals.AutoDomain](https://github.com/SzymonHalucha/Minerals.AutoDomain) - ![stars](https://img.shields.io/github/stars/SzymonHalucha/Minerals.AutoDomain?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/SzymonHalucha/Minerals.AutoDomain?style=flat-square&cacheSeconds=86400) This package provides a fast method of defining domain layer components with their specific implementation, such as aggregates, entities and domain events. Package has built-in strongly typed IDs. ### Metaprogramming -- [GenerateHelperLibraries](https://github.com/musictopia2/GenerateHelperLibraries) - ![stars](https://img.shields.io/github/stars/musictopia2/GenerateHelperLibraries?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/musictopia2/GenerateHelperLibraries?style=flat-square&cacheSeconds=86400) A source generator where you can send any code to the client without having to do as a string. Helper for custom classes a client has to override in order to have additional features for source generators. Intended to be used from another source generator. -- [Gobie](https://github.com/GobieGenerator/Gobie) -![stars](https://img.shields.io/github/stars/GobieGenerator/Gobie?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/GobieGenerator/Gobie?style=flat-square&cacheSeconds=86400) - Allows developers define and use custom source generation without writing any generator code themselves or learning the Roslyn APIs. Instead, devs define the generator they want, in C#, and can then use that generator throughout their project. +- [GenerateHelperLibraries](https://github.com/musictopia2/GenerateHelperLibraries) - ![stars](https://img.shields.io/github/stars/musictopia2/GenerateHelperLibraries?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/musictopia2/GenerateHelperLibraries?style=flat-square&cacheSeconds=86400) A source generator where you can send any code to the client without having to do as a string. Helper for custom classes a client has to override in order to have additional features for source generators. Intended to be used from another source generator. +- [Gobie](https://github.com/GobieGenerator/Gobie) - ![stars](https://img.shields.io/github/stars/GobieGenerator/Gobie?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/GobieGenerator/Gobie?style=flat-square&cacheSeconds=86400) Allows developers define and use custom source generation without writing any generator code themselves or learning the Roslyn APIs. Instead, devs define the generator they want, in C#, and can then use that generator throughout their project. - [Matryoshki](https://github.com/krasin-ga/matryoshki) - ![stars](https://img.shields.io/github/stars/krasin-ga/matryoshki?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/krasin-ga/matryoshki?style=flat-square&cacheSeconds=86400) Metaprogramming framework based on C# source generators. It allows you to define behaviours with adornments and generate decorators for arbitrary types. -- [SourceGeneratorQuery](https://github.com/roeibajayo/SourceGeneratorQuery) - ![stars](https://img.shields.io/github/stars/roeibajayo/SourceGeneratorQuery?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/roeibajayo/SourceGeneratorQuery?style=flat-square&cacheSeconds=86400) - C# SourceGenerator helper which helps you query your files, and adds LINQ support. +- [SourceGeneratorQuery](https://github.com/roeibajayo/SourceGeneratorQuery) - ![stars](https://img.shields.io/github/stars/roeibajayo/SourceGeneratorQuery?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/roeibajayo/SourceGeneratorQuery?style=flat-square&cacheSeconds=86400) C# SourceGenerator helper which helps you query your files, and adds LINQ support. ### Webprogramming -- [AjaxService.Gen](https://github.com/MrAliSalehi/AjaxService) - ![stars](https://img.shields.io/github/stars/MrAliSalehi/AjaxService?style=flat-square) ![last commit](https://img.shields.io/github/last-commit/MrAliSalehi/AjaxService?style=flat-square&cacheSeconds=86400) - Automatically Generate typescript Ajax calls based on your C# Api endpoints. +- [AjaxService.Gen](https://github.com/MrAliSalehi/AjaxService) - ![stars](https://img.shields.io/github/stars/MrAliSalehi/AjaxService?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/MrAliSalehi/AjaxService?style=flat-square&cacheSeconds=86400) Automatically Generate typescript Ajax calls based on your C# Api endpoints. - [ApiClientGenerator](https://github.com/surgicalcoder/ApiClientGenerator) - ![stars](https://img.shields.io/github/stars/surgicalcoder/ApiClientGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/surgicalcoder/ApiClientGenerator?style=flat-square&cacheSeconds=86400) Generates a strongly typed HttpClient based off MVC's default routing. Can be used to output into multiple projects, like Blazor WebAssembly. -- [ControllerGenerator](https://github.com/cloud0259/ControllerGenerator) -![stars](https://img.shields.io/github/stars/cloud0259/ControllerGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/cloud0259/ControllerGenerator?style=flat-square&cacheSeconds=86400) Automatically generate controllers from services in a web application -- [HttpClientCodeGenerator](https://github.com/Jalalx/HttpClientCodeGenerator) -![stars](https://img.shields.io/github/stars/jalalx/HttpClientCodeGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/jalalx/HttpClientCodeGenerator?style=flat-square&cacheSeconds=86400) - HttpClientGenerator is a tool that uses the Roslyn code generator feature to write boilerplate HttpClient code for you. -- [Immediate.Apis](https://github.com/immediateplatform/immediate.apis) - ![stars](https://img.shields.io/github/stars/immediateplatform/immediate.apis?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/immediateplatform/immediate.apis?style=flat-square&cacheSeconds=86400) - Generates minimal APIs bindings for [Immediate.Handlers](https://github.com/immediateplatform/immediate.handlers) handlers. -- [Ridge](https://github.com/Melchy/Ridge) -![stars](https://img.shields.io/github/stars/Melchy/Ridge?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Melchy/Ridge?style=flat-square&cacheSeconds=86400) Generates strongly-typed clients for API based on controller definition and internal application details. -- [Safe-Routing](https://github.com/daviddotcs/safe-routing) -![stars](https://img.shields.io/github/stars/daviddotcs/safe-routing?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/daviddotcs/safe-routing?style=flat-square&cacheSeconds=86400) Analyses a project's razor pages and MVC controllers, producing strongly-typed representations of those routes as you type -- [TypedSignalR.Client](https://github.com/nenoNaninu/TypedSignalR.Client) -![stars](https://img.shields.io/github/stars/nenoNaninu/TypedSignalR.Client?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/nenoNaninu/TypedSignalR.Client?style=flat-square&cacheSeconds=86400) C# Source Generator to create strongly typed SignalR clients. +- [ControllerGenerator](https://github.com/cloud0259/ControllerGenerator) - ![stars](https://img.shields.io/github/stars/cloud0259/ControllerGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/cloud0259/ControllerGenerator?style=flat-square&cacheSeconds=86400) Automatically generate controllers from services in a web application +- [HttpClientCodeGenerator](https://github.com/Jalalx/HttpClientCodeGenerator) - ![stars](https://img.shields.io/github/stars/Jalalx/HttpClientCodeGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Jalalx/HttpClientCodeGenerator?style=flat-square&cacheSeconds=86400) HttpClientGenerator is a tool that uses the Roslyn code generator feature to write boilerplate HttpClient code for you. +- [Immediate.Apis](https://github.com/immediateplatform/immediate.apis) - ![stars](https://img.shields.io/github/stars/immediateplatform/immediate.apis?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/immediateplatform/immediate.apis?style=flat-square&cacheSeconds=86400) Generates minimal APIs bindings for [Immediate.Handlers](https://github.com/immediateplatform/immediate.handlers) handlers. +- [Ridge](https://github.com/Melchy/Ridge) - ![stars](https://img.shields.io/github/stars/Melchy/Ridge?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Melchy/Ridge?style=flat-square&cacheSeconds=86400) Generates strongly-typed clients for API based on controller definition and internal application details. +- [Safe-Routing](https://github.com/daviddotcs/safe-routing) - ![stars](https://img.shields.io/github/stars/daviddotcs/safe-routing?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/daviddotcs/safe-routing?style=flat-square&cacheSeconds=86400) Analyses a project's razor pages and MVC controllers, producing strongly-typed representations of those routes as you type +- [TypedSignalR.Client](https://github.com/nenoNaninu/TypedSignalR.Client) - ![stars](https://img.shields.io/github/stars/nenoNaninu/TypedSignalR.Client?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/nenoNaninu/TypedSignalR.Client?style=flat-square&cacheSeconds=86400) C# Source Generator to create strongly typed SignalR clients. -#### Open Api +### Open Api -- [H.NSwag.Generator](https://github.com/HavenDV/H.NSwag.Generator) -![stars](https://img.shields.io/github/stars/HavenDV/H.NSwag.Generator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/HavenDV/H.NSwag.Generator?style=flat-square&cacheSeconds=86400) - C# Source Generator for NSwag. -- [SourceApi](https://github.com/alekshura/SourceApi) - ![stars](https://img.shields.io/github/stars/alekshura/SourceApi?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/alekshura/SourceApi?style=flat-square&cacheSeconds=86400) - API first Open API code generator based on json or yaml definitions. It generates base abstract controllers with docs, routes, that you inherit and implement in your controllers. -- [ST.NSwag.ServerSourceGenerator](https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator) -![stars](https://img.shields.io/github/stars/s-tarasov/ST.NSwag.ServerSourceGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/s-tarasov/ST.NSwag.ServerSourceGenerator?style=flat-square&cacheSeconds=86400) Generates Web API/ASP.NET Core controllers from a OpenAPI specification. +- [H.NSwag.Generator](https://github.com/HavenDV/H.NSwag.Generator) - ![stars](https://img.shields.io/github/stars/HavenDV/H.NSwag.Generator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/HavenDV/H.NSwag.Generator?style=flat-square&cacheSeconds=86400) C# Source Generator for NSwag. +- [SourceApi](https://github.com/alekshura/SourceApi) - ![stars](https://img.shields.io/github/stars/alekshura/SourceApi?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/alekshura/SourceApi?style=flat-square&cacheSeconds=86400) API first Open API code generator based on json or yaml definitions. It generates base abstract controllers with docs, routes, that you inherit and implement in your controllers. +- [ST.NSwag.ServerSourceGenerator](https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator) - ![stars](https://img.shields.io/github/stars/s-tarasov/ST.NSwag.ServerSourceGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/s-tarasov/ST.NSwag.ServerSourceGenerator?style=flat-square&cacheSeconds=86400) Generates Web API/ASP.NET Core controllers from a OpenAPI specification. -#### Razor / Blazor +### Razor / Blazor -- [Blazor.TSRuntime](https://github.com/BlackWhiteYoshi/Blazor.TSRuntime) -![stars](https://img.shields.io/github/stars/BlackWhiteYoshi/Blazor.TSRuntime?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/BlackWhiteYoshi/Blazor.TSRuntime?style=flat-square&cacheSeconds=86400) An improved JSRuntime with automatic JS-module loading and caching, compile time errors instead of runtime errors and nice IntelliSense guidance. -- [BlazorInteropGenerator](https://github.com/surgicalcoder/BlazorInteropGenerator) -![stars](https://img.shields.io/github/stars/surgicalcoder/BlazorInteropGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/surgicalcoder/BlazorInteropGenerator?style=flat-square&cacheSeconds=86400) Generates Blazor -> Javascript strongly typed interop methods, by parsing the Javascript it self and generating extension methods for IJSRuntime. +- [Blazor.TSRuntime](https://github.com/BlackWhiteYoshi/Blazor.TSRuntime) - ![stars](https://img.shields.io/github/stars/BlackWhiteYoshi/Blazor.TSRuntime?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/BlackWhiteYoshi/Blazor.TSRuntime?style=flat-square&cacheSeconds=86400) An improved JSRuntime with automatic JS-module loading and caching, compile time errors instead of runtime errors and nice IntelliSense guidance. +- [BlazorInteropGenerator](https://github.com/surgicalcoder/BlazorInteropGenerator) - ![stars](https://img.shields.io/github/stars/surgicalcoder/BlazorInteropGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/surgicalcoder/BlazorInteropGenerator?style=flat-square&cacheSeconds=86400) Generates Blazor -> Javascript strongly typed interop methods, by parsing the Javascript it self and generating extension methods for IJSRuntime. - [BlazorOcticons](https://github.com/BlazorOcticons/BlazorOcticons) - ![stars](https://img.shields.io/github/stars/BlazorOcticons/BlazorOcticons?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/BlazorOcticons/BlazorOcticons?style=flat-square&cacheSeconds=86400) Github [Octicons](https://primer.style/octicons/) created as a `.razor` components using source generator. The generated components are available via the NuGet package, the generator itself is available as a separate NuGet package. The project [website](https://blazorocticons.net/) is an example using the generated components. -- [MiniRazor](https://github.com/Tyrrrz/MiniRazor) -![stars](https://img.shields.io/github/stars/Tyrrrz/MiniRazor?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Tyrrrz/MiniRazor?style=flat-square&cacheSeconds=86400) Portable Razor compiler & code generator. +- [MiniRazor](https://github.com/Tyrrrz/MiniRazor) - ![stars](https://img.shields.io/github/stars/Tyrrrz/MiniRazor?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Tyrrrz/MiniRazor?style=flat-square&cacheSeconds=86400) Portable Razor compiler & code generator. - [RazorPageRouteGenerator](https://github.com/surgicalcoder/RazorPageRouteGenerator) - ![stars](https://img.shields.io/github/stars/surgicalcoder/RazorPageRouteGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/surgicalcoder/RazorPageRouteGenerator?style=flat-square&cacheSeconds=86400) Generates methods with parameters for Razor and Blazor pages, so you can navigate without having to guess URLs or parameters. ### XAML / WPF / Avalonia -- [Avalonia.NameGenerator](https://github.com/AvaloniaUI/Avalonia.NameGenerator) -![stars](https://img.shields.io/github/stars/avaloniaui/Avalonia.NameGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/avaloniaui/Avalonia.NameGenerator?style=flat-square&cacheSeconds=86400) Generates typed references to named [Avalonia](https://github.com/avaloniaui) XAML controls. -- [boilerplatezero](https://github.com/IGood/boilerplatezero) -![stars](https://img.shields.io/github/stars/IGood/boilerplatezero?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/IGood/boilerplatezero?style=flat-square&cacheSeconds=86400) WPF Dependency Property and Routed Event generator. +- [Avalonia.NameGenerator](https://github.com/AvaloniaUI/Avalonia.NameGenerator) - ![stars](https://img.shields.io/github/stars/AvaloniaUI/Avalonia.NameGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/AvaloniaUI/Avalonia.NameGenerator?style=flat-square&cacheSeconds=86400) Generates typed references to named [Avalonia](https://github.com/avaloniaui) XAML controls. +- [boilerplatezero](https://github.com/IGood/boilerplatezero) - ![stars](https://img.shields.io/github/stars/IGood/boilerplatezero?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/IGood/boilerplatezero?style=flat-square&cacheSeconds=86400) WPF Dependency Property and Routed Event generator. - [DependencyPropertyGenerator](https://github.com/HavenDV/DependencyPropertyGenerator) - ![stars](https://img.shields.io/github/stars/HavenDV/DependencyPropertyGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/HavenDV/DependencyPropertyGenerator?style=flat-square&cacheSeconds=86400) Dependency property and routed event source generator for WPF/UWP/WinUI/Uno/Avalonia/MAUI platforms. -- [WinUI-ObservableSettings](https://github.com/JasonWei512/WinUI-ObservableSettings) -![stars](https://img.shields.io/github/stars/JasonWei512/WinUI-ObservableSettings?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/JasonWei512/WinUI-ObservableSettings?style=flat-square&cacheSeconds=86400) - Generate boilerplates to read and write settings in packaged WinUI 3 app. +- [WinUI-ObservableSettings](https://github.com/JasonWei512/WinUI-ObservableSettings) - ![stars](https://img.shields.io/github/stars/JasonWei512/WinUI-ObservableSettings?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/JasonWei512/WinUI-ObservableSettings?style=flat-square&cacheSeconds=86400) Generate boilerplates to read and write settings in packaged WinUI 3 app. -#### INotifyPropertyChanged +### INotifyPropertyChanged -- [PropertyChanged.SourceGenerator](https://github.com/canton7/PropertyChanged.SourceGenerator) -![stars](https://img.shields.io/github/stars/canton7/PropertyChanged.SourceGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/canton7/PropertyChanged.SourceGenerator?style=flat-square&cacheSeconds=86400) - Powerful INotifyPropertyChanged Source Generator, which generates INPC boilerplate for you as part of your build. Supports features such as automatic and manual dependencies between properties, notifications when specific properties change, and more. -- [ValueChangedGenerator](https://github.com/ufcpp/ValueChangedGenerator) -![stars](https://img.shields.io/github/stars/ufcpp/ValueChangedGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/ufcpp/ValueChangedGenerator?style=flat-square&cacheSeconds=86400) for generating PropertyChanged from inner struct members. +- [PropertyChanged.SourceGenerator](https://github.com/canton7/PropertyChanged.SourceGenerator) - ![stars](https://img.shields.io/github/stars/canton7/PropertyChanged.SourceGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/canton7/PropertyChanged.SourceGenerator?style=flat-square&cacheSeconds=86400) Powerful INotifyPropertyChanged Source Generator, which generates INPC boilerplate for you as part of your build. Supports features such as automatic and manual dependencies between properties, notifications when specific properties change, and more. +- [ValueChangedGenerator](https://github.com/ufcpp/ValueChangedGenerator) - ![stars](https://img.shields.io/github/stars/ufcpp/ValueChangedGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/ufcpp/ValueChangedGenerator?style=flat-square&cacheSeconds=86400) for generating PropertyChanged from inner struct members. -#### Model View Viewmodel (MVVM) +### Model View Viewmodel (MVVM) - [DevExpress.Mvvm.CodeGenerators](https://github.com/DevExpress/DevExpress.Mvvm.CodeGenerators) - ![stars](https://img.shields.io/github/stars/DevExpress/DevExpress.Mvvm.CodeGenerators?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/DevExpress/DevExpress.Mvvm.CodeGenerators?style=flat-square&cacheSeconds=86400) Generates boilerplate code for your View Models (INotifyPropertyChanged, Commands, IDataErrorInfo, DevExpress services). Compatible with the Prism and MVVM Light libraries. -- [Microsoft MVVM Toolkit](https://github.com/CommunityToolkit/dotnet) -![stars](https://img.shields.io/github/stars/CommunityToolkit/dotnet?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/CommunityToolkit/dotnet?style=flat-square&cacheSeconds=86400) A modular MVVM library with support for source generators to reduce boilrplate and improve performance. -- [MvvmGen](https://github.com/thomasclaudiushuber/mvvmgen) - ![stars](https://img.shields.io/github/stars/thomasclaudiushuber/MvvmGen?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/thomasclaudiushuber/MvvmGen?style=flat-square&cacheSeconds=86400) A lightweight MVVM library for XAML applications that generates your ViewModels with a C# Source Generator. +- [Microsoft MVVM Toolkit](https://github.com/CommunityToolkit/dotnet) - ![stars](https://img.shields.io/github/stars/CommunityToolkit/dotnet?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/CommunityToolkit/dotnet?style=flat-square&cacheSeconds=86400) A modular MVVM library with support for source generators to reduce boilrplate and improve performance. +- [MvvmGen](https://github.com/thomasclaudiushuber/mvvmgen) - ![stars](https://img.shields.io/github/stars/thomasclaudiushuber/mvvmgen?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/thomasclaudiushuber/mvvmgen?style=flat-square&cacheSeconds=86400) A lightweight MVVM library for XAML applications that generates your ViewModels with a C# Source Generator. ### Database / ORM -- [AdaskoTheBeAsT.Identity.Dapper](https://github.com/AdaskoTheBeAsT/AdaskoTheBeAsT.Identity.Dapper) - ![stars](https://img.shields.io/github/stars/AdaskoTheBeAsT/AdaskoTheBeAsT.Identity.Dapper?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/AdaskoTheBeAsT/AdaskoTheBeAsT.Identity.Dapper?style=flat-square&cacheSeconds=86400) - Custom Dapper implementation for Microsoft.Extensions.Identity.Stores (part of ASP.NET Core Identity) +- [AdaskoTheBeAsT.Identity.Dapper](https://github.com/AdaskoTheBeAsT/AdaskoTheBeAsT.Identity.Dapper) - ![stars](https://img.shields.io/github/stars/AdaskoTheBeAsT/AdaskoTheBeAsT.Identity.Dapper?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/AdaskoTheBeAsT/AdaskoTheBeAsT.Identity.Dapper?style=flat-square&cacheSeconds=86400) Custom Dapper implementation for Microsoft.Extensions.Identity.Stores (part of ASP.NET Core Identity) - [AutoDbSet](https://github.com/Atulin/AutoDbSet) - ![stars](https://img.shields.io/github/stars/Atulin/AutoDbSet?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Atulin/AutoDbSet?style=flat-square&cacheSeconds=86400) Source Generator to automatically create `DbSet` properties on the `DbContext` from marked entities -- [Breezy](https://github.com/Ludovicdln/Breezy) - ![stars](https://img.shields.io/github/stars/Ludovicdln/Breezy?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/ludovicdln/Breezy?style=flat-square&cacheSeconds=86400) Micro ORM with source generator. -- [Dynatello](https://github.com/inputfalken/Dynatello) - ![stars](https://img.shields.io/github/stars/inputfalken/Dynatello?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/inputfalken/Dynatello?style=flat-square&cacheSeconds=86400) A source generator for the low-level API of DynamoDB. +- [Breezy](https://github.com/Ludovicdln/Breezy) - ![stars](https://img.shields.io/github/stars/Ludovicdln/Breezy?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Ludovicdln/Breezy?style=flat-square&cacheSeconds=86400) Micro ORM with source generator. +- [Dynatello](https://github.com/inputfalken/Dynatello) - ![stars](https://img.shields.io/github/stars/inputfalken/Dynatello?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/inputfalken/Dynatello?style=flat-square&cacheSeconds=86400) A source generator for the low-level API of DynamoDB. - [EntityLengths.Generator](https://github.com/TarasKovalenko/EntityLengths.Generator) - ![stars](https://img.shields.io/github/stars/TarasKovalenko/EntityLengths.Generator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/TarasKovalenko/EntityLengths.Generator?style=flat-square&cacheSeconds=86400) Source Generator designed to automatically generate string length constants from Entity Framework configurations and data annotations. -- [MapDataReader](https://github.com/jitbit/MapDataReader) - ![stars](https://img.shields.io/github/stars/jitbit/mapdatareader?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/jitbit/mapdatareader?style=flat-square&cacheSeconds=86400) - Fast mapping `IDataReader` to a custom class +- [MapDataReader](https://github.com/jitbit/MapDataReader) - ![stars](https://img.shields.io/github/stars/jitbit/MapDataReader?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/jitbit/MapDataReader?style=flat-square&cacheSeconds=86400) Fast mapping `IDataReader` to a custom class - [NpgsqlSourceGenerators](https://github.com/Atulin/NpgsqlSourceGenerators) - ![stars](https://img.shields.io/github/stars/Atulin/NpgsqlSourceGenerators?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Atulin/NpgsqlSourceGenerators?style=flat-square&cacheSeconds=86400) Source Generator to automatically register marked enums with NpgSQL for use with PostgreSQL -- [SqlMarshal](https://github.com/kant2002/SqlMarshal) -![stars](https://img.shields.io/github/stars/kant2002/SqlMarshal?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/kant2002/SqlMarshal?style=flat-square&cacheSeconds=86400) Native AOT friendly-performant mini-ORM. Generation of wrappers for accessing SQL using ADO.NET. +- [SqlMarshal](https://github.com/kant2002/SqlMarshal) - ![stars](https://img.shields.io/github/stars/kant2002/SqlMarshal?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/kant2002/SqlMarshal?style=flat-square&cacheSeconds=86400) Native AOT friendly-performant mini-ORM. Generation of wrappers for accessing SQL using ADO.NET. - [TableStorage](https://github.com/StevenThuriot/TableStorage) - ![stars](https://img.shields.io/github/stars/StevenThuriot/TableStorage?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/StevenThuriot/TableStorage?style=flat-square&cacheSeconds=86400) Streamlined way of working with Azure Data Tables that mimics Entity Framework's way of working with DbSets. Source Generators for the Table Entities to avoid any reflection calls being made, making it easier to use Azure Data Tables in a NativeAOT project. - [Unflat](https://github.com/pstlnce/unflat) - ![stars](https://img.shields.io/github/stars/pstlnce/unflat?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/pstlnce/unflat?style=flat-square&cacheSeconds=86400) ORM for zero allocation fast parsing into complex classes/structs with custom type parsers support @@ -339,9 +348,9 @@ Add GitHub topic [`csharp-sourcegenerator`](https://github.com/topics/csharp-sou - [dot-env-generator](https://github.com/RainwayApp/dot-env-generator) - ![stars](https://img.shields.io/github/stars/RainwayApp/dot-env-generator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/RainwayApp/dot-env-generator?style=flat-square&cacheSeconds=86400) A source generator for C# that turns `.env` files into runtime constants. - [EnvVariablesGenerator](https://github.com/KAW0/EnvVariablesGenerator) - ![stars](https://img.shields.io/github/stars/KAW0/EnvVariablesGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/KAW0/EnvVariablesGenerator?style=flat-square&cacheSeconds=86400) Generate code from `.env` files that can be changed after build. - [NotNot.AppSettings](https://github.com/jasonswearingen/NotNot.AppSettings) - ![stars](https://img.shields.io/github/stars/jasonswearingen/NotNot.AppSettings?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/jasonswearingen/NotNot.AppSettings?style=flat-square&cacheSeconds=86400) Automatically create strongly typed C# settings objects from AppSettings.json. -- [SourceConfig](https://github.com/alekshura/SourceConfig) - ![stars](https://img.shields.io/github/stars/alekshura/SourceConfig?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/alekshura/SourceConfig?style=flat-square&cacheSeconds=86400) - Generates configuration POCO objects, lists, dictionaries in AOT based on *.json config files. +- [SourceConfig](https://github.com/alekshura/SourceConfig) - ![stars](https://img.shields.io/github/stars/alekshura/SourceConfig?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/alekshura/SourceConfig?style=flat-square&cacheSeconds=86400) Generates configuration POCO objects, lists, dictionaries in AOT based on *.json config files. - [StronglyTypedEmbeddedResources](https://github.com/surgicalcoder/StronglyTypedEmbeddedResources) - ![stars](https://img.shields.io/github/stars/surgicalcoder/StronglyTypedEmbeddedResources?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/surgicalcoder/StronglyTypedEmbeddedResources?style=flat-square&cacheSeconds=86400) Generates strongly typed names for Embedded Resources automatically. -- [TxtToListGenerator](https://github.com/musictopia2/TxtToListGenerator) - ![stars](https://img.shields.io/github/stars/musictopia2/TxtToListGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/musictopia2/TxtToListGenerator?style=flat-square&cacheSeconds=86400) A source generator where if you have a text file as additional file and you have a list ordered by return carriages, then it produces either a list of int or a list of string in c#. +- [TxtToListGenerator](https://github.com/musictopia2/TxtToListGenerator) - ![stars](https://img.shields.io/github/stars/musictopia2/TxtToListGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/musictopia2/TxtToListGenerator?style=flat-square&cacheSeconds=86400) A source generator where if you have a text file as additional file and you have a list ordered by return carriages, then it produces either a list of int or a list of string in c#. ### Text templating @@ -351,48 +360,46 @@ Add GitHub topic [`csharp-sourcegenerator`](https://github.com/topics/csharp-sou ### Other -- [AssemblyVersionInfo](https://github.com/BlackWhiteYoshi/AssemblyVersionInfo) -![stars](https://img.shields.io/github/stars/BlackWhiteYoshi/AssemblyVersionInfo?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/BlackWhiteYoshi/AssemblyVersionInfo?style=flat-square&cacheSeconds=86400) AssemblyVersionInfo is a very simple source generator that generates constant strings of your assembly name and version. The intended usage is for the System.CodeDom.Compiler.GeneratedCodeAttribute. +- [AssemblyVersionInfo](https://github.com/BlackWhiteYoshi/AssemblyVersionInfo) - ![stars](https://img.shields.io/github/stars/BlackWhiteYoshi/AssemblyVersionInfo?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/BlackWhiteYoshi/AssemblyVersionInfo?style=flat-square&cacheSeconds=86400) AssemblyVersionInfo is a very simple source generator that generates constant strings of your assembly name and version. The intended usage is for the System.CodeDom.Compiler.GeneratedCodeAttribute. - [AutoConstructor](https://github.com/k94ll13nn3/AutoConstructor) - ![stars](https://img.shields.io/github/stars/k94ll13nn3/AutoConstructor?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/k94ll13nn3/AutoConstructor?style=flat-square&cacheSeconds=86400) C# source generator that generates a constructor from readonly fields/properties in a class or struct. - [AutoFilterer.Generators](https://github.com/enisn/AutoFilterer/blob/develop/docs/generators/AutoFilterer-Generators.md) - ![stars](https://img.shields.io/github/stars/enisn/AutoFilterer?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/enisn/AutoFilterer?style=flat-square&cacheSeconds=86400) AutoFilterer.Generators aims to generate filter DTOs from entities automatically via using dotnet source generators. -- [AutoInterface](https://github.com/BlackWhiteYoshi/AutoInterface) -![stars](https://img.shields.io/github/stars/BlackWhiteYoshi/AutoInterface?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/BlackWhiteYoshi/AutoInterface?style=flat-square&cacheSeconds=86400) AutoInterface is a source generator that generates an interface based on your class/struct. Basically, you write your class and get the corresponding interface for free. -- [AutoInvoke](https://github.com/LokiMidgard/AutoInvoke.Generator) -![stars](https://img.shields.io/github/stars/LokiMidgard/AutoInvoke.Generator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/LokiMidgard/AutoInvoke.Generator?style=flat-square&cacheSeconds=86400) A generator that generates a method that invokes a specified generic method, for every Type in your project that satisfies a defined constraint. +- [AutoInterface](https://github.com/BlackWhiteYoshi/AutoInterface) - ![stars](https://img.shields.io/github/stars/BlackWhiteYoshi/AutoInterface?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/BlackWhiteYoshi/AutoInterface?style=flat-square&cacheSeconds=86400) AutoInterface is a source generator that generates an interface based on your class/struct. Basically, you write your class and get the corresponding interface for free. +- [AutoInvoke](https://github.com/LokiMidgard/AutoInvoke.Generator) - ![stars](https://img.shields.io/github/stars/LokiMidgard/AutoInvoke.Generator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/LokiMidgard/AutoInvoke.Generator?style=flat-square&cacheSeconds=86400) A generator that generates a method that invokes a specified generic method, for every Type in your project that satisfies a defined constraint. - [AutoLoggerMessage](https://github.com/stbychkov/AutoLoggerMessage) - ![stars](https://img.shields.io/github/stars/stbychkov/AutoLoggerMessage?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/stbychkov/AutoLoggerMessage?style=flat-square&cacheSeconds=86400) Automatically migrates your logging calls to the LoggerMessage (high-performance logging) version - [AutomaticInterface](https://github.com/codecentric/net_automatic_interface) - ![stars](https://img.shields.io/github/stars/codecentric/net_automatic_interface?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/codecentric/net_automatic_interface?style=flat-square&cacheSeconds=86400) Generate an Interface from a class. -- [BigMachines](https://github.com/archi-Doc/BigMachines) -![stars](https://img.shields.io/github/stars/archi-Doc/BigMachines?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/archi-Doc/BigMachines?style=flat-square&cacheSeconds=86400) BigMachines is State Machine library for .NET. -- [BitsKit](https://github.com/barncastle/BitsKit) - A C# library for efficient bit-level reading and writing also adding bit field support -- [BuildInformationGenerator](https://github.com/pekspro/BuildInformationGenerator) -![stars](https://img.shields.io/github/stars/pekspro/BuildInformationGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/pekspro/BuildInformationGenerator?style=flat-square&cacheSeconds=86400) Adds build information, like build time, commit id and branch, as simple constants. -- [CacheSourceGenerator](https://github.com/jeppevammenkristensen/cachesourcegenerator) -![stars](https://img.shields.io/github/stars/jeppevammenkristensen/cachesourcegenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/jeppevammenkristensen/cachesourcegenerator?style=flat-square&cacheSeconds=86400) Generates an IMemoryCache wrapper around a method call. +- [BigMachines](https://github.com/archi-Doc/BigMachines) - ![stars](https://img.shields.io/github/stars/archi-Doc/BigMachines?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/archi-Doc/BigMachines?style=flat-square&cacheSeconds=86400) BigMachines is State Machine library for .NET. +- [BuildInformationGenerator](https://github.com/pekspro/BuildInformationGenerator) - ![stars](https://img.shields.io/github/stars/pekspro/BuildInformationGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/pekspro/BuildInformationGenerator?style=flat-square&cacheSeconds=86400) Adds build information, like build time, commit id and branch, as simple constants. +- [CacheSourceGenerator](https://github.com/jeppevammenkristensen/cachesourcegenerator) - ![stars](https://img.shields.io/github/stars/jeppevammenkristensen/cachesourcegenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/jeppevammenkristensen/cachesourcegenerator?style=flat-square&cacheSeconds=86400) Generates an IMemoryCache wrapper around a method call. - [Cloneable](https://github.com/mostmand/Cloneable) - ![stars](https://img.shields.io/github/stars/mostmand/Cloneable?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/mostmand/Cloneable?style=flat-square&cacheSeconds=86400) auto-generate Clone method. - [Credfeto.Version.Information.Generator](https://github.com/credfeto/credfeto-version-constants-generator) - ![stars](https://img.shields.io/github/stars/credfeto/credfeto-version-constants-generator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/credfeto/credfeto-version-constants-generator?style=flat-square&cacheSeconds=86400) Minimal source generator for embedding build information as compile time constants. Constants added to `VersionInformation` class in each assembly for `Version`, `Product`, `Company` and `Copyright`. - [CsCodeGenerator](https://github.com/borisdj/CsCodeGenerator) - ![stars](https://img.shields.io/github/stars/borisdj/CsCodeGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/borisdj/CsCodeGenerator?style=flat-square&cacheSeconds=86400) Easy C# class and code generation, POCO object and Methods creation. -- [DataAnnotationValuesExtractor](https://github.com/pekspro/DataAnnotationValuesExtractor) -![stars](https://img.shields.io/github/stars/pekspro/DataAnnotationValuesExtractor?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/pekspro/DataAnnotationValuesExtractor?style=flat-square&cacheSeconds=86400) Extracts values from data annotation attributes, like maximum string length, and exposes them as strongly-typed constants. +- [DataAnnotationValuesExtractor](https://github.com/pekspro/DataAnnotationValuesExtractor) - ![stars](https://img.shields.io/github/stars/pekspro/DataAnnotationValuesExtractor?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/pekspro/DataAnnotationValuesExtractor?style=flat-square&cacheSeconds=86400) Extracts values from data annotation attributes, like maximum string length, and exposes them as strongly-typed constants. - [Dolly](https://github.com/AnderssonPeter/Dolly) - ![stars](https://img.shields.io/github/stars/AnderssonPeter/Dolly?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/AnderssonPeter/Dolly?style=flat-square&cacheSeconds=86400) auto-generate Clone & DeepClone method. - [Durian](https://github.com/piotrstenke/Durian) - ![stars](https://img.shields.io/github/stars/piotrstenke/Durian?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/piotrstenke/Durian?style=flat-square&cacheSeconds=86400) Extends the default capabilities of C# by mimicking features from other languages. -- [Fairy](https://github.com/hermanussen/Fairy) -![stars](https://img.shields.io/github/stars/hermanussen/Fairy?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/hermanussen/Fairy?style=flat-square&cacheSeconds=86400) generates C# code based on Sitecore Content Serialization (SCS) `.yml` files. -- [FastGenericNew](https://github.com/Nyrest/FastGenericNew) - ![stars](https://img.shields.io/github/stars/Nyrest/FastGenericNew?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Nyrest/FastGenericNew?style=flat-square&cacheSeconds=86400) The ultimate fast alternative to `Activator.CreateInstance` / `new T()`. Built on SourceGenerator V2 (Incremental Generator). -- [GitBuildInfo.SourceGenerator](https://github.com/Elskom/GitBuildInfo.SourceGenerator) -![stars](https://img.shields.io/github/stars/Elskom/GitBuildInfo.SourceGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Elskom/GitBuildInfo.SourceGenerator?style=flat-square&cacheSeconds=86400) - for dumping the git information (commit hash, branch, the head description) into assembly level metadata attributes. -- [Hangfire.RecurringJob](https://github.com/IeuanWalker/Hangfire.RecurringJob) - ![stars](https://img.shields.io/github/stars/IeuanWalker/Hangfire.RecurringJob?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/IeuanWalker/Hangfire.RecurringJob?style=flat-square&cacheSeconds=86400) - Automatically generates the recurring job registration code. -- [IDisposableGenerator](https://github.com/Elskom/IDisposableGenerator) -![stars](https://img.shields.io/github/stars/Elskom/IDisposableGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Elskom/IDisposableGenerator?style=flat-square&cacheSeconds=86400) - a Source Generator for Generating the Dispose functions in Disposables. All you have to do is mark them with attributes and it will work from there. +- [Fairy](https://github.com/hermanussen/Fairy) - ![stars](https://img.shields.io/github/stars/hermanussen/Fairy?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/hermanussen/Fairy?style=flat-square&cacheSeconds=86400) generates C# code based on Sitecore Content Serialization (SCS) `.yml` files. +- [FastGenericNew](https://github.com/Nyrest/FastGenericNew) - ![stars](https://img.shields.io/github/stars/Nyrest/FastGenericNew?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Nyrest/FastGenericNew?style=flat-square&cacheSeconds=86400) The ultimate fast alternative to `Activator.CreateInstance` / `new T()`. Built on SourceGenerator V2 (Incremental Generator). +- [GitBuildInfo.SourceGenerator](https://github.com/Elskom/GitBuildInfo.SourceGenerator) - ![stars](https://img.shields.io/github/stars/Elskom/GitBuildInfo.SourceGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Elskom/GitBuildInfo.SourceGenerator?style=flat-square&cacheSeconds=86400) for dumping the git information (commit hash, branch, the head description) into assembly level metadata attributes. +- [Hangfire.RecurringJob](https://github.com/IeuanWalker/Hangfire.RecurringJob) - ![stars](https://img.shields.io/github/stars/IeuanWalker/Hangfire.RecurringJob?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/IeuanWalker/Hangfire.RecurringJob?style=flat-square&cacheSeconds=86400) Automatically generates the recurring job registration code. +- [IDisposableGenerator](https://github.com/Elskom/IDisposableGenerator) - ![stars](https://img.shields.io/github/stars/Elskom/IDisposableGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Elskom/IDisposableGenerator?style=flat-square&cacheSeconds=86400) a Source Generator for Generating the Dispose functions in Disposables. All you have to do is mark them with attributes and it will work from there. - [Lazysh](https://github.com/B1Z0N/LazyshGen) - ![stars](https://img.shields.io/github/stars/B1Z0N/LazyshGen?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/B1Z0N/LazyshGen?style=flat-square&cacheSeconds=86400) Lazy implementation of any interface. - [LinqGen](https://github.com/cathei/LinqGen) - ![stars](https://img.shields.io/github/stars/cathei/LinqGen?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/cathei/LinqGen?style=flat-square&cacheSeconds=86400) Alloc-free and fast replacement for Linq, with code generation. - [LoggingDecoratorGenerator](https://github.com/DavidFineboym/LoggingDecoratorGenerator) - ![stars](https://img.shields.io/github/stars/DavidFineboym/LoggingDecoratorGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/DavidFineboym/LoggingDecoratorGenerator?style=flat-square&cacheSeconds=86400) Generates logger decorator class for an interface. Uses Microsoft.Extensions.Logging.ILogger to log and requires it in decorator class constructor. -- [MemberAccessGenerator](https://github.com/ufcpp/MemberAccessGenerator) -![stars](https://img.shields.io/github/stars/ufcpp/MemberAccessGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/ufcpp/MemberAccessGenerator?style=flat-square&cacheSeconds=86400) generates `GetMember(int)` and/or `GetMember(string)` methods that return property value for a given property name or index (e.g. in positional records). +- [MemberAccessGenerator](https://github.com/ufcpp/MemberAccessGenerator) - ![stars](https://img.shields.io/github/stars/ufcpp/MemberAccessGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/ufcpp/MemberAccessGenerator?style=flat-square&cacheSeconds=86400) generates `GetMember(int)` and/or `GetMember(string)` methods that return property value for a given property name or index (e.g. in positional records). - [MrMeeseeks.StaticDelegateGenerator](https://github.com/Yeah69/MrMeeseeks.StaticDelegateGenerator) - ![stars](https://img.shields.io/github/stars/Yeah69/MrMeeseeks.StaticDelegateGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Yeah69/MrMeeseeks.StaticDelegateGenerator?style=flat-square&cacheSeconds=86400) Makes static classes and members injectable as dependency by generating delegating interfaces and their implementing classes. - [Navitski.Crystalized](https://github.com/AlexNav73/Navitski.Crystalized) - ![stars](https://img.shields.io/github/stars/AlexNav73/Navitski.Crystalized?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/AlexNav73/Navitski.Crystalized?style=flat-square&cacheSeconds=86400) Generates domain model based on schema files. Generated model supports undo/redo, saving to/loading from SQLite and Json files, precise changes tracking and more. -- [net_automatic_interface](https://github.com/codecentric/net_automatic_interface) -![stars](https://img.shields.io/github/stars/codecentric/net_automatic_interface?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/codecentric/net_automatic_interface?style=flat-square&cacheSeconds=86400) .Net Core Source Generator for Automatic Interfaces. -- [PolySharp](https://github.com/Sergio0694/PolySharp) -![stars](https://img.shields.io/github/stars/Sergio0694/PolySharp?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Sergio0694/PolySharp?style=flat-square&cacheSeconds=86400) Provides generated, source-only polyfills for C# language features, to easily use all runtime-agnostic features downlevel. -- [PrimaryConstructor](https://github.com/chaowlert/PrimaryConstructor) -![stars](https://img.shields.io/github/stars/chaowlert/PrimaryConstructor?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/chaowlert/PrimaryConstructor?style=flat-square&cacheSeconds=86400) Generate primary constructor from readonly fields. -- [PrimitiveStaticDataGenerator](https://github.com/iiweis/PrimitiveStaticDataGenerator) -![stars](https://img.shields.io/github/stars/iiweis/PrimitiveStaticDataGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/iiweis/PrimitiveStaticDataGenerator?style=flat-square&cacheSeconds=86400) for creating methods that return optimized `ReadOnlySpan` static data from primitive values. -- [PrintMembersGenerator](https://github.com/Youssef1313/PrintMembersGenerator) -![stars](https://img.shields.io/github/stars/Youssef1313/PrintMembersGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Youssef1313/PrintMembersGenerator?style=flat-square&cacheSeconds=86400) helps re-defining C# record's PrintMembers method to force include/exclude certain members. +- [PolySharp](https://github.com/Sergio0694/PolySharp) - ![stars](https://img.shields.io/github/stars/Sergio0694/PolySharp?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Sergio0694/PolySharp?style=flat-square&cacheSeconds=86400) Provides generated, source-only polyfills for C# language features, to easily use all runtime-agnostic features downlevel. +- [PrimaryConstructor](https://github.com/chaowlert/PrimaryConstructor) - ![stars](https://img.shields.io/github/stars/chaowlert/PrimaryConstructor?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/chaowlert/PrimaryConstructor?style=flat-square&cacheSeconds=86400) Generate primary constructor from readonly fields. +- [PrimitiveStaticDataGenerator](https://github.com/iiweis/PrimitiveStaticDataGenerator) - ![stars](https://img.shields.io/github/stars/iiweis/PrimitiveStaticDataGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/iiweis/PrimitiveStaticDataGenerator?style=flat-square&cacheSeconds=86400) for creating methods that return optimized `ReadOnlySpan` static data from primitive values. +- [PrintMembersGenerator](https://github.com/Youssef1313/PrintMembersGenerator) - ![stars](https://img.shields.io/github/stars/Youssef1313/PrintMembersGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Youssef1313/PrintMembersGenerator?style=flat-square&cacheSeconds=86400) helps re-defining C# record's PrintMembers method to force include/exclude certain members. - [QuickConstructor](https://github.com/flavien/QuickConstructor) - ![stars](https://img.shields.io/github/stars/flavien/QuickConstructor?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/flavien/QuickConstructor?style=flat-square&cacheSeconds=86400) A reliable and feature-rich source generator that can automatically emit a constructor from the fields and properties of a class. It can also generate null checks based on nullable reference types annotations. -- [SmallSharp](https://github.com/kzu/SmallSharp) -![stars](https://img.shields.io/github/stars/kzu/SmallSharp?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/kzu/SmallSharp?style=flat-square&cacheSeconds=86400) Create, edit and run multiple C# 9.0 top-level programs in the same project by just selecting the startup program from the start button. -- [SmartAnnotations](https://github.com/fiseni/SmartAnnotations) -![stars](https://img.shields.io/github/stars/fiseni/SmartAnnotations?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/fiseni/SmartAnnotations?style=flat-square&cacheSeconds=86400) A library that uses source generators to automatically generate data annotations for your models. It provides a strongly-typed mechanism (fluent like API) to define your annotation rules. -- [StringLiteralGenerator](https://github.com/ufcpp/StringLiteralGenerator) -![stars](https://img.shields.io/github/stars/ufcpp/StringLiteralGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/ufcpp/StringLiteralGenerator?style=flat-square&cacheSeconds=86400) for optimizing UTF-8 binaries. -- [SyncMethodGenerator](https://github.com/zompinc/sync-method-generator) -![stars](https://img.shields.io/github/stars/zompinc/sync-method-generator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/zompinc/sync-method-generator?style=flat-square&cacheSeconds=86400) - Generates a synchronized method from your async code. -- [ThisAssembly](https://github.com/kzu/ThisAssembly) -![stars](https://img.shields.io/github/stars/kzu/ThisAssembly?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/kzu/ThisAssembly?style=flat-square&cacheSeconds=86400) Exposes project and assembly level information as constants in the ThisAssembly class. -- [ToString](https://github.com/Burgyn/MMLib.ToString) -![stars](https://img.shields.io/github/stars/Burgyn/MMLib.ToString?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Burgyn/MMLib.ToString?style=flat-square&cacheSeconds=86400) - C# source generator for implementing `ToString` override like `record` type. -- [TupleOverloadGenerator](https://github.com/ProphetLamb/TupleOverloadGenerator) - ![stars](https://img.shields.io/github/stars/ProphetLamb/TupleOverloadGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/ProphetLamb/TupleOverloadGenerator?style=flat-square&cacheSeconds=86400) - Overload `params` array parameter with tuples avoiding heap allocations. -- [ValueLink](https://github.com/archi-Doc/ValueLink) -![stars](https://img.shields.io/github/stars/archi-Doc/ValueLink?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/archi-Doc/ValueLink?style=flat-square&cacheSeconds=86400) A C# Library for creating and managing multiple links between objects. +- [SmallSharp](https://github.com/kzu/SmallSharp) - ![stars](https://img.shields.io/github/stars/kzu/SmallSharp?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/kzu/SmallSharp?style=flat-square&cacheSeconds=86400) Create, edit and run multiple C# 9.0 top-level programs in the same project by just selecting the startup program from the start button. +- [SmartAnnotations](https://github.com/fiseni/SmartAnnotations) - ![stars](https://img.shields.io/github/stars/fiseni/SmartAnnotations?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/fiseni/SmartAnnotations?style=flat-square&cacheSeconds=86400) A library that uses source generators to automatically generate data annotations for your models. It provides a strongly-typed mechanism (fluent like API) to define your annotation rules. +- [StringLiteralGenerator](https://github.com/ufcpp/StringLiteralGenerator) - ![stars](https://img.shields.io/github/stars/ufcpp/StringLiteralGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/ufcpp/StringLiteralGenerator?style=flat-square&cacheSeconds=86400) for optimizing UTF-8 binaries. +- [SyncMethodGenerator](https://github.com/zompinc/sync-method-generator) - ![stars](https://img.shields.io/github/stars/zompinc/sync-method-generator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/zompinc/sync-method-generator?style=flat-square&cacheSeconds=86400) Generates a synchronized method from your async code. +- [ThisAssembly](https://github.com/kzu/ThisAssembly) - ![stars](https://img.shields.io/github/stars/kzu/ThisAssembly?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/kzu/ThisAssembly?style=flat-square&cacheSeconds=86400) Exposes project and assembly level information as constants in the ThisAssembly class. +- [ToString](https://github.com/Burgyn/MMLib.ToString) - ![stars](https://img.shields.io/github/stars/Burgyn/MMLib.ToString?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Burgyn/MMLib.ToString?style=flat-square&cacheSeconds=86400) C# source generator for implementing `ToString` override like `record` type. +- [TupleOverloadGenerator](https://github.com/ProphetLamb/TupleOverloadGenerator) - ![stars](https://img.shields.io/github/stars/ProphetLamb/TupleOverloadGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/ProphetLamb/TupleOverloadGenerator?style=flat-square&cacheSeconds=86400) Overload `params` array parameter with tuples avoiding heap allocations. +- [ValueLink](https://github.com/archi-Doc/ValueLink) - ![stars](https://img.shields.io/github/stars/archi-Doc/ValueLink?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/archi-Doc/ValueLink?style=flat-square&cacheSeconds=86400) A C# Library for creating and managing multiple links between objects. ## Meta - libs and generators for other generators @@ -401,12 +408,12 @@ Add GitHub topic [`csharp-sourcegenerator`](https://github.com/topics/csharp-sou - [REPO](https://github.com/REPO) - ![stars](https://img.shields.io/github/stars/REPO?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/REPO?style=flat-square&cacheSeconds=86400) --> -- [AttributeFactoryGenerator](https://github.com/PaulBraetz/AttributeFactoryGenerator) - ![stars](https://img.shields.io/github/stars/PaulBraetz/AttributeFactoryGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/PaulBraetz/AttributeFactoryGenerator?style=flat-square&cacheSeconds=86400) - Generate factories to easily parse actual attribute instances from symbol data. -- [AttributesSourceGeneratorHelper](https://github.com/musictopia2/AttributesSourceGeneratorHelper) - ![stars](https://img.shields.io/github/stars/musictopia2/AttributesSourceGeneratorHelper?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/musictopia2/AttributesSourceGeneratorHelper?style=flat-square&cacheSeconds=86400) A source generator to help another generator by producing attributes. Anything that inherits from Attribute will be sent to the client so you don't have to build strings for attributes. -- [CommonSourceGeneratorsHelpers](https://github.com/musictopia2/CommonSourceGeneratorsHelpers) - ![stars](https://img.shields.io/github/stars/musictopia2/CommonSourceGeneratorsHelpers?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/musictopia2/CommonSourceGeneratorsHelpers?style=flat-square&cacheSeconds=86400) A generator to create many helpers for source generators to use to make up that its very difficult to reference third party libraries in source generators including extensions and a source code string builder. -- [HotReload](https://github.com/andrzejolszak/BuilderGeneratorHotReload) - ![stars](https://img.shields.io/github/stars/andrzejolszak/BuilderGeneratorHotReload?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/andrzejolszak/BuilderGeneratorHotReload?style=flat-square&cacheSeconds=86400) - A simple hack to enable hot reload in Visual Studio Intellisense when developing a source generator project together with an example dependent client project inside a single solution. -- [SourceGeneratorUtils](https://github.com/thenameless314159/SourceGeneratorUtils) - ![stars](https://img.shields.io/github/stars/thenameless314159/SourceGeneratorUtils?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/thenameless314159/SourceGeneratorUtils?style=flat-square&cacheSeconds=86400) An essential library equipped with utility functions and helpers to aid in writing source files for source generators or for general purposes. Based on the `System.Text.Json` source generator architecture for best-practices. -- [SourceGenerator.Helper.CopyCode](https://github.com/LokiMidgard/SourceGenerator.Helper.CopyCode) - ![stars](https://img.shields.io/github/stars/LokiMidgard/SourceGenerator.Helper.CopyCode?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/LokiMidgard/SourceGenerator.Helper.CopyCode?style=flat-square&cacheSeconds=86400) - A simple Generator that generates a string representation to an annotated Type. +- [AttributeFactoryGenerator](https://github.com/PaulBraetz/AttributeFactoryGenerator) - ![stars](https://img.shields.io/github/stars/PaulBraetz/AttributeFactoryGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/PaulBraetz/AttributeFactoryGenerator?style=flat-square&cacheSeconds=86400) Generate factories to easily parse actual attribute instances from symbol data. +- [AttributesSourceGeneratorHelper](https://github.com/musictopia2/AttributesSourceGeneratorHelper) - ![stars](https://img.shields.io/github/stars/musictopia2/AttributesSourceGeneratorHelper?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/musictopia2/AttributesSourceGeneratorHelper?style=flat-square&cacheSeconds=86400) A source generator to help another generator by producing attributes. Anything that inherits from Attribute will be sent to the client so you don't have to build strings for attributes. +- [CommonSourceGeneratorsHelpers](https://github.com/musictopia2/CommonSourceGeneratorsHelpers) - ![stars](https://img.shields.io/github/stars/musictopia2/CommonSourceGeneratorsHelpers?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/musictopia2/CommonSourceGeneratorsHelpers?style=flat-square&cacheSeconds=86400) A generator to create many helpers for source generators to use to make up that its very difficult to reference third party libraries in source generators including extensions and a source code string builder. +- [HotReload](https://github.com/andrzejolszak/BuilderGeneratorHotReload) - ![stars](https://img.shields.io/github/stars/andrzejolszak/BuilderGeneratorHotReload?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/andrzejolszak/BuilderGeneratorHotReload?style=flat-square&cacheSeconds=86400) A simple hack to enable hot reload in Visual Studio Intellisense when developing a source generator project together with an example dependent client project inside a single solution. +- [SourceGeneratorUtils](https://github.com/thenameless314159/SourceGeneratorUtils) - ![stars](https://img.shields.io/github/stars/thenameless314159/SourceGeneratorUtils?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/thenameless314159/SourceGeneratorUtils?style=flat-square&cacheSeconds=86400) An essential library equipped with utility functions and helpers to aid in writing source files for source generators or for general purposes. Based on the `System.Text.Json` source generator architecture for best-practices. +- [SourceGenerator.Helper.CopyCode](https://github.com/LokiMidgard/SourceGenerator.Helper.CopyCode) - ![stars](https://img.shields.io/github/stars/LokiMidgard/SourceGenerator.Helper.CopyCode?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/LokiMidgard/SourceGenerator.Helper.CopyCode?style=flat-square&cacheSeconds=86400) A simple Generator that generates a string representation to an annotated Type. ## Tips & Tricks @@ -468,6 +475,7 @@ Reference local projects or embed NuGet packages to source generator assemblies Sorted from newest. Please follow the template: - [Title](URL) (YYYY-MM-DD) short description. --> +- [Title](URL) (YYYY-MM-DD) short description. - [Series: Creating a source generator](https://andrewlock.net/series/creating-a-source-generator/) (2022-02-01) Complete series about how to create an incremental source generator, using the APIs introduced in .NET 6. - [Mastering at Source Generators](https://medium.com/c-sharp-progarmming/mastering-at-source-generators-18125a5f3fca) (2022-01-15) Generating CRUD controller from DTO model using text template. - [Using C# Source Generators to create an external DSL](https://devblogs.microsoft.com/dotnet/using-c-source-generators-to-create-an-external-dsl/) (2021-01-27) that shows how to implement a simple DSL. @@ -488,6 +496,7 @@ Reference local projects or embed NuGet packages to source generator assemblies - [Title](URL) (YYYY-MM-DD) short description. --> +- [Title](URL) (YYYY-MM-DD) short description. - [C# Source Generators - Write code that writes code - David Wengier](https://www.youtube.com/watch?v=pqLs7X6Cr6s) (2020-11-13) Roslyn dev takes deep dive into the topic. - [.NET Languages and Runtime Community Standup - Source Generators](https://www.youtube.com/watch?v=A4479Etdx4I) (2020-10-08) shows how Generators work and how they can be tested. - [Channel 9 'Source Generators in C#'](https://channel9.msdn.com/Shows/Visual-Studio-Toolbox/Source-Generators-in-CSharp) (2020-08-12) has Roslyn PMs discussing the feature. @@ -504,9 +513,9 @@ Maybe they can inspire you too! ## Projects using custom Source Generators "internally" -- [Elskom/Sdk](https://github.com/Elskom/Sdk) - ![stars](https://img.shields.io/github/stars/Elskom/Sdk?style=flat-square$cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Elskom/Sdk?style=flat-square&cacheSeconds=86400) Dumps git repository data to assembly level metadata attributes that can be checked at runtime for things like trapping if a user is using an possibly unstable build of the libraries built in the repository and so the user can see a message about it (and optionally opt into running the possibly unstable code). -- [Heroicons.AspNetCore](https://github.com/tompazourek/Heroicons.AspNetCore) -![stars](https://img.shields.io/github/stars/tompazourek/Heroicons.AspNetCore?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/tompazourek/Heroicons.AspNetCore?style=flat-square&cacheSeconds=86400) [Heroicons](https://heroicons.com/) that are easy to use in ASP.NET Core MVC as TagHelpers. -- [HydraScript](https://github.com/Stepami/hydrascript) - ![stars](https://img.shields.io/github/stars/Stepami/hydrascript?style=flat-square) ![last commit](https://img.shields.io/github/last-commit/Stepami/hydrascript?style=flat-square) TypeScript & Go inspired small interpreted programming language written in C# that uses Source Generator to build large regular expression for lexical analysis. The regex value is passed to `[GeneratedRegex]` attribute, so this internal generator generates the input for another generator. +- [Elskom/Sdk](https://github.com/Elskom/Sdk) - ![stars](https://img.shields.io/github/stars/Elskom/Sdk?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Elskom/Sdk?style=flat-square&cacheSeconds=86400) Dumps git repository data to assembly level metadata attributes that can be checked at runtime for things like trapping if a user is using an possibly unstable build of the libraries built in the repository and so the user can see a message about it (and optionally opt into running the possibly unstable code). +- [Heroicons.AspNetCore](https://github.com/tompazourek/Heroicons.AspNetCore) - ![stars](https://img.shields.io/github/stars/tompazourek/Heroicons.AspNetCore?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/tompazourek/Heroicons.AspNetCore?style=flat-square&cacheSeconds=86400) [Heroicons](https://heroicons.com/) that are easy to use in ASP.NET Core MVC as TagHelpers. +- [HydraScript](https://github.com/Stepami/hydrascript) - ![stars](https://img.shields.io/github/stars/Stepami/hydrascript?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Stepami/hydrascript?style=flat-square&cacheSeconds=86400) TypeScript & Go inspired small interpreted programming language written in C# that uses Source Generator to build large regular expression for lexical analysis. The regex value is passed to `[GeneratedRegex]` attribute, so this internal generator generates the input for another generator. - [NetFabric.Hyperlinq](https://github.com/NetFabric/NetFabric.Hyperlinq) - ![stars](https://img.shields.io/github/stars/NetFabric/NetFabric.Hyperlinq?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/NetFabric/NetFabric.Hyperlinq?style=flat-square&cacheSeconds=86400) generates overloads for its extension methods. - [RestEase](https://github.com/canton7/RestEase) - ![stars](https://img.shields.io/github/stars/canton7/RestEase?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/canton7/RestEase?style=flat-square&cacheSeconds=86400) uses Source Generator to generate interface implementations on compile time instead of in runtime via Reflection.Emit. - [WarHub/wham](https://github.com/WarHub/wham) - ![stars](https://img.shields.io/github/stars/WarHub/wham?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/WarHub/wham?style=flat-square&cacheSeconds=86400) generates code for immutable tree object graph based on red-green node approach used in Roslyn; generates custom XmlSerializer that supports C#9 records and ImmutableArray. diff --git a/TESTING.md b/TESTING.md new file mode 100644 index 0000000..4494686 --- /dev/null +++ b/TESTING.md @@ -0,0 +1,55 @@ +# Testing the Refactored Structure + +This document demonstrates how to use the new data-driven structure. + +## Quick Test + +1. **Validate the current data:** + ```bash + python scripts/validate_data.py + ``` + +2. **Render the README:** + ```bash + python scripts/render_readme.py + ``` + +3. **Add a new repository** (edit `data/repositories.yml`): + ```yaml + categories: + your-category: + repositories: + - name: NewGenerator + url: https://github.com/user/repo + description: Description of the generator + ``` + +4. **Validate and render:** + ```bash + python scripts/validate_data.py && python scripts/render_readme.py + ``` + +## Automated Workflow + +When you push changes to `data/repositories.yml`: + +1. GitHub Actions runs validation +2. If validation passes, README.md is automatically regenerated +3. Changes are committed back to the repository + +## Local Development + +Install dependencies: +```bash +pip install -r requirements.txt +``` + +Run validation: +```bash +python scripts/validate_data.py +``` + +Render README: +```bash +python scripts/render_readme.py +``` diff --git a/data/repositories.yml b/data/repositories.yml new file mode 100644 index 0000000..b877c73 --- /dev/null +++ b/data/repositories.yml @@ -0,0 +1,1036 @@ +header: + title: C# Source Generators +table_of_contents: +- name: Documentation and samples + anchor: documentation-and-samples +- name: Source Generators + anchor: source-generators +- name: Meta - libs and generators for other generators + anchor: meta---libs-and-generators-for-other-generators +- name: Tips & Tricks + anchor: tips--tricks +- name: Articles + anchor: articles +- name: Videos + anchor: videos +- name: Demo, PoC and excercise projects + anchor: demo-poc-and-excercise-projects +- name: Projects using custom Source Generators "internally" + anchor: projects-using-custom-source-generators-internally +introduction: +- A list of C# Source Generators (not necessarily awesome), because I haven't found a good list yet. +- '' +- '**C# Source Generators** is a Roslyn compiler feature introduced in C#9/.NET 5. It lets C# developers inspect user code + and generate new C# source files that can be added to a compilation.' +- '' +- Add GitHub topic [`csharp-sourcegenerator`](https://github.com/topics/csharp-sourcegenerator) to your generator repo - let's + get it started! +documentation: +- '[docs.microsoft.com](https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/source-generators-overview) official documentation.' +- '[dotnet/roslyn feature design document](https://github.com/dotnet/roslyn/blob/main/docs/features/source-generators.md) + describing the compiler feature.' +- '[dotnet/roslyn cookbook](https://github.com/dotnet/roslyn/blob/main/docs/features/source-generators.cookbook.md) to help + with generator creation.' +- '[dotnet/roslyn-sdk samples](https://github.com/dotnet/roslyn-sdk/tree/main/samples/CSharp/SourceGenerators) show how to + implement a source generator and use features like external package references (*inside* generators). Includes AutoNotify, + Csv, Maths, Mustache, and SettingsXml.' +- '[SourceGeneratorPlayground](https://wengier.com/SourceGeneratorPlayground) - an online Source Generator Playground to play + with generator ideas 💡 without any setup noise. [Source repo](https://github.com/davidwengier/SourceGeneratorPlayground).' +- '[davidwengier/SourceGeneratorTemplate](https://github.com/davidwengier/SourceGeneratorTemplate) -![stars](https://img.shields.io/github/stars/davidwengier/SourceGeneratorTemplate?style=flat-square&cacheSeconds=604800) + ![last commit](https://img.shields.io/github/last-commit/davidwengier/SourceGeneratorTemplate?style=flat-square&cacheSeconds=86400) + A basic template for writing a C# source generator, from the Roslyn dev.' +categories: + dependency-injection-ioc-container: + name: Dependency Injection (IoC Container) + repositories: + - name: AutoCtor + url: https://github.com/distantcam/AutoCtor + description: AutoCtor is a Roslyn Source Generator that will automatically create a constructor for your class for use + with constructor Dependency Injection. + - name: AutoRegisterInject + url: https://github.com/patrickklaeren/AutoRegisterInject + description: Automatically generate Microsoft Dependency Injection ServiceCollection registrations for your classes + from attributes. + - name: CircleDI + url: https://github.com/BlackWhiteYoshi/CircleDI + description: The world only full-power circular Service Provider. It can resolve circular dependencies, has compile + time safety and optimal performance. + - name: DependencyInjection.SourceGenerators + url: https://github.com/jimmy-mll/DependencyInjection.SourceGenerators + description: This project is a C# source generator designed to simplify and automate the registration of dependencies + in Microsoft's Dependency Injection service collection. By using this package, developers can enhance the clarity + and efficiency of their code by reducing the need for manual service registration. + - name: DependencyManagement + url: https://github.com/essy-ecosystem/dependency-management + description: The Dependency Management is a very fast dependency injection and components container, with many interesting + features, and without reflection. + - name: GrpcInjection + url: https://github.com/juniorporfirio/grpcinjection + description: GrpcInjection is a tool that allow you to inject Services and Interceptor in time of compilation inside + of GRPC Projects using C# source generator. + - name: Injectio + url: https://github.com/loresoft/Injectio + description: Source generator that helps register discovered services in the dependency injection container + - name: Jab + url: https://github.com/pakrym/jab + description: Compile Time Dependency Injection + - name: lambdajection + url: https://github.com/cythral/lambdajection + description: Framework for building AWS Lambdas using dependency injection and aspect-oriented programming. + - name: MrMeeseeks.DIE + url: https://github.com/Yeah69/MrMeeseeks.DIE + description: An unambigous, convenient, flexible and feature rich compile time dependency injection container. + - name: Pure.DI + url: https://github.com/DevTeam/Pure.DI + description: dependency injection for .NET without any IoC/DI containers, frameworks, dependencies, and thus without + any performance impact and side-effects. + - name: ServiceScan.SourceGenerator + url: https://github.com/Dreamescaper/ServiceScan.SourceGenerator + description: Type scanning source generator for `Microsoft.Extensions.DependencyInjection` services registrations inspired + by [Scrutor](https://github.com/khellang/Scrutor/). + - name: SourceDepend + url: https://github.com/crwsolutions/sourcedepend + description: Simply tag members with a `[Dependency]` attribute and those will be added to the constructor, saving you + from manual coding the constructor. + - name: SourceInject + url: https://github.com/giggio/sourceinject/ + description: A source generator that allow you to generate your services for dependencies injection during compile time. + - name: StrongInject + url: https://github.com/YairHalberstadt/stronginject + description: compile time dependency injection for .NET. + - name: Thunderboltloc + url: https://github.com/AlyElhaddad/ThunderboltIoc + description: One of the very first IoC frameworks for .Net that has no reflection. + console--cli: + name: Console / CLI + repositories: + - name: AutoSpectre + url: https://github.com/jeppevammenkristensen/auto-spectre + description: Generates a service for prompting and populating a class using the Spectre.Console library + - name: ConsoleAppFramework + url: https://github.com/Cysharp/ConsoleAppFramework + description: Zero Dependency, Zero Overhead, Zero Reflection, Zero Allocation, AOT Safe CLI Framework powered by C# + Source Generator. + - name: docopt.net + url: https://github.com/docopt/docopt.net + description: generates C# source code that parses command-line arguments into a strong-typed arguments class (also generated), + given _just_ the [POSIX-style usage in plain text](http://docopt.org/) as part of the CLI. In other words, write the + help message for your program and get the entire parser generated for free! + - name: Figgle + url: https://github.com/drewnoakes/figgle + description: Generate ASCII banner text at compile time (or run time) using figlet fonts. + mappers: + name: Mappers + repositories: + - name: AutoDto + url: https://github.com/Ohorodnikov/AutoDto + description: A source generator that generates DTO models from BL to avoid same BL and DTO models + - name: Facet + url: https://github.com/Tim-Maes/Facet/ + description: A source generator that instantly scaffolds DTOs, ViewModels and typed LINQ projections. + - name: Flattening + url: https://github.com/Kros-sk/Kros.Generators.Flattening + description: C# source generator for generating flattened classes from complex domain classes. + - name: GraphQL.Tools + url: https://github.com/MoienTajik/GraphQL.Tools + description: A GraphQL to C# compiler (code-generator) which turns your GraphQL schema into a set of C# classes, interfaces, + and enums. + - name: Mapperly + url: https://github.com/riok/mapperly + description: A source generator for generating object mappings. Inspired by MapStruct. + - name: MappingCloningExtensions + url: https://github.com/musictopia2/MappingCloningExtensions + description: Generates extensions of objects for mapping and cloning using either attributes or fluent style. Also, + supports deep copying and specfiying whether it can do a deep copy and the possibility of doing so safely. + - name: Mapster + url: https://github.com/MapsterMapper/Mapster + description: A fast, fun and performant object to object Mapper. Has better performance and is more memorry efficient + than Automapper. Besides code generation, supports also Fluent API. + - name: MapTo + url: https://github.com/mrtaikandi/MapTo + description: A convention based object to object mapper similar to Automapper. + - name: NextGenMapper + url: https://github.com/DedAnton/NextGenMapper + description: Easy-to-use mapper without configuration. + - name: SourceMapper + url: https://github.com/alekshura/SourceMapper + description: generates Mappers code based on attributes used on interfaces or abstract classes. It is inspired by Java + [MapStruct](https://mapstruct.org/) + - name: SourceMapper + url: https://github.com/paiden/SourceMapper/ + description: A source generator that creates extension methods for cloning and mapping. + communication: + name: Communication + repositories: + - name: CoreWCF + url: https://github.com/CoreWCF/CoreWCF + description: CoreWCF provides support of WCF server side code on .NET Core / .NET6. CoreWCF allows users to inject services + into `OperationContract` implementation using a source generator to provide an `OperationContract` implementation + that fits the expected `ServiceContract`. The supplied implementation fetch services from the DI container the same + way the `[FromServices]` attribute works in ASP.NET core MVC Controllers. The source generator supports both a dedicated + `[Injected]` attribute and the ASP.NET Core MVC `[FromServices]` attribute. + - name: Imp.NET + url: https://github.com/DouglasDwyer/Imp.NET + description: a fast, high-level, object-oriented C# networking library that supports the invocation of remote methods + through proxy interface objects. + - name: IoTHubClientGenerator + url: https://github.com/alonf/IoTHubClientGenerator + description: Build a C# Azure IoT Device client program in seconds! + graphics--drawing: + name: Graphics / Drawing + repositories: + - name: ComputeSharp + url: https://github.com/Sergio0694/ComputeSharp + description: A .NET library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute + shaders, which are transpiled from C# and precompiled at build-time using source generators. + - name: Svg to C# Source Generators + url: https://github.com/wieslawsoltes/Svg.Skia + description: SVGC compiles SVG drawing markup to C# using SkiaSharp as rendering engine. SVGC can be also used as codegen + for upcoming C# 9 Source Generator feature. + enums: + name: Enums + repositories: + - name: BetterEnums + url: https://github.com/Ceiridge/BetterEnums + description: C# Enums with values and better performance as a source generator + - name: Credfeto.Enumeration.Source.Generation + url: https://github.com/credfeto/credfeto-enum-source-generation + description: Enum to text generator for enums - generates strongly typed enums for all enums in the assembly, and using + `EnumText` attribute for third party enums. Also includes an analyzer to ensure that all enum usages use the `.GetName` + extension method rather than `.ToString`. + - name: Enum.Source.Generator + url: https://github.com/EngRajabi/Enum.Source.Generator + description: A C# source generator to create an enumeration (enum) class from an enum type. With this package, you can + work on enums very, very fast without using reflection. + - name: EnumClass + url: https://github.com/ashenBlade/EnumClass + description: Generate Kotlin's `enum class` from C# `enum` with additional features like Switch function (instead of + `switch` statement). It also contains support libraries like generator for JsonConverter for generated classes + - name: EnumerationClassGenerator + url: https://github.com/HamedFathi/EnumerationClassGenerator + description: A C# source generator to create an enumeration class from an enum type. + - name: EnumFastToStringDotNet + url: https://github.com/Spinnernicholas/EnumFastToStringDotNet + description: Automatically generates enum extension methods that implement a switch expression based ToString method. + - name: EnumUtilitiesGenerator + url: https://github.com/leoformaggi/enum-utilities-generator + description: A source generator to generate compile-time mapping of enums and description attributes. + - name: FastEnumGenerator + url: https://github.com/musictopia2/FastEnumGenerator + description: An enum like generator where you create a partial class with private enum and it will generate an enum + like record struct even including returning the words and a list. + - name: JOS.Enumeration + url: https://github.com/joseftw/jos.enumeration + description: Enumeration class powered by source generation + - name: NetEscapades.EnumGenerators + url: https://github.com/andrewlock/NetEscapades.EnumGenerators + description: A source generator for generating fast "reflection" methods for enums + - name: RapidEnum + url: https://github.com/hanachiru/RapidEnum + description: RapidEnum is a Source Generator that provides fast-running enum utilities for C#/.NET. It is faster than + the .NET API and achieves zero allocation for all methods. + functional-programming: + name: Functional Programming + repositories: [] + subcategories: + value-semantic--new-type-idiom: + name: Value semantic / New Type Idiom + repositories: + - name: ComparisonOperatorsGenerator + url: https://github.com/sonnemaf/ReflectionIT.ComparisonOperatorsGenerator + description: A Source Generator package that generates the `>`, `>=`, `<`, `<=` operators for a `partial` type (`class`, + `struct` or `record`) which implements `IComparable`. + - name: Generator.Equals + url: https://github.com/diegofrata/Generator.Equals + description: generates equality and hashing for classes and records, supports a number of strategies for comparing + collections and properties. + - name: RSCG_UtilityTypes + url: https://github.com/ignatandrei/RSCG_UtilityTypes + description: Add Omit and Pick attributes to generate classes from existing class, like in TypeScript. + - name: Strongly + url: https://github.com/lucasteles/Strongly + description: Easily generate serializable domain value types + - name: StronglyTypedId + url: https://github.com/andrewlock/StronglyTypedId + description: A Rosyln-powered generator for strongly-typed IDs + - name: ValueObjectGenerator + url: https://github.com/RyotaMurohoshi/ValueObjectGenerator + description: C# source generator is for ValueObjects (ie.Wrapper classes). + - name: Vogen + url: https://github.com/SteveDunn/Vogen + description: C# source generator and code analyser that generates strongly typed domain identities. + - name: WrapperValueObject + url: https://github.com/martinothamar/WrapperValueObject + description: for creating simple value objects wrapping primitive types. + immutability: + name: Immutability + repositories: + - name: Immutype + url: https://github.com/DevTeam/Immutype + description: generates extension methods to support immutability. + - name: Visor + url: https://github.com/leviysoft/Visor + description: C# optics library with incremental code generator (maintained fork of [suspended Tinkoff project](https://github.com/Tinkoff/Visor)) + discriminated-unions: + name: Discriminated Unions + repositories: + - name: AnyOf + url: https://github.com/StefH/AnyOf + description: The Source Generator creates a `AnyOf` type to handle multiple defined types as + input parameters for methods. + - name: dotVariant + url: https://github.com/mknejp/dotvariant + description: A type-safe and space-efficient sum type for C# (comparable to discriminated unions in C or C++). + - name: Dunet + url: https://github.com/domn1995/dunet + description: A simple source generator for [discriminated unions](https://en.wikipedia.org/wiki/Tagged_union) in + C#. + - name: Funcky Discriminated Unions + url: https://github.com/polyadic/funcky-discriminated-union + description: A source generator that generates `Match` methods for all your discriminated unions needs. ✨ Can be + used with or without the functional programming library Funcky. + - name: N.SourceGenerators.UnionTypes + url: https://github.com/Ne4to/N.SourceGenerators.UnionTypes + description: Discriminated union type source generator. + - name: Unions + url: https://github.com/PaulBraetz/Unions + description: for generating meaningful, efficient union types. + serialization: + name: Serialization + repositories: + - name: AutoDeconstructable + url: https://github.com/nemesissoft/Nemesis.TextParsers/tree/master/Nemesis.TextParsers.CodeGen/Deconstructable + description: Generator for efficient and automatic flat text serializer/deserializer using [Deconstructable aspect](https://github.com/nemesissoft/Nemesis.TextParsers/blob/master/Specification.md#deconstructables) + in [NTP](https://github.com/nemesissoft/Nemesis.TextParsers) library. + - name: Azura + url: https://github.com/Lucina/Azura + description: Generates binary [de]serializers on Streams at design time. + - name: Csv-CSharp + url: https://github.com/nuskey8/Csv-CSharp + description: Csv-CSharp is a highly performant CSV (TSV) parser for .NET and Unity. It is designed to parse UTF-8 binaries + directly and leverage Source Generators to enable serialization/deserialization between CSV (TSV) and object arrays + with zero (or very low) allocation. + - name: CSV-Parser-Generator + url: https://github.com/LokiMidgard/CSV-Parser-Generator + description: A Parser for CSV with support for uncommon line separators (e.g. Unicode) and instantiation of read-only + objects and working nullable handling. + - name: GenPack + url: https://github.com/dimohy/GenPack + description: is a library that uses the .NET source generator to automatically generate packets as classes once you + define a schema for the packets. It's easy to use and the results are useful. + - name: MemoryPack + url: https://github.com/Cysharp/MemoryPack + description: Zero encoding extreme performance binary serializer for C# and Unity. + - name: MessagePack for C# + url: https://github.com/MessagePack-CSharp/MessagePack-CSharp + description: Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#] + - name: ProtobufSourceGenerator + url: https://github.com/ladeak/ProtobufSourceGenerator + description: A source generator that generates partial helper classes where member properties are attributed with ProtoMember + attribute. + - name: protobuf-net + url: https://github.com/protobuf-net/protobuf-net + description: protobuf-net is a contract based serializer for .NET code, that happens to write data in the "protocol + buffers" serialization format engineered by Google. + - name: SerdeDn (serde-sn) + url: https://github.com/agocke/serde-dn + description: is a port of the popular [serde.rs](https://serde.rs/) Rust serialization/deserialization library to .NET. + Basic cases are fully automated using a C# source generator. + - name: SpreadCheetah + url: https://github.com/sveinungf/spreadcheetah + description: Create Excel files with a C# Source Generator for generating the rows. + - name: StackXML + url: https://github.com/ZingBallyhoo/StackXML + description: Stack based zero-allocation XML serializer and deserializer. + - name: StructPacker + url: https://github.com/RudolfKurka/StructPacker + description: binary serializer that auto-generates C# serialization code to achieve peak runtime performance and efficiency. + - name: Tinyhand + url: https://github.com/archi-Doc/Tinyhand + description: Tiny and simple data format/serializer using a source generator. + - name: VYaml + url: https://github.com/hadashiA/VYaml + description: VYaml is a pure C# YAML 1.2 implementation, which is extra fast, low memory footprint with focued on .NET + and Unity. + subcategories: + json: + name: Json + repositories: + - name: GeneratedJsonConverters + url: https://github.com/aviationexam/json-converter-source-generator + description: generate json converters for polymorph contracts and string based enum serialization. + - name: JsonByExampleGenerator + url: https://github.com/hermanussen/JsonByExampleGenerator + description: generate classes based on example json files in your project. + - name: JsonDeserializeResourceSourceGenerator + url: https://github.com/musictopia2/JsonDeserializeResourceSourceGenerator + description: Instead of having to do embedded resource, can instead have json as additional file and it will produce + a c# string and will deserialize to a type specified. + - name: JsonPolymorphicGenerator + url: https://github.com/surgicalcoder/JsonPolymorphicGenerator + description: Source Code Generator for System.Text.Json JsonDerivedType attributes on polymorphic classes + - name: JsonSerializerContextGenerator + url: https://github.com/musictopia2/JsonSerializerContextGenerator + description: A source generator that produces nearly the same code as system.json.text but easier to use because + you only have to put an attribute for a model class you want to produce for. Also, produces a method to register + to make it easy to use that source generator when serializing/deserializing json. + - name: JsonSrcGen + url: https://github.com/trampster/JsonSrcGen + description: compile time JSON serializer generation. + - name: TeuJson + url: https://github.com/Terria-K/TeuJson + description: A Reflection-less and Lightweight Json Library using source generator. + validation: + name: Validation + repositories: + - name: EasyValidate + url: https://github.com/mu-dawood/EasyValidate + description: High-performance, type-safe .NET source generator that uses attributes to automatically generate validation + for properties, fields, and method parameters. Easy Validate supports async validation, integrates with dependency + injection, and includes rich analyzers and code fixers for a seamless developer experience. + - name: Validly + url: https://github.com/Hookyns/validly + description: A performant, zero-allocation, and highly customizable validation library that generates validation logic + based on attributes, with usage similar to DataAnnotations. + localization: + name: Localization + repositories: + - name: kli.Localize + url: https://github.com/kl1mm/localize + description: localize strings from json files via source code generation + - name: MrMeeseeks.ResXToViewModelGenerator + url: https://github.com/Yeah69/MrMeeseeks.ResXToViewModelGenerator + description: Takes ResX files and generates localization ViewModels for a more convenient usage of localization in MVVM + projects. + - name: ResXGenerator + url: https://github.com/ycanardeau/ResXGenerator + description: Generates strongly-typed resource classes for looking up localized strings. + testing: + name: Testing + repositories: + - name: Buildenator + url: https://github.com/progala2/Buildenator + description: Generate data builder classes for testing purposes (and not only) for your entities. Autofixture + Moq + extensions. + - name: FluentAssertions.Eventual + url: https://github.com/mazharenko/FluentAssertions.Eventual + description: Generates a specialized waiting wrapper for `FluentAssertions` assertions, offering a syntax similar to + plain `FluentAssertions`. + - name: ScenarioTests + url: https://github.com/koenbeuk/ScenarioTests + description: Test your code like you would write a notebook. Simply and effective + subcategories: + mocking: + name: Mocking + repositories: + - name: GRPC-Mock-Server + url: https://github.com/cezarypiatek/GRPC-Mock-Server + description: A source generator for stubbing GRPC services. + - name: InterfaceGenerator + url: https://github.com/daver32/InterfaceGenerator + description: Auto generate interface definition by implementation, for when you need an abstraction for the sake + of mocking. + - name: MockableStaticGenerator + url: https://github.com/HamedFathi/MockableStaticGenerator + description: A C# source generator to make an interface and a class wrapper to test static/extension methods. + - name: MockGen + url: https://github.com/thomas-girotto/MockGen + description: A C# mocking library based on source generators. + - name: MockSourceGenerator + url: https://github.com/hermanussen/MockSourceGenerator + description: A C# mocking library that generates mocks at compile-time using a source generator. + - name: ProxyInterfaceGenerator + url: https://github.com/StefH/ProxyInterfaceSourceGenerator + description: generate an interface and a Proxy class for classes. This makes it possible to wrap external classes + which do not have an interface, in a Proxy class which makes it easier to Mock and use DI. + - name: Rocks + url: https://github.com/JasonBock/Rocks + description: A mocking library based on the Compiler APIs (Roslyn + Mocks). + patterns: + name: Patterns + repositories: + - name: ActorSrcGen + url: https://github.com/aabs/ActorSrcGen + description: Generates boilerplate to turn simple C# classes into TPL Dataflow compatible pipelines with robust and + performant asynchronous and concurrent code. + - name: InlineComposition + url: https://github.com/BlackWhiteYoshi/InlineComposition + description: A source generator that merges the content of other classes into one class. A simple workaround for struct + inheritance or multiple inheritance. + - name: JinShil.MixinSourceGenerator + url: https://github.com/JinShil/JinShil.MixinSourceGenerator + description: A simple, but powerful source generator that implements the mixin design pattern by copying members—along + with their attributes and XML documentation comments—verbatim from one or more source classes/structs into anaother, + forming a composition of said classes/structs. + - name: Lombok.NET + url: https://github.com/CollinAlpert/Lombok.NET + description: Generates boilerplate code and common code patterns. As the name suggests, it is the .NET version of Java's + Lombok. + - name: Minerals.AutoMixins + url: https://github.com/SzymonHalucha/Minerals.AutoMixins + description: Package for automatic mixin design pattern generation using an incremental source generator. + - name: Minerals.AutoCQRS + url: https://github.com/SzymonHalucha/Minerals.AutoCQRS + description: NuGet package that provides interfaces for implementing the CQRS pattern (Commands, Queries, and Pipelines) + along with automatic dependency injection and no MediatR package overhead. + subcategories: + mediator: + name: Mediator + repositories: + - name: DumplingsDevs.Pipelines + url: https://github.com/DumplingsDevs/Pipelines + description: The most flexible mediation implementation in the .NET ecosystem with your own types. + - name: Foundatio Mediator + url: https://github.com/FoundatioFx/Foundatio.Mediator + description: Blazingly fast, convention-based C# mediator powered by source generators and interceptors. + - name: Immediate.Handlers + url: https://github.com/immediateplatform/Immediate.Handlers + description: An implementation of the Mediator pattern in .NET using source generators, without using a central + mediator instance. + - name: Mediator + url: https://github.com/martinothamar/Mediator + description: a high performance implementation of Mediator pattern in .NET using source generators. + - name: MediatR controllers generator + url: https://github.com/Burgyn/MMLib.MediatR.Generators + description: This generator generates controllers and their methods based on your [MediatR](https://github.com/jbogard/MediatR) + requests. + command: + name: Command + repositories: + - name: Plastic + url: https://github.com/sang-hyeon/Plastic + description: This project provides encapsulation of things like Domain, Application Rules, Business Rules or Business + Logic in Application. + builder: + name: Builder + repositories: + - name: Data Builder Generator + url: https://github.com/dasMulli/data-builder-generator + description: Generate data builder patterns for your model classes. + - name: FluentBuilder + url: https://github.com/StefH/FluentBuilder + description: A project which uses Source Generation to create a FluentBuilder for a specified model or DTO. + - name: M31.FluentAPI + url: https://github.com/m31coding/M31.FluentAPI + description: Generate fluent APIs for your C# classes with ease. + - name: StepwiseBuilderGenerator + url: https://github.com/Georgiy-Petrov/StepwiseBuilderGenerator + description: Generate stepwise (fluent) builders effortlessly. + proxy: + name: Proxy + repositories: + - name: avatar + url: https://github.com/kzu/avatar + description: A modern compile-time generated interception/proxy library. + - name: DudNet + url: https://github.com/jwshyns/DudNet + description: A C# source generator for implementing a proxy pattern. + visitor: + name: Visitor + repositories: + - name: MrMeeseeks.Visitor + url: https://github.com/Yeah69/MrMeeseeks.Visitor + description: Generates the boilerplate code for applications of the Visitor pattern. + - name: Visitor.NET + url: https://github.com/Stepami/visitor-net + description: First-ever acyclic generic extensible typesafe implementation of Visitor pattern for .NET without any + usage of dynamic cast. Implementation powered by Source Generators + adapter: + name: Adapter + repositories: + - name: AutoInterface + url: https://github.com/beakona/AutoInterface + description: interface-to-member source generator. + - name: Minerals.AutoInterfaces + url: https://github.com/SzymonHalucha/Minerals.AutoInterfaces + description: Package for automatic interface generation using an incremental source generator. + fluent-api: + name: Fluent API + repositories: + - name: SuperFluid + url: https://github.com/hughesjs/SuperFluid + description: Generates the interfaces to represent a fluent API with grammar + domain-driven-design-ddd: + name: Domain Driven Design (DDD) + repositories: + - name: AltaSoft.DomainPrimitives + url: https://github.com/altasoft/DomainPrimitives + description: A C# toolkit purposefully designed to accelerate the development of domain-specific primitives within your + applications. This streamlined solution empowers developers to efficiently encapsulate fundamental domain logic. Through + this toolkit, you'll significantly reduce code complexity while improving the maintainability of your project. + - name: Architect.DomainModeling + url: https://github.com/TheArchitectDev/Architect.DomainModeling + description: A complete Domain-Driven Design (DDD) toolset for implementing domain models, including base types and + source generators for ValueObjects, WrapperValueObjects, Entities, and Identities. + - name: Minerals.AutoDomain + url: https://github.com/SzymonHalucha/Minerals.AutoDomain + description: This package provides a fast method of defining domain layer components with their specific implementation, + such as aggregates, entities and domain events. Package has built-in strongly typed IDs. + metaprogramming: + name: Metaprogramming + repositories: + - name: GenerateHelperLibraries + url: https://github.com/musictopia2/GenerateHelperLibraries + description: A source generator where you can send any code to the client without having to do as a string. Helper + for custom classes a client has to override in order to have additional features for source generators. Intended + to be used from another source generator. + - name: Gobie + url: https://github.com/GobieGenerator/Gobie + description: Allows developers define and use custom source generation without writing any generator code themselves + or learning the Roslyn APIs. Instead, devs define the generator they want, in C#, and can then use that generator + throughout their project. + - name: Matryoshki + url: https://github.com/krasin-ga/matryoshki + description: Metaprogramming framework based on C# source generators. It allows you to define behaviours with adornments + and generate decorators for arbitrary types. + - name: SourceGeneratorQuery + url: https://github.com/roeibajayo/SourceGeneratorQuery + description: C# SourceGenerator helper which helps you query your files, and adds LINQ support. + webprogramming: + name: Webprogramming + repositories: + - name: AjaxService.Gen + url: https://github.com/MrAliSalehi/AjaxService + description: Automatically Generate typescript Ajax calls based on your C# Api endpoints. + - name: ApiClientGenerator + url: https://github.com/surgicalcoder/ApiClientGenerator + description: Generates a strongly typed HttpClient based off MVC's default routing. Can be used to output into multiple + projects, like Blazor WebAssembly. + - name: ControllerGenerator + url: https://github.com/cloud0259/ControllerGenerator + description: Automatically generate controllers from services in a web application + - name: HttpClientCodeGenerator + url: https://github.com/Jalalx/HttpClientCodeGenerator + description: HttpClientGenerator is a tool that uses the Roslyn code generator feature to write boilerplate HttpClient + code for you. + - name: Immediate.Apis + url: https://github.com/immediateplatform/immediate.apis + description: Generates minimal APIs bindings for [Immediate.Handlers](https://github.com/immediateplatform/immediate.handlers) + handlers. + - name: Ridge + url: https://github.com/Melchy/Ridge + description: Generates strongly-typed clients for API based on controller definition and internal application details. + - name: Safe-Routing + url: https://github.com/daviddotcs/safe-routing + description: Analyses a project's razor pages and MVC controllers, producing strongly-typed representations of those + routes as you type + - name: TypedSignalR.Client + url: https://github.com/nenoNaninu/TypedSignalR.Client + description: C# Source Generator to create strongly typed SignalR clients. + subcategories: + open-api: + name: Open Api + repositories: + - name: H.NSwag.Generator + url: https://github.com/HavenDV/H.NSwag.Generator + description: C# Source Generator for NSwag. + - name: SourceApi + url: https://github.com/alekshura/SourceApi + description: API first Open API code generator based on json or yaml definitions. It generates base abstract controllers + with docs, routes, that you inherit and implement in your controllers. + - name: ST.NSwag.ServerSourceGenerator + url: https://github.com/s-tarasov/ST.NSwag.ServerSourceGenerator + description: Generates Web API/ASP.NET Core controllers from a OpenAPI specification. + razor--blazor: + name: Razor / Blazor + repositories: + - name: Blazor.TSRuntime + url: https://github.com/BlackWhiteYoshi/Blazor.TSRuntime + description: An improved JSRuntime with automatic JS-module loading and caching, compile time errors instead of + runtime errors and nice IntelliSense guidance. + - name: BlazorInteropGenerator + url: https://github.com/surgicalcoder/BlazorInteropGenerator + description: Generates Blazor -> Javascript strongly typed interop methods, by parsing the Javascript it self and + generating extension methods for IJSRuntime. + - name: BlazorOcticons + url: https://github.com/BlazorOcticons/BlazorOcticons + description: Github [Octicons](https://primer.style/octicons/) created as a `.razor` components using source generator. + The generated components are available via the NuGet package, the generator itself is available as a separate + NuGet package. The project [website](https://blazorocticons.net/) is an example using the generated components. + - name: MiniRazor + url: https://github.com/Tyrrrz/MiniRazor + description: Portable Razor compiler & code generator. + - name: RazorPageRouteGenerator + url: https://github.com/surgicalcoder/RazorPageRouteGenerator + description: Generates methods with parameters for Razor and Blazor pages, so you can navigate without having to + guess URLs or parameters. + xaml--wpf--avalonia: + name: XAML / WPF / Avalonia + repositories: + - name: Avalonia.NameGenerator + url: https://github.com/AvaloniaUI/Avalonia.NameGenerator + description: Generates typed references to named [Avalonia](https://github.com/avaloniaui) XAML controls. + - name: boilerplatezero + url: https://github.com/IGood/boilerplatezero + description: WPF Dependency Property and Routed Event generator. + - name: DependencyPropertyGenerator + url: https://github.com/HavenDV/DependencyPropertyGenerator + description: Dependency property and routed event source generator for WPF/UWP/WinUI/Uno/Avalonia/MAUI platforms. + - name: WinUI-ObservableSettings + url: https://github.com/JasonWei512/WinUI-ObservableSettings + description: Generate boilerplates to read and write settings in packaged WinUI 3 app. + subcategories: + inotifypropertychanged: + name: INotifyPropertyChanged + repositories: + - name: PropertyChanged.SourceGenerator + url: https://github.com/canton7/PropertyChanged.SourceGenerator + description: Powerful INotifyPropertyChanged Source Generator, which generates INPC boilerplate for you as part + of your build. Supports features such as automatic and manual dependencies between properties, notifications when + specific properties change, and more. + - name: ValueChangedGenerator + url: https://github.com/ufcpp/ValueChangedGenerator + description: for generating PropertyChanged from inner struct members. + model-view-viewmodel-mvvm: + name: Model View Viewmodel (MVVM) + repositories: + - name: DevExpress.Mvvm.CodeGenerators + url: https://github.com/DevExpress/DevExpress.Mvvm.CodeGenerators + description: Generates boilerplate code for your View Models (INotifyPropertyChanged, Commands, IDataErrorInfo, + DevExpress services). Compatible with the Prism and MVVM Light libraries. + - name: Microsoft MVVM Toolkit + url: https://github.com/CommunityToolkit/dotnet + description: A modular MVVM library with support for source generators to reduce boilrplate and improve performance. + - name: MvvmGen + url: https://github.com/thomasclaudiushuber/mvvmgen + description: A lightweight MVVM library for XAML applications that generates your ViewModels with a C# Source Generator. + database--orm: + name: Database / ORM + repositories: + - name: AdaskoTheBeAsT.Identity.Dapper + url: https://github.com/AdaskoTheBeAsT/AdaskoTheBeAsT.Identity.Dapper + description: Custom Dapper implementation for Microsoft.Extensions.Identity.Stores (part of ASP.NET Core Identity) + - name: AutoDbSet + url: https://github.com/Atulin/AutoDbSet + description: Source Generator to automatically create `DbSet` properties on the `DbContext` from marked entities + - name: Breezy + url: https://github.com/Ludovicdln/Breezy + description: Micro ORM with source generator. + - name: Dynatello + url: https://github.com/inputfalken/Dynatello + description: A source generator for the low-level API of DynamoDB. + - name: EntityLengths.Generator + url: https://github.com/TarasKovalenko/EntityLengths.Generator + description: Source Generator designed to automatically generate string length constants from Entity Framework configurations + and data annotations. + - name: MapDataReader + url: https://github.com/jitbit/MapDataReader + description: Fast mapping `IDataReader` to a custom class + - name: NpgsqlSourceGenerators + url: https://github.com/Atulin/NpgsqlSourceGenerators + description: Source Generator to automatically register marked enums with NpgSQL for use with PostgreSQL + - name: SqlMarshal + url: https://github.com/kant2002/SqlMarshal + description: Native AOT friendly-performant mini-ORM. Generation of wrappers for accessing SQL using ADO.NET. + - name: TableStorage + url: https://github.com/StevenThuriot/TableStorage + description: Streamlined way of working with Azure Data Tables that mimics Entity Framework's way of working with DbSets. + Source Generators for the Table Entities to avoid any reflection calls being made, making it easier to use Azure Data + Tables in a NativeAOT project. + - name: Unflat + url: https://github.com/pstlnce/unflat + description: ORM for zero allocation fast parsing into complex classes/structs with custom type parsers support + statically-typed-resources--configurations: + name: Statically typed resources / configurations + repositories: + - name: dot-env-generator + url: https://github.com/RainwayApp/dot-env-generator + description: A source generator for C# that turns `.env` files into runtime constants. + - name: EnvVariablesGenerator + url: https://github.com/KAW0/EnvVariablesGenerator + description: Generate code from `.env` files that can be changed after build. + - name: NotNot.AppSettings + url: https://github.com/jasonswearingen/NotNot.AppSettings + description: Automatically create strongly typed C# settings objects from AppSettings.json. + - name: SourceConfig + url: https://github.com/alekshura/SourceConfig + description: Generates configuration POCO objects, lists, dictionaries in AOT based on *.json config files. + - name: StronglyTypedEmbeddedResources + url: https://github.com/surgicalcoder/StronglyTypedEmbeddedResources + description: Generates strongly typed names for Embedded Resources automatically. + - name: TxtToListGenerator + url: https://github.com/musictopia2/TxtToListGenerator + description: A source generator where if you have a text file as additional file and you have a list ordered by return + carriages, then it produces either a list of int or a list of string in c#. + text-templating: + name: Text templating + repositories: + - name: Transplator + url: https://github.com/atifaziz/Transplator + description: A simple C# source generator for text templates. + - name: Weave + url: https://github.com/otac0n/Weave + description: Weave is a text templating engine for .NET that is all about attention to detail. Weave handles the tricky + work of making your rendered text beautiful. + - name: TemplatePropertyGenerator + url: https://github.com/JKamsker/JKToolKit.TemplatePropertyGenerator + description: Generates strongly typed stringformatters based on Stringformats + other: + name: Other + repositories: + - name: AssemblyVersionInfo + url: https://github.com/BlackWhiteYoshi/AssemblyVersionInfo + description: AssemblyVersionInfo is a very simple source generator that generates constant strings of your assembly + name and version. The intended usage is for the System.CodeDom.Compiler.GeneratedCodeAttribute. + - name: AutoConstructor + url: https://github.com/k94ll13nn3/AutoConstructor + description: C# source generator that generates a constructor from readonly fields/properties in a class or struct. + - name: AutoFilterer.Generators + url: https://github.com/enisn/AutoFilterer/blob/develop/docs/generators/AutoFilterer-Generators.md + description: AutoFilterer.Generators aims to generate filter DTOs from entities automatically via using dotnet source + generators. + - name: AutoInterface + url: https://github.com/BlackWhiteYoshi/AutoInterface + description: AutoInterface is a source generator that generates an interface based on your class/struct. Basically, + you write your class and get the corresponding interface for free. + - name: AutoInvoke + url: https://github.com/LokiMidgard/AutoInvoke.Generator + description: A generator that generates a method that invokes a specified generic method, for every Type in your project + that satisfies a defined constraint. + - name: AutoLoggerMessage + url: https://github.com/stbychkov/AutoLoggerMessage + description: Automatically migrates your logging calls to the LoggerMessage (high-performance logging) version + - name: AutomaticInterface + url: https://github.com/codecentric/net_automatic_interface + description: Generate an Interface from a class. + - name: BigMachines + url: https://github.com/archi-Doc/BigMachines + description: BigMachines is State Machine library for .NET. + - name: BuildInformationGenerator + url: https://github.com/pekspro/BuildInformationGenerator + description: Adds build information, like build time, commit id and branch, as simple constants. + - name: CacheSourceGenerator + url: https://github.com/jeppevammenkristensen/cachesourcegenerator + description: Generates an IMemoryCache wrapper around a method call. + - name: Cloneable + url: https://github.com/mostmand/Cloneable + description: auto-generate Clone method. + - name: Credfeto.Version.Information.Generator + url: https://github.com/credfeto/credfeto-version-constants-generator + description: Minimal source generator for embedding build information as compile time constants. Constants added to + `VersionInformation` class in each assembly for `Version`, `Product`, `Company` and `Copyright`. + - name: CsCodeGenerator + url: https://github.com/borisdj/CsCodeGenerator + description: Easy C# class and code generation, POCO object and Methods creation. + - name: DataAnnotationValuesExtractor + url: https://github.com/pekspro/DataAnnotationValuesExtractor + description: Extracts values from data annotation attributes, like maximum string length, and exposes them as strongly-typed + constants. + - name: Dolly + url: https://github.com/AnderssonPeter/Dolly + description: auto-generate Clone & DeepClone method. + - name: Durian + url: https://github.com/piotrstenke/Durian + description: Extends the default capabilities of C# by mimicking features from other languages. + - name: Fairy + url: https://github.com/hermanussen/Fairy + description: generates C# code based on Sitecore Content Serialization (SCS) `.yml` files. + - name: FastGenericNew + url: https://github.com/Nyrest/FastGenericNew + description: The ultimate fast alternative to `Activator.CreateInstance` / `new T()`. Built on SourceGenerator V2 + (Incremental Generator). + - name: GitBuildInfo.SourceGenerator + url: https://github.com/Elskom/GitBuildInfo.SourceGenerator + description: for dumping the git information (commit hash, branch, the head description) into assembly level metadata + attributes. + - name: Hangfire.RecurringJob + url: https://github.com/IeuanWalker/Hangfire.RecurringJob + description: Automatically generates the recurring job registration code. + - name: IDisposableGenerator + url: https://github.com/Elskom/IDisposableGenerator + description: a Source Generator for Generating the Dispose functions in Disposables. All you have to do is mark them + with attributes and it will work from there. + - name: Lazysh + url: https://github.com/B1Z0N/LazyshGen + description: Lazy implementation of any interface. + - name: LinqGen + url: https://github.com/cathei/LinqGen + description: Alloc-free and fast replacement for Linq, with code generation. + - name: LoggingDecoratorGenerator + url: https://github.com/DavidFineboym/LoggingDecoratorGenerator + description: Generates logger decorator class for an interface. Uses Microsoft.Extensions.Logging.ILogger to log and + requires it in decorator class constructor. + - name: MemberAccessGenerator + url: https://github.com/ufcpp/MemberAccessGenerator + description: generates `GetMember(int)` and/or `GetMember(string)` methods that return property value for a given property + name or index (e.g. in positional records). + - name: MrMeeseeks.StaticDelegateGenerator + url: https://github.com/Yeah69/MrMeeseeks.StaticDelegateGenerator + description: Makes static classes and members injectable as dependency by generating delegating interfaces and their + implementing classes. + - name: Navitski.Crystalized + url: https://github.com/AlexNav73/Navitski.Crystalized + description: Generates domain model based on schema files. Generated model supports undo/redo, saving to/loading from + SQLite and Json files, precise changes tracking and more. + - name: PolySharp + url: https://github.com/Sergio0694/PolySharp + description: Provides generated, source-only polyfills for C# language features, to easily use all runtime-agnostic + features downlevel. + - name: PrimaryConstructor + url: https://github.com/chaowlert/PrimaryConstructor + description: Generate primary constructor from readonly fields. + - name: PrimitiveStaticDataGenerator + url: https://github.com/iiweis/PrimitiveStaticDataGenerator + description: for creating methods that return optimized `ReadOnlySpan` static data from primitive values. + - name: PrintMembersGenerator + url: https://github.com/Youssef1313/PrintMembersGenerator + description: helps re-defining C# record's PrintMembers method to force include/exclude certain members. + - name: QuickConstructor + url: https://github.com/flavien/QuickConstructor + description: A reliable and feature-rich source generator that can automatically emit a constructor from the fields + and properties of a class. It can also generate null checks based on nullable reference types annotations. + - name: SmallSharp + url: https://github.com/kzu/SmallSharp + description: Create, edit and run multiple C# 9.0 top-level programs in the same project by just selecting the startup + program from the start button. + - name: SmartAnnotations + url: https://github.com/fiseni/SmartAnnotations + description: A library that uses source generators to automatically generate data annotations for your models. It provides + a strongly-typed mechanism (fluent like API) to define your annotation rules. + - name: StringLiteralGenerator + url: https://github.com/ufcpp/StringLiteralGenerator + description: for optimizing UTF-8 binaries. + - name: SyncMethodGenerator + url: https://github.com/zompinc/sync-method-generator + description: Generates a synchronized method from your async code. + - name: ThisAssembly + url: https://github.com/kzu/ThisAssembly + description: Exposes project and assembly level information as constants in the ThisAssembly class. + - name: ToString + url: https://github.com/Burgyn/MMLib.ToString + description: C# source generator for implementing `ToString` override like `record` type. + - name: TupleOverloadGenerator + url: https://github.com/ProphetLamb/TupleOverloadGenerator + description: Overload `params` array parameter with tuples avoiding heap allocations. + - name: ValueLink + url: https://github.com/archi-Doc/ValueLink + description: A C# Library for creating and managing multiple links between objects. +meta: +- name: AttributeFactoryGenerator + url: https://github.com/PaulBraetz/AttributeFactoryGenerator + description: Generate factories to easily parse actual attribute instances from symbol data. +- name: AttributesSourceGeneratorHelper + url: https://github.com/musictopia2/AttributesSourceGeneratorHelper + description: A source generator to help another generator by producing attributes. Anything that inherits from Attribute + will be sent to the client so you don't have to build strings for attributes. +- name: CommonSourceGeneratorsHelpers + url: https://github.com/musictopia2/CommonSourceGeneratorsHelpers + description: A generator to create many helpers for source generators to use to make up that its very difficult to reference + third party libraries in source generators including extensions and a source code string builder. +- name: HotReload + url: https://github.com/andrzejolszak/BuilderGeneratorHotReload + description: A simple hack to enable hot reload in Visual Studio Intellisense when developing a source generator project + together with an example dependent client project inside a single solution. +- name: SourceGeneratorUtils + url: https://github.com/thenameless314159/SourceGeneratorUtils + description: An essential library equipped with utility functions and helpers to aid in writing source files for source + generators or for general purposes. Based on the `System.Text.Json` source generator architecture for best-practices. +- name: SourceGenerator.Helper.CopyCode + url: https://github.com/LokiMidgard/SourceGenerator.Helper.CopyCode + description: A simple Generator that generates a string representation to an annotated Type. +articles: +- '[Title](URL) (YYYY-MM-DD) short description.' +- '[Series: Creating a source generator](https://andrewlock.net/series/creating-a-source-generator/) (2022-02-01) Complete + series about how to create an incremental source generator, using the APIs introduced in .NET 6.' +- '[Mastering at Source Generators](https://medium.com/c-sharp-progarmming/mastering-at-source-generators-18125a5f3fca) (2022-01-15) + Generating CRUD controller from DTO model using text template.' +- '[Using C# Source Generators to create an external DSL](https://devblogs.microsoft.com/dotnet/using-c-source-generators-to-create-an-external-dsl/) + (2021-01-27) that shows how to implement a simple DSL.' +- '[4 ways to generate code in C# — Including Source Generators in .NET 5](https://levelup.gitconnected.com/four-ways-to-generate-code-in-c-including-source-generators-in-net-5-9e6817db425) + (2021-01-19) demonstrates the comparison between Source Generators, T4 template and Reflection, etc.' +- '[.NET 5 Source Generators - MediatR - CQRS - OMG!](https://www.edument.se/en/blog/post/net-5-source-generators-mediatr-cqrs) + (2020-12-16) explores how source generators can be used to automatically generate an API for a system using the MediatR + library and the CQRS pattern.' +- '[Source Generators in .NET 5 with ReSharper](https://blog.jetbrains.com/dotnet/2020/11/12/source-generators-in-net-5-with-resharper/) + (2020-11-20) introduces source generators and briefly mentions how they are being worked into the ReSharper product.' +- '[Source Generators - real world example](https://dominikjeske.github.io/source-generators) (2020-11-09) contains a rich + and deep dive into a real world generator with lots of useful tips.' +- '[How to profile C# 9.0 Source Generators](https://jaylee.org/archive/2020/10/10/profiling-csharp-9-source-generators.html) + (2020-10-10) demonstrates how to profile your source generator using the [performance profiling tools built into Visual + Studio](https://docs.microsoft.com/en-us/visualstudio/profiling/?view=vs-2019).' +- '[How to Debug C# 9 Source Code Generators](https://nicksnettravels.builttoroam.com/debug-code-gen/) (2020-10-09) contains + debugging tips.' +- '[How to generate code using Roslyn source generators in real world scenarios](https://www.cazzulino.com/source-generators.html) + (2020-09-17) rich story of how ThisAssembly generator was written using Scriban templates.' +- '[.NET Blog ''New C# Source Generator Samples'' post](https://devblogs.microsoft.com/dotnet/new-c-source-generator-samples/) + (2020-08-25) that shows some simple samples.' +- '[.NET Blog ''Introducing C# Source Generators'' post](https://devblogs.microsoft.com/dotnet/introducing-c-source-generators/) + (2020-04-29) that announces the feature.' +videos: +- '[Title](URL) (YYYY-MM-DD) short description.' +- '[C# Source Generators - Write code that writes code - David Wengier](https://www.youtube.com/watch?v=pqLs7X6Cr6s) (2020-11-13) + Roslyn dev takes deep dive into the topic.' +- '[.NET Languages and Runtime Community Standup - Source Generators](https://www.youtube.com/watch?v=A4479Etdx4I) (2020-10-08) + shows how Generators work and how they can be tested.' +- '[Channel 9 ''Source Generators in C#''](https://channel9.msdn.com/Shows/Visual-Studio-Toolbox/Source-Generators-in-CSharp) + (2020-08-12) has Roslyn PMs discussing the feature.' +demo_projects: +- name: Compile Time Method Execution Generator + url: https://github.com/hermanussen/CompileTimeMethodExecutionGenerator + description: proof of concept that allows executing a method during compilation, so that it can be really fast during runtime. +- name: DpdtInject + url: https://github.com/lsoft/DpdtInject + description: DI container based on C# Source Generators. Its goal is to remove everything possible from runtime and make + resolving process as faster as we can. This is achieved by transferring huge piece of resolving logic to the compilation + stage into the source generator. +- name: jakubsturc/talk-csharp-source-generators + url: https://github.com/jakubsturc/talk-csharp-source-generators/tree/master/demo/SourceGeneratorSamples + description: 'contains 4 generators: AutoNotify, ConsoleWritelineHijack, HelloWorld and SettingsXml, plus nice presentation + slides.' +- name: RyanAlameddine/SourceGeneratorDemo + url: https://github.com/RyanAlameddine/SourceGeneratorDemo + description: 'contains 3 demos: hello world, INPC and OpCode class.' +- name: TMC-CSharp/CodeExerciseLibrary + url: https://github.com/TMC-CSharp/CodeExerciseLibrary + description: Library to help creating C# exercises. Generates missing methods and classes inside tests on the fly by using + Source Generators. +projects_using_generators: +- name: Elskom/Sdk + url: https://github.com/Elskom/Sdk + description: Dumps git repository data to assembly level metadata attributes that can be checked at runtime for things like + trapping if a user is using an possibly unstable build of the libraries built in the repository and so the user can see + a message about it (and optionally opt into running the possibly unstable code). +- name: Heroicons.AspNetCore + url: https://github.com/tompazourek/Heroicons.AspNetCore + description: '[Heroicons](https://heroicons.com/) that are easy to use in ASP.NET Core MVC as TagHelpers.' +- name: HydraScript + url: https://github.com/Stepami/hydrascript + description: TypeScript & Go inspired small interpreted programming language written in C# that uses Source Generator to + build large regular expression for lexical analysis. The regex value is passed to `[GeneratedRegex]` attribute, so this + internal generator generates the input for another generator. +- name: NetFabric.Hyperlinq + url: https://github.com/NetFabric/NetFabric.Hyperlinq + description: generates overloads for its extension methods. +- name: RestEase + url: https://github.com/canton7/RestEase + description: uses Source Generator to generate interface implementations on compile time instead of in runtime via Reflection.Emit. +- name: WarHub/wham + url: https://github.com/WarHub/wham + description: generates code for immutable tree object graph based on red-green node approach used in Roslyn; generates custom + XmlSerializer that supports C#9 records and ImmutableArray. +tips_and_tricks: "Collection of tips and tricks (simple and brief to fit in Tweet):\n\n[Tweeted](https://twitter.com/raboof/status/1397296571801288704)\ + \ by [@raboof](https://twitter.com/raboof) on May 25 2021 at 23:00:\n\n> TIL to debug a source generator in VS 16.10: upgrade\ + \ [Microsoft.CodeAnalysis.CSharp to 3.10.\\*](https://www.nuget.org/packages/Microsoft.CodeAnalysis.CSharp/3.10.0-3.final),\ + \ add `true` to source generator project, select **Roslyn Component** for **Launch**\ + \ in **Project Properties Debug** page, choose **Target** then F5 :rocket:\n>\n> ![Source Generator debugger](https://docs.microsoft.com/en-us/visualstudio/releases/2019/media/16.10/16.10_p2_source_generators_debugger.png)\n\ + \n[Tweeted](https://twitter.com/raboof/status/1328426892882550784) by [@raboof](https://twitter.com/raboof) on Nov 16 2020\ + \ at 20:57:\n\n> See files emitted by [#SourceGenerators] by adding these properties to your (*.csproj) project file:\n\ + >\n> ```xml\n> true\n> $(BaseIntermediateOutputPath)Generated\n\ + > ```\n\n[Tweeted](https://twitter.com/Chiser99/status/1301198611158499328) by [@Chiser99](https://twitter.com/Chiser99)\ + \ on Sep 02 2020 at 06:41:\n\n> I made a thing: https://github.com/chsienki/Kittitas\n>\n> If you're building Roslyn Source\ + \ Generators or Analyzers check it out, it makes debugging them inside the compiler easier. #roslyn #csharp #dotnetcore\ + \ #sourcegenerators #analyzers\n\nBuild failed in WPF projects [microsoft/CsWin32#7](https://github.com/microsoft/CsWin32/issues/7):\n\ + \n> If your build failed in a *_wpftmp.csproj file you need to add following property to your (*.csproj) project file:\n\ + > ```xml\n> true\n> ```\n\ + >\n> and use at least .NET 5.0.102 SDK\n\n [#SourceGenerators]: https://twitter.com/hashtag/SourceGenerators?src=hashtag_click\n\ + \ [#sourcegenerators]: https://twitter.com/hashtag/sourcegenerators?src=hashtag_click\n [#roslyn]: https://twitter.com/hashtag/roslyn?src=hashtag_click\n\ + \ [#csharp]: https://twitter.com/hashtag/csharp?src=hashtag_click\n [#dotnetcore]: https://twitter.com/hashtag/dotnetcore?src=hashtag_click\n\ + \ [#analyzers]: https://twitter.com/hashtag/analyzers?src=hashtag_click\n\nReference local projects or embed NuGet packages\ + \ to source generator assemblies [dotnet/roslyn#47517](https://github.com/dotnet/roslyn/discussions/47517#discussioncomment-64145):\n\ + \n⚠ Please be aware that this may result in crashes, when another generator or SDK component loads such an assembly with\ + \ lower version. If you can, please avoid embedding additional DLLs/packages.\n\n> You can add a dependency to a source\ + \ generator in the same solution through three steps:\n> \n> 1. Add a ``, making sure to set both `GeneratePathProperty=\"\ + true\"` and `PrivateAssets=\"all\"`\n> 2. Add a build target to add `` elements as\ + \ part of GetTargetPath, and add all the required dependency assemblies inside this target, making sure to set `IncludeRuntimeDependency=\"\ + false\"`\n> 3. Update `` to ensure the target from the previous step is used\n> \n> You can see\ + \ an example of these steps here:\n> https://github.com/dotnet/roslyn-sdk/blob/0313c80ed950ac4f4eef11bb2e1c6d1009b328c4/samples/CSharp/SourceGenerators/SourceGeneratorSamples/SourceGeneratorSamples.csproj#L13-L30" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3aecde9 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pyyaml>=6.0 diff --git a/scripts/extract_data.py b/scripts/extract_data.py new file mode 100755 index 0000000..590e4bc --- /dev/null +++ b/scripts/extract_data.py @@ -0,0 +1,223 @@ +#!/usr/bin/env python3 +""" +Extracts repository data from existing README.md into YAML format. +""" + +import re +import yaml +from pathlib import Path +from typing import Dict, List, Any, Optional + + +def parse_repository_line(line: str) -> Optional[Dict[str, Any]]: + """Parse a repository entry line.""" + # Pattern: - [Name](URL) - ![stars](...) ![last commit](...) Description + # or: - [Name](URL) -![stars](...) ![last commit](...) Description + # or: - [Name](URL) ![stars](...) ![last commit](...) - Description + + match = re.match(r'-\s+\[([^\]]+)\]\(([^)]+)\)\s*(-?)\s*!\[stars\]', line) + if not match: + return None + + name = match.group(1) + url = match.group(2) + + # Extract description (everything after the badges) + # Remove badges + desc_match = re.search(r'!\[last commit\][^)]+\)\s*(-?\s*)?(.*)$', line) + description = desc_match.group(2).strip() if desc_match and desc_match.group(2) else "" + + return { + 'name': name, + 'url': url, + 'description': description + } + + +def extract_readme_data() -> Dict[str, Any]: + """Extract data from README.md.""" + readme_path = Path(__file__).parent.parent / "README.md" + with open(readme_path, 'r', encoding='utf-8') as f: + content = f.read() + + lines = content.split('\n') + + data = { + 'header': { + 'title': 'C# Source Generators' + }, + 'table_of_contents': [ + {'name': 'Documentation and samples', 'anchor': 'documentation-and-samples'}, + {'name': 'Source Generators', 'anchor': 'source-generators'}, + {'name': 'Meta - libs and generators for other generators', 'anchor': 'meta---libs-and-generators-for-other-generators'}, + {'name': 'Tips & Tricks', 'anchor': 'tips--tricks'}, + {'name': 'Articles', 'anchor': 'articles'}, + {'name': 'Videos', 'anchor': 'videos'}, + {'name': 'Demo, PoC and excercise projects', 'anchor': 'demo-poc-and-excercise-projects'}, + {'name': 'Projects using custom Source Generators "internally"', 'anchor': 'projects-using-custom-source-generators-internally'} + ], + 'introduction': [ + "A list of C# Source Generators (not necessarily awesome), because I haven't found a good list yet.", + "", + "**C# Source Generators** is a Roslyn compiler feature introduced in C#9/.NET 5. It lets C# developers inspect user code and generate new C# source files that can be added to a compilation.", + "", + "Add GitHub topic [`csharp-sourcegenerator`](https://github.com/topics/csharp-sourcegenerator) to your generator repo - let's get it started!" + ], + 'documentation': [], + 'categories': {}, + 'meta': [], + 'articles': [], + 'videos': [], + 'demo_projects': [], + 'projects_using_generators': [] + } + + current_section = None + current_category = None + current_subcategory = None + i = 0 + + while i < len(lines): + line = lines[i].strip() + + # Detect sections + if line == "## Documentation and samples": + current_section = 'documentation' + current_category = None + i += 1 + continue + elif line == "## Source Generators": + current_section = 'source_generators' + current_category = None + i += 1 + continue + elif line == "## Meta - libs and generators for other generators": + current_section = 'meta' + current_category = None + i += 1 + continue + elif line == "## Tips & Tricks": + current_section = 'tips_and_tricks' + # Capture the entire section + tips_lines = [] + i += 1 + while i < len(lines) and not lines[i].strip().startswith('## '): + tips_lines.append(lines[i]) + i += 1 + data['tips_and_tricks'] = '\n'.join(tips_lines).strip() + continue + elif line == "## Articles": + current_section = 'articles' + i += 1 + continue + elif line == "## Videos": + current_section = 'videos' + i += 1 + continue + elif line == "## Demo, PoC and excercise projects": + current_section = 'demo_projects' + i += 1 + continue + elif line == '## Projects using custom Source Generators "internally"': + current_section = 'projects_using_generators' + i += 1 + continue + + # Handle documentation section + if current_section == 'documentation' and line.startswith('- '): + data['documentation'].append(line[2:]) # Remove '- ' + + # Handle categories + elif current_section == 'source_generators': + if line.startswith('### '): + # Main category + category_name = line[4:].strip() + category_id = category_name.lower().replace(' ', '-').replace('/', '-').replace('(', '').replace(')', '').replace('--', '-') + current_category = category_id + data['categories'][category_id] = { + 'name': category_name, + 'repositories': [] + } + current_subcategory = None + elif line.startswith('#### '): + # Subcategory + subcategory_name = line[5:].strip() + subcategory_id = subcategory_name.lower().replace(' ', '-').replace('/', '-').replace('(', '').replace(')', '').replace('--', '-') + current_subcategory = subcategory_id + if current_category: + if 'subcategories' not in data['categories'][current_category]: + data['categories'][current_category]['subcategories'] = {} + data['categories'][current_category]['subcategories'][subcategory_id] = { + 'name': subcategory_name, + 'repositories': [] + } + elif line.startswith('- [') and current_category: + repo = parse_repository_line(line) + if repo: + if current_subcategory: + data['categories'][current_category]['subcategories'][current_subcategory]['repositories'].append(repo) + else: + data['categories'][current_category]['repositories'].append(repo) + + # Handle meta section + elif current_section == 'meta' and line.startswith('- ['): + repo = parse_repository_line(line) + if repo: + data['meta'].append(repo) + + # Handle articles + elif current_section == 'articles' and line.startswith('- ['): + data['articles'].append(line[2:]) # Remove '- ' + + # Handle videos + elif current_section == 'videos' and line.startswith('- ['): + data['videos'].append(line[2:]) # Remove '- ' + + # Handle demo projects + elif current_section == 'demo_projects' and line.startswith('- ['): + repo = parse_repository_line(line) + if repo: + data['demo_projects'].append(repo) + + # Handle projects using generators + elif current_section == 'projects_using_generators' and line.startswith('- ['): + repo = parse_repository_line(line) + if repo: + data['projects_using_generators'].append(repo) + + i += 1 + + return data + + +def main(): + """Main entry point.""" + print("Extracting data from README.md...") + data = extract_readme_data() + + output_file = Path(__file__).parent.parent / "data" / "repositories.yml" + with open(output_file, 'w', encoding='utf-8') as f: + yaml.dump(data, f, default_flow_style=False, allow_unicode=True, sort_keys=False, width=120) + + print(f"✓ Data extracted to {output_file}") + + # Print some stats + total_repos = sum(len(cat.get('repositories', [])) for cat in data['categories'].values()) + total_repos += sum( + len(subcat.get('repositories', [])) + for cat in data['categories'].values() + if 'subcategories' in cat + for subcat in cat['subcategories'].values() + ) + total_repos += len(data.get('meta', [])) + total_repos += len(data.get('demo_projects', [])) + total_repos += len(data.get('projects_using_generators', [])) + + print(f" Categories: {len(data['categories'])}") + print(f" Total repositories: {total_repos}") + print(f" Articles: {len(data.get('articles', []))}") + print(f" Videos: {len(data.get('videos', []))}") + + +if __name__ == '__main__': + main() diff --git a/scripts/render_readme.py b/scripts/render_readme.py new file mode 100755 index 0000000..e21ec33 --- /dev/null +++ b/scripts/render_readme.py @@ -0,0 +1,225 @@ +#!/usr/bin/env python3 +""" +Renders README.md from YAML data files. +""" + +import yaml +import re +from pathlib import Path +from typing import Dict, List, Any + + +def load_data() -> Dict[str, Any]: + """Load data from YAML file.""" + data_file = Path(__file__).parent.parent / "data" / "repositories.yml" + with open(data_file, 'r', encoding='utf-8') as f: + return yaml.safe_load(f) + + +def generate_badge_urls(repo_url: str) -> Dict[str, str]: + """Generate GitHub badge URLs for a repository.""" + # Extract owner/repo from URL + match = re.search(r'github\.com/([^/]+/[^/]+)', repo_url) + if not match: + return {} + + repo_path = match.group(1).rstrip('/') + + return { + 'stars': f'![stars](https://img.shields.io/github/stars/{repo_path}?style=flat-square&cacheSeconds=604800)', + 'last_commit': f'![last commit](https://img.shields.io/github/last-commit/{repo_path}?style=flat-square&cacheSeconds=86400)' + } + + +def render_repository_entry(repo: Dict[str, Any]) -> str: + """Render a single repository entry.""" + name = repo['name'] + url = repo['url'] + description = repo.get('description', '') + + badges = generate_badge_urls(url) + badges_str = f" {badges['stars']} {badges['last_commit']}" if badges else "" + + # Handle special spacing before the dash in description + spacing = " -" if description and not description.startswith('-') else "" + + return f"- [{name}]({url}){spacing}{badges_str}{' ' + description if description else ''}" + + +def render_category(category: Dict[str, Any], category_id: str) -> str: + """Render a category section.""" + lines = [] + + # Category header + category_name = category.get('name', category_id.replace('-', ' ').title()) + lines.append(f"### {category_name}") + lines.append("") + + # Repositories + repositories = category.get('repositories', []) + for repo in repositories: + lines.append(render_repository_entry(repo)) + + lines.append("") + return '\n'.join(lines) + + +def render_categories_list(categories: Dict[str, Dict[str, Any]]) -> str: + """Render the categories list in the table of contents.""" + lines = [] + for cat_id, cat_data in categories.items(): + cat_name = cat_data.get('name', cat_id.replace('-', ' ').title()) + # Create anchor from category name + anchor = cat_name.lower().replace(' ', '-').replace('/', '-').replace('(', '').replace(')', '') + lines.append(f"- [{cat_name}](#{anchor})") + + # Handle subcategories + if 'subcategories' in cat_data: + for subcat_id, subcat_data in cat_data['subcategories'].items(): + subcat_name = subcat_data.get('name', subcat_id.replace('-', ' ').title()) + subcat_anchor = subcat_name.lower().replace(' ', '-').replace('/', '-').replace('(', '').replace(')', '') + lines.append(f" - [{subcat_name}](#{subcat_anchor})") + + return '\n'.join(lines) + + +def render_readme(data: Dict[str, Any]) -> str: + """Render the complete README.md content.""" + lines = [] + + # Header + header = data.get('header', {}) + lines.append(f"# {header.get('title', 'C# Source Generators')}") + lines.append("") + + # Table of contents + if 'table_of_contents' in data: + for section in data['table_of_contents']: + lines.append(f" * [{section['name']}](#{section['anchor']})") + lines.append("") + + lines.append("---") + lines.append("") + + # Introduction + if 'introduction' in data: + for para in data['introduction']: + lines.append(para) + lines.append("") + + # Documentation section + if 'documentation' in data: + lines.append("## Documentation and samples") + lines.append("") + for item in data['documentation']: + lines.append(f"- {item}") + lines.append("") + + # Source Generators section + lines.append("## Source Generators") + lines.append("") + lines.append("
") + lines.append(" Categories") + lines.append("") + lines.append(render_categories_list(data.get('categories', {}))) + lines.append("") + lines.append("
") + lines.append("") + + # Template comment + lines.append("") + lines.append("") + + # Render categories + categories = data.get('categories', {}) + for cat_id, cat_data in categories.items(): + lines.append(render_category(cat_data, cat_id)) + + # Handle subcategories + if 'subcategories' in cat_data: + for subcat_id, subcat_data in cat_data['subcategories'].items(): + lines.append(render_category(subcat_data, subcat_id)) + + # Meta section + if 'meta' in data: + lines.append("## Meta - libs and generators for other generators") + lines.append("") + lines.append("") + lines.append("") + for repo in data['meta']: + lines.append(render_repository_entry(repo)) + lines.append("") + + # Tips & Tricks section (keep as-is from data) + if 'tips_and_tricks' in data: + lines.append("## Tips & Tricks") + lines.append("") + lines.append(data['tips_and_tricks']) + lines.append("") + + # Articles section + if 'articles' in data: + lines.append("## Articles") + lines.append("") + lines.append("") + for article in data['articles']: + lines.append(f"- {article}") + lines.append("") + + # Videos section + if 'videos' in data: + lines.append("## Videos") + lines.append("") + lines.append("") + lines.append("") + for video in data['videos']: + lines.append(f"- {video}") + lines.append("") + + # Demo projects section + if 'demo_projects' in data: + lines.append("## Demo, PoC and excercise projects") + lines.append("") + lines.append("Maybe they can inspire you too!") + lines.append("") + for repo in data['demo_projects']: + lines.append(render_repository_entry(repo)) + lines.append("") + + # Projects using generators internally + if 'projects_using_generators' in data: + lines.append('## Projects using custom Source Generators "internally"') + lines.append("") + for repo in data['projects_using_generators']: + lines.append(render_repository_entry(repo)) + lines.append("") + + return '\n'.join(lines) + + +def main(): + """Main entry point.""" + data = load_data() + readme_content = render_readme(data) + + output_file = Path(__file__).parent.parent / "README.md" + with open(output_file, 'w', encoding='utf-8') as f: + f.write(readme_content) + + print(f"✓ README.md generated successfully") + + +if __name__ == '__main__': + main() diff --git a/scripts/validate_data.py b/scripts/validate_data.py new file mode 100755 index 0000000..29ca82d --- /dev/null +++ b/scripts/validate_data.py @@ -0,0 +1,205 @@ +#!/usr/bin/env python3 +""" +Validates the YAML data file for correctness. +""" + +import yaml +import re +import sys +from pathlib import Path +from typing import Dict, List, Any, Set +from urllib.parse import urlparse + + +def validate_url(url: str) -> bool: + """Validate that a URL is well-formed.""" + try: + result = urlparse(url) + return all([result.scheme, result.netloc]) + except: + return False + + +def validate_github_url(url: str) -> bool: + """Validate that a URL is a GitHub URL.""" + return 'github.com' in url.lower() + + +def check_duplicates(data: Dict[str, Any]) -> List[str]: + """Check for duplicate repository URLs.""" + errors = [] + all_urls: Set[str] = set() + + def add_repos(repos: List[Dict], section_name: str): + for repo in repos: + url = repo.get('url', '') + if url in all_urls: + errors.append(f"Duplicate URL found in {section_name}: {url}") + all_urls.add(url) + + # Check categories + for cat_id, cat_data in data.get('categories', {}).items(): + add_repos(cat_data.get('repositories', []), f"category '{cat_id}'") + + # Check subcategories + for subcat_id, subcat_data in cat_data.get('subcategories', {}).items(): + add_repos(subcat_data.get('repositories', []), f"subcategory '{subcat_id}'") + + # Check other sections + add_repos(data.get('meta', []), 'meta') + add_repos(data.get('demo_projects', []), 'demo_projects') + add_repos(data.get('projects_using_generators', []), 'projects_using_generators') + + return errors + + +def validate_repository(repo: Dict[str, Any], location: str) -> List[str]: + """Validate a single repository entry.""" + errors = [] + + # Check required fields + if 'name' not in repo: + errors.append(f"{location}: Missing 'name' field") + elif not repo['name'].strip(): + errors.append(f"{location}: 'name' is empty") + + if 'url' not in repo: + errors.append(f"{location}: Missing 'url' field") + else: + url = repo['url'] + if not validate_url(url): + errors.append(f"{location}: Invalid URL format: {url}") + elif not validate_github_url(url): + errors.append(f"{location}: URL is not a GitHub URL: {url}") + + # Description is optional, but if present should not be empty + if 'description' in repo and not repo['description'].strip(): + errors.append(f"{location}: 'description' field is present but empty") + + return errors + + +def validate_category(category: Dict[str, Any], cat_id: str, is_subcategory: bool = False) -> List[str]: + """Validate a category.""" + errors = [] + cat_type = "Subcategory" if is_subcategory else "Category" + + # Check for name + if 'name' not in category: + errors.append(f"{cat_type} '{cat_id}': Missing 'name' field") + + # Validate repositories + repositories = category.get('repositories', []) + if not isinstance(repositories, list): + errors.append(f"{cat_type} '{cat_id}': 'repositories' must be a list") + else: + for i, repo in enumerate(repositories): + if not isinstance(repo, dict): + errors.append(f"{cat_type} '{cat_id}', repository {i}: Must be a dictionary") + else: + repo_errors = validate_repository(repo, f"{cat_type} '{cat_id}', repository '{repo.get('name', f'#{i}')}'") + errors.extend(repo_errors) + + return errors + + +def validate_data(data: Dict[str, Any]) -> List[str]: + """Validate the entire data structure.""" + errors = [] + + # Validate header + if 'header' not in data: + errors.append("Missing 'header' section") + elif 'title' not in data['header']: + errors.append("Missing 'title' in header") + + # Validate categories + if 'categories' not in data: + errors.append("Missing 'categories' section") + else: + for cat_id, cat_data in data['categories'].items(): + if not isinstance(cat_data, dict): + errors.append(f"Category '{cat_id}': Must be a dictionary") + continue + + errors.extend(validate_category(cat_data, cat_id)) + + # Validate subcategories + if 'subcategories' in cat_data: + for subcat_id, subcat_data in cat_data['subcategories'].items(): + if not isinstance(subcat_data, dict): + errors.append(f"Subcategory '{cat_id}/{subcat_id}': Must be a dictionary") + continue + errors.extend(validate_category(subcat_data, f"{cat_id}/{subcat_id}", is_subcategory=True)) + + # Validate meta + if 'meta' in data: + for i, repo in enumerate(data['meta']): + repo_errors = validate_repository(repo, f"Meta repository '{repo.get('name', f'#{i}')}'") + errors.extend(repo_errors) + + # Validate demo_projects + if 'demo_projects' in data: + for i, repo in enumerate(data['demo_projects']): + repo_errors = validate_repository(repo, f"Demo project '{repo.get('name', f'#{i}')}'") + errors.extend(repo_errors) + + # Validate projects_using_generators + if 'projects_using_generators' in data: + for i, repo in enumerate(data['projects_using_generators']): + repo_errors = validate_repository(repo, f"Project using generators '{repo.get('name', f'#{i}')}'") + errors.extend(repo_errors) + + # Check for duplicates + duplicate_errors = check_duplicates(data) + errors.extend(duplicate_errors) + + return errors + + +def main(): + """Main entry point.""" + data_file = Path(__file__).parent.parent / "data" / "repositories.yml" + + print(f"Validating {data_file}...") + + # Load YAML + try: + with open(data_file, 'r', encoding='utf-8') as f: + data = yaml.safe_load(f) + except yaml.YAMLError as e: + print(f"❌ YAML parsing error: {e}") + sys.exit(1) + except FileNotFoundError: + print(f"❌ File not found: {data_file}") + sys.exit(1) + + # Validate + errors = validate_data(data) + + if errors: + print(f"\n❌ Validation failed with {len(errors)} error(s):\n") + for error in errors: + print(f" - {error}") + sys.exit(1) + else: + print("✓ Validation passed!") + + # Print stats + total_repos = sum(len(cat.get('repositories', [])) for cat in data['categories'].values()) + total_repos += sum( + len(subcat.get('repositories', [])) + for cat in data['categories'].values() + if 'subcategories' in cat + for subcat in cat['subcategories'].values() + ) + total_repos += len(data.get('meta', [])) + total_repos += len(data.get('demo_projects', [])) + total_repos += len(data.get('projects_using_generators', [])) + + print(f" Categories: {len(data['categories'])}") + print(f" Total repositories: {total_repos}") + + +if __name__ == '__main__': + main()