Skip to content

Commit

Permalink
chore: add exports field to all packages
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Nov 4, 2020
1 parent 30b6cee commit 193ea25
Show file tree
Hide file tree
Showing 53 changed files with 319 additions and 102 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -11,6 +11,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))

### Performance

Expand Down
6 changes: 1 addition & 5 deletions e2e/custom-resolver/resolver.js
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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

0 comments on commit 193ea25

Please sign in to comment.