Documentation
¶
Overview ¶
Package atlas derives the Atlas JSON (docs/atlas.md): what each project is and how it moves, from the declared file and each checkout's own git history and manifest, with no host call.
Index ¶
Constants ¶
const DeclaredFile = "atlas.md"
DeclaredFile is ~/.f10/atlas.md, the user's own words about each project.
const Version = 1
Version is the spec version docs/atlas.md opens with.
Variables ¶
This section is empty.
Functions ¶
func Resolve ¶
func Resolve(ctx context.Context, decl Declared, scope []Checkout, roots []string) (map[string]Entry, error)
Resolve checks the declared file's rules, links and aliases included so a broken file fails on its first read, and maps each checkout to its entry. roots (nil without F10_ROOTS) turns a key matching nothing into a typo.
Types ¶
type Checkout ¶
type Checkout struct {
Main string
Name string // the main checkout's basename
ID string // the normalised remote; unused when Local
Local bool
}
A Checkout is one project in scope: its main checkout, never a linked worktree.
type Declared ¶
Declared is the declared file's frontmatter; unknown keys are refused by the reader, as for every user file.
type Document ¶
type Document struct {
Version int `json:"version"`
GeneratedAt string `json:"generated_at"`
Nodes []Node `json:"nodes"`
Edges []Edge `json:"edges"`
}
func Build ¶
func Build(ctx context.Context, entries map[string]Entry, scope []Checkout, now time.Time) (Document, []string)
Build reads every public checkout and only the manifests of an aliased one, so no private history reaches the process. The warnings are anonymous nodes' failed reads, because their closed shape has no error field.
type Edge ¶
type Edge struct {
From string `json:"from"`
To string `json:"to"`
Kind string `json:"kind"`
Source string `json:"source"`
Manifest string `json:"manifest,omitempty"`
Dev bool `json:"dev,omitempty"`
Relation string `json:"relation,omitempty"`
}
An Edge joins two nodes, not both anonymous: a manifest dependency or a declared link.
type Node ¶
type Node struct {
ID string `json:"id"`
Kind string `json:"kind"`
Name string `json:"name,omitempty"`
Alias string `json:"alias,omitempty"`
Role string `json:"role,omitempty"`
Status string `json:"status,omitempty"`
Tagline string `json:"tagline,omitempty"`
Language string `json:"language,omitempty"`
FirstCommit string `json:"first_commit,omitempty"`
LastCommit string `json:"last_commit,omitempty"`
CommitsPerMonth []Month `json:"commits_per_month,omitempty"`
LatestTag *Tag `json:"latest_tag,omitempty"`
Error string `json:"error,omitempty"`
}
A Node is a public node, or an anonymous one carrying only ID, Kind and Alias; every optional field is absent rather than empty.