chore(sdk): set explicit rootDir for TS 6 compat#721
Conversation
TypeScript 6 no longer infers rootDir and emits TS5011 when not set. Set rootDir=./src in sdk/ts and sdk/ts-compat base tsconfig, with ts-jest inline override to '.' so test/ files outside src still compile. No-op under TS 5.9; unblocks the TS 6.0 bump in #719. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adds explicit ChangesTypeScript & Jest rootDir Configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
sdk/ts/jest.config.cjs (1)
12-21:⚠️ Potential issue | 🟠 Major | ⚡ Quick winUpgrade ts-jest to v29.4.0 or later for Jest 30 compatibility.
ts-jest 29.1.2 does not support Jest 30. Jest 30 support was added in ts-jest v29.4.0 (released June 2025). Using 29.1.2 with Jest 30.2.0 will trigger peer dependency conflicts and warnings about untested versions. The test results passing don't validate this compatibility mismatch. Upgrade both sdk/ts and sdk/ts-compat to use ts-jest@^29.4.0 or later.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@sdk/ts/jest.config.cjs` around lines 12 - 21, The project is using ts-jest 29.1.2 which is incompatible with Jest 30; update the ts-jest dependency to ^29.4.0 (or later) in both the sdk/ts and sdk/ts-compat package.json devDependencies, run install to refresh the lockfile, and re-run tests to confirm no peer-dependency warnings; ensure any custom ts-jest config in jest.config.cjs (the transformer mapping '^.+\\.ts$' => ['ts-jest', {...}]) remains valid for the new ts-jest version.
🧹 Nitpick comments (1)
sdk/ts-compat/jest.config.cjs (1)
1-25: ⚡ Quick winBuild order is enforced through CI workflow orchestration and npm dependencies—no action needed, but consider adding TypeScript
referencesfor compile-time enforcement.The monorepo already enforces
sdk/tsbuilding beforesdk/ts-compatthrough:
- npm dependency:
sdk/ts-compat/package.jsondeclares@yellow-org/sdkas both a peerDependency and devDependency usingfile:../ts- CI orchestration:
.github/workflows/main-pr.ymland.github/workflows/main-push.ymluse thebootstrap-project-path: 'sdk/ts'parameter in the test workflow, which explicitly buildssdk/tsbeforesdk/ts-compatHowever, neither
sdk/ts/tsconfig.jsonnorsdk/ts-compat/tsconfig.jsonincludes areferencesfield to encode this dependency at the TypeScript compilation level. Adding"references": [{ "path": "../ts" }]tosdk/ts-compat/tsconfig.jsonwould make the build order explicit and enforceable during local development and CI builds.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@sdk/ts-compat/jest.config.cjs` around lines 1 - 25, Summary: TypeScript project dependency isn't encoded via tsconfig references, so add a "references" link from sdk/ts-compat to sdk/ts and enable composite builds. Update sdk/ts-compat/tsconfig.json to include "references": [{ "path": "../ts" }] so the compiler knows it depends on the ../ts project, and ensure the referenced project (sdk/ts/tsconfig.json) has "compilerOptions.composite": true (and "declaration": true if not already) so TypeScript can build and check referenced project artifacts; this will enforce build order during local and CI TypeScript compilation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@sdk/ts/jest.config.cjs`:
- Around line 12-21: The project is using ts-jest 29.1.2 which is incompatible
with Jest 30; update the ts-jest dependency to ^29.4.0 (or later) in both the
sdk/ts and sdk/ts-compat package.json devDependencies, run install to refresh
the lockfile, and re-run tests to confirm no peer-dependency warnings; ensure
any custom ts-jest config in jest.config.cjs (the transformer mapping
'^.+\\.ts$' => ['ts-jest', {...}]) remains valid for the new ts-jest version.
---
Nitpick comments:
In `@sdk/ts-compat/jest.config.cjs`:
- Around line 1-25: Summary: TypeScript project dependency isn't encoded via
tsconfig references, so add a "references" link from sdk/ts-compat to sdk/ts and
enable composite builds. Update sdk/ts-compat/tsconfig.json to include
"references": [{ "path": "../ts" }] so the compiler knows it depends on the
../ts project, and ensure the referenced project (sdk/ts/tsconfig.json) has
"compilerOptions.composite": true (and "declaration": true if not already) so
TypeScript can build and check referenced project artifacts; this will enforce
build order during local and CI TypeScript compilation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2084022d-97c9-4740-be60-804130f0ae4d
📒 Files selected for processing (4)
sdk/ts-compat/jest.config.cjssdk/ts-compat/tsconfig.jsonsdk/ts/jest.config.cjssdk/ts/tsconfig.json
The router-handler drift check still pointed at clearnode/api/rpc_router.go, which was renamed to nitronode/api/rpc_router.go in c0a5850. Restores the test under the new path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
"rootDir": "./src"insdk/ts/tsconfig.jsonandsdk/ts-compat/tsconfig.json.rootDir: '.'override in ts-jest inline tsconfig (jest.config.cjs) for both packages so tests outsidesrc/still compile.Why
TypeScript 6 no longer infers
rootDirfrom the common source dir and emitsTS5011: The common source directory of 'tsconfig.json' is './src'. The 'rootDir' setting must be explicitly set...This blocks the TS 5.9 → 6.0 bump in #719 (Test (TS SDK)andTest (TS SDK Compat)jobs failing).This change is a no-op under TS 5.9 (matches the previously inferred value) and unblocks the upgrade.
Test plan
cd sdk/ts && npm run typecheck— cleancd sdk/ts && npm run build:ci— cleancd sdk/ts && npm test— 104/105 pass; sole failure is pre-existingrpc-drift.test.tsreferencingclearnode/api/rpc_router.gopostclearnode→nitronoderename (unrelated, tracked separately)cd sdk/ts-compat && npm run typecheck— cleancd sdk/ts-compat && npm run build— cleancd sdk/ts-compat && npm test— 5/5 passAfter merge: comment
@dependabot rebaseon #719 to retry CI under TS 6.🤖 Generated with Claude Code
Summary by CodeRabbit