feat: track tsconfig files as dependencies#200
Conversation
Merging this PR will improve performance by 31.19%
Performance Changes
Comparing |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8dc54a917
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
This PR improves dependency tracking for TypeScript tsconfig-based path resolution by ensuring tsconfig files involved in resolution (including extends and project references) are surfaced in ResolveContext.file_dependencies, aligning behavior more closely with enhanced-resolve.
Changes:
- Add
file_dependenciestracking toTsConfigand propagate it throughextendsmerges. - Plumb the main resolve context through tsconfig-paths resolution and add collected
tsconfigdependencies into the resolve context. - Add a regression test asserting
tsconfig/extends/referenced configs appear inResolveContext.file_dependencies.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/tsconfig.rs | Introduces TsConfig.file_dependencies and propagates it when extending configs. |
| src/lib.rs | Ensures tsconfig-paths uses the caller context and records tsconfig-derived file dependencies into ResolveContext. |
| src/tests/tsconfig_project_references.rs | Adds regression coverage for reporting tsconfig-related dependencies in ResolveContext.file_dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
ResolveContext.file_dependencies.Why
When tsconfig paths resolution was enabled, the resolver loaded
tsconfig.jsonfiles through a separate context, so those config files were not reported as file dependencies. This diverged from enhanced-resolve and could miss invalidation when tsconfig files changed.Validation
cargo fmt --checkcargo test tsconfig --libcargo test --lib -- --skip tests::pnpNote: full
cargo test --libstill fails in this checkout because PnP fixtures do not include.pnp.*files; non-PnP lib tests pass.