Skip to content

Commit 298388b

Browse files
committed
chore: bump rspack-resolver
1 parent 02a2649 commit 298388b

File tree

5 files changed

+73
-84
lines changed

5 files changed

+73
-84
lines changed

.size-limit.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[
22
{
33
"path": "./lib/index.js",
4-
"limit": "1.4kB"
4+
"limit": "1.5kB"
55
}
66
]

package.json

+5-8
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@
1919
"exports": {
2020
".": {
2121
"types": "./lib/index.d.ts",
22-
"import": "./lib/index.js",
23-
"require": "./lib/index.cjs"
22+
"require": "./lib/index.cjs",
23+
"default": "./lib/index.js"
2424
},
2525
"./package.json": "./package.json"
2626
},
2727
"types": "lib/index.d.ts",
2828
"files": [
2929
"lib",
30-
"shim.d.ts",
3130
"!**/*.tsbuildinfo"
3231
],
3332
"keywords": [
@@ -39,9 +38,9 @@
3938
],
4039
"scripts": {
4140
"build": "run-p -c 'build:*'",
42-
"build:r": "r -f cjs,es2020",
41+
"build:r": "r -f cjs",
4342
"build:ts": "tsc -b",
44-
"eslint": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint --cache",
43+
"eslint": "ESLINT_USE_FLAT_CONFIG=false eslint --cache",
4544
"lint": "run-p 'lint:*'",
4645
"lint:es": "eslint . --cache",
4746
"lint:tsc": "tsc --noEmit",
@@ -80,7 +79,7 @@
8079
"debug": "^4.4.0",
8180
"get-tsconfig": "^4.10.0",
8281
"is-bun-module": "^1.3.0",
83-
"rspack-resolver": "^1.1.0",
82+
"rspack-resolver": "^1.1.2",
8483
"stable-hash": "^0.0.5",
8584
"tinyglobby": "^0.2.12"
8685
},
@@ -97,7 +96,6 @@
9796
"@types/pnpapi": "^0.0.5",
9897
"@types/unist": "^3.0.3",
9998
"clean-pkg-json": "^1.2.1",
100-
"cross-env": "^7.0.3",
10199
"dummy.js": "link:dummy.js",
102100
"eslint": "^9.22.0",
103101
"eslint-import-resolver-typescript": "link:.",
@@ -110,7 +108,6 @@
110108
"size-limit": "^11.2.0",
111109
"size-limit-preset-node-lib": "^0.3.0",
112110
"type-coverage": "^2.29.7",
113-
"type-fest": "^4.37.0",
114111
"typescript": "~5.8.2",
115112
"yarn-berry-deduplicate": "^6.1.1"
116113
},

src/index.ts

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isBuiltin } from 'node:module'
1+
import module from 'node:module'
22
import path from 'node:path'
33

44
import type { ResolvedResult } from 'eslint-plugin-import-x/types.js'
@@ -10,7 +10,7 @@ import {
1010
} from 'get-tsconfig'
1111
import { type Version, isBunModule } from 'is-bun-module'
1212
import { ResolverFactory } from 'rspack-resolver'
13-
import stableHash_ from 'stable-hash'
13+
import { stableHash } from 'stable-hash'
1414

