chore: bump unrs-resolver to 1.12.1, remove jest-pnp-resolver and unnecessary checks (#15721)

This commit is contained in:
JounQin
2026-05-19 08:24:24 +02:00
committed by GitHub
parent a9e8764dd2
commit c393ea3d4c
6 changed files with 129 additions and 145 deletions
+2
View File
@@ -4,6 +4,8 @@ enableGlobalCache: true
enableScripts: true
enableTelemetry: false
logFilters:
- code: YN0032
level: discard
+1
View File
@@ -4,6 +4,7 @@
- `[@jest/expect-utils, jest-mock]` Add `mockFn.whenCalledWith(...args)` for configuring return values per argument list, with first-class asymmetric-matcher support ([#16053](https://github.com/jestjs/jest/pull/16053))
- `[@jest/expect-utils]` Export `AsymmetricMatcher` and `FunctionParameters` types (previously private to `expect`) ([#16053](https://github.com/jestjs/jest/pull/16053))
- `[jest-resolve]` Bump `unrs-resolver` to 1.12.1, remove `jest-pnp-resolver` and unnecessary checks ([#15721](https://github.com/jestjs/jest/pull/15721))
### Fixes
@@ -9,5 +9,7 @@
it('should surface pnp errors', () => {
expect(() => {
require('undeclared');
}).toThrow(expect.objectContaining({code: 'MODULE_NOT_FOUND'}));
}).toThrow(
"undeclared tried to access unesitent_module__, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.",
);
});
+1 -2
View File
@@ -22,11 +22,10 @@
"chalk": "^4.1.2",
"graceful-fs": "^4.2.11",
"jest-haste-map": "workspace:*",
"jest-pnp-resolver": "^1.2.3",
"jest-util": "workspace:*",
"jest-validate": "workspace:*",
"slash": "^3.0.0",
"unrs-resolver": "^1.7.11"
"unrs-resolver": "^1.12.1"
},
"devDependencies": {
"@types/graceful-fs": "^4.1.9",
+1 -21
View File
@@ -6,8 +6,6 @@
*/
import {isBuiltin} from 'node:module';
import {fileURLToPath} from 'node:url';
import pnpResolver from 'jest-pnp-resolver';
import {
type ResolveResult,
ResolverFactory,
@@ -45,12 +43,6 @@ export interface ResolverOptions extends Omit<
paths?: ReadonlyArray<string>;
/** Current root directory. */
rootDir?: string;
/**
* @internal Whether to allow the `jest-pnp-resolver` to be used.
* @see https://github.com/arcanis/jest-pnp-resolver/blob/ae8e3992349f3b43d1476572e9315e14358e8944/index.js#L49
*/
allowPnp?: boolean;
}
export type SyncResolver = (path: string, options: ResolverOptions) => string;
@@ -79,23 +71,11 @@ function baseResolver(
options: ResolverOptions,
async?: true,
): string | Promise<string> {
// https://github.com/oxc-project/oxc-resolver/issues/565
// https://github.com/jestjs/jest/issues/15676
// `builtins` in `unrs-resolver` is static which could be wrong at runtime.
if (isBuiltin(path)) {
return path;
}
if (process.versions.pnp && options.allowPnp !== false) {
return pnpResolver(path, {
...options,
extensions: options.extensions as Array<string> | undefined,
});
}
if (path.startsWith('file://')) {
path = fileURLToPath(path);
}
/* eslint-disable prefer-const */
let {
basedir,
+121 -121
View File
@@ -3621,31 +3621,31 @@ __metadata:
languageName: node
linkType: hard
"@emnapi/core@npm:^1.4.3":
version: 1.4.3
resolution: "@emnapi/core@npm:1.4.3"
"@emnapi/core@npm:1.10.0":
version: 1.10.0
resolution: "@emnapi/core@npm:1.10.0"
dependencies:
"@emnapi/wasi-threads": "npm:1.0.2"
"@emnapi/wasi-threads": "npm:1.2.1"
tslib: "npm:^2.4.0"
checksum: 10/b511f66b897d2019835391544fdf11f4fa0ce06cc1181abfa17c7d4cf03aaaa4fc8a64fcd30bb3f901de488d0a6f370b53a8de2215a898f5a4ac98015265b3b7
checksum: 10/d32f386084e64deaf2609aabb8295d1ad5af6144d0f46d2060b76cc53f1f3b486df54bec9b0f33c37d85a3822e1193ebcd4e3deb4a5f0e4cd650aa2ffc631715
languageName: node
linkType: hard
"@emnapi/runtime@npm:^1.4.3":
version: 1.4.3
resolution: "@emnapi/runtime@npm:1.4.3"
"@emnapi/runtime@npm:1.10.0":
version: 1.10.0
resolution: "@emnapi/runtime@npm:1.10.0"
dependencies:
tslib: "npm:^2.4.0"
checksum: 10/4f90852a1a5912982cc4e176b6420556971bcf6a85ee23e379e2455066d616219751367dcf43e6a6eaf41ea7e95ba9dc830665a52b5d979dfe074237d19578f8
checksum: 10/d21083d07fa0c2da171c142e78ef986b66b07d45b06accc0bcaf49fcc61bb4dbc10e1c1760813070165b9f49b054376a931045347f21c0f42ff1eb2d2040faac
languageName: node
linkType: hard
"@emnapi/wasi-threads@npm:1.0.2":
version: 1.0.2
resolution: "@emnapi/wasi-threads@npm:1.0.2"
"@emnapi/wasi-threads@npm:1.2.1":
version: 1.2.1
resolution: "@emnapi/wasi-threads@npm:1.2.1"
dependencies:
tslib: "npm:^2.4.0"
checksum: 10/e82941776665eb958c2084728191d6b15a94383449975c4621b67a1c8217e1c0ec11056a693906c76863cb96f782f8be500510ecec6874e3f5da35a8e7968cfd
checksum: 10/57cd4292be81c05d26aa886d68a9e4c449ff666e8503fed6463dfc6b64a4e4213f03c152d53296b7cda32840271e38cd33347332070658f01befeb9bf4e59f36
languageName: node
linkType: hard
@@ -5138,14 +5138,15 @@ __metadata:
languageName: node
linkType: hard
"@napi-rs/wasm-runtime@npm:^0.2.11":
version: 0.2.12
resolution: "@napi-rs/wasm-runtime@npm:0.2.12"
"@napi-rs/wasm-runtime@npm:^1.1.4":
version: 1.1.4
resolution: "@napi-rs/wasm-runtime@npm:1.1.4"
dependencies:
"@emnapi/core": "npm:^1.4.3"
"@emnapi/runtime": "npm:^1.4.3"
"@tybys/wasm-util": "npm:^0.10.0"
checksum: 10/5fd518182427980c28bc724adf06c5f32f9a8915763ef560b5f7d73607d30cd15ac86d0cbd2eb80d4cfab23fc80d0876d89ca36a9daadcb864bc00917c94187c
"@tybys/wasm-util": "npm:^0.10.1"
peerDependencies:
"@emnapi/core": ^1.7.1
"@emnapi/runtime": ^1.7.1
checksum: 10/1db3dc7eeb981306b09360487bd8ce4dfa5588d273bd8ea9f07dccca1b4ade57b675414180fc9bb66966c6c50b17208b0263194993e2f7f92cc7af28bda4d1af
languageName: node
linkType: hard
@@ -6680,12 +6681,12 @@ __metadata:
languageName: node
linkType: hard
"@tybys/wasm-util@npm:^0.10.0":
version: 0.10.1
resolution: "@tybys/wasm-util@npm:0.10.1"
"@tybys/wasm-util@npm:^0.10.1":
version: 0.10.2
resolution: "@tybys/wasm-util@npm:0.10.2"
dependencies:
tslib: "npm:^2.4.0"
checksum: 10/7fe0d239397aebb002ac4855d30c197c06a05ea8df8511350a3a5b1abeefe26167c60eda8a5508337571161e4c4b53d7c1342296123f9607af8705369de9fa7f
checksum: 10/d12f1dafe12d7a573c406b35ffef0038042b9cc9fbcc74d657267eb635499b956276afc05eebdbd81bea582e1c4c921421a1dd7243a93daaa8c8216b19395c23
languageName: node
linkType: hard
@@ -7628,137 +7629,146 @@ __metadata:
languageName: node
linkType: hard
"@unrs/resolver-binding-android-arm-eabi@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-android-arm-eabi@npm:1.11.1"
"@unrs/resolver-binding-android-arm-eabi@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-android-arm-eabi@npm:1.12.1"
conditions: os=android & cpu=arm
languageName: node
linkType: hard
"@unrs/resolver-binding-android-arm64@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-android-arm64@npm:1.11.1"
"@unrs/resolver-binding-android-arm64@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-android-arm64@npm:1.12.1"
conditions: os=android & cpu=arm64
languageName: node
linkType: hard
"@unrs/resolver-binding-darwin-arm64@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-darwin-arm64@npm:1.11.1"
"@unrs/resolver-binding-darwin-arm64@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-darwin-arm64@npm:1.12.1"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard
"@unrs/resolver-binding-darwin-x64@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-darwin-x64@npm:1.11.1"
"@unrs/resolver-binding-darwin-x64@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-darwin-x64@npm:1.12.1"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard
"@unrs/resolver-binding-freebsd-x64@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-freebsd-x64@npm:1.11.1"
"@unrs/resolver-binding-freebsd-x64@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-freebsd-x64@npm:1.12.1"
conditions: os=freebsd & cpu=x64
languageName: node
linkType: hard
"@unrs/resolver-binding-linux-arm-gnueabihf@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-linux-arm-gnueabihf@npm:1.11.1"
"@unrs/resolver-binding-linux-arm-gnueabihf@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-linux-arm-gnueabihf@npm:1.12.1"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard
"@unrs/resolver-binding-linux-arm-musleabihf@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-linux-arm-musleabihf@npm:1.11.1"
"@unrs/resolver-binding-linux-arm-musleabihf@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-linux-arm-musleabihf@npm:1.12.1"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard
"@unrs/resolver-binding-linux-arm64-gnu@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-linux-arm64-gnu@npm:1.11.1"
"@unrs/resolver-binding-linux-arm64-gnu@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-linux-arm64-gnu@npm:1.12.1"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard
"@unrs/resolver-binding-linux-arm64-musl@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-linux-arm64-musl@npm:1.11.1"
"@unrs/resolver-binding-linux-arm64-musl@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-linux-arm64-musl@npm:1.12.1"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard
"@unrs/resolver-binding-linux-ppc64-gnu@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-linux-ppc64-gnu@npm:1.11.1"
"@unrs/resolver-binding-linux-ppc64-gnu@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-linux-ppc64-gnu@npm:1.12.1"
conditions: os=linux & cpu=ppc64 & libc=glibc
languageName: node
linkType: hard
"@unrs/resolver-binding-linux-riscv64-gnu@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-linux-riscv64-gnu@npm:1.11.1"
"@unrs/resolver-binding-linux-riscv64-gnu@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-linux-riscv64-gnu@npm:1.12.1"
conditions: os=linux & cpu=riscv64 & libc=glibc
languageName: node
linkType: hard
"@unrs/resolver-binding-linux-riscv64-musl@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-linux-riscv64-musl@npm:1.11.1"
"@unrs/resolver-binding-linux-riscv64-musl@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-linux-riscv64-musl@npm:1.12.1"
conditions: os=linux & cpu=riscv64 & libc=musl
languageName: node
linkType: hard
"@unrs/resolver-binding-linux-s390x-gnu@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-linux-s390x-gnu@npm:1.11.1"
"@unrs/resolver-binding-linux-s390x-gnu@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-linux-s390x-gnu@npm:1.12.1"
conditions: os=linux & cpu=s390x & libc=glibc
languageName: node
linkType: hard
"@unrs/resolver-binding-linux-x64-gnu@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-linux-x64-gnu@npm:1.11.1"
"@unrs/resolver-binding-linux-x64-gnu@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-linux-x64-gnu@npm:1.12.1"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard
"@unrs/resolver-binding-linux-x64-musl@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-linux-x64-musl@npm:1.11.1"
"@unrs/resolver-binding-linux-x64-musl@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-linux-x64-musl@npm:1.12.1"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard
"@unrs/resolver-binding-wasm32-wasi@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-wasm32-wasi@npm:1.11.1"
"@unrs/resolver-binding-openharmony-arm64@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-openharmony-arm64@npm:1.12.1"
conditions: os=openharmony & cpu=arm64
languageName: node
linkType: hard
"@unrs/resolver-binding-wasm32-wasi@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-wasm32-wasi@npm:1.12.1"
dependencies:
"@napi-rs/wasm-runtime": "npm:^0.2.11"
"@emnapi/core": "npm:1.10.0"
"@emnapi/runtime": "npm:1.10.0"
"@napi-rs/wasm-runtime": "npm:^1.1.4"
conditions: cpu=wasm32
languageName: node
linkType: hard
"@unrs/resolver-binding-win32-arm64-msvc@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-win32-arm64-msvc@npm:1.11.1"
"@unrs/resolver-binding-win32-arm64-msvc@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-win32-arm64-msvc@npm:1.12.1"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard
"@unrs/resolver-binding-win32-ia32-msvc@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-win32-ia32-msvc@npm:1.11.1"
"@unrs/resolver-binding-win32-ia32-msvc@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-win32-ia32-msvc@npm:1.12.1"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard
"@unrs/resolver-binding-win32-x64-msvc@npm:1.11.1":
version: 1.11.1
resolution: "@unrs/resolver-binding-win32-x64-msvc@npm:1.11.1"
"@unrs/resolver-binding-win32-x64-msvc@npm:1.12.1":
version: 1.12.1
resolution: "@unrs/resolver-binding-win32-x64-msvc@npm:1.12.1"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
@@ -14632,18 +14642,6 @@ __metadata:
languageName: unknown
linkType: soft
"jest-pnp-resolver@npm:^1.2.3":
version: 1.2.3
resolution: "jest-pnp-resolver@npm:1.2.3"
peerDependencies:
jest-resolve: "*"
peerDependenciesMeta:
jest-resolve:
optional: true
checksum: 10/db1a8ab2cb97ca19c01b1cfa9a9c8c69a143fde833c14df1fab0766f411b1148ff0df878adea09007ac6a2085ec116ba9a996a6ad104b1e58c20adbf88eed9b2
languageName: node
linkType: hard
"jest-preset-angular@npm:^16.0.0":
version: 16.0.0
resolution: "jest-preset-angular@npm:16.0.0"
@@ -14700,11 +14698,10 @@ __metadata:
chalk: "npm:^4.1.2"
graceful-fs: "npm:^4.2.11"
jest-haste-map: "workspace:*"
jest-pnp-resolver: "npm:^1.2.3"
jest-util: "workspace:*"
jest-validate: "workspace:*"
slash: "npm:^3.0.0"
unrs-resolver: "npm:^1.7.11"
unrs-resolver: "npm:^1.12.1"
url: "npm:^0.11.4"
languageName: unknown
linkType: soft
@@ -17132,7 +17129,7 @@ __metadata:
languageName: node
linkType: hard
"napi-postinstall@npm:^0.3.0":
"napi-postinstall@npm:^0.3.4":
version: 0.3.4
resolution: "napi-postinstall@npm:0.3.4"
bin:
@@ -22563,30 +22560,31 @@ __metadata:
languageName: node
linkType: hard
"unrs-resolver@npm:^1.7.11, unrs-resolver@npm:^1.9.2":
version: 1.11.1
resolution: "unrs-resolver@npm:1.11.1"
"unrs-resolver@npm:^1.12.1, unrs-resolver@npm:^1.7.11, unrs-resolver@npm:^1.9.2":
version: 1.12.1
resolution: "unrs-resolver@npm:1.12.1"
dependencies:
"@unrs/resolver-binding-android-arm-eabi": "npm:1.11.1"
"@unrs/resolver-binding-android-arm64": "npm:1.11.1"
"@unrs/resolver-binding-darwin-arm64": "npm:1.11.1"
"@unrs/resolver-binding-darwin-x64": "npm:1.11.1"
"@unrs/resolver-binding-freebsd-x64": "npm:1.11.1"
"@unrs/resolver-binding-linux-arm-gnueabihf": "npm:1.11.1"
"@unrs/resolver-binding-linux-arm-musleabihf": "npm:1.11.1"
"@unrs/resolver-binding-linux-arm64-gnu": "npm:1.11.1"
"@unrs/resolver-binding-linux-arm64-musl": "npm:1.11.1"
"@unrs/resolver-binding-linux-ppc64-gnu": "npm:1.11.1"
"@unrs/resolver-binding-linux-riscv64-gnu": "npm:1.11.1"
"@unrs/resolver-binding-linux-riscv64-musl": "npm:1.11.1"
"@unrs/resolver-binding-linux-s390x-gnu": "npm:1.11.1"
"@unrs/resolver-binding-linux-x64-gnu": "npm:1.11.1"
"@unrs/resolver-binding-linux-x64-musl": "npm:1.11.1"
"@unrs/resolver-binding-wasm32-wasi": "npm:1.11.1"
"@unrs/resolver-binding-win32-arm64-msvc": "npm:1.11.1"
"@unrs/resolver-binding-win32-ia32-msvc": "npm:1.11.1"
"@unrs/resolver-binding-win32-x64-msvc": "npm:1.11.1"
napi-postinstall: "npm:^0.3.0"
"@unrs/resolver-binding-android-arm-eabi": "npm:1.12.1"
"@unrs/resolver-binding-android-arm64": "npm:1.12.1"
"@unrs/resolver-binding-darwin-arm64": "npm:1.12.1"
"@unrs/resolver-binding-darwin-x64": "npm:1.12.1"
"@unrs/resolver-binding-freebsd-x64": "npm:1.12.1"
"@unrs/resolver-binding-linux-arm-gnueabihf": "npm:1.12.1"
"@unrs/resolver-binding-linux-arm-musleabihf": "npm:1.12.1"
"@unrs/resolver-binding-linux-arm64-gnu": "npm:1.12.1"
"@unrs/resolver-binding-linux-arm64-musl": "npm:1.12.1"
"@unrs/resolver-binding-linux-ppc64-gnu": "npm:1.12.1"
"@unrs/resolver-binding-linux-riscv64-gnu": "npm:1.12.1"
"@unrs/resolver-binding-linux-riscv64-musl": "npm:1.12.1"
"@unrs/resolver-binding-linux-s390x-gnu": "npm:1.12.1"
"@unrs/resolver-binding-linux-x64-gnu": "npm:1.12.1"
"@unrs/resolver-binding-linux-x64-musl": "npm:1.12.1"
"@unrs/resolver-binding-openharmony-arm64": "npm:1.12.1"
"@unrs/resolver-binding-wasm32-wasi": "npm:1.12.1"
"@unrs/resolver-binding-win32-arm64-msvc": "npm:1.12.1"
"@unrs/resolver-binding-win32-ia32-msvc": "npm:1.12.1"
"@unrs/resolver-binding-win32-x64-msvc": "npm:1.12.1"
napi-postinstall: "npm:^0.3.4"
dependenciesMeta:
"@unrs/resolver-binding-android-arm-eabi":
optional: true
@@ -22618,6 +22616,8 @@ __metadata:
optional: true
"@unrs/resolver-binding-linux-x64-musl":
optional: true
"@unrs/resolver-binding-openharmony-arm64":
optional: true
"@unrs/resolver-binding-wasm32-wasi":
optional: true
"@unrs/resolver-binding-win32-arm64-msvc":
@@ -22626,7 +22626,7 @@ __metadata:
optional: true
"@unrs/resolver-binding-win32-x64-msvc":
optional: true
checksum: 10/4de653508cbaae47883a896bd5cdfef0e5e87b428d62620d16fd35cd534beaebf08ebf0cf2f8b4922aa947b2fe745180facf6cc3f39ba364f7ce0f974cb06a70
checksum: 10/a0a02e947979cc0ad9d937f3a4e7b7992c0378017c49a0fe66b51dd332062961d06bd6bfb137d81fcecfc97b1b6112bc6a645471accc3f9784cdaf455837fe27
languageName: node
linkType: hard