fix: use minimatch.escape() for path prefix escaping#152
Conversation
|
This should fix the failing update in #151 |
There was a problem hiding this comment.
Pull request overview
Updates glob-pattern handling to avoid minimatch brace-expansion edge cases by switching path-prefix escaping to minimatch.escape() and bumping the minimatch dependency.
Changes:
- Bump
minimatchfrom10.0.1to10.2.3. - Replace manual regex-based escaping of
pathPrefixwithminimatch.escape()(plus explicit#handling).
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/index.ts | Switches pathPrefix escaping to minimatch.escape() before building Minimatch globs. |
| package.json | Updates the direct minimatch dependency version. |
| pnpm-lock.yaml | Updates lockfile resolutions for minimatch and many transitive dependencies. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ab759e5 to
952d002
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #152 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 762 755 -7
Branches 67 67
=========================================
- Hits 762 755 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I like this change more than just upgrading to 10.2.4. Can you update 10.2.3 -> 10.2.4, and ensure you are in the contributors section of package.json please? |
|
Can we also relax the constraints? The brace expansion bug has been fixed |
|
We can relax the constraints, but I'd prefer to keep them tight, since we've had such issues with different minimatch versions breaking things. I'm open to having my mind changed, however. |
|
Me and others in the community have done what we can to get those addressed, and frankly I think both minimatch and brace-expansions are very stable so unlikely to see more releases, and pinning makes it harder to deduplicate dependencies... I don't know if there's much more I can say beyond that 😅 (If it matters, I think relaxing for the v1 line is more useful 🤷♂️) |
|
Shrug, ok. Let's add a |
Updated minimatch to 10.2.4, which includes the escape() fix.
952d002 to
7b6b77f
Compare
|
@hildjj I pushed the changes and amended the commit. I add |
|
It needs a |
Sorry, I left for out of town and don’t gave a computer to make the last changes needed. Can you please do the missing step I forgot? |
Bump minimatch from 10.0.1 to 10.2.3. Replace manual backslash escaping of path prefixes with minimatch.escape() using bracket-style escaping (windowsPathsNoEscape: true), which avoids a brace-expansion bug that stripped backslash escape sequences.