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:
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.
Problem
anchor-bankrun
currently needs@coral-xyz/anchor
,@solana/web3.js
andsolana-bankrun
but they are installed as normal dependencies. This makesanchor-bankrun
use a private copy of these dependencies. This can cause issues like the following:Solution
By using peer dependencies
anchor-bankrun
expectssolana-bankrun
to be there an be within a specific version range. Added benefit is that now every time we want to updatesolana-bankrun
,anchor-bankrun
will keep working.