Skip to content

fix(graph): translate wildcards inside import.meta.glob brace alternatives - #274

Merged
adityankale190895 merged 1 commit into
DiffCI:mainfrom
FredApps:fix/vite-glob-brace-wildcards
Nov 18, 2026
Merged

adityankale190895 merged 1 commit into
DiffCI:mainfrom
FredApps:fix/vite-glob-brace-wildcards

Conversation

@FredApps

Copy link
Copy Markdown
Contributor

Fixes #273

Brace alternatives are translated with the same rules as the rest of the pattern (*, ?, **). Literal alternatives such as *.{ts,tsx} match as before. Nested braces or an unmatched } keep the load computed, as an unclosed { already did.

Validation:

  • tests/repo/vite-glob-brace-wildcards.test.ts: the wildcard-alternative case fails on main and passes here. Literal alternatives and nested braces pass on both.
  • npm run typecheck, npm test (1170 pass), npm run build, npm run audit:boundary.

…tives

globPattern escaped each brace alternative as literal text, so ./icons/{index,*-icon}.ts matched index.ts only. Files the glob loads through a wildcard alternative had no edge, and changing them selected no tests. Alternatives are now translated like the rest of the pattern; nested braces stay computed.

Signed-off-by: FredApps <[email protected]>

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cross-review of 6e7260c.

Checked:

  • The fix matches #273. Each brace alternative is now translated as a glob, so {index,*-icon} matches both. Nested braces and a stray } return undefined, which keeps the load computed (the safe side). Patterns without braces translate exactly as before.
  • The new test fails with src/ reverted (1 of 3 fail) and passes with the fix. tests/repo/vite-glob-brace-wildcards.test.ts is listed in release-files.json. The commit is DCO-signed. The branch is level with main. CI is green.

Fixed: nothing.

Still open: none.

@FredApps
FredApps marked this pull request as ready for review November 18, 2026 00:55
@adityankale190895
adityankale190895 merged commit 12cdb28 into DiffCI:main Nov 18, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vite: a wildcard inside an import.meta.glob brace alternative is matched literally

2 participants