initial commit
generated from the plugin template, this does nothing but provide a plugin with the expected name
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
npm-debug.log*
|
||||
node_modules
|
||||
/build/
|
||||
31
README.md
Normal file
31
README.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# fake-xpack
|
||||
|
||||
> Enough to satisfy the license check
|
||||
|
||||
---
|
||||
|
||||
## 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 npm tasks.
|
||||
|
||||
- `npm start`
|
||||
|
||||
Start kibana and have it include this plugin
|
||||
|
||||
- `npm start -- --config kibana.yml`
|
||||
|
||||
You can pass any argument that you would normally send to `bin/kibana` by putting them after `--` when running `npm start`
|
||||
|
||||
- `npm run build`
|
||||
|
||||
Build a distributable archive
|
||||
|
||||
- `npm run test:browser`
|
||||
|
||||
Run the browser tests in a real web browser
|
||||
|
||||
- `npm run test:server`
|
||||
|
||||
Run the server tests using mocha
|
||||
|
||||
For more information about any of these commands run `npm run ${task} -- --help`.
|
||||
22
TRANSLATION.md
Normal file
22
TRANSLATION.md
Normal file
@@ -0,0 +1,22 @@
|
||||
A Kibana translation plugin structure.
|
||||
|
||||
The main goal is to keep the plugin extremely simple so non-technical translators will have no trouble
|
||||
creating new translations for Kibana. Everything except for the translations themselves can be generated
|
||||
automatically with some enhancements to the Kibana plugin generator. The generator would only need a
|
||||
plugin name and a list of one or more languages the user wants to create translations for.
|
||||
|
||||
The plugin exports its translation file(s) on the server when it it starts up. This is achieved by publishing the files
|
||||
via 'uiExports'.This is configurable by modifying the 'translations' item in the 'uiExports'.
|
||||
|
||||
Translation files are broken up by language and must have names that match IETF BCP 47 language codes.
|
||||
Each translation file contains a single flat object with translation strings matched to their unique keys. Keys are
|
||||
prefixed with plugin names and a dash to ensure uniqueness between plugins. A translation plugin is not restricted to
|
||||
providing translations only for itself, the provided translations can cover other plugins as well.
|
||||
|
||||
For example, this template plugin shows how a third party plugin might provide Spanish translations for the Kibana core "kibana" app, which is itself a separate plugin.
|
||||
|
||||
To create a translation plugin using this template, follow these steps:
|
||||
1. Generate the plugin using the generator
|
||||
2. Add your translations files to <plugin_name>/translations directory. Remove/Overwrite the existing translation file (i.e. 'es.json').
|
||||
3. Edit <plugin_name>/index.js, updating the 'translations' item as per your plugin translations.
|
||||
4. Restart the Kibana server to publish your plugin translations.
|
||||
18
gather-info.js
Normal file
18
gather-info.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const templatePkg = require('./package.json');
|
||||
const kibanaPkg = require('../kibana/package.json');
|
||||
|
||||
const debugInfo = {
|
||||
kibana: {
|
||||
version: kibanaPkg.version,
|
||||
build: kibanaPkg.build,
|
||||
engines: kibanaPkg.engines,
|
||||
},
|
||||
plugin: {
|
||||
name: templatePkg.name,
|
||||
version: templatePkg.version,
|
||||
kibana: templatePkg.kibana,
|
||||
dependencies: templatePkg.dependencies,
|
||||
},
|
||||
};
|
||||
|
||||
console.log(debugInfo);
|
||||
14
index.js
Normal file
14
index.js
Normal file
@@ -0,0 +1,14 @@
|
||||
export default function (kibana) {
|
||||
return new kibana.Plugin({
|
||||
require: [],
|
||||
name: 'xpack_main',
|
||||
id: 'xpack_main',
|
||||
configPrefix: 'xpack.xpack_main',
|
||||
config(Joi) {
|
||||
return Joi.object({
|
||||
enabled: Joi.boolean().default(true),
|
||||
xpack_api_polling_frequency_millis: Joi.number().default(30000),
|
||||
}).default();
|
||||
},
|
||||
});
|
||||
}
|
||||
33
package.json
Normal file
33
package.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "fake-xpack",
|
||||
"version": "0.0.0",
|
||||
"description": "Enough to satisfy the license check",
|
||||
"main": "index.js",
|
||||
"kibana": {
|
||||
"version": "kibana",
|
||||
"templateVersion": "7.2.3"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint",
|
||||
"start": "plugin-helpers start",
|
||||
"test:server": "plugin-helpers test:server",
|
||||
"test:browser": "plugin-helpers test:browser",
|
||||
"build": "plugin-helpers build",
|
||||
"postinstall": "plugin-helpers postinstall",
|
||||
"gather-info": "node gather-info.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@elastic/eslint-config-kibana": "^0.14.0",
|
||||
"@elastic/eslint-import-resolver-kibana": "^1.0.0",
|
||||
"@elastic/plugin-helpers": "^8.1.1",
|
||||
"babel-eslint": "^8.0.2",
|
||||
"eslint": "^4.11.0",
|
||||
"eslint-plugin-babel": "^4.1.1",
|
||||
"eslint-plugin-import": "^2.3.0",
|
||||
"eslint-plugin-jest": "^21.3.2",
|
||||
"eslint-plugin-mocha": "^4.9.0",
|
||||
"eslint-plugin-prefer-object-spread": "^1.2.1",
|
||||
"eslint-plugin-react": "^7.0.1",
|
||||
"expect.js": "^0.3.1"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user