Skip to content

Commit

Permalink
Update for new cli version
Browse files Browse the repository at this point in the history
  • Loading branch information
Zorin95670 committed Aug 20, 2024
1 parent 46c279f commit 0645c88
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 65 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ jobs:
run: |
npm install -g [email protected] && \
npm ci && \
npm run plugin:install -- repository-name="githubator-plugin" repository-url="https://github.com/ditrit/githubator-plugin.git#0.4.2" && \
npm run plugin:install -- repository-name="terrator-plugin" repository-url="https://github.com/ditrit/terrator-plugin.git#0.11.0" && \
npm run plugin:install -- name="githubator-plugin" version="0.5.1" && \
npm run plugin:install -- name="terrator-plugin" version="0.12.1" && \
npm run plugin:init && \
docker build -t leto-modelizer -f DockerfileE2E .
- name: Run application
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ To run all the e2e tests, you need to run the application with ALL official plug

```bash
npm ci
npm run plugin:install -- repository-name="terrator-plugin" repository-url="https://github.com/ditrit/terrator-plugin.git#0.11.0"
npm run plugin:install -- repository-name="githubator-plugin" repository-url="https://github.com/ditrit/githubator-plugin.git#0.4.2"
npm run plugin:install -- name="terrator-plugin" version="0.12.1"
npm run plugin:install -- name="githubator-plugin" version="0.5.1"
npm run plugin:init
TEMPLATE_LIBRARY_BASE_URL="https://raw.githubusercontent.com/ditrit/leto-modelizer-templates-library/leto-modelizer/e2e_test" npm run dev
```
Expand All @@ -66,8 +66,8 @@ TEMPLATE_LIBRARY_BASE_URL="https://raw.githubusercontent.com/ditrit/leto-modeliz

```bash
npm ci
npm run plugin:install -- repository-name="terrator-plugin" repository-url="https://github.com/ditrit/terrator-plugin.git#0.11.0"
npm run plugin:install -- repository-name="githubator-plugin" repository-url="https://github.com/ditrit/githubator-plugin.git#0.4.2"
npm run plugin:install -- name="terrator-plugin" version="0.12.1"
npm run plugin:install -- name="githubator-plugin" version="0.5.1"
npm run plugin:init
```

Expand Down
113 changes: 77 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ If you only want your own language component (maybe based on existing plugins),

## Requirements

