From a9d471bb5fd60589664beb51d680f1e5f24dabf3 Mon Sep 17 00:00:00 2001 From: Liza K Date: Thu, 30 Jan 2020 12:13:50 +0200 Subject: [PATCH] CR fixes --- .../sao_template/template/README.md | 2 +- .../sao_template/template/public/components/app.tsx | 2 +- .../sao_template/template/public/index.ts | 12 +++++++----- .../sao_template/template/public/plugin.ts | 10 +++++----- .../sao_template/template/public/types.ts | 4 ++-- .../sao_template/template/server/index.ts | 11 +++++++---- .../sao_template/template/server/plugin.ts | 6 ++---- 7 files changed, 25 insertions(+), 22 deletions(-) diff --git a/packages/kbn-plugin-generator/sao_template/template/README.md b/packages/kbn-plugin-generator/sao_template/template/README.md index acd1ede5a573e..13dfab2eb3f01 100755 --- a/packages/kbn-plugin-generator/sao_template/template/README.md +++ b/packages/kbn-plugin-generator/sao_template/template/README.md @@ -8,5 +8,5 @@ ## development -See the [kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) for instructions setting up your development environment. Once you have completed that, use the following yarn scripts. +See the [kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) for instructions setting up your development environment. diff --git a/packages/kbn-plugin-generator/sao_template/template/public/components/app.tsx b/packages/kbn-plugin-generator/sao_template/template/public/components/app.tsx index 913400efc0b10..d6a79906d37b9 100644 --- a/packages/kbn-plugin-generator/sao_template/template/public/components/app.tsx +++ b/packages/kbn-plugin-generator/sao_template/template/public/components/app.tsx @@ -103,7 +103,7 @@ export const <%= upperCamelCaseName %>App = ({ basename, notifications, http, na

