feat(sdk): add workspace:* protocol and @uniswap/sdk umbrella package#489
feat(sdk): add workspace:* protocol and @uniswap/sdk umbrella package#489thomasthachil wants to merge 1 commit intomainfrom
Conversation
🤖 Claude Code Review
SummaryThis PR introduces two main changes:
AnalysisThe Umbrella PackageThe umbrella package design is clean:
Publishing Configuration ChangeThe switch from Turbo ChangesThe turbo.json changes add:
The Minor NoteThe new VerdictThe changes are consistent, well-structured, and follow the existing patterns in the repository. The umbrella package provides a clean developer experience, and the publishing configuration changes appear to be a systematic improvement across all packages. 💡 Want a fresh review? Add a comment containing |
There was a problem hiding this comment.
📋 Review verdict: APPROVE
👆 The main review comment above is the source of truth for this PR review. It is automatically updated on each review cycle, so always refer to it for the most current feedback.
This formal review submission is for the verdict only.
This PR makes two key changes to simplify SDK dependency management: 1. **Switch internal dependencies to workspace:* protocol** - All internal @uniswap/* dependencies now use `workspace:*` - At publish time, yarn replaces with actual version numbers - Eliminates cascading version bump PRs (6+ PRs → 1 PR) 2. **Add @uniswap/sdk umbrella package** - Single package that re-exports all SDKs - Namespaced exports to avoid conflicts (V2, V3, V4, etc.) - Tree shaking ensures minimal bundle size - Simplifies internal service dependencies 3. **Use yarn npm publish for workspace protocol support** - Changed semantic-release config to use `yarn npm publish` - `@semantic-release/npm` with `npmPublish: false` for version bumping - `@semantic-release/exec` with `publishCmd: "yarn npm publish"` for publishing - Ensures workspace:* gets replaced with actual versions Updated packages: - v2-sdk, v3-sdk, v4-sdk - router-sdk, universal-router-sdk - uniswapx-sdk, smart-wallet-sdk - permit2-sdk, sdk-core - flashtestations-sdk, tamperproof-transactions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ef7e639 to
4c805f2
Compare
Superseded by new review after PR update
There was a problem hiding this comment.
📋 Review verdict: APPROVE
👆 The main review comment above is the source of truth for this PR review. It is automatically updated on each review cycle, so always refer to it for the most current feedback.
This formal review submission is for the verdict only.
Summary
This PR addresses the SDK update chaos by making three key architectural changes:
1. Switch internal dependencies to
workspace:*protocolAll internal
@uniswap/*dependencies now useworkspace:*instead of explicit npm version ranges.Before:
After:
Benefits:
workspace:*with the actual version2. Add
@uniswap/sdkumbrella packageNew package that re-exports all SDKs for simplified internal usage:
Benefits:
3. Use
yarn npm publishfor workspace protocol supportChanged semantic-release config across all packages:
@semantic-release/npmwithnpmPublish: false→ only bumps version in package.json@semantic-release/execwithpublishCmd: "yarn npm publish"→ publishes with workspace resolutionWhy this is needed: The default
npm publishdoesn't resolve workspace protocols.yarn npm publishdoes.4. Release ordering via turbo
Updated
turbo.jsonto ensure packages release in dependency order:How it works:
turbo run release --concurrency=1runs releases sequentiallydependsOn: ["^release"]ensures dependencies release firstpackage.jsonto7.11.07.11.0→workspace:*resolves to^7.11.0Packages updated
workspace:*deps,yarn npm publishworkspace:*deps,yarn npm publishworkspace:*deps,yarn npm publishyarn npm publishyarn npm publishrelease.dependsOn: ["^release"]Impact on common scenarios
@uniswap/sdk)Test plan
yarn g:build)🤖 Generated with Claude Code
✨ Claude-Generated Content
Summary
Addresses SDK update chaos by switching all internal
@uniswap/*dependencies toworkspace:*protocol and adding a new@uniswap/sdkumbrella package for simplified internal usage.Changes
1. Switch internal dependencies to
workspace:*protocolAll internal
@uniswap/*dependencies now useworkspace:*instead of explicit npm version ranges:workspace:*sdk-coresdk-coresdk-core,v3-sdksdk-core,v2-sdk,v3-sdk,v4-sdksdk-core,v2-sdk,v3-sdk,v4-sdk,router-sdk,permit2-sdksdk-core,permit2-sdksdk-coreworkspace:*with the actual version2. Add
@uniswap/sdkumbrella packageNew package (
sdks/sdk/) that re-exports all SDKs:sdk-coreexports directly (Token, CurrencyAmount, etc.)V2,V3,V4Router,UniversalRouterPermit2,UniswapXSmartWallet,Flashtestations,TamperproofTx3. Build and publish configuration
turbo.jsonto adddependsOn: ["^build"]for proper build ordering with workspace dependenciesdependsOn: ["^release"]for release task orderingyarn npm publishvia@semantic-release/execinstead of direct@semantic-release/npmpublishImpact
@uniswap/sdk)How Has This Been Tested?
yarn g:build)Are there any breaking changes?
No breaking changes for external consumers. Individual packages still published to npm with resolved versions. The umbrella package is additive.
Follow Ups
@uniswap/sdkin a consuming project