Skip to content

Conversation

@anxolin
Copy link
Contributor

@anxolin anxolin commented Dec 23, 2025

Summary

fix sdk tools

After SDK changes to add adapters for web3 libraries, https://sdk-tools.cow.fi became broken:

Before:
image

After
image

Test

Test https://sdk-tools-git-fix-sdk-tools-cowswap-dev.vercel.app doesn't get that error

Summary by CodeRabbit

  • Chores
    • Initialize a global SDK adapter at application startup to ensure the SDK is ready before UI rendering.
    • Update TypeScript build settings to stop generating declaration files and disable composite project mode, altering build outputs.
    • Add deployment configuration to serve the app as a single-page application and specify build/output steps.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
cowfi Ready Ready Preview Jan 5, 2026 4:35pm
explorer-dev Ready Ready Preview Jan 5, 2026 4:35pm
sdk-tools Ready Ready Preview Jan 5, 2026 4:35pm
swap-dev Ready Ready Preview Jan 5, 2026 4:35pm
widget-configurator Ready Ready Preview Jan 5, 2026 4:35pm
1 Skipped Deployment
Project Deployment Review Updated (UTC)
cosmos Ignored Ignored Jan 5, 2026 4:35pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 23, 2025

Warning

Rate limit exceeded

@kernelwhisperer has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 44 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 0975d42 and 55c5e82.

📒 Files selected for processing (3)
  • apps/sdk-tools/src/main.tsx
  • apps/sdk-tools/tsconfig.app.json
  • apps/sdk-tools/vercel.json

Walkthrough

Adds module-level initialization that constructs and registers a global CoW SDK adapter (EthersV5Adapter using MAINNET RPC) before React rendering, removes composite/declaration from the app TypeScript config, and adds a Vercel deployment config with a SPA rewrite and build/install/output commands.

Changes

Cohort / File(s) Summary
CoW SDK Adapter Initialization
apps/sdk-tools/src/main.tsx
Adds imports (getRpcProvider, setGlobalAdapter, SupportedChainId, EthersV5Adapter); creates an EthersV5Adapter with the MAINNET RPC provider at module load and calls setGlobalAdapter() before React renders.
TypeScript build config
apps/sdk-tools/tsconfig.app.json
Removes composite: true and declaration: true from compilerOptions, disabling composite project mode and declaration file output for this app.
Vercel deployment config
apps/sdk-tools/vercel.json
Adds Vercel config: SPA rewrite to index.html, buildCommand (cd ../../ && yarn build:sdk-tools), installCommand (cd ../../ && yarn run install:ci), and outputDirectory (../../build/sdk-tools).

Sequence Diagram(s)

mermaid
sequenceDiagram
autonumber
participant Module as main.tsx (module load)
participant RPC as RPC Provider
participant Adapter as EthersV5Adapter
participant Global as Global SDK State
participant React as React App (Root)

Note over Module,RPC: Module-level init runs before app render
Module->>RPC: getRpcProvider(SupportedChainId.MAINNET)
RPC-->>Module: rpcProvider
Module->>Adapter: new EthersV5Adapter(rpcProvider, chainId)
Adapter-->>Module: adapterInstance
Module->>Global: setGlobalAdapter(adapterInstance)
Global-->>Module: adapter registered
Note over Global,React: Global adapter now available to app
Module->>React: import/execute Root render
React-->>Global: read global adapter (on use)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • alfetopito
  • shoom3301

Poem

🐰 I hopped in early, set the chain,
MAINNET whispers through my vein,
An adapter snug, then off they run,
Root greets code — the job is done,
✨🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description includes a summary with context and screenshots showing the issue, but the testing section is incomplete and lacks detailed verification steps. Expand the testing section with specific, numbered steps to verify the fix and define what QA should check (e.g., verify no error appears, confirm adapter initializes correctly).
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a global adapter initialization to fix the sdk-tools application.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 738fa0e and 44e25b4.

📒 Files selected for processing (1)
  • apps/sdk-tools/tsconfig.app.json
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: alfetopito
Repo: cowprotocol/cowswap PR: 6234
File: libs/tokens/src/index.ts:1-4
Timestamp: 2025-09-11T08:25:51.460Z
Learning: In the cowprotocol/cowswap project, there is currently no SSR (Server-Side Rendering) support, so localStorage access at module import time does not cause SSR-related issues.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Setup
  • GitHub Check: Cypress

@kernelwhisperer kernelwhisperer enabled auto-merge (squash) January 5, 2026 16:33
@kernelwhisperer kernelwhisperer merged commit 6dce7aa into develop Jan 5, 2026
17 checks passed
@kernelwhisperer kernelwhisperer deleted the fix-sdk-tools branch January 5, 2026 16:36
@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants