diff --git a/.changeset/wise-deers-provide.md b/.changeset/wise-deers-provide.md new file mode 100644 index 0000000000..36bcff9e49 --- /dev/null +++ b/.changeset/wise-deers-provide.md @@ -0,0 +1,5 @@ +--- +"@pnpm/plugin-commands-publishing": patch +--- + +peerDependencies workspace substitution diff --git a/packages/plugin-commands-publishing/src/publish.ts b/packages/plugin-commands-publishing/src/publish.ts index 921801e581..bc9f15ce97 100644 --- a/packages/plugin-commands-publishing/src/publish.ts +++ b/packages/plugin-commands-publishing/src/publish.ts @@ -236,6 +236,7 @@ async function makePublishManifest (dir: string, originalManifest: ProjectManife dependencies: await makePublishDependencies(dir, originalManifest.dependencies), devDependencies: await makePublishDependencies(dir, originalManifest.devDependencies), optionalDependencies: await makePublishDependencies(dir, originalManifest.optionalDependencies), + peerDependencies: await makePublishDependencies(dir, originalManifest.peerDependencies), } const { publishConfig } = originalManifest diff --git a/packages/plugin-commands-publishing/test/publish.ts b/packages/plugin-commands-publishing/test/publish.ts index 7d10be864e..d9a33189b6 100644 --- a/packages/plugin-commands-publishing/test/publish.ts +++ b/packages/plugin-commands-publishing/test/publish.ts @@ -356,6 +356,9 @@ test('convert specs with workspace protocols to regular version ranges', async ( optionalDependencies: { 'lodash.deburr': 'workspace:^4.1.0', }, + peerDependencies: { + 'random-package': 'workspace:*', + }, }, { name: 'is-negative', @@ -431,6 +434,9 @@ test('convert specs with workspace protocols to regular version ranges', async ( t.deepEqual(publishedManifest.optionalDependencies, { 'lodash.deburr': '^4.1.0', }) + t.deepEqual(publishedManifest.peerDependencies, { + 'random-package': '1.2.3', + }) t.end() })