manifest

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindPath added in v0.2.2

func FindPath(dir string) string

FindPath returns the path to the manifest file in dir. It prefers melon.yaml but falls back to melon.yml for backwards compatibility. When neither file exists it returns the canonical melon.yaml path so callers receive a clear "file not found" error on Load.

func Save

func Save(m Manifest, path string) error

Save serializes m to YAML and writes it to path.

Types

type IndexConfig added in v0.3.7

type IndexConfig struct {
	// URLs is a list of custom index.yaml URLs to search.
	URLs []string `yaml:"urls,omitempty"`
	// PublicIndex, when false, suppresses the default public melon index so only
	// the custom URLs are searched. Defaults to true (public index included).
	PublicIndex *bool `yaml:"public_index,omitempty"`
}

IndexConfig holds optional custom index configuration for a project.

type Manifest

type Manifest struct {
	Name         string            `yaml:"name"`
	Version      string            `yaml:"version"`
	Description  string            `yaml:"description,omitempty"`
	Entrypoint   string            `yaml:"entrypoint"`
	Dependencies map[string]string `yaml:"dependencies,omitempty"`
	// Outputs maps target filenames to glob patterns of dep names to include.
	// Example: "CLAUDE.md": "*"  or  ".claude/SKILL.md": "github.com/alice/*"
	Outputs    map[string]string `yaml:"outputs,omitempty"`
	Tags       []string          `yaml:"tags,omitempty"`
	ToolCompat []string          `yaml:"tool_compat,omitempty"`
	// Vendor controls whether melon manages .gitignore for its cache and symlinks.
	// When nil or true, melon never touches .gitignore (default: vendor everything).
	// When false, melon keeps .gitignore in sync across install/add/remove.
	Vendor *bool `yaml:"vendor,omitempty"`
	// Index configures a custom skill registry. When absent, the default public
	// melon index is used.
	Index *IndexConfig `yaml:"index,omitempty"`
	// Policy configures source restrictions. When absent, all sources are permitted.
	Policy *PolicyConfig `yaml:"policy,omitempty"`
}

Manifest is the parsed representation of a project's melon.yaml.

func Load

func Load(path string) (Manifest, error)

Load reads and parses a melon.yaml file at the given path.

func (Manifest) IsVendored added in v0.3.5

func (m Manifest) IsVendored() bool

IsVendored reports whether the manifest is in vendor mode. Returns true when Vendor is nil (field absent) or explicitly true.

type PolicyConfig added in v0.4.0

type PolicyConfig struct {
	// AllowedSources is a list of glob patterns. Only dependency paths matching
	// at least one pattern are permitted by melon add and melon install.
	// When empty or absent, all sources are permitted.
	AllowedSources []string `yaml:"allowed_sources,omitempty"`
}

PolicyConfig holds optional source restriction policy for a project.

Jump to

Keyboard shortcuts

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