Testing section, generator guide, and less rationale - #29
Merged
Conversation
Testing was one page filed under "Everything else". It is now a section of its own between Getting started and Registering in bulk, split into what each part is actually for: running tests against a module, substituting and supplying values, and asserting on the registrations themselves. Adds "Writing your own generator" at the end of Everything else, documenting the extension points DependencyModules.Conventions is built on — IDependencyModuleSourceGenerator, BaseSourceGenerator, BaseAttributeSourceGenerator, emitting through DependencyFileWriter, and the analyzer packaging that is unforgiving in ways only visible after someone installs the package. It keeps its reasoning, because its readers are writing a generator and the reasoning is the content. Everywhere else the reasoning is gone. The pages were explaining why the library was designed the way it was — why the interface name appears twice, why an assembly is always named, why there is no default lifetime, what would have happened had we chosen otherwise. A reader wants to know what to write and what will happen, not what was weighed. Roughly forty passages cut or rewritten to say the rule and the fix. Kept where it changes what a reader does: that both branches of a conditional registration still ship, that only public types cross an assembly boundary, that building a provider twice gives two sets of singletons. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C56x6Vv6HJ6ArfqwKsuSb9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three changes to the docs site.
Testing is its own section
It was one page under Everything else. It now sits between Getting started and Registering in bulk, split by what each part is for:
[ModuleTest], where module attributes go, data-driven tests, scopes, what is worth testing[Mock],[InjectValues],[TestExport], and which to reach forWriting your own generator
New page at the end of Everything else, documenting the extension points
DependencyModules.Conventionsis built on:IDependencyModuleSourceGenerator,BaseSourceGenerator,BaseAttributeSourceGenerator<T>, emitting throughDependencyFileWriter, and the analyzer packaging — which is unforgiving in ways that only appear after somebody installs the package.It also carries the three rules that cost a day each: never put a symbol in a model, give every model structural equality, and keep the predicate syntax-only.
This page keeps its reasoning. Its readers are writing a generator, so the reasoning is the content.
Less rationale everywhere else
The pages were explaining why the library was designed the way it is — why the interface name appears twice, why an assembly is always named, why there is no default lifetime, what would have happened had we chosen otherwise. That is design-doc material. A reader wants to know what to write and what will happen.
Roughly forty passages cut or rewritten to state the rule and the fix. For example:
The "Why the interface name appears twice" section is gone entirely, replaced by one line: implement
Conventionsexplicitly, an implicitpublicone does not compile.Kept where it changes what a reader does: that both branches of a conditional registration still ship, that only
publictypes cross an assembly boundary, and that building a provider twice gives you two sets of singletons.Build
Builds clean with no dead links; all four new and moved pages verified serving locally.
🤖 Generated with Claude Code
https://claude.ai/code/session_01C56x6Vv6HJ6ArfqwKsuSb9