-
Notifications
You must be signed in to change notification settings - Fork 333
Dependencies duplicates management
Our projects relies heavily on many NPM libraries for the apps and the UI, the coin integrations, the various hardware wallet transports,... This reliance often leads to duplicated dependencies in our system. Over time, these duplicates accumulate as an unintended consequence of using pnpm-lock.yaml
. While pnpm-lock.yaml
is instrumental in locking and securing our dependencies, it does come with trade-offs. In certain situations, manual intervention is necessary. Below are some tips to address these issues.
Occasionally, the pnpm-lock.yaml
file may diverge, causing the application to malfunction with sneaky bugs / grow in size / lower in performance. This often occurs after attempts to add/update dependencies or resolving conflicts.
We have put in place non regression automation that will always compare your PR against the target (e.g; develop) to check for possible introduction of duplicates.
There is usually a solution to deduplicate libraries and here are some tips to deal with these.
To safely regenerate the pnpm-lock.yaml
, follow these steps:
1. Retrieve the pnpm-lock.yaml
from the develop
branch:
git checkout origin/develop pnpm-lock.yaml
2. Run the pnpm install
command:
pnpm i
When a dependency, denoted as <dep>
, is used by multiple packages with specified dependency patterns (e.g., 1.2.*
), and these packages have locked versions at slightly different points (e.g., 1.2.3 and 1.2.4), you can instruct pnpm
to unify them under a single version, such as 1.2.4. Execute the following command for the desktop project, or use pnpm -r
to apply it across all libraries:
pnpm -r up <dep>
- Ledger Live Desktop
- Ledger Live Mobile
-
Ledger Live Common
- Introduction
- Currency Models
- Currency Bridge
- Account
- Account Bridge
- apps
- appsCheckAllAppVersions
- ledger-live bot
- Canonical Ways to Investigate Bugs
- Coin Integration Introduction
- Countervalues
- Packages Duplicates
- Derivation
- Developing with CLI
- Developing
- Gist Firmware Update
- Gist Transaction
- Hardware Wallet Logic
- Socket
- Assorted tips
- Integration Tests
- Process
- Monorepository Migration Guide
- Issues, Workaround and Tricks
- Common CI Troubleshooting
- Create staging builds using the CI
- Deprecated