Documentation
¶
Overview ¶
THE single schema-concatenation contract (R3).
Both the runtime (charly core (cue_schema.go) `sharedCueSchema`) and the dev-time code generator (internal/schemagen) need to concatenate every package-less schema/*.cue file into ONE compilation unit. They used to carry two byte-identical-by-comment copies of the same loop; this is the ONE copy they both call, so the compiled schema (what the runtime validates against) and the generated Go types (`cue exp gengotypes`) can never drift.
Leaf package (no deps beyond stdlib `io/fs`) so the dev-time generator can call it WITHOUT importing the spec package it regenerates.
STANDALONE: depends only on the stdlib `io/fs` abstraction, so the runtime passes its `//go:embed` FS and the generator passes `os.DirFS(schemaDir)`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConcatSchema ¶
ConcatSchema reads every `*.cue` file in fsys under dir (skipping any for which exclude reports true — pass nil to include all), sorts the names for a deterministic result, and joins the file bodies with a trailing newline. It returns the joined body (WITHOUT any package clause) and the sorted list of files included.
Types ¶
This section is empty.