Conversation
WalkthroughAdopts Turborepo for build/dev orchestration, updates root/package scripts to use turbo, broadens Makefile clean targets, and introduces a new zoekt package with Go build and a webserver script. Adds turbo.json, adjusts gitignore for .turbo and zoekt/bin, and aligns per-package dev/build scripts to watch-mode TypeScript workflows. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant Turbo as Turbo CLI
participant Pkgs as Packages (tsc/tsc-watch)
participant Zoekt as zoekt-webserver (Go)
Dev->>Turbo: yarn with-env turbo dev zoekt:webserver
Turbo->>Pkgs: Run dev tasks (watch) [persistent, no cache]
Turbo->>Zoekt: Run zoekt:webserver (build then start)
Pkgs-->>Turbo: Emit compiled outputs (dist/**)
Zoekt-->>Dev: Webserver running with -index .sourcebot/index -rpc
sequenceDiagram
autonumber
actor Dev as Developer
participant Turbo as Turbo CLI
participant Pkg as Workspace packages
note over Turbo,Pkg: turbo build with outputs: .next/**, dist/**, bin/** (excl. .next/cache/**)
Dev->>Turbo: turbo build
Turbo->>Pkg: Topo-ordered build (dependsOn ^build)
Pkg-->>Turbo: Produce artifacts
Turbo-->>Dev: Build summary
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ 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 |
|
@brendan-kellam your pull request is missing a changelog! |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/logger/package.json (1)
7-24: Addcross-envto this package.Both new scripts rely on
cross-env, but this manifest doesn’t list it. Unless we count on an incidental hoist from another workspace package,yarn build/yarn devhere will fail with “cross-env: command not found.” Please addcross-envtodevDependenciesas done in other packages.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (13)
.gitignore(3 hunks)Makefile(1 hunks)package.json(2 hunks)packages/backend/package.json(1 hunks)packages/crypto/package.json(1 hunks)packages/db/package.json(1 hunks)packages/logger/package.json(1 hunks)packages/mcp/package.json(1 hunks)packages/schemas/package.json(1 hunks)packages/shared/package.json(2 hunks)packages/zoekt/.gitignore(1 hunks)packages/zoekt/package.json(1 hunks)turbo.json(1 hunks)
| ], | ||
| "scripts": { | ||
| "build": "cross-env SKIP_ENV_VALIDATION=1 yarn workspaces foreach -A run build", | ||
| "build": "turbo build", |
There was a problem hiding this comment.
Use the correct Turbo CLI form.
turbo build is invalid; the CLI expects turbo run <task>. As-is, yarn build exits with “Unknown command: build.” Update the script to call turbo run build.
- "build": "turbo build",
+ "build": "turbo run build",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "build": "turbo build", | |
| "build": "turbo run build", |
🤖 Prompt for AI Agents
In package.json around line 7, the npm script uses an invalid Turbo CLI command
"turbo build"; change it to use the correct form "turbo run build" so running
yarn/npm run build invokes the Turbo pipeline properly. Update the "build"
script value to "turbo run build" (no other changes needed).
| "dev": "yarn with-env turbo dev zoekt:webserver", | ||
| "with-env": "cross-env PATH=\"$PROJECT_CWD/packages/zoekt/bin:$PATH\" dotenv -e .env.development -c --", |
There was a problem hiding this comment.
Fix the dev script Turborepo invocation.
Same issue as above: turbo dev zoekt:webserver omits the required run subcommand, so yarn dev fails immediately. The intent (running both dev and zoekt:webserver) works once the CLI call is turbo run ….
- "dev": "yarn with-env turbo dev zoekt:webserver",
+ "dev": "yarn with-env turbo run dev zoekt:webserver",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "dev": "yarn with-env turbo dev zoekt:webserver", | |
| "with-env": "cross-env PATH=\"$PROJECT_CWD/packages/zoekt/bin:$PATH\" dotenv -e .env.development -c --", | |
| "dev": "yarn with-env turbo run dev zoekt:webserver", | |
| "with-env": "cross-env PATH=\"$PROJECT_CWD/packages/zoekt/bin:$PATH\" dotenv -e .env.development -c --", |
🤖 Prompt for AI Agents
In package.json around lines 9 to 10, the dev script calls "turbo dev
zoekt:webserver" which omits the required "run" subcommand and causes yarn dev
to fail; update the script to call "turbo run dev zoekt:webserver" (i.e., insert
the "run" subcommand after "turbo") so Turbo runs the "dev" task for the
specified scope/target; keep the surrounding with-env wrapper intact.
| "build": "tsc", | ||
| "dev": "node ./dist/index.js", | ||
| "build:watch": "tsc-watch --preserveWatchOutput" | ||
| "dev": "tsc-watch --preserveWatchOutput" | ||
| }, |
There was a problem hiding this comment.
Restore runtime execution in dev script.
dev used to start the MCP service via node ./dist/index.js. Now it only runs tsc-watch, so yarn dev (and any turbo dev pipeline that shells out to it) never launches the binary. That regresses local development for MCP—it compiles but nothing runs—so please add an --onSuccess "node ./dist/index.js" (or an equivalent runner) back in.
🤖 Prompt for AI Agents
In packages/mcp/package.json around lines 8 to 10, the "dev" script currently
only runs tsc-watch so it compiles but does not start the MCP binary; restore
runtime execution by updating the "dev" command to run tsc-watch with an
onSuccess hook that launches the built node binary (for example add --onSuccess
"node ./dist/index.js" or equivalent), ensuring local `yarn dev` (and turbo
pipelines) both compile and start the service automatically.
| "build": "mkdir -p $PROJECT_CWD/packages/zoekt/bin/ && go build -C $PROJECT_CWD/vendor/zoekt -o $PROJECT_CWD/packages/zoekt/bin/ ./cmd/...", | ||
| "zoekt:webserver": "yarn build && ./bin/zoekt-webserver -index $PROJECT_CWD/.sourcebot/index -rpc" |
There was a problem hiding this comment.
Fix the Go build invocation.
go build -o ... ./cmd/... fails because -o cannot be combined with multiple packages (the zoekt cmd tree contains several commands). As written, yarn build exits with go build: cannot use -o directory with multiple packages, so the binary never materializes and downstream tasks break. Adjust the command to build the specific binaries (e.g., the webserver) individually.
Apply this diff to unblock the build:
- "build": "mkdir -p $PROJECT_CWD/packages/zoekt/bin/ && go build -C $PROJECT_CWD/vendor/zoekt -o $PROJECT_CWD/packages/zoekt/bin/ ./cmd/...",
+ "build": "mkdir -p $PROJECT_CWD/packages/zoekt/bin/ && go build -C $PROJECT_CWD/vendor/zoekt -o $PROJECT_CWD/packages/zoekt/bin/zoekt-webserver ./cmd/zoekt-webserver",If other zoekt binaries are required, invoke go build once per command (without -o) so each lands in bin/.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "build": "mkdir -p $PROJECT_CWD/packages/zoekt/bin/ && go build -C $PROJECT_CWD/vendor/zoekt -o $PROJECT_CWD/packages/zoekt/bin/ ./cmd/...", | |
| "zoekt:webserver": "yarn build && ./bin/zoekt-webserver -index $PROJECT_CWD/.sourcebot/index -rpc" | |
| "build": "mkdir -p $PROJECT_CWD/packages/zoekt/bin/ && go build -C $PROJECT_CWD/vendor/zoekt -o $PROJECT_CWD/packages/zoekt/bin/zoekt-webserver ./cmd/zoekt-webserver", | |
| "zoekt:webserver": "yarn build && ./bin/zoekt-webserver -index $PROJECT_CWD/.sourcebot/index -rpc" |
🤖 Prompt for AI Agents
In packages/zoekt/package.json around lines 5-6, the current go build invocation
uses -o with ./cmd/... which fails because -o cannot be used when building
multiple packages; change the build step to build specific binaries individually
(for example, run go build -o $PROJECT_CWD/packages/zoekt/bin/zoekt-webserver
./cmd/zoekt-webserver) or invoke go build once per command without a shared -o
so each produced binary is written into packages/zoekt/bin/, ensuring the
zoekt:webserver script can then run the produced webserver binary.
This PR adds support for Turborepo, which should improve our inner loop development experience.
Next up is to implement remote caching for our CI to hopefully improve our build times.
Summary by CodeRabbit