From 79a305f2de8f8c8db98ab6981233612eaec55a85 Mon Sep 17 00:00:00 2001 From: Maxime Brazeilles Date: Mon, 5 Feb 2024 11:04:06 +0100 Subject: [PATCH] [FIX] Glob no longer expose minimatch in proto (#2822) * [FIX] Glob no longer expose minimatch in proto --- packages/mjml-cli/package.json | 1 + packages/mjml-cli/src/commands/watchFiles.js | 6 +++--- yarn.lock | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/mjml-cli/package.json b/packages/mjml-cli/package.json index cdd65be11..c402d7899 100644 --- a/packages/mjml-cli/package.json +++ b/packages/mjml-cli/package.json @@ -31,6 +31,7 @@ "html-minifier": "^4.0.0", "js-beautify": "^1.6.14", "lodash": "^4.17.21", + "minimatch": "^9.0.3", "mjml-core": "4.15.2", "mjml-migrate": "4.15.2", "mjml-parser-xml": "4.15.2", diff --git a/packages/mjml-cli/src/commands/watchFiles.js b/packages/mjml-cli/src/commands/watchFiles.js index 24884a70d..bf2802a7a 100644 --- a/packages/mjml-cli/src/commands/watchFiles.js +++ b/packages/mjml-cli/src/commands/watchFiles.js @@ -1,6 +1,7 @@ /* eslint-disable no-console */ import chokidar from 'chokidar' -import { glob } from 'glob' +import { sync } from 'glob' +import { match } from 'minimatch' import path from 'path' import mjml2html from 'mjml-core' import { flow, pickBy, flatMap, uniq, difference, remove } from 'lodash/fp' @@ -98,8 +99,7 @@ export default (input, options) => { console.log(`Now watching file: ${filePath}`) const matchInputOption = input.reduce( - (found, file) => - found || glob(path.resolve(file)).minimatch.match(filePath), + (found, file) => found || match(sync(path.resolve(file)), filePath), false, ) diff --git a/yarn.lock b/yarn.lock index 47cdd8a39..9d04f4fa6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6332,7 +6332,7 @@ minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimatch@^9.0.1: +minimatch@^9.0.1, minimatch@^9.0.3: version "9.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==