-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore: use caret version for the viem
dependencies
#5038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
10 Skipped Deployments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR moves the viem
dependency from dependencies
to optionalDependencies
across multiple packages in the codebase, making it an optional rather than required dependency for consumers.
Key changes:
- Removes
viem
from thedependencies
section in all affected package.json files - Adds
viem
tooptionalDependencies
with version constraint>=2.37.2
- In the wagmi adapter, moves
viem
frompeerDependencies
tooptionalDependencies
Reviewed Changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 8 comments.
Show a summary per file
File | Description |
---|---|
packages/siwx/package.json | Moves viem to optionalDependencies, incorrectly adds wagmi instead |
packages/siwe/package.json | Moves viem to optionalDependencies, incorrectly adds wagmi instead |
packages/experimental/package.json | Moves viem to optionalDependencies, incorrectly adds wagmi instead |
packages/controllers/package.json | Moves viem to optionalDependencies, incorrectly adds wagmi instead |
packages/common/package.json | Moves viem to optionalDependencies, incorrectly adds wagmi instead |
packages/cdn/package.json | Moves viem to optionalDependencies, incorrectly adds wagmi instead |
packages/appkit/package.json | Moves viem to optionalDependencies, incorrectly adds wagmi instead |
packages/appkit-utils/package.json | Moves viem to optionalDependencies, incorrectly adds wagmi instead |
packages/adapters/wagmi/package.json | Correctly moves viem from peerDependencies to optionalDependencies |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Coverage Report
File CoverageNo changed files found. |
optionalDependencies
peerDependencies
|
peerDependencies
viem
dependencies
Description
Here’s the PR description in plain Markdown, ready to copy:
PR: Switch
viem
(and related deps) topeerDependencies
Why
We previously declared
viem
(and in some caseswagmi
) as a regular dependency in@reown/appkit
,@reown/appkit-adapter-wagmi
, and other internal packages.This caused multiple versions of
viem
to be installed in consuming apps whenever users had their ownviem
inpackage.json
.Example problem case
User installs:
Our packages declare:
Result:
node_modules
ends up with two different versions of viem (user’s 0.2.0 and our 0.3.x).This breaks consumers because viem types and runtime are not compatible across multiple copies.
How
We now declare viem (and wagmi where imported directly) as peer dependencies:
peerDependencies
: tell the app to provide these packages.Benefits
node_modules
, less chance of type mismatches.Example dependency tree
Before
After
Type of change
Associated Issues
For Linear issues: Closes APKT-xxx
For GH issues: closes #...
Showcase (Optional)
If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.
Checklist