Skip to content

feat: support publishConfig.name to publish under a different name - #13353

Merged
zkochan merged 3 commits into
mainfrom
fix-13345
Jul 26, 2026
Merged

zkochan merged 3 commits into
mainfrom
fix-13345

Conversation

@zkochan

@zkochan zkochan commented Jul 25, 2026 •

Copy link
Copy Markdown
Member

Summary

The Rust CLI is a workspace project named pacquet that publishes as pnpm, because the TypeScript CLI already owns pnpm in the workspace. That rename happened in a CI shell step (generate-packages.mjs) that rewrote the manifest immediately before publish, so nothing in the repo could see it. The release tooling keys parked changelog sections, the ledger, and intents by the manifest name, and then looked the package up on the registry under that same name — a name npm has never had this artifact under.

Two consequences, both verified against the live registry:

  1. The Rust CLI has been publishing with no changelog at all. [email protected] and @pnpm/[email protected] contain no CHANGELOG.md; [email protected] and @pnpm/[email protected] both do. compose_registry_changelog read the name back off the rewritten manifest and looked for .changeset/changelogs/pnpm@<version>.md while the section was parked as pacquet@<version>.md, found nothing, and packed nothing. Eleven alphas of release notes never reached users.
  2. Sections and their consumed intents accumulate. confirmed_published_versions probed pacquet on npm — an unrelated 0.x package — so a section could never be confirmed and never collected. pacquet-edge-aware-engine-strict.md is ledgered as consumed by [email protected], published several alphas ago, and is still sitting in .changeset/.

Approach

Let the manifest state the rename, instead of a build step performing it invisibly.

  • name joins the publishConfig whitelist in both stacks, so a project can declare the name it publishes under while keeping its workspace identity. Only the artifact is renamed: dependents, pnpm-lock.yaml, and release tooling keep addressing the project by its manifest name.
  • Pack reads the name back off the publish manifest, so the tarball filename, the packed manifest, and the registry metadata name one artifact. The code already stated that goal for the version; the name was reading from the pre-override manifest.
  • The changelog paths separate the two identities. The parked section stays keyed by the manifest name — that is what the ledger joins on — while the registry probe, the previous-changelog lookup, and the composed changelog's title use the published name.
  • Everything else that addresses the registry follows. The unpublished-dirs probe behind pnpm change status and pnpm version -r, and both the already-published check and the registry selection of pnpm publish -r, resolve the published name too. The first of those decides whether a release is a first release, which keeps the manifest version instead of bumping it — so probing pacquet, an unrelated 0.x package on npm, read the Rust CLI as never published on every release.
  • Pack validates the rename. The tarball filename is derived from the publish manifest's name, which never passed the check the manifest name goes through; an invalid rename could put a path separator in it. Both stacks now reject one with ERR_PNPM_INVALID_PACKAGE_NAME, and an empty rename means "no rename" in both.
  • The pacquet wrapper declares publishConfig.name and the generator no longer rewrites the name. @pnpm/exe, generated by copying that manifest, strips the inherited rename so it does not publish itself as pnpm.

Verification

  • Ran generate-packages.mjs end to end with stubbed native binaries: the wrapper comes out name: pacquet / publishConfig.name: pnpm / no private, and @pnpm/exe comes out named @pnpm/exe with no inherited publishConfig.
  • New tests: publish_config_name_renames_the_published_package (pacquet-exportable-manifest), publish_config_name_renames_the_tarball_and_the_packed_manifest (pacquet-pack, asserts both the .tgz filename and the packed manifest), and publishConfig.name renames the published package (@pnpm/releasing.exportable-manifest).
  • Registry-addressing tests, each verified to fail without its fix: first_release_probe_uses_the_published_name_of_a_renamed_project and recursive_publish_probes_a_renamed_project_under_its_published_name (pacquet-cli), a package renamed by publishConfig.name is probed under the name the registry knows (@pnpm/releasing.commands, one in change, one in recursivePublish).
  • Validation tests: invalid_publish_config_name_is_rejected (pacquet-pack, covering ..\..\evil and @a/b/c), pack a package with an invalid publishConfig.name and pack a package renamed by publishConfig.name (@pnpm/releasing.commands).
  • Suites green: pacquet-cli (989 unit + 10 change e2e), pacquet-pack + pacquet-exportable-manifest (68), @pnpm/releasing.commands / .versioning / @pnpm/types (65), @pnpm/releasing.exportable-manifest (30).
  • Full pnpm run compile, pnpm run lint (0 errors), cargo clippy --deny warnings, cargo fmt --check.

Not in scope

  • Never-published packages still leak sections. pd, @pnpm/scripts, @pnpm-private/updater, @pnpm/get-release-text, @pnpm/jest-config, @pnpm/testing.* are 404 on npm, so the confirmation gate can never pass for them (20 of the 36 parked sections). private: true does not identify them — @pnpm/napi is private and publishes fine — so this needs its own decision about whether such projects should park sections at all.
  • The existing backlog is not backfilled. The 11 stranded pacquet sections describe alphas that were published without a changelog, so they will still never confirm. Whether to fold that prose into the next release or drop it is a call for a maintainer; deleting release notes did not feel like something to do unilaterally.

Refs pnpm/tasks#38.

Squash Commit Body

The Rust CLI is a workspace project named `pacquet` that publishes as `pnpm`,
because the TypeScript CLI already owns that name in the workspace. The rename
happened in a CI shell step that rewrote the manifest just before publish, so
nothing in the repo could see it — and the release tooling, which keys parked
changelog sections, the ledger, and intents by the manifest name, looked the
renamed package up under a name the registry does not have. Two consequences:
the composed changelog was never found, so the published tarballs carry none at
all, and the publication check could never confirm a section, so sections and
their consumed intents accumulated instead of being collected.

Let the manifest state the rename instead. `name` joins the publishConfig
whitelist in both stacks, so a project can declare the name it publishes under
while keeping its workspace identity. Pack reads the name back off the publish
manifest so the tarball filename, the packed manifest, and the registry
metadata name one artifact, and the changelog paths now separate the two
identities: the parked section is still keyed by the manifest name, which the
ledger joins on, while the registry probe, the previous-changelog lookup, and
the composed changelog's title all use the published one.

The pacquet wrapper declares `publishConfig.name` and the generator no longer
rewrites the name. `@pnpm/exe`, generated by copying that manifest, strips the
inherited rename so it does not publish itself as `pnpm`.

Everything else that addresses the registry follows the same rule: the
unpublished-dirs probe behind `pnpm change status` and `pnpm version -r`, and
both the already-published check and the registry selection of
`pnpm publish -r`. Pack validates the rename before it reaches the tarball
filename, which the manifest-name check never covered.

Refs pnpm/tasks#38.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.
  • Updated the documentation if needed.

Written by an agent (Claude Code, claude-opus-5[1m]).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features
    • Added support for publishing under a different name via publishConfig.name.
    • The generated published package manifest and tarball filename now reflect the configured published name.
    • Workspace name, lockfile entries, and release references continue to use the original manifest name.
  • Bug Fixes
    • Fixed release/changelog composition and publish/version verification when packages are renamed for publication.
    • Ensured wrapper packages and wrapper publishing logic don’t unintentionally inherit the renamed publish name.

The Rust CLI is a workspace project named `pacquet` that publishes as `pnpm`,
because the TypeScript CLI already owns that name in the workspace. The rename
happened in a CI shell step that rewrote the manifest just before publish, so
nothing in the repo could see it — and the release tooling, which keys parked
changelog sections, the ledger, and intents by the manifest name, looked the
renamed package up under a name the registry does not have. Two consequences:
the composed changelog was never found, so the published tarballs carry none at
all, and the publication check could never confirm a section, so sections and
their consumed intents accumulated instead of being collected.

Let the manifest state the rename instead. `name` joins the publishConfig
whitelist in both stacks, so a project can declare the name it publishes under
while keeping its workspace identity. Pack reads the name back off the publish
manifest so the tarball filename, the packed manifest, and the registry
metadata name one artifact, and the changelog paths now separate the two
identities: the parked section is still keyed by the manifest name, which the
ledger joins on, while the registry probe, the previous-changelog lookup, and
the composed changelog's title all use the published one.

The pacquet wrapper declares `publishConfig.name` and the generator no longer
rewrites the name. `@pnpm/exe`, generated by copying that manifest, strips the
inherited rename so it does not publish itself as `pnpm`.

Only the artifact is renamed: dependents, `pnpm-lock.yaml`, and release tooling
keep addressing the project by its manifest name.

Refs pnpm/pnpm#13345.
Copilot AI review requested due to automatic review settings July 25, 2026 13:48

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds publishConfig.name support across manifest export, tarball packing, pnpm wrapper generation, and release changelog verification. Published artifacts use the configured name, while workspace manifests, lockfiles, and release intent identifiers retain the original manifest name.

