Skip to content

feat(codegen): render built-in plugins from tx3c's built-in templates - #132

Merged
scarmuega merged 1 commit into
mainfrom
codegen/bundled-clients
Sep 26, 2026
Merged

scarmuega merged 1 commit into
mainfrom
codegen/bundled-clients

Conversation

@scarmuega

@scarmuega scarmuega commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

tx3c now ships the first-party templates itself and selects them by name (tx3-lang/tx3#360, tx3-lang/tx3#361). A built-in plugin name such as rust-client is also the name of its tx3c template. The built-in plugins ts-client, rust-client, python-client and go-client therefore call tx3c codegen --template <plugin name>. They no longer download each SDK repo's .trix/client-lib at the codegen-v1beta0 tag.

  • A generated client always matches the installed tx3c, and built-in codegen needs no network access.
  • Custom { repo, path, ref } plugins keep the download and pass the downloaded directory to the same --template flag.
  • CURRENT_CODEGEN_VERSION and the built-in repo, path and ref table are removed. There is no mapping from plugin to language either, because the plugin name is passed straight through.
  • The tx3c compatibility floor rises to 0.24.0. That assumes 0.24.0 is the release that ships the built-in templates from tx3#360 and tx3#361.
  • The two example projects replace their stale [[bindings]] blocks with [[codegen]] plugin = "ts-client".

Merge order

Release tx3c with tx3#360 and tx3#361 before releasing trix with this PR. A trix release that includes this change rejects any tx3c older than 0.24.0. If the tx3c release gets a different version number, update the floor in src/spawn/compat.rs before merging.

Verification

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features --locked -- -D warnings
  • cargo test --workspace --all-targets --all-features --locked, which passes, including a new contract test. It checks that built-in plugins pass their name as --template and never download templates.
  • End to end: trix init followed by trix codegen --plugin go-client, using the real tx3c built from tx3#361, rendered go.mod, protocol.go and README.md with no download. The compatibility gate was skipped, because that unreleased build still reports 0.23.0.

🤖 Generated with Claude Code

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>
@scarmuega
scarmuega force-pushed the codegen/bundled-clients branch from ea54db7 to 8c4ec71 Compare September 26, 2026 18:43
@scarmuega scarmuega changed the title feat(codegen): render built-in clients with tx3c --language feat(codegen): render built-in plugins from tx3c's built-in templates Sep 26, 2026
@scarmuega
scarmuega merged commit 5b8649e into main Sep 26, 2026
10 checks passed
@scarmuega
scarmuega deleted the codegen/bundled-clients branch September 26, 2026 22:00
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.

1 participant