-
Notifications
You must be signed in to change notification settings - Fork 159
chore: add global adapter to fix sdk-tools #6753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdds module-level initialization that constructs and registers a global CoW SDK adapter (EthersV5Adapter using MAINNET RPC) before React rendering, removes Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ 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)
🔇 Additional comments (2)
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. Comment |
There was a problem hiding this 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
📒 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
| "compilerOptions": { | ||
| "outDir": "../../dist/out-tsc", | ||
| "types": ["node", "vite/client"], | ||
| "composite": true, | ||
| "declaration": true | ||
| "types": ["node", "vite/client"] | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check for tsconfig files that might reference sdk-tools as a composite project
echo "=== Searching for project references to sdk-tools ==="
rg -n --type=json '"references"' -A 10 | grep -i 'sdk-tools' || echo "No references found to sdk-tools"
echo ""
echo "=== Checking for composite project configurations ==="
fd tsconfig.json --exec rg -l '"composite".*true' {} \;
echo ""
echo "=== Searching for imports from sdk-tools app (unusual for apps) ==="
rg -n "from ['\"].*sdk-tools" --type=ts --type=tsx -g '!apps/sdk-tools/**' || echo "No imports from sdk-tools found"
echo ""
echo "=== Checking the full tsconfig.app.json content ==="
cat apps/sdk-tools/tsconfig.app.json
echo ""
echo "=== Checking tsconfig.json (base config) ==="
cat apps/sdk-tools/tsconfig.json 2>/dev/null || echo "No base tsconfig.json found in apps/sdk-tools"
echo ""
echo "=== Checking if apps/sdk-tools is referenced in root tsconfig ==="
rg -n '"references"' -A 50 tsconfig.json | head -60Repository: cowprotocol/cowswap
Length of output: 1969
🏁 Script executed:
#!/bin/bash
echo "=== Checking tsconfig.spec.json ==="
cat apps/sdk-tools/tsconfig.spec.json
echo ""
echo "=== Verifying: are composite and declaration in any of the sdk-tools tsconfig files? ==="
grep -r "composite\|declaration" apps/sdk-tools/tsconfig*.json || echo "Not found in any tsconfig files"
echo ""
echo "=== Documentation check: does TypeScript require composite for referenced projects? ==="
echo "TypeScript's project references feature (using 'references' in tsconfig) requires all referenced projects to have 'composite: true'"
echo "Without it, TypeScript compilation will fail with an error like 'Project cannot be built because of the above errors.'"Repository: cowprotocol/cowswap
Length of output: 1310
Critical: composite: true must be restored to tsconfig.app.json to prevent TypeScript build failure.
The removal of composite: true breaks the project reference chain in apps/sdk-tools/tsconfig.json, which declares references to both tsconfig.app.json and tsconfig.spec.json. TypeScript requires all referenced projects to have composite: true enabled. Currently, only tsconfig.spec.json has this setting, but tsconfig.app.json is missing it. This will cause TypeScript compilation to fail with "Project cannot be built because of the above errors."
Restore "composite": true to the compilerOptions in tsconfig.app.json.
🤖 Prompt for AI Agents
In apps/sdk-tools/tsconfig.app.json around lines 3 to 6, the compilerOptions
block is missing "composite": true which breaks the TypeScript project reference
chain; add "composite": true into the compilerOptions object (alongside outDir
and types) so tsconfig.app.json is a composite project and the references
declared in apps/sdk-tools/tsconfig.json can be built successfully.
Summary
fix sdk tools
After SDK changes to add adapters for web3 libraries, https://sdk-tools.cow.fi became broken:
Before:

After

Test
Test https://sdk-tools-git-fix-sdk-tools-cowswap-dev.vercel.app doesn't get that error
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.