Skip to content

chore(ci): guard adapter peer versions in CI - #418

Merged
pasevin merged 3 commits into
mainfrom
ci/add-check-peers
Aug 24, 2026
Merged

chore(ci): guard adapter peer versions in CI#418
pasevin merged 3 commits into
mainfrom
ci/add-check-peers

Conversation

@pasevin

@pasevin pasevin commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Why

@openzeppelin/adapter-* packages declare peerDependencies on @openzeppelin/ui-* but enforce them only at runtime, inside validatePeerVersions(). A repo that bumps the adapters without moving its ui-* pins passes typecheck, tests, build and lint, then fails in the browser with the network runtime stuck failed.

This repo had no guard against that. Its pins are correct today, but nothing would catch the next adapter major that moves a peer floor — it would land in staging instead of CI.

Changes

  • new CI step "Adapter peer version check" running oz-ui-dev check-peers --project "$PWD"
  • check-adapter-peers npm script for running it locally
  • @openzeppelin/ui-dev-cli^1.3.0, the first published line carrying the command
  • versions.ts synced to the published registry versions (the pre-push hook enforces this and refuses the push otherwise)

Why the shared command rather than a local script

role-manager and rwa-wizard each carried a copy of this script. Both hardcoded node_modules/@openzeppelin at the repo root — which is why a straight copy into this repo failed outright, since dependencies here install under apps/builder. The shared command reuses the CLI's collectWorkspacePackageDirs, expanding pnpm-workspace.yaml globs, so it scans the root and every workspace package. A third copy would also have been a third thing to drift; the existing two already had.

Verification

  • pnpm exec oz-ui-dev check-peers → passes, 15 adapter/peer pairs, resolving under apps/builder/node_modules — the layout that broke the old script
  • the npm script path gives the same result
  • export snapshot tests pass after the versions.ts sync (9 tests)

Merge order

Merge after #417 in this repo. Both touch ui-dev-cli and versions.ts; the versions.ts content is byte-identical between the two branches, so it merges cleanly, and the ui-dev-cli line is a one-line conflict at worst.

This repo had no peer guard. Its pins are currently correct -- 15 of 15
adapter/peer pairs satisfied -- but nothing was stopping an adapter bump from
leaving the @OpenZeppelin/ui-* pins behind.

The adapters enforce those minimums only at runtime, inside validatePeerVersions,
so a stale pin passes build, typecheck, test and lint and then fails in the
browser with the network runtime stuck failed. That is how the same mismatch
reached rwa-wizard staging.

Uses the shared oz-ui-dev check-peers command rather than a local script, so
there is no per-repo copy to drift. It resolves scope directories from
pnpm-workspace.yaml, which matters here: dependencies land both at the root and
under apps/builder.

Requires ui-dev-cli >=1.2.0, which is where check-peers lands. The only major
change in 1.x is the Node engine floor >=22.13.0, which this repo already
declares. The lockfile is intentionally not regenerated: 1.2.0 is unpublished,
so pnpm cannot resolve it yet.
check-peers shipped in @openzeppelin/ui-dev-cli 1.3.0, so the branch no
longer points at an unpublished version.
The pre-push hook syncs versions.ts against the registry and refuses the push
otherwise. This branch predates the adapter 5.x release, so its pins were
stale. The values match the ones on fix/drop-metamask-sdk exactly, so the two
branches merge without conflict.
@pasevin
pasevin requested a review from a team as a code owner August 24, 2026 14:30
@pasevin
pasevin merged commit cda2c33 into main Aug 24, 2026
13 checks passed
@pasevin
pasevin deleted the ci/add-check-peers branch August 24, 2026 14:49
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