Skip to content

Commit 75b6f39

Browse files
authored
chore: update micromatch (#27038)
1 parent 5619220 commit 75b6f39

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

packages/gatsby-page-utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"gatsby-core-utils": "^1.3.20",
2828
"glob": "^7.1.6",
2929
"lodash": "^4.17.20",
30-
"micromatch": "^3.1.10"
30+
"micromatch": "^4.0.2"
3131
},
3232
"devDependencies": {
3333
"@babel/cli": "^7.11.6",

packages/gatsby-page-utils/src/ignore-path.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import * as mm from "micromatch"
1+
import { isMatch, Options as mmOptions } from "micromatch"
22

33
interface IPathIgnoreOptions {
44
patterns?: string | ReadonlyArray<string>
5-
options?: mm.Options
5+
options?: mmOptions
66
}
77

88
export function ignorePath(
@@ -13,7 +13,7 @@ export function ignorePath(
1313
if (!ignore) return false
1414
const settings: {
1515
patterns: string | ReadonlyArray<string>
16-
options: mm.Options
16+
options: mmOptions
1717
} = {
1818
patterns: ``,
1919
options: {},
@@ -37,5 +37,5 @@ export function ignorePath(
3737
settings.patterns = ignore.patterns
3838
}
3939
}
40-
return mm.any(path, settings.patterns, settings.options)
40+
return isMatch(path, settings.patterns, settings.options)
4141
}

packages/gatsby-page-utils/src/validate-path.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { parse } from "path"
2-
import * as mm from "micromatch"
2+
import { isMatch } from "micromatch"
33

44
const tsDeclarationExtTest = /\.d\.tsx?$/
55
const jsonYamlExtTest = /\.(json|ya?ml)$/
@@ -11,7 +11,7 @@ function isTestFile(filePath: string): boolean {
1111
`**/(*.)+(spec|test).(js|ts|jsx|tsx)`,
1212
]
1313

14-
return mm.isMatch(filePath, testPatterns)
14+
return isMatch(filePath, testPatterns)
1515
}
1616

1717
export function validatePath(path: string): boolean {

packages/gatsby/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"lodash": "^4.17.20",
103103
"md5-file": "^3.2.3",
104104
"meant": "^1.0.1",
105-
"micromatch": "^3.1.10",
105+
"micromatch": "^4.0.2",
106106
"mime": "^2.4.6",
107107
"mini-css-extract-plugin": "^0.11.2",
108108
"mitt": "^1.2.0",
@@ -161,6 +161,7 @@
161161
"@babel/cli": "^7.11.6",
162162
"@babel/runtime": "^7.11.2",
163163
"@types/hapi__joi": "^16.0.12",
164+
"@types/micromatch": "^4.0.1",
164165
"@types/normalize-path": "^3.0.0",
165166
"@types/reach__router": "^1.3.5",
166167
"@types/semver": "^7.1.0",

packages/gatsby/src/redux/run-fast-filters.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { IGatsbyNode } from "./types"
22
import { GatsbyGraphQLType } from "../.."
33
import { prepareRegex } from "../utils/prepare-regex"
4-
const { makeRe } = require(`micromatch`)
4+
import { makeRe } from "micromatch"
55
import { getValueAt } from "../utils/get-value-at"
66
import _ from "lodash"
77
import {

0 commit comments

Comments
 (0)