Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Liza K committed Feb 2, 2020
1 parent 1ff8556 commit 8ad025e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 20 deletions.
14 changes: 7 additions & 7 deletions packages/kbn-plugin-generator/sao_template/sao.js
Original file line number Diff line number Diff line change
Expand Up @@ -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?',
Expand All @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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);
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Original file line number Diff line number Diff line change
@@ -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);
}
Expand Down

0 comments on commit 8ad025e

Please sign in to comment.