npm

package
v0.76.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDummyRc added in v0.44.0

func CreateDummyRc() (string, error)

func GetMockClient added in v0.44.0

func GetMockClient(baseUrl string, mockedToken string, mockedBody string, mockedHTTPStatusCode int) *httpclient.MockClient

Types

type Data

type Data struct {
	Versions map[string]versions
	DistTags distTags `json:"dist-tags,omitempty"`
}

type Npm

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

Npm defines a resource of kind "npm"

func New

func New(spec interface{}) (*Npm, error)

New returns a new valid Npm package object.

func (Npm) Changelog

func (n Npm) Changelog() string

Changelog returns the link to the found npm package version's deprecated info

func (Npm) Condition

func (n Npm) Condition(source string, scm scm.ScmHandler) (pass bool, message string, err error)

Condition checks that an Npm package version exist

func (Npm) Source

func (n Npm) Source(workingDir string, resultSource *result.Source) error

Source returns the latest npm package version

func (Npm) Target

func (n Npm) Target(source string, scm scm.ScmHandler, dryRun bool, resultTarget *result.Target) error

type RcConfig added in v0.44.0

type RcConfig struct {
	Registries map[string]Registry
	Scopes     map[string]string
}

type Registry added in v0.44.0

type Registry struct {
	AuthToken string
	Url       string
}

type Spec

type Spec struct {
	// Defines the specific npm package name
	Name string `yaml:",omitempty"`
	// Defines a specific package version
	Version string `yaml:",omitempty"`
	// URL defines the registry url (defaults to `https://registry.npmjs.org/`)
	URL string `yaml:",omitempty"`
	// RegistryToken defines the token to use when connection to the registry
	RegistryToken string `yaml:",omitempty"`
	// VersionFilter provides parameters to specify version pattern and its type like regex, semver, or just latest.
	VersionFilter version.Filter `yaml:",omitempty"`
	// NpmrcPath defines the path to the .npmrc file
	NpmrcPath string `yaml:"npmrcpath,omitempty"`
}

Spec defines a specification for an Npm package parsed from an updatecli manifest file

func (*Spec) Validate

func (s *Spec) Validate() (err error)

Validate run some validation on the Npm struct

Jump to

Keyboard shortcuts

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