Skip to content

Commit beef5ec

Browse files
committed
chore: drop package-directory
Empathic can do this with a basic dirname check.
1 parent 961d9b2 commit beef5ec

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed

package-lock.json

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

packages/build/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@
101101
"p-locate": "^6.0.0",
102102
"p-map": "^7.0.0",
103103
"p-reduce": "^3.0.0",
104-
"package-directory": "^8.0.0",
105104
"path-exists": "^5.0.0",
106105
"path-type": "^6.0.0",
107106
"pretty-ms": "^9.0.0",

packages/build/src/install/local.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { packageDirectory } from 'package-directory'
1+
import { dirname } from 'path'
2+
3+
import { up as packagePath } from 'empathic/package'
24

35
import { logInstallLocalPluginsDeps } from '../log/messages/install.js'
46

@@ -57,6 +59,7 @@ const hasPackageDir = function ({ packageDir }) {
5759

5860
// We only install dependencies of local plugins that have their own `package.json`
5961
const removeMainRoot = async function (localPluginsOptions, buildDir) {
60-
const mainPackageDir = await packageDirectory({ cwd: buildDir })
62+
const mainPackagePath = packagePath({ cwd: buildDir })
63+
const mainPackageDir = mainPackagePath ? dirname(mainPackagePath) : undefined
6164
return localPluginsOptions.filter(({ packageDir }) => packageDir !== mainPackageDir)
6265
}

0 commit comments

Comments
 (0)