graph

package
v0.38.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteDOT

func WriteDOT(w io.Writer, report *GraphReport)

WriteDOT writes the graph report in Graphviz DOT format.

func WriteJSON

func WriteJSON(w io.Writer, report *GraphReport) error

WriteJSON writes the graph report as machine-readable JSON.

func WriteText

func WriteText(w io.Writer, report *GraphReport)

WriteText writes the graph report in human-readable text format.

Types

type ActionInfo

type ActionInfo struct {
	Type     string `json:"type"`               // "create", "inject", "append"
	Target   string `json:"target"`             // output file path (raw frontmatter value)
	Marker   string `json:"marker,omitempty"`   // for inject actions
	Position string `json:"position,omitempty"` // "after" or "before"
}

ActionInfo describes a file operation performed by a generator template.

type BundleInfo

type BundleInfo struct {
	Name       string   `json:"name"`
	Order      []string `json:"order"`       // generator names in execution order
	ValidOrder bool     `json:"valid_order"` // true if create-before-inject respected
}

BundleInfo describes a bundle and its generator execution order.

type GeneratorNode

type GeneratorNode struct {
	Name    string       `json:"name"`
	Actions []ActionInfo `json:"actions"`
}

GeneratorNode represents a single generator and its file actions.

type GraphReport

type GraphReport struct {
	Generators []GeneratorNode `json:"generators"`
	Bundles    []BundleInfo    `json:"bundles"`
	Markers    []MarkerInfo    `json:"markers"`
	Warnings   []Warning       `json:"warnings"`
}

GraphReport holds the full generator dependency analysis result.

func Analyze

func Analyze(root string) (*GraphReport, error)

Analyze scans a template directory and returns a GraphReport describing the dependency graph between generators, files, and injection markers.

type MarkerInfo

type MarkerInfo struct {
	File   string   `json:"file"`
	Line   int      `json:"line"`
	Text   string   `json:"text"`
	UsedBy []string `json:"used_by"` // generator names that inject at this marker
}

MarkerInfo describes an injection marker found in scaffold source files.

type Warning

type Warning struct {
	Code      string `json:"code"`      // e.g. "missing_target", "file_conflict", "order_violation"
	Generator string `json:"generator"` // generator name
	Message   string `json:"message"`
}

Warning represents a potential issue found during analysis.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL