Skip to content

fix(cli): use a separate ignore matcher to ignore watched files#1681

Merged
meteorlxy merged 8 commits intomainfrom
chokidar
Mar 10, 2026
Merged

fix(cli): use a separate ignore matcher to ignore watched files#1681
meteorlxy merged 8 commits intomainfrom
chokidar

Conversation

@Mister-Hope
Copy link
Copy Markdown
Member

No description provided.

@coveralls
Copy link
Copy Markdown

coveralls commented Mar 9, 2026

Pull Request Test Coverage Report for Build 22886476298

Details

  • 0 of 5 (0.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.05%) to 75.19%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/cli/src/commands/dev/watchPageFiles.ts 0 5 0.0%
Files with Coverage Reduction New Missed Lines %
packages/cli/src/commands/dev/watchPageFiles.ts 2 1.43%
Totals Coverage Status
Change from base Build 22884354324: -0.05%
Covered Lines: 735
Relevant Lines: 978

💛 - Coveralls

@Mister-Hope Mister-Hope marked this pull request as ready for review March 9, 2026 05:42
Copy link
Copy Markdown

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 the chokidar file watcher's ignored callback in VuePress's dev server page watcher. The main change improves directory-level filtering by separating the ignore logic into a dedicated picomatch matcher for ignored directories and a page matcher for file-level filtering, ensuring that directories like node_modules and .vuepress are immediately ignored without traversing their children.

Changes:

  • Split the single picomatch matcher (with ignore option) into two separate matchers: ignoreMatcher for directory-level exclusion and isPageMatch for file matching
  • Restructured the ignored callback to first check ignoreMatcher, then check temp/cache directories (guarded by isDirectory()), and finally check file pattern matching
  • Changed temp/cache directory comparison from startsWith to strict equality, which is correct since ignored directories are not traversed

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/cli/src/commands/dev/watchPageFiles.ts Outdated
Comment thread packages/cli/src/commands/dev/watchPageFiles.ts Outdated
Comment thread packages/cli/src/commands/dev/watchPageFiles.ts Outdated
meteorlxy
meteorlxy previously approved these changes Mar 10, 2026
@meteorlxy meteorlxy changed the title fix(cli): fix chokidar fix(cli): fix pages watcher Mar 10, 2026
@meteorlxy meteorlxy changed the title fix(cli): fix pages watcher fix(cli): use a separate ignore matcher to ignore watched files Mar 10, 2026
@meteorlxy meteorlxy merged commit 1ab52b6 into main Mar 10, 2026
30 checks passed
@meteorlxy meteorlxy deleted the chokidar branch March 10, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants