Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(watch): --include CLI flag to watch additional files #625

Merged
merged 20 commits into from
Aug 24, 2024

Conversation

mdmower-csnw
Copy link
Contributor

@mdmower-csnw mdmower-csnw commented Jul 31, 2024

This PR picks up from where #561 left off (it appears to have been abandoned), but there is actually very little of that PR remaining here. Notably, I didn't see it necessary to add --exclude which would only alias the --ignore flag. Nonetheless, the chain of commits here reflects the original contribution.

  • Add support for watch CLI flag --include that can be used to include additional file paths and glob patterns (same syntax as the --ignore flag).
  • Add test that ensures both file path and glob pattern work with --include flag.

Fixes #181

boxizen and others added 12 commits March 23, 2023 00:42
Co-authored-by: hiroki osame <hiroki.osame@gmail.com>
- Incorporate review feedback into 'watch: include' test
- Fix final stdout check for 'watch: include' test
- Add new 'watch: exclude' test to ensure a file can be excluded from
  watch
- There is no need to alias --ignore with --exclude, remove the new flag
- Handle --include flag inside options object like the --ignore flag
- Improve include test to also ensure glob pattern works
- Before checking for substrings in stdout, strip ANSI escape codes
tests/specs/watch.ts Outdated Show resolved Hide resolved
- On Windows, mixed path separators are output by the watch utility.
  Normalize on / before searching for expected output.
- Remove wait on debounce and separate file writes based on stdout
  output.
Fix error seen on Windows CI:
String.prototype.replaceAll called with a non-global RegExp argument
@mdmower-csnw
Copy link
Contributor Author

mdmower-csnw commented Aug 1, 2024

Thanks for all the CI reruns @privatenumber (and also sorry you had to keep rerunning). I had some trouble installing node-gyp on Windows so my testing was limited to Debian.

@mdmower-csnw
Copy link
Contributor Author

@privatenumber - is there anything else you need from me for this PR?

@privatenumber
Copy link
Owner

Sorry, hard to prioritize tsx these days. But eventually I'll have to figure out funding first so it makes sense for me to invest more time on tsx, and then I plan to work on a bunch of watch improvements including this.

@privatenumber
Copy link
Owner

I was debating between naming it watch vs include, but I think include makes sense to avoid the double "watch".
I think I'll have to rename ignore to exclude in the next major.

@privatenumber privatenumber changed the title feat(watch): support --include CLI flag feat(watch): --include CLI flag to watch additional files Aug 24, 2024
@privatenumber privatenumber merged commit 474ea71 into privatenumber:master Aug 24, 2024
3 checks passed
@privatenumber
Copy link
Owner

This issue is now resolved in v4.18.0.

If you're able to, your sponsorship would be very much appreciated.

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

Successfully merging this pull request may close these issues.

Add files to be watched
3 participants