Skip to content

fix(publish): report generated manifest in publish summary#11371

Merged
zkochan merged 1 commit into
pnpm:mainfrom
lawrence3699:fix/publish-summary-directory
Apr 29, 2026
Merged

fix(publish): report generated manifest in publish summary#11371
zkochan merged 1 commit into
pnpm:mainfrom
lawrence3699:fix/publish-summary-directory

Conversation

@lawrence3699

Copy link
Copy Markdown
Contributor

Fixes #11239.

When recursive publish calls publish() for a package with publishConfig.directory, the packed package can use a different manifest from the workspace package manifest. pnpm-publish-summary.json was using the workspace manifest returned from publish(), so it could report the root version instead of the version that was actually packed from the generated directory.

This keeps returning the workspace manifest for existing callers, also exposes the packed manifest, and uses that manifest for recursive publish summaries.

Validation:

  • pnpm --filter @pnpm/releasing.commands run compile
  • pnpm --filter @pnpm/releasing.commands exec jest test/publish/recursivePublish.ts
  • pnpm --filter pnpm run compile
  • pnpm run spellcheck
  • git diff --check

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes recursive publish summaries so pnpm-publish-summary.json reports the manifest/version that was actually packed and (dry-)published when a package uses publishConfig.directory, rather than the workspace/root manifest.

Changes:

  • Extend publish() to also return publishedManifest (the manifest derived from the packed output), while keeping the existing manifest return for current callers.
  • Update recursive publish summary generation to prefer publishedManifest over the workspace manifest.
  • Add a regression test covering publishConfig.directory version divergence and a changeset entry.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
releasing/commands/test/publish/recursivePublish.ts Adds a regression test asserting summary uses the manifest from publishConfig.directory.
releasing/commands/src/publish/recursivePublish.ts Uses publishedManifest ?? manifest when writing the publish summary entries.
releasing/commands/src/publish/publish.ts Adds publishedManifest to PublishResult and populates it from pack.api() result.
.changeset/publish-summary-directory.md Documents the patch change for pnpm and @pnpm/releasing.commands.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zkochan zkochan merged commit 4ac15b2 into pnpm:main Apr 29, 2026
12 checks passed
@welcome

welcome Bot commented Apr 29, 2026

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉🎉🎉

zkochan pushed a commit that referenced this pull request Apr 30, 2026
Co-authored-by: lawrence3699 <lawrence3699@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

publish summary reports the wrong version if it differs in publishConfig.directory

3 participants