mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-11 02:29:48 -04:00
Adds native `pnpm deprecate` and `pnpm undeprecate` commands that interact with the npm registry directly instead of delegating to the npm CLI. ## Changes - **New package `@pnpm/registry-access.commands`** — a new top-level domain for commands that manage packages on the registry - **`pnpm deprecate <package>[@<version>] <message>`** — sets a deprecation message on matching versions - **`pnpm undeprecate <package>[@<version>]`** — removes deprecation from already-deprecated versions - Updated `pnpm-workspace.yaml`, CLI registration, and meta-updater config - Removed `deprecate` from the not-implemented commands list - Added changeset ## Implementation Details - `registry-access/commands/src/deprecation/common.ts` — shared logic (auth, registry fetch, version matching) - `registry-access/commands/src/deprecation/deprecate.ts` — deprecate command handler - `registry-access/commands/src/deprecation/undeprecate.ts` — undeprecate command handler - Uses `pickRegistryForPackage` for per-scope registry support - Uses `createFetchFromRegistry`/`fetchWithDispatcher` for proxy/TLS support - Uses `@pnpm/npm-package-arg` for package spec parsing - Reuses `PackageMeta`/`PackageInRegistry` types from `@pnpm/resolving.registry.types` - Sends minimal payload (only `name` + modified `versions.deprecated` fields) to the registry ## Usage ```bash # Deprecate all versions pnpm deprecate my-package "This package is deprecated" # Deprecate a specific version pnpm deprecate my-package@1.0.0 "Use v2 instead" # Undeprecate all versions pnpm undeprecate my-package # Undeprecate a specific version pnpm undeprecate my-package@1.0.0 ``` --------- Co-authored-by: Zoltan Kochan <z@kochan.io>
5.5 KiB
5.5 KiB