Skip to content

Command line tools to install and manage plugins in leto-modelizer

License

Notifications You must be signed in to change notification settings

ditrit/leto-modelizer-plugin-cli

Repository files navigation

Leto Modelizer Plugin CLI (leto-modelizer-plugin-cli)

Quality Gate Status Reliability Rating Maintainability Rating Security Rating

Code Smells Bugs Vulnerabilities Technical Debt

Lines of Code Coverage Duplicated Lines (%)

Client for Leto-Modelizer. It installs plugins and imports their models and icons.

Requirements

Leto Modelizer Install

To install the client in Leto Modelizer, use this command line:

npm install --save-dev "git://github.com/ditrit/leto-modelizer-plugin-cli.git#1.0.0"

Add this to package.json scripts:

{
    "plugin:install": "node node_modules/leto-modelizer-plugin-cli install",
    "plugin:init": "node node_modules/leto-modelizer-plugin-cli init"
}

How to define official plugins

The user can select one or more plugins to install from a list of official plugins. To do that, create a leto-modelizer-plugin-cli.json file at the root of Leto Modelizer project. Each object represent a plugin. Example :

[
  {
    "displayName": "Terraform plugin",
    "name": "terrator-plugin",
    "scope": "ditrit",
    "version": "0.12.0" ,
    "url": "https://github.com/ditrit/terrator-plugin.git#0.11.0"
  }
]

  • displayName attribute represents the plugin's display name, which is used to assist the user during installation.
  • name attribute is the plugin's name and must match the one defined in the plugin project.
  • url attribute is the repository url of the plugin. It must be valid (see NOTE ).
  • scope attribute is the organisation name of the plugin.
  • version attribute is the release version of the plugin.

⚠️ The url attribute is optional! If specified, the plugin will be installed from the repository instead of the registry.

NOTE:
The repository url must be valid like git@github.com/repository.git, http(s)://github.com/repository.git or http(s)://github.com/repository.git#1.0.0.

Leto Modelizer commands

Install

"plugin:install": "leto-modelizer-plugin-cli install",

Tasks performed during installation:

  • Install plugin(s) using npm.
  • Import icons and models from each installed plugins.
  • Then generate or update "src/plugins/index.js".

Options name and version can be added with the npm run plugin:install command to bypass cli prompts. Example :

npm run plugin:install -- name="name" version="version"

Uninstall

"plugin:uninstall": "leto-modelizer-plugin-cli uninstall",

Tasks performed during installation:

  • Uninstall plugin(s) using npm.
  • Delete icons and models from each deleted plugins.
  • Then generate or update "src/plugins/index.js".

Options name and version can be added with the npm run plugin:uninstall command to bypass cli prompts. Example :

npm run plugin:uninstall -- name="name" version="version"