Include optional dependencies in pnpm dependency graphs

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

まだ誰も着手していません。

評価

難易度
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分
マージ済み PR(30日)
2

環境構築

はじめの一歩

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

ayushdoesdev/verspect のほかの issue

ayushdoesdev/verspect の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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