Repository navigation
feat(tx3c): render template output paths through Handlebars - #363
Merged
scarmuega merged 1 commit intoSep 27, 2026
Merged
Conversation
A template file's relative path may contain Handlebars expressions. tx3c
renders each path with the same helpers and data as the file's contents,
for built-in templates and custom template directories alike, so a
template can emit layouts such as `Sources/{{pascalCase
tii.protocol.name}}Client/`. Paths without expressions render unchanged.
Rendered paths that are empty, absolute, or have an empty, `.` or `..`
segment are errors naming the source template file, as are two files
that render to the same path.
The golden corpus gains a `templated-paths` custom template that pins a
protocol-named Swift and Java layout for every fixture; existing golden
output is unchanged.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
scarmuega
marked this pull request as ready for review
September 27, 2026 12:27
Contributor
Author
|
Merge observed. Plan: Trellis will verify the human merge evidence, adopt the domain pin, and retire the plan. No further merge action is needed. |
scarmuega
deleted the
work/work-9c5ab72281778b74c419144c89cb67abd6474200
branch
September 27, 2026 12:40
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 codegenrenders each path with the same helpers and data as the file's contents, for built-in templates and custom template directories alike, so a template can emit layouts such asSources/{{pascalCase tii.protocol.name}}Client/orsrc/main/java/land/tx3/generated/{{snakeCase tii.protocol.name}}/. Paths without expressions render unchanged..or..segment are errors naming the source template file. Two files rendering to the same output path are an error naming both.TemplateFile+write_output), instead of two static-file code paths.Tests
tests/codegen/custom/templated-paths/pins a protocol-named Swift and Java layout, plus a static file inside a templated directory, for every fixture...and.segments, empty segments, collisions, and rendering errors.cargo fmt --all -- --check,cargo clippy --workspace --all-targets --all-features --locked -- -D warnings,cargo test -p tx3c --lockedpass.Plan:
plans/lang-codegen-templated-output-paths.md(tx3 domain). The renderer-contract note forsdk-specis reported on the plan for the spec owner to apply.🤖 Generated with Claude Code