* node - [v18.4](https://nodejs.org/en/blog/release/v18.4.0)
* npm - [v8.19.3](https://www.npmjs.com/package/npm/v/8.19.3)
* node - [v20.16.0](https://nodejs.org/en/blog/release/v20.16.0)
* npm - [v10.8.1](https://www.npmjs.com/package/npm/v/10.8.1)

## Official plugins

Expand All @@ -50,19 +50,19 @@ For now, we don't have many plugins to offer you, but follow us and in the next

Plugin to manage terraform files, by default it comes with aws provider definition.

[GitHub url](https://github.com/ditrit/terrator-plugin#0.11.0)
[GitHub url](https://github.com/ditrit/terrator-plugin#0.12.1)

### Github plugin

Plugin to manage GitHub action files.

[GitHub url](https://github.com/ditrit/githubator-plugin#0.4.2)
[GitHub url](https://github.com/ditrit/githubator-plugin#0.5.1)

### Kubernetes plugin

Plugin to manage Kubernetes files.

[GitHub url](https://github.com/ditrit/kubernator-plugin#0.2.1)
[GitHub url](https://github.com/ditrit/kubernator-plugin#0.3.1)

## Compatibility versions table

Expand Down Expand Up @@ -110,10 +110,10 @@ Plugin to manage Kubernetes files.
</tr>
<tr>
<td>next version</td>
<td>= 0.26.2</td>
<td>= 0.11.0</td>
<td>= 0.4.2</td>
<td>= 0.2.1</td>
<td>= 0.28.0</td>
<td>= 0.12.1</td>
<td>= 0.5.1</td>
<td>= 0.3.1</td>
</tr>
</tbody>
</table>
Expand All @@ -124,58 +124,99 @@ Run `npm install` to let npm retrieve all dependencies and especially our cli to

Then you just have to know two things about your plugins:
- it's name
- it's repository url

To install plugin, run this command `npm run plugin:install`.
You can choose between installing __official__ or __custom__ plugins.
- it's version

### Install official plugins

The `leto-modelizer-plugin-cli.json` file, at the root of Leto Modelizer, contains the list of official plugins provided by the team. Each plugin is represented by an object containing the name, repository URL and version of the plugin.
The `leto-modelizer-plugin-cli.json` file, at the root of Leto Modelizer, contains the list of official plugins provided by the team.
Each plugin is represented by an object containing the name, scope and version of the plugin.

Choose __Official plugins__ to select from the list of official plugins, one or more plugin(s) to install.
To install plugin, run this command `npm run plugin:install`.

![](docs/plugin-install-official.gif)

### Install custom plugin

Choose __Custom plugin__ to install a specific plugin not referenced as an official plugin.
If you want to add a custom plugin, you can modify `leto-modelizer-plugin-cli.json`:
- if your plugin is referenced on npm:
```js
// leto-modelizer-plugin-cli.json
[
// (...)
{
"displayName": "YOUR_PLUGIN_DISPLAY_NAME",
"name": "YOUR_PLUGIN_NAME",
"scope": "NPM_ORGANISATION",
"version": "X.X.X"
}
]
```
- if your plugin only have a repository url on a git provider:
```js
// leto-modelizer-plugin-cli.json
[
// (...)
{
"displayName": "YOUR_PLUGIN_DISPLAY_NAME",
"name": "YOUR_PLUGIN_NAME",
"scope": "YOUR_ORGANISATION",
"version": "X.X.X",
"url": "YOUR_REPOSITORY_URL" // like http(s)://github.com/repository.git#1.0.0
}
]
```

![](docs/plugin-install-custom.gif)
For more information about configuring plugin, you can read this [documentation](https://github.com/ditrit/leto-modelizer-plugin-cli).

Examples with official plugins:
- terrator-plugin:
- plugin name: `terrator-plugin`
- git repository url: `https://github.com/ditrit/terrator-plugin.git#0.11.0`
- githubator-plugin:
- plugin name: `githubator-plugin`
- git repository url: `https://github.com/ditrit/githubator-plugin.git#0.4.2`
- kubernator-plugin:
- plugin name: `kubernator-plugin`
- git repository url: `https://github.com/ditrit/kubernator-plugin.git#0.2.1`
Then execute this command `npm run plugin:install` and choose your custom plugin in the list to install it.

### Install custom plugin in command line
### Install official/custom plugin in command line

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

```bash
# Example with terraform plugin
npm run plugin:install -- repository-name="terrator-plugin" repository-url="https://github.com/ditrit/terrator-plugin.git#0.11.0"
npm run plugin:install -- name="terrator-plugin" version="0.12.1"

# Example with github action plugin
npm run plugin:install -- repository-name="githubator-plugin" repository-url="https://github.com/ditrit/githubator-plugin.git#0.4.2"
npm run plugin:install -- name="githubator-plugin" version="0.5.1"

# Example with kubernator plugin
npm run plugin:install -- repository-name="kubernator-plugin" repository-url="https://github.com/ditrit/kubernator-plugin.git#0.2.1"
npm run plugin:install -- name="kubernator-plugin" version="0.3.1"
```

Now that your plugin is installed, you can continue to install other plugins with the same command if you want.

### Initialize plugins
## How to uninstall plugin

Run `npm install` to let npm retrieve all dependencies and especially our cli to easily uninstall your plugins 😉.

Then you just have to know two things about your plugins:
- it's name
- it's version

### Uninstall plugins

To uninstall plugin, run this command `npm run plugin:uninstall`.

![](docs/plugin-uninstall.gif)
-
### Uninstall plugin in command line

When you have installed all the desired plugins, please run this commands `npm run plugin:init` to complete all plugins' installation.
Options `name` and `version` can be added with the `npm run plugin:uninstall` command to bypass cli prompts.

```bash
# Example with terraform plugin
npm run plugin:uninstall -- name="terrator-plugin" version="0.12.1"

# Example with github action plugin
npm run plugin:uninstall -- name="githubator-plugin" version="0.5.1"

# Example with kubernator plugin
npm run plugin:uninstall -- name="kubernator-plugin" version="0.3.1"
```

![](docs/plugin-init.png)
Now that your plugin is uninstalled, you can continue to uninstall other plugins with the same command if you want.

## How to setup the authentication with Leto-Modelizer-Api

Expand Down Expand Up @@ -210,7 +251,7 @@ It will generate the built application in the `dist` folder.

To build this app with docker (the two main plugins for terraform & github are included), please use this command:
```bash
docker build . -build-arg TERRATOR_PLUGIN_VERSION="0.11.0" -build-arg GITHUBATOR_PLUGIN_VERSION="0.4.2" -build-arg KUBERNATOR_PLUGIN_VERSION="0.2.1" -t leto-modelizer
docker build . -build-arg TERRATOR_PLUGIN_VERSION="0.12.1" -build-arg GITHUBATOR_PLUGIN_VERSION="0.5.1" -build-arg KUBERNATOR_PLUGIN_VERSION="0.3.1" -t leto-modelizer
```

### Docker run
Expand Down
42 changes: 21 additions & 21 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Technical content:
* Update import of vue components.
* Plugin management:
* Work with [plugin-core](https://github.com/ditrit/leto-modelizer-plugin-core/tree/0.25.0) version 0.26.2.
* Work with [terrator-plugin](https://github.com/ditrit/terrator-plugin/tree/0.11.0) version 0.11.0.
* Work with [githubator-plugin](https://github.com/ditrit/githubator-plugin/tree/0.4.2) version 0.4.2.
* Work with [kubernator-plugin](https://github.com/ditrit/kubernator-plugin/tree/0.2.1) version 0.2.1.
* Work with [plugin-core](https://github.com/ditrit/leto-modelizer-plugin-core/tree/0.28.0) version `0.28.0`.
* Work with [terrator-plugin](https://github.com/ditrit/terrator-plugin/tree/0.12.1) version `0.12.1`.
* Work with [githubator-plugin](https://github.com/ditrit/githubator-plugin/tree/0.5.1) version `0.5.1`.
* Work with [kubernator-plugin](https://github.com/ditrit/kubernator-plugin/tree/0.3.1) version `0.3.1`.
* Improve performance on git add.
* Replace OIDC authentication by Leto-Modelizer-Api, see [this issue](https://github.com/ditrit/leto-modelizer/issues/425).
* Separating git-related functions into a dedicated composable.
* Merge add/create diagram buttons into a drop-down button, see [this issue](https://github.com/ditrit/leto-modelizer/issues/471).
* Improve Authentication by re-doing login process if the token is expired, see [this issue](https://github.com/ditrit/leto-modelizer/issues/478).
* Handle external id.
* Replaced old authentication (Parse) by the new LetoModelizeApi (Java/Spring).
* Replaced old authentication (Parse) by the new Leto-Modelize-Api (Java/Spring).

### Fixed

Expand Down Expand Up @@ -100,27 +100,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Rework and clean all layouts and pages.
* Have only one configuration file by project to save all diagrams positions.
* Save diagram template position.
* Rework on project documenation (replace esdoc by jsdoc).
* Rework on project documentation (replace esdoc by jsdoc).
* Models page:
* Rework on tag display, use tag category for all diagrams in table.
* Rework on tag display, use tag language for plugin selection on create diagram from template.
* Update naviguation bar to display user info.
* Update navigation bar to display user info.
* Draw page:
* Rework on left drawer.
* Re-design attribute fields.
* Re-design information icon on attribute fields.
* Plugin management:
* Work with [terrator-plugin](https://github.com/ditrit/terrator-plugin/tree/0.7.0) version 0.7.0.
* Work with [plugin-core](https://github.com/ditrit/leto-modelizer-plugin-core/tree/0.21.0) version 0.21.0.
* Work with [githubator-plugin](https://github.com/ditrit/githubator-plugin/tree/0.2.5) version 0.2.5.
* Improve performance of the automatic functionnal tests.
* Work with [terrator-plugin](https://github.com/ditrit/terrator-plugin/tree/0.7.0) version `0.7.0`.
* Work with [plugin-core](https://github.com/ditrit/leto-modelizer-plugin-core/tree/0.21.0) version `0.21.0`.
* Work with [githubator-plugin](https://github.com/ditrit/githubator-plugin/tree/0.2.5) version `0.2.5`.
* Improve performance of the automatic functional tests.
* User settings:
* Save records by page in ModelsPage.

### Fixed

* Fix bug on models default folder opening, see [this issue](https://github.com/ditrit/leto-modelizer/issues/303).
* Fix Sonar new bugs/code smell due to quality profil change, see [this issue](https://github.com/ditrit/leto-modelizer/issues/322).
* Fix Sonar new bugs/code smell due to quality profile change, see [this issue](https://github.com/ditrit/leto-modelizer/issues/322).
* Fix bug on using default file name from plugin instead of the file name specified by the user, when adding a component after creating a diagram from scratch.
* Fix bug on deleted files while pushing a branch or using "upload to git" button, see [this issue](https://github.com/ditrit/leto-modelizer/issues/358).
* Fix bug on import repository with `.git` or `/` at the end, see [this issue](https://github.com/ditrit/leto-modelizer/issues/368).
Expand Down Expand Up @@ -162,9 +162,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Redesign template grid.
* Redesign template card.
* Plugin management:
* Work with [terrator-plugin](https://github.com/ditrit/terrator-plugin/tree/0.3.0) version 0.3.0.
* Work with [plugin-core](https://github.com/ditrit/leto-modelizer-plugin-core/tree/0.16.0) version 0.16.0.
* Work with [githubator-plugin](https://github.com/ditrit/githubator-plugin/tree/0.2.0) version 0.2.0.
* Work with [terrator-plugin](https://github.com/ditrit/terrator-plugin/tree/0.3.0) version `0.3.0`.
* Work with [plugin-core](https://github.com/ditrit/leto-modelizer-plugin-core/tree/0.16.0) version `0.16.0`.
* Work with [githubator-plugin](https://github.com/ditrit/githubator-plugin/tree/0.2.0) version `0.2.0`.

## [1.1.0] - 2023/05/04

Expand Down Expand Up @@ -192,10 +192,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Internal optimization of plugin usage.
* New display for library list & component grid.
* Plugin management:
* Work with [terrator-plugin](https://github.com/ditrit/terrator-plugin/tree/0.2.0) version 0.2.0.
* Work with [plugin-core](https://github.com/ditrit/leto-modelizer-plugin-core/tree/0.15.2) version 0.15.2.
* Work with [githubator-plugin](https://github.com/ditrit/githubator-plugin/tree/0.1.1) version 0.1.1.
* Update [plugin-cli](https://github.com/ditrit/leto-modelizer-plugin-cli/tree/1.0.0) version 1.0.0.
* Work with [terrator-plugin](https://github.com/ditrit/terrator-plugin/tree/0.2.0) version `0.2.0`.
* Work with [plugin-core](https://github.com/ditrit/leto-modelizer-plugin-core/tree/0.15.2) version `0.15.2`.
* Work with [githubator-plugin](https://github.com/ditrit/githubator-plugin/tree/0.1.1) version `0.1.1`.
* Update [plugin-cli](https://github.com/ditrit/leto-modelizer-plugin-cli/tree/1.0.0) version `1.0.0`.

### Fixed

Expand Down Expand Up @@ -254,8 +254,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Push branch to git provider.
* Plugin management:
* Work with multi-plugin.
* Work with [terrator-plugin](https://github.com/ditrit/terrator-plugin/tree/0.1.12) version 0.1.12.
* Work with [plugin-core](https://github.com/ditrit/leto-modelizer-plugin-core/tree/0.13.0) version 0.13.0.
* Work with [terrator-plugin](https://github.com/ditrit/terrator-plugin/tree/0.1.12) version `0.1.12`.
* Work with [plugin-core](https://github.com/ditrit/leto-modelizer-plugin-core/tree/0.13.0) version `0.13.0`.

[1.3.0]: https://github.com/ditrit/leto-modelizer/blob/main/changelog.md#1.3.0
[1.2.0]: https://github.com/ditrit/leto-modelizer/blob/main/changelog.md#1.2.0
Expand Down
Binary file removed docs/plugin-init.png
Binary file not shown.
Binary file removed docs/plugin-install-custom.gif
Binary file not shown.
Binary file modified docs/plugin-install-official.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plugin-uninstall.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"test": "jest --coverageProvider=v8",
"test:coverage": "jest --coverage --coverageProvider=v8",
"test:e2e": "cypress run --browser electron --spec **/*.feature",
"plugin:install": "node node_modules/leto-modelizer-plugin-cli install",
"plugin:delete": "node node_modules/leto-modelizer-plugin-cli delete"
"plugin:install": "node node_modules/@ditrit/leto-modelizer-plugin-cli/src/index.js install",
"plugin:uninstall": "node node_modules/@ditrit/leto-modelizer-plugin-cli/src/index.js uninstall"
},
"dependencies": {
"@ditrit/leto-modelizer-plugin-core": "=0.28.0",
Expand Down

0 comments on commit 0645c88

Please sign in to comment.