Documentation
¶
Overview ¶
Package composition promotes DocumentSpecs into deterministic RenderManifests. It is the pure pipeline between collected document data and target-specific filesystem/compilation boundaries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrCatalogRequired = errors.New("composition catalog is required") ErrTargetRequired = errors.New("composition target is required") )
Functions ¶
func DirtySet ¶
func DirtySet(previous, next RenderManifest) []string
DirtySet compares two manifests and propagates changed component identities through reverse dependency edges.
Types ¶
type Composer ¶
type Composer struct {
// contains filtered or unexported fields
}
Composer promotes and renders immutable document values.
func (*Composer) Compose ¶
func (composer *Composer) Compose(ctx context.Context, spec document.DocumentSpec) (RenderManifest, error)
Compose performs validation, promotion, bounded rendering, and deterministic manifest assembly. Effects belong after this method.
type Fragment ¶
type Fragment struct {
ComponentID string `json:"componentId"`
Key component.Key `json:"key"`
Mode document.CompositionMode `json:"mode"`
Content []byte `json:"content,omitempty"`
Assets []document.AssetRef `json:"assets,omitempty"`
Children []string `json:"children,omitempty"`
Dependencies []string `json:"dependencies,omitempty"`
Hash string `json:"hash"`
}
Fragment is one content-addressed projection of a component.
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
MemoryCache is a race-safe content cache for long-lived composers and preview sessions.
func NewMemoryCache ¶
func NewMemoryCache() *MemoryCache
func (*MemoryCache) Put ¶
func (cache *MemoryCache) Put(key string, fragment Fragment)
type RenderManifest ¶
type RenderManifest struct {
DocumentID string `json:"documentId,omitempty"`
Theme string `json:"theme,omitempty"`
Target string `json:"target"`
RootOrder []string `json:"rootOrder"`
Fragments []Fragment `json:"fragments"`
SourceMap map[string]SourceLocation `json:"sourceMap"`
Dependencies map[string][]string `json:"dependencies"`
Sources map[string][]document.AssetRef `json:"sources"`
Hash string `json:"hash"`
Stats Stats `json:"stats"`
}
RenderManifest is the stable boundary value produced by composition.
type SourceLocation ¶
SourceLocation maps user-facing component identity to generated material.