Repository navigation
fix(core): support glob characters in the project path - #8390
Merged
Merged
Conversation
`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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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.
When the project lives in a directory with glob characters, like
~/Dropbox (Team)/app,fs.resolveGlobpasses 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.pathExistsalso returnsfalsefor 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 inpathExistsbefore globbing.Tested with a new case in
Utils.win.test.ts(mocked cwd undertemp/glob (chars) [x]), which fails without the change. Running the suite from a checkout underCoding(Real)/, 6 existing tests failed for this reason and pass now: source folder detection, absolute paths (GH #1073), MigratorgetPendingand up/down params, and SeederseedString.