Skip to content

feat: support dynamic options, static files and multiple templates#73

Merged
scarmuega merged 2 commits intomainfrom
feat/support-multiple-templates
Jul 23, 2025
Merged

feat: support dynamic options, static files and multiple templates#73
scarmuega merged 2 commits intomainfrom
feat/support-multiple-templates

Conversation

@mduthey
Copy link
Contributor

@mduthey mduthey commented Jul 21, 2025

This pr's adds new logic to bindgen supporting static files and dynamic options. Those options will get pass to handlebars as data which will be used internally.

Added new template property on bindings and deprecate plugin property.
This new template property allow to define the repository to take the template, the path from root to it and a ref which could be a branch or commit from where to take the template. If ref is missing, main will be the default one

Web-sdk template is updated on tx3-lang/web-sdk#18 and can be used as

[[bindings]]
template = { repo = "tx3-lang/web-sdk", path = "bindgen/client-lib", ref = "main" }
output_dir = "./gen/typescript/standalone"
options = { standalone = true }

[[bindings]]
template = { repo = "tx3-lang/web-sdk", path = "bindgen/client-lib" }
output_dir = "./gen/typescript/protocol-only"
options = { standalone = false }

and the output for this will be
image

@mduthey mduthey linked an issue Jul 21, 2025 that may be closed by this pull request
@scarmuega scarmuega merged commit f85c66b into main Jul 23, 2025
6 of 7 checks passed
@scarmuega scarmuega deleted the feat/support-multiple-templates branch July 23, 2025 18:58
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.

feat: support more than one bidgen template per repo

2 participants