Documentation
¶
Index ¶
- func ConfirmOverwrite() (bool, error)
- func DefaultPluginNames() []string
- func FormatVersionSources(sources []VersionSource) string
- func GenerateConfigWithComments(path string, selectedPlugins []string) ([]byte, error)
- func GenerateConfigWithDiscovery(path string, selectedPlugins []string, ...) ([]byte, error)
- func GenerateWorkspaceConfigWithComments(plugins []string, modules []DiscoveredModule) ([]byte, error)
- func IsValidTemplate(name string) bool
- func PromptPluginSelection(detectionSummary string) ([]string, error)
- func Run() *cli.Command
- func TemplateNames() []string
- type DiscoveredModule
- type PluginOption
- type ProjectContext
- type Template
- type VersionSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfirmOverwrite ¶
ConfirmOverwrite asks the user if they want to overwrite an existing .sley.yaml file.
func DefaultPluginNames ¶
func DefaultPluginNames() []string
DefaultPluginNames returns the names of plugins that are enabled by default.
func FormatVersionSources ¶
func FormatVersionSources(sources []VersionSource) string
FormatVersionSources formats the detected sources for display.
func GenerateConfigWithComments ¶
GenerateConfigWithComments creates a Config struct and returns it as YAML with helpful comments. The path parameter specifies the .version file path to use in the config. The selectedPlugins parameter should contain the names of plugins to enable.
func GenerateConfigWithDiscovery ¶
func GenerateConfigWithDiscovery(path string, selectedPlugins []string, syncCandidates []discovery.SyncCandidate) ([]byte, error)
GenerateConfigWithDiscovery creates a Config with dependency-check configuration based on discovered sync candidates.
func GenerateWorkspaceConfigWithComments ¶
func GenerateWorkspaceConfigWithComments(plugins []string, modules []DiscoveredModule) ([]byte, error)
GenerateWorkspaceConfigWithComments generates YAML config with workspace section. In workspace mode, the root path field is omitted since each module defines its own path.
func IsValidTemplate ¶
IsValidTemplate checks if the given name is a valid template.
func PromptPluginSelection ¶
PromptPluginSelection shows an interactive multi-select prompt for plugin selection. Returns the list of selected plugin names or an error if the user cancels.
func TemplateNames ¶
func TemplateNames() []string
TemplateNames returns the names of all available templates.
Types ¶
type DiscoveredModule ¶
DiscoveredModule represents a .version file found during workspace discovery.
type PluginOption ¶
PluginOption represents a selectable plugin with metadata.
func AllPluginOptions ¶
func AllPluginOptions() []PluginOption
AllPluginOptions returns all available plugins with their descriptions. The order matches the desired display order in the prompt.
type ProjectContext ¶
type ProjectContext struct {
IsGitRepo bool
HasPackageJSON bool
HasGoMod bool
HasCargoToml bool
HasPyprojectToml bool
}
ProjectContext holds information about the detected project environment.
func DetectProjectContext ¶
func DetectProjectContext() *ProjectContext
DetectProjectContext analyzes the current directory to detect project type and environment. This helps provide smart defaults and suggestions during initialization.
func (*ProjectContext) FormatDetectionSummary ¶
func (ctx *ProjectContext) FormatDetectionSummary() string
FormatDetectionSummary returns a human-readable summary of detected project features.
func (*ProjectContext) HasAnyDetection ¶
func (ctx *ProjectContext) HasAnyDetection() bool
HasAnyDetection returns true if any project features were detected.
func (*ProjectContext) SuggestedPlugins ¶
func (ctx *ProjectContext) SuggestedPlugins() []string
SuggestedPlugins returns a list of plugin names that would be useful for this project.
type Template ¶
Template represents a pre-configured set of plugins for common use cases.
func GetTemplate ¶
GetTemplate returns the template with the given name, or an error if not found.
type VersionSource ¶
type VersionSource struct {
// File is the source file path.
File string
// Version is the extracted version string.
Version string
// Format describes the file format (e.g., "package.json", "Cargo.toml").
Format string
}
VersionSource represents a detected version from an existing file.
func DetectExistingVersions ¶
func DetectExistingVersions() []VersionSource
DetectExistingVersions searches for version information in common project files. Returns all detected versions, allowing the user to choose which to use.
func GetBestVersionSource ¶
func GetBestVersionSource(sources []VersionSource) *VersionSource
GetBestVersionSource returns the most appropriate version source. Priority: package.json > Cargo.toml > pyproject.toml > Chart.yaml > plain text