fix: validate glob entry correctness in bundle mode#1512
Merged
Timeless0911 merged 1 commit intomainfrom Mar 4, 2026
Merged
Conversation
Timeless0911
approved these changes
Mar 4, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a validation gap in bundle mode where glob entry patterns that happen to have a file extension (e.g. !src/404/**/*.md) were incorrectly classified as missing files rather than unsupported glob patterns. The fix adds a isGlobLike check that detects negation (! prefix) and glob special characters (*, ?, [, ], {, }) to provide the appropriate, clearer error message.
Changes:
- Adds a
isGlobLikeregex check in the bundle mode entry validation to catch glob/negation patterns that have extensions (which previously fell through to the "non-existing file" error path). - Extends the test fixture
bundleWithGlob.config.tswith a negation glob that includes a file extension (!src/404/**/*.md) to cover the newly fixed case. - Updates the inline snapshot in the integration test to expect a third error message for the new glob entry.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/core/src/config.ts |
Adds isGlobLike detection so patterns like !src/404/**/*.md trigger the correct "glob not supported in bundle mode" error |
tests/integration/entry/validate/bundleWithGlob.config.ts |
Adds !src/404/**/*.md (a negation glob with extension) to the test fixture to exercise the new detection path |
tests/integration/entry/index.test.ts |
Updates inline snapshot to include the expected error for the new !src/404/**/*.md entry |
You can also share your feedback on Copilot code review. Take the survey.
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.
Summary
validate glob entry correctness in bundle mode.
before:

after:

Related Links
Checklist