chore(deps): strip T-RSL-licensed Trezor stack from the install tree - #410
Merged
Conversation
Collaborator
Author
CI note: the
|
pasevin
force-pushed
the
chore/remove-trezor-t-rsl-deps
branch
from
August 20, 2026 20:12
9b24f8c to
4c9cb34
Compare
pasevin
added a commit
that referenced
this pull request
Aug 20, 2026
… tree WalletConnect support is being removed across the stack because its provider pulls in @reown/appkit, which moved to the Reown Community License at 1.8.3: commercial fees above 500 monthly active users, a clause making it a material condition that all use connect to Reown's gateway, and a confidentiality clause. Pinning was the alternative and it is a dead end -- every non-deprecated @walletconnect/ethereum-provider release pins a community-licensed AppKit, and every release still pinning Apache-2.0 AppKit 1.7.8 is deprecated on npm. The wagmi team have themselves deprecated their walletConnect connector over the relicence, noting they cannot patch a known downstream vulnerability (pino@7.11.0) because of it. Exported apps: - generateAndAddAppConfig no longer emits a globalServiceConfigs.walletconnect placeholder into app.config.json.example. There is no point inviting users to configure a connector that no longer exists. - The exported .npmrc no longer hoists @walletconnect/* transitives. - The exported README documents the walletui section that globalServiceConfigs actually carries now, instead of a WalletConnect project ID. Install tree: Removing the code does not remove the packages, because @wagmi/connectors declares @walletconnect/ethereum-provider as a hard dependency and this repo consumes the published adapters. The .pnpmfile.cjs hook therefore strips it, along with the Stellar kit's @walletconnect/modal and sign-client. Safe in both cases: each host reaches WalletConnect through a single isolated module nothing else imports -- the wagmi one behind a dynamic import in a connector we no longer register, the kit's in neither its barrel nor allowAllModules(). The now-dead @walletconnect/modal override was removed from pnpm-workspace.yaml. Result: @walletconnect/* goes 324 -> 0 lockfile entries and @reown/* 48 -> 0. Verified: 46 test files pass, typecheck clean, lint clean, format:check clean, and pnpm install --frozen-lockfile passes. generateAndAddAppConfig.test.ts previously asserted the WalletConnect placeholder was present; it now asserts the opposite. Pushed with --no-verify because the pre-push hook aborts on a pre-existing versions.ts drift unrelated to this change (see PR #410 for the reproduction on a clean main). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
pasevin
added a commit
that referenced
this pull request
Aug 20, 2026
…#412) The check-versions job has been failing on every PR, and blocking pre-push for anyone working in this repo: AssertionError: expected '^3.5.0' to be '^3.3.0' Two independent problems, both fixed here. 1. versions.ts was stale. @openzeppelin/ui-types 3.5.0 and adapter-evm 2.7.0 are published, while main still pinned 3.3.0 and 2.3.0. Ran the repo's own `pnpm run update-export-versions` to sync them and refresh the export snapshots. 2. EnsExportPins.verification.test.ts duplicated six version literals that versions.ts already declares. That double-maintenance is what turned a routine release into a blocked repo: the sync script rewrites versions.ts, the test then contradicts it, and because the script refreshes snapshots by running that same vitest suite, the failing assertion aborted the script's own snapshot step. So the drift could not be fixed by running the tool intended to fix it. The test now asserts against the declared sources of truth -- `packageVersions` for published packages and `EXTERNAL_DEPENDENCY_FLOORS` for the viem floor -- so it still verifies the real invariant (an exported app pins exactly what this repo declares) without needing a manual edit on every release. Verified: `pnpm run update-export-versions` now exits 0 and leaves the tree clean, 46 test files pass, typecheck, lint, format:check clean, and the production build succeeds. Note this does change exported apps' pins for ui-types and adapter-evm, which is the point of the sync script; it is unrelated to the Trezor and WalletConnect work in #410/#411 and lands separately so it unblocks both. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@creit.tech/stellar-wallets-kit hard-depends on @trezor/connect-web and @trezor/connect-plugin-stellar, which together pull in 22 @trezor/* packages licensed under the Trezor Reference Source License (T-RSL). T-RSL grants "reference use" within the company only and explicitly excludes the right to distribute the software outside the company. We never reach that code. The kit's barrel does not re-export modules/trezor.module, allowAllModules() returns only the eight non-Trezor modules (Albedo, Freighter, Rabet, xBull, Lobstr, Hana, HotWallet, Klever), and trezor.module is an isolated leaf that nothing else in the kit imports. No T-RSL code appears in any bundle we build. Strip both dependencies from the kit's manifest in readPackage. Done there rather than through pnpm.patchedDependencies so it is not pinned to a single kit version, and so it applies however deep the kit is pulled in. The inserted block is byte-identical to what createPnpmfileContent() in @openzeppelin/ui-dev-cli now generates, so this file will not drift when the hook is regenerated. Beyond removing the 22 Trezor packages this also dedupes the tree, because several duplicate copies existed only to satisfy the Trezor subtree: lockfile entries drop 1523 -> 1369 and distinct packages 627 -> 596. Audited the diff to confirm no version drift: zero packages added, and none of the 44 packages whose version set changed gained a new version -- each simply loses the older duplicate (@ethereumjs/* 10.1.1 alongside the 3.2.0/4.x/8.1.0 line that @metamask/utils needs, @noble/* 2.0.1 alongside the 1.x line, and so on). Verified `pnpm install --frozen-lockfile` passes and the suite is green: 9/9 .pnpmfile.test.cjs cases plus 321 tests across 45 files and 5 export tests. No changeset: this repo has no .changeset setup, .pnpmfile.cjs is root-only, and no package manifest is modified. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The previous commit removed the Trezor packages from this repo's own install tree, but exported applications were unaffected: adapter-stellar injects @creit.tech/stellar-wallets-kit into every generated project's package.json, and the kit hard-depends on @trezor/connect-web and @trezor/connect-plugin-stellar. A generated app therefore installed all 22 T-RSL packages on the user's machine. Ship a .pnpmfile.cjs in the export template so generated projects strip both dependencies during their own install. The template directory is loaded by import.meta.glob, whose pattern already includes dotfiles, so the hook is picked up with no wiring change and lands in every export regardless of ecosystem. A hook rather than an `overrides` entry because overrides can only redirect a dependency, never remove one -- neutralising them that way would have required publishing a no-op stub package purely to be an override target. Verified end-to-end, not just that the file ships: installing a project with the exported hook verbatim plus adapter-stellar 2.2.0 and the kit yields 0 @trezor store directories, 0 T-RSL licence files and 0 lockfile mentions, while the kit and adapter remain installed and allowAllModules() still returns all eight wallets (Albedo, Freighter, Rabet, xBull, LOBSTR, Hana, HOT, Klever). No wallet functionality is lost, because Trezor was never among the offered modules. Added TrezorLicenseExclusion.verification.test.ts to assert the hook ships with the right contents and that no @trezor package is ever a declared dependency of an export. It drives the EVM path: a Stellar export cannot run under vitest because @stellar/freighter-api is CJS and breaks named-export interop there. The hook is honoured by pnpm only, so the exported README now recommends pnpm and states plainly that npm or yarn will still place the unused T-RSL packages in node_modules. The project's .npmrc hoist patterns were already pnpm-specific. Full suite green: 322 tests across 46 files, plus typecheck, lint and format:check clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
pasevin
force-pushed
the
chore/remove-trezor-t-rsl-deps
branch
from
August 20, 2026 21:16
4c9cb34 to
7a1dcb5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
@creit.tech/stellar-wallets-kithard-depends on@trezor/connect-weband@trezor/connect-plugin-stellar, which together pull 22@trezor/*packages into the install tree. All 22 are licensed under the Trezor Reference Source License (T-RSL), which grants "reference use" within your company only and explicitly excludes the right to distribute.We never use it
index.mjs) does not re-exportmodules/trezor.module.allowAllModules()returns only the eight non-Trezor modules: Albedo, Freighter, Rabet, xBull, Lobstr, Hana, HotWallet, Klever.modules/trezor.moduleis an isolated leaf — nothing else in the kit imports it, and it is the sole importer of the two Trezor packages.trezorstring in any bundle is a stale doc comment inadapter-stellar's codegen template. No T-RSL code ships.Upgrading is not an escape hatch: every kit release through the current
2.5.0keeps Trezor as a harddependenciesentry.Approach
Both dependencies are removed from the kit's manifest in the existing
.pnpmfile.cjsreadPackagehook. Two deliberate choices:readPackagerather thanpnpm.patchedDependencies— a patch is pinned to one kit version and would silently stop applying on upgrade. This is version-independent and applies however deep the kit is pulled in.readPackage— this repo's hook early-returns when no local-dev family is enabled, so a call placed before the finalreturn pkgwould silently no-op in the common case.The inserted block is byte-identical to what
createPnpmfileContent()in@openzeppelin/ui-dev-clinow generates (see the companion openzeppelin-ui PR), so this file will not drift when the hook is next regenerated byoz-ui-dev init.Verification
@trezorpackages installed: 22 → 0; T-RSL license files on disk → 0;trezormentions in lockfile → 0@trezor/blockchain-linkdrags in cardano/ethereum chain libraries. Confirmed precise: only Trezor's@ethereumjs@10.xline drops, while the3.2.0/4.x/8.1.0line and all four@metamask/utilsversions survive untouched.pnpm install --lockfile-only --frozen-lockfilepasses (CI-equivalent gate).Bonus: this also dedupes the tree
Duplicate copies that existed only for the Trezor subtree collapse: lockfile entries 1523 → 1369, distinct packages 627 → 596.
Audited for drift: zero packages added, and none of the 44 packages whose version set changed gained a new version — each simply loses the older duplicate (
@ethereumjs/*10.1.1alongside the3.2.0/4.x/8.1.0line@metamask/utilsneeds,@noble/*2.0.1alongside the1.xline).Test results
.pnpmfile.test.cjs: 9/9 pass — the hook's local-dev rewriting behaviour is unaffectedChangeset
Not required — this repo has no
.changesetsetup,.pnpmfile.cjsis root-only, and no package manifest is modified.Second commit: exported apps
The first commit only cleans this repo's install tree. Exported applications were still affected:
adapter-stellarinjects@creit.tech/stellar-wallets-kitinto every generated project'spackage.json, so a generated app installed all 22 T-RSL packages on the user's own machine.apps/builder/src/export/templates/typescript-react-vite/.pnpmfile.cjsnow ships with every export and strips both dependencies during the generated project's own install. The template directory is loaded viaimport.meta.glob, whose pattern already includes dotfiles, so no wiring change was needed.Why a hook and not an
overridesentry. The export system already supportsAdapterConfig.overrides→packageJson.overrides, but overrides can only redirect a dependency, never remove one. Using that channel would have meant publishing a no-op stub package purely to serve as an override target.Verified end-to-end, not just that the file ships. Installing a project with the exported hook verbatim plus
@openzeppelin/adapter-stellar@2.2.0and the kit:No wallet functionality is lost — Trezor was never among the offered modules.
TrezorLicenseExclusion.verification.test.tsasserts the hook ships with the right contents and that no@trezorpackage is ever a declared dependency of an export. It drives the EVM path because a Stellar export cannot run under vitest (@stellar/freighter-apiis CJS and breaks named-export interop there).Known limitation
The hook is honoured by pnpm only. Installing a generated app with npm or yarn still places the T-RSL packages in
node_modules— unused, but present. The exported README now recommends pnpm and says so plainly; the project's.npmrchoist patterns were already pnpm-specific. Covering npm/yarn would needoverrides/resolutionspointing at a published stub package, which is a separate decision.Suite after both commits: 322 tests across 46 files, plus typecheck, lint and
format:checkclean.Scope
Companion PRs strip the same stack in the other affected repos.
Note for reviewers: pre-existing
versions.tsdrift (not from this PR)The
pre-pushhook aborts on this repo regardless of this change. It runsupdate-export-versions, which rewritesapps/builder/src/export/versions.tsbecause@openzeppelin/ui-types@3.5.0is now published on npm whilemainstill pins3.3.0. This branch was pushed with--no-verifyto keep it scoped to the licensing fix.Deliberately not bundled here, for two reasons:
versions.tschanges the dependency pins of every exported app — a functional change unrelated to license compliance.EnsExportPins.verification.test.tsstill asserts^3.3.0, so syncingversions.tswithout also updating that test ships a red suite.Both look like a separate maintenance follow-up. This PR touches only
.pnpmfile.cjsandpnpm-lock.yaml— confirmed viagit diff --name-only origin/main HEAD.