Skip to content

[heft-swc] Reduce set of watched folders#5295

Merged
dmichon-msft merged 3 commits intomicrosoft:mainfrom
dmichon-msft:heft-swc-watch-loop
Aug 4, 2025
Merged

[heft-swc] Reduce set of watched folders#5295
dmichon-msft merged 3 commits intomicrosoft:mainfrom
dmichon-msft:heft-swc-watch-loop

Conversation

@dmichon-msft
Copy link
Contributor

@dmichon-msft dmichon-msft commented Aug 4, 2025

Summary

Updates the watch logic to only watch folders that TypeScript has identified has having wildcard patterns for source files, rather than all folders enumerated during TSConfig parsing.

This avoids, for example, watching for changes to the project root folder.

Details

The TSConfig parser returns a wildcardDirectories object that indicates folders that contained wildcards and if the wildcard is local (* or ?) or recursive (**). This is used to determine the directories that should be watched by Heft's watcher.

How it was tested

Local heft run-watch --only build -- --clean in heft-swc-test and creating/modifying/deleting files at various points in the directory hierarchy.
Linked the new version into a repository that was having infinite loop issues and verified that no such issues occur.

Impacted documentation

None.

@dmichon-msft dmichon-msft enabled auto-merge (squash) August 4, 2025 23:08
@dmichon-msft dmichon-msft merged commit 4ef999a into microsoft:main Aug 4, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Needs triage to Closed in Bug Triage Aug 4, 2025
@dmichon-msft dmichon-msft deleted the heft-swc-watch-loop branch August 4, 2025 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

2 participants