NPM
kind: npm
| source | condition | target |
|---|---|---|
✔ | ✔ | ✗ |
source
The NPM "source" retrieves the latest version of a npm package matching a specific version filter.
condition
The NPM "condition" test that a specific version is published on a NPM registry.
target
The NPM "target" is not supported as we couldn’t think about a useful usecase. Feel free to open an issue suggesting one.
Parameter
| Name | Type | Description | Required |
|---|---|---|---|
| name | string | Defines the specific npm package name | |
| npmrcpath | string | NpmrcPath defines the path to the .npmrc file | |
| registrytoken | string | RegistryToken defines the token to use when connection to the registry | |
| url | string | URL defines the registry url (defaults to https://registry.npmjs.org/) | |
| version | string | Defines a specific package version | |
| versionfilter | object | VersionFilter provides parameters to specify version pattern and its type like regex, semver, or just latest. | |
| kind | string | specifies the version kind such as semver, regex, or latest | |
| pattern | string | specifies the version pattern according the version kind for semver, it is a semver constraint for regex, it is a regex pattern for time, it is a date format | |
| regex | string | specifies the regex pattern, used for regex/semver and regex/time. Output of the first capture group will be used. | |
| strict | boolean | strict enforce strict versioning rule. Only used for semantic versioning at this time |
Example
# updatecli.yaml
name: NPM resource example
sources:
axios:
name: Get latest axios version from npm registry
kind: npm
spec:
name: axios
yaml:
name: get latest yaml version matching ~0
kind: npm
spec:
name: yaml
versionfilter:
kind: semver
pattern: ~0
conditions:
axios:
name: Test that axios version 1.0.0 exists on the NPM registry
kind: npm
disablesourceinput: true
spec:
name: axios
version: 1.0.0
yaml:
name: Test that that YAML version matching ~0 exist on registry
kind: npm
sourceid: yaml
spec:
name: yaml
targets:
# Targets are not supported