Skip to content

Commit 4d0cf1a

Browse files
committed
chore: add exports field to all packages
1 parent 6bd96a0 commit 4d0cf1a

File tree

53 files changed

+367
-196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+367
-196
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
### Chore & Maintenance
88

9+
- `[*]` [**BREAKING**] Add `exports` field to all `package.json`s ([#9921](https://github.com/facebook/jest/pull/9921))
10+
911
### Performance
1012

1113
## 26.6.2

e2e/custom-resolver/resolver.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
const {
9-
default: defaultResolver,
10-
} = require('jest-resolve/build/defaultResolver');
11-
128
const exportedModules = new Map([
139
['foo', 'foo'],
1410
['bar', 'bar'],
@@ -20,6 +16,6 @@ module.exports = (name, options) => {
2016
if (resolution) {
2117
return `${__dirname}/${resolution}.js`;
2218
} else {
23-
return defaultResolver(name, options);
19+
return options.defaultResolver(name, options);
2420
}
2521
};

packages/babel-jest/package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88
"directory": "packages/babel-jest"
99
},
1010
"license": "MIT",
11-
"main": "build/index.js",
12-
"types": "build/index.d.ts",
11+
"main": "./build/index.js",
12+
"types": "./build/index.d.ts",
13+
"exports": {
14+
".": "./build/index.js",
15+
"./package.json": "./package.json"
16+
},
1317
"dependencies": {
1418
"@jest/transform": "^26.6.2",
1519
"@jest/types": "^26.6.2",
@@ -33,6 +37,5 @@
3337
},
3438
"publishConfig": {
3539
"access": "public"
36-
},
37-
"gitHead": "170eee11d03b0ed5c60077982fdbc3bafd403638"
40+
}
3841
}

packages/babel-plugin-jest-hoist/package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@
1010
"node": ">= 10.14.2"
1111
},
1212
"license": "MIT",
13-
"main": "build/index.js",
14-
"types": "build/index.d.ts",
13+
"main": "./build/index.js",
14+
"types": "./build/index.d.ts",
15+
"exports": {
16+
".": "./build/index.js",
17+
"./package.json": "./package.json"
18+
},
1519
"dependencies": {
1620
"@babel/template": "^7.3.3",
1721
"@babel/types": "^7.3.3",
@@ -29,6 +33,5 @@
2933
},
3034
"publishConfig": {
3135
"access": "public"
32-
},
33-
"gitHead": "170eee11d03b0ed5c60077982fdbc3bafd403638"
36+
}
3437
}

packages/babel-preset-jest/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
"directory": "packages/babel-preset-jest"
88
},
99
"license": "MIT",
10-
"main": "index.js",
10+
"main": "./index.js",
11+
"exports": {
12+
".": "./index.js",
13+
"./package.json": "./package.json"
14+
},
1115
"dependencies": {
1216
"babel-plugin-jest-hoist": "^26.6.2",
1317
"babel-preset-current-node-syntax": "^1.0.0"
@@ -20,6 +24,5 @@
2024
},
2125
"publishConfig": {
2226
"access": "public"
23-
},
24-
"gitHead": "170eee11d03b0ed5c60077982fdbc3bafd403638"
27+
}
2528
}

packages/diff-sequences/package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@
1818
"engines": {
1919
"node": ">= 10.14.2"
2020
},
21-
"main": "build/index.js",
22-
"types": "build/index.d.ts",
21+
"main": "./build/index.js",
22+
"types": "./build/index.d.ts",
23+
"exports": {
24+
".": "./build/index.js",
25+
"./package.json": "./package.json"
26+
},
2327
"scripts": {
2428
"perf": "node --expose-gc perf/index.js"
2529
},
@@ -30,6 +34,5 @@
3034
},
3135
"publishConfig": {
3236
"access": "public"
33-
},
34-
"gitHead": "170eee11d03b0ed5c60077982fdbc3bafd403638"
37+
}
3538
}

packages/expect/package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@
77
"directory": "packages/expect"
88
},
99
"license": "MIT",
10-
"main": "build/index.js",
11-
"types": "build/index.d.ts",
10+
"main": "./build/index.js",
11+
"types": "./build/index.d.ts",
12+
"exports": {
13+
".": "./build/index.js",
14+
"./package.json": "./package.json",
15+
"./build/utils": "./build/utils.js"
16+
},
1217
"dependencies": {
1318
"@jest/types": "^26.6.2",
1419
"ansi-styles": "^4.0.0",
@@ -28,6 +33,5 @@
2833
},
2934
"publishConfig": {
3035
"access": "public"
31-
},
32-
"gitHead": "170eee11d03b0ed5c60077982fdbc3bafd403638"
36+
}
3337
}

packages/jest-changed-files/package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
"directory": "packages/jest-changed-files"
88
},
99
"license": "MIT",
10-
"main": "build/index.js",
11-
"types": "build/index.d.ts",
10+
"main": "./build/index.js",
11+
"types": "./build/index.d.ts",
12+
"exports": {
13+
".": "./build/index.js",
14+
"./package.json": "./package.json"
15+
},
1216
"dependencies": {
1317
"@jest/types": "^26.6.2",
1418
"execa": "^4.0.0",
@@ -19,6 +23,5 @@
1923
},
2024
"publishConfig": {
2125
"access": "public"
22-
},
23-
"gitHead": "170eee11d03b0ed5c60077982fdbc3bafd403638"
26+
}
2427
}

packages/jest-circus/package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@
77
"directory": "packages/jest-circus"
88
},
99
"license": "MIT",
10-
"main": "build/index.js",
11-
"types": "build/index.d.ts",
10+
"main": "./build/index.js",
11+
"types": "./build/index.d.ts",
12+
"exports": {
13+
".": "./build/index.js",
14+
"./package.json": "./package.json",
15+
"./runner": "./runner.js"
16+
},
1217
"dependencies": {
1318
"@babel/traverse": "^7.1.0",
1419
"@jest/environment": "^26.6.2",
@@ -50,6 +55,5 @@
5055
},
5156
"publishConfig": {
5257
"access": "public"
53-
},
54-
"gitHead": "170eee11d03b0ed5c60077982fdbc3bafd403638"
58+
}
5559
}

packages/jest-cli/package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
"name": "jest-cli",
33
"description": "Delightful JavaScript Testing.",
44
"version": "26.6.2",
5-
"main": "build/index.js",
6-
"types": "build/index.d.ts",
5+
"main": "./build/index.js",
6+
"types": "./build/index.d.ts",
7+
"exports": {
8+
".": "./build/index.js",
9+
"./package.json": "./package.json",
10+
"./bin/jest": "./bin/jest.js"
11+
},
712
"dependencies": {
813
"@jest/core": "^26.6.2",
914
"@jest/test-result": "^26.6.2",
@@ -71,6 +76,5 @@
7176
],
7277
"publishConfig": {
7378
"access": "public"
74-
},
75-
"gitHead": "170eee11d03b0ed5c60077982fdbc3bafd403638"
79+
}
7680
}

0 commit comments

Comments
 (0)