mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-10 18:18:56 -04:00
fix: don't ignore the overrides field on partial install/update
This commit is contained in:
5
.changeset/polite-houses-design.md
Normal file
5
.changeset/polite-houses-design.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"supi": patch
|
||||
---
|
||||
|
||||
Don't ignore the "overrides" field when install/update doesn't include the root project.
|
||||
@@ -137,12 +137,15 @@ export async function mutateModules (
|
||||
const installsOnly = projects.every((project) => project.mutation === 'install')
|
||||
opts['forceNewModules'] = installsOnly
|
||||
const ctx = await getContext(projects, opts)
|
||||
const rootProject = ctx.projects.find(({ id }) => id === '.')
|
||||
const rootProjectManifest = ctx.projects.find(({ id }) => id === '.')?.manifest ??
|
||||
// When running install/update on a subset of projects, the root project might not be included,
|
||||
// so reading its manifest explicitly hear.
|
||||
await safeReadProjectManifestOnly(opts.lockfileDir)
|
||||
// We read Yarn's resolutions field for compatibility
|
||||
// but we really replace the version specs to any other version spec, not only to exact versions,
|
||||
// so we cannot call it resolutions
|
||||
const overrides = rootProject
|
||||
? rootProject.manifest.pnpm?.overrides ?? rootProject.manifest.resolutions
|
||||
const overrides = rootProjectManifest
|
||||
? rootProjectManifest.pnpm?.overrides ?? rootProjectManifest.resolutions
|
||||
: undefined
|
||||
if (!R.isEmpty(overrides ?? {})) {
|
||||
const versionsOverrider = createVersionsOverrider(overrides!)
|
||||
|
||||
Reference in New Issue
Block a user