Repository navigation
chore(ci): add dedicated TypeScript typecheck workflow and root typecheck script #1437
Description
Problem
The PR-time Lint and Test workflows in .github/workflows/ run yarn lint and yarn test respectively, but neither invokes tsc on the web package. The only place tsc runs for the web package is as a side-effect of next build inside the pr-gate.yml Docker-image build job, which is slow, shared with image building, and not the focused signal that developers watch during iterative review.
The other workspaces (backend, db, schemas, shared) all have tsc in their build scripts, so they are type-checked when those packages are built. web is the only workspace without a dedicated typecheck path.
Impact
- A PR that introduces a TypeScript compile error in
packages/webis only flagged once the slow Docker build runs inpr-gate.yml. A dedicatedtscstep on a focused workflow would surface the same error in seconds. - Local developers have no
yarn typecheckshortcut to type-check all workspaces; they must either runtscper package or trigger a fullnext build.
Proposed solution
This PR is the first step of a two-step plan:
- This PR (scope-cut): Add a
typecheckscript in the rootpackage.jsonthat runstsc --noEmitin each workspace that ships TypeScript (web, backend, db, schemas, shared), using the same topological ordering as the existingtest/lintscripts. Plus a per-packagetypecheckscript (mirroring the existingtest/lintpatterns). Local developers can now runyarn typecheckfrom the repository root. - Follow-up PR (separate scope): Add a new CI workflow (
.github/workflows/typecheck.yml) that runsyarn typecheckon PRs. This depends on first fixing latent type errors thatyarn typechecksurfaces on currentmain(seeFuture workbelow).
Scope of this PR
- 1 root
package.jsonchange (additive). - 5 per-package
package.jsonchanges (additive, onetypecheckscript each). - No source code changes. No new dependencies. No new CI workflow.
Acceptance criteria
yarn workspace @sourcebot/web typecheckexits 0 (with the caveats below).yarn workspace @sourcebot/backend typecheckexits 0.yarn workspace @sourcebot/db typecheckexits 0.yarn workspace @sourcebot/schemas typecheckexits 0.yarn workspace @sourcebot/shared typecheckexits 0.yarn typecheckfrom the repository root invokes each workspace'stypecheckin topological order.
Future work (out of scope here)
The current main has latent type errors that surface when tsc --noEmit runs against each workspace in isolation:
packages/webtest fixtures reference fields that exist in DB migrations but were not added to theschema.prismamodel (e.g.,UserToOrg.lastActiveAtfrom migration20260702000001,UserToOrg.suspendedAt/scimExternalIdfrom20260702000000). Fixing this requires either (a) updatingschema.prismato declare those columns, or (b) re-runningprisma generate, depending on intent. Either way, that is its own scope.packages/dbhad a stale Prisma client before this work; runningyarn prisma:generatelocally resolves the immediateAgentSkill*errors. This is documented as a prerequisite for the follow-up CI workflow PR.
A follow-up PR will: (1) fix the schema-drift in schema.prisma, (2) update test fixtures to match, (3) add the .github/workflows/typecheck.yml CI workflow introduced in this issue's proposed solution. Tracking in this issue so the work isn't lost.
Backward compatibility
None. Pure additive tooling. Existing build/test/lint scripts unchanged.
Activity
Harsh23Kashyap commentedon Jul 12, 2026
Picking this up. The local tooling half — root
yarn typecheckplus per-packagetypecheckscripts — is on branchHarsh23Kashyap:chore-ci-typecheck-workflow. Cross-fork PR-create API is rejecting my head today (same GitHub-side quirk we hit before on this fork), so PR opening falls back to the web URL: https://github.com/sourcebot-dev/sourcebot/compare/main...Harsh23Kashyap:chore-ci-typecheck-workflow?expand=1The PR scopes the tooling half of the issue and explicitly defers the CI workflow half — adding
.github/workflows/typecheck.ymlrequires first fixing the schema-drift inpackages/db/prisma/schema.prisma(UserToOrg.lastActiveAt / suspendedAt / scimExternalId added in migrations 20260702000000 and 20260702000001 but not declared) and the ~30 test-fixture types inpackages/webthat reference those columns. That is its own scope.Will not post a daily nudge; will leave a single follow-up comment on this issue if/when maintainers want to sequence the schema-drift fix in a separate PR.
Harsh23Kashyap commentedon Jul 13, 2026
PR opened: #1438
Opened on branch
Harsh23Kashyap:typecheck-workflow(had to switch fromHarsh23Kashyap:chore-ci-typecheck-workflowbecause the cross-fork PR-create API on this fork was rejecting theHarsh23Kashyap:ref shape for cross-fork heads; simpler bare ref worked).This is the local-tooling half of the issue. The CI workflow half (the
.github/workflows/typecheck.ymlfile) is intentionally deferred to a follow-up PR — see the PR body for why. No daily nudge will be posted on the PR.