Skip to content

Commit

Permalink
chore: add exports field to all package.jsons (#9921)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored Nov 4, 2020
1 parent a82babd commit 6392dbd
Show file tree
Hide file tree
Showing 53 changed files with 319 additions and 102 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
### Chore & Maintenance

- `[*]` [**BREAKING**] Only support Node LTS releases and Node 15 ([#10685](https://github.com/facebook/jest/pull/10685))
- `[*]` [**BREAKING**] Add `exports` field to all `package.json`s ([#9921](https://github.com/facebook/jest/pull/9921))
- `[jest-resolve]` [**BREAKING**] Migrate to ESM ([#10688](https://github.com/facebook/jest/pull/10688))

### Performance
Expand Down
6 changes: 1 addition & 5 deletions e2e/custom-resolver/resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/

const {
default: defaultResolver,
} = require('jest-resolve/build/defaultResolver');

const exportedModules = new Map([
['foo', 'foo'],
['bar', 'bar'],
Expand All @@ -20,6 +16,6 @@ module.exports = (name, options) => {
if (resolution) {
return `${__dirname}/${resolution}.js`;
} else {
return defaultResolver(name, options);
return options.defaultResolver(name, options);
}
};
8 changes: 6 additions & 2 deletions packages/babel-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
"directory": "packages/babel-jest"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"dependencies": {
"@jest/transform": "^26.6.2",
"@jest/types": "^26.6.2",
Expand Down
8 changes: 6 additions & 2 deletions packages/babel-plugin-jest-hoist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"dependencies": {
"@babel/template": "^7.3.3",
"@babel/types": "^7.3.3",
Expand Down
6 changes: 5 additions & 1 deletion packages/babel-preset-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
"directory": "packages/babel-preset-jest"
},
"license": "MIT",
"main": "index.js",
"main": "./index.js",
"exports": {
".": "./index.js",
"./package.json": "./package.json"
},
"dependencies": {
"babel-plugin-jest-hoist": "^26.6.2",
"babel-preset-current-node-syntax": "^1.0.0"
Expand Down
8 changes: 6 additions & 2 deletions packages/diff-sequences/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
"engines": {
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
},
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"scripts": {
"perf": "node --expose-gc perf/index.js"
},
Expand Down
9 changes: 7 additions & 2 deletions packages/expect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
"directory": "packages/expect"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json",
"./build/utils": "./build/utils.js"
},
"dependencies": {
"@jest/types": "^26.6.2",
"ansi-styles": "^4.0.0",
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-changed-files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
"directory": "packages/jest-changed-files"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"dependencies": {
"@jest/types": "^26.6.2",
"execa": "^4.0.0",
Expand Down
9 changes: 7 additions & 2 deletions packages/jest-circus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
"directory": "packages/jest-circus"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json",
"./runner": "./runner.js"
},
"dependencies": {
"@babel/traverse": "^7.1.0",
"@jest/environment": "^26.6.2",
Expand Down
9 changes: 7 additions & 2 deletions packages/jest-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
"name": "jest-cli",
"description": "Delightful JavaScript Testing.",
"version": "26.6.3",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json",
"./bin/jest": "./bin/jest.js"
},
"dependencies": {
"@jest/core": "^26.6.3",
"@jest/test-result": "^26.6.2",
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
"directory": "packages/jest-config"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"peerDependencies": {
"ts-node": ">=9.0.0"
},
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
"directory": "packages/jest-console"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"dependencies": {
"@jest/types": "^26.6.2",
"@types/node": "*",
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
"name": "@jest/core",
"description": "Delightful JavaScript Testing.",
"version": "26.6.3",
"main": "build/jest.js",
"types": "build/jest.d.ts",
"main": "./build/jest.js",
"types": "./build/jest.d.ts",
"exports": {
".": "./build/jest.js",
"./package.json": "./package.json"
},
"dependencies": {
"@jest/console": "^26.6.2",
"@jest/reporters": "^26.6.2",
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-create-cache-key-function/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"publishConfig": {
"access": "public"
}
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-diff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
"directory": "packages/jest-diff"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"dependencies": {
"chalk": "^4.0.0",
"diff-sequences": "^26.6.2",
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-docblock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
"directory": "packages/jest-docblock"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"dependencies": {
"detect-newline": "^3.0.0"
},
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-each/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
"name": "jest-each",
"version": "26.6.2",
"description": "Parameterised tests for Jest",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/jest.git",
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-environment-jsdom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
"directory": "packages/jest-environment-jsdom"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"dependencies": {
"@jest/environment": "^26.6.2",
"@jest/fake-timers": "^26.6.2",
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-environment-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
"directory": "packages/jest-environment-node"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"dependencies": {
"@jest/environment": "^26.6.2",
"@jest/fake-timers": "^26.6.2",
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-environment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
"directory": "packages/jest-environment"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"dependencies": {
"@jest/fake-timers": "^26.6.2",
"@jest/types": "^26.6.2",
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-fake-timers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
"directory": "packages/jest-fake-timers"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"dependencies": {
"@jest/types": "^26.6.2",
"@sinonjs/fake-timers": "^6.0.1",
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-get-type/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"publishConfig": {
"access": "public"
}
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-globals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"dependencies": {
"@jest/environment": "^26.6.2",
"@jest/types": "^26.6.2",
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-haste-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
"directory": "packages/jest-haste-map"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"dependencies": {
"@jest/types": "^26.6.2",
"@types/graceful-fs": "^4.1.2",
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-jasmine2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
"directory": "packages/jest-jasmine2"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"dependencies": {
"@babel/traverse": "^7.1.0",
"@jest/environment": "^26.6.2",
Expand Down
8 changes: 6 additions & 2 deletions packages/jest-leak-detector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
"directory": "packages/jest-leak-detector"
},
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"dependencies": {
"jest-get-type": "^26.3.0",
"pretty-format": "^26.6.2"
Expand Down
Loading

0 comments on commit 6392dbd

Please sign in to comment.