Skip to content

Conversation

sheetalkamat
Copy link
Member

Fixes #48314

Now that we have buildinfo in --b mode, we can consistently check the package.json status changes in watch or tsc -b invocations to get consistent behaviour by encoding needed package.json into buildInfo

@Copilot Copilot AI review requested due to automatic review settings September 5, 2025 21:05
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Sep 5, 2025
@typescript-bot
Copy link
Collaborator

Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page.

Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up.

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 pull request fixes #48314 by ensuring consistent handling of package.json files between regular tsc and tsc --build modes. The key change is encoding necessary package.json information into buildInfo files, allowing watch mode and build mode to behave consistently when detecting package.json status changes.

Key changes:

  • Adds packageJsons field to build info structures to track package.json dependencies
  • Updates build info generation to include package.json paths that affect module resolution
  • Modifies up-to-date checking to consider package.json changes when validating build info

Reviewed Changes

Copilot reviewed 79 out of 80 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/baselines/reference/*.js Updated test baselines to reflect new packageJsons field in build info
src/compiler/tsbuildPublic.ts Modified to track and watch package.json files using build info data
src/compiler/builderPublic.ts Added realpath function to BuilderProgramHost interface
src/compiler/builder.ts Added packageJsons tracking to build info generation and state management
tests/baselines/reference/api/typescript.d.ts Updated API to include realpath in BuilderProgramHost

@jakebailey
Copy link
Member

Is it likely for this to grow hugely for lots of packages? I guess it doesn't really matter, given it is just one extra string for each package, and each package already has multiple files otherwise we wouldn't have these package.jsons anyway.

Do we definitely want this in Strada at this point?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

Tsbuild watching packagejson is dependent on whether program was built in the invocation
3 participants