blocktypes

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package blocktypes assigns ordinary Blocks generated symbols from the resolved manifest. It does not replace persisted field identities or intern schemas.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Identifier

func Identifier(value string) string

Identifier derives a portable name from a resolved slug or field path.

func Shape

func Shape(block schema.BlockType) (string, error)

Shape compares resolved value contracts, excluding placement and author-facing metadata. It deliberately retains defaults, validation and reference targets.

func ValidName

func ValidName(name string) bool

ValidName limits explicit names to portable exported Go/TypeScript identifiers.

Types

type Catalog

type Catalog struct {
	Fields   map[schema.StableID]Field
	Variants []Variant
}

Catalog is a deterministic, generation-local index into resolved schemas.

func Build

func Build(snapshot schema.Snapshot) (*Catalog, error)

Build validates naming and reuse without mutating the manifest. Labels and presentation metadata never participate in a block's resolved shape.

type Field

type Field struct {
	Embedded      bool
	Name          string
	Discriminator string
	Identity      string
	Variants      []string
}

Field describes a named block container at an existing stable field identity.

type Variant

type Variant struct {
	Name          string
	Discriminator string
	Identity      string
	Block         schema.BlockType
}

Variant describes one reusable concrete generated type family.

Jump to

Keyboard shortcuts

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