Skip to content

Commit b015ca2

Browse files
authored
perf: switch to empathic find package traversal (#1053)
* perf: switch to `empathic` find package traversal Uses `empathic/find` for finding the closest `package.json`, a much faster and smaller library than the various over-specialised alternatives lying around. * chore: bump empathic
1 parent 6fe6e9c commit b015ca2

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"node": "^18.20.0 || ^20.10.0 || >=22.0.0"
1111
},
1212
"dependencies": {
13-
"find-up": "^5.0.0"
13+
"empathic": "^2.0.1"
1414
},
1515
"peerDependencies": {
1616
"@babel/core": "^7.12.0 || ^8.0.0-beta.1",

src/cache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const path = require("path");
1313
const zlib = require("zlib");
1414
const { promisify } = require("util");
1515
const { readFile, writeFile, mkdir } = require("fs/promises");
16-
const { sync: findUpSync } = require("find-up");
16+
const { up: findUpSync } = require("empathic/find");
1717
const { env } = process;
1818
const transform = require("./transform");
1919
const serialize = require("./serialize");

yarn.lock

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2042,10 +2042,10 @@ __metadata:
20422042
"@babel/preset-env": ^8.0.0-beta.1
20432043
"@rspack/core": ^1.7.5
20442044
c8: ^10.1.2
2045+
empathic: ^2.0.1
20452046
eslint: ^9.6.0
20462047
eslint-config-prettier: ^9.1.0
20472048
eslint-plugin-prettier: ^5.1.3
2048-
find-up: ^5.0.0
20492049
globals: ^15.8.0
20502050
husky: ^9.1.5
20512051
lint-staged: ^15.2.9
@@ -2461,6 +2461,13 @@ __metadata:
24612461
languageName: node
24622462
linkType: hard
24632463

2464+
"empathic@npm:^2.0.1":
2465+
version: 2.0.1
2466+
resolution: "empathic@npm:2.0.1"
2467+
checksum: c5a37b78926e722c38779e5026342350098771fa1cacb52cb808e5329896ab39abb88cd2f1374671d6e5c98aa24cba2534f00da2938d04f11de1a2d012ee75c3
2468+
languageName: node
2469+
linkType: hard
2470+
24642471
"encoding@npm:^0.1.13":
24652472
version: 0.1.13
24662473
resolution: "encoding@npm:0.1.13"

0 commit comments

Comments
 (0)