Skip to content

feat!: introduce built-in ignore patterns for large deep folders#1694

Open
Mister-Hope wants to merge 1 commit intomainfrom
ignore
Open

feat!: introduce built-in ignore patterns for large deep folders#1694
Mister-Hope wants to merge 1 commit intomainfrom
ignore

Conversation

@Mister-Hope
Copy link
Member

@Mister-Hope Mister-Hope commented Mar 19, 2026

This is a refactor similar to #1690, but with some common folders hard coded

@coveralls
Copy link

Pull Request Test Coverage Report for Build 23288850843

Details

  • 1 of 2 (50.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 75.155%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/cli/src/commands/dev/watchPageFiles.ts 1 2 50.0%
Files with Coverage Reduction New Missed Lines %
packages/cli/src/commands/dev/watchPageFiles.ts 1 2.78%
Totals Coverage Status
Change from base Build 23282024048: 0.02%
Covered Lines: 736
Relevant Lines: 980

💛 - Coveralls

Copy link

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 aims to reduce performance/FS-watcher issues caused by large/deep folders (e.g., node_modules, VCS dirs) by introducing built-in ignore behavior and adjusting the default pagePatterns.

Changes:

  • Updates core default pagePatterns to remove the !node_modules exclusion.
  • Documents that folders like node_modules/.git are “ignored anyway”.
  • Adds a DEFAULT_IGNORE_PATTERNS list in the dev page watcher and passes it to picomatch via ignore.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
packages/core/tests/app/resolveAppOptions.spec.ts Updates the expected default pagePatterns in unit tests.
packages/core/src/types/app/options.ts Updates pagePatterns documentation and default annotation.
packages/core/src/app/resolveAppOptions.ts Changes the default pagePatterns value used by core.
packages/cli/src/commands/dev/watchPageFiles.ts Introduces default ignore patterns in the dev watcher’s page-matching logic.

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

Comment on lines +13 to +19
// package managers
'**/node_modules/**',
'**/.yarn/**',

// version controls
'**/.git/**',
'**/.svn/**',
Comment on lines 67 to +73
const tempDir = app.dir.temp()
const cacheDir = app.dir.cache()
const ignoreMatcher = picomatch(ignorePatterns, { cwd: sourceDir })
const pageMatcher = picomatch(pagePatterns, { cwd: sourceDir })
const pageMatcher = picomatch(pagePatterns, {
cwd: sourceDir,
ignore: DEFAULT_IGNORE_PATTERNS,
})
Comment on lines 72 to 79
/**
* Patterns to match the markdown files as pages
*
* @default ['**\/*.md', '!.vuepress', '!node_modules']
* Note: folders like node_modules and .git will be ignored anyway
*
* @default ['**\/*.md', '!.vuepress']
*/
pagePatterns?: string[]
debug = false,
markdown = {},
pagePatterns = ['**/*.md', '!.vuepress', '!node_modules'],
pagePatterns = ['**/*.md', '!.vuepress'],
port: 8080,
open: false,
pagePatterns: ['**/*.md', '!.vuepress', '!node_modules'],
pagePatterns: ['**/*.md', '!.vuepress'],
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.

3 participants