From 8ad025ec6f55e8a55cd3edb61ff6f6369b4f79a9 Mon Sep 17 00:00:00 2001 From: Liza K Date: Sun, 2 Feb 2020 10:42:40 +0200 Subject: [PATCH] code review --- packages/kbn-plugin-generator/sao_template/sao.js | 14 +++++++------- .../sao_template/template/public/application.tsx | 4 ++-- .../sao_template/template/public/index.ts | 6 ++---- .../sao_template/template/public/plugin.ts | 4 ++-- .../sao_template/template/public/types.ts | 2 +- .../sao_template/template/server/index.ts | 8 ++++---- 6 files changed, 18 insertions(+), 20 deletions(-) diff --git a/packages/kbn-plugin-generator/sao_template/sao.js b/packages/kbn-plugin-generator/sao_template/sao.js index e6c0c8bec7af3..aed4b9a02838f 100755 --- a/packages/kbn-plugin-generator/sao_template/sao.js +++ b/packages/kbn-plugin-generator/sao_template/sao.js @@ -50,11 +50,11 @@ module.exports = function({ name, targetPath, isKibanaPlugin }) { message: 'Should a server API be generated?', default: true, }, - generateTranslations: { - type: 'confirm', - message: 'Should translation files be generated?', - default: true, - }, + // generateTranslations: { + // type: 'confirm', + // message: 'Should translation files be generated?', + // default: true, + // }, generateScss: { type: 'confirm', message: 'Should SCSS be used?', @@ -71,8 +71,8 @@ module.exports = function({ name, targetPath, isKibanaPlugin }) { 'public/**/index.scss': 'generateScss', 'public/**/*': 'generateApp', 'server/**/*': 'generateApi', - 'translations/**/*': 'generateTranslations', - '.i18nrc.json': 'generateTranslations', + // 'translations/**/*': 'generateTranslations', + // '.i18nrc.json': 'generateTranslations', 'eslintrc.js': 'generateEslint', }, move: { diff --git a/packages/kbn-plugin-generator/sao_template/template/public/application.tsx b/packages/kbn-plugin-generator/sao_template/template/public/application.tsx index 581d414c0a578..8106a18a784e7 100644 --- a/packages/kbn-plugin-generator/sao_template/template/public/application.tsx +++ b/packages/kbn-plugin-generator/sao_template/template/public/application.tsx @@ -1,13 +1,13 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { AppMountParameters, CoreStart } from '<%= relRoot %>/src/core/public'; -import { AppPluginDependencies } from './types'; +import { AppPluginStartDependencies } from './types'; import { <%= upperCamelCaseName %>App } from './components/app'; export const renderApp = ( { notifications, http }: CoreStart, - { navigation }: AppPluginDependencies, + { navigation }: AppPluginStartDependencies, { appBasePath, element }: AppMountParameters ) => { ReactDOM.render( 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 246b5aca73cce..2999dc7264ddb 100644 --- a/packages/kbn-plugin-generator/sao_template/template/public/index.ts +++ b/packages/kbn-plugin-generator/sao_template/template/public/index.ts @@ -4,10 +4,8 @@ import './index.scss'; import { <%= upperCamelCaseName %>Plugin } from './plugin'; -/** - * This exports static code and TypeScript types, - * as well as, Kibana Platform `plugin()` initializer. - **/ +// This exports static code and TypeScript types, +// as well as, Kibana Platform `plugin()` initializer. export function plugin() { return new <%= upperCamelCaseName %>Plugin(); } 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 cc46e1cf0c1d7..76f7f1a6f9908 100644 --- a/packages/kbn-plugin-generator/sao_template/template/public/plugin.ts +++ b/packages/kbn-plugin-generator/sao_template/template/public/plugin.ts @@ -1,6 +1,6 @@ import { i18n } from '@kbn/i18n'; import { AppMountParameters, CoreSetup, CoreStart, Plugin } from '<%= relRoot %>/src/core/public'; -import { <%= upperCamelCaseName %>PluginSetup, <%= upperCamelCaseName %>PluginStart, AppPluginDependencies } from './types'; +import { <%= upperCamelCaseName %>PluginSetup, <%= upperCamelCaseName %>PluginStart, AppPluginStartDependencies } from './types'; import { PLUGIN_NAME } from '../common'; export class <%= upperCamelCaseName %>Plugin @@ -17,7 +17,7 @@ export class <%= upperCamelCaseName %>Plugin // Get start services as specified in kibana.json const [coreStart, depsStart] = await core.getStartServices(); // Render the application - return renderApp(coreStart, depsStart as AppPluginDependencies, params); + return renderApp(coreStart, depsStart as AppPluginStartDependencies, params); }, }); 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 43d2c38bffd86..2ebb0c0d1257f 100644 --- a/packages/kbn-plugin-generator/sao_template/template/public/types.ts +++ b/packages/kbn-plugin-generator/sao_template/template/public/types.ts @@ -6,6 +6,6 @@ export interface <%= upperCamelCaseName %>PluginSetup { // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface <%= upperCamelCaseName %>PluginStart {} -export interface AppPluginDependencies { +export interface AppPluginStartDependencies { 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 f34203722e0cc..816b8faec2a45 100644 --- a/packages/kbn-plugin-generator/sao_template/template/server/index.ts +++ b/packages/kbn-plugin-generator/sao_template/template/server/index.ts @@ -1,10 +1,10 @@ import { PluginInitializerContext } from '<%= relRoot %>/src/core/server'; import { <%= upperCamelCaseName %>Plugin } from './plugin'; -/** - * This exports static code and TypeScript types, - * as well as, Kibana Platform `plugin()` initializer. - **/ + +// This exports static code and TypeScript types, +// as well as, Kibana Platform `plugin()` initializer. + export function plugin(initializerContext: PluginInitializerContext) { return new <%= upperCamelCaseName %>Plugin(initializerContext); }