Repository navigation
fix(path): match Node minimatch extglobs and normalized paths - #46
Merged
Merged
Conversation
Reuse the existing filesystem minimatch implementation lazily from node:path, with separate last-pattern caches for POSIX and Windows. Remove the separate Bun.Glob adapter so negated extglobs and dot-segment normalization follow Node's matcher configuration. A 26,460-case comparison matches Node 24 exactly (4,582 baseline mismatches). The path suite passes 163 tests, including 16 regressions that fail unpatched. Independent review, built-in type checks and JavaScript lint pass.
steipete
force-pushed
the
claude/w18b-path-matches-glob
branch
from
October 1, 2026 07:16
4c806c4 to
b1b7140
Compare
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.
Make
path.matchesGlobuse the fork's existing Node-compatible minimatch matcher. Negated extglobs now select production sources correctly, and minimatch's dot-segment normalization makes paths such asui/src/styles/./base.cssmatch the same policy as their normalized spelling.The path adapter lazily loads the existing filesystem glob implementation, keeping its POSIX/Windows behavior and retaining a separate last-pattern cache for each adapter. This removes the separate Bun.Glob path implementation without introducing a dependency or editing the vendored minimatch block.
Upstream: scoped oven-sh/bun issue and PR searches for matchesGlob extglobs and normalization found no existing fix. The matcher already in the fork was ported from Node; this change reuses it.
Validation on macOS arm64 against Node 24.21.0:
OpenClaw consumer proof at
9280c615c0c3b, with private HOME/state and mode-0700 TMPDIR on every run:test/scripts/ci-changed-node-test-plan.config-fallback.test.tstest/scripts/ci-changed-node-test-plan.integration.test.tstest/scripts/ci-changed-node-test-plan.source-owners.test.tstest/scripts/ci-changed-node-test-plan.test.tstest/scripts/ci-node-test-plan.test.tsThe first baseline source-owner run hit its no-output guard under heavy host load; rerunning the file alone completed and reproduced the 11 failures shown above. All five patched consumer files pass (363 tests).