Skip to content

Commit

Permalink
add links to plugin manifest format
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov committed Nov 21, 2019
1 parent 1bef133 commit bfa2ecd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## PluginManifest.id property

Identifier of the plugin.
Identifier of the plugin. Must be a string in snake\_case.

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface PluginManifest
| Property | Type | Description |
| --- | --- | --- |
| [configPath](./kibana-plugin-server.pluginmanifest.configpath.md) | <code>ConfigPath</code> | Root [configuration path](./kibana-plugin-server.configpath.md) used by the plugin, defaults to "id". |
| [id](./kibana-plugin-server.pluginmanifest.id.md) | <code>PluginName</code> | Identifier of the plugin. |
| [id](./kibana-plugin-server.pluginmanifest.id.md) | <code>PluginName</code> | Identifier of the plugin. Must be a string in snake\_case. |
| [kibanaVersion](./kibana-plugin-server.pluginmanifest.kibanaversion.md) | <code>string</code> | The version of Kibana the plugin is compatible with, defaults to "version". |
| [optionalPlugins](./kibana-plugin-server.pluginmanifest.optionalplugins.md) | <code>readonly PluginName[]</code> | An optional list of the other plugins that if installed and enabled \*\*may be\*\* leveraged by this plugin for some additional functionality but otherwise are not required for this plugin to work properly. |
| [requiredPlugins](./kibana-plugin-server.pluginmanifest.requiredplugins.md) | <code>readonly PluginName[]</code> | An optional list of the other plugins that \*\*must be\*\* installed and enabled for this plugin to function properly. |
Expand Down
2 changes: 1 addition & 1 deletion src/core/CONVENTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ my_plugin/
   ├── index.ts
   └── plugin.ts
```

- `my_plugin` should be the same as plugin `id` declared in `kibana.json` [manifest file](/docs/development/core/server/kibana-plugin-server.pluginmanifest.md)
- Both `server` and `public` should have an `index.ts` and a `plugin.ts` file:
- `index.ts` should only contain:
- The `plugin` export
Expand Down
8 changes: 8 additions & 0 deletions src/core/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ src/plugins
"ui": true
}
```
More details about[manifest file format](/docs/development/core/server/kibana-plugin-server.pluginmanifest.md)

Note that `package.json` files are irrelevant to and ignored by the new platform.

Expand Down Expand Up @@ -1320,6 +1321,13 @@ export class Plugin implements Plugin<PluginSetup, PluginStart> {
}
```
If you want to disable your plugin by default, you could declare the `enabled` flag in plugin config. This is a special Kibana platform key. The platform reads its value and won't create a plugin instance if `enabled: false`. All plugins are considered enabled by default.
```js
export const config = {
schema: schema.object({ enabled: schema.boolean({ defaultValue: false }) }),
};
```

### Mock new platform services in tests

#### Writing mocks for your plugin
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/plugins/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export type PluginOpaqueId = symbol;
*/
export interface PluginManifest {
/**
* Identifier of the plugin.
* Identifier of the plugin. Must be a string in snake_case.
*/
readonly id: PluginName;

Expand Down

0 comments on commit bfa2ecd

Please sign in to comment.