Skip to content

Conversation

@louiellan
Copy link

@louiellan louiellan commented Aug 4, 2025

Closes #45182

This adds the --watch-pattern cli option to Node.js, which allows to watch files and directories with the use of globs. This PR is a non-breaking change opposed to --watch-path option supporting globs since there could be instances where some glob characters are used (e.g., file[1].js) which could be treated as a glob and may cause breakage on existing scripts.

@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Aug 4, 2025
@codecov
Copy link

codecov bot commented Aug 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.36%. Comparing base (55b7d28) to head (bf21496).
⚠️ Report is 49 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #59345      +/-   ##
==========================================
- Coverage   89.97%   89.36%   -0.61%     
==========================================
  Files         649      654       +5     
  Lines      192189   192701     +512     
  Branches    37679    37461     -218     
==========================================
- Hits       172915   172212     -703     
- Misses      11864    13004    +1140     
- Partials     7410     7485      +75     
Files with missing lines Coverage Δ
lib/internal/fs/glob.js 90.72% <100.00%> (-1.27%) ⬇️

... and 115 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@louiellan louiellan force-pushed the glob-on-watch-path branch from 0c53c42 to 46be19d Compare August 5, 2025 03:14
Co-authored-by: Moshe Atlow <moshe@atlow.co.il>
@louiellan louiellan marked this pull request as draft August 12, 2025 02:02
@louiellan louiellan changed the title lib: support globs on --watch-path lib: adding --watch-pattern to support watching files/dirs with glob Aug 15, 2025
@louiellan
Copy link
Author

I've added another PR for supporting glob on --watch-path option #59478 just in case if it is ever decided that we would go through with the breaking change

@louiellan louiellan marked this pull request as ready for review August 15, 2025 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support file globs with --watch-path

3 participants