orca-so / orca-sdks

Open-sourced typescript SDKs for Orca
MIT License
43 stars 10 forks source link

Use peer dependencies to prevent common sdk version mismatches #68

Closed wjthieme closed 5 months ago

wjthieme commented 5 months ago

Right now we're facing an issue with dependency mismatch between several packages (common-sdk, axios, web3.js, etc.). By defining these as peerDependencies instead of normal dependencies we have more freedom over which version eventually gets used downstream.

Normal dependencies create a nested dependency which is fine if the dependency is only used internally in the package but might pose a problem when using types externally. With peer dependencies we can sync the versions across multiple dependencies allowing us to use types externally as well (such as AxiosInstance, TransactionBuilder, PublicKey etc.) without having to painstakingly match versions with each other.

After this change tests still pass