You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4255c2a
Browse filesBrowse the repository at this point in the historyBrowse files
feat(csharp): eject hands over the emitters a generator writes through; api-docs is ejectable
An ejected C# generator used to be one file over packaged emitters, so a defect in
the enum, navigation, doc-comment or prompt-tier writers still waited for a release.
Eject now copies those emitters with the generator, into codegen/generators/ in the
same Codegen.Generators namespace: Fr019SharedEnum, XmlDocBuilder, M2MNavigation and
ReverseFinders with entity, db-context and routes as each calls them;
ExtractDelegateEmitter, Fr010FieldMapping and OutputFormatSpecEmitter with
output-parser, extractor and output-prompt. The list is each registry entry's
Companions. A file two generators share is copied once and never overwritten.
Naming and type-mapping tables, the model walks and the generator base stay in the
package as the engine.
api-docs is registered for C# and ejectable. The api reference is now a generator
(IDocsGenerator) that `dotnet meta docs` runs; `gen` and `verify --codegen` skip it
and say so. `docs` hands off to an owned codegen project once it owns api-docs, and
what the reference documents comes from the generators in that project's list
(GeneratorApplicability.From), so it describes an owned copy.
Moved to the engine so an owned copy needs no emitter: CSharpStringLiteral to
CSharpNaming, ValueObjectNames.ResolveValueObject out of RenderHelperGenerator.
EjectedGeneratorsAloneTests derives its list from the registry: each ejectable
generator is ejected alone, compiled against the public API, checked against a
written engine surface, and compared byte for byte with the packaged generator.
Packaged output is unchanged.
Copy file name to clipboardExpand all lines: docs/ports/csharp.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,7 +81,7 @@ for a worked example.
81
81
82
82
## Generate
83
83
84
-
**Own a generator.**`dotnet meta eject <name>...` copies a reference generator into `codegen/generators/` and scaffolds an owned `codegen/` console project that `dotnet meta gen` then runs. See [Own your codegen → C#](../features/own-your-codegen.md#c-dotnet-meta-eject).
84
+
**Own a generator.**`dotnet meta eject <name>...` copies a reference generator into `codegen/generators/` and scaffolds an owned `codegen/` console project that `dotnet meta gen` then runs. Every generator `dotnet meta gen --list` shows is ejectable except `template`, the Mustache primitive, which has no emit logic of its own to own. An ejected generator comes with the emitters it writes its output through (the enum, navigation, doc-comment and prompt-tier writers), so the copy owns the code that writes the file and not a shell around the package's; the naming and type-mapping tables (`CSharpNaming`, `ValueObjectNames`) stay in the package as the engine. `dotnet meta eject api-docs` does the same for the api reference `dotnet meta docs` writes, and the reference then describes the generators you own. See [Own your codegen → C#](../features/own-your-codegen.md#c-dotnet-meta-eject).
Copy file name to clipboardExpand all lines: fixtures/generator-registry-conformance/registry.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -90,8 +90,8 @@
90
90
"concept": "Per-entity/template SDK API reference (generated-code API; human + agent forms).",
91
91
"tier": "native",
92
92
"layer": "docs",
93
-
"note": "Run by `meta docs` as its api surface (ADR-0025), not by `meta gen`: a `meta gen` config that lists it is warned about and skipped.",
94
-
"ports": ["typescript"]
93
+
"note": "Run by `meta docs` as its api surface (ADR-0025), not by `meta gen`: a `meta gen` config that lists it is warned about and skipped. On csharp it is run by `dotnet meta docs`, and `dotnet meta gen` skips it with a warning.",
0 commit comments