fix: improve Turborepo configuration#2556
fix: improve Turborepo configuration#2556anthonyshew wants to merge 2 commits intoakash-network:mainfrom
Conversation
- Add missing build, lint, and test tasks to turbo.json - Add transit node pattern for parallel lint/test with correct cache invalidation - Fix root lint scripts to delegate to turbo run instead of running eslint directly - Remove duplicate dependencies from root package.json (already in apps that use them)
📝 WalkthroughWalkthroughThe project is migrated to use Turbo for task orchestration. Lint scripts now invoke Turbo instead of directly calling eslint. Four unused root-level dependencies are removed, and Turbo is configured with four new tasks establishing a dependency graph for build, lint, test, and transit operations. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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 |
| @@ -9,12 +9,6 @@ | |||
| "./packages/*", | |||
There was a problem hiding this comment.
🔄 Carefully review the package-lock.json diff
Resolve the comment if everything is ok
- node_modules/@mswjs/interceptors/node_modules/agent-base 7.1.3
- node_modules/@mswjs/interceptors/node_modules/cssstyle 4.3.1
- node_modules/@mswjs/interceptors/node_modules/data-urls 5.0.0
- node_modules/@mswjs/interceptors/node_modules/html-encoding-sniffer 4.0.0
- node_modules/@mswjs/interceptors/node_modules/https-proxy-agent 7.0.6
- node_modules/@mswjs/interceptors/node_modules/iconv-lite 0.6.3
- node_modules/@mswjs/interceptors/node_modules/jsdom 26.1.0
- node_modules/@mswjs/interceptors/node_modules/tough-cookie 5.1.2
- node_modules/@mswjs/interceptors/node_modules/tr46 5.1.1
- node_modules/@mswjs/interceptors/node_modules/w3c-xmlserializer 5.0.0
- node_modules/@mswjs/interceptors/node_modules/webidl-conversions 7.0.0
- node_modules/@mswjs/interceptors/node_modules/whatwg-encoding 3.1.1
- node_modules/@mswjs/interceptors/node_modules/whatwg-mimetype 4.0.0
- node_modules/@mswjs/interceptors/node_modules/whatwg-url 14.2.0
- node_modules/@mswjs/interceptors/node_modules/xml-name-validator 5.0.0
- node_modules/@mswjs/interceptors 0.38.5
- node_modules/@open-draft/deferred-promise 2.2.0
- node_modules/@open-draft/logger 0.3.0
- node_modules/@open-draft/until 2.1.0
- node_modules/is-node-process 1.2.0
- node_modules/nock 14.0.4
- node_modules/outvariant 1.4.3
- node_modules/strict-event-emitter 0.5.1 | "npm run validate:types -w apps/indexer" | ||
| ] | ||
| }, | ||
| "dependencies": { |
There was a problem hiding this comment.
@stalniy @ygrishajev do you remember why we had dependencies at the root package?
There was a problem hiding this comment.
coz it was a pain to make sure that they appear in the root node_modules sometimes. If the package added in the root has different version it goes to the workspace's local node_modules. However it depends on some package in the root modules, so then it throws. The proper solution would syncing deps across workspaces so that all modules go to the root/deduped.
This change is potentially risky, need to test every app runs without issues. I guess tests should pick the issue if there's any
There was a problem hiding this comment.
yes, I spent a day yesterday fighting with package-lock issues. It appeared to be deeply nested package hoisting issue. To fix it, I added vitest and tsup into root devDependencies and it fixed the issue.
So, this hack just helps to solve the issue but we nee to get back to #1048
|
@anthonyshew could you pls rebase your repo |
Summary
build,lint, andtesttasks toturbo.jsonfor proper caching and parallelizationlintscripts to delegate toturbo run lintinstead of runningeslint .directlypackage.jsonthat already exist in the apps that use them (drizzle-orm,pg,nock,@interchain-ui/react)Why
The previous configuration was missing task definitions for common scripts (
build,lint,test) that exist across multiple packages. This meant:turbo run build/lint/testwouldn't benefit from Turborepo's caching or parallelizationlintscript bypassed Turborepo entirely, defeating the purpose of the monorepo setupAI Usage
Chat transcript: https://opncd.ai/share/IwyhgsPI
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.