pkg

package
v0.0.0-...-38831a8 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PackageConfig

type PackageConfig struct {
	Name            string            `json:"name"`
	Version         string            `json:"version"`
	Description     string            `json:"description,omitempty"`
	Dependencies    map[string]string `json:"dependencies,omitempty"`
	DevDependencies map[string]string `json:"devDependencies,omitempty"`
	Scripts         map[string]string `json:"scripts,omitempty"`
}

PackageConfig represents the shode.json configuration

type PackageInfo

type PackageInfo struct {
	Name        string `json:"name"`
	Version     string `json:"version"`
	Description string `json:"description,omitempty"`
	Main        string `json:"main,omitempty"`
	Homepage    string `json:"homepage,omitempty"`
	Repository  string `json:"repository,omitempty"`
}

PackageInfo represents information about an installed package

type PackageManager

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

PackageManager manages Shode package dependencies

func NewPackageManager

func NewPackageManager() *PackageManager

NewPackageManager creates a new package manager instance.

The package manager handles package initialization, dependency management, script execution, and registry operations. It automatically initializes a registry client with default configuration.

Returns a new PackageManager instance ready to use.

Example:

pm := pkg.NewPackageManager()
err := pm.Init("my-package", "1.0.0")

func (*PackageManager) AddDependency

func (pm *PackageManager) AddDependency(name, version string, dev bool) error

AddDependency adds a package dependency

func (*PackageManager) AddScript

func (pm *PackageManager) AddScript(name, command string) error

AddScript adds a script to the configuration

func (*PackageManager) GetConfig

func (pm *PackageManager) GetConfig() *PackageConfig

GetConfig returns the current package configuration

func (*PackageManager) GetConfigPath

func (pm *PackageManager) GetConfigPath() string

GetConfigPath returns the path to the config file

func (*PackageManager) GetRegistryClient

func (pm *PackageManager) GetRegistryClient() *registry.Client

GetRegistryClient returns the registry client

func (*PackageManager) Init

func (pm *PackageManager) Init(name, version string) error

Init initializes a new package configuration

func (*PackageManager) Install

func (pm *PackageManager) Install() error

Install installs all dependencies

func (*PackageManager) ListDependencies

func (pm *PackageManager) ListDependencies() error

ListDependencies lists all dependencies

func (*PackageManager) LoadConfig

func (pm *PackageManager) LoadConfig() error

LoadConfig loads the package configuration from shode.json

func (*PackageManager) Publish

func (pm *PackageManager) Publish() error

Publish publishes the current package to the registry

func (*PackageManager) RemoveDependency

func (pm *PackageManager) RemoveDependency(name string, dev bool) error

RemoveDependency removes a package dependency

func (*PackageManager) RemoveScript

func (pm *PackageManager) RemoveScript(name string) error

RemoveScript removes a script from the configuration

func (*PackageManager) RunScript

func (pm *PackageManager) RunScript(name string) error

RunScript runs a script from the configuration

func (*PackageManager) SaveConfig

func (pm *PackageManager) SaveConfig() error

SaveConfig saves the package configuration to shode.json

func (*PackageManager) Search

func (pm *PackageManager) Search(query string) ([]*registry.SearchResult, error)

Search searches for packages in the registry

Jump to

Keyboard shortcuts

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