Documentation
¶
Overview ¶
Package packages resolves local Karty package archives and development folders.
Index ¶
- Constants
- Variables
- func CheckModules(ctx context.Context, project string, set *Set) error
- func Digest(data []byte) string
- func FolderRoots(ctx context.Context, project string) (map[string]string, error)
- func LoadSources(ctx context.Context, directory string) (map[string]Source, string, error)
- func MakeDirectories(root *os.Root, name string) error
- func Read(ctx context.Context, root *os.Root, name string, limit int64) ([]byte, error)
- func ResolveUI(ctx context.Context, directory string, assets project.Assets, set *Set) (project.Assets, error)
- func ValidPath(name string) bool
- func WriteGenerated(ctx context.Context, root *os.Root, name string, data []byte, immutable bool) error
- type Manifest
- type Processor
- type Resolved
- type Set
- type Source
- type Texture
- type UIComponent
- type UIExports
- type UIFont
- type WorldTexture
Constants ¶
const ( ManifestName = "karty-package.toml" InventoryName = "karty-package.files.json" MaxFiles = 8192 MaxFileBytes = 64 << 20 MaxTotalBytes = 512 << 20 MaxArchiveBytes = 256 << 20 MaxManifestBytes = 1 << 20 MaxPackages = 16 MaxTextures = 256 MaxPathDepth = 32 )
const MaxUIComponents = 128
Variables ¶
var ErrPackage = errors.New("invalid Karty package")
Functions ¶
func FolderRoots ¶
FolderRoots describes explicit development capabilities. The watcher opens a separate confined root for each; project path confinement is never relaxed.
func LoadSources ¶
func MakeDirectories ¶
MakeDirectories rejects every existing symlink component, including links confined within the root. Generated outputs must not redirect into user files.
func ResolveUI ¶
func ResolveUI(ctx context.Context, directory string, assets project.Assets, set *Set) (project.Assets, error)
ResolveUI adds package exports to the in-memory project, staging all inputs inside its root. Authored sources and the project's theme file stay untouched.
Types ¶
type Manifest ¶
type Manifest struct {
FormatVersion int `toml:"format_version"`
Name string `toml:"name"`
Version string `toml:"version"`
SDK string `toml:"sdk,omitempty"`
Prefabs string `toml:"prefabs,omitempty"`
Textures []Texture `toml:"textures,omitempty"`
UI UIExports `toml:"ui,omitempty"`
Processors []Processor `toml:"processors,omitempty"`
// GoModule is read from go.mod, never a second editable declaration.
GoModule string `toml:"-"`
}
func Export ¶
Export packages source bytes, never generated game outputs. ZIP order, timestamps, inventory and permissions are deterministic; links are rejected.
type Processor ¶
Processor declares a build tool. Import, export, restore and schema never run it. A consuming project must explicitly select it in build.processors.
type Set ¶
type UIComponent ¶
type UIExports ¶
type UIExports struct {
Components []UIComponent `toml:"components,omitempty"`
Layouts []string `toml:"layouts,omitempty"`
Images []Texture `toml:"images,omitempty"`
Fonts []UIFont `toml:"fonts,omitempty"`
Theme string `toml:"theme,omitempty"`
}
UIExports are authored sources, compiled against the consuming game's SDK. Component and layout names retain KartUI's ordinary filename convention.
type WorldTexture ¶
func ResolveWorld ¶
func ResolveWorld(ctx context.Context, set *Set, contents []byte, localTextures []string) ([]byte, []WorldTexture, error)
ResolveWorld merges selected static prefab exports into an ordinary authored world. Scalar types/null presence survive until the existing schema checks.