mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Backports the following commits to 6.x: - [kbn-plugin-generator] Fix plugin naming inconsistency (#20808)
This commit is contained in:
parent
2747d5e848
commit
215c41c4dc
5 changed files with 9 additions and 10 deletions
|
@ -19,7 +19,6 @@
|
|||
|
||||
const { resolve, relative, dirname } = require('path');
|
||||
|
||||
const kebabCase = require('lodash.kebabcase');
|
||||
const startCase = require('lodash.startcase');
|
||||
const camelCase = require('lodash.camelcase');
|
||||
const snakeCase = require('lodash.snakecase');
|
||||
|
@ -86,9 +85,9 @@ module.exports = function({ name }) {
|
|||
Object.assign(
|
||||
{
|
||||
templateVersion: pkg.version,
|
||||
kebabCase,
|
||||
startCase,
|
||||
camelCase,
|
||||
snakeCase,
|
||||
name,
|
||||
},
|
||||
answers
|
||||
|
|
|
@ -128,8 +128,8 @@ describe('plugin generator sao integration', () => {
|
|||
const nameLine = indexContents.match('name: (.*)')[1];
|
||||
const mainLine = indexContents.match('main: (.*)')[1];
|
||||
|
||||
expect(nameLine).toContain('some-fancy-plugin');
|
||||
expect(mainLine).toContain('plugins/some-fancy-plugin/app');
|
||||
expect(nameLine).toContain('some_fancy_plugin');
|
||||
expect(mainLine).toContain('plugins/some_fancy_plugin/app');
|
||||
});
|
||||
|
||||
it('plugin package has correct name', async () => {
|
||||
|
@ -142,7 +142,7 @@ describe('plugin generator sao integration', () => {
|
|||
const packageContents = getFileContents(res.files['package.json']);
|
||||
const pkg = JSON.parse(packageContents);
|
||||
|
||||
expect(pkg.name).toBe('some-fancy-plugin');
|
||||
expect(pkg.name).toBe('some_fancy_plugin');
|
||||
});
|
||||
|
||||
it('package has version "kibana" with master', async () => {
|
||||
|
|
|
@ -4,4 +4,4 @@ extends: "@elastic/kibana"
|
|||
settings:
|
||||
import/resolver:
|
||||
'@elastic/eslint-import-resolver-kibana':
|
||||
rootPackageName: '<%= kebabCase(name) %>'
|
||||
rootPackageName: '<%= snakeCase(name) %>'
|
||||
|
|
|
@ -5,13 +5,13 @@ import exampleRoute from './server/routes/example';
|
|||
export default function (kibana) {
|
||||
return new kibana.Plugin({
|
||||
require: ['elasticsearch'],
|
||||
name: '<%= kebabCase(name) %>',
|
||||
name: '<%= snakeCase(name) %>',
|
||||
uiExports: {
|
||||
<%_ if (generateApp) { -%>
|
||||
app: {
|
||||
title: '<%= startCase(name) %>',
|
||||
description: '<%= description %>',
|
||||
main: 'plugins/<%= kebabCase(name) %>/app',
|
||||
main: 'plugins/<%= snakeCase(name) %>/app',
|
||||
<%_ if (generateScss) { -%>
|
||||
styleSheetPath: require('path').resolve(__dirname, 'public/app.scss'),
|
||||
<%_ } -%>
|
||||
|
@ -19,7 +19,7 @@ export default function (kibana) {
|
|||
<%_ } -%>
|
||||
<%_ if (generateHack) { -%>
|
||||
hacks: [
|
||||
'plugins/<%= kebabCase(name) %>/hack'
|
||||
'plugins/<%= snakeCase(name) %>/hack'
|
||||
]
|
||||
<%_ } -%>
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "<%= kebabCase(name) %>",
|
||||
"name": "<%= snakeCase(name) %>",
|
||||
"version": "0.0.0",
|
||||
"description": "<%= description %>",
|
||||
"main": "index.js",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue