Skip to content

Conversation

sheetalkamat
Copy link
Member

Fixes #62434

@Copilot Copilot AI review requested due to automatic review settings September 11, 2025 18:44
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Sep 11, 2025
@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Sep 11, 2025
Copy link

@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 an issue where .d.ts files from project references were incorrectly ignored during module resolution. The fix modifies the program compilation logic to properly handle declaration files in project references by updating the file processing condition.

Key Changes

  • Modified the file processing logic in createProgram to handle declaration files correctly
  • Added a new test case to verify that module resolution works correctly from .d.ts files in referenced projects

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/compiler/program.ts Updates file processing condition to properly handle declaration files from project references
src/testRunner/unittests/tsbuild/moduleResolution.ts Adds new test case for verifying module resolution from .d.ts files in referenced projects
tests/baselines/reference/tsbuild/moduleResolution/resolution-from-d.ts-of-referenced-project.js Baseline file for the new test case showing expected compilation output and trace resolution

const path = toPath(fileName);
let outputDts;
if (!fileExtensionIs(fileName, Extension.Json)) {
if (!isDeclarationFileName(fileName) && !fileExtensionIs(fileName, Extension.Json)) {
Copy link
Preview

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

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

[nitpick] The condition logic is now more complex with two negations. Consider extracting this into a helper function with a descriptive name like shouldProcessForOutput to improve readability and make the intent clearer.

Copilot uses AI. Check for mistakes.

@github-project-automation github-project-automation bot moved this from Not started to Needs merge in PR Backlog Sep 11, 2025
@sheetalkamat sheetalkamat enabled auto-merge (squash) September 11, 2025 19:04
@sheetalkamat sheetalkamat merged commit e9bcbe6 into main Sep 11, 2025
33 checks passed
@sheetalkamat sheetalkamat deleted the dtsInProjReference branch September 11, 2025 19:14
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Sep 11, 2025
@jakebailey
Copy link
Member

@typescript-bot cherry-pick this to release-5.9

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 11, 2025

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
cherry-pick this to release-5.9 ✅ Started ✅ Results

@typescript-bot
Copy link
Collaborator

Hey, @jakebailey! I've created #62440 for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Paths not respected in declaration files from referenced projects
3 participants