diff --git a/packages/kbn-plugin-generator/sao_template/template/public/index.ts b/packages/kbn-plugin-generator/sao_template/template/public/index.ts index 6b769e873335f..9f788de48d90c 100644 --- a/packages/kbn-plugin-generator/sao_template/template/public/index.ts +++ b/packages/kbn-plugin-generator/sao_template/template/public/index.ts @@ -2,12 +2,14 @@ import './index.scss'; <%_ } -%> -import { <%= upperCamelCaseName %>PublicPlugin } from './plugin'; +import { <%= upperCamelCaseName %>Plugin } from './plugin'; +// These exports are the public contract for your static code and types. export function plugin() { - return new <%= upperCamelCaseName %>PublicPlugin(); + return new <%= upperCamelCaseName %>Plugin(); } - -export * from '../common'; -export * from './types'; +export { + <%= upperCamelCaseName %>PluginSetup, + <%= upperCamelCaseName %>PluginStart, +} from './types'; diff --git a/packages/kbn-plugin-generator/sao_template/template/public/plugin.ts b/packages/kbn-plugin-generator/sao_template/template/public/plugin.ts index ec1983aa58821..cc46e1cf0c1d7 100644 --- a/packages/kbn-plugin-generator/sao_template/template/public/plugin.ts +++ b/packages/kbn-plugin-generator/sao_template/template/public/plugin.ts @@ -1,12 +1,12 @@ import { i18n } from '@kbn/i18n'; import { AppMountParameters, CoreSetup, CoreStart, Plugin } from '<%= relRoot %>/src/core/public'; -import { <%= upperCamelCaseName %>PublicPluginSetup, <%= upperCamelCaseName %>PublicPluginStart, AppPluginDependencies } from './types'; +import { <%= upperCamelCaseName %>PluginSetup, <%= upperCamelCaseName %>PluginStart, AppPluginDependencies } from './types'; import { PLUGIN_NAME } from '../common'; -export class <%= upperCamelCaseName %>PublicPlugin - implements Plugin<<%= upperCamelCaseName %>PublicPluginSetup, <%= upperCamelCaseName %>PublicPluginStart> { +export class <%= upperCamelCaseName %>Plugin + implements Plugin<<%= upperCamelCaseName %>PluginSetup, <%= upperCamelCaseName %>PluginStart> { - public setup(core: CoreSetup): <%= upperCamelCaseName %>PublicPluginSetup { + public setup(core: CoreSetup): <%= upperCamelCaseName %>PluginSetup { // Register an application into the side navigation menu core.application.register({ id: '<%= camelCase(name) %>', @@ -34,7 +34,7 @@ export class <%= upperCamelCaseName %>PublicPlugin }; } - public start(core: CoreStart): <%= upperCamelCaseName %>PublicPluginStart { + public start(core: CoreStart): <%= upperCamelCaseName %>PluginStart { return {}; } diff --git a/packages/kbn-plugin-generator/sao_template/template/public/types.ts b/packages/kbn-plugin-generator/sao_template/template/public/types.ts index 480f93aa2df78..43d2c38bffd86 100644 --- a/packages/kbn-plugin-generator/sao_template/template/public/types.ts +++ b/packages/kbn-plugin-generator/sao_template/template/public/types.ts @@ -1,10 +1,10 @@ import { NavigationPublicPluginStart } from '<%= relRoot %>/src/plugins/navigation/public'; -export interface <%= upperCamelCaseName %>PublicPluginSetup { +export interface <%= upperCamelCaseName %>PluginSetup { getGreeting: () => string; } // eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface <%= upperCamelCaseName %>PublicPluginStart {} +export interface <%= upperCamelCaseName %>PluginStart {} export interface AppPluginDependencies { navigation: NavigationPublicPluginStart diff --git a/packages/kbn-plugin-generator/sao_template/template/server/index.ts b/packages/kbn-plugin-generator/sao_template/template/server/index.ts index 75ea5fe201be5..2305e0aba28bb 100644 --- a/packages/kbn-plugin-generator/sao_template/template/server/index.ts +++ b/packages/kbn-plugin-generator/sao_template/template/server/index.ts @@ -1,9 +1,12 @@ import { PluginInitializerContext } from '<%= relRoot %>/src/core/server'; -import { <%= upperCamelCaseName %>ServerPlugin } from './plugin'; +import { <%= upperCamelCaseName %>Plugin } from './plugin'; +// These exports are the server side contract for your static code and types. export function plugin(initializerContext: PluginInitializerContext) { - return new <%= upperCamelCaseName %>ServerPlugin(initializerContext); + return new <%= upperCamelCaseName %>Plugin(initializerContext); } -export { <%= upperCamelCaseName %>ServerPlugin as Plugin }; -export * from '../common'; +export { + <%= upperCamelCaseName %>PluginSetup, + <%= upperCamelCaseName %>PluginStart, +} from './types'; diff --git a/packages/kbn-plugin-generator/sao_template/template/server/plugin.ts b/packages/kbn-plugin-generator/sao_template/template/server/plugin.ts index c380a46ef648a..d6a343209e39e 100644 --- a/packages/kbn-plugin-generator/sao_template/template/server/plugin.ts +++ b/packages/kbn-plugin-generator/sao_template/template/server/plugin.ts @@ -3,7 +3,7 @@ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from ' import { <%= upperCamelCaseName %>PluginSetup, <%= upperCamelCaseName %>PluginStart } from './types'; import { defineRoutes } from './routes'; -export class <%= upperCamelCaseName %>ServerPlugin +export class <%= upperCamelCaseName %>Plugin implements Plugin<<%= upperCamelCaseName %>PluginSetup, <%= upperCamelCaseName %>PluginStart> { private readonly logger: Logger; @@ -12,7 +12,7 @@ export class <%= upperCamelCaseName %>ServerPlugin } public setup(core: CoreSetup) { - this.logger.debug('<%= name %>: Ssetup'); + this.logger.debug('<%= name %>: Setup'); const router = core.http.createRouter(); // Register server side APIs @@ -28,5 +28,3 @@ export class <%= upperCamelCaseName %>ServerPlugin public stop() {} } - -export { <%= upperCamelCaseName %>ServerPlugin as Plugin };