Skip to content

fix: enforce typecheck across the monorepo#42

Merged
antfu merged 1 commit into
devframes:mainfrom
antfubot:fix/typecheck-wiring
Jun 19, 2026
Merged

fix: enforce typecheck across the monorepo#42
antfu merged 1 commit into
devframes:mainfrom
antfubot:fix/typecheck-wiring

Conversation

@antfubot

Copy link
Copy Markdown
Contributor

Why

pnpm typecheck ran tsc -b, but the root tsconfig.json had files: [] and no project references — so it was a no-op. CI ran the script on every PR yet never type-checked a single package, letting ~20 latent type errors accumulate undetected.

What

Wiringpnpm typecheck now runs turbo run typecheck:

  • each package owns a "typecheck": "tsc --noEmit" script and an explicit include
  • composite (only needed for the unused build-mode) is dropped; cross-package imports resolve to source through the existing paths aliases, so checks need no prior build
  • plugins/* is added to the workspace globs so future plugin packages are type-checked automatically once they ship the typecheck script
  • tsconfig.base.json is a Turbo globalDependency, and ^typecheck keeps the cache honest across the package graph

Latent type fixes the newly-enforced check surfaced:

  • declared the internal-protocol RPC methods consumed by broadcast/$call (shared-state client sync, auth:revoked, anonymous:auth) plus the hub's terminals:updated / messages:updated notifications
  • aligned RpcSharedStateHost.get with its actual string-keyed implementation, removing the as any / as keyof … casts it forced at every call site
  • annotated deliberately-throwing dump-test handlers so they no longer infer a never return that broke RpcDump assignability
  • supplied the required icon on dock test entries; Error → Record cast and a diagnostics passthrough cast

Verification

pnpm lint, pnpm typecheck, pnpm test (354 tests, incl. the tsnapi API-snapshot guard), and pnpm build all pass. No public API surface changed.


This PR was created with the help of an agent.

The root `tsc -b` was a no-op — `tsconfig.json` had `files: []` and no
project references, so `pnpm typecheck` passed without checking any
package and CI never caught type regressions (~20 had accumulated).

Wire `pnpm typecheck` to `turbo run typecheck`, giving each package its
own `tsc --noEmit` script and an explicit `include`. Cross-package
imports resolve to source via the existing `paths` aliases, so checks
need no prior build. `plugins/*` is added to the workspace so future
plugins are typechecked automatically once they ship the script.

Fix the latent type errors this surfaces:
- declare the internal protocol RPC methods used by `broadcast`/`$call`
  (client-state sync, auth-revoke, anonymous-auth) and the hub's
  terminal/message notifications
- align `RpcSharedStateHost.get` with its string-keyed implementation,
  removing the casts it forced at every call site
- annotate deliberately-throwing dump test handlers so they don't infer
  a `never` return that broke `RpcDump` assignability
- supply the required `icon` on dock test entries and other minor fixes
@netlify

netlify Bot commented Jun 19, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit 4f9ecba
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a34ad3b82888c0008d5afe0
😎 Deploy Preview https://deploy-preview-42--devfra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@antfu antfu merged commit 885ec30 into devframes:main Jun 19, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants