feat: migrate build pipeline from tsc to tsdown#369
Open
Conversation
Replace tsc --build with tsdown (Rolldown/OXC) for all 5 SDK packages. - Add tsdown as root devDependency with per-package configs - Enable isolatedDeclarations for OXC-powered .d.ts generation - Add explicit return types to all exported functions/constants - Build all packages fully in parallel (no dependency ordering) - DTS lives alongside ESM in dist/esm/ (no separate dist/types/) - Add scripts/build.js for per-package timing output Build time: ~13s → ~1.9s (~7x faster) Closes EMB-317 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
effie-ms
reviewed
Mar 20, 2026
| "type": "module", | ||
| "scripts": { | ||
| "build": "pnpm --filter @lifi/sdk build && pnpm -r --parallel --filter './packages/**' --filter '!@lifi/sdk' build", | ||
| "build": "pnpm -r --parallel --filter './packages/**' build", |
Contributor
There was a problem hiding this comment.
SDK provider packages rely on core SDK package - shouldn't we still build core SDK first, or it's handled anyhow differently now?
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.
Migrate build pipeline from tsc to tsdown
Closes EMB-317
TL;DR
Replace
tsc --buildwith tsdown (powered by Rolldown/OXC in Rust) across all 5 SDK packages. Build time drops from ~13s to ~650ms (~20x faster).DESCRIPTION
Before vs After
check:typesstepWhat changed
Root:
tsdownas root devDependencyisolatedDeclarations: trueto root tsconfig (enables OXC-powered .d.ts generation)buildscript to run all packages in parallel (no SDK-first ordering needed)scripts/build.js— wraps tsdown with per-package timing outputPer package (5 packages):
tsdown.config.tswith ESM+DTS and CJS configs (ESM-only for sui)build:cjs/build:esm/build:types/build:cleanwith singletsdowncall.d.tsfiles now live alongside ESM indist/esm/(no separatedist/types/)types/typings/exportsfields to point todist/esm/index.d.tswatchupdated totsdown --watchcheck:typesremainstsc --noEmit(no faster alternative exists yet)Source files (~30 files):
isolatedDeclarations)parseAbiresults inabi.tstyped asAbi(viem's narrow generics incompatible with isolated declarations); downstream multicall results useascastsreturn thisfromHTTPError.buildAdditionalDetailsparseEthereumErrors.tsWhy tsdown?
.d.tsis generated independently without cross-file type resolution, enabling massive parallelismSTEPS TO TEST
EXPECTED RESULTS
dist/esm/contains.js,.js.map,.d.ts,.d.ts.mapfilesdist/cjs/contains.js,.js.mapfiles (not for sui)pnpm check(biome) passespnpm check:typespassesCHECKLIST