Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.0][Bug] Clean concepts in packages/osd-plugin-generator #630

Merged
merged 1 commit into from
Jul 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions packages/osd-plugin-generator/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# OpenSearch Dashboards Plugin Generator

This package can be used to generate a OpenSearch Dashboards plugin from the OpenSearch Dashboards repo.
This package can be used to generate an OpenSearch Dashboards plugin from the OpenSearch Dashboards repo.

## Setup

Before you can use this plugin generator you must setup your [OpenSearch Dashboards development environment](../../CONTRIBUTING.md#development-environment-setup). If you can successfully run `yarn osd bootstrap` then you are ready to generate plugins!

## Compatibility

The plugin generator became a part of the OpenSearch Dashboards project as of OpenSearch Dashboards 6.3. If you are targeting versions **before OpenSearch Dashboards 6.3** then use the [Kibana plugin sao template](https://github.com/elastic/template-kibana-plugin).

If you are targeting **OpenSearch Dashboards 6.3 or greater** then checkout the corresponding OpenSearch Dashboards branch and run the plugin generator.
The plugin generator became a part of the OpenSearch Dashboards project as of OpenSearch Dashboards 1.0.

## Quick Start

Expand All @@ -21,13 +19,13 @@ node scripts/generate_plugin --name my_plugin_name -y
# generates a plugin in `plugins/my_plugin_name`
```

To target 6.8, use the `6.8` branch.
To target 1.0, use the `1.0` branch.

```sh
git checkout 6.x
git checkout 1.x
yarn osd bootstrap # always bootstrap when switching branches
node scripts/generate_plugin --name my_plugin_name -y
# generates a plugin for OpenSearch Dashboards 6.8 in `../opensearch-dashboards-extra/my_plugin_name`
# generates a plugin for OpenSearch Dashboards 1.0 in `../opensearch-dashboards-extra/my_plugin_name`
```

The generate script supports a few flags; run it with the `--help` flag to learn more.
Expand All @@ -49,7 +47,7 @@ yarn osd bootstrap

## Plugin Development Scripts

Generated plugins receive a handful of scripts that can be used during development. Those scripts are detailed in the [README.md](template/README.md) file in each newly generated plugin, and expose the scripts provided by the [OpenSearch Dashboards plugin helpers](../osd-plugin-helpers), but here is a quick reference in case you need it:
Generated plugins receive a handful of scripts that can be used during development. Those scripts are detailed in the README.md file in each newly generated plugin, and expose the scripts provided by the [OpenSearch Dashboards plugin helpers](../osd-plugin-helpers), but here is a quick reference in case you need it:

> ***NOTE:*** All of these scripts should be run from the generated plugin.

Expand All @@ -59,6 +57,12 @@ Generated plugins receive a handful of scripts that can be used during developme

> ***IMPORTANT:*** Use this script instead of `yarn` to install dependencies when switching branches, and re-run it whenever your dependencies change.

- `yarn build`

Build a distributable archive of your plugin.

To start opensearch dashboards run the following command from OpenSearch Dashboards root.

- `yarn start`

Start OpenSearch Dashboards and have it include this plugin. You can pass any arguments that you would normally send to `bin/opensearch-dashboards`
Expand All @@ -67,12 +71,4 @@ Generated plugins receive a handful of scripts that can be used during developme
yarn start --opensearch.hosts http://localhost:9220
```

- `yarn build`

Build a distributable archive of your plugin.

- `yarn test:mocha`

Run the server tests using mocha.

For more information about any of these commands run `yarn ${task} --help`. For a full list of tasks run `yarn run` or take a look in the `package.json` file.