Repository navigation
Conversation
Port typescript-go's behavior at
`internal/tsoptions/tsconfigparsing.go:1240-1252`: when the user
specifies no `exclude`, the include walk implicitly skips `outDir` and
`declarationDir`. Without this, a project's compiled `.d.ts` outputs
would be re-included in its own program — silently doubling files and
giving the wrong tsconfig in ownership queries.
- New `out_dir` / `declaration_dir` fields on `CompilerOptions`,
normalized at parse time (same pattern as `root_dirs`) so they
survive `extends` into a different directory, with ${configDir}
template substitution still happening in `build()`.
- `populate_owned_files` skips recursing into those directories when
`exclude` is `None`.
- `path_matches_specs` (the virtual-path fallback) applies the same
exclusion, so behavior is consistent for paths that don't exist on
disk yet.
- `implicit_output_excludes` helper centralizes the "no user exclude →
use outDir/declarationDir" decision.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 05-27-feat_tsconfig_transitive_project_references #1165 +/- ##
=====================================================================================
- Coverage 93.31% 93.18% -0.14%
=====================================================================================
Files 22 22
Lines 4265 4315 +50
=====================================================================================
+ Hits 3980 4021 +41
- Misses 285 294 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d223c817d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if entry.file_type.is_dir() { | ||
| if !is_default_excluded_dir(&entry.path) { | ||
| if !is_default_excluded_dir(&entry.path) | ||
| && !implicit_output_excludes.iter().any(|d| entry.path == *d) |
There was a problem hiding this comment.
Normalize output excludes before comparing walked entries
When a tsconfig is reached through a symlinked directory, parse stores outDir/declarationDir relative to the canonical config path, but populate_owned_files walks from the preserved caller-supplied self.directory() and read_dir returns entries under that symlink path. In that context this exact equality never matches, so the output directory is still recursed into and its files are claimed by the project; the same path-space mismatch also affects the virtual-path fallback. Compare against the walked/caller path, or canonicalize both sides, before deciding to push the directory.
Useful? React with 👍 / 👎.
Merging this PR will improve performance by 4.36%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | small |
11.7 µs | 11.3 µs | +4.36% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing 05-27-feat_tsconfig_default_exclude_outdir (9d223c8) with 05-27-feat_tsconfig_transitive_project_references (a18b497)
Footnotes
-
5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Summary
Port typescript-go's behavior at
internal/tsoptions/tsconfigparsing.go:1240-1252: when the user specifies noexclude, the include walk implicitly skipsoutDiranddeclarationDir. Without this, a project's compiled.d.tsoutputs would be re-included in its own program — silently doubling files and giving the wrong tsconfig in ownership queries.Changes
out_dir/declaration_dirfields onCompilerOptions, normalized at parse time (same pattern asroot_dirs) so they surviveextendsinto a different directory.${configDir}template substitution still happens inbuild().populate_owned_filesskips recursing into those directories whenexcludeisNone.path_matches_specs(the virtual-path fallback added in refactor(tsconfig): precompute owned-file sets via directory walk #1162) applies the same exclusion, so behavior is consistent for paths that don't exist on disk.implicit_output_excludeshelper centralizes the "no userexclude→ useoutDir/declarationDir" decision.Test
project-outdir-exclude/: nested config withoutDir: ./dist. Queryinginner/dist/foo.d.tsnow falls past the inner config (which auto-excludes its owndist) and is owned by the outer config — matching typescript-go's project-discovery behavior.