Repository navigation
feat(tx3c): select built-in templates by name with --template - #361
Merged
Merged
Conversation
A template is one use case in one language, such as `rust-client`, so it is the single thing `tx3c codegen` selects. Replace the unreleased `--language` flag with `--template <name-or-dir>`: - A bare name (no path separator, no leading `.`) selects a built-in template when one has that name. Anything else is a custom template directory, exactly as before, so every released caller keeps working. - Built-in templates are ts-client, rust-client, python-client, and go-client, matching trix's plugin names. Their files move to bin/tx3c/templates/<name>/ and are listed in a name-keyed registry (codegen/templates.rs). Language backends no longer own templates; a template picks its backend through the helpers it calls. - Golden output moves to expected/<name>/, and the codegen compile CI job runs per template. A new use case in an existing language, such as a server stub, is a new template directory and registry entry, with no CLI change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Sep 26, 2026
Merged
Merged
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.
Summary
Follow-up to #360, before any release ships
--language. A template is one use case in one language, such asrust-client. It is therefore the single dimensiontx3c codegenselects. Language and use case are not separate flags.--template <name-or-dir>replaces the unreleased--language. A bare name, with no path separator and no leading., selects a built-in template when one has that name. Anything else is a custom template directory, exactly as before, so every released caller of--template <dir>keeps working../nameforces a directory.ts-client,rust-client,python-clientandgo-client. The names match trix's plugin names, so trix can pass them straight through. Their files move tobin/tx3c/templates/<name>/and are listed in a name-keyed registry,codegen/templates.rs.declarations tii "rust".Backend::client_templates()is removed.Tests and CI
expected/<language>toexpected/<name>with identical content.codegen compileCI job now runs per template.Verification
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test -p tx3c --locked, with 25 unit tests plus the golden corpus.codegen-compile-check.shpassed forrust-clientandts-clientagainst the published 0.15.0 SDKs. CI coverspython-clientandgo-client.tx3-lang/trix#132 is updated to pass
--template <plugin name>for built-in plugins.🤖 Generated with Claude Code