fix: enforce typecheck across the monorepo#42
Merged
Conversation
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
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
pnpm typecheckrantsc -b, but the roottsconfig.jsonhadfiles: []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
Wiring —
pnpm typechecknow runsturbo run typecheck:"typecheck": "tsc --noEmit"script and an explicitincludecomposite(only needed for the unused build-mode) is dropped; cross-package imports resolve to source through the existingpathsaliases, so checks need no prior buildplugins/*is added to the workspace globs so future plugin packages are type-checked automatically once they ship thetypecheckscripttsconfig.base.jsonis a TurboglobalDependency, and^typecheckkeeps the cache honest across the package graphLatent type fixes the newly-enforced check surfaced:
broadcast/$call(shared-state client sync,auth:revoked,anonymous:auth) plus the hub'sterminals:updated/messages:updatednotificationsRpcSharedStateHost.getwith its actual string-keyed implementation, removing theas any/as keyof …casts it forced at every call siteneverreturn that brokeRpcDumpassignabilityiconon dock test entries;Error → Recordcast and a diagnostics passthrough castVerification
pnpm lint,pnpm typecheck,pnpm test(354 tests, incl. thetsnapiAPI-snapshot guard), andpnpm buildall pass. No public API surface changed.This PR was created with the help of an agent.