1.0.2 • Published 6 years ago

api-console-dependency-manager v1.0.2

Weekly downloads
33
License
Apache-2.0
Repository
github
Last release
6 years ago

api-console-dependency-manager

Warning Warning Warning Warning

Moved to: https://www.npmjs.com/package/@api-components/api-console-dependency-manager

Do not use this version in new projects.

Warning Warning Warning Warning

https://travis-ci.org/advanced-rest-client/api-console-dependency-manager.svg?branch=master

A npm module to detect and install Mulesoft's API console dependencies.

This module is mainly used in the api-console-builder.

API

Shorthand functions:

  • installDependencies(workingDir, logger, opts) -> new DependendenciesManager#installDependencies(workingDir, logger, opts)

The module exposes 2 classes:

Example

const consoleDependencies = require('api-console-dependency-manager');

consoleDependencies.installDependencies('./build/', console, {
  verbose: true,
  parser: true,
  app: true
})
.then(() => console.log('Dependencies are now installed'))
.catch(cause => console.error(cause));

equivalent to

const {DependendenciesManager, DependenciesOptions} = require('api-console-github-resolver');

const options = new DependenciesOptions({
  verbose: true,
  parser: true,
  app: true
});
const workingDir = './build/';
const logger = console; // Winston or other with console like interface
const manager = new DependendenciesManager(workingDir, logger, options);
manager.installDependencies()
.then(() => console.log('Dependencies are now installed'))
.catch(cause => console.error(cause));

DependenciesOptions

PropertyTypeDefaultDescription
verboseBooleanfalsePrints verbose output while installing dependencies. This is used to build install command for bower which is printing console output by default.
parserBooleanfalseIf set it installs RAML javascript parser with the enhancer. Deprecated: This option is only relevant for the console version 4. It may be removed in future releases. Set isV4 option when using this one.
appBooleanfalseIf set it installs app-route element to support standalone application architecture of the API console. Deprecated: This option is only relevant for the console version 4. It may be removed in future releases. Set isV4 option when using this one.
isV4BooleanfalseCompatibility mode with API console version 4. If set then it works as module created for v4 (versions 0.x.x of the module)
optionalDependenciesArray<String>undefinedList of optional dependencies to install besides the ones installed with bower file. It contains the list to of bower dependencies as it would be defined in bower.json file. This isn relevant for console v5 build process which manages dependencies differently.

DependendenciesManager

Constructor

Arguments
PropertyTypeDescription
workingDirStringPath to a working directory where the console is processed. Usually it's where the bower.json file is.
optionsObject or DependenciesOptionsBuild options passed to the module.
loggerObjectAny logger with the interface compatible with platform's console object.

installDependencies()

Installs dependencies in the workingDir.

Return

Resolved promise when operation is completed.

Changes in stable version

  • Order of arguments is reversed
  • It uses locally installed Bower dependency and does not checks if bower is installed on local machine.
  • Now additional dependencies has to be defined in the configuration options