Skip to content

feat: track tsconfig files as dependencies#200

Open
stormslowly wants to merge 3 commits intomainfrom
codex/tsconfig-file-dependencies
Open

feat: track tsconfig files as dependencies#200
stormslowly wants to merge 3 commits intomainfrom
codex/tsconfig-file-dependencies

Conversation

@stormslowly
Copy link
Copy Markdown
Collaborator

Summary

  • Track tsconfig files loaded for paths resolution as file dependencies.
  • Propagate config file dependencies through extended tsconfigs and project references.
  • Add a regression test covering tsconfig, extends, and referenced config files in ResolveContext.file_dependencies.

Why

When tsconfig paths resolution was enabled, the resolver loaded tsconfig.json files 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 --check
  • cargo test tsconfig --lib
  • cargo test --lib -- --skip tests::pnp

Note: full cargo test --lib still fails in this checkout because PnP fixtures do not include .pnp.* files; non-PnP lib tests pass.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 24, 2026

Merging this PR will improve performance by 31.19%

⚡ 1 improved benchmark
✅ 11 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory resolver[resolve from symlinks multi thread] 730.3 KB 556.6 KB +31.19%

Comparing codex/tsconfig-file-dependencies (5816483) with main (e5cbe7d)

Open in CodSpeed

@stormslowly stormslowly changed the title [codex] track tsconfig files as dependencies feat: track tsconfig files as dependencies Apr 24, 2026
@stormslowly stormslowly marked this pull request as ready for review April 24, 2026 10:32
Copilot AI review requested due to automatic review settings April 24, 2026 10:32
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/lib.rs
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_dependencies tracking to TsConfig and propagate it through extends merges.
  • Plumb the main resolve context through tsconfig-paths resolution and add collected tsconfig dependencies into the resolve context.
  • Add a regression test asserting tsconfig/extends/referenced configs appear in ResolveContext.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.

Comment thread src/tsconfig.rs
Comment thread src/tsconfig.rs
Comment thread src/tests/tsconfig_project_references.rs Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@stormslowly stormslowly requested a review from hardfist May 8, 2026 07:00
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.

2 participants