Documentation
¶
Index ¶
Constants ¶
const ( // ConfigFileName is the name of the config file ConfigFileName = "config.yaml" // DefaultConfigDir is the default directory for lvt configuration // This will be ~/.config/lvt/ on Unix systems DefaultConfigDir = ".config/lvt" )
const (
// ProjectConfigFileName is the name of the project config file
ProjectConfigFileName = ".lvtrc"
)
Variables ¶
This section is empty.
Functions ¶
func EnsureConfigDir ¶
func EnsureConfigDir() error
EnsureConfigDir creates the config directory if it doesn't exist using the default manager
func GetConfigDir ¶
GetConfigDir returns the directory containing the config file using the default manager
func GetConfigPath ¶
GetConfigPath returns the path to the config file using the default manager
func SaveConfig ¶
SaveConfig saves the configuration to the config file using the default manager
func SaveProjectConfig ¶
func SaveProjectConfig(basePath string, config *ProjectConfig) error
SaveProjectConfig saves the project configuration to .lvtrc in the specified directory
func SetConfigPath ¶
func SetConfigPath(path string)
SetConfigPath sets a custom config path for the default manager Deprecated: Use Manager.SetCustomPath for better thread safety
Types ¶
type Config ¶
type Config struct {
// KitPaths are additional paths to search for kits
// Standard paths (~/.config/lvt/kits/ and .lvt/kits/) are searched automatically
KitPaths []string `yaml:"kit_paths,omitempty"`
// Version tracks the config file version for future migrations
Version string `yaml:"version,omitempty"`
}
Config represents the lvt configuration
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a new Config with default values
func LoadConfig ¶
LoadConfig loads the configuration from the config file using the default manager If the file doesn't exist, returns a default config
func LoadConfigFromPath ¶
LoadConfigFromPath loads configuration from a specific path
func (*Config) AddKitPath ¶
AddKitPath adds a kit path to the config
func (*Config) RemoveKitPath ¶
RemoveKitPath removes a kit path from the config
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages configuration loading and saving with optional custom paths
func (*Manager) EnsureConfigDir ¶
EnsureConfigDir creates the config directory if it doesn't exist
func (*Manager) GetConfigDir ¶
GetConfigDir returns the directory containing the config file for this manager
func (*Manager) GetConfigPath ¶
GetConfigPath returns the path to the config file for this manager
func (*Manager) LoadConfig ¶
LoadConfig loads the configuration from the config file for this manager If the file doesn't exist, returns a default config
func (*Manager) SaveConfig ¶
SaveConfig saves the configuration to the config file for this manager
func (*Manager) SetCustomPath ¶
SetCustomPath sets a custom config path for this manager instance
type ProjectConfig ¶
type ProjectConfig struct {
// Module is the Go module name for the project
Module string
// Kit is the kit used for this project
Kit string
// Styles is the style adapter for components (e.g. "tailwind", "unstyled")
Styles string
// DevMode indicates whether to use local client library
DevMode bool
}
ProjectConfig represents the project-level configuration
func DefaultProjectConfig ¶
func DefaultProjectConfig() *ProjectConfig
DefaultProjectConfig returns a new ProjectConfig with default values
func LoadProjectConfig ¶
func LoadProjectConfig(basePath string) (*ProjectConfig, error)
LoadProjectConfig loads the project configuration from .lvtrc in the specified directory If the file doesn't exist, returns a default config
func (*ProjectConfig) GetKit ¶
func (c *ProjectConfig) GetKit() string
GetKit returns the kit for the project
func (*ProjectConfig) Validate ¶
func (c *ProjectConfig) Validate() error
Validate validates the project configuration