Commit deef88b
committed
refactor: Port C# SDK generation from nextlove to Metalsmith
Replace @seamapi/nextlove-sdk-generator with a Metalsmith + Handlebars
pipeline (via @seamapi/smith), mirroring the javascript-http and python
codegen architecture. The nextlove C# generator (its AST codegen
framework, dataclass serializer, and OpenAPI helpers) is ported verbatim
under codegen/lib as TEMPORARY output-parity workarounds, so the
generated output stays byte-identical after csharpier. A thin, durable
Metalsmith plugin (codegen/lib/csharp.ts) drives the port and emits each
generated file through a passthrough layout.
- codegen/smith.ts: Metalsmith entry point
- codegen/lib/csharp.ts: plugin wrapping the ported generator
- codegen/lib/generate-csharp-sdk.ts, codegen.ts, dataclass.ts,
schema-modifications.ts, endpoint-rules.ts, types.ts, openapi/*:
verbatim TEMPORARY ports (grep TEMPORARY to skip in review)
- Keep @seamapi/types pinned at 1.691.0 and change-case at ^4; the
generated output is tied to both
- Adopt @seamapi/smith eslint/tsconfig config; add eslint.config.ts,
tsconfig.json, .prettierignore; wire lint/typecheck/format scripts
- Bump Node to 24 (.nvmrc, setup action) and CI test matrix to 22
(@seamapi/smith requires Node >=20.9)
The generator does not clean the output directory: the previous
generator overwrote without deleting, so the committed output still
contains stale files for schemas removed from the pinned types. Cleaning
would change the output and is deferred (see TODO in smith.ts).
@seamapi/blueprint is installed to satisfy the smith peer dependency but
is not wired into the pipeline: the port iterates the raw OpenAPI spec
for parity, and blueprint 0.55.0 does not parse the pinned types.
Verified: generated output is byte-identical after csharpier 0.29.2;
npm run lint, typecheck, and format all pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018oCdmrhyAEX8e9sAFRXZAF1 parent d10e0ea commit deef88b
48 files changed
Lines changed: 10044 additions & 3018 deletions
File tree
- .github
- actions/setup
- workflows
- codegen
- content
- layouts
- lib
- openapi
- templates/fs
- src/Seam
- Client
- Model
- src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
| 20 | + | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
44 | | - | |
| 42 | + | |
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
| |||
65 | 63 | | |
66 | 64 | | |
67 | 65 | | |
68 | | - | |
69 | | - | |
| 66 | + | |
70 | 67 | | |
71 | 68 | | |
72 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments