Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 93a9908

Browse files
authored
chore: upgrade to glob v10 (#14509)
1 parent e23bb82 commit 93a9908

File tree

9 files changed

+18
-38
lines changed

9 files changed

+18
-38
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
- `[*]` [**BREAKING**] Drop support for `[email protected]`, minimum version is now `5.0` ([#14542](https://github.com/facebook/jest/pull/14542))
5555
- `[*]` Depend on exact versions of monorepo dependencies instead of `^` range ([#14553](https://github.com/facebook/jest/pull/14553))
5656
- `[*]` [**BREAKING**] Add ESM wrapper for all of Jest's modules ([#14661](https://github.com/jestjs/jest/pull/14661))
57+
- `[*]` [**BREAKING**] Upgrade to `glob@10` ([#14509](https://github.com/jestjs/jest/pull/14509))
5758
- `[docs]` Fix typos in `CHANGELOG.md` and `packages/jest-validate/README.md` ([#14640](https://github.com/jestjs/jest/pull/14640))
5859
- `[docs]` Don't use alias matchers in docs ([#14631](https://github.com/facebook/jest/pull/14631))
5960
- `[babel-jest, babel-preset-jest]` [**BREAKING**] Increase peer dependency of `@babel/core` to `^7.11` ([#14109](https://github.com/jestjs/jest/pull/14109))

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"eslint-plugin-unicorn": "^50.0.0",
4545
"execa": "^5.0.0",
4646
"find-process": "^1.4.1",
47-
"glob": "^10.0.0",
47+
"glob": "^10.3.10",
4848
"graceful-fs": "^4.2.9",
4949
"isbinaryfile": "^5.0.0",
5050
"istanbul-lib-coverage": "^3.0.0",

packages/jest-config/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"chalk": "^4.0.0",
3939
"ci-info": "^4.0.0",
4040
"deepmerge": "^4.2.2",
41-
"glob": "^7.1.3",
41+
"glob": "^10.3.10",
4242
"graceful-fs": "^4.2.9",
4343
"jest-circus": "workspace:*",
4444
"jest-environment-node": "workspace:*",
@@ -55,7 +55,6 @@
5555
"strip-json-comments": "^3.1.1"
5656
},
5757
"devDependencies": {
58-
"@types/glob": "^7.1.1",
5958
"@types/graceful-fs": "^4.1.3",
6059
"@types/micromatch": "^4.0.1",
6160
"@types/parse-json": "^4.0.0",

packages/jest-config/src/normalize.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {totalmem} from 'os';
1010
import * as path from 'path';
1111
import chalk = require('chalk');
1212
import merge = require('deepmerge');
13-
import {sync as glob} from 'glob';
13+
import {glob} from 'glob';
1414
import {statSync} from 'graceful-fs';
1515
import micromatch = require('micromatch');
1616
import type {Config} from '@jest/types';
@@ -755,7 +755,9 @@ export default async function normalize(
755755
// We expand it to these paths. If not, we keep the original path
756756
// for the future resolution.
757757
const globMatches =
758-
typeof project === 'string' ? glob(project) : [];
758+
typeof project === 'string'
759+
? glob.sync(project, {windowsPathsNoEscape: true})
760+
: [];
759761
return projects.concat(
760762
globMatches.length > 0 ? globMatches : project,
761763
);

packages/jest-reporters/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"chalk": "^4.0.0",
2525
"collect-v8-coverage": "^1.0.0",
2626
"exit": "^0.1.2",
27-
"glob": "^7.1.3",
27+
"glob": "^10.3.10",
2828
"graceful-fs": "^4.2.9",
2929
"istanbul-lib-coverage": "^3.0.0",
3030
"istanbul-lib-instrument": "^6.0.0",
@@ -43,7 +43,6 @@
4343
"@jest/test-utils": "workspace:*",
4444
"@tsd/typescript": "^5.0.4",
4545
"@types/exit": "^0.1.30",
46-
"@types/glob": "^7.1.1",
4746
"@types/graceful-fs": "^4.1.3",
4847
"@types/istanbul-lib-coverage": "^2.0.0",
4948
"@types/istanbul-lib-instrument": "^1.7.2",

packages/jest-reporters/src/CoverageReporter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as path from 'path';
99
import {mergeProcessCovs} from '@bcoe/v8-coverage';
1010
import type {EncodedSourceMap} from '@jridgewell/trace-mapping';
1111
import chalk = require('chalk');
12-
import glob = require('glob');
12+
import {glob} from 'glob';
1313
import * as fs from 'graceful-fs';
1414
import istanbulCoverage = require('istanbul-lib-coverage');
1515
import istanbulReport = require('istanbul-lib-report');
@@ -296,7 +296,7 @@ export default class CoverageReporter extends BaseReporter {
296296
// of execution time.
297297
if (filesByGlob[absoluteThresholdGroup] === undefined) {
298298
filesByGlob[absoluteThresholdGroup] = glob
299-
.sync(absoluteThresholdGroup)
299+
.sync(absoluteThresholdGroup, {windowsPathsNoEscape: true})
300300
.map(filePath => path.resolve(filePath));
301301
}
302302

packages/jest-runtime/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"chalk": "^4.0.0",
3131
"cjs-module-lexer": "^1.0.0",
3232
"collect-v8-coverage": "^1.0.0",
33-
"glob": "^7.1.3",
33+
"glob": "^10.3.10",
3434
"graceful-fs": "^4.2.9",
3535
"jest-haste-map": "workspace:*",
3636
"jest-message-util": "workspace:*",
@@ -44,7 +44,6 @@
4444
},
4545
"devDependencies": {
4646
"@jest/test-utils": "workspace:*",
47-
"@types/glob": "^7.1.1",
4847
"@types/graceful-fs": "^4.1.3",
4948
"jest-environment-node": "workspace:*"
5049
},

packages/jest-runtime/src/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import * as path from 'path';
9-
import glob = require('glob');
9+
import {glob} from 'glob';
1010
import slash = require('slash');
1111
import type {Config} from '@jest/types';
1212

@@ -42,7 +42,7 @@ export const findSiblingsWithFileExtension = (
4242
const slashedDirname = slash(dirname);
4343

4444
const matches = glob
45-
.sync(`${pathToModule}.*`)
45+
.sync(`${pathToModule}.*`, {windowsPathsNoEscape: true})
4646
.map(match => slash(match))
4747
.map(match => {
4848
const relativePath = path.posix.relative(slashedDirname, match);

yarn.lock

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3045,7 +3045,7 @@ __metadata:
30453045
eslint-plugin-unicorn: ^50.0.0
30463046
execa: ^5.0.0
30473047
find-process: ^1.4.1
3048-
glob: ^10.0.0
3048+
glob: ^10.3.10
30493049
graceful-fs: ^4.2.9
30503050
isbinaryfile: ^5.0.0
30513051
istanbul-lib-coverage: ^3.0.0
@@ -3101,7 +3101,6 @@ __metadata:
31013101
"@jridgewell/trace-mapping": ^0.3.18
31023102
"@tsd/typescript": ^5.0.4
31033103
"@types/exit": ^0.1.30
3104-
"@types/glob": ^7.1.1
31053104
"@types/graceful-fs": ^4.1.3
31063105
"@types/istanbul-lib-coverage": ^2.0.0
31073106
"@types/istanbul-lib-instrument": ^1.7.2
@@ -3113,7 +3112,7 @@ __metadata:
31133112
chalk: ^4.0.0
31143113
collect-v8-coverage: ^1.0.0
31153114
exit: ^0.1.2
3116-
glob: ^7.1.3
3115+
glob: ^10.3.10
31173116
graceful-fs: ^4.2.9
31183117
istanbul-lib-coverage: ^3.0.0
31193118
istanbul-lib-instrument: ^6.0.0
@@ -5142,16 +5141,6 @@ __metadata:
51425141
languageName: node
51435142
linkType: hard
51445143

5145-
"@types/glob@npm:^7.1.1":
5146-
version: 7.2.0
5147-
resolution: "@types/glob@npm:7.2.0"
5148-
dependencies:
5149-
"@types/minimatch": "*"
5150-
"@types/node": "*"
5151-
checksum: 6ae717fedfdfdad25f3d5a568323926c64f52ef35897bcac8aca8e19bc50c0bd84630bbd063e5d52078b2137d8e7d3c26eabebd1a2f03ff350fff8a91e79fc19
5152-
languageName: node
5153-
linkType: hard
5154-
51555144
"@types/graceful-fs@npm:^4.1.3":
51565145
version: 4.1.9
51575146
resolution: "@types/graceful-fs@npm:4.1.9"
@@ -5342,13 +5331,6 @@ __metadata:
53425331
languageName: node
53435332
linkType: hard
53445333

5345-
"@types/minimatch@npm:*":
5346-
version: 5.1.2
5347-
resolution: "@types/minimatch@npm:5.1.2"
5348-
checksum: 0391a282860c7cb6fe262c12b99564732401bdaa5e395bee9ca323c312c1a0f45efbf34dce974682036e857db59a5c9b1da522f3d6055aeead7097264c8705a8
5349-
languageName: node
5350-
linkType: hard
5351-
53525334
"@types/ms@npm:*":
53535335
version: 0.7.34
53545336
resolution: "@types/ms@npm:0.7.34"
@@ -11035,7 +11017,7 @@ __metadata:
1103511017
languageName: node
1103611018
linkType: hard
1103711019

11038-
"glob@npm:^10.0.0, glob@npm:^10.2.2, glob@npm:^10.3.10, glob@npm:^10.3.7":
11020+
"glob@npm:^10.2.2, glob@npm:^10.3.10, glob@npm:^10.3.7":
1103911021
version: 10.3.10
1104011022
resolution: "glob@npm:10.3.10"
1104111023
dependencies:
@@ -12915,15 +12897,14 @@ __metadata:
1291512897
"@babel/core": ^7.11.6
1291612898
"@jest/test-sequencer": "workspace:*"
1291712899
"@jest/types": "workspace:*"
12918-
"@types/glob": ^7.1.1
1291912900
"@types/graceful-fs": ^4.1.3
1292012901
"@types/micromatch": ^4.0.1
1292112902
"@types/parse-json": ^4.0.0
1292212903
babel-jest: "workspace:*"
1292312904
chalk: ^4.0.0
1292412905
ci-info: ^4.0.0
1292512906
deepmerge: ^4.2.2
12926-
glob: ^7.1.3
12907+
glob: ^10.3.10
1292712908
graceful-fs: ^4.2.9
1292812909
jest-circus: "workspace:*"
1292912910
jest-environment-node: "workspace:*"
@@ -13319,13 +13300,12 @@ __metadata:
1331913300
"@jest/test-utils": "workspace:*"
1332013301
"@jest/transform": "workspace:*"
1332113302
"@jest/types": "workspace:*"
13322-
"@types/glob": ^7.1.1
1332313303
"@types/graceful-fs": ^4.1.3
1332413304
"@types/node": "*"
1332513305
chalk: ^4.0.0
1332613306
cjs-module-lexer: ^1.0.0
1332713307
collect-v8-coverage: ^1.0.0
13328-
glob: ^7.1.3
13308+
glob: ^10.3.10
1332913309
graceful-fs: ^4.2.9
1333013310
jest-environment-node: "workspace:*"
1333113311
jest-haste-map: "workspace:*"

0 commit comments

Comments
 (0)