durable-update

0.0.6 • Public • Published

durable-update


Node.js module that allows for easy dependency management

Usage

Install durable-update with npm

npm install --save-dev durable-update

Run durable-update.js

./node_modules/durable-update/bin/durable-update.js

Configuration

Update your package.json file to add a durable-update attribute with configuration to customize the update process on your project to your needs.

Below is the default configuration:

{
//  ...
  "durable-update" : {
      order         : [ 'standard', 'dev', 'optional' ],
      targetVersion : {
        standard : {
          tag : 'stable',
          semver : 'minimum',
        },
        dev : {
          tag : 'stable',
          semver : 'minimum',
        },
        optional : {
          tag : 'stable',
          semver : 'minimum',
        },
      },
      upgradeType   : 'single',
      // upgradeType   : 'all',
      // onFailure     : 'abort',
      onFailure     : 'skip',
      testCommands  : [ 'npm test' ],
      scmCommands    : [ 'git commit -F %file %manifest' ]
    },
//  ...
}

order

An array of enumerated strings representing each type of dependency found in the package manifest.

Value Definition
standard refers to dependencies in package manifest
dev refers to devDependencies in package manifest
optional refers to optionalDependencies in package manifest

targetVersion

For each dependency type denoted by the order enumeration, one can specify the target version to which to update a given dependency of that type.

{
  tag : ...,
  semver : ...,
}

tag

Value Definition
stable refers to the latest stable version that is published
latest refers to the absolute latest version that is published, even if it is considered experimental

semver

Value Definition
exact specifies that the dependency semver should be exact (e.g: 0.1.2)
minimum specifies that the dependency semver should be at least a certain version (e.g: ^0.1.2)
loose specifies that the dependency semver should be any patch increment version (e.g: `~0.1.2)

upgradeType

How many dependencies to update in a single run

Value Definition
single will cause durable-update to finish after successfully updating a single dependency
all will cause durable-update to finish after successfully attempting to update all dependencies

onFailure

What action to take on a failed dependency update

Value Definition
about will cause durable-update exit on the first failed dependency update
skip will cause durable-update to skip any failed dependency update

testCommands

An Array of commands that need to be run in order to thoroughly test the package. The failure (non-zero return code) of any of these commands will be treated as a failure to successfully update.

scmCommands

An Array of commands that need to commit changes to source control management. The failure (non-zero return code) of any of these commands will be treated as a failure to successfully commit changes. Certain substitutions are supported.

Substitutions

Value Definition
%message replaced with the commit message
%file replaced with the filepath to a file containing the commit message
%manifest replaced with the filepath to the manifest file updated by durable-update

Package Sidebar

Install

npm i durable-update

Weekly Downloads

1

Version

0.0.6

License

MIT

Last publish

Collaborators

  • blackhawk56