1.4.2 • Published 6 years ago

vanilla-cli-node-tools v1.4.2

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Vanilla's Command Line Interface

This tool is used to make various tasks easier for developers working on Vanilla Forums core or addons.

Current functionalities include:

  • Building frontend assets (scripts, stylesheets, and images)
  • Generating cache files for addons
  • Converting addons' info arrays to json

See the vanilla-cli docs for documentation about the different commands.

Table of Contents

Installation

See our Installation Docs and our Quickstart Guide.

Basic Usage

  • From the command line:
vanilla --help

or

vanilla SOME_COMMAND --help
  • From other php applications:
require('{{VANILLA_CLI_DIRECTORY}}/vendor/autoload.php');
$cli = new \Vanilla\Cli\Cli();
try {
    $cli->run($args); // Must be: array('vanilla', '{{COMMAND_NAME}}'[, options...])
} catch (Exception $e) {
    ...
}

Documentation

More detailed usage documentation can be found at our official vanilla-cli docs.

Tests

Some of the node.js build processes have unit and integration tests. Be sure that these pass before making pull requests. To run the tests:

The NodeTools tests are run using jest.

$ yarn install

$ yarn test
# Or 
$ yarn test --watch

Debugging

During local development you may want to run a debugger. This is supported for the primary PHP process.

PHP

Ensure you IDE is properly configured for XDebug.

How to setup PHPStorm for XDebug

Debugging in VsCode

Running the Debugger

Just export XDEBUG_CONFIG from your shell, set up your IDE to listen for XDebug, and run your vanilla command.

export XDEBUG_CONFIG="idekey=PHPSTORM"
vanilla some-command --some-argument