Skip to content

Commit

Permalink
fix: use the real path for the local package (pnpm#6524)
Browse files Browse the repository at this point in the history
  • Loading branch information
grimly committed Jan 7, 2024
1 parent 227c903 commit 5a2f831
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .changeset/real-knives-bathe.md
@@ -1,5 +1,5 @@
---
"@pnpm/plugin-commands-installation": patch
"@pnpm/config": patch
---

Fetches the local module real path
Fixes the local package real path
2 changes: 1 addition & 1 deletion config/config/src/index.ts
Expand Up @@ -291,7 +291,7 @@ export async function getConfig (
...rcOptions.map((configKey) => [camelcase(configKey), npmConfig.get(configKey)]) as any, // eslint-disable-line
...Object.entries(cliOptions).filter(([name, value]) => typeof value !== 'undefined').map(([name, value]) => [camelcase(name), value]),
]) as unknown as ConfigWithDeprecatedSettings
const cwd = betterPathResolve(cliOptions.dir ?? npmConfig.localPrefix)
const cwd = await fs.promises.realpath(betterPathResolve(cliOptions.dir ?? npmConfig.localPrefix))

pnpmConfig.maxSockets = npmConfig.maxsockets
// @ts-expect-error
Expand Down
1 change: 0 additions & 1 deletion pkg-manager/plugin-commands-installation/src/recursive.ts
Expand Up @@ -170,7 +170,6 @@ export async function recursive (
const calculatedRepositoryRoot = await fs.realpath(calculateRepositoryRoot(opts.workspaceDir, importers.map(x => x.rootDir)))
const isFromWorkspace = isSubdir.bind(null, calculatedRepositoryRoot)
importers = await pFilter(importers, async ({ rootDir }: { rootDir: string }) => isFromWorkspace(await fs.realpath(rootDir)))
importers = await Promise.all(importers.map(async ({ rootDir, ...rest }) => ({ rootDir: await fs.realpath(rootDir), ...rest })))
if (importers.length === 0) return true
let mutation!: string
switch (cmdFullName) {
Expand Down

0 comments on commit 5a2f831

Please sign in to comment.