Skip to content
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

Merged
merged 3 commits into from
Jan 28, 2025
Merged

Improved Exports for @sei-js/evm #205

merged 3 commits into from
Jan 28, 2025

Conversation

codebycarson
Copy link
Collaborator

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.

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.
Copy link

changeset-bot bot commented Jan 28, 2025

🦋 Changeset detected

Latest commit: 4727d97

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sei-js/evm Major

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

@codebycarson codebycarson requested review from besated and mj850 January 28, 2025 05:00
@codebycarson
Copy link
Collaborator Author

Tested this by creating two files:

index.cjs

// Test require (CJS)
const { ADDRESS_PRECOMPILE_ABI, ADDRESS_PRECOMPILE_ADDRESS } = require('@sei-js/evm');

console.log('Testing CJS (require):');
console.log('ADDRESS_PRECOMPILE_ABI:', ADDRESS_PRECOMPILE_ABI);
console.log('ADDRESS_PRECOMPILE_ADDRESS:', ADDRESS_PRECOMPILE_ADDRESS);

index.mjs

// Test import (ESM)
import { ADDRESS_PRECOMPILE_ABI, ADDRESS_PRECOMPILE_ADDRESS } from '@sei-js/evm';

console.log('Testing ESM (import):');
console.log('ADDRESS_PRECOMPILE_ABI:', ADDRESS_PRECOMPILE_ABI);
console.log('ADDRESS_PRECOMPILE_ADDRESS:', ADDRESS_PRECOMPILE_ADDRESS);

Also tested by releasing an internal version of @sei-js/evm and importing that into the eliza repo for the new sei plugin.

@codecov-commenter
Copy link

codecov-commenter commented Jan 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 4.67%. Comparing base (343043c) to head (4727d97).

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.
📢 Have feedback on the report? Share it here.

@@ -31,30 +31,8 @@
"publishConfig": {
"access": "public"
},
"dependencies": {},
"peerDependencies": {
"dependencies": {
Copy link
Contributor

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

Copy link
Collaborator Author

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

@codebycarson codebycarson requested a review from besated January 28, 2025 21:15
@@ -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
Copy link
Contributor

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?

@codebycarson codebycarson merged commit 747340b into main Jan 28, 2025
2 checks passed
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.

3 participants