Include optional dependencies in pnpm dependency graphs

未关闭
#3 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
62/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
javascript, python
领域
backend

调研方向

Start in backend/app/scanners/analyzers/javascript.py where the _pnpm_packages parser reads dependencies:, then check how backend/app/models/dependency_relationship.py stores edge_type before deciding how optional edges are marked. Add fixture-based cases to backend/tests/scanners/test_javascript_analyzer.py for both pnpm v6 and v9 lockfiles, asserting optional and required edges separately. Done when optional edges are distinct, existing required-edge tests still pass, and the focused analyzer and scanner tests run green.

由索引模型根据 Issue 内容生成。

描述

enhancement good first issue

Summary

The _pnpm_packages parser currently collects relationships from dependencies: but not optionalDependencies:. This leaves optional package edges out of the pnpm dependency graph or risks treating them as required if added without preserving their kind.

Affected files

  • backend/app/scanners/analyzers/javascript.py
  • backend/app/models/dependency_relationship.py (inspect the existing graph representation before implementation)
  • backend/tests/scanners/test_javascript_analyzer.py

Scope

Parse optional dependency references in the supported pnpm v6 and v9 lockfile forms. The current graph model stores directed parent-to-child edges with an edge_type string; trace graph persistence and serialization so optional status remains distinguishable to consumers. Do not change existing required-edge semantics.

Acceptance criteria

  • Optional dependency references are parsed from supported pnpm v6 and v9 lockfiles.
  • Optional edges are represented distinctly using the existing graph model (or a compatible existing mechanism).
  • Optional dependencies are not classified as required dependencies.
  • Existing required dependencies: edges and pnpm graph behavior remain unchanged.
  • Focused fixture-based tests cover both lockfile versions and assert required and optional edge semantics separately.

Testing expectations

Run the focused JavaScript analyzer tests and relevant backend scanner tests. Include regression tests for current required dependency edges.

主要语言
Python
星标
2
派生
1
平均合并
1 小时 22 分钟
30 天内合并 PR
2

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ayushdoesdev/verspect 的其他 Issue

查看 ayushdoesdev/verspect 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。