Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .config/purview-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# The purview.dev catalogue record for this project (ADR 0013 in purview-dev/purview-dev).
# The site reads this file from the default branch of this repository, so the record
# changes in the same pull request as the thing it describes.
#
# `$schema` is an editor hint and nothing more: the enforcing validation is the site's
# loader, which `just check-projects` runs there.
$schema: https://raw.githubusercontent.com/purview-dev/purview-dev/main/src/src/lib/manifest/schema.ts

id: sourcegenerator-framework
name: SourceGenerator Framework
shortDescription: A typed framework for building incremental C# source generators.
description: >-
A strongly typed framework for building, testing, and maintaining
incremental C# source generators with Roslyn. Includes structured code
generation, attribute data models, type libraries, and a step-cache test
runner for verifying incremental behaviour.
origin: >-
Building several incremental generators exposed the same needs for typed models, structured
output, testing, and cache verification, so those foundations became a shared framework.
useWhen: >-
You are building a non-trivial incremental C# source generator and want reusable modelling,
code-writing, packaging, and testing infrastructure.
avoidWhen: >-
Your generator is small enough for the Roslyn APIs directly, or adopting a framework would
hide behaviour your implementation needs to control precisely.
repository: purview-dev/sourcegenerator-framework
category: source-generation
status: stable
featured: true
order: 40
docs:
source: github-path
path: docs/wiki
rootPage: Getting-Started.md
exclude:
- _Sidebar.md
- Home.md
- index.md
targetFrameworks:
- net10.0
- net11.0
packages:
- id: Purview.SourceGeneratorFramework
description: Core helpers, models, and MSBuild integration for incremental generators.
primary: true
targetFrameworks:
- netstandard2.0
- id: Purview.SourceGeneratorFramework.Testing
description: Framework-agnostic test runner and assertions for generator tests.
- id: Purview.SourceGeneratorFramework.Testing.TUnit
description: TUnit-specific test base classes and assertions.
useCases:
- audience: contributor
title: Build an incremental generator on typed foundations
scenario: >-
You are writing a non-trivial incremental C# source generator and need typed attribute
models, structured code output, and packaging that Roslyn will actually load.
code: |
<ProjectReference
Include="..\MyGenerator\MyGenerator.csproj"
PrivateAssets="all"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false"
/>
language: xml
outcome: >-
The framework supplies attribute-data models, a structured code writer, a type library, and
packaging helpers so the generator stays focused on its own logic.
evidence: >-
The Purview generators themselves are built on the framework, so it is exercised by real
generators rather than being an untested abstraction.
docsPage: guide
- audience: contributor
title: Verify incremental behaviour in tests
scenario: >-
You need to prove a generator is incremental and produces the code you expect, without
assembling a Roslyn driver by hand in every test.
outcome: >-
The testing package provides SourceGeneratorTestRunner<TGenerator>, a framework-agnostic test
base, and assertions such as AssertSingleGeneratedSource and AssertNoCompilationErrors.
evidence: >-
Step-cache tests and a TUnit integration ship alongside the runner, so incremental regressions
surface in CI.
docsPage: testing
Loading