-
Notifications
You must be signed in to change notification settings - Fork 41
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
Improved Exports for @sei-js/evm #205
Conversation
Due to inconsistencies in node versions and the way they resolve this package, this change removes the "export" field in the package.json so that default module resolution strategies are used by using the "main", "module", and "types" fields in the package.json. all files from the "viem" and "ethers" directories are included in the default export and the dependencies are moved from peer dependencies to the regular dependencies field.
🦋 Changeset detectedLatest commit: 4727d97 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Tested this by creating two files: index.cjs
index.mjs
Also tested by releasing an internal version of @sei-js/evm and importing that into the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #205 +/- ##
=====================================
Coverage 4.67% 4.67%
=====================================
Files 212 212
Lines 44030 44030
Branches 15793 15793
=====================================
Hits 2058 2058
Misses 41972 41972 ☔ View full report in Codecov by Sentry. |
packages/evm/package.json
Outdated
@@ -31,30 +31,8 @@ | |||
"publishConfig": { | |||
"access": "public" | |||
}, | |||
"dependencies": {}, | |||
"peerDependencies": { | |||
"dependencies": { |
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.
i think we need to keep ethers/viem as peer dependencies since moving them to regular dependencies could cause version conflicts when users have different versions in their apps
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.
Reverted that part of the change
@@ -5,7 +5,7 @@ Typescript library containing helper functions for interacting with the EVM on S | |||
## Installation | |||
|
|||
```bash | |||
yarn add @sei-js/evm | |||
yarn add @sei-js/evm ethers viem |
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.
do users need to install both ethers and viem even if they're only using one?
Due to inconsistencies in node versions and the way they resolve this package, this change removes the "export" field in the package.json so that default module resolution strategies are used by using the "main", "module", and "types" fields in the package.json.
all files from the "viem" and "ethers" directories are included in the default export and the dependencies are moved from peer dependencies to the regular dependencies field.