fix: remove pkg apply cleanupUnusedCatalogs (#9930)

* fix: remove pkg apply cleanupUnusedCatalogs

* fix: lint
This commit is contained in:
btea
2025-09-07 06:03:56 +08:00
committed by GitHub
parent 7e891383fc
commit c182b2d588
2 changed files with 11 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"@pnpm/plugin-commands-installation": patch
---
`cleanupUnusedCatalogs` configuration should be applied when removing a dependency package.

View File

@@ -9,6 +9,7 @@ import { type Config, getOptionsFromRootManifest, types as allTypes } from '@pnp
import { PnpmError } from '@pnpm/error'
import { arrayOfWorkspacePackagesToMap } from '@pnpm/get-context'
import { findWorkspacePackages } from '@pnpm/workspace.find-packages'
import { updateWorkspaceManifest } from '@pnpm/workspace.manifest-writer'
import { getAllDependenciesFromManifest } from '@pnpm/manifest-utils'
import { createOrConnectStoreController, type CreateStoreControllerOptions } from '@pnpm/store-connection-manager'
import { type DependenciesField, type ProjectRootDir } from '@pnpm/types'
@@ -150,6 +151,7 @@ export async function handler (
| 'workspaceDir'
| 'workspacePackagePatterns'
| 'sharedWorkspaceLockfile'
| 'cleanupUnusedCatalogs'
> & {
recursive?: boolean
pnpmfile: string[]
@@ -215,4 +217,8 @@ export async function handler (
removeOpts
)
await writeProjectManifest(mutationResult.updatedProject.manifest)
await updateWorkspaceManifest(opts.workspaceDir ?? opts.dir, {
cleanupUnusedCatalogs: opts.cleanupUnusedCatalogs,
allProjects: opts.allProjects,
})
}