Repository navigation
feat(tx3c): generate first-party clients with --language - #360
Merged
Merged
Conversation
This was referenced Sep 26, 2026
tx3c now owns first-party client codegen end to end. The Rust, TypeScript, Python, and Go client templates move from each SDK repo's .trix/client-lib into bin/tx3c/templates/<language> and are compiled into the binary. `tx3c codegen --language <language>` renders the client for that language. `--template <dir>` keeps rendering custom templates, and exactly one of the two is required. A language's client is defined by its backend: the type mapping and naming it already had, plus the client templates it now lists through `Backend::client_templates()`. A tx3c release therefore carries the backends, the client templates, and the SDK version range those templates target as one consistent unit, with no separate template release, git tag, or download to keep in step. - A test fails if a template directory and its backend's list disagree. - The golden corpus renders every language's client under expected/<language>, moves the custom-template cases under custom/, and adds the SDKs' shared transfer.tii fixture. - A new CI job renders each client for the transfer and complex fixtures and compiles it against the published SDK release its templates pin. Java and Swift keep their backends; they have no client templates yet, and --language says so. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
scarmuega
force-pushed
the
codegen/bundled-templates
branch
from
September 26, 2026 18:04
a19751a to
defedd9
Compare
scarmuega
added a commit
to tx3-lang/trix
that referenced
this pull request
Sep 26, 2026
tx3c now generates the first-party clients itself (tx3-lang/tx3#360). The built-in plugins (ts-client, rust-client, python-client, go-client) call `tx3c codegen --language <language>` instead of downloading the SDK repos' `.trix/client-lib` at the `codegen-v1beta0` tag. A generated client therefore always matches the installed tx3c, and codegen needs no network access. Custom `{ repo, path, ref }` plugins keep the download and `--template` path unchanged. - Remove CURRENT_CODEGEN_VERSION and the built-in repo/path/ref table. - Raise the tx3c compatibility floor to 0.24.0, the release that ships `--language`. - The fake tx3c accepts `--language`, and a new contract test pins that built-in plugins pass it and never download templates. - Replace the stale `[[bindings]]` blocks in the example projects with `[[codegen]] plugin = "ts-client"`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
scarmuega
added a commit
to tx3-lang/trix
that referenced
this pull request
Sep 26, 2026
tx3c now ships the first-party templates itself and selects them by name (tx3-lang/tx3#360, #361). A built-in plugin name such as `rust-client` is also the name of its tx3c template, so the built-in plugins (ts-client, rust-client, python-client, go-client) call `tx3c codegen --template <plugin name>` instead of downloading the SDK repos' `.trix/client-lib` at the `codegen-v1beta0` tag. A generated client therefore always matches the installed tx3c, and codegen needs no network access. Custom `{ repo, path, ref }` plugins keep the download and pass the downloaded directory to the same `--template` flag. - Remove CURRENT_CODEGEN_VERSION and the built-in repo/path/ref table. - Raise the tx3c compatibility floor to 0.24.0, the release that ships built-in templates. - A new contract test pins that built-in plugins pass their name as `--template` and never download templates. - Replace the stale `[[bindings]]` blocks in the example projects with `[[codegen]] plugin = "ts-client"`. 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
tx3c now owns first-party client codegen end to end. This removes the release chain of a tx3c release, then an SDK template PR, then a hand-moved
codegen-v1beta0tag..trix/client-libintobin/tx3c/templates/<language>and are compiled into the binary. They are the versions already migrated to the unified helpers.Backend::client_templates(). Giving a language a client means adding its template directory and listing the files there.tx3c codegen --tii X --language <rust|typescript|python|go> --output Yrenders that language's client.--template <dir>still renders custom templates, and exactly one of the two flags is required.--language javaexplains that and points to--template.Tests and CI
expected/<language>. The custom-template cases move undercustom/, with output inexpected/custom/. The corpus also adds the SDKs' sharedtransfer.tiifixture.codegen compileCI job renders each client for the transfer and complex fixtures. It compiles the output against the published SDK release the templates pin, using.github/scripts/codegen-compile-check.sh.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 compilejob passed for all four languages against the published 0.15.0 SDKs.Follow-ups
--languageand raises the tx3c compatibility floor to the release that ships this PR..trix/client-libafter that trix release. Their codegen check will render with--language. Thecodegen-v1beta0tags stay frozen for older trix versions.🤖 Generated with Claude Code