Skip to content

npm: レジストリで deprecated が付いた版を更新先に選ぶ (例: @testing-library/jest-dom 6.10.0) #7

Closed

Description

@owayo

概要

npm レジストリで deprecated が付いた版が、更新候補から外されずに更新先として選ばれる。

再現手順

{
  "dependencies": {
    "@testing-library/jest-dom": "^6.4.6"
  }
}
$ depup --dry-run --max-change minor
  @testing-library/jest-dom   6.4.6 → 6.10.0 [minor] (2026/07/20 19:04) ✓ OSV

6.10.0 には、レジストリで次の deprecated が付いている。

$ npm view @testing-library/jest-dom@6.10.0 deprecated
Incorrect minor release with breaking changes (Node >=22 and required @testing-library/dom peer). Use 6.9.1 for the 6.x line, or upgrade to 7.0.0.

depup --install の後の pnpm install も [WARN] deprecated @testing-library/jest-dom@6.10.0 を出す。

期待する動作

deprecated の版は候補から外し、この例では 6.x で deprecated でない最新の 6.9.1 を選ぶ。npm 自身も、範囲を解決するときは deprecated でない版を優先する (npm-pick-manifest)。

原因の見当

src/registry/npm.rs の NpmPackageResponse が versions: HashMap<String, IgnoredAny> で各版のマニフェストを読み捨てているため、deprecated フィールドを見ていない。src/update/version_info.rs の接尾辞 (-deprecated など) による除外はあるが、レジストリのメタデータで付いた deprecated は対象外になっている。

補足: 旧いメジャー系列の全版に deprecated が付くパッケージもある (例: eslint@8.57.1 は "This version is no longer supported")。今の版も候補もすべて deprecated のときは、更新しない (今の版のまま) 扱いでよいと思う。

環境

  • depup 26.9.101
  • macOS

Activity

  1. self-assigned this
    on Sep 30, 2026
  2. owayo commented on Sep 30, 2026

    @owayo
    OwnerAuthor

    #8 をマージして対応しました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions