Skip to content

Create a dependency graph for the terminal #2

Description

@r4gus

The function fetchPackageDependencies() returns a map with values of type PackageInfo. Every package info contains references to other PackageInfo instances in the form of fingerprints, i.e. we have a flat data structure the resembles a (circular) dependency graph.

Having a function that generates a graph for the terminal serves at least two purposes:

  • Create a complete graph as the result of calling zat --graph, e.g., zat --graph --terminal.
  • Create a tree for a single package leaf that is part of the output when running zat --audit

zat audit example:

~/Dev/PassKeeZ$ zat --audit
Scanning build.zig.zon for vulnerabilities (8 package dependencies)

Package:      zbor
Version:      0.17.0
Title:        This is the first advisory published to zig-sec/advisory-db.
Date:         2025-03-16
ID:           ZIGSEC-2025-0001
Solution:     Don't worry! But you should upgrade anyway as a new zbor release is available.
Dependency tree:                                 <
keylib 0.6.1                                           < THIS IS NEW!
└── zbor 0.17.0                               <

error: 1 vulnerability found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions