Skip to content

chore: keep packageManager when cleaning package.json for release - #808

Merged
JounQin merged 1 commit into
mainfrom
fix/release-keep-package-manager
Oct 13, 2026
Merged

JounQin merged 1 commit into
mainfrom
fix/release-keep-package-manager

Conversation

@JounQin

@JounQin JounQin commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Keep packageManager when clean-pkg-json runs as part of yarn release:

-"release": "yarn check && mocha && clean-pkg-json && changeset publish",
+"release": "yarn check && mocha && clean-pkg-json --keep packageManager && changeset publish",

Why

The release of the pending Version Packages PR failed with:

Error: Yarn Classic is not supported. Please upgrade to Yarn Berry or another maintained package manager.
    at getPublishTool (.../@changesets/cli/dist/getPublishPlan.mjs:587:59)

Changesets v3 picks its publish tool by running yarn --version. clean-pkg-json strips packageManager from package.json before that point, so the corepack yarn shim has nothing to pin against and falls back to Yarn Classic:

$ corepack yarn --version   # packageManager present -> 4.18.1
$ corepack yarn --version   # packageManager removed -> 1.22.22

(1.22.22 is also corepack's fallback with no packageManager.)

Passing --keep packageManager keeps the shim pinned to Yarn Berry for the publish step. publishConfig (the provenance setting) is already in clean-pkg-json's default keep list, so it survives either way.

Verified locally that after clean-pkg-json --keep packageManager, packageManager is still present and corepack yarn --version still resolves to 4.18.1.

Summary by CodeRabbit

  • Chores
    • Published package metadata now retains its package manager information, improving consistency between the project’s package details and the manifest distributed with releases. This change affects release packaging only; it does not alter application features or behavior.

`clean-pkg-json` strips `packageManager` before `changeset publish`, so
the corepack `yarn` shim falls back to Yarn Classic (1.22.22). Changesets
v3 then aborts with "Yarn Classic is not supported" because it runs
`yarn --version` to choose a publish tool.

Pass `--keep packageManager` so the release keeps resolving Yarn Berry.
Copilot AI balanced review requested due to automatic review settings October 13, 2026 12:31
@changeset-bot

changeset-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3f72c6f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI left a comment

Copy link
Copy Markdown

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 Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 31aa7b3e-6467-49a9-ba63-c1cd01658866
📥 Commits

Reviewing files that changed from the base of the PR and between 7544956 and 3f72c6f.

📒 Files selected for processing (1)
  • package.json

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

📝 Walkthrough

The release script now passes --keep packageManager to clean-pkg-json before publishing.

Changes: Release metadata

Layer / File(s) Summary
Retain package manager metadata
package.json
The release script tells clean-pkg-json to keep the packageManager field.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 3f72c

The release cleanup is configured to retain the package manager metadata needed for Yarn selection. No actionable merge risk remains.

Pre-merge checks · Passed 5
Passed Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: preserving the packageManager field when cleaning package.json for release.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@pkg-pr-new

pkg-pr-new Bot commented Oct 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/eslint-plugin-prettier@808

commit: 3f72c6f

@JounQin
JounQin merged commit e6dd27a into main Oct 13, 2026
21 checks passed
@JounQin
JounQin deleted the fix/release-keep-package-manager branch October 13, 2026 12:37
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.

2 participants