Skip to content

Drop interop-breaking SDK wildcard re-export from generated TS clients - #2691

Open
Galmanus wants to merge 1 commit into
stellar:mainfrom
Galmanus:fix/2352-drop-sdk-wildcard-reexport
Open

Drop interop-breaking SDK wildcard re-export from generated TS clients#2691
Galmanus wants to merge 1 commit into
stellar:mainfrom
Galmanus:fix/2352-drop-sdk-wildcard-reexport

Conversation

@Galmanus

Copy link
Copy Markdown

Fixes #2352

What

Removes export * from "@stellar/stellar-sdk" from the generated TypeScript client's src/index.ts template, keeping the namespace re-exports (export * as contract, export * as rpc).

Why

The SDK's root entrypoint is CommonJS. A flat export * over a CJS module cannot be statically resolved by Rollup/Vite, which emits Unable to interop \export *` in ... this may lose module exports` and silently drops exports in consumer bundles. The namespace re-exports do not hit this path and are preserved.

How

  • Removed the flat wildcard re-export from project_template/src/index.ts
  • Regenerated the two affected fixtures (test_constructor, test_custom_types)
  • Added a regression test (test_index_ts_has_no_interop_breaking_wildcard_reexport) that runs init into a temp dir and asserts the generated index.ts no longer contains the flat re-export while keeping the namespace ones

Testing

  • New regression test fails on main (verified by re-adding the line) and passes with this change
  • cargo test -p soroban-spec-typescript: 26 passed
  • cargo clippy -p soroban-spec-typescript --all-targets: clean

The generated src/index.ts re-exported the whole CommonJS SDK entrypoint
with `export * from "@stellar/stellar-sdk"`, which Rollup/Vite cannot
statically interop, producing "Unable to interop `export *`" warnings
and dropped exports in consumer bundles (stellar#2352).

Remove the flat wildcard re-export and keep the namespace re-exports
(`contract`, `rpc`), which bundlers handle correctly. Regenerated the
two fixtures and added a regression test that inits a fresh project and
asserts the generated index.ts no longer carries the flat re-export.
Copilot AI balanced review requested due to automatic review settings August 22, 2026 00:22
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Aug 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the generated TypeScript client’s interop-breaking Stellar SDK wildcard re-export while preserving namespace exports.

Changes:

  • Removed the SDK root wildcard export from the template and fixtures.
  • Added regression coverage for generated index.ts.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/project_template/src/index.ts Removes the problematic wildcard export.
src/boilerplate.rs Adds generation regression coverage.
fixtures/test_custom_types/src/index.ts Updates the generated fixture.
fixtures/test_constructor/src/index.ts Updates the generated fixture.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog (Not Ready)

Development

Successfully merging this pull request may close these issues.

Export issue in the generated clients

2 participants