Skip to content

Refactor renderVisitor to use crateFolder as primary argument#85

Open
lorisleiva wants to merge 1 commit into12-01-sync_cargo.toml_when_generating_codefrom
02-14-refactor_rendervisitor_to_use_cratefolder_as_primary_argument
Open

Refactor renderVisitor to use crateFolder as primary argument#85
lorisleiva wants to merge 1 commit into12-01-sync_cargo.toml_when_generating_codefrom
02-14-refactor_rendervisitor_to_use_cratefolder_as_primary_argument

Conversation

@lorisleiva
Copy link
Member

@lorisleiva lorisleiva commented Feb 14, 2026

This PR refactors renderVisitor to accept the crate folder (where Cargo.toml lives) as its primary argument, instead of the generated output path. The generated folder is now derived internally by joining the crate folder with a configurable generatedFolder option (defaults to 'src/generated').

This mirrors the same refactoring done in renderers-js#118, with the difference that syncCargoToml remains false by default since it hasn't been tested in production yet.

- const visitor = renderVisitor('clients/rust/src/generated', {
-     crateFolder: 'clients/rust',
- });
+ const visitor = renderVisitor('clients/rust');

This also fixes formatCode and syncCargoToml which previously required an optional crateFolder option — now that the crate folder is always known, these features work without additional configuration.

@changeset-bot
Copy link

changeset-bot bot commented Feb 14, 2026

🦋 Changeset detected

Latest commit: e486ba1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@codama/renderers-rust Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@lorisleiva lorisleiva marked this pull request as ready for review February 14, 2026 00:13
@lorisleiva lorisleiva force-pushed the 02-14-refactor_rendervisitor_to_use_cratefolder_as_primary_argument branch from 3825d48 to e486ba1 Compare February 14, 2026 00:24
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