installer

package
v0.0.0-...-3b06f3a Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package installer provides dependency installation capabilities for Node.js, Python, and .NET projects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallNodeDependencies

func InstallNodeDependencies(project types.NodeProject) error

InstallNodeDependencies installs dependencies using the detected package manager.

func RestoreDotnetProject

func RestoreDotnetProject(project types.DotnetProject) error

RestoreDotnetProject runs dotnet restore on a project.

func SetupPythonVirtualEnv

func SetupPythonVirtualEnv(project types.PythonProject) error

SetupPythonVirtualEnv creates a virtual environment and installs dependencies.

Types

type DependencyInstallError

type DependencyInstallError struct {
	ProjectType    string
	ProjectDir     string
	PackageManager string
	Command        string
	Err            error
}

DependencyInstallError represents an error during dependency installation.

func (*DependencyInstallError) Error

func (e *DependencyInstallError) Error() string

Error implements the error interface.

func (*DependencyInstallError) Unwrap

func (e *DependencyInstallError) Unwrap() error

Unwrap returns the underlying error.

type ParallelInstaller

type ParallelInstaller struct {
	Verbose bool // Show full installation output
	// contains filtered or unexported fields
}

ParallelInstaller handles parallel installation of multiple projects with progress tracking.

func NewParallelInstaller

func NewParallelInstaller() *ParallelInstaller

NewParallelInstaller creates a new parallel installer.

func NewParallelInstallerWithContext

func NewParallelInstallerWithContext(ctx context.Context) *ParallelInstaller

NewParallelInstallerWithContext creates a new parallel installer with cancellation support.

func (*ParallelInstaller) AddDotnetProject

func (pi *ParallelInstaller) AddDotnetProject(project types.DotnetProject)

AddDotnetProject adds a .NET project installation task.

func (*ParallelInstaller) AddNodeProject

func (pi *ParallelInstaller) AddNodeProject(project types.NodeProject)

AddNodeProject adds a Node.js project installation task.

func (*ParallelInstaller) AddPythonProject

func (pi *ParallelInstaller) AddPythonProject(project types.PythonProject)

AddPythonProject adds a Python project installation task.

func (*ParallelInstaller) AddTask

func (pi *ParallelInstaller) AddTask(task ProjectInstallTask)

AddTask adds a new installation task.

func (*ParallelInstaller) FailedProjects

func (pi *ParallelInstaller) FailedProjects() []string

FailedProjects returns a list of project descriptions that failed installation.

func (*ParallelInstaller) GetResults

func (pi *ParallelInstaller) GetResults() []ProjectInstallResult

GetResults returns all installation results.

func (*ParallelInstaller) HasFailures

func (pi *ParallelInstaller) HasFailures() bool

HasFailures returns true if any installation failed.

func (*ParallelInstaller) Run

func (pi *ParallelInstaller) Run() error

Run executes all tasks with progress tracking. Tasks are grouped by package manager to avoid race conditions: - pnpm tasks run sequentially (shared global store causes conflicts) - All other tasks (npm, yarn, pip, dotnet) run in parallel

func (*ParallelInstaller) TotalProjects

func (pi *ParallelInstaller) TotalProjects() int

TotalProjects returns the total number of projects that were processed.

type ProjectInstallResult

type ProjectInstallResult struct {
	Task    ProjectInstallTask
	Success bool
	Error   error
}

ProjectInstallResult represents the result of a project installation.

type ProjectInstallTask

type ProjectInstallTask struct {
	ID          string
	Description string
	Type        string
	Dir         string
	Path        string
	Manager     string
	Project     interface{} // Store the actual project for installation
}

ProjectInstallTask represents a single project installation task.

type VirtualEnvError

type VirtualEnvError struct {
	ProjectDir string
	Tool       string
	Err        error
}

VirtualEnvError represents an error during virtual environment setup.

func (*VirtualEnvError) Error

func (e *VirtualEnvError) Error() string

Error implements the error interface.

func (*VirtualEnvError) Unwrap

func (e *VirtualEnvError) Unwrap() error

Unwrap returns the underlying error.

Jump to

Keyboard shortcuts

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