2016-12-14 04:37:55 +01:00
[[development-plugin-resources]]
2020-07-16 16:13:51 +02:00
== Plugin Resources
2016-12-14 04:37:55 +01:00
2019-09-18 16:38:02 +02:00
Here are some resources that are helpful for getting started with plugin development.
2016-12-14 04:37:55 +01:00
2020-07-16 16:13:51 +02:00
[discrete]
=== Some light reading
2020-07-13 16:47:01 +02:00
If you haven't already, start with <<development-getting-started>>. If you are planning to add your plugin to the {kib} repo, read the <<contributing>> guide, if you are building a plugin externally, read <<external-plugin-development>>. In both cases, read up on our recommended <<development-best-practices>>.
2016-12-14 04:37:55 +01:00
2020-07-16 16:13:51 +02:00
[discrete]
=== Creating an empty plugin
2016-12-14 04:37:55 +01:00
2020-07-13 16:47:01 +02:00
You can use the <<automatic-plugin-generator>> to get a basic structure for a new plugin. Plugins that are not part of the
{kib} repo should be developed inside the `plugins` folder. If you are building a new plugin to check in to the {kib} repo,
you will choose between a few locations:
2018-02-12 20:23:23 +01:00
2021-02-08 16:47:36 +01:00
- {kib-repo}tree/{branch}/x-pack/plugins[x-pack/plugins] for plugins related to subscription features
- {kib-repo}tree/{branch}/src/plugins[src/plugins] for plugins related to free features
2020-07-13 16:47:01 +02:00
- {kib-repo}tree/{branch}/examples[examples] for developer example plugins (these will not be included in the distributables)
2018-03-21 22:16:32 +01:00
2020-07-16 16:13:51 +02:00
[discrete]
=== Elastic UI Framework
2018-03-21 22:16:32 +01:00
If you're developing a plugin that has a user interface, take a look at our https://elastic.github.io/eui[Elastic UI Framework].
2020-07-13 16:47:01 +02:00
It documents the CSS and React components we use to build {kib}'s user interface.
2018-03-21 22:16:32 +01:00
2019-09-18 16:38:02 +02:00
You're welcome to use these components, but be aware that they are rapidly evolving, and we might introduce breaking changes that will disrupt your plugin's UI.
2018-05-18 19:54:57 +02:00
2020-07-16 16:13:51 +02:00
[discrete]
=== TypeScript Support
2020-07-13 16:47:01 +02:00
We recommend your plugin code is written in http://www.typescriptlang.org/[TypeScript].
2019-09-18 16:38:02 +02:00
To enable TypeScript support, create a `tsconfig.json` file at the root of your plugin that looks something like this:
2018-05-18 19:54:57 +02:00
["source","js"]
-----------
{
2020-09-24 19:19:29 +02:00
// extend Kibana's tsconfig, or use your own settings
2018-05-18 19:54:57 +02:00
"extends": "../../kibana/tsconfig.json",
// tell the TypeScript compiler where to find your source files
"include": [
"server/**/*",
"public/**/*"
]
}
-----------
2020-02-10 22:35:06 +01:00
TypeScript code is automatically converted into JavaScript during development,
2020-07-13 16:47:01 +02:00
but not in the distributable version of {kib}. If you use the
{kib-repo}blob/{branch}/packages/kbn-plugin-helpers[@kbn/plugin-helpers] to build your plugin, then your `.ts` and `.tsx` files will be permanently transpiled before your plugin is archived. If you have your own build process, make sure to run the TypeScript compiler on your source files and ship the compilation output so that your plugin will work with the distributable version of {kib}.
2020-02-14 20:33:25 +01:00
2020-07-16 16:13:51 +02:00
[discrete]
=== {kib} platform migration guide
2020-02-14 20:33:25 +01:00
2020-11-24 09:46:19 +01:00
<<migrating-legacy-plugins, This guide>>
provides an action plan for moving a legacy plugin to the new platform.
<<migrating-legacy-plugins-examples, Provides>> migration examples for the legacy core services.
2020-07-13 16:47:01 +02:00
2020-07-16 16:13:51 +02:00
[discrete]
=== Externally developed plugins
2020-07-13 16:47:01 +02:00
If you are building a plugin outside of the {kib} repo, read <<external-plugin-development>>.