Members

(static, constant) appToPlugin :TCommand

Command definition object for converting a Bajo app to a plugin.

(static, constant) createApp :TCommand

Command definition object for creating a Bajo app project.

(static, constant) createPlugin :TCommand

Command definition object for creating a Bajo plugin project.

(static, constant) templates :TCommand

Command definition object for listing project templates.

Methods

(async, static) buildPackageJson(options) → {Promise.<object>}

Build the package.json file for a new project.

Parameters:
NameTypeDescription
optionsobject

Parameters

Properties
NameTypeDescription
argvobject

Command line arguments

sessionobject

Session data

typestring

Project type

Returns:
  • The generated package.json object
Type: 
Promise.<object>

(async, static) cancelProject() → {Promise.<void>}

Cancel project creation and optionally remove the project directory.

Returns:
Type: 
Promise.<void>

(async, static) copyMain(options) → {Promise.<void>}

Copy the main plugin files to the target directory and update the main class.

Parameters:
NameTypeDescription
optionsobject

Parameters

Properties
NameTypeDescription
cwdstring

Current working directory

argvobject

Command line arguments

Returns:
Type: 
Promise.<void>

(async, static) copyRootFiles(options) → {Promise.<void>}

Copy the root files of the project to the target directory and modify the license.

Parameters:
NameTypeDescription
optionsobject

Parameters

Properties
NameTypeDescription
pkgobject

Package information

cwdstring

Current working directory

tplDirstring

Template directory

filesArray.<string>

Files to copy

Returns:
Type: 
Promise.<void>

(async, static) copySkel(options) → {Promise.<void>}

Copy the project skeleton to the target directory.

Parameters:
NameTypeDescription
optionsobject

Parameters

Properties
NameTypeDescription
cwdstring

Current working directory

tplDirstring

Template directory

Returns:
Type: 
Promise.<void>

(async, static) customInstall(options) → {Promise.<object>}

Custom installation process for selecting templates and plugins.

Parameters:
NameTypeDescription
optionsobject

Parameters

Properties
NameTypeDescription
argvobject

Command line arguments

typestring

Type of project (app or plugin)

sessionobject

Session information

Returns:
  • Selected options
Type: 
Promise.<object>

(async, static) dirNameCheck(argv, cwd) → {Promise.<string>}

Check the validity of the directory name and npm package name.

Parameters:
NameTypeDescription
argvobject

Command line arguments

cwdstring

Current working directory

Returns:
  • Validated directory path
Type: 
Promise.<string>

(async, static) endOfISession() → {Promise.<string>}

Prompt the user at the end of an interactive session.

Returns:
  • User's choice
Type: 
Promise.<string>

(async, static) ensureDir(cwd) → {Promise.<void>}

Ensure the project directory exists and change the current working directory to it.

Parameters:
NameTypeDescription
cwdstring

Current working directory

Returns:
Type: 
Promise.<void>

(async, static) installPackages() → {Promise.<void>}

Install project dependencies.

Returns:
Type: 
Promise.<void>

(async, static) modifyLicense(options) → {Promise.<void>}

Modify the LICENSE.md file with the author's name and the current year.

Parameters:
NameTypeDescription
optionsobject

Parameters

Properties
NameTypeDescription
cwdstring

Current working directory

pkgobject

Package information

Properties
NameTypeDescription
authorstring

Author's name

Returns:
Type: 
Promise.<void>

(async, static) modifyPluginFactory(options) → {Promise.<void>}

Modify the plugin factory file with the provided arguments.

Parameters:
NameTypeDescription
optionsobject

Parameters

Properties
NameTypeDescription
cwdstring

Current working directory

argvobject

Command line arguments

Properties
NameTypeDescription
namestring

Plugin name

Returns:
Type: 
Promise.<void>

(async, static) modifyReadme(options) → {Promise.<void>}

Modify the README.md file with the provided arguments.

Parameters:
NameTypeDescription
optionsobject

Parameters

Properties
NameTypeDescription
cwdstring

Current working directory

argvobject

Command line arguments

Properties
NameTypeDescription
namestring

Project name

Returns:
Type: 
Promise.<void>

(async, static) tplCheck(options) → {Promise.<(string|undefined)>}

Check if the specified template exists.

Parameters:
NameTypeDescription
optionsobject

Parameters

Properties
NameTypeDescription
typestring

Template type

argvobject

Command line arguments

Properties
NameTypeDescription
tplstring

Template name

Returns:
  • Template directory or undefined if not found
Type: 
Promise.<(string|undefined)>

(async, static) writePackageJson(options) → {Promise.<void>}

Write the package.json file with the provided package information.

Parameters:
NameTypeDescription
optionsobject

Parameters

Properties
NameTypeDescription
cwdstring

Current working directory

pkgobject

Package information

argvobject

Command line arguments

Returns:
Type: 
Promise.<void>