Skip to content

refactor(networks)!: drop wagmi re-export from root barrel (viem isolation)#40

Merged
ignromanov merged 1 commit into
mainfrom
056-phase3-a3-networks-barrel
Jun 4, 2026
Merged

refactor(networks)!: drop wagmi re-export from root barrel (viem isolation)#40
ignromanov merged 1 commit into
mainfrom
056-phase3-a3-networks-barrel

Conversation

@ignromanov
Copy link
Copy Markdown
Contributor

Summary

  • Removes export { ethereumWagmi, baseWagmi, arbitrumWagmi, optimismWagmi, polygonWagmi, ALL_WAGMI_CHAINS } from './wagmi.js' from packages/networks/src/index.ts
  • viem is declared an optional peerDependency, but this static re-export forced it into every consumer's module graph on root import — defeating the optional-peer intent (re-audit [codec][P0] Publish-blockers: Node-runnable artifact + networks barrel + release.yml + Rust coverage #17, networks-barrel item)
  • Wagmi configs remain available exclusively via the existing subpath export: import { ALL_WAGMI_CHAINS } from '@void-layer/networks/wagmi' — the exports["./wagmi"] entry in package.json is untouched

BREAKING CHANGE

Consumers importing wagmi symbols from the root (@void-layer/networks) must update to the subpath:

-import { ALL_WAGMI_CHAINS } from '@void-layer/networks';
+import { ALL_WAGMI_CHAINS } from '@void-layer/networks/wagmi';

This lands before the first npm publish so the published 0.1.0 root API ships viem-free.

Validation

  • pnpm --filter @void-layer/networks build — clean (tsc exit 0)
  • pnpm --filter @void-layer/networks test — 166/166 pass, 100% statement/function/line coverage
  • pnpm -w lint — clean (eslint + clippy)
  • Two new root-barrel isolation tests added to index.test.ts asserting wagmi symbols absent from root and viem-free surface fully present

Files changed

  • packages/networks/src/index.ts — remove wagmi re-export block (−8 lines)
  • packages/networks/src/index.test.ts — add root barrel isolation tests (+24 lines)

No source files outside packages/networks/ required repointing (grep confirmed wagmi symbols only appear in src/wagmi.ts, src/wagmi.test.ts, and dist artifacts).

Part of #17.

…ation)

Remove the static `export { ..., ALL_WAGMI_CHAINS } from './wagmi.js'`
block from the root index.ts. viem is declared an optional peerDependency
but the barrel re-export forced it into every consumer's module graph.

Wagmi configs remain available via the existing subpath export:
  import { ALL_WAGMI_CHAINS } from '@void-layer/networks/wagmi';

Add two root-barrel isolation tests asserting wagmi symbols are absent
from the root surface and the viem-free set is fully present.

Part of #17.
@ignromanov ignromanov merged commit d750774 into main Jun 4, 2026
7 checks passed
@ignromanov ignromanov deleted the 056-phase3-a3-networks-barrel branch June 4, 2026 03:19
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