Shopify / Shopify/rubydex

Generate visual representation of the index graph

Open
#70 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

easy
Dominant language
Rust
Stars
355
Forks
24
Avg merge
2d 6h
Merged PRs (30d)
17

Description

With https://github.com/Shopify/index/pull/69 we're moving the implementation of the index to a graph structure:

  • Nodes: names, definitions, URIs
  • Edges: name -> definitions, definition -> name, uri -> definition

Vini provided a visualization of the structure:

Image

Let's provide a way to automatically generate this kind of representation directly backed into the index.

So for example this:

$ index_cli path/to/files --dot graph.dot

Would directly generate the visual representation of the graph in DOT format. One can take inspiration from how we do it in Spoom's POSet: https://github.com/Shopify/spoom/blob/main/lib/spoom/poset.rb#L101-L129

Of course as we aim to index quite large codebases, we should find ways to make the output actually readable:

  • Should we be able to filter the edges we want to show?
  • Or the kind of nodes?
  • Or to focus on a node and only show n-parents/children?
  • Or is there a way to have an interactive map of the graph?
  • Should we also have a --mermaid output?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the index_cli entry point and the graph structure described in the issue, then review Spoom's POSet implementation for DOT generation. Define the supported filters, node and edge selection, and whether Mermaid or interactive output is in scope before implementing. Done means the index can generate a readable graph representation for a specified codebase.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.