feat: build the projects a typescript config file references - #336
Merged
Conversation
alexander-akait
changed the base branch from
feat/ignore-diagnostics
to
main
September 13, 2026 20:32
A `tsconfig.json` that lists only `references` describes an empty program of its own, so a solution reported nothing at all. `build: true` builds the graph the way `tsc -b` does and reports what every project in it finds. A reference is read through the declarations the referenced project publishes, so the build writes each project's `.d.ts` and its `.tsbuildinfo` and nothing else — the JavaScript stays webpack's, and a later `tsc -b` of your own still emits it. What a check writes is now kept out of the folders it hands the watcher, so a build is not its own trigger. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy
alexander-akait
force-pushed
the
feat/build-project-references
branch
from
September 13, 2026 20:56
29caa91 to
3748fba
Compare
This was referenced Sep 13, 2026
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.
Summary
A
tsconfig.jsonthat lists onlyreferencesdescribes an empty program of its own — measured on a two-project solution, the check parsed it, found 0 files and 0 diagnostics, and reported nothing.build: truebuilds the graph the waytsc -bdoes and reports what every project in it finds.A reference is read through the declarations the referenced project publishes, so building one is how the next is checked at all. The build therefore writes each project's
.d.tsand its.tsbuildinfoand nothing else: the JavaScript stays webpack's to write, and a latertsc -bof your own still emits it (verified both ways round — a declaration-only build leaves existing output alone, and a full build after one still emits).noEmitis not an option here: TypeScript itself refuses it with TS6310,Referenced project may not disable emit.What a check writes is now also kept out of the folders it hands the watcher (#334), so a build is not its own trigger.
The cost is a
tsc -bpass rather than the kept program of #332. Over five projects and 205 files:The last row is
tsc -bsemantics: a project that fails is never up to date, so it is checked again each time.reportAs: "log"(#331, #333) takes that off the rebuild's critical path for anyone who would rather not wait.Rebased onto
mainnow that #335 has landed, so this is one commit again. #337 sits on top of this one.What kind of change does this PR introduce?
feat
Did you add tests for your changes?
Yes —
test/typescript/references.test.jsover a new two-project solution fixture: nothing reported unbuilt, the error a built solution finds, the declarations published and no JavaScript written, the folders watched and the written ones not, an unreadable project in the graph, and a fix clearing the report.Does this PR introduce a breaking change?
No — a new option, off by default.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
Documented in
README.mdunder the TypeScript check.Use of AI
Claude Code wrote the change, the tests and this description, and ran the measurements above; I reviewed all of it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy