Skip to content

Commit 74855b8

Browse files
43081jserhalp
andauthored
chore: replace find-up for file traversal (#387)
Replaces `find-up` with `empathic`, which is faster and smaller. As other PRs land, both in Netlify and outside, this will also de-dupe better. Co-authored-by: Philippe Serhal <[email protected]>
1 parent b249a1e commit 74855b8

File tree

3 files changed

+13
-75
lines changed

3 files changed

+13
-75
lines changed

package-lock.json

Lines changed: 10 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/dev-utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
"chokidar": "^4.0.1",
5757
"decache": "^4.6.2",
5858
"dot-prop": "9.0.0",
59+
"empathic": "^2.0.0",
5960
"env-paths": "^3.0.0",
60-
"find-up": "7.0.0",
6161
"image-size": "^2.0.2",
6262
"js-image-generator": "^1.0.4",
6363
"lodash.debounce": "^4.0.8",

packages/dev-utils/src/lib/local-state.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from 'path'
33
import process from 'process'
44

55
import { deleteProperty, getProperty, hasProperty, setProperty } from 'dot-prop'
6-
import { findUpSync } from 'find-up'
6+
import { file as findUpSync } from 'empathic/find'
77
import writeFileAtomic from 'write-file-atomic'
88

99
import { getPathInProject } from './paths.js'
@@ -15,7 +15,7 @@ const permissionError = "You don't have access to this file."
1515
* Finds location of `.netlify/state.json`
1616
*/
1717
const findStatePath = (cwd: string): string => {
18-
const statePath = findUpSync([STATE_PATH], { cwd })
18+
const statePath = findUpSync(STATE_PATH, { cwd })
1919

2020
if (!statePath) {
2121
return path.join(cwd, STATE_PATH)

0 commit comments

Comments
 (0)