Skip to content

Remove minimatch from cli-kit (use native path.matchesGlob)#7725

Draft
amcaplan wants to merge 1 commit into
mainfrom
remove-dep/minimatch
Draft

Remove minimatch from cli-kit (use native path.matchesGlob)#7725
amcaplan wants to merge 1 commit into
mainfrom
remove-dep/minimatch

Conversation

@amcaplan
Copy link
Copy Markdown
Contributor

@amcaplan amcaplan commented Jun 5, 2026

What

Removes the minimatch dependency from @shopify/cli-kit, replacing it with Node's native path.matchesGlob (Node ≥22.12 — cli-kit already requires this via engines).

Why

Reduce Dependabot churn — minimatch saw ~58 version bumps in 24 months. Part of an automated CLI dependency-removal initiative.

How

  • matchGlob() in packages/cli-kit/src/public/node/fs.ts now uses node:path matchesGlob.
  • ⚠️ Reviewer note: the original audit assumed MatchGlobOptions (matchBase/noglobstar) was unused, but a real caller passes them. Native matchesGlob takes no options, so they are emulated:
    • noglobstar: rewrite *** in the pattern.
    • matchBase: when the pattern has no path separator, also match against the basename.
  • Added parity tests in fs.test.ts.
  • Patch changeset added.

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/noglobstar emulation.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Jun 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Differences in type declarations

We 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:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/cli @shopify/cli package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant