kevinheavey / anchor-bankrun

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

Use peer dependencies instead of normal dependencies #4

Closed wjthieme closed 1 year 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