shazow / whatsabi

Extract the ABI (and resolve proxies, and get other metadata) from Ethereum bytecode, even without source code.
https://shazow.github.io/whatsabi/
MIT License
1.04k stars 71 forks source link

Listing @noble/hashes as a depenency. #88

Closed einaralex closed 4 months ago

einaralex commented 6 months ago

I just wanted to start by thanking you for this fantastic package; I've been struggling to identify ERC-1271 proxies and finally found an efficient way to do it with your package.

Listing @noble/hashes as a peerDependency in your package requires your users to install it as a dependency in their application. Ethers, Safe and other packages do this.

einaralex commented 6 months ago

I just realized this might not be a problem with npm and pnpm; I think they install peer dependencies from other package dependencies. We use Yarn.

einaralex commented 6 months ago

I created a PR if you're interested.

shazow commented 6 months ago

@einaralex Thanks for the kind words, and for raising this!

I'm honestly not 100% clear on how peerDependencies are supposed to work, despite having read the docs a dozen times.

Here's what I'm trying to achieve, maybe you can help me figure this out?

Any idea what the best way to do this in a way that is yarn-compatible? My understanding is that yarn v2+ has peerDependencies support?

einaralex commented 6 months ago

Yeah haha, I noticed I have 6 different versions of noble/hashes in my yarn.lock from different web3 packages. I don't think there is a good automated way to do it. Since you list ethers as a dependency, I'd probably just follow that version, since the user of your app will get that version of ethers, you'd be matching that.

I just noticed we are actually using v1 of Yarn, so it's maybe more of a me-problem :P

shazow commented 6 months ago

Would you be up for trying Yarn v2+ and seeing if it solves this for you?

I'd like to keep the whatsabi bundle as small as possible, and adding more direct dependencies can make things tricky for tree-shaking. :)

shazow commented 4 months ago

Closing for now, let me know if you think it's still an issue with whatsabi.