Skip to content
Source
Sign inSign up
TanStack/db

ci: typecheck ordinary db-ivm and offline test sources #1812

Send to my agent
ClosedKyleAMathews(GitHub profile, opens in a new tab) opened this issue 0 comments

Problem

The PR workflow runs pnpm run build && pnpm run test. Passing those checks does not typecheck every ordinary test file.

Observed at local baseline 541ab9f8ea2c60fda8728549288ff9e69ab103b7 with the same installed dependencies used for the oracle repair pass:

  • pnpm --dir packages/db-ivm exec tsc --noEmit: 16 diagnostics, all in tests.
  • pnpm --dir packages/offline-transactions exec tsc --noEmit: 38 diagnostics, all in tests/harness. The repair pass removes two invalid fixtures, leaving 36 existing diagnostics.
  • The offline package defines typecheck, but root CI never invokes it. Its selected vitest.config.ts does not enable typechecking.
  • db-ivm enables Vitest typechecking, but Vitest 3.2.4's default include is **/*.{test,spec}-d.?(c|m)[jt]s?(x), not ordinary .test.ts files.
  • The shared build plugin generates/checks declarations with include: options.srcDir, which does not replace a test-source typecheck.

These are local baseline comparisons, not a claim that every current main package has been audited.

Separate cleanup PR

  • Fix existing fixture typing without weakening strictness or adding broad casts/suppressions. Examples include accesses after length assertions, synchronous callbacks incorrectly declared Promise-only, and incomplete serializer transaction fixtures.
  • Check db-ivm's distinct output typing: tests expect numeric hash keys while its public return annotation preserves the input key. Resolve the type contract against actual emitted values, not by casting tests.
  • Add explicit test-source typecheck targets to CI for these packages, distinct from declaration builds and dedicated API type tests.
  • Prove the gate rejects an intentional type error in an ordinary .test.ts file; remove the probe before commit.
  • Record commands and baseline/head versions. Do not classify passing runtime tests as type safety.

Found during #1808. Type cleanup is deliberately outside the current oracle/bug-fix PR.

Sign in to join this conversation.