Skip to content

Commit

Permalink
docs: improve and convert library design diagram to SVG
Browse files Browse the repository at this point in the history
It was lovingly hand drawn by yours truly in Excalidraw.

Signed-off-by: Austin Seipp <[email protected]>
  • Loading branch information
thoughtpolice committed Jan 8, 2025
1 parent e6c0692 commit a621d8c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 27 deletions.
39 changes: 12 additions & 27 deletions docs/technical/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,18 @@ the `.jj/repo/store/type` file. There are similar files for the other backends

### Overview

Here's a diagram showing some important types in the library crate. The
following sections describe each component.

```mermaid
graph TD;
ReadonlyRepo-->Store;
ReadonlyRepo-->OpStore;
ReadonlyRepo-->OpHeadsStore;
ReadonlyRepo-->ReadonlyIndex
MutableIndex-->ReadonlyIndex;
Store-->Backend;
GitBackend-->Backend;
LocalBackend-->Backend;
LocalBackend-->StackedTable;
MutableRepo-->ReadonlyRepo;
MutableRepo-->MutableIndex;
Transaction-->MutableRepo;
WorkingCopy-->TreeState;
Workspace-->WorkingCopy;
Workspace-->RepoLoader;
RepoLoader-->Store;
RepoLoader-->OpStore;
RepoLoader-->OpHeadsStore;
RepoLoader-->ReadonlyRepo;
Git-->GitBackend;
GitBackend-->StackedTable;
```
Here's a diagram showing some important types in the library crate, and how they
relate. For example, given a `Workspace`, you can use it to get a `WorkingCopy`
or a `RepoLoader`. A `Transaction` is required to acquire a `MutableRepo`, etc.
The following sections describe each component.

![Type diagram](types.svg)

_This diagram was created with [Excalidraw]. You can get a copy of it [at this
location][types-drawing], and Right Click > "Copy to Clipboard as SVG"._

[Excalidraw]: https://excalidraw.com/
[types-drawing]: https://excalidraw.com/#json=wuOSusqzm6MjoXatFk1kn,aCySj27AVmQMf7aJdMzMCw

### Backend

Expand Down
10 changes: 10 additions & 0 deletions docs/technical/types.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a621d8c

Please sign in to comment.