chore(errors): drop the @ledgerhq/errors package (LIVE-32915) - #20278
chore(errors): drop the @ledgerhq/errors package (LIVE-32915)#20278gre-ledger wants to merge 1 commit into
Conversation
Web Tools Build Status
|
There was a problem hiding this comment.
Pull request overview
This PR removes the deprecated @ledgerhq/errors workspace package from the Ledger Wallet monorepo and cleans up remaining repository references, while temporarily keeping runtime compatibility for external coin-module packages via pnpm.packageExtensions until upstream peerDependency removal is released.
Changes:
- Remove the in-repo
libs/ledgerjs/packages/errorspackage and drop all remaining workspace dependency references to@ledgerhq/errors. - Add
pnpm.packageExtensionsto inject@ledgerhq/errors@6.37.0as a dependency for@ledgerhq/coin-module-framework,coin-stellar,coin-xrp, andcoin-hypercore(external packages that stillrequire()it). - Update boundary tooling/tests, coin-modules allowlists/docs, and agent skills/docs to reflect the migration to native
Errorclasses anderror.namechecks.
Reviewed changes
Copilot reviewed 91 out of 92 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/nx-plugins/enforce-boundaries/validate.test.js | Updates legacy import test fixtures now that @ledgerhq/errors is removed. |
| tools/nx-plugins/enforce-boundaries/validate.js | Updates inline documentation example for sub-path stripping. |
| pnpm-lock.yaml | Lockfile updates reflecting removal of workspace @ledgerhq/errors and new packageExtensions-injected deps. |
| package.json | Removes ljs:errors/build filters and adds pnpm.packageExtensions bridge for external coin modules. |
| libs/ledgerjs/packages/hw-app-celo/.unimportedrc.json | Removes now-unneeded @ledgerhq/errors ignore entry. |
| libs/ledgerjs/packages/errors/tsconfig.json | Deletes config as part of removing the @ledgerhq/errors package. |
| libs/ledgerjs/packages/errors/tsconfig.build.json | Deletes build config as part of removing the @ledgerhq/errors package. |
| libs/ledgerjs/packages/errors/src/index.ts | Removes the legacy error exports implementation. |
| libs/ledgerjs/packages/errors/src/index.test.ts | Removes package tests along with the package. |
| libs/ledgerjs/packages/errors/src/helpers.ts | Removes legacy createCustomErrorClass + serialization helpers with the package. |
| libs/ledgerjs/packages/errors/src/deserializeError.test.ts | Removes serialization resiliency tests with the package. |
| libs/ledgerjs/packages/errors/README.md | Removes package README along with the package. |
| libs/ledgerjs/packages/errors/package.json | Removes the workspace package manifest. |
| libs/ledgerjs/packages/errors/jest.config.ts | Removes package Jest config along with the package. |
| libs/ledgerjs/packages/errors/DEPRECATED.md | Removes deprecated-package guidance along with the package. |
| libs/ledgerjs/packages/errors/CHANGELOG.md | Removes package changelog along with the package. |
| libs/ledgerjs/packages/errors/.unimportedrc.json | Removes unimported config along with the package. |
| libs/ledger-live-common/src/exchange/swap/completeExchange.ts | Adjusts comment wording to reflect migration away from shared error class checks. |
| libs/ledger-live-common/package.json | Drops @ledgerhq/errors dependency. |
| libs/ledger-live-common/dependencies.md | Removes @ledgerhq/errors from dependency tracking doc. |
| libs/coin-tester-modules/coin-tester-xrp/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-tester-modules/coin-tester-xrp/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-tester-modules/coin-tester-stellar/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-tester-modules/coin-tester-stellar/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-tester-modules/coin-tester-polkadot/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-tester-modules/coin-tester-cosmos/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/README.md | Updates allowed-import documentation to remove @ledgerhq/errors and include framework errors home. |
| libs/coin-modules/coin-vechain/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-vechain/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-tron/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-tron/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-ton/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-ton/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-tezos/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-tezos/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-sui/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-sui/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-stacks/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-solana/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-solana/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-polkadot/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-polkadot/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-near/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-near/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-multiversx/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-multiversx/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-module-boilerplate/package.json | Drops @ledgerhq/errors dependency (template upkeep). |
| libs/coin-modules/coin-module-boilerplate/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-mina/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-kaspa/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-kaspa/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-internet_computer/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-internet_computer/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-icon/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-icon/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-hedera/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-hedera/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-filecoin/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-filecoin/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-evm/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-evm/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-cosmos/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-cosmos/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-concordium/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-celo/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-celo/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-casper/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-casper/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-cardano/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-cardano/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-canton/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-bitcoin/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-bitcoin/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-aptos/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-aptos/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-algorand/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-algorand/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/coin-aleo/package.json | Drops @ledgerhq/errors dependency. |
| libs/coin-modules/coin-aleo/.unimportedrc.json | Removes @ledgerhq/errors ignore entry. |
| libs/coin-modules/.oxlintrc.json | Removes @ledgerhq/errors from restricted-import allowlist. |
| features/platform/currencies/src/errors.ts | Updates docs to remove references to legacy @ledgerhq/errors. |
| features/platform/currencies/README.md | Aligns feature README with native error-class approach. |
| docs/new-library.md | Updates new-library checklist to remove @ledgerhq/errors guidance. |
| CODEOWNERS | Removes codeownership entry for deleted @ledgerhq/errors source file. |
| apps/wallet-cli/src/device/classify-device-error.ts | Updates comments to remove references to @ledgerhq/errors. |
| apps/ledger-live-mobile/package.json | Drops @ledgerhq/errors dependency. |
| apps/ledger-live-desktop/package.json | Drops @ledgerhq/errors dependency. |
| .changeset/LIVE-32915-remove-errors-package.md | Adds changeset documenting removal and migration guidance. |
| .changeset/LIVE-32915-drop-serialize-deserialize-errors.md | Removes now-irrelevant changeset targeting the deleted package. |
| .agents/skills/impacting-prs/SKILL.md | Updates skill docs/examples to remove @ledgerhq/errors-specific wording. |
| .agents/skills/errors/SKILL.md | Updates errors skill to reflect post-@ledgerhq/errors guidance (needs minor wording tweak). |
| .agents/skills/coin-modules/SKILL.md | Updates coin-modules skill allowed-import guidance to remove @ledgerhq/errors. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Rsdoctor Bundle Diff AnalysisFound 7 projects in monorepo, 7 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 desktop-mainPath:
📁 desktop-preloaderPath:
📁 desktop-rendererPath:
📁 desktop-webviewDappPreloaderPath:
📁 desktop-webviewPreloaderPath:
📁 desktop-workersPath:
📁 mobilePath:
Generated by Rsdoctor GitHub Action |
196c551 to
bdf815f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 91 out of 92 changed files in this pull request and generated no new comments.
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Suppressed comments (1)
package.json:353
pnpm.packageExtensionskeys currently target the package name without a version selector, so this extension will keep applying even after bumping@ledgerhq/coin-module-framework/coin-stellar/coin-xrp/coin-hypercoreto versions that no longer need@ledgerhq/errors. Scoping the selector to the current versions makes the bridge self-expiring and reduces the risk of accidentally keeping@ledgerhq/errorsin the dependency graph after the upstream fix is released.
|
Important Superseded by #20280 — do not merge this. The #20280 does the same de-dependency work but keeps the package in-repo and bridges the external peer with |
|
Preconditions for the full sunsetConfirmed: wallet-api@916d7a3 ("chore: remove @ledgerhq/errors dependency", #598) does exactly what is needed — it drops the dep from both So deleting
Why 2 matters beyond tidinessThe renderer duplication reported on this PR is version-based —
Once wallet-api-core is bumped, the Neither of those two is a Ledger package, so they will keep resolving |
No workspace source imported the lib anymore: every error class it held now lives in the package that owns it, with @ledgerhq/ledger-wallet-framework/errors as the shared home below the coin layer. This removes the package itself plus all remaining references (manifests, lint and unimported allowlists, root nx filters, CODEOWNERS, docs and skills). The external @ledgerhq/coin-module-framework, coin-stellar, coin-xrp and coin-hypercore still declare @ledgerhq/errors as a peerDependency and require it at runtime, so the peer is bridged from npm via pnpm.packageExtensions. That bridge is temporary and should be deleted once LedgerHQ/coin-modules#752 lands and is released. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
bdf815f to
0162219
Compare
| "@ledgerhq/coin-vechain": patch | ||
| "@ledgerhq/live-common": patch | ||
| "ledger-live-desktop": patch | ||
| "live-mobile": patch |
There was a problem hiding this comment.
fixme refine the diff for the actual subset of lib that are effectively dropping these
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 22 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Suppressed comments (2)
tools/nx-plugins/enforce-boundaries/constraints.js:56
BANNED_DEPENDENCIESis now empty, which disables the safeguard added in #20280 that prevented reintroducing@ledgerhq/errorsvia workspace manifests. Since@ledgerhq/errorsstill exists on npm, this change makes it easy for new code to accidentally add it back without any enforce-boundaries failure.
/**
* Packages no workspace manifest may declare, whatever the dependency field.
*
* `hoist=false` means a package can only resolve what it declares, so banning the
* declaration is enough to ban the import too — an undeclared import fails to resolve.
*/
const BANNED_DEPENDENCIES = [];
module.exports = { DEP_CONSTRAINTS, BOUNDARY_EXCEPTIONS, BANNED_DEPENDENCIES };
pnpm-lock.yaml:46548
- The lockfile now shows
@ledgerhq/coin-module-framework/coin-*snapshots without an@ledgerhq/errorsdependency (even though those packages still declare it as a peerDependency in the same lockfile). Withauto-install-peers=false, this is a strong sign that the peer won’t be provided at runtime; after restoring thepnpm.packageExtensionsbridge inpackage.json, please regeneratepnpm-lock.yamlso these snapshots reflect the injected dependency.
| "packageExtensions": { | ||
| "detox-allure2-adapter": { | ||
| "dependencies": { | ||
| "tslib": "*" | ||
| } | ||
| }, | ||
| "tronweb": { | ||
| "dependencies": { | ||
| "tslib": "*" | ||
| } | ||
| }, | ||
| "detox": { | ||
| "dependencies": { | ||
| "expect": "*" | ||
| } | ||
| }, | ||
| "@ledgerhq/coin-module-framework": { | ||
| "dependencies": { | ||
| "@ledgerhq/errors": "workspace:*" | ||
| } | ||
| }, | ||
| "@ledgerhq/coin-stellar": { | ||
| "dependencies": { | ||
| "@ledgerhq/errors": "workspace:*" | ||
| } | ||
| }, | ||
| "@ledgerhq/coin-xrp": { | ||
| "dependencies": { | ||
| "@ledgerhq/errors": "workspace:*" | ||
| } | ||
| }, | ||
| "@ledgerhq/coin-hypercore": { | ||
| "dependencies": { | ||
| "@ledgerhq/errors": "workspace:*" | ||
| } | ||
| } | ||
| }, |
There was a problem hiding this comment.
here we're just anticipating the drop



coin-module-framework,coin-stellar,coin-xrpandcoin-hypercorealso all drop @ledgerhq/errors peer dependencyWarning
Do not merge before LedgerHQ/coin-modules#752 lands and is released.
That PR removes the
@ledgerhq/errorspeerDependency fromcoin-module-framework,coin-stellar,coin-xrpandcoin-hypercore. Until it ships, this PR needs thepnpm.packageExtensionsbridge below to keep those external packages resolvable at runtime.📝 Description
Removes the
@ledgerhq/errorspackage from the monorepo. No workspace source imported it anymore — every error class it held now lives in the package that owns it, with@ledgerhq/ledger-wallet-framework/errorsas the shared home below the coin layer.createCustomErrorClassand theserializeError/deserializeErrorstack go away with it.Also drops all remaining references: 33 manifests, 29
.unimportedrc.jsonallowlists, thelibs/coin-modules/.oxlintrc.jsonimport allowlist, the rootnx run-manyfilters andljs:errorsscript, CODEOWNERS, docs and skills.Define errors as native classes and branch on
name, which survives serialization:The one non-obvious part. Those 33 manifests looked like dead weight — no source file imported the package — but they were load-bearing. The external
@ledgerhq/coin-module-framework(andcoin-stellar/coin-xrp) declare@ledgerhq/errorsas apeerDependencyandrequire()it at runtime; withauto-install-peers=false, each consumer'sworkspace:^entry was what satisfied that peer. Dropping them brokecoin-module-framework/config,/errorsand/api/getBalance/rejectBalanceOptions— 79 import sites across 30 packages, both apps included.So the peer is bridged from npm until #752 ships:
Once #752 is released, bump those four catalog versions and delete the block — it is the only thing keeping
@ledgerhq/errorsin the dependency graph.@ledgerhq/errors@6.37.0stays on npm for external consumers; it is simply no longer published from this repo.🔗 Context