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

Abierto
#678 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@vibgrate-team ya está trabajando en esto.

Desde el 13/11/2026.

  • #680 de @vibgrate-team — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
62/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
dart, flutter, typescript
Área
tooling

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
TypeScript
Estrellas
4
Forks
3
Merge medio
1 d 22 h
PR fusionados (30 d)
76

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de vibgrate/cli

Todos los issues de vibgrate/cli

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.