Enhancement: apply pubspec.yaml `dependency_overrides` in Dart scans
维护者通常 1 天内回复
评估
- 难度
- 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 内容生成。
描述
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:andgit: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 scanreportshttpat1.2.1, not^0.13.0. - An overridden
dev_dependenciespackage 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 小时
- 30 天内合并 PR
- 76
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
vibgrate/cli 的其他 Issue
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
相似的 Issue
-
area: documentation status: in progress type: documentation
难度 1/5 1 小时以内 新手友好度 76/100
Oddmash/oddmash-ui#222 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
appium/appium-wincore-driver#169 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
india-ultimate/hub#715 ·
维护者通常 1 天内回复
-
documentation Entwickler
难度 1/5 1 小时以内 新手友好度 89/100
维护者通常 1 天内回复