From d12e9902a7048c88fdfb86de1946583ec6e47185 Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Wed, 20 Sep 2017 11:01:47 -0700 Subject: [PATCH] Feat: add translations to default build source paths (elastic/kibana-plugin-helpers#48) * feat: add translations path to build included by default, to better match what's in the elastic products and even the plugin template also add a translations path to the mock plugin for tests * chore: add script to run tests with linting Original commit: elastic/kibana-plugin-helpers@9871a4b11dad7ad820c251c20d4d7a6f46373890 --- packages/kbn-plugin-helpers/lib/plugin_config.js | 2 +- packages/kbn-plugin-helpers/package.json | 1 + .../tasks/build/__fixtures__/test_plugin/translations/es.json | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 packages/kbn-plugin-helpers/tasks/build/__fixtures__/test_plugin/translations/es.json diff --git a/packages/kbn-plugin-helpers/lib/plugin_config.js b/packages/kbn-plugin-helpers/lib/plugin_config.js index bf44c7393599..d2afa5c0e59e 100644 --- a/packages/kbn-plugin-helpers/lib/plugin_config.js +++ b/packages/kbn-plugin-helpers/lib/plugin_config.js @@ -11,7 +11,7 @@ module.exports = function (root) { const buildSourcePatterns = [ 'package.json', 'index.js', - '{lib,public,server,webpackShims}/**/*', + '{lib,public,server,webpackShims,translations}/**/*', ]; // add shrinkwrap and lock files, if they exist diff --git a/packages/kbn-plugin-helpers/package.json b/packages/kbn-plugin-helpers/package.json index 4d9fc8e31def..f1d542f823e1 100644 --- a/packages/kbn-plugin-helpers/package.json +++ b/packages/kbn-plugin-helpers/package.json @@ -14,6 +14,7 @@ "license": "Apache-2.0", "scripts": { "test": "npm run lint && npm run jest", + "test:only": "npm run jest", "jest": "jest", "lint": "eslint bin/ help/ tasks/" }, diff --git a/packages/kbn-plugin-helpers/tasks/build/__fixtures__/test_plugin/translations/es.json b/packages/kbn-plugin-helpers/tasks/build/__fixtures__/test_plugin/translations/es.json new file mode 100644 index 000000000000..2f0e09a5542e --- /dev/null +++ b/packages/kbn-plugin-helpers/tasks/build/__fixtures__/test_plugin/translations/es.json @@ -0,0 +1,4 @@ +{ + "UI-WELCOME_MESSAGE": "Cargando Kibana", + "UI-WELCOME_ERROR": "Kibana no se cargó correctamente. Heck la salida del servidor para obtener más información." +} \ No newline at end of file