Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
5f0c199
Move vfs matching to package
jakebailey Dec 17, 2025
e169936
Big test
jakebailey Dec 17, 2025
89940b4
it works
jakebailey Dec 17, 2025
e08673a
Start splitting apart
jakebailey Dec 17, 2025
97046fe
fmt
jakebailey Dec 17, 2025
c8ead74
perf optimizations
jakebailey Dec 17, 2025
c1c0947
fix benchmarks
jakebailey Dec 17, 2025
e16c972
perf optimizations
jakebailey Dec 17, 2025
e1a8f97
Even fewer regex
jakebailey Dec 17, 2025
8d9ecfd
move to old school testing
jakebailey Dec 17, 2025
f3e63f2
Make seperable
jakebailey Dec 17, 2025
297c82b
fmt
jakebailey Dec 17, 2025
57c83ff
Remove from getWildcardDirectoryFromSpec
jakebailey Dec 17, 2025
9ddea2e
bench
jakebailey Dec 17, 2025
bab63db
Eliminate another
jakebailey Dec 17, 2025
83931d1
Drop bad comments
jakebailey Dec 17, 2025
ccd944c
Make my life easier
jakebailey Dec 17, 2025
c21638a
more perf
jakebailey Dec 17, 2025
f37c9bf
Simplify
jakebailey Dec 17, 2025
314bc82
Proper enum
jakebailey Dec 17, 2025
6919ad3
No hardcode
jakebailey Dec 17, 2025
834fbd8
Big simplify pass
jakebailey Dec 18, 2025
604196e
More simplficiations
jakebailey Dec 18, 2025
ef638bf
More simplficiations
jakebailey Dec 18, 2025
c06760b
More simplficiations
jakebailey Dec 18, 2025
0801191
Fix range
jakebailey Dec 18, 2025
e511530
rando fixups
jakebailey Dec 18, 2025
8d06bcd
Unused method
jakebailey Dec 18, 2025
816b3b2
Remove leftover nil checks
jakebailey Dec 18, 2025
1168650
more testing
jakebailey Dec 18, 2025
e51f138
More cleanup, tests
jakebailey Dec 18, 2025
68e49cf
big oops
jakebailey Dec 18, 2025
1d8a075
Fix confusing min.js behavior
jakebailey Dec 18, 2025
316e46d
Pesky pesky min.js
jakebailey Dec 18, 2025
ee3f2e4
why can't I type
jakebailey Dec 18, 2025
5f971f6
More perf
jakebailey Dec 18, 2025
efd6350
GetNormalizedPathComponents specialize
jakebailey Dec 18, 2025
323caa4
More perf optimizations
jakebailey Dec 18, 2025
041843f
Random exported funcs
jakebailey Dec 18, 2025
9a6cbbb
Stop using pointer for depth
jakebailey Dec 19, 2025
e20b040
globPattern as a value type
jakebailey Dec 19, 2025
8ec6a52
Merge branch 'main' into jabaile/vfs-match-again
jakebailey Jan 7, 2026
c348ed1
backtracking tests
jakebailey Jan 7, 2026
b1fbe99
iterable
jakebailey Jan 8, 2026
743511b
use go style return
jakebailey Jan 10, 2026
ba281ce
commentary
jakebailey Jan 10, 2026
9ee9093
clarity tweaks
jakebailey Jan 10, 2026
80e6517
Merge branch 'main' into jabaile/vfs-match-again
jakebailey Jan 10, 2026
8d3ec80
unused label
jakebailey Jan 10, 2026
ad62b4a
Merge branch 'main' into jabaile/vfs-match-again
jakebailey Jan 13, 2026
c456031
Merge branch 'main' into jabaile/vfs-match-again
jakebailey Jan 31, 2026
d1228d1
compile
jakebailey Jan 31, 2026
6c07007
Merge branch 'main' into jabaile/vfs-match-again
jakebailey Feb 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Pesky pesky min.js
  • Loading branch information
jakebailey committed Dec 18, 2025
commit 316e46d170714e9d2f8209f4f817a5f5307fc968
30 changes: 23 additions & 7 deletions internal/vfs/vfsmatch/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,23 +290,39 @@ func (p *globPattern) checkMinJsExclusion(filename string, segs []segment) bool
return true
}

lowerName := strings.ToLower(filename)
if !strings.HasSuffix(lowerName, ".min.js") {
// Preserve legacy behavior:
// - When matching is case-sensitive, only the exact ".min.js" suffix is excluded by default.
// - When matching is case-insensitive, any casing variant is excluded by default.
if !p.hasMinJsSuffix(filename) {
return true
}
// Allow when the user's pattern explicitly references the .min. suffix.
if p.patternMentionsMinSuffix(segs) {
return true
}
return false
}

func (p *globPattern) hasMinJsSuffix(filename string) bool {
if p.caseSensitive {
return strings.HasSuffix(filename, ".min.js")
}
return strings.HasSuffix(strings.ToLower(filename), ".min.js")
}

// Match legacy behavior: exclude .min.js by default for "files" patterns, but allow it
// when the user's pattern explicitly references the .min. suffix (e.g. "*.min.*" or "*.min.js").
func (p *globPattern) patternMentionsMinSuffix(segs []segment) bool {
for _, seg := range segs {
if seg.kind != segLiteral {
continue
}
lowerLit := strings.ToLower(seg.literal)
if strings.Contains(lowerLit, ".min.js") || strings.Contains(lowerLit, ".min.") {
lit := seg.literal
if !p.caseSensitive {
lit = strings.ToLower(lit)
}
if strings.Contains(lit, ".min.js") || strings.Contains(lit, ".min.") {
return true
}
}

return false
}

Expand Down
13 changes: 13 additions & 0 deletions internal/vfs/vfsmatch/vfsmatch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func caseSensitiveHost() vfs.FS {
"/dev/q/a/c/b/d.ts": "",
"/dev/js/a.js": "",
"/dev/js/b.js": "",
"/dev/js/d.MIN.js": "",
}, true)
}

Expand Down Expand Up @@ -641,6 +642,18 @@ func TestReadDirectory(t *testing.T) {
assert.Assert(t, !slices.Contains(got, "/dev/js/ab.min.js"))
},
},
{
name: "min js exclusion is case-sensitive on case-sensitive FS",
host: caseSensitiveHost,
extensions: []string{".js"},
includes: []string{"js/*"},
expect: func(t *testing.T, got []string) {
assert.Assert(t, slices.Contains(got, "/dev/js/a.js"))
assert.Assert(t, slices.Contains(got, "/dev/js/b.js"))
// Legacy behavior: only lowercase ".min.js" is excluded by default when matching is case-sensitive.
assert.Assert(t, slices.Contains(got, "/dev/js/d.MIN.js"))
},
},
{
name: "min js files explicitly included",
host: caseInsensitiveHost,
Expand Down