mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-28 12:01:37 -04:00
fix: comparison of hoistPattern values (#10713)
This commit is contained in:
6
.changeset/slick-cases-double.md
Normal file
6
.changeset/slick-cases-double.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/headless": patch
|
||||
"@pnpm/core": patch
|
||||
---
|
||||
|
||||
Fix the comparison of current and previous hoistPattern and publicHoistPattern values.
|
||||
@@ -63,7 +63,7 @@ export async function validateModules (
|
||||
}
|
||||
if (
|
||||
opts.forcePublicHoistPattern &&
|
||||
!equals(modules.publicHoistPattern, opts.publicHoistPattern || undefined)
|
||||
!equals(modules.publicHoistPattern ?? [], opts.publicHoistPattern ?? [])
|
||||
) {
|
||||
if (opts.forceNewModules && (rootProject != null)) {
|
||||
await purgeModulesDirsOfImporter(opts, rootProject)
|
||||
@@ -80,7 +80,7 @@ export async function validateModules (
|
||||
|
||||
if (opts.forceHoistPattern && (rootProject != null)) {
|
||||
try {
|
||||
if (!equals(opts.currentHoistPattern, opts.hoistPattern || undefined)) {
|
||||
if (!equals(opts.currentHoistPattern ?? [], opts.hoistPattern ?? [])) {
|
||||
throw new PnpmError(
|
||||
'HOIST_PATTERN_DIFF',
|
||||
'This modules directory was created using a different hoist-pattern value.' +
|
||||
|
||||
@@ -334,8 +334,8 @@ export async function headlessInstall (opts: HeadlessOptions): Promise<Installat
|
||||
nodeVersion: opts.currentEngine.nodeVersion,
|
||||
pnpmVersion: opts.currentEngine.pnpmVersion,
|
||||
supportedArchitectures: opts.supportedArchitectures,
|
||||
includeUnchangedDeps: (!equals(opts.currentHoistPattern, opts.hoistPattern ?? undefined)) ||
|
||||
(!equals(opts.currentPublicHoistPattern, opts.publicHoistPattern ?? undefined)),
|
||||
includeUnchangedDeps: (!equals(opts.currentHoistPattern ?? [], opts.hoistPattern ?? [])) ||
|
||||
(!equals(opts.currentPublicHoistPattern ?? [], opts.publicHoistPattern ?? [])),
|
||||
} as LockfileToDepGraphOptions
|
||||
const {
|
||||
directDependenciesByImporterId,
|
||||
|
||||
Reference in New Issue
Block a user