Skip to content

Commit

Permalink
bump resolve.exports
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Oct 15, 2021
1 parent 7ed7ec9 commit 135e19b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 26 deletions.
2 changes: 1 addition & 1 deletion e2e/resolve-conditions/package.json
Expand Up @@ -13,6 +13,6 @@
"transform": {}
},
"dependencies": {
"resolve.exports": "^1.0.2"
"resolve.exports": "^1.1.0"
}
}
8 changes: 1 addition & 7 deletions e2e/resolve-conditions/resolver.js
Expand Up @@ -24,13 +24,7 @@ function createPathFilter(conditions) {
const path = relativePath === 'index' ? '.' : relativePath;

return (
resolveExports(pkg, path, {
// `resolve.exports` adds `node` unless `browser` is `true`, so let's add this ugly thing
browser: conditions.includes('browser'),
conditions,
// `resolve.exports` adds `import` unless `require` is `true`, so let's add this ugly thing
require: conditions.includes('require'),
}) || relativePath
resolveExports(pkg, path, {conditions, unsafe: true}) || relativePath
);
};
}
10 changes: 5 additions & 5 deletions e2e/resolve-conditions/yarn.lock
Expand Up @@ -5,17 +5,17 @@ __metadata:
version: 4
cacheKey: 7

"resolve.exports@npm:^1.0.2":
version: 1.0.2
resolution: "resolve.exports@npm:1.0.2"
checksum: 012a46e3ae41c53762abf5b50ea1b4adf2de617bbea1dbc7bf6e609c1ceaedee7782acbc92d443951d5dd0c3a8fb1090ce73285a9ccc24b530e33b5e09ae196f
"resolve.exports@npm:^1.1.0":
version: 1.1.0
resolution: "resolve.exports@npm:1.1.0"
checksum: d04d2ce651fac14fe6ba13b377690f790cbbe91e6211b8fbec97ee08282e278875c74073a9b6243143a64e33d95eefb479e1dd4965664edc73b28b712100b36c
languageName: node
linkType: hard

"root-workspace-0b6124@workspace:.":
version: 0.0.0-use.local
resolution: "root-workspace-0b6124@workspace:."
dependencies:
resolve.exports: ^1.0.2
resolve.exports: ^1.1.0
languageName: unknown
linkType: soft
2 changes: 1 addition & 1 deletion packages/jest-resolve/package.json
Expand Up @@ -23,7 +23,7 @@
"jest-util": "^27.2.5",
"jest-validate": "^27.2.5",
"resolve": "^1.20.0",
"resolve.exports": "^1.0.2",
"resolve.exports": "^1.1.0",
"slash": "^3.0.0"
},
"devDependencies": {
Expand Down
8 changes: 1 addition & 7 deletions packages/jest-resolve/src/defaultResolver.ts
Expand Up @@ -158,13 +158,7 @@ function readPackageSync(_: unknown, file: Config.Path): PkgJson {

function createPackageFilter(conditions?: Array<string>) {
const options: ResolveExportsOptions = conditions
? {
// `resolve.exports` adds `node` unless `browser` is `true`, so let's add this ugly thing
browser: conditions.includes('browser'),
conditions,
// `resolve.exports` adds `import` unless `require` is `true`, so let's add this ugly thing
require: conditions.includes('require'),
}
? {conditions, unsafe: true}
: // no conditions were passed - let's assume this is Jest internal and it should be `require`
{browser: false, require: true};

Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Expand Up @@ -13027,7 +13027,7 @@ fsevents@^1.2.7:
jest-util: ^27.2.5
jest-validate: ^27.2.5
resolve: ^1.20.0
resolve.exports: ^1.0.2
resolve.exports: ^1.1.0
slash: ^3.0.0
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -18946,10 +18946,10 @@ react-native@0.64.0:
languageName: node
linkType: hard

"resolve.exports@npm:^1.0.2":
version: 1.0.2
resolution: "resolve.exports@npm:1.0.2"
checksum: 012a46e3ae41c53762abf5b50ea1b4adf2de617bbea1dbc7bf6e609c1ceaedee7782acbc92d443951d5dd0c3a8fb1090ce73285a9ccc24b530e33b5e09ae196f
"resolve.exports@npm:^1.1.0":
version: 1.1.0
resolution: "resolve.exports@npm:1.1.0"
checksum: d04d2ce651fac14fe6ba13b377690f790cbbe91e6211b8fbec97ee08282e278875c74073a9b6243143a64e33d95eefb479e1dd4965664edc73b28b712100b36c
languageName: node
linkType: hard

Expand Down

0 comments on commit 135e19b

Please sign in to comment.