feat: add typecheck CI step and fix Turborepo caching#270
Conversation
Add per-package `tsc --noEmit` typecheck scripts orchestrated through Turborepo, with a parallel CI job in the test workflow. Also fix pre-existing type error in CLI build command (missing PackageJsonParseError import), remove dead `lint` turbo task (linting runs centrally, not per-package), and narrow globalDependencies to avoid over-invalidation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
⌛ 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. 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA TypeScript type-checking step is introduced across the monorepo. A new "typecheck" task runs Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
The typecheck task depended on ^typecheck, but tsc --noEmit produces no output. In CI (no prior build), dependent packages like the CLI couldn't resolve workspace imports because dist/*.d.ts files didn't exist. Changing to ^build ensures dependency packages are built first. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
turbo.json (1)
4-4:package.jsonremoved fromglobalDependencies— verify coverage is adequate.The root
package.jsonis no longer a global dependency. Changes likepnpm.overridesor workspace protocol bumps inpackage.jsonwill only invalidate caches if they also touchpnpm-lock.yaml. Sincepnpm-lock.yamlis now included, this is generally fine — but it's worth confirming that no rootpackage.jsonfields affect task outputs independently of the lockfile.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@turbo.json` at line 4, You removed "package.json" from the turbo.json globalDependencies list; inspect the root package.json for any fields that can influence task outputs (e.g., pnpm.overrides, workspace protocol versions, scripts, engines, or any custom metadata used by build tools) and either re-add "package.json" into globalDependencies or update CI/caching docs to ensure those fields are covered by pnpm-lock.yaml; specifically review the turbo.json "globalDependencies" array and the root package.json for pnpm.overrides/workspace entries or other build-time metadata and make the change (re-add or document/adjust) so cache invalidation remains correct.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@turbo.json`:
- Line 4: You removed "package.json" from the turbo.json globalDependencies
list; inspect the root package.json for any fields that can influence task
outputs (e.g., pnpm.overrides, workspace protocol versions, scripts, engines, or
any custom metadata used by build tools) and either re-add "package.json" into
globalDependencies or update CI/caching docs to ensure those fields are covered
by pnpm-lock.yaml; specifically review the turbo.json "globalDependencies" array
and the root package.json for pnpm.overrides/workspace entries or other
build-time metadata and make the change (re-add or document/adjust) so cache
invalidation remains correct.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (13)
.github/workflows/test.yamlAGENTS.mdlocal/tsup/package.jsonpackage.jsonpackages/build-utils/package.jsonpackages/cli/package.jsonpackages/cli/src/commands/build/index.tspackages/commons/package.jsonpackages/harmony/package.jsonpackages/harmony/tsconfig.check.jsonpackages/network-config/package.jsonpackages/sdk/package.jsonturbo.json
Summary
tsc --noEmittypecheck scripts to all 7 packages, orchestrated through Turborepo with proper dependency ordering and cachingtypecheckCI job to the test workflow (now four gates: test, lint, format, typecheck)PackageJsonParseErrorimport)lintturbo task (linting runs centrally from root, no packages have a lint script)globalDependenciesfrom["package.json"]to["pnpm-lock.yaml", ".nvmrc", "tsconfig.base.json"]to avoid unnecessary cache invalidationtsconfig.check.jsonto exclude Storybook stories from type-checkingTest plan
pnpm typecheckpasses across all 7 packagespnpm buildpassespnpm lintpassespnpm formatpasses🤖 Generated with Claude Code
Summary by CodeRabbit