upgrade

package
v1.2.15 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package upgrade plans and applies transactional upgrades to generated projects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileDiff added in v1.0.0

type FileDiff struct {
	Path string `json:"path"`
	Diff string `json:"diff"`
}

FileDiff is a deterministic unified diff for one planned path.

type FrameworkTemplate

type FrameworkTemplate struct {
	TemplateName string
	TargetPath   string
}

FrameworkTemplate represents a framework element template and its target path

func GetFrameworkTemplates

func GetFrameworkTemplates(config *layout.ScaffoldConfig) []FrameworkTemplate

GetFrameworkTemplates returns the list of framework element templates These are the only files that get upgraded when running andurel upgrade

type GitAnalyzer

type GitAnalyzer struct {
	// contains filtered or unexported fields
}

GitAnalyzer represents git analyzer.

func NewGitAnalyzer

func NewGitAnalyzer(projectRoot string) *GitAnalyzer

NewGitAnalyzer creates a new git analyzer.

func (*GitAnalyzer) GetFileFromInitialCommit

func (g *GitAnalyzer) GetFileFromInitialCommit(relPath string) ([]byte, error)

GetFileFromInitialCommit returns file from initial commit.

func (*GitAnalyzer) GetModifiedFiles

func (g *GitAnalyzer) GetModifiedFiles() (map[string]bool, error)

GetModifiedFiles returns modified files.

func (*GitAnalyzer) IsClean

func (g *GitAnalyzer) IsClean() (bool, error)

IsClean reports whether clean.

type TemplateGenerator

type TemplateGenerator struct {
	// contains filtered or unexported fields
}

TemplateGenerator generates template artifacts.

func NewTemplateGenerator

func NewTemplateGenerator(targetVersion string) *TemplateGenerator

NewTemplateGenerator creates a new template generator.

func (*TemplateGenerator) RenderFrameworkTemplates

func (g *TemplateGenerator) RenderFrameworkTemplates(
	projectRoot string,
	config layout.ScaffoldConfig,
	extensions []string,
) (map[string][]byte, error)

RenderFrameworkTemplates renders all framework element templates and returns a map of file paths to their rendered content

type ToolSyncResult added in v1.0.0

type ToolSyncResult struct {
	Added    []string
	Removed  []string
	Updated  []string
	Metadata []string
}

ToolSyncResult represents the result of synchronizing tools

type UpgradeOptions

type UpgradeOptions struct {
	DryRun        bool
	Auto          bool
	Repair        bool
	TargetVersion string
}

UpgradeOptions configures upgrade behavior.

type UpgradeReport

type UpgradeReport struct {
	FromVersion   string
	ToVersion     string
	FilesReplaced int
	FilesRemoved  int

	ToolsAdded   int
	ToolsRemoved int
	ToolsUpdated int

	AddedTools          []string
	RemovedTools        []string
	UpdatedTools        []string
	ToolMetadataChanges []string
	ReplacedFiles       []string
	RemovedFiles        []string
	Diffs               []FileDiff
	DirtyWorktree       bool
	AlreadyCurrent      bool
	RepairAvailable     bool
	RepairApplied       bool

	Success bool
	Error   error
}

UpgradeReport represents upgrade report.

type Upgrader

type Upgrader struct {
	// contains filtered or unexported fields
}

Upgrader represents upgrader.

func NewUpgrader

func NewUpgrader(projectRoot string, opts UpgradeOptions) (*Upgrader, error)

NewUpgrader creates a new upgrader.

func (*Upgrader) Execute

func (u *Upgrader) Execute() (*UpgradeReport, error)

Execute performs the execute operation.

Jump to

Keyboard shortcuts

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