@bva/bva-cli

1.0.0 • Public • Published

bva-cli

A simple CLI tool used for internal dev things.

Table of Contents

Install

Copy/paste the following command into your terminal:

yarn global add @bva/bva-cli

How To Use

This tool is used by calling bva and passing options to it. For example, if you want to install the Recommendations module to a Slate project you would do:

bva --add @bva/recommendations

Command Options

  • -i --interactive - Uses interactive mode to make it easier to accomplish tasks.

Non interactive commands provide a specific level of control, but most important things can be accomplished by using interactive mode.

  • -a --add - Adds a module to the project its being called from (see below for current list of modules) - Ex: bva --add module-name
  • --add-help - Display the help menu for --add
  • -l --list - Lists all items associated with a specific list type (bva --list module)
  • -h --help - Displays the help menu (bva --help)
  • -v --version - Displays the CLI version (bva --version)

Subhelp Menus

All command options that take arguments will also have an associated help menu to go along with them. To view these help menus you just need to use help as the argument. An example would look like bva --list help. An alias for h will also be accepted bva --list h.

How To Add A Module

Modules are automatically added if certain things are done within the module's codebase. At the simplest level, a module can be added by:

  1. Making sure the name of the module is @bva/module-name in package.json
  2. Adding keywords":["bva-module"] to package.json
  3. Publishing the package to NPM

This will create a BVA scoped package and by adding bva-module as a keyword the CLI tool knows to treat the package as a BVA module.

Adding Files to Slate Projects

Doing the above will allow your package to either yarn add in the Slate project it's requested for, but that's not the main benefit. The main benefit of using the CLI tool for installing BVA modules is extra files can also be added to the project. The purpose of these extra files is to provide developers with the ability to rapidly develop a feature using the module. So usually these files would include some of the baseline required code to get the module working. To add extra files to modules, do the following:

  1. Create a root level folder called templates. Steps 2-5 are performed within the templates folder.
  2. (optional) To add a JS file, create a file with the following structure: bva-module-name.js
  3. (optional) To add a stylesheet, create a file with the following structure: bva-module-name.scss
  4. (optional) To add a section, create a file with the following structure: section-bva-module-name.liquid
  5. (optional) To add a snippet, create a files with the following structure: snippet-bva-module-name.liquid

Any or all of the files above marked (optional) can be omitted and everything else will be handled by the CLI tool.

Contributing

See the wiki for details

Changelog

To see the most recent changes view the CHANGELOG.

Readme

Keywords

Package Sidebar

Install

npm i @bva/bva-cli

Weekly Downloads

11

Version

1.0.0

License

none

Unpacked Size

277 kB

Total Files

76

Last publish

Collaborators

  • bvaadmin