Skip to content

refactor(sdk): replace glob re-export with explicit public API facade - #146

Merged
brandonrc merged 1 commit into
mainfrom
feat/72-sdk-explicit-facade
Jul 9, 2026
Merged

refactor(sdk): replace glob re-export with explicit public API facade#146
brandonrc merged 1 commit into
mainfrom
feat/72-sdk-explicit-facade

Conversation

@brandonrc

Copy link
Copy Markdown
Contributor

Summary

sdk/src/lib.rs previously did pub use generated_sdk::*, which made every item in the 100k-line generated module part of the crate's public API. Any cargo xtask generate run could silently add, remove, or change public items, and consumers could accidentally depend on transitively-exposed internals.

This replaces the glob with an explicit facade. The generated_sdk module stays private; only the listed names are exposed.

Approach

Full explicit enumeration was practical here because the generated module's top level is small (~45 names) even though the file is huge — the hundreds of request/response types already live under the types module and the operation builders under builder, so those stay namespaced rather than being flattened.

Explicitly re-exported:

  • Core: Client, plus the progenitor runtime types used in operation signatures: ByteStream, ClientInfo, Error, ResponseValue
  • Namespaced modules: types (request/response schemas), builder (operation builders), prelude (Client + all extension traits)
  • All 37 Client*Ext per-tag operation traits, listed by name

The existing pub use progenitor_client; / pub use reqwest; re-exports are unchanged. A doc comment notes that regeneration which adds a new operation tag now requires an intentional edit to the facade list — which is the point of the change.

Verification

  • cargo build --workspace — clean (the CLI binary is the real consumer test; nothing it imports was dropped)
  • cargo build --release — clean
  • cargo fmt --check — clean
  • cargo clippy --workspace -- -D warnings -A dead_code — clean
  • cargo test --workspace — 2095 passed, 0 failed (e2e tests ignored as usual, backend-gated)

No behavior change; pure re-export restructuring, so Windows compatibility is unaffected. Scope is confined to sdk/src/lib.rs and does not touch the lint configuration (kept clear of the #70 work).

Closes #72

The SDK crate re-exported everything from the generated module via
pub use generated_sdk::*, making all generated items public API and
turning every regeneration into a potential breaking change.

Replace the glob with an explicit facade in sdk/src/lib.rs:

- Client plus the progenitor runtime types (ByteStream, ClientInfo,
  Error, ResponseValue) re-exported by name
- types, builder, and prelude kept as namespaced modules
- all 37 Client*Ext operation traits listed explicitly

The generated_sdk module stays private, so new generated items no
longer leak into the public surface implicitly; additions to the API
now require an intentional edit to the facade list.

No behavior change; pure re-export restructuring.

Closes #72
@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

@brandonrc
brandonrc marked this pull request as ready for review July 9, 2026 23:06
@brandonrc
brandonrc merged commit 77a81dc into main Jul 9, 2026
16 checks passed
@brandonrc
brandonrc deleted the feat/72-sdk-explicit-facade branch July 25, 2026 00: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.

SDK re-exports everything unfiltered via pub use

1 participant