render

package
v0.1.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: GPL-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package render executes the embedded template tree over the IR, producing the complete file plan for a generated repository. Rendering is pure — []File in memory; Write materializes a plan under the regeneration-safety rules (markers, internal/custom/ emitted once).

Index

Constants

View Source
const Marker = "Code generated by biscuit. DO NOT EDIT."

Marker is the generated-file header line. Files whose on-disk copy lacks it are treated as user-owned and never rewritten. No biscuit version inside — golden bytes must not churn on biscuit releases.

Variables

This section is empty.

Functions

func OutputDir

func OutputDir(api *ir.API, cfg *config.Config) string

OutputDir resolves where the generated repo lands: output.dir when set, else ./{binary}-cli next to the working directory.

Types

type File

type File struct {
	Path       string // slash-separated, relative to the output dir
	Contents   []byte
	Executable bool
	EmitOnce   bool // written when absent, never overwritten (internal/custom/)
}

func Render

func Render(api *ir.API, cfg *config.Config, prov Provenance) ([]File, error)

Render produces the full file plan. One render unit per output file — the invariant that will let the unit loop fan out with no locking once the benchmark asks for it (PRD: generation pipeline). Sequential today.

type Provenance

type Provenance struct {
	SpecPath   string
	SpecSHA256 string
}

Provenance records where the spec came from, written to .biscuit-state.yml.

type WriteResult

type WriteResult struct {
	Written         []string
	SkippedCustom   []string // EmitOnce files that already existed
	SkippedUnmarked []string // existing files without the marker: user-owned
}

WriteResult reports what Write actually touched.

func WriteFiles

func WriteFiles(dir string, files []File) (*WriteResult, error)

WriteFiles materializes a plan under dir. Regeneration touches only marked files: an existing file without the marker has been taken over by the user (or never carried one) and is left alone — except when the planned contents carry no marker either (go.sum can't hold comments; it stays machine-owned).

Jump to

Keyboard shortcuts

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