Skip to content

Comments

fix(adapter): resolve adapter-evm-core type declarations and clean up type hierarchy#344

Merged
pasevin merged 1 commit intomainfrom
fix/adapter-dts-resolve-and-type-cleanup
Feb 20, 2026
Merged

fix(adapter): resolve adapter-evm-core type declarations and clean up type hierarchy#344
pasevin merged 1 commit intomainfrom
fix/adapter-dts-resolve-and-type-cleanup

Conversation

@pasevin
Copy link
Collaborator

@pasevin pasevin commented Feb 20, 2026

Summary

  • Add dts.resolve: ['@openzeppelin/ui-builder-adapter-evm-core'] to tsup configs for both adapter-evm and adapter-polkadot, so type declarations (.d.ts) bundle internal adapter-evm-core types alongside runtime JS. This fixes exported apps failing to compile because .d.ts files referenced the unpublished adapter-evm-core package.
  • Refactor TypedPolkadotNetworkConfig to extend PolkadotNetworkConfig from @openzeppelin/ui-types directly (with narrowed viemChain typing), eliminating its type-level dependency on adapter-evm-core.
  • Refactor TypedEvmNetworkConfig to extend EvmNetworkConfig from @openzeppelin/ui-types directly (with narrowed viemChain typing), instead of going through EvmCompatibleNetworkConfig<'evm'>.

Context

adapter-evm-core is an internal workspace package bundled into the adapters via tsup's noExternal. While the runtime JS was correctly bundled, the generated .d.ts files still contained import { TypedEvmNetworkConfig } from '@openzeppelin/ui-builder-adapter-evm-core' — an unresolvable reference in exported apps since adapter-evm-core is never published to npm. This caused TS2345 type errors when building exported apps.

The type hierarchy cleanup is an additional improvement: since @openzeppelin/ui-types already defines PolkadotNetworkConfig (with all the same fields), the polkadot adapter no longer needs to extend from evm-core types at the source level. Helper types (PolkadotExecutionType, PolkadotNetworkCategory, PolkadotRelayChain) are re-exported from ui-types for convenience.

Test plan

  • Full monorepo build passes
  • No adapter-evm-core imports remain in any .d.ts output
  • Polkadot adapter tests pass (77/77)
  • EVM core tests pass (598/598)
  • EVM adapter tests pass (98/98)
  • Exported app tsc type check passes with patched .d.ts files

… type hierarchy

Add dts.resolve for adapter-evm-core in tsup configs so .d.ts files
bundle internal types alongside runtime JS. Refactor
TypedPolkadotNetworkConfig to extend PolkadotNetworkConfig from
ui-types directly, and TypedEvmNetworkConfig to extend EvmNetworkConfig.
@pasevin pasevin requested a review from a team as a code owner February 20, 2026 13:22
@pasevin pasevin merged commit 2b74cde into main Feb 20, 2026
11 checks passed
@pasevin pasevin deleted the fix/adapter-dts-resolve-and-type-cleanup branch February 20, 2026 13:29
@oz-release-app oz-release-app bot mentioned this pull request Feb 20, 2026
@oz-release-app oz-release-app bot mentioned this pull request Feb 20, 2026
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