Skip to content

Commit 87229fc

Browse files
authored
feat: replace find-up with empathic to have smaller installation (#86)
1 parent 1b60aa3 commit 87229fc

File tree

5 files changed

+67
-338
lines changed

5 files changed

+67
-338
lines changed

esbuild-node-externals/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
"node": ">=12"
3232
},
3333
"dependencies": {
34-
"find-up": "^5.0.0"
34+
"empathic": "^2.0.0"
3535
},
3636
"peerDependencies": {
3737
"esbuild": "0.12 - 0.28"
3838
},
3939
"devDependencies": {
40-
"@types/node": "^24.10.1",
40+
"@types/node": "^24.12.2",
4141
"esbuild": "^0.28.0",
42-
"rimraf": "^6.1.0",
42+
"rimraf": "^6.1.3",
4343
"tslib": "^2.8.1",
4444
"typescript": "^5.9.3"
4545
}

esbuild-node-externals/src/utils.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from 'node:path';
22
import fs from 'node:fs';
3-
import findUp from 'find-up';
3+
import * as find from 'empathic/find';
44

55
export type AllowPredicate = (path: string) => boolean;
66
export type AllowList = (string | RegExp)[] | AllowPredicate;
@@ -36,8 +36,7 @@ const isInGitDirectory = (path: string, gitRootPath?: string): boolean => {
3636
*/
3737
export const findPackagePaths = (_cwd: string = process.cwd()): string[] => {
3838
// Find git root if in git repository
39-
const gitDirectoryPath = findUp.sync('.git', {
40-
type: 'directory',
39+
const gitDirectoryPath = find.up('.git', {
4140
cwd: _cwd,
4241
});
4342
const gitRootPath: string | undefined =
@@ -48,7 +47,7 @@ export const findPackagePaths = (_cwd: string = process.cwd()): string[] => {
4847
const packagePaths: string[] = [];
4948

5049
while (
51-
(packagePath = findUp.sync('package.json', { type: 'file', cwd })) &&
50+
(packagePath = find.up('package.json', { cwd })) &&
5251
isInGitDirectory(packagePath, gitRootPath)
5352
) {
5453
packagePaths.push(packagePath);

examples/basic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"dependencies": {
99
"@accounts/rest-client": "0.33.1",
10-
"koa": "2.16.3"
10+
"koa": "2.16.4"
1111
},
1212
"devDependencies": {
1313
"esbuild": "^0.28.0",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
"singleQuote": true
1313
},
1414
"devDependencies": {
15-
"prettier": "3.6.2"
15+
"prettier": "3.8.1"
1616
}
1717
}

0 commit comments

Comments
 (0)