Skip to content

fix: pnpm の override と解決版を確認して誤った更新報告を防ぐ - #53

Merged
owayo merged 1 commit into
mainfrom
fix/issue-51-pnpm-override-resolution
Oct 19, 2026
Merged

owayo merged 1 commit into
mainfrom
fix/issue-51-pnpm-override-resolution

Conversation

@owayo

@owayo owayo commented Oct 19, 2026

Copy link
Copy Markdown
Owner

概要

pnpm の overrides が直接依存を上書きし、manifest だけ更新されて lock が旧版でも成功と表示される問題を修正します。実効 override がある直接依存は理由付きでスキップし、固定・範囲の設定を保持します。親指定で無関係な直接依存を妨げず、スコープ付き依存と alias も扱います。

install 後は各 workspace の宣言キー・実名・解決版を照合します。目標未到達や確認不能な更新は成功件数から除き、JSON・text・quiet・diff で失敗として表示して終了コード2を返します。--no-age と --refresh-lock も対象です。

設計判断

override の自動変更は利用者の固定方針を変えるため採用せず、スキップする設計を選びました。版条件付きの selector は保守的に保護し、その可能性を理由に示します。旧 package.json の設定は実際の pnpm が11未満の場合だけ扱います。peer 単独の要件にローカルへのインストールを要求しません。

通常 install の確認失敗では検査用にファイルを保持し、refresh は既存の復元処理を使います。今回は pnpm を対象とし、出力は install の最終検証後に確定します。

検証

  • make ci: pass(fmt・clippy・全テスト)。追加したCLI E2Eも成功。
  • 修正前に回帰テストの失敗を確認。override の選別・workspace と alias の分離・古い版と欠落・peer 単独要件・refresh の復元を検証。
  • 実物の pnpm 10.33.0 / 12.9.1 で固定・範囲・親指定・旧設定・スコープ付き依存・alias を確認。
  • install が旧 lock を残す再現で、4種類の出力と refresh が更新0・失敗1・終了コード2になることを確認。
  • astro-sight と Codex のレビューを実施。selector の判定とルート manifest がない workspace の扱いを修正し、再レビューは問題なし。

Closes #51

pnpm の override が直接依存の指定を上書きすると、manifest だけが更新され、
lock の版が古いままでも更新成功と報告していた。
実効 override のある宣言は設定を維持して理由付きでスキップする。
install 後は importer・宣言キー・実パッケージ名・版を照合し、目標未到達を失敗に数える。
全出力を最終検証後に確定し、refresh の復元も維持する。
@owayo owayo self-assigned this Oct 19, 2026
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 851c5fef-ac63-41b3-b52e-7dee2ca3b4f5
  • 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.

@owayo
owayo merged commit b5ac3e2 into main Oct 19, 2026
8 checks passed
@owayo
owayo deleted the fix/issue-51-pnpm-override-resolution branch October 19, 2026 00:58
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.

pnpm の overrides が同じパッケージを指していると、--install が lockfile の版を上げないまま更新済みと表示する

1 participant