Skip to content

fix(core): support glob characters in the project path - #8390

Merged
B4nan merged 2 commits into
mikro-orm:masterfrom
kaanisthatyou:fix/glob-chars-in-cwd
Oct 5, 2026
Merged

B4nan merged 2 commits into
mikro-orm:masterfrom
kaanisthatyou:fix/glob-chars-in-cwd

Conversation

@kaanisthatyou

Copy link
Copy Markdown
Contributor

When the project lives in a directory with glob characters, like ~/Dropbox (Team)/app, fs.resolveGlob passes absolute paths to tinyglobby as patterns, the cwd part is read as glob syntax and nothing matches: migrations and seeders (globbed from their absolute path) and entities given as absolute paths are not found. fs.pathExists also returns false for existing files when the path contains [ or ], since it treats the path as a pattern.

This makes absolute paths relative to the cwd in resolveGlob (tinyglobby escapes the cwd itself) and checks the path itself in pathExists before globbing.

Tested with a new case in Utils.win.test.ts (mocked cwd under temp/glob (chars) [x]), which fails without the change. Running the suite from a checkout under Coding(Real)/, 6 existing tests failed for this reason and pass now: source folder detection, absolute paths (GH #1073), Migrator getPending and up/down params, and Seeder seedString.

kaanisthatyou and others added 2 commits October 5, 2026 10:21
`fs.resolveGlob` passed absolute paths to the glob as patterns, so when the
project lives in a directory like `~/Dropbox (Team)/app`, the cwd part
was read as glob syntax and nothing matched: migrations, seeders and
entities given as absolute paths were not found. Make absolute paths
relative to the cwd first, which tinyglobby escapes itself.

`fs.pathExists` treated every path with `[` or `]` as a pattern, so it
returned `false` for existing files in such a directory. Check the path
itself before globbing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A directory that exists on disk is now searched as-is instead of being parsed as a glob,
so paths like `src/(group)/entities` or `../sibling [x]/entities` resolve with both
tinyglobby and the `node:fs` fallback.
@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.66%. Comparing base (ef629d5) to head (32e23a0).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8390   +/-   ##
=======================================
  Coverage   99.66%   99.66%           
=======================================
  Files         293      293           
  Lines       31995    31998    +3     
  Branches     8617     8621    +4     
=======================================
+ Hits        31889    31892    +3     
  Misses        102      102           
  Partials        4        4           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@B4nan B4nan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks

@B4nan
B4nan merged commit f2c02f0 into mikro-orm:master Oct 5, 2026
26 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.

2 participants