Changes

Published package naming

Layer / File(s) Summary
Published-name manifest contract
pnpm11/core/types/src/package.ts, pnpm/crates/exportable-manifest/..., pnpm11/releasing/exportable-manifest/...
Adds PublishConfig.name and hoists it into published manifests, removing the consumed publishConfig field.
Published artifact naming
pnpm/crates/pack/..., pnpm11/releasing/commands/src/publish/pack.ts, pnpm/npm/pnpm/...
Derives tarball names from the published manifest and prevents generated wrappers from inheriting the base rename.
Release name mapping
pnpm/crates/cli/src/cli_args/..., pnpm11/releasing/commands/src/...
Uses manifest-to-published-name mappings for registry probes, release verification, recursive publishing, and changelog composition.
Release metadata
.changeset/*.md
Records the new publishConfig.name behavior and package release bumps.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

Possibly related PRs

  • pnpm/pnpm#13207 — Introduces the unpublished-directory registry probing path extended here for published names.
  • pnpm/pnpm#13260 — Also changes pack::api to use publish-time manifest data.

Suggested labels: product: pacquet, product: pnpm@11

Suggested reviewers: copilot

Sequence Diagram(s)

sequenceDiagram
  participant WorkspaceManifest
  participant ExportableManifest
  participant PackCommand
  participant Registry
  participant ReleaseVerifier
  WorkspaceManifest->>ExportableManifest: read publishConfig.name
  ExportableManifest->>PackCommand: produce published manifest
  PackCommand->>PackCommand: derive tarball name from published manifest
  PackCommand->>Registry: publish renamed artifact and changelog
  ReleaseVerifier->>Registry: fetch changelog by published name
  Registry-->>ReleaseVerifier: return published changelog
  ReleaseVerifier-->>ReleaseVerifier: verify expected release section
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-13345

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Support publishConfig.name to publish under a different package name

🐞 Bug fix ✨ Enhancement 🧪 Tests ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Allow publishConfig.name to override the published package name without renaming the workspace
 project.
• Fix registry changelog composition/verification to probe the *published* name while keying ledger
 by manifest name.
• Ensure tarball filename and packed manifest use the same published name across Rust and TS
 packers.
Diagram

graph TD
  G["generate-packages.mjs"] --> A["Workspace manifest"] --> B["Exportable manifest"] --> C["Pack tarball"] --> D[("npm registry")]
  A --> E["Parked changelog"] --> F["Changelog compose/verify"] --> D
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep CI-time name rewrite, but teach tooling both names
  • ➕ Avoids introducing publishConfig.name semantics into pack/exportable-manifest
  • ➕ Keeps committed manifests closer to what consumers expect to install
  • ➖ Still relies on an invisible mutation step; harder to reason about locally
  • ➖ Requires more ad-hoc name plumbing across release tooling; easier to regress again
2. Split into a dedicated publish-only package directory with the published name
  • ➕ Clear separation: workspace identity vs publish identity via distinct packages
  • ➕ Reduces special-case logic in pack/changelog (at the cost of repo structure)
  • ➖ Adds repository/layout complexity and duplication
  • ➖ Still needs careful changeset/ledger strategy to avoid fragmenting release intent tracking
3. Use npm aliasing/dist-tag strategy instead of name override
  • ➕ Avoids publishing under a competing name in the workspace entirely
  • ➖ Does not solve the core problem when the package must literally publish under a specific name
  • ➖ Doesn’t address tarball name/packed manifest consistency requirements

Recommendation: The PR’s approach (declare the published name in publishConfig.name, then consistently consume the publish manifest for tarball/registry-facing behaviors while keeping ledger keyed by manifest name) is the most robust and locally observable option. It removes the hidden CI mutation, aligns Rust and TypeScript implementations, and directly addresses both failure modes (missing changelog and unverifiable published sections) with targeted tests.

Files changed (15) +203 / -23

Enhancement (3) +19 / -0
create.rsWhitelist publishConfig.name for hoisting into the publish manifest +7/-0

Whitelist publishConfig.name for hoisting into the publish manifest

• Extends the publishConfig hoisting whitelist to include 'name'. Documents the intent: publish under a different name without changing workspace identity.

pnpm/crates/exportable-manifest/src/create.rs

package.tsAdd publishConfig.name to typed PublishConfig interface +7/-0

Add publishConfig.name to typed PublishConfig interface

• Extends the TypeScript 'PublishConfig' type to include an optional 'name' field with documentation explaining workspace vs published identity. Aligns type-level support with the new behavior.

pnpm11/core/types/src/package.ts

overridePublishConfig.tsWhitelist publishConfig.name in exportable-manifest override logic +5/-0

Whitelist publishConfig.name in exportable-manifest override logic

• Adds 'name' to the set of publishConfig keys hoisted into the publish manifest in the TypeScript stack. Documents the rationale and non-effects on workspace identity.

pnpm11/releasing/exportable-manifest/src/overridePublishConfig.ts

Bug fix (6) +115 / -23
changelog.rsProbe registry by published name while keeping ledger keyed by manifest name +51/-7

Probe registry by published name while keeping ledger keyed by manifest name

• Separates manifest name vs published name in changelog composition and publication verification. Adds helpers to extract 'publishConfig.name' and build a manifest→published mapping for workspace projects.

pnpm/crates/cli/src/cli_args/changelog.rs

version.rsThread published-name mapping into registry publish verification +6/-3

Thread published-name mapping into registry publish verification

• Builds the published-name map from discovered workspace projects and passes it to 'confirmed_published_versions'. Ensures registry confirmation uses the published name when a project is renamed for publishing.

pnpm/crates/cli/src/cli_args/version.rs

lib.rsDerive tarball filename from publish manifest name +6/-1

Derive tarball filename from publish manifest name

• Updates packing to read the effective package name from the already-built publish manifest, so 'publishConfig.name' affects the tarball filename. Ensures packed manifest, tarball name, and registry metadata agree.

pnpm/crates/pack/src/lib.rs

generate-packages.mjsStop rewriting wrapper name; prevent exe wrapper inheriting publishConfig.name +14/-4

Stop rewriting wrapper name; prevent exe wrapper inheriting publishConfig.name

• Removes the generator’s direct 'name = "pnpm"' mutation for the wrapper, relying on 'publishConfig.name' instead. Ensures the generated '@pnpm/exe' wrapper strips inherited 'publishConfig.name' so it doesn’t publish as 'pnpm'.

pnpm/npm/pnpm/scripts/generate-packages.mjs

pack.tsUse published name for tarball naming and registry changelog composition +15/-5

Use published name for tarball naming and registry changelog composition

• Computes 'publishedName' from the publish manifest and uses it for tarball filename normalization. Updates changelog composition to read parked sections by manifest name but fetch/render using the published name.

pnpm11/releasing/commands/src/publish/pack.ts

index.tsVerify published sections against registry using publishConfig.name mapping +23/-3

Verify published sections against registry using publishConfig.name mapping

• Threads workspace projects into the verification callback and builds a manifest→published rename map. Ensures registry checks use the published name when confirming whether a parked section has been published.

pnpm11/releasing/commands/src/version/index.ts

Tests (3) +53 / -0
tests.rsTest publishConfig.name hoisting renames the published manifest name +17/-0

Test publishConfig.name hoisting renames the published manifest name

• Adds a unit test asserting 'publishConfig.name' overrides the root 'name' in the output manifest. Verifies 'publishConfig' is removed after hoisting.

pnpm/crates/exportable-manifest/src/create/tests.rs

tests.rsTest tarball filename + packed manifest reflect publishConfig.name rename +24/-0

Test tarball filename + packed manifest reflect publishConfig.name rename

• Adds coverage that a package with 'publishConfig.name' produces a tarball named after the published name and includes a packed manifest with the renamed 'name' and no 'publishConfig'.

pnpm/crates/pack/src/tests.rs

overridePublishConfig.test.tsTest publishConfig.name renames the publish manifest name (TS) +12/-0

Test publishConfig.name renames the publish manifest name (TS)

• Adds a unit test asserting 'overridePublishConfig' moves 'publishConfig.name' into the root 'name' and removes 'publishConfig'. Keeps TS behavior aligned with Rust exportable-manifest.

pnpm11/releasing/exportable-manifest/test/overridePublishConfig.test.ts

Documentation (2) +13 / -0
pacquet-publish-config-name.mdAdd pacquet patch changeset documenting publishConfig.name support +5/-0

Add pacquet patch changeset documenting publishConfig.name support

• Introduces a changeset entry for the 'pacquet' workspace project describing 'publishConfig.name' behavior and the Rust CLI changelog fix. Captures the user-visible impact and links to the reported issue.

.changeset/pacquet-publish-config-name.md

publish-config-name.mdAdd multi-package changeset for publishConfig.name feature rollout +8/-0

Add multi-package changeset for publishConfig.name feature rollout

• Adds a changeset covering the releasing/exportable-manifest/types/pnpm packages to ship 'publishConfig.name' support. Documents the intended use case (published name taken by a sibling workspace project).

.changeset/publish-config-name.md

Other (1) +3 / -0
package.jsonDeclare pnpm published name via publishConfig.name +3/-0

Declare pnpm published name via publishConfig.name

• Adds 'publishConfig.name: "pnpm"' to the 'pacquet' wrapper manifest to make the publish rename explicit and repo-visible. Keeps the workspace identity as 'pacquet'.

pnpm/npm/pnpm/package.json

@github-actions

github-actions Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.02     11.0±0.14ms    33.9 MB/sec    1.00     10.8±0.02ms    34.7 MB/sec
packument/parse                1.06     40.0±0.08µs  1660.3 MB/sec    1.00     37.8±0.24µs  1754.3 MB/sec
tarball/download_dependency    1.05      2.4±0.07ms  1836.5 KB/sec    1.00      2.2±0.06ms  1932.9 KB/sec

@greptile-apps

greptile-apps Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported cross-scope registry-routing problem is fixed in both implementations because registry selection now receives the published package name.

Reviews (2): Last reviewed commit: "style(cli): link published_names as an i..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
.changeset/pacquet-publish-config-name.md (1)

5-5: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep both changesets concise and user-facing. The notes include internal implementation rationale rather than the observable feature.

  • .changeset/pacquet-publish-config-name.md#L5-L5: reduce this to the user-visible publishConfig.name behavior and its outcome.
  • .changeset/publish-config-name.md#L8-L8: remove the sibling-package/build-step background and describe the feature directly.

As per path instructions, changesets must be “concise/for users” with “no implementation rationale.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.changeset/pacquet-publish-config-name.md at line 5, Shorten the changeset
descriptions to concise, user-facing notes: in
.changeset/pacquet-publish-config-name.md at line 5, describe only that
publishConfig.name publishes the package under a different name and updates the
published artifact; in .changeset/publish-config-name.md at line 8, describe the
feature directly without sibling-package, build-step, or implementation
rationale.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pnpm/crates/cli/src/cli_args/version.rs`:
- Line 363: Thread the published_names rename map from release_from_intents into
unpublished_release_dirs, and use the mapped published name only for that
function’s registry probe. Match the lookup behavior used by
changelog::confirmed_published_versions while preserving release.name for other
release-plan logic.

In `@pnpm/crates/pack/src/lib.rs`:
- Around line 316-321: The effective published name must be validated before
artifact naming and changelog lookup in both pack implementations. In
pnpm/crates/pack/src/lib.rs, update the published_name handling around
normalize_tarball_name to reject explicitly provided empty or invalid
publishConfig.name values using is_valid_old_npm_package_name rather than
falling back to name. In pnpm11/releasing/commands/src/publish/pack.ts, validate
publishedName with validateNpmPackageName before normalization and make
empty-name handling match the Rust implementation.

---

Nitpick comments:
In @.changeset/pacquet-publish-config-name.md:
- Line 5: Shorten the changeset descriptions to concise, user-facing notes: in
.changeset/pacquet-publish-config-name.md at line 5, describe only that
publishConfig.name publishes the package under a different name and updates the
published artifact; in .changeset/publish-config-name.md at line 8, describe the
feature directly without sibling-package, build-step, or implementation
rationale.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 981b3fd4-393c-4428-8e3b-add93f5b2e66

📥 Commits

Reviewing files that changed from the base of the PR and between b4032e8 and 296d61b.

📒 Files selected for processing (15)
  • .changeset/pacquet-publish-config-name.md
  • .changeset/publish-config-name.md
  • pnpm/crates/cli/src/cli_args/changelog.rs
  • pnpm/crates/cli/src/cli_args/version.rs
  • pnpm/crates/exportable-manifest/src/create.rs
  • pnpm/crates/exportable-manifest/src/create/tests.rs
  • pnpm/crates/pack/src/lib.rs
  • pnpm/crates/pack/src/tests.rs
  • pnpm/npm/pnpm/package.json
  • pnpm/npm/pnpm/scripts/generate-packages.mjs
  • pnpm11/core/types/src/package.ts
  • pnpm11/releasing/commands/src/publish/pack.ts
  • pnpm11/releasing/commands/src/version/index.ts
  • pnpm11/releasing/exportable-manifest/src/overridePublishConfig.ts
  • pnpm11/releasing/exportable-manifest/test/overridePublishConfig.test.ts

Comment thread pnpm/crates/cli/src/cli_args/version.rs Resolved
Comment thread pnpm/crates/pack/src/lib.rs Resolved
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.56757% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.05%. Comparing base (c3754b1) to head (296d61b).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/cli/src/cli_args/changelog.rs 58.62% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   pnpm/pnpm#13353      +/-   ##
==========================================
+ Coverage   87.04%   87.05%   +0.01%     
==========================================
  Files         535      535              
  Lines       91824    91953     +129     
==========================================
+ Hits        79929    80051     +122     
- Misses      11895    11902       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@qodo-code-review

qodo-code-review Bot commented Jul 25, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (2) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 24 rules

Grey Divider


Action required

1. Pack name not validated ✓ Resolved 🐞 Bug ⛨ Security
Description
pnpm pack/pacquet pack now derives the tarball filename from
publishManifest.name/publish_manifest["name"] (which can be overridden via publishConfig.name)
without validating that the overridden value is a valid string npm package name, enabling Windows
path-separator traversal (..\\) or a runtime crash when non-strings reach string operations.
Because manifests are attacker-controlled per REVIEW_GUIDE.md, this can disrupt CI/release tooling
or cause unexpected writes outside the intended destination directory on Windows.
Code

pnpm11/releasing/commands/src/publish/pack.ts[R280-285]

+  // Read back off the publish manifest so a `publishConfig.name` rename reaches
+  // the filename too — the tarball name, the packed manifest, and the registry
+  // metadata all name one artifact.
+  const publishedName = publishManifest.name ?? manifest.name
+  const normalizedName = publishedName.replace('@', '').replace('/', '-')
  if (opts.out) {
Relevance

⭐⭐⭐ High

Security hardening in pack flow (path/symlink safety) has been accepted before; likely to accept
name validation too.

PR-#12777
PR-#12669

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The updated packing flow switches to computing the normalized tarball name from the *publish*
manifest’s name (publishManifest.name / publish_manifest["name"]) rather than the
already-validated on-disk manifest name. In the exportable-manifest pipeline, publishConfig.name
is hoisted into the publish manifest as-is (with only truthiness/whitelist checks and no runtime
string/type enforcement), so malformed or crafted values can reach the tarball-name normalization
logic; that normalization does not strip Windows \\ separators (and only performs limited cleanup
such as removing the first @ and /). Finally, the tarball is written via `path.join(destDir,
tarballName) / PathBuf::join`, so embedded separators/backtracking in the derived name can
influence the final output path (and non-string values can trigger crashes when .replace/string
methods are called).

pnpm11/releasing/commands/src/publish/pack.ts[250-296]
pnpm11/releasing/commands/src/publish/pack.ts[327-370]
pnpm11/releasing/exportable-manifest/src/overridePublishConfig.ts[4-49]
pnpm11/releasing/exportable-manifest/src/transform/requiredFields.ts[6-14]
pnpm/crates/pack/src/lib.rs[258-279]
pnpm/crates/pack/src/lib.rs[316-375]
pnpm/crates/pack/src/lib.rs[628-679]
pnpm/crates/exportable-manifest/src/create.rs[53-80]
pnpm/crates/exportable-manifest/src/create.rs[273-301]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Packing now uses the published manifest’s `name` (influenced by `publishConfig.name`) to derive the tarball filename, but it does not re-validate that this overridden value is (1) a string and (2) a valid npm package name that is safe to use in a filesystem path join. This allows malformed manifests to crash packing (e.g., non-string values reaching string operations) and enables Windows path-separator/backtracking injection (e.g., `..\\`) to affect `destDir.join(tarballName)`.

## Issue Context
- The exportable-manifest layer/override step hoists `publishConfig.name` into the publish manifest without runtime type/validity checks.
- Required-field checks are truthiness-based and don’t enforce that `name` is a string.
- Tarball-name normalization does not remove Windows `\\` separators and only performs limited replacements (e.g., first `@` and `/`), so separator characters can survive into the final filename.
- The tarball output path is constructed with `path.join(destDir, tarballName)` / `PathBuf::join`, so separators/backtracking in the derived name can influence the destination.

## Fix Focus Areas
- pnpm11/releasing/commands/src/publish/pack.ts[250-360]
- pnpm11/releasing/exportable-manifest/src/overridePublishConfig.ts[35-48]
- pnpm11/releasing/exportable-manifest/src/transform/requiredFields.ts[10-13]
- pnpm/crates/pack/src/lib.rs[258-279]
- pnpm/crates/pack/src/lib.rs[316-375]
- pnpm/crates/pack/src/lib.rs[628-633]
- pnpm/crates/exportable-manifest/src/create.rs[53-80]
- pnpm/crates/exportable-manifest/src/create.rs[273-301]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. TS rename not validated 🐞 Bug ⛨ Security ⭐ New
Description
Release tooling in both TypeScript and Rust now uses publishConfig.name as the registry-facing
package identity for probes and registry selection, but publishedName()/published_name() accept
any non-empty string. This creates a pre-pack validation gap where malformed names can misroute
scope→registry selection, break unpublished detection/changelog fetching, and leak into user-facing
diagnostics before pack-time name validation rejects them.
Code

pnpm11/releasing/commands/src/publishedNames.ts[R13-16]

+export function publishedName (manifest: Pick<BaseManifest, 'name' | 'publishConfig'>): string | undefined {
+  const renamed = manifest.publishConfig?.name
+  return typeof renamed === 'string' && renamed !== '' ? renamed : manifest.name
+}
Relevance

⭐⭐⭐ High

Team often adds early validation/safety checks to prevent bad input affecting side effects
(network/filesystem).

PR-#12777
PR-#12669
PR-#13203

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The code paths described show that publishedName()/published_name() return any non-empty
publishConfig.name, and upstream callers (e.g., resolveUnpublishedDirs() / published_names /
unpublished_release_dirs) feed that value directly into registry-probe logic that also drives
registry selection (scope→registry routing) and constructs errors that include the package name;
separately, name validation happens later during packing, demonstrating a temporal gap where network
probes and diagnostic messages can occur with an invalid name before pack-time validation blocks
publishing.

pnpm11/releasing/commands/src/publishedNames.ts[13-16]
pnpm11/releasing/commands/src/resolveUnpublishedDirs.ts[25-34]
pnpm11/releasing/commands/src/publish/pack.ts[281-291]
pnpm11/resolving/npm-resolver/src/fetch.ts[57-75]
pnpm/crates/cli/src/cli_args/changelog.rs[69-87]
pnpm/crates/cli/src/cli_args/changelog.rs[89-106]
pnpm/crates/cli/src/cli_args/changelog.rs[114-139]
pnpm/crates/cli/src/cli_args/changelog.rs[141-172]
pnpm/crates/cli/src/cli_args/changelog.rs[230-240]
pnpm/crates/cli/src/cli_args/changelog.rs[274-277]
pnpm/crates/pack/src/lib.rs[316-330]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`publishConfig.name` is being treated as the authoritative published/registry identity for multiple release-time operations (unpublished probes, previous-changelog lookup, recursive publish registry selection), but `publishedName()`/`published_name()` only check for non-empty strings. This allows malformed package names (e.g., whitespace/control characters/invalid npm name shapes) to affect registry routing and probe results and to be echoed into user-facing diagnostics before pack-time validation runs.

## Issue Context
There is pack-time validation of the published name (TypeScript: `publish/pack.ts`; Rust: packing policy via `is_valid_old_npm_package_name`), but several probe paths run *before* packing (e.g., `pnpm change status`, `pnpm version -r`, confirmed-published checks, recursive publish), so validation must occur earlier—at or before the first registry-facing entry point that derives the published name from `publishConfig.name`.

## Fix Focus Areas
- pnpm11/releasing/commands/src/publishedNames.ts[13-16]
- pnpm11/releasing/commands/src/resolveUnpublishedDirs.ts[25-34]
- pnpm11/releasing/commands/src/publish/recursivePublish.ts[139-142]
- pnpm11/releasing/commands/src/publish/pack.ts[281-291]
- pnpm/crates/cli/src/cli_args/changelog.rs[274-277]
- pnpm/crates/cli/src/cli_args/changelog.rs[89-106]
- pnpm/crates/cli/src/cli_args/changelog.rs[114-139]

## Suggested fix
- When `manifest.publishConfig?.name` is present and non-empty, validate it using the same rule as packing (TypeScript: `validate-npm-package-name` / `validForOldPackages`; Rust: `is_valid_old_npm_package_name`) and ensure names containing control characters are rejected.
- Fail fast with a clear dedicated error (`PnpmError('INVALID_PACKAGE_NAME', ...)` or a `miette!`/custom error) from the earliest registry-facing entry point (e.g., `publishedName()`/`published_name()` or the immediate callers that start probes), rather than silently treating invalid values as “no rename”, so probe/routing commands error out before any registry access or misleading diagnostics.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Missing TS test for rename ✓ Resolved 📘 Rule violation ▣ Testability
Description
The PR changes tarball naming to use the published name (publishConfig.name) but does not add a
corresponding TypeScript test asserting the renamed tarball filename and packed manifest name. This
risks regressions where the Rust and TypeScript pack implementations diverge without detection.
Code

pnpm11/releasing/commands/src/publish/pack.ts[R280-284]

+  // Read back off the publish manifest so a `publishConfig.name` rename reaches
+  // the filename too — the tarball name, the packed manifest, and the registry
+  // metadata all name one artifact.
+  const publishedName = publishManifest.name ?? manifest.name
+  const normalizedName = publishedName.replace('@', '').replace('/', '-')
Relevance

⭐⭐ Medium

Team sometimes mirrors Rust/TS behavior with matching tests, but no close precedent for this exact
pack rename case.

PR-#13203

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2255044 requires mirrored tests when a behavior change exists across Rust and
TypeScript. The TypeScript pack code now uses publishedName for tarball naming, while the Rust
side adds an explicit test for publishConfig.name renaming; the TypeScript pack tests shown do not
exercise publishConfig.name rename behavior.

Rule 2255044: Cross-stack behavior changes must have mirrored tests in Rust and TypeScript
pnpm11/releasing/commands/src/publish/pack.ts[280-284]
pnpm/crates/pack/src/tests.rs[115-137]
pnpm11/releasing/commands/test/publish/pack.ts[15-82]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A new cross-stack behavior is introduced: `publishConfig.name` must rename both the tarball filename and the packed manifest name. Rust has an explicit test for this, but the TypeScript `@pnpm/releasing.commands` pack tests do not cover this scenario.

## Issue Context
This PR intentionally aligns Rust and TypeScript behavior for `publishConfig.name`. The compliance rule requires mirrored tests across stacks for such behavior changes.

## Fix Focus Areas
- pnpm11/releasing/commands/src/publish/pack.ts[280-285]
- pnpm11/releasing/commands/test/publish/pack.ts[15-82]
- pnpm/crates/pack/src/tests.rs[115-137]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

4. pacquet changeset missing pnpm 📘 Rule violation § Compliance
Description
The new changeset .changeset/pacquet-publish-config-name.md does not include a pnpm entry in its
front-matter, which violates the requirement that every new/modified changeset explicitly declares
pnpm. This can cause release tooling to miss or mis-bump pnpm for this change set.
Code

.changeset/pacquet-publish-config-name.md[R1-3]

+---
+"pacquet": patch
+---
Relevance

⭐ Low

Multiple prior PRs rejected adding a pnpm entry to pacquet-only changesets.

PR-#13304
PR-#13329
PR-#12991

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires each new/modified changeset to include a pnpm entry with a valid
bump type. The added changeset .changeset/pacquet-publish-config-name.md only lists pacquet in
its front-matter.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/pacquet-publish-config-name.md[1-3]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The changeset `.changeset/pacquet-publish-config-name.md` is missing a `pnpm` front-matter entry, but compliance requires `pnpm` to be explicitly listed in every new/modified changeset.

## Issue Context
There is already another changeset in this PR (`.changeset/publish-config-name.md`) that lists `pnpm`.

## Fix Focus Areas
- .changeset/pacquet-publish-config-name.md[1-3]
- .changeset/publish-config-name.md[1-6]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. composeRegistryChangelog() has 4 params 📘 Rule violation ⚙ Maintainability
Description
The updated TypeScript function composeRegistryChangelog now takes 4 parameters, exceeding the
3-parameter limit. This reduces readability and makes future call sites more error-prone.
Code

pnpm11/releasing/commands/src/publish/pack.ts[431]

+async function composeRegistryChangelog (opts: PackOptions, pkgName: string, publishedName: string, version: string): Promise<string | undefined> {
Relevance

⭐ Low

Max-3-params refactor requests were previously rejected for similar TS helper signatures.

PR-#12876

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713433 limits TypeScript functions to three parameters or fewer. The
composeRegistryChangelog declaration in pnpm11/releasing/commands/src/publish/pack.ts has four
parameters.

Rule 713433: Limit TypeScript functions to three parameters or fewer
pnpm11/releasing/commands/src/publish/pack.ts[431-431]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`composeRegistryChangelog` now has 4 positional parameters (`opts`, `pkgName`, `publishedName`, `version`), violating the 3-parameter limit for TypeScript functions.

## Issue Context
This function is called from the pack flow; using an options object avoids brittle positional arguments and improves clarity.

## Fix Focus Areas
- pnpm11/releasing/commands/src/publish/pack.ts[431-438]
- pnpm11/releasing/commands/src/publish/pack.ts[280-284]
- pnpm11/releasing/commands/src/publish/pack.ts[322-322]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Previous review results

Review updated until commit 66a851a

Results up to commit 296d61b ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (2) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. Pack name not validated ✓ Resolved 🐞 Bug ⛨ Security
Description
pnpm pack/pacquet pack now derives the tarball filename from
publishManifest.name/publish_manifest["name"] (which can be overridden via publishConfig.name)
without validating that the overridden value is a valid string npm package name, enabling Windows
path-separator traversal (..\\) or a runtime crash when non-strings reach string operations.
Because manifests are attacker-controlled per REVIEW_GUIDE.md, this can disrupt CI/release tooling
or cause unexpected writes outside the intended destination directory on Windows.
Code

pnpm11/releasing/commands/src/publish/pack.ts[R280-285]

+  // Read back off the publish manifest so a `publishConfig.name` rename reaches
+  // the filename too — the tarball name, the packed manifest, and the registry
+  // metadata all name one artifact.
+  const publishedName = publishManifest.name ?? manifest.name
+  const normalizedName = publishedName.replace('@', '').replace('/', '-')
  if (opts.out) {
Relevance

⭐⭐⭐ High

Security hardening in pack flow (path/symlink safety) has been accepted before; likely to accept
name validation too.

PR-#12777
PR-#12669

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The updated packing flow switches to computing the normalized tarball name from the *publish*
manifest’s name (publishManifest.name / publish_manifest["name"]) rather than the
already-validated on-disk manifest name. In the exportable-manifest pipeline, publishConfig.name
is hoisted into the publish manifest as-is (with only truthiness/whitelist checks and no runtime
string/type enforcement), so malformed or crafted values can reach the tarball-name normalization
logic; that normalization does not strip Windows \\ separators (and only performs limited cleanup
such as removing the first @ and /). Finally, the tarball is written via `path.join(destDir,
tarballName) / PathBuf::join`, so embedded separators/backtracking in the derived name can
influence the final output path (and non-string values can trigger crashes when .replace/string
methods are called).

pnpm11/releasing/commands/src/publish/pack.ts[250-296]
pnpm11/releasing/commands/src/publish/pack.ts[327-370]
pnpm11/releasing/exportable-manifest/src/overridePublishConfig.ts[4-49]
pnpm11/releasing/exportable-manifest/src/transform/requiredFields.ts[6-14]
pnpm/crates/pack/src/lib.rs[258-279]
pnpm/crates/pack/src/lib.rs[316-375]
pnpm/crates/pack/src/lib.rs[628-679]
pnpm/crates/exportable-manifest/src/create.rs[53-80]
pnpm/crates/exportable-manifest/src/create.rs[273-301]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Packing now uses the published manifest’s `name` (influenced by `publishConfig.name`) to derive the tarball filename, but it does not re-validate that this overridden value is (1) a string and (2) a valid npm package name that is safe to use in a filesystem path join. This allows malformed manifests to crash packing (e.g., non-string values reaching string operations) and enables Windows path-separator/backtracking injection (e.g., `..\\`) to affect `destDir.join(tarballName)`.

## Issue Context
- The exportable-manifest layer/override step hoists `publishConfig.name` into the publish manifest without runtime type/validity checks.
- Required-field checks are truthiness-based and don’t enforce that `name` is a string.
- Tarball-name normalization does not remove Windows `\\` separators and only performs limited replacements (e.g., first `@` and `/`), so separator characters can survive into the final filename.
- The tarball output path is constructed with `path.join(destDir, tarballName)` / `PathBuf::join`, so separators/backtracking in the derived name can influence the destination.

## Fix Focus Areas
- pnpm11/releasing/commands/src/publish/pack.ts[250-360]
- pnpm11/releasing/exportable-manifest/src/overridePublishConfig.ts[35-48]
- pnpm11/releasing/exportable-manifest/src/transform/requiredFields.ts[10-13]
- pnpm/crates/pack/src/lib.rs[258-279]
- pnpm/crates/pack/src/lib.rs[316-375]
- pnpm/crates/pack/src/lib.rs[628-633]
- pnpm/crates/exportable-manifest/src/create.rs[53-80]
- pnpm/crates/exportable-manifest/src/create.rs[273-301]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended
2. Missing TS test for rename ✓ Resolved 📘 Rule violation ▣ Testability
Description
The PR changes tarball naming to use the published name (publishConfig.name) but does not add a
corresponding TypeScript test asserting the renamed tarball filename and packed manifest name. This
risks regressions where the Rust and TypeScript pack implementations diverge without detection.
Code

pnpm11/releasing/commands/src/publish/pack.ts[R280-284]

+  // Read back off the publish manifest so a `publishConfig.name` rename reaches
+  // the filename too — the tarball name, the packed manifest, and the registry
+  // metadata all name one artifact.
+  const publishedName = publishManifest.name ?? manifest.name
+  const normalizedName = publishedName.replace('@', '').replace('/', '-')
Relevance

⭐⭐ Medium

Team sometimes mirrors Rust/TS behavior with matching tests, but no close precedent for this exact
pack rename case.

PR-#13203

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2255044 requires mirrored tests when a behavior change exists across Rust and
TypeScript. The TypeScript pack code now uses publishedName for tarball naming, while the Rust
side adds an explicit test for publishConfig.name renaming; the TypeScript pack tests shown do not
exercise publishConfig.name rename behavior.

Rule 2255044: Cross-stack behavior changes must have mirrored tests in Rust and TypeScript
pnpm11/releasing/commands/src/publish/pack.ts[280-284]
pnpm/crates/pack/src/tests.rs[115-137]
pnpm11/releasing/commands/test/publish/pack.ts[15-82]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A new cross-stack behavior is introduced: `publishConfig.name` must rename both the tarball filename and the packed manifest name. Rust has an explicit test for this, but the TypeScript `@pnpm/releasing.commands` pack tests do not cover this scenario.

## Issue Context
This PR intentionally aligns Rust and TypeScript behavior for `publishConfig.name`. The compliance rule requires mirrored tests across stacks for such behavior changes.

## Fix Focus Areas
- pnpm11/releasing/commands/src/publish/pack.ts[280-285]
- pnpm11/releasing/commands/test/publish/pack.ts[15-82]
- pnpm/crates/pack/src/tests.rs[115-137]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational
3. pacquet changeset missing pnpm 📘 Rule violation § Compliance
Description
The new changeset .changeset/pacquet-publish-config-name.md does not include a pnpm entry in its
front-matter, which violates the requirement that every new/modified changeset explicitly declares
pnpm. This can cause release tooling to miss or mis-bump pnpm for this change set.
Code

.changeset/pacquet-publish-config-name.md[R1-3]

+---
+"pacquet": patch
+---
Relevance

⭐ Low

Multiple prior PRs rejected adding a pnpm entry to pacquet-only changesets.

PR-#13304
PR-#13329
PR-#12991

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires each new/modified changeset to include a pnpm entry with a valid
bump type. The added changeset .changeset/pacquet-publish-config-name.md only lists pacquet in
its front-matter.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/pacquet-publish-config-name.md[1-3]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The changeset `.changeset/pacquet-publish-config-name.md` is missing a `pnpm` front-matter entry, but compliance requires `pnpm` to be explicitly listed in every new/modified changeset.

## Issue Context
There is already another changeset in this PR (`.changeset/publish-config-name.md`) that lists `pnpm`.

## Fix Focus Areas
- .changeset/pacquet-publish-config-name.md[1-3]
- .changeset/publish-config-name.md[1-6]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. composeRegistryChangelog() has 4 params 📘 Rule violation ⚙ Maintainability
Description
The updated TypeScript function composeRegistryChangelog now takes 4 parameters, exceeding the
3-parameter limit. This reduces readability and makes future call sites more error-prone.
Code

pnpm11/releasing/commands/src/publish/pack.ts[431]

+async function composeRegistryChangelog (opts: PackOptions, pkgName: string, publishedName: string, version: string): Promise<string | undefined> {
Relevance

⭐ Low

Max-3-params refactor requests were previously rejected for similar TS helper signatures.

PR-#12876

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713433 limits TypeScript functions to three parameters or fewer. The
composeRegistryChangelog declaration in pnpm11/releasing/commands/src/publish/pack.ts has four
parameters.

Rule 713433: Limit TypeScript functions to three parameters or fewer
pnpm11/releasing/commands/src/publish/pack.ts[431-431]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`composeRegistryChangelog` now has 4 positional parameters (`opts`, `pkgName`, `publishedName`, `version`), violating the 3-parameter limit for TypeScript functions.

## Issue Context
This function is called from the pack flow; using an options object avoids brittle positional arguments and improves clarity.

## Fix Focus Areas
- pnpm11/releasing/commands/src/publish/pack.ts[431-438]
- pnpm11/releasing/commands/src/publish/pack.ts[280-284]
- pnpm11/releasing/commands/src/publish/pack.ts[322-322]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@github-actions

github-actions Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 66a851aa332e

Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time).

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.523 ± 0.173 2.359 2.803 1.65 ± 0.16
pacquet@main 2.453 ± 0.107 2.354 2.691 1.60 ± 0.13
pnpr@HEAD 1.533 ± 0.107 1.353 1.726 1.00
pnpr@main 1.575 ± 0.123 1.381 1.739 1.03 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.52347832576,
      "stddev": 0.17293227541325457,
      "median": 2.4547020376599997,
      "user": 1.4908631599999995,
      "system": 1.3368474,
      "min": 2.35924870316,
      "max": 2.80307469416,
      "times": [
        2.45662643416,
        2.80307469416,
        2.35924870316,
        2.68850078716,
        2.45277764116,
        2.63549843316,
        2.35949640616,
        2.38907772816,
        2.35969454716,
        2.73078788316
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.4529865333600003,
      "stddev": 0.10746005388843234,
      "median": 2.4210379146600003,
      "user": 1.4992930599999998,
      "system": 1.2529431,
      "min": 2.35424079716,
      "max": 2.6911690681600002,
      "times": [
        2.41077875016,
        2.35424079716,
        2.38524419916,
        2.43129707916,
        2.37450418416,
        2.36518116916,
        2.6911690681600002,
        2.46237710316,
        2.47493640316,
        2.58013658016
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.53344119606,
      "stddev": 0.1069040940051446,
      "median": 1.5315732876600001,
      "user": 1.02495686,
      "system": 1.1570959,
      "min": 1.35329671316,
      "max": 1.72556435616,
      "times": [
        1.5653077511600002,
        1.62879482916,
        1.6058299261600002,
        1.5062932831600002,
        1.5000058041600002,
        1.35329671316,
        1.4299310901600002,
        1.46253491516,
        1.55685329216,
        1.72556435616
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.57515610836,
      "stddev": 0.12302407157526331,
      "median": 1.61108536916,
      "user": 1.02663926,
      "system": 1.1559501,
      "min": 1.3806804801600001,
      "max": 1.73893858916,
      "times": [
        1.5065254991600001,
        1.61702235816,
        1.68573549116,
        1.6051483801600002,
        1.61977739616,
        1.3806804801600001,
        1.3898814641600001,
        1.73893858916,
        1.52024352916,
        1.68760789616
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 257.3 ± 5.8 247.3 265.4 1.03 ± 0.04
pacquet@main 250.2 ± 6.5 239.6 261.2 1.00
pnpr@HEAD 267.7 ± 5.4 257.2 275.5 1.07 ± 0.04
pnpr@main 282.8 ± 8.2 274.7 300.4 1.13 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.25729390786,
      "stddev": 0.005759690031583657,
      "median": 0.25552381476,
      "user": 0.2127893,
      "system": 0.54347302,
      "min": 0.24733222076000003,
      "max": 0.26543165076,
      "times": [
        0.26543165076,
        0.26265505276,
        0.24733222076000003,
        0.26318476976000005,
        0.25536725076,
        0.25564911076,
        0.25162160676,
        0.25454283676,
        0.26175606076,
        0.25539851876
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.25021216066,
      "stddev": 0.0065394834229173405,
      "median": 0.25068171276,
      "user": 0.1953195,
      "system": 0.52446452,
      "min": 0.23959644576000003,
      "max": 0.26119247876,
      "times": [
        0.23959644576000003,
        0.24637110076000002,
        0.26119247876,
        0.25284079376,
        0.24852263176000003,
        0.25405212376,
        0.25669767676,
        0.24349093676000003,
        0.24617488176000002,
        0.25318253676
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.26769189186,
      "stddev": 0.0053783407206836635,
      "median": 0.26777910126000004,
      "user": 0.22387839999999998,
      "system": 0.5175380199999999,
      "min": 0.25722870476000004,
      "max": 0.27552622776,
      "times": [
        0.26529433176,
        0.26712550076,
        0.27552622776,
        0.27407756076,
        0.26843270176,
        0.26608914976000003,
        0.27015851076,
        0.26258401976,
        0.25722870476000004,
        0.27040221076000004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.28276006756000005,
      "stddev": 0.008158676223779672,
      "median": 0.28068835876000003,
      "user": 0.21731609999999998,
      "system": 0.5536162199999999,
      "min": 0.27467066676,
      "max": 0.30043968976,
      "times": [
        0.28063205276000003,
        0.29193712976,
        0.27633654476,
        0.30043968976,
        0.28160039576,
        0.27472658276,
        0.27467066676,
        0.28074466476000004,
        0.28646767076,
        0.28004527776000004
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.782 ± 0.018 2.758 2.812 1.76 ± 0.12
pacquet@main 2.786 ± 0.026 2.756 2.818 1.76 ± 0.13
pnpr@HEAD 1.638 ± 0.162 1.435 1.850 1.03 ± 0.13
pnpr@main 1.585 ± 0.112 1.432 1.827 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.7817618618200006,
      "stddev": 0.01752254652004815,
      "median": 2.77606641852,
      "user": 1.6926256599999998,
      "system": 1.3397938999999996,
      "min": 2.7576197050199998,
      "max": 2.81151963502,
      "times": [
        2.7576197050199998,
        2.77183932102,
        2.81151963502,
        2.76774194902,
        2.79833089002,
        2.77588908502,
        2.77624375202,
        2.79292336002,
        2.79909479802,
        2.76641612302
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.78584173262,
      "stddev": 0.025562986391766417,
      "median": 2.78072071202,
      "user": 1.7039925599999997,
      "system": 1.3002327999999999,
      "min": 2.75559512102,
      "max": 2.81828018102,
      "times": [
        2.77188280402,
        2.81155221702,
        2.81713372302,
        2.75926250702,
        2.7860789860199997,
        2.77536243802,
        2.81828018102,
        2.80640654202,
        2.75686280702,
        2.75559512102
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.63816325122,
      "stddev": 0.16235314646742377,
      "median": 1.68723054302,
      "user": 1.0126762599999999,
      "system": 1.1432011999999998,
      "min": 1.4346867200200002,
      "max": 1.85027421002,
      "times": [
        1.8126160450200002,
        1.45971534602,
        1.4841110110200002,
        1.7388791530200003,
        1.6515331610200001,
        1.85027421002,
        1.4346867200200002,
        1.46163195202,
        1.7229279250200003,
        1.7652569890200003
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5849700675199998,
      "stddev": 0.11201423656140895,
      "median": 1.58446324802,
      "user": 1.0055917600000002,
      "system": 1.1740363,
      "min": 1.43220833702,
      "max": 1.8271494860200002,
      "times": [
        1.53450351402,
        1.4439972060200001,
        1.58366952902,
        1.43220833702,
        1.6238204660200002,
        1.5970680970200002,
        1.8271494860200002,
        1.58525696702,
        1.5585566450200001,
        1.6634704280200001
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 597.5 ± 14.1 583.8 625.5 1.97 ± 0.06
pacquet@main 597.4 ± 12.2 577.1 615.6 1.97 ± 0.06
pnpr@HEAD 304.3 ± 5.9 296.3 315.0 1.00 ± 0.03
pnpr@main 302.9 ± 6.0 293.5 314.1 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.59754452842,
      "stddev": 0.014065399202090151,
      "median": 0.59430415652,
      "user": 0.7088169599999999,
      "system": 0.6904958400000001,
      "min": 0.58375329802,
      "max": 0.6254646150200001,
      "times": [
        0.58375329802,
        0.5970315700200001,
        0.59491606202,
        0.61238126802,
        0.6102070000200001,
        0.6254646150200001,
        0.58640097802,
        0.59369225102,
        0.58377145202,
        0.58782679002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.59738398652,
      "stddev": 0.01216861002718243,
      "median": 0.59473141502,
      "user": 0.71240766,
      "system": 0.6853440400000002,
      "min": 0.57707907502,
      "max": 0.61560223702,
      "times": [
        0.58763984802,
        0.59319606702,
        0.57707907502,
        0.60716265402,
        0.59047397702,
        0.61464367402,
        0.61560223702,
        0.59969579202,
        0.59626676302,
        0.59207977802
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.30434634822,
      "stddev": 0.005931080598336594,
      "median": 0.30342436702,
      "user": 0.20135646000000001,
      "system": 0.52423164,
      "min": 0.29627946502,
      "max": 0.31502462802,
      "times": [
        0.29627946502,
        0.29730677702,
        0.30201458102,
        0.31000829402,
        0.30046675102,
        0.30243742602,
        0.31502462802,
        0.30569768802,
        0.30981656402,
        0.30441130802
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.30291293282000004,
      "stddev": 0.00603601375843011,
      "median": 0.30277725052000004,
      "user": 0.20331126,
      "system": 0.5256302399999999,
      "min": 0.29351985602,
      "max": 0.31406335202,
      "times": [
        0.30418745902,
        0.30638312602,
        0.30192812802,
        0.31406335202,
        0.30875175102,
        0.30268424102,
        0.29897082702,
        0.29351985602,
        0.30287026002,
        0.29577032802
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.924 ± 0.013 1.908 1.943 6.23 ± 0.19
pacquet@main 1.911 ± 0.018 1.889 1.946 6.19 ± 0.20
pnpr@HEAD 0.311 ± 0.007 0.302 0.325 1.01 ± 0.04
pnpr@main 0.309 ± 0.009 0.298 0.324 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.92443755286,
      "stddev": 0.012736743103402429,
      "median": 1.92018119436,
      "user": 0.9823805599999998,
      "system": 0.7458912999999999,
      "min": 1.90841078286,
      "max": 1.9434352328600002,
      "times": [
        1.9390010828600002,
        1.9120819058600003,
        1.94290989486,
        1.91845250786,
        1.9434352328600002,
        1.9219098808600001,
        1.9176528538600002,
        1.9228231378600003,
        1.90841078286,
        1.91769824886
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.91059753776,
      "stddev": 0.017763942943574886,
      "median": 1.9115781393600002,
      "user": 0.93010146,
      "system": 0.7668706,
      "min": 1.88916328386,
      "max": 1.9455033818600003,
      "times": [
        1.90983694486,
        1.9455033818600003,
        1.92497671686,
        1.89000896286,
        1.91903988186,
        1.9133193338600003,
        1.9196502908600002,
        1.8946525168600001,
        1.88916328386,
        1.8998240638600001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31071264266000004,
      "stddev": 0.007019746714233681,
      "median": 0.30958051436,
      "user": 0.20657785999999997,
      "system": 0.5252327999999999,
      "min": 0.30162454186000004,
      "max": 0.3250315528600001,
      "times": [
        0.3250315528600001,
        0.30278983386,
        0.31533951586000003,
        0.30936848586000004,
        0.30839725886,
        0.30583286586,
        0.30162454186000004,
        0.30979254286,
        0.31207157986000006,
        0.31687824886000004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.30884932306,
      "stddev": 0.009441101065120803,
      "median": 0.30666839836000004,
      "user": 0.19340766,
      "system": 0.559245,
      "min": 0.29770023086,
      "max": 0.32425157586000003,
      "times": [
        0.31849020986000004,
        0.30399602186,
        0.29770023086,
        0.29962922886000004,
        0.32425157586000003,
        0.30444168086000006,
        0.30043839986000004,
        0.30889511586000007,
        0.32103128986000007,
        0.30961947686
      ]
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 367.2 ± 5.4 360.0 374.8 4.28 ± 0.12
pacquet@main 357.0 ± 8.7 347.2 368.4 4.16 ± 0.14
pnpr@HEAD 87.0 ± 1.9 82.8 90.3 1.01 ± 0.03
pnpr@main 85.8 ± 2.1 81.8 89.2 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.3671641104,
      "stddev": 0.005430146067986742,
      "median": 0.3669162094,
      "user": 0.36321896000000004,
      "system": 0.04950182,
      "min": 0.3600418859,
      "max": 0.37479249690000005,
      "times": [
        0.3716722999,
        0.36436785790000004,
        0.36137254690000004,
        0.3600418859,
        0.3694645609,
        0.3625115689,
        0.3634131029,
        0.37386636590000005,
        0.3701384179,
        0.37479249690000005
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.35701824600000004,
      "stddev": 0.008663555186724315,
      "median": 0.35401261540000006,
      "user": 0.34307846000000003,
      "system": 0.06250282,
      "min": 0.3471598669,
      "max": 0.36844893190000005,
      "times": [
        0.35074965490000004,
        0.36706798490000003,
        0.36844893190000005,
        0.34832349490000003,
        0.3497262519,
        0.35699763290000003,
        0.36678849890000004,
        0.35102759790000004,
        0.3471598669,
        0.3638925449
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08696917283750003,
      "stddev": 0.0019164435620534867,
      "median": 0.08718925240000001,
      "user": 0.021511041249999998,
      "system": 0.00752426125,
      "min": 0.08283629890000001,
      "max": 0.09028906990000002,
      "times": [
        0.08855443890000002,
        0.08437359890000001,
        0.08329320690000001,
        0.0876989999,
        0.08964449890000001,
        0.08461605490000002,
        0.08942727990000002,
        0.08495290890000001,
        0.08283629890000001,
        0.0877353299,
        0.08858236190000002,
        0.08622819490000001,
        0.08320314890000001,
        0.08614591190000001,
        0.08858559690000001,
        0.09028906990000002,
        0.08582075990000002,
        0.08885781990000001,
        0.0851378769,
        0.08724544890000001,
        0.08685693690000001,
        0.08717829190000001,
        0.08889177290000001,
        0.08698506890000002,
        0.08655992990000001,
        0.08843266990000001,
        0.08817096890000001,
        0.0871178179,
        0.08750220090000001,
        0.08649316290000002,
        0.08720021290000002,
        0.08839569090000002
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.08575748286969698,
      "stddev": 0.002110340196173512,
      "median": 0.0862058229,
      "user": 0.021035714545454543,
      "system": 0.007953927272727274,
      "min": 0.08178942990000002,
      "max": 0.08924441490000001,
      "times": [
        0.0845775529,
        0.08792480490000001,
        0.08689448790000001,
        0.08705610190000002,
        0.08401958290000001,
        0.08752587390000001,
        0.08924441490000001,
        0.08557213290000001,
        0.08919881090000001,
        0.08466381490000001,
        0.08769760790000002,
        0.08759212990000001,
        0.0862058229,
        0.08261014290000002,
        0.08232553890000001,
        0.08425021590000001,
        0.08632263290000002,
        0.08846694390000001,
        0.08750216090000001,
        0.08679152490000001,
        0.08742327190000002,
        0.08648176190000001,
        0.08208844290000002,
        0.0844873829,
        0.08683486590000002,
        0.08603305890000001,
        0.08178942990000002,
        0.08242566690000001,
        0.08600081790000001,
        0.08761956090000002,
        0.08491313290000001,
        0.08392205990000001,
        0.0835351829
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.515 ± 0.118 4.426 4.815 1.28 ± 0.05
pacquet@main 4.545 ± 0.118 4.422 4.791 1.29 ± 0.05
pnpr@HEAD 3.534 ± 0.100 3.444 3.751 1.00
pnpr@main 3.591 ± 0.109 3.476 3.809 1.02 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.51520537744,
      "stddev": 0.11778002732739501,
      "median": 4.47402758694,
      "user": 1.7038915799999999,
      "system": 1.3460223400000002,
      "min": 4.42577125044,
      "max": 4.81509137744,
      "times": [
        4.81509137744,
        4.600099885440001,
        4.44367349844,
        4.42577125044,
        4.47597089844,
        4.4776167324400005,
        4.46123752944,
        4.4372168394400004,
        4.47208427544,
        4.54329148744
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.54540689734,
      "stddev": 0.11783122152623586,
      "median": 4.516926933940001,
      "user": 1.75154608,
      "system": 1.29647094,
      "min": 4.42236203744,
      "max": 4.7905101634400005,
      "times": [
        4.515456615440001,
        4.44143910244,
        4.57421800844,
        4.46775653144,
        4.56712533844,
        4.46050883044,
        4.696295093440001,
        4.518397252440001,
        4.7905101634400005,
        4.42236203744
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5342901196400005,
      "stddev": 0.10010413547987283,
      "median": 3.4861780059400003,
      "user": 1.1690400799999998,
      "system": 1.2487715400000003,
      "min": 3.44380022144,
      "max": 3.75055434844,
      "times": [
        3.4795948254400004,
        3.4723263664400004,
        3.66007596644,
        3.4720939794400003,
        3.4586482924400004,
        3.75055434844,
        3.5681943674400003,
        3.5448516424400003,
        3.49276118644,
        3.44380022144
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.59073748024,
      "stddev": 0.10863135977891478,
      "median": 3.56721222744,
      "user": 1.21553998,
      "system": 1.21761124,
      "min": 3.4755763334400003,
      "max": 3.80918534744,
      "times": [
        3.4755763334400003,
        3.52653500244,
        3.50805912144,
        3.59066896244,
        3.47886833644,
        3.80918534744,
        3.5437554924400003,
        3.6985768024400003,
        3.5966334204400003,
        3.6795159834400004
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13353
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,757.62 ms
(+0.87%)Baseline: 2,733.71 ms
3,280.45 ms
(84.06%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,908.41 ms
(+0.99%)Baseline: 1,889.75 ms
2,267.70 ms
(84.16%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
583.75 ms
(+1.94%)Baseline: 572.63 ms
687.15 ms
(84.95%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
360.04 ms
(+4.00%)Baseline: 346.19 ms
415.43 ms
(86.67%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,359.25 ms
(+0.04%)Baseline: 2,358.19 ms
2,829.83 ms
(83.37%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,425.77 ms
(-0.02%)Baseline: 4,426.55 ms
5,311.86 ms
(83.32%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
247.33 ms
(+0.16%)Baseline: 246.95 ms
296.33 ms
(83.46%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13353
Testbedpnpr

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,434.69 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
301.62 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
296.28 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
82.84 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,353.30 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,443.80 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
257.23 ms
🐰 View full continuous benchmarking report in Bencher

zkochan added 2 commits July 26, 2026 01:32
`publishConfig.name` renames the artifact, so the registry only ever knows
the published name — but three probes still addressed the project by its
manifest name.

The unpublished-dirs probe decides whether a release is a *first* release,
which keeps the manifest version instead of bumping it. `pacquet` is an
unrelated 0.x package on npm with none of the Rust CLI's alpha versions, so
that probe reads the Rust CLI as never published on every release. It now
translates through the same rename map the changelog check uses.

Recursive publish probed the already-published check and picked the target
registry by the workspace name: a renamed package always looked absent, and
a rename that crosses scopes routed to the registry configured for the old
scope whenever the new one has no entry of its own.

Pack derived the tarball filename from the publish manifest's name, which
never passed the validation the manifest name goes through. An invalid
rename could put a path separator in the filename and write the tarball
outside the destination; both stacks now reject it with
ERR_PNPM_INVALID_PACKAGE_NAME, and TypeScript reuses `normalizePackageName`
rather than repeating the normalization inline.

Refs pnpm/pnpm#13345.
Copilot AI review requested due to automatic review settings July 25, 2026 23:39

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 66a851a

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (2)
pnpm/crates/cli/src/cli_args/publish/recursive.rs (1)

142-146: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use an implementation comment, not rustdoc, for this private helper.

publish_eligible is private, and most of this rustdoc repeats its branches. Keep only the non-obvious registry-name invariant as a regular // comment.

Proposed change
-/// A package's `(published name, version)` when it is eligible to be published,
-/// or `None` when it should be skipped before any registry lookup: an unnamed,
-/// unversioned, or private package is never published recursively. The name is
-/// the one the registry knows — the `publishConfig.name` rename, when the
-/// project has one — since it is only used to address the registry.
+// Registry probes use `publishConfig.name`, while release planning retains
+// manifest names elsewhere.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/src/cli_args/publish/recursive.rs` around lines 142 - 146,
Replace the rustdoc immediately above the private `publish_eligible` helper with
a concise regular `//` implementation comment. Retain only the non-obvious
invariant that the returned name uses the registry-facing `publishConfig.name`
rename, and remove the redundant branch-by-branch behavior description.

Sources: Coding guidelines, Path instructions

.changeset/pacquet-publish-config-name.md (1)

5-5: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Make the changeset user-facing.

This lists internal implementation details (pnpm-lock.yaml, release ledger, probes, registry selection). Reduce it to the observable publishing behavior and changelog fix.

Proposed change
-Added support for `publishConfig.name`, which publishes a package under a different name than the one its manifest carries in the workspace. Only the published artifact is renamed — dependents, `pnpm-lock.yaml`, and release tooling keep addressing the project by its manifest name — and the new name reaches the packed manifest, the tarball filename, and everything that addresses the package at the registry: the already-published check of `pnpm publish -r`, its registry selection, and the release-planning probes of `pnpm change status` and `pnpm version -r`. This also fixes the changelog of the Rust CLI itself, which is published as `pnpm` from a workspace project named `pacquet`: its release notes were composed under the workspace name and so never made it into the published package [`#13345`](https://github.com/pnpm/pnpm/issues/13345).
+Packages can use `publishConfig.name` to publish under a different package name. This also fixes release notes for the Rust CLI package published as `pnpm`.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.changeset/pacquet-publish-config-name.md at line 5, Rewrite the changeset
entry to describe only user-visible behavior: packages can publish under a
different name via publishConfig.name, including the published manifest and
tarball, and the Rust CLI changelog is correctly included when publishing as
pnpm. Remove internal implementation details such as lockfiles, release tooling,
probes, and registry selection.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.changeset/pacquet-publish-config-name.md:
- Line 5: Rewrite the changeset entry to describe only user-visible behavior:
packages can publish under a different name via publishConfig.name, including
the published manifest and tarball, and the Rust CLI changelog is correctly
included when publishing as pnpm. Remove internal implementation details such as
lockfiles, release tooling, probes, and registry selection.

In `@pnpm/crates/cli/src/cli_args/publish/recursive.rs`:
- Around line 142-146: Replace the rustdoc immediately above the private
`publish_eligible` helper with a concise regular `//` implementation comment.
Retain only the non-obvious invariant that the returned name uses the
registry-facing `publishConfig.name` rename, and remove the redundant
branch-by-branch behavior description.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7b67678b-5eba-41a2-b6f1-c35b6f93b860

📥 Commits

Reviewing files that changed from the base of the PR and between 296d61b and 66a851a.

📒 Files selected for processing (19)
  • .changeset/pacquet-publish-config-name.md
  • .changeset/publish-config-name.md
  • pnpm/crates/cli/src/cli_args/change.rs
  • pnpm/crates/cli/src/cli_args/changelog.rs
  • pnpm/crates/cli/src/cli_args/publish/recursive.rs
  • pnpm/crates/cli/src/cli_args/version.rs
  • pnpm/crates/cli/tests/change.rs
  • pnpm/crates/cli/tests/publish_recursive.rs
  • pnpm/crates/pack/src/lib.rs
  • pnpm/crates/pack/src/tests.rs
  • pnpm11/releasing/commands/src/change/index.ts
  • pnpm11/releasing/commands/src/publish/pack.ts
  • pnpm11/releasing/commands/src/publish/recursivePublish.ts
  • pnpm11/releasing/commands/src/publishedNames.ts
  • pnpm11/releasing/commands/src/resolveUnpublishedDirs.ts
  • pnpm11/releasing/commands/src/version/index.ts
  • pnpm11/releasing/commands/test/change/index.test.ts
  • pnpm11/releasing/commands/test/publish/pack.ts
  • pnpm11/releasing/commands/test/publish/recursivePublish.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • .changeset/publish-config-name.md
  • pnpm/crates/pack/src/lib.rs
  • pnpm/crates/cli/src/cli_args/changelog.rs

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 25, 2026
@zkochan
zkochan merged commit 291ab43 into main Jul 26, 2026
43 of 44 checks passed
@zkochan
zkochan deleted the fix-13345 branch July 26, 2026 00:20
kairosci added a commit to kairosci/pnpm that referenced this pull request Jul 27, 2026
…npm#13353)

The Rust CLI is a workspace project named `pacquet` that publishes as `pnpm`,
because the TypeScript CLI already owns that name in the workspace. The rename
happened in a CI shell step that rewrote the manifest just before publish, so
nothing in the repo could see it — and the release tooling, which keys parked
changelog sections, the ledger, and intents by the manifest name, looked the
renamed package up under a name the registry does not have. Two consequences:
the composed changelog was never found, so the published tarballs carry none at
all, and the publication check could never confirm a section, so sections and
their consumed intents accumulated instead of being collected.

Let the manifest state the rename instead. `name` joins the publishConfig
whitelist in both stacks, so a project can declare the name it publishes under
while keeping its workspace identity. Pack reads the name back off the publish
manifest so the tarball filename, the packed manifest, and the registry
metadata name one artifact, and the changelog paths now separate the two
identities: the parked section is still keyed by the manifest name, which the
ledger joins on, while the registry probe, the previous-changelog lookup, and
the composed changelog's title all use the published one.

The pacquet wrapper declares `publishConfig.name` and the generator no longer
rewrites the name. `@pnpm/exe`, generated by copying that manifest, strips the
inherited rename so it does not publish itself as `pnpm`.

Everything else that addresses the registry follows the same rule: the
unpublished-dirs probe behind `pnpm change status` and `pnpm version -r`, and
both the already-published check and the registry selection of
`pnpm publish -r`. Pack validates the rename before it reaches the tarball
filename, which the manifest-name check never covered.

Refs pnpm/pnpm#13345.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet product: pnpm@11 reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants