Skip to content

Conversation

sheetalkamat
Copy link
Member

@sheetalkamat sheetalkamat commented Sep 12, 2025

We didnt consider the ".ts" to "d.ts" redirection when setting file include reason which resulted in missing changes when included file was from referenced project from two different imports. We would pick whichever was used first and miss other
Also added extra test validation on each program to verify this for future refactors and tests

Thanks @gabritto from sharing this in #1714 (comment)

@Copilot Copilot AI review requested due to automatic review settings September 12, 2025 20:03
Copy link
Contributor

@Copilot 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 fixes a bug where file include reasons were not properly tracked when files were redirected from .ts to .d.ts, causing missing import information in TypeScript build outputs. The fix ensures that include reasons are correctly propagated through file redirections, particularly for referenced projects with multiple import paths.

  • Fixed incorrect file include reason handling for .ts to .d.ts redirections
  • Added validation to verify include reasons are properly set for all program files
  • Updated test baselines to reflect corrected import tracking behavior

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/compiler/filesparser.go Modified include reason logic to handle redirected files and added helper function for proper reason propagation
internal/compiler/fileloader.go Added missing files to processed files structure
internal/compiler/program.go Added testing methods to expose include reasons and missing file checking
internal/execute/tsctests/sys.go Added validation logic to check include reason consistency and baseline reporting
internal/execute/tsctests/runner.go Updated baseline generation to include include reason validation results
Test baseline files Updated baselines showing corrected "Imported via" information in build outputs

@sheetalkamat sheetalkamat added this pull request to the merge queue Sep 12, 2025
Merged via the queue into main with commit 0522ac5 Sep 12, 2025
22 checks passed
@sheetalkamat sheetalkamat deleted the explainFiles branch September 12, 2025 22:10
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