Documentation
¶
Index ¶
- Constants
- func FindConfig(startDir string) (string, error)
- func ValidateDependencies(cfg *Config) error
- func WriteConfig(cfg *Config, configPath string) error
- type Config
- type ConsignmentConfig
- type Dependency
- type GitHubConfig
- type HistoryConfig
- type MetadataConfig
- type MetadataField
- type Package
- type RemoteConfig
- type TemplateConfig
- type TemplateSource
Constants ¶
const ( EcosystemGo = "go" EcosystemNPM = "npm" EcosystemPython = "python" EcosystemHelm = "helm" EcosystemCargo = "cargo" EcosystemDeno = "deno" )
Ecosystem types
Variables ¶
This section is empty.
Functions ¶
func FindConfig ¶ added in v0.2.0
FindConfig searches for a shipyard config file in the current directory and parent directories up to the repository root
func ValidateDependencies ¶ added in v0.2.0
ValidateDependencies checks that all package dependencies reference existing packages. Returns an error if any dependency references a non-existent package.
Validation rules:
- All dependency package names must exist in the config
- Self-dependencies are allowed (package depending on itself)
- Circular dependencies are allowed (will be handled by cycle detection)
- Empty dependency lists are valid
func WriteConfig ¶ added in v0.2.0
WriteConfig writes the configuration to a YAML file
Types ¶
type Config ¶ added in v0.2.0
type Config struct {
Extends []RemoteConfig `yaml:"extends,omitempty"`
Packages []Package `yaml:"packages"`
Templates TemplateConfig `yaml:"templates,omitempty"`
Metadata MetadataConfig `yaml:"metadata,omitempty"`
Consignments ConsignmentConfig `yaml:"consignments,omitempty"`
History HistoryConfig `yaml:"history,omitempty"`
GitHub GitHubConfig `yaml:"github,omitempty"`
}
Config represents the project-specific settings
func LoadFromDir ¶ added in v0.2.0
LoadFromDir loads the configuration from a directory It looks for shipyard.yaml, shipyard.yml, shipyard.json, or shipyard.toml First checks .shipyard/ subdirectory, then the root directory
func (*Config) GetPackage ¶ added in v0.2.0
GetPackage retrieves a package by name
func (*Config) Merge ¶ added in v0.2.0
Merge merges this config with another, with the overlay taking precedence
func (*Config) WithDefaults ¶ added in v0.2.0
WithDefaults returns a config with default values applied
type ConsignmentConfig ¶ added in v0.2.0
type ConsignmentConfig struct {
Path string `yaml:"path,omitempty"`
}
ConsignmentConfig holds consignment storage settings
type Dependency ¶ added in v0.2.0
type Dependency struct {
Package string `yaml:"package"`
Strategy string `yaml:"strategy,omitempty"` // "fixed" or "linked"
BumpMapping map[string]string `yaml:"bumpMapping,omitempty"`
}
Dependency represents a package dependency
type GitHubConfig ¶ added in v0.2.0
type GitHubConfig struct {
Owner string `yaml:"owner,omitempty"`
Repo string `yaml:"repo,omitempty"`
Token string `yaml:"token,omitempty"` // Format: "env:VAR_NAME"
}
GitHubConfig holds GitHub integration settings
type HistoryConfig ¶ added in v0.2.0
type HistoryConfig struct {
Path string `yaml:"path,omitempty"`
}
HistoryConfig holds history file settings
type MetadataConfig ¶ added in v0.2.0
type MetadataConfig struct {
Fields []MetadataField `yaml:"fields,omitempty"`
}
MetadataConfig defines custom metadata fields
type MetadataField ¶ added in v0.2.0
type MetadataField struct {
Name string `yaml:"name"`
Required bool `yaml:"required,omitempty"`
Type string `yaml:"type,omitempty"` // "string", "int", "list", "map"
// String validation
Pattern string `yaml:"pattern,omitempty"`
MinLength *int `yaml:"minLength,omitempty"`
MaxLength *int `yaml:"maxLength,omitempty"`
// Integer validation
Min *int `yaml:"min,omitempty"`
Max *int `yaml:"max,omitempty"`
// List validation
ItemType string `yaml:"itemType,omitempty"` // "string", "int"
MinItems *int `yaml:"minItems,omitempty"`
MaxItems *int `yaml:"maxItems,omitempty"`
// Common
AllowedValues []string `yaml:"allowedValues,omitempty"`
Default string `yaml:"default,omitempty"`
Description string `yaml:"description,omitempty"`
}
MetadataField defines a custom metadata field
type Package ¶
type Package struct {
Name string `yaml:"name"`
Path string `yaml:"path"`
Ecosystem string `yaml:"ecosystem,omitempty"`
VersionFiles []string `yaml:"versionFiles,omitempty"` // Use ["tag-only"] for tag-only mode
Dependencies []Dependency `yaml:"dependencies,omitempty"`
Templates *TemplateConfig `yaml:"templates,omitempty"`
}
Package represents a versionable package
type RemoteConfig ¶ added in v0.2.0
type RemoteConfig struct {
URL string `yaml:"url,omitempty"`
Git string `yaml:"git,omitempty"`
Path string `yaml:"path,omitempty"`
Ref string `yaml:"ref,omitempty"`
Auth string `yaml:"auth,omitempty"`
}
RemoteConfig represents a remote configuration source
func (*RemoteConfig) UnmarshalYAML ¶ added in v0.2.0
func (rc *RemoteConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements custom unmarshaling for RemoteConfig
type TemplateConfig ¶ added in v0.2.0
type TemplateConfig struct {
Changelog *TemplateSource `yaml:"changelog,omitempty"`
TagName *TemplateSource `yaml:"tagName,omitempty"`
ReleaseNotes *TemplateSource `yaml:"releaseNotes,omitempty"`
CommitMessage *TemplateSource `yaml:"commitMessage,omitempty"`
}
TemplateConfig holds template definitions
type TemplateSource ¶ added in v0.2.0
type TemplateSource struct {
Source string `yaml:"source,omitempty"`
Inline string `yaml:"inline,omitempty"`
}
TemplateSource represents a template source