Documentation
¶
Overview ¶
Package operations provides reusable operations for module manipulation.
Index ¶
- func DeriveDependencyName(path string) string
- func SyncDependencies(registry *plugins.PluginRegistry, version semver.SemVersion, ...) error
- type BumpOperation
- func (op *BumpOperation) Execute(ctx context.Context, mod *workspace.Module) error
- func (op *BumpOperation) Name() string
- func (op *BumpOperation) Preview(ctx context.Context, path string) (BumpResult, error)
- func (op *BumpOperation) Write(ctx context.Context, path string, version semver.SemVersion) error
- type BumpResult
- type BumpType
- type PreOperation
- type SetOperation
- type ShowOperation
- type ValidateOperation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeriveDependencyName ¶ added in v0.12.1
DeriveDependencyName extracts a display name from a file path. For .version files, uses the parent directory name. For other files (package.json, etc.), uses the filename.
func SyncDependencies ¶ added in v0.12.1
func SyncDependencies(registry *plugins.PluginRegistry, version semver.SemVersion, bumpedPaths ...string) error
SyncDependencies updates all configured dependency files to match the new version. Returns nil if dependency checker is not enabled or auto-sync is disabled. The bumpedPaths parameter contains paths that were already bumped as modules and should be excluded from the output (they're still synced but not displayed twice).
Types ¶
type BumpOperation ¶
type BumpOperation struct {
// contains filtered or unexported fields
}
BumpOperation performs a version bump on a module.
func NewBumpOperation ¶
func NewBumpOperation(fs core.FileSystem, bumper semver.VersionBumper, bumpType BumpType, preRelease, metadata string, preserveMetadata bool) *BumpOperation
NewBumpOperation creates a new bump operation.
func (*BumpOperation) Name ¶
func (op *BumpOperation) Name() string
Name returns the name of this operation.
func (*BumpOperation) Preview ¶ added in v0.12.1
func (op *BumpOperation) Preview(ctx context.Context, path string) (BumpResult, error)
Preview calculates the new version without writing it. This allows callers to inspect the result for hooks and validation before committing the write via Write().
func (*BumpOperation) Write ¶ added in v0.12.1
func (op *BumpOperation) Write(ctx context.Context, path string, version semver.SemVersion) error
Write saves the given version to the specified path. Used after Preview() when the caller has completed hooks and validation.
type BumpResult ¶ added in v0.12.1
type BumpResult struct {
PreviousVersion semver.SemVersion
NewVersion semver.SemVersion
}
BumpResult holds the result of a version bump calculation.
type PreOperation ¶
type PreOperation struct {
// contains filtered or unexported fields
}
PreOperation sets or increments pre-release labels on a module.
func NewPreOperation ¶
func NewPreOperation(fs core.FileSystem, label string, increment bool) *PreOperation
NewPreOperation creates a new pre-release operation.
func (*PreOperation) Name ¶
func (op *PreOperation) Name() string
Name returns the name of this operation.
type SetOperation ¶
type SetOperation struct {
// contains filtered or unexported fields
}
SetOperation sets the version of a module to a specific value.
func NewSetOperation ¶
func NewSetOperation(fs core.FileSystem, version string) *SetOperation
NewSetOperation creates a new set operation.
func (*SetOperation) Name ¶
func (op *SetOperation) Name() string
Name returns the name of this operation.
type ShowOperation ¶
type ShowOperation struct {
// contains filtered or unexported fields
}
ShowOperation reads and displays the current version of a module.
func NewShowOperation ¶
func NewShowOperation(fs core.FileSystem) *ShowOperation
NewShowOperation creates a new show operation.
func (*ShowOperation) Execute ¶
Execute reads the version from the module. The version is stored in the module's CurrentVersion field.
func (*ShowOperation) Name ¶
func (op *ShowOperation) Name() string
Name returns the name of this operation.
type ValidateOperation ¶
type ValidateOperation struct {
// contains filtered or unexported fields
}
ValidateOperation validates the version file of a module.
func NewValidateOperation ¶
func NewValidateOperation(fs core.FileSystem) *ValidateOperation
NewValidateOperation creates a new validate operation.
func (*ValidateOperation) Execute ¶
Execute validates the version file in the module. The current version is stored in the module's CurrentVersion field on success.
func (*ValidateOperation) Name ¶
func (op *ValidateOperation) Name() string
Name returns the name of this operation.