Skip to content

fix: validate glob entry correctness in bundle mode#1512

Merged
Timeless0911 merged 1 commit intomainfrom
glob-error
Mar 4, 2026
Merged

fix: validate glob entry correctness in bundle mode#1512
Timeless0911 merged 1 commit intomainfrom
glob-error

Conversation

@9aoy
Copy link
Copy Markdown
Contributor

@9aoy 9aoy commented Mar 4, 2026

Summary

validate glob entry correctness in bundle mode.

before:
image

after:
image

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings March 4, 2026 07:34
Copy link
Copy Markdown
Contributor

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 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 isGlobLike regex 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.ts with 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.

@Timeless0911 Timeless0911 merged commit 8ac6625 into main Mar 4, 2026
14 checks passed
@Timeless0911 Timeless0911 deleted the glob-error branch March 4, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants