diff --git a/.changeset/old-symbols-invite.md b/.changeset/old-symbols-invite.md new file mode 100644 index 0000000000..307ecf76a6 --- /dev/null +++ b/.changeset/old-symbols-invite.md @@ -0,0 +1,6 @@ +--- +"@pnpm/plugin-commands-deploy": patch +"pnpm": patch +--- + +Let `pnpm deploy` work in repos with `overrides` when `inject-workspace-packages=true` [#9283](https://github.com/pnpm/pnpm/issues/9283). diff --git a/releasing/plugin-commands-deploy/src/createDeployFiles.ts b/releasing/plugin-commands-deploy/src/createDeployFiles.ts index cad587e5cb..0739847222 100644 --- a/releasing/plugin-commands-deploy/src/createDeployFiles.ts +++ b/releasing/plugin-commands-deploy/src/createDeployFiles.ts @@ -119,7 +119,6 @@ export function createDeployFiles ({ const result: DeployFiles = { lockfile: { ...lockfile, - overrides: undefined, // the effects of package overrides should already be part of the package snapshots patchedDependencies: undefined, packageExtensionsChecksum: undefined, // the effects of the package extensions should already be part of the package snapshots pnpmfileChecksum: undefined, // the effects of the pnpmfile should already be part of the package snapshots @@ -136,7 +135,6 @@ export function createDeployFiles ({ pnpm: { ...rootProjectManifest?.pnpm, ...pick(USEFUL_NON_ROOT_PNPM_FIELDS, selectedProjectManifest.pnpm ?? {}), - overrides: undefined, // the effects of package overrides should already be part of the package snapshots patchedDependencies: undefined, packageExtensions: undefined, // the effects of the package extensions should already be part of the package snapshots }, diff --git a/releasing/plugin-commands-deploy/test/shared-lockfile.test.ts b/releasing/plugin-commands-deploy/test/shared-lockfile.test.ts index 16d7962e8b..544509ef9a 100644 --- a/releasing/plugin-commands-deploy/test/shared-lockfile.test.ts +++ b/releasing/plugin-commands-deploy/test/shared-lockfile.test.ts @@ -337,9 +337,9 @@ test('the deploy manifest should inherit the pnpm object from the root manifest const manifest = readPackageJson('deploy') as ProjectManifest expect(manifest.pnpm).toStrictEqual({ onlyBuiltDependencies: preparedManifests.root.pnpm!.onlyBuiltDependencies, + overrides: preparedManifests.root.pnpm!.overrides, executionEnv: preparedManifests['project-0'].pnpm!.executionEnv, } as ProjectManifest['pnpm']) - expect(manifest.pnpm?.overrides).toBeUndefined() // by design expect(readPackageJson('deploy/node_modules/is-positive/')).toHaveProperty(['version'], preparedManifests.root.pnpm!.overrides!['is-positive']) expect(project.readLockfile().importers).toStrictEqual({