Skip to content

fix(build): add the root tsconfig.json typecheck has always pointed at - #9

Closed
unfoundbox wants to merge 1 commit into
claude/priceless-haslett-30cd49from
chore/typecheck
Closed

fix(build): add the root tsconfig.json typecheck has always pointed at#9
unfoundbox wants to merge 1 commit into
claude/priceless-haslett-30cd49from
chore/typecheck

Conversation

@unfoundbox

@unfoundbox unfoundbox commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #8 — that is the base branch, so this diff is only the config.
Merge #8 first.

The bug

npm run typecheck is tsc --noEmit -p tsconfig.json, and no root
tsconfig.json has ever been committed. It is not gitignored; it was simply
never added. The script has failed with TS5058 for everyone who has run it,
on every commit in the repo's history. CI never ran it, so nothing noticed.

The gap is not cosmetic. core and cdp are type-checked as a side effect of
emitting declarations during their build. mcp is bundled by esbuild alone,
which strips types without reading them — packages/mcp/src/index.ts had never
been type-checked at all.

What changed

  • tsconfig.json: one noEmit pass over all three packages' src.
  • pretypecheck: npm run build, which is load-bearing — mcp imports its
    siblings by package name and those resolve to their built declarations.
    Without it a fresh clone gets three TS2307s instead of an answer.
  • A typecheck CI job. It needs no Chrome, so it reports in under a minute
    rather than after a browser download, and the script cannot rot again.
  • CONTRIBUTING notes the git-worktree trap: a worktree with no node_modules
    of its own resolves @motionvector/* up to the main checkout, so mcp gets
    checked against whatever is built over there. It cost a bad push during this
    work.

Verification, in a cold clone

npm ci && npm run typecheck from cold exit 0
bare tsc, nothing built 3× TS2307 — why pretypecheck exists
deliberate type error in mcp caught, TS2322

test/*.mjs stays outside the config deliberately. Type-checking the tests is
worth doing and is not a config line — they reach for fields the public types
do not carry, e.g. census.targetType. Separate change.

🤖 Generated with Claude Code


View with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is enabled.

`npm run typecheck` is `tsc --noEmit -p tsconfig.json` and there is no
root tsconfig.json in the repository — it was never committed, and it is
not gitignored. The script has therefore failed with TS5058 for every
person who has ever run it. CI never ran it, so nothing noticed.

The gap it left is not cosmetic. core and cdp are type-checked as a side
effect of emitting declarations during their build; mcp is bundled by
esbuild alone, which strips types without reading them. Nothing has
type-checked packages/mcp/src since it was written.

The config covers all three packages and emits nothing. `pretypecheck`
runs the build first, because mcp imports its siblings by package name
and those resolve through the workspace links to their built
declarations — without it, a fresh clone gets TS2307 instead of an
answer.

Wired into CI as its own job. It needs no Chrome, so it reports in well
under a minute rather than after a browser download, and a broken script
cannot go unnoticed for another release.

test/*.mjs stays outside the config. Type-checking the tests is worth
doing and is not this change: they reach for fields the public types do
not carry (`census.targetType`), so it is a change with real edits in it,
not a config line.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@unfoundbox
unfoundbox deleted the branch claude/priceless-haslett-30cd49 August 17, 2026 08:29
@unfoundbox unfoundbox closed this Aug 17, 2026
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.

1 participant