Enhancement: apply pubspec.yaml `dependency_overrides` in Dart scans

オープン
#678 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@vibgrate-team がすでに取り組んでいます。

2026年11月13日 から。

  • #680 @vibgrate-team による — オープン

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
62/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
dart, flutter, typescript
領域
tooling

調査の方向性

Start with parsePubspecYaml in src/core-open/scanners/dart-scanner.ts (around lines 203-300), where the section tracking only handles dependencies and dev_dependencies. Teach it to read dependency_overrides entries in the same forms (one-line, version map, path, git), letting the override spec replace the declared spec for packages that appear in both, and decide how override-only packages are reported. Done when the example reports http at 1.2.1, overridden dev packages keep their dev flag, projects without the section are unchanged, and a new test beside test/dart-pubspec-map.test.ts passes under npm test.

索引モデルが issue の本文から書いたものです。

説明

enhancement

Context

In Dart and Flutter projects, dependency_overrides: in pubspec.yaml forces the version that actually gets resolved, whatever dependencies: or dev_dependencies: ask for:

dependencies:
  http: ^0.13.0

dependency_overrides:
  http: 1.2.1

parsePubspecYaml in src/core-open/scanners/dart-scanner.ts (around lines 203–300) only enters a section for dependencies: and dev_dependencies:. Any other top-level key, including dependency_overrides:, resets the section, so overrides are ignored. As a result, a project scanned without a pubspec.lock reports the ^0.13.0 constraint for http, even though the project builds with 1.2.1. A package that appears only in dependency_overrides is not reported at all.

What to do

  • Read dependency_overrides: entries in the same forms already supported for the other sections (one-line version, { version: … } maps, path: and git: entries).
  • When a package is both declared and overridden, use the override's spec for that package's row and keep it as a production or development dependency according to where it was declared.
  • Decide what to do with override-only packages (for example, report them as production rows) and write the choice down in the function's doc comment.
  • Add a test next to test/dart-pubspec-map.test.ts.

Acceptance

  • With the example above, vg scan reports http at 1.2.1, not ^0.13.0.
  • An overridden dev_dependencies package keeps its development flag.
  • Projects with no dependency_overrides: section produce exactly the same output as before.
  • New test passes with npm test.
主要言語
TypeScript
スター
4
フォーク
3
平均マージ
1日 22時間
マージ済み PR(30日)
76

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

vibgrate/cli のほかの issue

vibgrate/cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。