Documentation
¶
Index ¶
Constants ¶
const DefaultMultiOutput = "stacklit-multi.json"
DefaultMultiOutput is where RunMulti writes when no output is given.
const GraphFile = "stacklit.graph.json"
GraphFile is the symbol graph refreshed alongside the index when present.
Variables ¶
This section is empty.
Functions ¶
func ParseReposFile ¶ added in v0.5.0
ParseReposFile reads one repo path per line. Blank lines and # comments are skipped, a leading ~ expands to the home directory, and relative paths resolve against the repos file's own directory so the list works from any cwd.
Types ¶
type MultiOptions ¶
type MultiOptions struct {
ReposFile string
Output string // defaults to DefaultMultiOutput in the current directory
Quiet bool
Timestamps bool // stamp generated_at; off by default so the file never churns
}
MultiOptions configures a RunMulti call.
type MultiResult ¶
type MultiResult struct {
OutputPath string
RepoCount int
Failed int
Duration time.Duration
Index *schema.MultiIndex
}
MultiResult holds the output of a RunMulti call.
func RunMulti ¶
func RunMulti(opts MultiOptions) (*MultiResult, error)
RunMulti scans every repo listed in a repos file without writing into any of them, then writes one combined index with per-repo package boundaries and cross-repo dependency edges.
type Options ¶
type Options struct {
Root string
Workspace string
InstallHook bool
Quiet bool
Summary bool
// NoWrite builds the index in memory only (used by multi-repo scans so
// member repos are never modified).
NoWrite bool
}
Options configures an engine Run.
type RefreshOptions ¶ added in v0.5.0
type RefreshOptions struct {
Root string
// Paths are files that changed, absolute or relative to Root.
Paths []string
// Debounce waits before processing so a burst of edits becomes one run.
// Negative means none; zero reads STACKLIT_REFRESH_DEBOUNCE_MS (default 30).
Debounce time.Duration
}
RefreshOptions selects what Refresh updates.
type RefreshResult ¶ added in v0.5.0
type RefreshResult struct {
// Status is refreshed, queued (another process holds the lock and will
// pick the paths up), no-index, or nothing (no file needed work).
Status string
Parsed int
Removed int
Bootstrapped bool
StructureHash string
// StructureChanged is true when the structure hash differs from before.
StructureChanged bool
Duration time.Duration
}
RefreshResult reports what a Refresh did.
func Refresh ¶ added in v0.5.0
func Refresh(o RefreshOptions) (*RefreshResult, error)
Refresh updates stacklit.json (and stacklit.graph.json when it exists) for the given files. Unchanged files are skipped by content hash, only changed files are parsed, and the outputs are rebuilt from stored per-file facts with the same code a full generate uses. Concurrent callers coalesce: the lock holder drains a queue the others append to.
type Result ¶
type Result struct {
JSONPath string
HTMLPath string
MermaidPath string
Index *schema.Index
Duration time.Duration
// Imports maps module name to its sorted unique import strings. Only
// filled when Options.NoWrite is set.
Imports map[string][]string
// Provides lists manifest names (root and workspaces) this repo publishes.
Provides []string
}
Result holds the output paths and assembled index from a Run.