pnpm deprecate and unpublish: Registry Access Reimagined
Scritto da Alessio il 06/04/2026
Problem
pnpm was delegating pnpm deprecate and pnpm unpublish to npm's CLI. This added process overhead and didn't integrate with pnpm's architecture or support per-scope registries.
Solution
Created @pnpm/registry-access.commands package with three native commands:
pnpm deprecate <package>[@<version>] <message>: Sets deprecation on matching versionspnpm undeprecate <package>[@<version>]: Removes deprecationpnpm unpublish <package>[@<version>]: Supports versions, semver ranges,--forcefor entire packages
All commands share common logic for auth, registry selection via pickRegistryForPackage, and version matching. Payload sent to registry is minimal: only name + modified versions.deprecated fields.
Result
Direct registry interaction without CLI pass-through. Proper OTP and custom registry support.
Commits: pnpm/pnpm@d401ff250, pnpm/pnpm@2c90d406
PRs: #11120, #11128