kibana/docs/developer/plugin/plugin-tooling.asciidoc
Mikhail Shustov ab8a2f7427
[docs] Convert migration guide to asciidoc (#82600)
* Initial conversion to asciidoc

* Update and split migration guide

* Convert MIGRATION_EXAMPLES to asciidoc

* build with --focus flag

* convert migration guide to asciidoc

* cleanup migration_examples

* fix wrong Heading size

* update links in docs

* Apply suggestions from code review

Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>

* Apply suggestions from code review

Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>

* add tooling section

* explain purpose of each lifecycle method

* cleanup docs

* cleanup p2

* fix wrong link

* resturcture core docs

* fix wrong link

* update missing links

* Apply suggestions from code review

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* address comments

* add a commenta about plugin-helpers preconfigured

* improve density of tables

* fix lik

* remove links to the migration guide

* address comments

* Apply suggestions from code review

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* address @gchaps comments

* Apply suggestions from code review

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* change format of ES client change list

Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
2020-11-24 09:46:19 +01:00

51 lines
2 KiB
Plaintext

[[plugin-tooling]]
== Plugin tooling
[discrete]
[[automatic-plugin-generator]]
=== Automatic plugin generator
We recommend that you kick-start your plugin by generating it with the {kib-repo}tree/{branch}/packages/kbn-plugin-generator[{kib} Plugin Generator]. Run the following in the {kib} repo, and you will be asked a couple of questions, see some progress bars, and have a freshly generated plugin ready for you to play with in {kib}'s `plugins` folder.
["source","shell"]
-----------
node scripts/generate_plugin my_plugin_name # replace "my_plugin_name" with your desired plugin name
-----------
[discrete]
=== Plugin location
The {kib} directory must be named `kibana`, and your plugin directory should be located in the root of `kibana` in a `plugins` directory, for example:
["source","shell"]
----
.
└── kibana
└── plugins
├── foo-plugin
└── bar-plugin
----
=== Build plugin distributable
WARNING: {kib} distributable is not shipped with `@kbn/optimizer` anymore. You need to pre-build your plugin for use in production.
You can leverage {kib-repo}blob/{branch}/packages/kbn-plugin-helpers[@kbn/plugin-helpers] to build a distributable archive for your plugin.
The package transpiles the plugin code, adds polyfills, and links necessary js modules in the runtime.
You don't need to install the `plugin-helpers`: the `package.json` is already pre-configured if you created your plugin with `node scripts/generate_plugin` script.
To build your plugin run within your plugin folder:
["source","shell"]
-----------
yarn build
-----------
It will output a`zip` archive in `kibana/plugins/my_plugin_name/build/` folder.
=== Install a plugin from archive
See <<install-plugin, How to install a plugin>>.
=== Run {kib} with your plugin in dev mode
Run `yarn start` in the {kib} root folder. Make sure {kib} found and bootstrapped your plugin:
["source","shell"]
-----------
[info][plugins-system] Setting up […] plugins: […, myPluginName, …]
-----------