kevinheavey / anchor-bankrun

An Anchor wrapper for solana-bankrun
MIT License
20 stars 5 forks source link

Use peer dependencies instead of normal dependencies #5

Closed wjthieme closed 11 months ago

wjthieme commented 1 year ago

Problem

anchor-bankrun currently needs @coral-xyz/anchor, @solana/web3.js and solana-bankrun but they are installed as normal dependencies. This makes anchor-bankrun use a private copy of these dependencies. This can cause issues like the following:

├── solana-bankrun@0.2.0
└─┬ anchor-bankrun@0.1.0
  └── solana-bankrun@0.1.1

Solution

By using peer dependencies anchor-bankrun expects solana-bankrun to be there an be within a specific version range. Added benefit is that now every time we want to update solana-bankrun, anchor-bankrun will keep working.

├── solana-bankrun@0.2.0
└── anchor-bankrun@0.1.0
wjthieme commented 1 year ago

(recreated because I accidentally deleted my fork)

kevinheavey commented 1 year ago

Question: do both solana-bankrun and anchor-bankrun need the @solana/web3.js peer dependency or would it be sufficient if just solana-bankrun had it?

Also I think we'll want to be stricter on version ranges

wjthieme commented 1 year ago

I presume by only setting it in solana-bankrun it will be there for anchor-bankrun as well. anchor-bankrun does use @solana/web3.js itself so that's why I added it. Your call!

Let me change the version ranges to only patch versions