Skip to content

feat(codegen): add types-only codegen#2158

Open
JordonPhillips wants to merge 1 commit into
mainfrom
feat/closure-type-codegen
Open

feat(codegen): add types-only codegen#2158
JordonPhillips wants to merge 1 commit into
mainfrom
feat/closure-type-codegen

Conversation

@JordonPhillips

Copy link
Copy Markdown
Contributor

This adds support for types-only codegen driven by Smithy shape closures. This does not add support for mixed-mode generation, but it does take steps in that direction by centralizing generation in a single codegen plugin that takes a mode parameter.

This is in draft because I'm not super happy with how schemas work right now.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@JordonPhillips
JordonPhillips requested a review from a team as a code owner July 20, 2026 14:29
This adds support for types-only codegen driven by Smithy shape
closures. This does not add support for mixed-mode generation, but
it does take steps in that direction by centralizing generation in
a single codegen plugin that takes a mode parameter.
@JordonPhillips
JordonPhillips force-pushed the feat/closure-type-codegen branch from b1446f9 to d554d15 Compare July 20, 2026 14:36
@kuhe

kuhe commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

😲

"modes": ["types"],
"closure": "example.types#typesClosure"
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in addition, the ./codegen/smithy-typescript-protocol-test-codegen folder should receive a new types-only model, with corresponding declaration in its smithy-build.json.

Please have the make generate-protocol-tests target include deleting and regenerating the sample model(s).

That app/target generates into ./private/<pkg>, which is versioned. This gives a reviewable diff of the consequences of the codegen change. It currently has one SSDK (newly added), and two client SDKs in both schema-serde and legacy modes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protocol tests aren't really appropriate since there are no protocol tests for types-only mode. I'll get something together at least.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name make generate-protocol-tests was perhaps misleading.

It is generating SDKs, some of which come with protocol tests, namely the Smithy RPCv2 CBOR protocol test client and perhaps more in the future, but the other things it generates are for visual diffing, which is why I want to have a types-only package in the group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants