Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Created by https://www.toptal.com/developers/gitignore/api/yarn,node
# Edit at https://www.toptal.com/developers/gitignore?templates=yarn,node
# Created by https://www.toptal.com/developers/gitignore/api/node,yarn,turbo
# Edit at https://www.toptal.com/developers/gitignore?templates=node,yarn,turbo

### Node ###
# Logs
Expand Down Expand Up @@ -141,6 +141,10 @@ dist
# SvelteKit build / generate output
.svelte-kit

### Turbo ###
# Turborepo task cache
.turbo

### yarn ###
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored

Expand All @@ -158,7 +162,7 @@ dist
# and uncomment the following lines
.pnp.*

# End of https://www.toptal.com/developers/gitignore/api/yarn,node
# End of https://www.toptal.com/developers/gitignore/api/node,yarn,turbo

.sourcebot
/bin
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,34 @@ clean:
rm -rf \
bin \
node_modules \
.turbo \
packages/web/.turbo \
packages/web/node_modules \
packages/web/.next \
packages/backend/.turbo \
packages/backend/dist \
packages/backend/node_modules \
packages/db/.turbo \
packages/db/node_modules \
packages/db/dist \
packages/schemas/.turbo \
packages/schemas/node_modules \
packages/schemas/dist \
packages/crypto/.turbo \
packages/crypto/node_modules \
packages/crypto/dist \
packages/error/node_modules \
packages/error/dist \
packages/mcp/.turbo \
packages/mcp/node_modules \
packages/mcp/dist \
packages/shared/.turbo \
packages/shared/node_modules \
packages/shared/dist \
packages/zoekt/.turbo \
packages/zoekt/node_modules \
packages/zoekt/dist \
packages/zoekt/bin \
.sourcebot

