fix(wallet): self-contained build (drop the lightnode-sdk dependency)#78
Merged
Conversation
…pendency) The wallet imported WorkerOperator/NETWORKS from lightnode-sdk via file:../sdk, which forced building the SDK (tsc) before bundling. That SDK build needs the monorepo's hoisted @types/node and fails in a clean wallet-only checkout (Cannot find name process / module node:crypto), so a fresh clone could not build the extension at all. Inline the four worker-status reads with viem (src/rpc/worker.ts) against the LightChain mainnet worker contracts - the only thing the wallet used the SDK for - and remove the dependency plus the prebuild/build:sdk/predev scripts. The wallet now builds from its own deps with no SDK, no prebuild, no dist. Bundle drops 918 -> 581 kB.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Fixes the fresh-clone build failure for real this time.
Root cause (deeper than #77): the wallet imported
WorkerOperator/NETWORKSfromlightnode-sdkviafile:../sdk, which forced building the SDK (tsc) before bundling. That SDK build needs the monorepo's hoisted@types/nodeand fails in a clean wallet-only checkout (Cannot find name 'process',Cannot find module 'node:crypto'), so a fresh clone could not build the extension - even with the prebuild from #77.Fix: inline the four worker-status reads with viem (
src/rpc/worker.ts) against the LightChain mainnet worker contracts - the only thing the wallet used the SDK for - and remove the dependency plus theprebuild/build:sdk/predevscripts. The wallet now builds from its own deps with no SDK, no prebuild, no dist.Verified on a true fresh clone:
git clone … && cd wallet && npm install && npm run buildsucceeds. Bundle drops 918 → 581 kB. 24 wallet tests + 491 root tests green,tscclean.