Client for Leto-Modelizer. It installs plugins and imports their models and icons.
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"
}
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.
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
.
"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"
"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"