Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add exports field to all package.jsons #9921

Merged
merged 2 commits into from Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
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
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