actions/install

Methods

static bowerInstall(cmpntopt, optionsopt, spawnOptionsopt) → {Promise}

Receives a list of components and an options object to install through bower.

The installation will automatically run during the run loop install phase.

Parameters:
Name Type Attributes Description
cmpnt String | Array <optional>

Components to install

options Object <optional>

Options to pass to dargs as arguments

spawnOptions Object <optional>

Options to pass child_process.spawn.

Returns:
Promise -

Resolved if install successful, rejected otherwise

static installDependencies(optionsopt) → {Promise}

Runs npm and bower, in sequence, in the generated directory and prints a message to let the user know.

Parameters:
Name Type Attributes Description
options Object <optional>
Properties
Name Type Attributes Default Description
npm Boolean | Object <optional>
true

whether to run npm install or can be options to pass to dargs as arguments

bower Boolean | Object <optional>
true

whether to run bower install or can be options to pass to dargs as arguments

yarn Boolean | Object <optional>
false

whether to run yarn install or can be options to pass to dargs as arguments

skipMessage Boolean <optional>
false

whether to log the used commands

Returns:
Promise -

Resolved once done, rejected if errors

Examples
this.installDependencies({
  bower: true,
  npm: true
}).then(() => console.log('Everything is ready!'));
this.installDependencies({
  yarn: {force: true},
  npm: false
}).then(() => console.log('Everything is ready!'));

static npmInstall(pkgsopt, optionsopt, spawnOptionsopt) → {Promise}

Receives a list of packages and an options object to install through npm.

The installation will automatically run during the run loop install phase.

Parameters:
Name Type Attributes Description
pkgs String | Array <optional>

Packages to install

options Object <optional>

Options to pass to dargs as arguments

spawnOptions Object <optional>

Options to pass child_process.spawn.

Returns:
Promise -

Resolved if install successful, rejected otherwise

static runInstall(installer, pathsopt, optionsopt, spawnOptionsopt) → {Promise}

Combine package manager cmd line arguments and run the install command.

During the install step, every command will be scheduled to run once, on the run loop. This means you can use Promise.then to log information, but don't return it or mix it with this.async as it'll dead lock the process.

Parameters:
Name Type Attributes Description
installer String

Which package manager to use

paths String | Array <optional>

Packages to install. Use an empty string for npm install

options Object <optional>

Options to pass to dargs as arguments

spawnOptions Object <optional>

Options to pass child_process.spawn. ref https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options

Returns:
Promise -

Resolved on installation success, rejected otherwise

static yarnInstall(pkgsopt, optionsopt, spawnOptionsopt) → {Promise}

Receives a list of packages and an options object to install through yarn.

The installation will automatically run during the run loop install phase.

Parameters:
Name Type Attributes Description
pkgs String | Array <optional>

Packages to install

options Object <optional>

Options to pass to dargs as arguments

spawnOptions Object <optional>

Options to pass child_process.spawn.

Returns:
Promise -

Resolved if install successful, rejected otherwise