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

Aperta
#678 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@vibgrate-team ci sta già lavorando.

Dal 13/11/2026.

  • #680 di @vibgrate-team — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
62/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
dart, flutter, typescript
Ambito
tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
TypeScript
Stelle
4
Fork
3
Merge medio
1g 22h
PR unite (30g)
76

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vibgrate/cli

Tutte le issue di vibgrate/cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.