1515
import { IMPORT_RESOLVER_NAME, JS_EXT_PATTERN } from './constants.js'
1616
import {
@@ -27,9 +27,6 @@ export * from './helpers.js'
2727
export * from './normalize-options.js'
2828
export type * from './types.js'
2929

30-
// CJS <-> ESM interop
31-
const stableHash = 'default' in stableHash_ ? stableHash_.default : stableHash_
32-
3330
const resolverCache = new Map<string, ResolverFactory>()
3431

3532
const tsconfigCache = new Map<string, TsConfigJsonResolved>()
@@ -65,7 +62,7 @@ export const resolve = (
6562
): ResolvedResult => {
6663
// don't worry about core node/bun modules
6764
if (
68-
isBuiltin(source) ||
65+
module.isBuiltin(source) ||
6966
(process.versions.bun &&
7067
isBunModule(source, process.versions.bun as Version))
7168
) {
@@ -77,6 +74,17 @@ export const resolve = (
7774
}
7875
}
7976

77+
if (process.versions.pnp && source === 'pnpapi') {
78+
return {
79+
found: true,
80+
path: module.findPnpApi(file).resolveToUnqualified(source, file, {
81+
considerBuiltins: false,
82+
}),
83+
}
84+
}
85+
86+
source = removeQuerystring(source)
87+
8088
options ||= {}
8189

8290
if (!resolver) {
@@ -91,8 +99,6 @@ export const resolve = (
9199
resolver = cached
92100
}
93101

94-
source = removeQuerystring(source)
95-
96102
options ||= {}
97103

98104
// eslint-disable-next-line sonarjs/label-position, sonarjs/no-labels

src/normalize-options.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { TsconfigOptions } from 'oxc-resolver'
1+
import type { TsconfigOptions } from 'rspack-resolver'
22
import { globSync, isDynamicPattern } from 'tinyglobby'
33

44
import {

yarn.lock

+52-66
Original file line numberDiff line numberDiff line change
@@ -4248,81 +4248,81 @@ __metadata:
42484248
languageName: node
42494249
linkType: hard
42504250

4251-
"@unrs/rspack-resolver-binding-darwin-arm64@npm:1.1.0":
4252-
version: 1.1.0
4253-
resolution: "@unrs/rspack-resolver-binding-darwin-arm64@npm:1.1.0"
4251+
"@unrs/rspack-resolver-binding-darwin-arm64@npm:1.1.2":
4252+
version: 1.1.2
4253+
resolution: "@unrs/rspack-resolver-binding-darwin-arm64@npm:1.1.2"
42544254
conditions: os=darwin & cpu=arm64
42554255
languageName: node
42564256
linkType: hard
42574257

4258-
"@unrs/rspack-resolver-binding-darwin-x64@npm:1.1.0":
4259-
version: 1.1.0
4260-
resolution: "@unrs/rspack-resolver-binding-darwin-x64@npm:1.1.0"
4258+
"@unrs/rspack-resolver-binding-darwin-x64@npm:1.1.2":
4259+
version: 1.1.2
4260+
resolution: "@unrs/rspack-resolver-binding-darwin-x64@npm:1.1.2"
42614261
conditions: os=darwin & cpu=x64
42624262
languageName: node
42634263
linkType: hard
42644264

4265-
"@unrs/rspack-resolver-binding-freebsd-x64@npm:1.1.0":
4266-
version: 1.1.0
4267-
resolution: "@unrs/rspack-resolver-binding-freebsd-x64@npm:1.1.0"
4265+
"@unrs/rspack-resolver-binding-freebsd-x64@npm:1.1.2":
4266+
version: 1.1.2
4267+
resolution: "@unrs/rspack-resolver-binding-freebsd-x64@npm:1.1.2"
42684268
conditions: os=freebsd & cpu=x64
42694269
languageName: node
42704270
linkType: hard
42714271

4272-
"@unrs/rspack-resolver-binding-linux-arm-gnueabihf@npm:1.1.0":
4273-
version: 1.1.0
4274-
resolution: "@unrs/rspack-resolver-binding-linux-arm-gnueabihf@npm:1.1.0"
4272+
"@unrs/rspack-resolver-binding-linux-arm-gnueabihf@npm:1.1.2":
4273+
version: 1.1.2
4274+
resolution: "@unrs/rspack-resolver-binding-linux-arm-gnueabihf@npm:1.1.2"
42754275
conditions: os=linux & cpu=arm
42764276
languageName: node
42774277
linkType: hard
42784278

4279-
"@unrs/rspack-resolver-binding-linux-arm64-gnu@npm:1.1.0":
4280-
version: 1.1.0
4281-
resolution: "@unrs/rspack-resolver-binding-linux-arm64-gnu@npm:1.1.0"
4279+
"@unrs/rspack-resolver-binding-linux-arm64-gnu@npm:1.1.2":
4280+
version: 1.1.2
4281+
resolution: "@unrs/rspack-resolver-binding-linux-arm64-gnu@npm:1.1.2"
42824282
conditions: os=linux & cpu=arm64 & libc=glibc
42834283
languageName: node
42844284
linkType: hard
42854285

4286-
"@unrs/rspack-resolver-binding-linux-arm64-musl@npm:1.1.0":
4287-
version: 1.1.0
4288-
resolution: "@unrs/rspack-resolver-binding-linux-arm64-musl@npm:1.1.0"
4286+
"@unrs/rspack-resolver-binding-linux-arm64-musl@npm:1.1.2":
4287+
version: 1.1.2
4288+
resolution: "@unrs/rspack-resolver-binding-linux-arm64-musl@npm:1.1.2"
42894289
conditions: os=linux & cpu=arm64 & libc=musl
42904290
languageName: node
42914291
linkType: hard
42924292

4293-
"@unrs/rspack-resolver-binding-linux-x64-gnu@npm:1.1.0":
4294-
version: 1.1.0
4295-
resolution: "@unrs/rspack-resolver-binding-linux-x64-gnu@npm:1.1.0"
4293+
"@unrs/rspack-resolver-binding-linux-x64-gnu@npm:1.1.2":
4294+
version: 1.1.2
4295+
resolution: "@unrs/rspack-resolver-binding-linux-x64-gnu@npm:1.1.2"
42964296
conditions: os=linux & cpu=x64 & libc=glibc
42974297
languageName: node
42984298
linkType: hard
42994299

4300-
"@unrs/rspack-resolver-binding-linux-x64-musl@npm:1.1.0":
4301-
version: 1.1.0
4302-
resolution: "@unrs/rspack-resolver-binding-linux-x64-musl@npm:1.1.0"
4300+
"@unrs/rspack-resolver-binding-linux-x64-musl@npm:1.1.2":
4301+
version: 1.1.2
4302+
resolution: "@unrs/rspack-resolver-binding-linux-x64-musl@npm:1.1.2"
43034303
conditions: os=linux & cpu=x64 & libc=musl
43044304
languageName: node
43054305
linkType: hard
43064306

4307-
"@unrs/rspack-resolver-binding-wasm32-wasi@npm:1.1.0":
4308-
version: 1.1.0
4309-
resolution: "@unrs/rspack-resolver-binding-wasm32-wasi@npm:1.1.0"
4307+
"@unrs/rspack-resolver-binding-wasm32-wasi@npm:1.1.2":
4308+
version: 1.1.2
4309+
resolution: "@unrs/rspack-resolver-binding-wasm32-wasi@npm:1.1.2"
43104310
dependencies:
43114311
"@napi-rs/wasm-runtime": "npm:^0.2.7"
43124312
conditions: cpu=wasm32
43134313
languageName: node
43144314
linkType: hard
43154315

4316-
"@unrs/rspack-resolver-binding-win32-arm64-msvc@npm:1.1.0":
4317-
version: 1.1.0
4318-
resolution: "@unrs/rspack-resolver-binding-win32-arm64-msvc@npm:1.1.0"
4316+
"@unrs/rspack-resolver-binding-win32-arm64-msvc@npm:1.1.2":
4317+
version: 1.1.2
4318+
resolution: "@unrs/rspack-resolver-binding-win32-arm64-msvc@npm:1.1.2"
43194319
conditions: os=win32 & cpu=arm64
43204320
languageName: node
43214321
linkType: hard
43224322

4323-
"@unrs/rspack-resolver-binding-win32-x64-msvc@npm:1.1.0":
4324-
version: 1.1.0
4325-
resolution: "@unrs/rspack-resolver-binding-win32-x64-msvc@npm:1.1.0"
4323+
"@unrs/rspack-resolver-binding-win32-x64-msvc@npm:1.1.2":
4324+
version: 1.1.2
4325+
resolution: "@unrs/rspack-resolver-binding-win32-x64-msvc@npm:1.1.2"
43264326
conditions: os=win32 & cpu=x64
43274327
languageName: node
43284328
linkType: hard
@@ -5886,19 +5886,7 @@ __metadata:
58865886
languageName: node
58875887
linkType: hard
58885888

5889-
"cross-env@npm:^7.0.3":
5890-
version: 7.0.3
5891-
resolution: "cross-env@npm:7.0.3"
5892-
dependencies:
5893-
cross-spawn: "npm:^7.0.1"
5894-
bin:
5895-
cross-env: src/bin/cross-env.js
5896-
cross-env-shell: src/bin/cross-env-shell.js
5897-
checksum: 10/e99911f0d31c20e990fd92d6fd001f4b01668a303221227cc5cb42ed155f086351b1b3bd2699b200e527ab13011b032801f8ce638e6f09f854bdf744095e604c
5898-
languageName: node
5899-
linkType: hard
5900-
5901-
"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.1, cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.5, cross-spawn@npm:^7.0.6":
5889+
"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.5, cross-spawn@npm:^7.0.6":
59025890
version: 7.0.6
59035891
resolution: "cross-spawn@npm:7.0.6"
59045892
dependencies:
@@ -6703,7 +6691,6 @@ __metadata:
67036691
"@types/pnpapi": "npm:^0.0.5"
67046692
"@types/unist": "npm:^3.0.3"
67056693
clean-pkg-json: "npm:^1.2.1"
6706-
cross-env: "npm:^7.0.3"
67076694
debug: "npm:^4.4.0"
67086695
dummy.js: "link:dummy.js"
67096696
eslint: "npm:^9.22.0"
@@ -6715,14 +6702,13 @@ __metadata:
67156702
npm-run-all2: "npm:^7.0.2"
67166703
prettier: "npm:^3.5.3"
67176704
react: "npm:^19.0.0"
6718-
rspack-resolver: "npm:^1.1.0"
6705+
rspack-resolver: "npm:^1.1.2"
67196706
simple-git-hooks: "npm:^2.11.1"
67206707
size-limit: "npm:^11.2.0"
67216708
size-limit-preset-node-lib: "npm:^0.3.0"
67226709
stable-hash: "npm:^0.0.5"
67236710
tinyglobby: "npm:^0.2.12"
67246711
type-coverage: "npm:^2.29.7"
6725-
type-fest: "npm:^4.37.0"
67266712
typescript: "npm:~5.8.2"
67276713
yarn-berry-deduplicate: "npm:^6.1.1"
67286714
peerDependencies:
@@ -13221,21 +13207,21 @@ __metadata:
1322113207
languageName: node
1322213208
linkType: hard
1322313209

13224-
"rspack-resolver@npm:^1.1.0":
13225-
version: 1.1.0
13226-
resolution: "rspack-resolver@npm:1.1.0"
13227-
dependencies:
13228-
"@unrs/rspack-resolver-binding-darwin-arm64": "npm:1.1.0"
13229-
"@unrs/rspack-resolver-binding-darwin-x64": "npm:1.1.0"
13230-
"@unrs/rspack-resolver-binding-freebsd-x64": "npm:1.1.0"
13231-
"@unrs/rspack-resolver-binding-linux-arm-gnueabihf": "npm:1.1.0"
13232-
"@unrs/rspack-resolver-binding-linux-arm64-gnu": "npm:1.1.0"
13233-
"@unrs/rspack-resolver-binding-linux-arm64-musl": "npm:1.1.0"
13234-
"@unrs/rspack-resolver-binding-linux-x64-gnu": "npm:1.1.0"
13235-
"@unrs/rspack-resolver-binding-linux-x64-musl": "npm:1.1.0"
13236-
"@unrs/rspack-resolver-binding-wasm32-wasi": "npm:1.1.0"
13237-
"@unrs/rspack-resolver-binding-win32-arm64-msvc": "npm:1.1.0"
13238-
"@unrs/rspack-resolver-binding-win32-x64-msvc": "npm:1.1.0"
13210+
"rspack-resolver@npm:^1.1.0, rspack-resolver@npm:^1.1.2":
13211+
version: 1.1.2
13212+
resolution: "rspack-resolver@npm:1.1.2"
13213+
dependencies:
13214+
"@unrs/rspack-resolver-binding-darwin-arm64": "npm:1.1.2"
13215+
"@unrs/rspack-resolver-binding-darwin-x64": "npm:1.1.2"
13216+
"@unrs/rspack-resolver-binding-freebsd-x64": "npm:1.1.2"
13217+
"@unrs/rspack-resolver-binding-linux-arm-gnueabihf": "npm:1.1.2"
13218+
"@unrs/rspack-resolver-binding-linux-arm64-gnu": "npm:1.1.2"
13219+
"@unrs/rspack-resolver-binding-linux-arm64-musl": "npm:1.1.2"
13220+
"@unrs/rspack-resolver-binding-linux-x64-gnu": "npm:1.1.2"
13221+
"@unrs/rspack-resolver-binding-linux-x64-musl": "npm:1.1.2"
13222+
"@unrs/rspack-resolver-binding-wasm32-wasi": "npm:1.1.2"
13223+
"@unrs/rspack-resolver-binding-win32-arm64-msvc": "npm:1.1.2"
13224+
"@unrs/rspack-resolver-binding-win32-x64-msvc": "npm:1.1.2"
1323913225
dependenciesMeta:
1324013226
"@unrs/rspack-resolver-binding-darwin-arm64":
1324113227
optional: true
@@ -13259,7 +13245,7 @@ __metadata:
1325913245
optional: true
1326013246
"@unrs/rspack-resolver-binding-win32-x64-msvc":
1326113247
optional: true
13262-
checksum: 10/b8582e0d28596ba9ed8a4cd19b04b6e96e0e0963cdc0d5f365fc7d46335e5bbdb44ef433c2e0a560dedb3f4cd55cc13788f1d3b223f83cf4a3a7f8550b96e305
13248+
checksum: 10/116fadb51a778560a079d82874e85d519a82f54987992fbde766c912597c347f5517cd7f8223bcc2658e742b8cd4f3beb5d994a48b0fbbe4818af75dcf994481
1326313249
languageName: node
1326413250
linkType: hard
1326513251

@@ -14340,7 +14326,7 @@ __metadata:
1434014326
languageName: node
1434114327
linkType: hard
1434214328

14343-
"type-fest@npm:4.37.0, type-fest@npm:^4.37.0, type-fest@npm:^4.6.0, type-fest@npm:^4.7.1, type-fest@npm:^4.8.2":
14329+
"type-fest@npm:4.37.0, type-fest@npm:^4.6.0, type-fest@npm:^4.7.1, type-fest@npm:^4.8.2":
1434414330
version: 4.37.0
1434514331
resolution: "type-fest@npm:4.37.0"
1434614332
checksum: 10/882cf05374d7c635cbbbc50cb89863dad3d27a77c426d062144ba32b23a44087193213c5bbd64f3ab8be04215005c950286567be06fecca9d09c66abd290ef01

0 commit comments

Comments
 (0)