Skip to content

Commit

Permalink
fix: pass resolveSymlinks to directory-fetcher (pnpm#5644)
Browse files Browse the repository at this point in the history
  • Loading branch information
zkochan committed Nov 16, 2022
1 parent 1f412c9 commit 1d04e66
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/warm-lizards-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@pnpm/core": minor
"@pnpm/headless": minor
"@pnpm/lifecycle": minor
---

New option added: resolveSymlinksInInjectedDirs.
2 changes: 2 additions & 0 deletions packages/core/src/install/extendInstallOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export interface StrictInstallOptions {
patchedDependencies?: Record<string, string>

allProjects: ProjectOptions[]
resolveSymlinksInInjectedDirs: boolean
}

export type InstallOptions =
Expand Down Expand Up @@ -199,6 +200,7 @@ const defaults = async (opts: InstallOptions) => {
workspacePackages: {},
enableModulesDir: true,
modulesCacheMaxAge: 7 * 24 * 60,
resolveSymlinksInInjectedDirs: false,
} as StrictInstallOptions
}

Expand Down
1 change: 1 addition & 0 deletions packages/core/src/install/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ export async function mutateModules (
extraBinPaths: opts.extraBinPaths,
extraEnv: opts.extraEnv,
rawConfig: opts.rawConfig,
resolveSymlinksInInjectedDirs: opts.resolveSymlinksInInjectedDirs,
scriptsPrependNodePath: opts.scriptsPrependNodePath,
scriptShell: opts.scriptShell,
shellEmulator: opts.shellEmulator,
Expand Down
2 changes: 2 additions & 0 deletions packages/headless/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export interface HeadlessOptions {
wantedLockfile?: Lockfile
ownLifecycleHooksStdio?: 'inherit' | 'pipe'
pendingBuilds: string[]
resolveSymlinksInInjectedDirs?: boolean
skipped: Set<string>
enableModulesDir?: boolean
nodeLinker?: 'isolated' | 'hoisted' | 'pnp'
Expand Down Expand Up @@ -194,6 +195,7 @@ export async function headlessInstall (opts: HeadlessOptions) {
extraBinPaths: opts.extraBinPaths,
extraEnv: opts.extraEnv,
rawConfig: opts.rawConfig,
resolveSymlinksInInjectedDirs: opts.resolveSymlinksInInjectedDirs,
scriptsPrependNodePath: opts.scriptsPrependNodePath,
scriptShell: opts.scriptShell,
shellEmulator: opts.shellEmulator,
Expand Down
3 changes: 2 additions & 1 deletion packages/lifecycle/src/runLifecycleHooksConcurrently.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type RunLifecycleHooksConcurrentlyOptions = Omit<RunLifecycleHookOptions,
| 'pkgRoot'
| 'rootModulesDir'
> & {
resolveSymlinksInInjectedDirs?: boolean
storeController: StoreController
}

Expand Down Expand Up @@ -53,7 +54,7 @@ export async function runLifecycleHooksConcurrently (
await runLifecycleHook(stage, manifest, runLifecycleHookOpts)
}
if (targetDirs == null || targetDirs.length === 0) return
const filesResponse = await fetchFromDir(rootDir, {})
const filesResponse = await fetchFromDir(rootDir, { resolveSymlinks: opts.resolveSymlinksInInjectedDirs })
await Promise.all(
targetDirs.map(async (targetDir) => {
const targetModulesDir = path.join(targetDir, 'node_modules')
Expand Down

0 comments on commit 1d04e66

Please sign in to comment.