From 3fcb4503dcc34054781b5c9d84e6c3a77e4d84c6 Mon Sep 17 00:00:00 2001 From: Harsh23Kashyap <55448981+Harsh23Kashyap@users.noreply.github.com> Date: Sun, 12 Jul 2026 20:55:34 +0530 Subject: [PATCH] chore(ci): add typecheck scripts for local TypeScript verification Adds a yarn typecheck script in the repository root and per-package typecheck scripts that run tsc --noEmit in each TypeScript workspace (web, backend, db, schemas, shared). Mirrors the existing test/lint conventions: root uses yarn workspaces foreach --all --topological, per-package scripts execute the same TypeScript compiler invocation in isolation. A new .github/workflows/typecheck.yml CI workflow is intentionally NOT added in this commit because running tsc --noEmit on the current main surfaces ~175 latent type errors in the web package (test fixtures referencing schema-drift columns added to migrations 20260702000000 and 20260702000001 but not yet declared in schema.prisma). A follow-up PR will fix the schema-drift, update test fixtures, then add the CI workflow. Mirrors CONTRIBUTING.md 'Developer tooling' / 'Bug fixes' guidance: pure additive tooling, no source code changes, no new dependencies. Refs #1437 --- package.json | 1 + packages/backend/package.json | 1 + packages/db/package.json | 1 + packages/schemas/package.json | 1 + packages/shared/package.json | 1 + packages/web/package.json | 1 + 6 files changed, 6 insertions(+) diff --git a/package.json b/package.json index ed846875f..b5d7fa757 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "build": "cross-env SKIP_ENV_VALIDATION=1 yarn workspaces foreach --all --topological run build", "test": "yarn workspaces foreach --all --topological run test", "lint": "yarn workspaces foreach --all --topological run lint", + "typecheck": "yarn workspaces foreach --all --topological run typecheck", "dev": "concurrently --kill-others --names \"zoekt,worker,web,schemas\" 'yarn dev:zoekt' 'yarn dev:backend' 'yarn dev:web' 'yarn 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", diff --git a/packages/backend/package.json b/packages/backend/package.json index 13640cef7..b9e038c00 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -8,6 +8,7 @@ "dev:watch": "tsc-watch --preserveWatchOutput --onSuccess \"yarn dev\"", "dev": "node ./dist/index.js", "build": "tsc", + "typecheck": "tsc --noEmit", "test": "cross-env SKIP_ENV_VALIDATION=1 vitest --config ./vitest.config.ts" }, "devDependencies": { diff --git a/packages/db/package.json b/packages/db/package.json index db623c5a2..ff728d659 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -5,6 +5,7 @@ "private": true, "scripts": { "build": "yarn prisma:generate && tsc", + "typecheck": "tsc --noEmit", "postinstall": "yarn build", "prisma:generate": "prisma generate", "prisma:generate:watch": "prisma generate --watch", diff --git a/packages/schemas/package.json b/packages/schemas/package.json index 3719a6da5..79dcae370 100644 --- a/packages/schemas/package.json +++ b/packages/schemas/package.json @@ -4,6 +4,7 @@ "private": true, "scripts": { "build": "yarn generate && tsc", + "typecheck": "tsc --noEmit", "generate": "tsx tools/generate.ts", "watch": "nodemon --watch ../../schemas -e json -x 'yarn build'", "postinstall": "yarn build" diff --git a/packages/shared/package.json b/packages/shared/package.json index 6ded4e24b..d19974a89 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -5,6 +5,7 @@ "private": true, "scripts": { "build": "tsc", + "typecheck": "tsc --noEmit", "build:watch": "tsc-watch --preserveWatchOutput", "postinstall": "yarn build", "test": "vitest --config ./vitest.config.ts", diff --git a/packages/web/package.json b/packages/web/package.json index 0f06c0d58..01bc5bd2c 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -7,6 +7,7 @@ "build": "cross-env SKIP_ENV_VALIDATION=1 next build", "start": "next start", "lint": "cross-env SKIP_ENV_VALIDATION=1 eslint .", + "typecheck": "tsc --noEmit", "test": "cross-env SKIP_ENV_VALIDATION=1 vitest", "openapi:generate": "tsx tools/generateOpenApi.ts", "generate:protos": "proto-loader-gen-types --includeComments --longs=Number --enums=String --defaults --oneofs --grpcLib=@grpc/grpc-js --keepCase --includeDirs=../../vendor/zoekt/grpc/protos --outDir=src/proto zoekt/webserver/v1/webserver.proto zoekt/webserver/v1/query.proto",