Remove minimatch from cli-kit (use native path.matchesGlob)#7725
Draft
amcaplan wants to merge 1 commit into
Draft
Remove minimatch from cli-kit (use native path.matchesGlob)#7725amcaplan wants to merge 1 commit into
amcaplan wants to merge 1 commit into
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/fs.d.ts@@ -344,8 +344,8 @@ export declare function findPathUp(matcher: OverloadParameters<typeof internalFi
*/
export declare function findPathUpSync(matcher: OverloadParameters<typeof internalFindUp>[0], options: OverloadParameters<typeof internalFindUp>[1]): ReturnType<typeof internalFindUpSync>;
export interface MatchGlobOptions {
- matchBase: boolean;
- noglobstar: boolean;
+ matchBase?: boolean;
+ noglobstar?: boolean;
}
/**
* Matches a key against a glob pattern.
|
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.
What
Removes the
minimatchdependency from@shopify/cli-kit, replacing it with Node's nativepath.matchesGlob(Node ≥22.12 — cli-kit already requires this viaengines).Why
Reduce Dependabot churn —
minimatchsaw ~58 version bumps in 24 months. Part of an automated CLI dependency-removal initiative.How
matchGlob()inpackages/cli-kit/src/public/node/fs.tsnow usesnode:pathmatchesGlob.MatchGlobOptions(matchBase/noglobstar) was unused, but a real caller passes them. NativematchesGlobtakes no options, so they are emulated:noglobstar: rewrite**→*in the pattern.matchBase: when the pattern has no path separator, also match against the basename.fs.test.ts.Validation
type-check✅ ·lint✅ ·vitest run src/public/node/fs.test.ts✅ (incl. new parity tests).🤖 Automated dependency-removal initiative — AI-generated draft, needs human review. Please double-check glob-semantics parity (dotfiles / negation / braces) and the
matchBase/noglobstaremulation.