Skip to content

codegen: consider namespacing the ~200 generated types instead of flooding the crate root #127

Description

@martinkersner

Split out from #116 (naming). PR #126 resolves the "two blocking modules / need both" confusion in-repo by making datamaxi::blocking a single unified sync entry point. This issue tracks the remaining codegen-side half of that item, which cannot be fixed in datamaxi-rust because it lives in the external datamaxi-codegen tool and would touch generated.rs (DO NOT EDIT).

Concern

src/lib.rs does pub use generated::*, which dumps ~200 generated names (CexCandleResponse, CexCandleOptions, every *View, every enum, …) directly into the crate root. This is the crate's canonical type surface today, so narrowing or removing the glob in-repo is too breaking and was deliberately not done in #126.

Options to weigh (codegen-side)

  1. Status quo — keep the flat crate root. Simple for callers (datamaxi::CexCandleResponse), but the root namespace is large and every added endpoint widens it. No action needed.
  2. Emit a types/models module in the generated output and re-export it, so callers can opt into datamaxi::types::* while the root stays lean. Would be a breaking reorg of the type paths → coordinate a minor/major bump.
  3. Rename generated::blocking (e.g. sync_endpoints) upstream so datamaxi::blocking no longer has to shadow a glob-imported module. Naming: disambiguate the two blocking modules #126's shadowing works and is not fragile today, but a distinct upstream name would make the layout self-evident without the shadowing trick.

Notes

Metadata

Metadata

Assignees

Labels

claude-foundSurfaced by Claude during review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions