wolfi-dev / wolfictl

A CLI used to work with the Wolfi OSS project
Apache License 2.0
57 stars 54 forks source link

refactor: introduce general tree output rendering #1323

Closed luhring closed 3 days ago

luhring commented 3 days ago

The mission of this PR is to generalize the tree rendering logic we've used in wolfictl scan, wolfictl sbom, and other consumers of this code, so that we have a central way to render these trees, and can adjust aspects of rendering as needed for future enhancements.

The updated tree rendering implementation is now used by wolfictl scan. (Later we'll also use this for wolfictl sbom.) But the old tree rendering is left in place since it is exported and used elsewhere. It will be removed in a follow-up PR.

A guiding principle is that we don't want to export logic directly from the cli package. But the cli/components package is more appropriate for exporting and reuse.