Commit graph

248 commits

Author SHA1 Message Date
Spencer d6f982dfd2
[system-loader] remove I-prefixed interface names (#20362)
Missed this in #19402
2018-07-02 09:44:52 -07:00
Maxim Tolochko 050e7ef13d Update @kbn/i18n yarn.lock file (#20301) 2018-06-28 18:31:40 +02:00
Maxim Tolochko f522b31ac9
Add draft implementation of I18n engine (#19555)
* Add draft implementation of I18n engine

* Add i18n loader

* kbn-i18n refactoring

* Fix react i18n context and update doc

* i18n engine refactoring

* Fix locales data loading and add more jsdoc comments

* Fix verify_translations task

* I18n tests refactoring

* Add build scripts to kbn-i18n package

* Fix some bugs

* Move uiI18nMixin into ui_i18n folder

* Add 'browser' field to kbn-i18n package.json

* Get rid of "showError" method

* Make i18n and i18nLoader a singleton object

* Add default locale as fallback if translation files were not registered

* Update yarn.lock

* kbn-i18n fix

* Add default formats

* Try to fix build

* Add more examples into kbn-i18n/README.md

* kbn-i18n fix

* Fix app_bootstrap tests

* Add links to issues in TODO comments
2018-06-28 12:38:39 +03:00
Josh Soref 2b27fb1c5f Fix misspellings (#19981) 2018-06-26 20:17:41 -07:00
archana b03243f5d8
[Functional Tests] Use @kbn/test on Kibana CI (#18967)
* Replace test:api with @kbn/test runTests

* Improve CLI help menu 🆘

* Use --es-from

* Replace jenkins:selenium with kbn-test

* Validate cli args, fixing test in the process

* Clean up some stuff

* Code review fixes

* Explanation for collectCliArgs

* Remove exit codes, they're useless anyway.

* Make markdown vis test pass with dev_mode setting

* Tests

* Remove unneeded export

* Code review: move console logging up to cli.js

* Code review: refactor startServers and runTests to take single options collection

* Code review: Remove all things I am sure we do not use

* Improve tests

* Code review fixes

* Pass created log to runFtr, runElasticsearch, runKibanaServer

* Update --es-from option to --esFrom
2018-06-26 18:08:40 -05:00
Aleh Zasypkin 18037984da
Upgrade rxjs: 6.1.0 ---> 6.2.1. (#20209) 2018-06-25 20:04:19 +02:00
Spencer 7f0308b700
[plugin-helpers] use execa so that errors include stdout with helpful info (#20110) 2018-06-22 13:17:10 -07:00
Tyler Smalley 699fb251eb
Adds SCSS support for plugins (#19643)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2018-06-21 16:25:29 -07:00
spalger 53cb1712f4 [kbn-es] update yarn.lock 2018-06-20 11:49:13 -07:00
Spencer 6a429d7fa3
[npm] upgrade to RxJS 6 (#18885)
This PR upgrades RxJS to version 6 and switches to a fork of `stream-to-observable` which includes an updated version of `any-observable` that supports RxJS 6 until https://github.com/jamestalmage/stream-to-observable/pull/10 is merged. The primary change in this version of RxJS is the movement of stream operators from `Obersable.prototype` to the `rxjs/operators` module. Some of the operators, like `catch` and `do`, have been renamed (`catchError`, and `tap`). The Obsevable factories have also been moved from static methods on the `Observable` class to named exports of the root `rxjs` module. Some of those factories have also changed slightly, like `fromEvent` which now emits arrays if the event handler is called with multiple arguments.

```js
// import the Rx namespace to get the Observable factories
import * as Rx from 'rxjs';
// import the operators as named imports
import { map, tap, switchMap } from 'rxjs/operators';
```
2018-06-18 10:16:38 -07:00
Jonathan Budzenski 3ad137a599
bump kbn-pm (#19623) 2018-06-07 13:32:11 -05:00
Aleh Zasypkin bc5f05ef2f
Execute tsc.cmd on Windows during build. (#19622) 2018-06-01 18:49:55 +02:00
Spencer f0cc432faf
Apache 2.0 license headers (#19383)
In order to make the license that applies to each file as clear as possible, and to be consistent with elasticsearch, we are adding Apache 2.0 license headers to the top of each file.

Existence of this header is enforced by eslint and tslint and missing headers were automatically added in the last commit by running:

```
node scripts/eslint --fix && node scripts/tslint --fix
```
2018-05-28 20:06:30 -07:00
Tiago Costa 194aba149f
Validate current node version (#19154)
* feat(12976): node version validation at runtime.

* refact(12976): move the code into a static utilities class.

* test(12976): added first test case using jest.

* test(12976): added test cases for node_version.

* feat(12976): create setup env node to bootstrap babel, ts-node and node version validator.

* refact(12976): migrated node version code from es6 to es5.

* feat(12976): node version validation at runtime.

* refact(12976): move the code into a static utilities class.

* test(12976): added first test case using jest.

* test(12976): added test cases for node_version.

* feat(12976): create setup env node to bootstrap babel, ts-node and node version validator.

* refact(12976): migrated node version code from es6 to es5.

* fix(12976): remove one level from ts node register cache directory link.

* chore(12976): added caret to semver dependecy in order to support minor versions.

* refact(12976): small change from named import to default import on node version validator.

* refact(12976): removed ts_node_register and add the code to babel_register.

* feat(12976): split eslint config in order to properly support files built to run before and after node version validator. refact(12976): convert script files to es5 code. refact(12976): delete inline eslint configs from node version check related files.

* refact(12976): remove ts node register file.

* refact(12976): completely port setup_node_env to es5.

* refact(12976): remove babel_register invokation from external dependencies in scripts.

* refact(12976): move node_version code directly into node_version_validator inside setup_node_env folder.

* refact(12976): only node version validator for kbn script.
2018-05-25 18:43:01 +01:00
Spencer 2587dc6867
[eslint-plugin-no-unsanitized] upgrade for import() support (#19315) 2018-05-24 11:36:59 -07:00
Spencer ce20463f59
[tslint] Fix violations in kbn-pm (#19335)
* [tslint/kbn-pm] apply autofixes

* [tslint/kbn-pm] whitelist all console.log calls for now

* [tslint/kbn-pm] sort object keys alphabetically

* [tslint/kbn-pm] use comments to "fill" empty blocks

* [tslint/kbn-pm] use I-prefix for interface names

* [tslint/kbn-pm] use arrow-functions where possible

* [tslint/kbn-pm] use lowerCamelCase for variable names

* [tslint/kbn-pm] prevent shadowed variable names

* [tslint/kbn-pm] avoid variable name and type clashes

* [tslint/kbn-pm] replace console.log statements with bare-bones logger
2018-05-23 14:50:02 -07:00
Spencer 3d08c5cb31
[tslint] fix violations in kbn-system-loader (#19336)
* [tslint/kbn-system-loader] remove tslint overrides

* [tslint/kbn-system-loader] apply autofixes

* [tslint/kbn-system-loader] override max-classes-per-file for tests

* [tslint/kbn-system-loader] use I-prefix for interface names

* [tslint/kbn-system-loader] use comments to "fill" empty blocks

* [tslint/kbn-system-loader] use lowerCamelCase for variable/property names

* [tslint/kbn-system-loader] sort object keys alphabetically

* [tslint/kbn-system-loader] ensure that public methods come before private ones
2018-05-23 13:27:04 -07:00
Spencer 4c2a90dbdd
[tslint] lint typescript code (#19105)
* [tslint] lint typescript code

* [tslint] filter projects when running specific project

* [dev/ts] use more explicit types

* [dev/ts] add note about why using glob

* [dev/ts] rely on ts, use fewer getters
2018-05-22 14:00:02 -07:00
Aleh Zasypkin 0ab9703287
Upgrade sinon (v1.17.3 --> v5.0.7). (#19074) 2018-05-22 12:13:38 +02:00
archana f63a3df17d
Option to run kibana from build for CI (#19125) (#19225)
* Option to run kibana from build for CI (#19125)

* Support --dev option for servers only

* try skipping dashboard time zones test
2018-05-21 08:31:30 -05:00
archana eaa4960981
Revert "Option to run kibana from build for CI" (#19224)
* Revert "[DOCS] Removes redundant index.asciidoc files (#19192)"

This reverts commit d11b5aae9a.

* Revert "[typescript] add typescript support for the server and browser (#19104)"

This reverts commit c6112067fc.

* Revert "Option to run kibana from build for CI (#19125)"

This reverts commit 5969860303.
2018-05-18 14:09:38 -05:00
Spencer c6112067fc
[typescript] add typescript support for the server and browser (#19104)
* [typescript] add typescript support for the server and browser

* [ts-jest] upgrade to latest version

* [jest] support test.tsx files

* [jest/ts] modify `ts-jest.tsConfigFile` config based on filePath

* [types] use correct major version of minimatch types

* [jest] add ts support to x-pack jest config

* [ts/projects] fix tsconfig.json not found error message

* [optimizer/ts] use lowercase jsx option

* [tsconfig] remove ui/* alias

* [plguin-helpers] remove mention of `buildSourcePatterns`

* [plugin-helpers] expect typescript to be a devDep

* [dev/build] place transpile tasks next to each other

* [ts/x-pack] add common and server directories to ts project

* [dev/ts/project] use a limited set of globs to find tsconfig files
2018-05-18 10:54:57 -07:00
archana 5969860303
Option to run kibana from build for CI (#19125) 2018-05-18 12:45:53 -05:00
spalger 0ad665f216 [eslint/import-resolver] ensure compat with slightly older versions of node for IDE support 2018-05-17 08:04:52 -07:00
Spencer 0b03166d2d
[eslint] unify resolver configs (#19102)
* [eslint] unify resolver configs

Our eslint resolver settings currently rely on the fact that we define
our resolver with a string globally, and an object in the overrides.
This causes the override value to completely override/replace the global
setting, which is desired, but when the global setting is converted to
an object they are merged, causing both resolvers to run.

This is a problem because some dependencies in the UI side of things
will resolve with the node resolver, but will resolve incorrectly
because they are intended to use some webpack specific override.

While trying to add TypeScript I needed to pass argument to the node
resolver which uncovered this issue. The change here moves us away from
using the node resolver directly and instead uses the kibana resolver
with `forceNode: true` set when linting server code and `forceNode:
false` when resolving imports that will be handled by webpack.

* [import-resolver] use object spread operator
2018-05-16 10:45:41 -07:00
Spencer f24a725144
[mocha] remove grunt-simple-mocha (#19079)
* [mocha] run tests with mocha script, remove grunt-simple-mocha

* [ci] force colored output

* [ci] disable color when reading the yarn bin

* [dev/build/exec] support tooling log having its own chalk

* [dev/mocha] avoid changing the cwd of the process

* [dev/mocha] only match files, speed up negative matches

* [cli/serve/test] strip ansi control characters from logs

* [ci] disable color in all `yarn bin` invocations

* [dev/mocha] cleanup old runInBand check

* [dev/mocha] enable gloabl leak checks
2018-05-16 10:43:55 -07:00
Aleh Zasypkin 078fb147a4
Rename @kbn/babel-preset/common & node & webpack to @kbn/babel-preset/common_preset & node_preset & webpack_preset. (#19025) 2018-05-15 17:23:20 +02:00
Tim Roes f579d2299f
Update React to 16.3 (#18768)
* Update React to 16.3

* Switch off specific eslint rules

* Update enzyme snapshots

* Incorporate PR feedback
2018-05-14 14:05:17 +02:00
archana b58e757794
Functional test setup with kbn-test package (#18568)
Restructure testing with kbn-test package

 - Run with multiple configs, move cli options to config
 - Package-ify kbn-test
 - Eventually we'll have functional_test_runner live in a package
of its own, and then this kbn-test will use that as a dependency,
probably still as a devDependency.
 - Implement functional_tests_server
 - Collapse single and multiple config apis into one command

Use kbn-es

Replace es_test_cluster + es_test_config with kbn/test utils

Implement new createEsTestCluster

Improve scripts, jsdocs, cli top-level tools

Lift error handling to the top level
2018-05-09 18:23:49 -05:00
Tyler Smalley 7c784db2f1
[kbn-es] Updates location of ES OSS snapshot (#18938)
ES snapshots are located again within the base elasticsearch directory and NOT within an additionally nested elasticsearch-oss directory

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2018-05-09 09:29:15 -07:00
Spencer 8e3c1c7517
Fix procRunner/x-pack ftr scripts (#18789)
* [x-pack/ftr] call fatalErrorHandler when functional tests fail

* [kbn/dev-tools/withProcRunner] require a log as the first arg

* [kbn/dev-tools/procRunner] use correct promise, convert to getter

* [x-pack/ftr] avoid race condition that prevents success message logging

When starting the kibana server it is possible for log messages to come
after the server is started, so we added a pause that waits for 5
seconds of logging silence before logging the success message. The
observable used fails to complete though if a log message is never
written AFTER the Kibana server starts. To counter this the observable
is started with `null` so it will always start at least one 5 second
timer and always complete even if there is no log data after Kibana
server starts.

* fix typo
2018-05-07 14:50:15 -07:00
Spencer e1a2fcbd96
[uiExports] migrate uiApp "uses" to explicit imports in apps (#17828)
* [uiExports] migrate uiApp "uses" to explicit imports in apps

* [uiApp] update tests for getModules() method

* [optimize/uiExports] improve naming and comments

* [uiExports] sort imports so they load in the same order as before

* [testHarness] load hacks when testing in the browser

* [x-pack/uiExports] use new uiExports modules

* [testHarness] describe why we import uiExports/hacks

* [optimize] remove needless [].concat()

* [optimize/createUiExportsModule] string.includes > string.indexOf

* [uiExports/createUiExportsModule] remove needless capture of module exports
2018-05-03 12:18:50 -07:00
Kim Joar Bekkelund 34ec484658 [kbn-pm] Max concurrency per batch (#16920) 2018-05-02 22:40:55 +02:00
Tyler Smalley 5cb9cd7d33
[kbn-es] Fixes ES snapshot path for OSS builds (#17860)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2018-04-24 15:42:49 -07:00
Jenkins CI fe4609647d Migrate x-pack-kibana source to kibana 2018-04-24 13:48:10 -07:00
Larry Gregory d9d9fb22fb
Disallow use of "dangerouslySetInnerHTML" on React components (#17759)
Disallows use of "dangerouslySetInnerHTML" on React components, except where explicitly whitelisted
2018-04-20 14:22:10 -04:00
Kim Joar Bekkelund ef900fd42d
Enable Prettier for more packages (#17763) 2018-04-20 17:13:34 +02:00
Kim Joar Bekkelund c0158105f5
Upgrade to Prettier 1.12.1 (#17791)
* Upgrade to Prettier 1.12.1

* Add back dev dep
2018-04-20 11:48:37 +02:00
Lukas Olson 2ec9956885
Fix date math parser to not use hardcoded length (#17751)
* Fix date math parser to not use hardcoded length

* Add test
2018-04-18 14:08:28 -07:00
Spencer 1fd537821f
[kbn-es] add basic integration tests for exit code/promise handling (#17600) 2018-04-18 12:59:19 -07:00
Kim Joar Bekkelund d9f34f704e
Introduce @kbn/system-loader (#17595)
* Introduce @kbn/plugin-system

* Throw if plugin exposes a promise from 'start'

* TS updates

* rename

* Better error if missing plugin

* Api to add multiple specs at the same time

* isPromise prettier-ified

* Rename 'plugin' to 'system'

* Metadata + some cleanups

* Make it possible to type system metadata

* Throw if stop is async

* Add tests for System class
2018-04-18 21:50:36 +02:00
Kim Joar Bekkelund 6be9df01af Move to Yarn 1.6.0 (#17741) 2018-04-17 09:53:12 -07:00
Tim Roes 07cf4b6b08
Move ng_mock wrapper to test_utils (#17712) 2018-04-17 08:14:54 +02:00
Spencer 6db8fea28e
[eslint-import-resolver] support mapping plugins to directories (#17667)
* [eslint-import-resolver] support mapping plugins to directories

* use shorthand syntax
2018-04-12 15:28:30 -07:00
Aleh Zasypkin 35e01f288f
[kbn/pm] Get rid of --skip-kibana in favour of --exclude kibana. (#17684) 2018-04-12 20:56:28 +02:00
Aleh Zasypkin 8b5330ccec
[kbn/pm] Allow to include/exclude projects in kbn watch. (#17421) 2018-04-12 17:40:11 +02:00
Spencer 22d70fcb22
[eslint-import-resolver] Add installation docs 2018-04-11 16:12:14 -07:00
Spencer 4f2a19bd9b
[eslint-import-resolver-kibana] bring in repo as package (#17665)
* [eslint-import-resolver-kibana] bring in repo as package

* [eslint-import-resolver] enable prettier
2018-04-11 15:21:29 -07:00
Spencer 9bbf8ce12e
[plugin-helpers] fix order of arguments passed to commander actions (#17663) 2018-04-11 12:20:18 -07:00
Spencer 7b827e87a5
[plugin-helpers] report task failures to CLI with exitCode 1 (#17647)
* [plugin-helpers] return promises/fail cli when async tasks fail

* [plugin-helpers] rename taskRunner to commanderAction

* [plugin-helpers] await async assertion
2018-04-10 16:36:26 -07:00