soft-reset:
Expand Down
14 changes: 5 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@
"packages/*"
],
"scripts": {
"build": "cross-env SKIP_ENV_VALIDATION=1 yarn workspaces foreach -A run build",
"build": "turbo build",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

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.

Suggested change
"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).

"test": "yarn workspaces foreach -A run test",
"dev": "yarn dev:prisma:migrate:dev && npm-run-all --print-label --parallel dev:zoekt dev:backend dev:web watch:mcp watch:schemas",
"with-env": "cross-env PATH=\"$PWD/bin:$PATH\" dotenv -e .env.development -c --",
"dev:zoekt": "yarn with-env zoekt-webserver -index .sourcebot/index -rpc",
"dev:backend": "yarn with-env yarn workspace @sourcebot/backend dev:watch",
"dev:web": "yarn with-env yarn workspace @sourcebot/web dev",
"watch:mcp": "yarn workspace @sourcebot/mcp build:watch",
"watch:schemas": "yarn workspace @sourcebot/schemas watch",
"dev": "yarn with-env turbo dev zoekt:webserver",
"with-env": "cross-env PATH=\"$PROJECT_CWD/packages/zoekt/bin:$PATH\" dotenv -e .env.development -c --",
Comment on lines +9 to +10
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

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.

Suggested change
"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.

"dev:prisma:migrate:dev": "yarn with-env yarn workspace @sourcebot/db prisma:migrate:dev",
"dev:prisma:generate": "yarn with-env yarn workspace @sourcebot/db prisma:generate",
"dev:prisma:studio": "yarn with-env yarn workspace @sourcebot/db prisma:studio",
Expand All @@ -23,7 +18,8 @@
"devDependencies": {
"cross-env": "^7.0.3",
"dotenv-cli": "^8.0.0",
"npm-run-all": "^4.1.5"
"npm-run-all": "^4.1.5",
"turbo": "^2.5.8"
},
"packageManager": "yarn@4.7.0",
"resolutions": {
Expand Down
5 changes: 2 additions & 3 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
"main": "index.js",
"type": "module",
"scripts": {
"dev:watch": "tsc-watch --preserveWatchOutput --onSuccess \"yarn dev\"",
"dev": "node ./dist/index.js",
"build": "tsc",
"dev": "tsc-watch --preserveWatchOutput --onSuccess \"node ./dist/index.js\"",
"build": "cross-env SKIP_ENV_VALIDATION=1 tsc",
"test": "cross-env SKIP_ENV_VALIDATION=1 vitest --config ./vitest.config.ts"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/crypto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"private": true,
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"postinstall": "yarn build"
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"private": true,
"scripts": {
"build": "yarn prisma:generate && tsc",
"dev": "yarn prisma:generate && tsc --watch",
"postinstall": "yarn build",
"prisma:generate": "prisma generate",
"prisma:generate:watch": "prisma generate --watch",
Expand Down
3 changes: 2 additions & 1 deletion packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"type": "module",
"private": true,
"scripts": {
"build": "tsc",
"build": "cross-env SKIP_ENV_VALIDATION=1 tsc",
"dev": "cross-env SKIP_ENV_VALIDATION=1 tsc --watch",
"postinstall": "yarn build"
},
"dependencies": {
Expand Down
3 changes: 1 addition & 2 deletions packages/mcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc",
"dev": "node ./dist/index.js",
"build:watch": "tsc-watch --preserveWatchOutput"
"dev": "tsc-watch --preserveWatchOutput"
},
Comment on lines 8 to 10
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

"devDependencies": {
"@types/express": "^5.0.1",
Expand Down
5 changes: 4 additions & 1 deletion packages/schemas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
"private": true,
"scripts": {
"build": "yarn generate && tsc",
"dev": "npm-run-all --parallel generate:watch tsc:watch",
"tsc:watch": "tsc --watch",
"generate": "tsx tools/generate.ts",
"watch": "nodemon --watch ../../schemas -e json -x 'yarn generate'",
"generate:watch": "nodemon --watch ../../schemas -e json -x 'yarn generate'",
"postinstall": "yarn build"
},
"devDependencies": {
"@apidevtools/json-schema-ref-parser": "^11.7.3",
"glob": "^11.0.1",
"json-schema-to-typescript": "^15.0.4",
"nodemon": "^3.1.10",
"npm-run-all": "^4.1.5",
"tsx": "^4.19.2",
"typescript": "^5.7.3"
},
Expand Down
4 changes: 3 additions & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"type": "module",
"private": true,
"scripts": {
"build": "tsc",
"build": "cross-env SKIP_ENV_VALIDATION=1 tsc",
"build:watch": "tsc-watch --preserveWatchOutput",
"dev": "tsc-watch --preserveWatchOutput",
"postinstall": "yarn build"
},
"dependencies": {
Expand All @@ -22,6 +23,7 @@
"devDependencies": {
"@types/micromatch": "^4.0.9",
"@types/node": "^22.7.5",
"cross-env": "^7.0.3",
"tsc-watch": "6.2.1",
"typescript": "^5.7.3"
},
Expand Down
1 change: 1 addition & 0 deletions packages/zoekt/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin
8 changes: 8 additions & 0 deletions packages/zoekt/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"private": true,
"name": "zoekt",
"scripts": {
"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"
Comment on lines +5 to +6
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

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.

Suggested change
"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.

}
}
26 changes: 26 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "https://turborepo.com/schema.json",
"ui": "tui",
"tasks": {
"build": {
"dependsOn": [
"^build"
],
"outputs": [
".next/**",
"!.next/cache/**",
"dist/**",
"bin/**"
]
},
"zoekt:webserver": {
"persistent": true,
"cache": false
},
"dev": {
"persistent": true,
"cache": false
}
},
"envMode": "loose"
}
80 changes: 80 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7680,6 +7680,7 @@ __metadata:
glob: "npm:^11.0.1"
json-schema-to-typescript: "npm:^15.0.4"
nodemon: "npm:^3.1.10"
npm-run-all: "npm:^4.1.5"
tsx: "npm:^4.19.2"
typescript: "npm:^5.7.3"
languageName: unknown
Expand All @@ -7697,6 +7698,7 @@ __metadata:
"@types/micromatch": "npm:^4.0.9"
"@types/node": "npm:^22.7.5"
ajv: "npm:^8.17.1"
cross-env: "npm:^7.0.3"
micromatch: "npm:^4.0.8"
strip-json-comments: "npm:^5.0.1"
tsc-watch: "npm:6.2.1"
Expand Down Expand Up @@ -17837,6 +17839,7 @@ __metadata:
cross-env: "npm:^7.0.3"
dotenv-cli: "npm:^8.0.0"
npm-run-all: "npm:^4.1.5"
turbo: "npm:^2.5.8"
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -19478,6 +19481,77 @@ __metadata:
languageName: node
linkType: hard

"turbo-darwin-64@npm:2.5.8":
version: 2.5.8
resolution: "turbo-darwin-64@npm:2.5.8"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"turbo-darwin-arm64@npm:2.5.8":
version: 2.5.8
resolution: "turbo-darwin-arm64@npm:2.5.8"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"turbo-linux-64@npm:2.5.8":
version: 2.5.8
resolution: "turbo-linux-64@npm:2.5.8"
conditions: os=linux & cpu=x64
languageName: node
linkType: hard

"turbo-linux-arm64@npm:2.5.8":
version: 2.5.8
resolution: "turbo-linux-arm64@npm:2.5.8"
conditions: os=linux & cpu=arm64
languageName: node
linkType: hard

"turbo-windows-64@npm:2.5.8":
version: 2.5.8
resolution: "turbo-windows-64@npm:2.5.8"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard

"turbo-windows-arm64@npm:2.5.8":
version: 2.5.8
resolution: "turbo-windows-arm64@npm:2.5.8"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

"turbo@npm:^2.5.8":
version: 2.5.8
resolution: "turbo@npm:2.5.8"
dependencies:
turbo-darwin-64: "npm:2.5.8"
turbo-darwin-arm64: "npm:2.5.8"
turbo-linux-64: "npm:2.5.8"
turbo-linux-arm64: "npm:2.5.8"
turbo-windows-64: "npm:2.5.8"
turbo-windows-arm64: "npm:2.5.8"
dependenciesMeta:
turbo-darwin-64:
optional: true
turbo-darwin-arm64:
optional: true
turbo-linux-64:
optional: true
turbo-linux-arm64:
optional: true
turbo-windows-64:
optional: true
turbo-windows-arm64:
optional: true
bin:
turbo: bin/turbo
checksum: 10c0/34e8dc87fc2c5d63c3cd5aede9068c1123509d88f9bb99283ffec1687de6ad6df7ebfb83a5d348580afb3fdac53af479456e36938a1b6ed80fc1c3416c6dc3f3
languageName: node
linkType: hard

"type-check@npm:^0.4.0, type-check@npm:~0.4.0":
version: 0.4.0
resolution: "type-check@npm:0.4.0"
Expand Down Expand Up @@ -20537,6 +20611,12 @@ __metadata:
languageName: node
linkType: hard

"zoekt@workspace:packages/zoekt":
version: 0.0.0-use.local
resolution: "zoekt@workspace:packages/zoekt"
languageName: unknown
linkType: soft

"zwitch@npm:^2.0.0, zwitch@npm:^2.0.4":
version: 2.0.4
resolution: "zwitch@npm:2.0.4"
Expand Down
Loading