feat!: introduce built-in ignore patterns for large deep folders#1694
Open
Mister-Hope wants to merge 1 commit intomainfrom
Open
feat!: introduce built-in ignore patterns for large deep folders#1694Mister-Hope wants to merge 1 commit intomainfrom
Mister-Hope wants to merge 1 commit intomainfrom
Conversation
Pull Request Test Coverage Report for Build 23288850843Details
💛 - Coveralls |
There was a problem hiding this comment.
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
pagePatternsto remove the!node_modulesexclusion. - Documents that folders like
node_modules/.gitare “ignored anyway”. - Adds a
DEFAULT_IGNORE_PATTERNSlist in the dev page watcher and passes it topicomatchviaignore.
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'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a refactor similar to #1690, but with some common folders hard coded