Commit graph

237 commits

Author SHA1 Message Date
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
Shaunak Kashyap 8800afd1d6
Removing old files that are no longer used (#17640) 2018-04-10 10:44:44 -07:00
Kim Joar Bekkelund fc265294f5
Use Jest on cli tests (#16389)
* Move CLI tests to Jest

* Get rid of logs from the output

* Allow skipped tests

* Move integration tests into integration_tests folder
2018-04-10 12:12:47 +02:00
Kim Joar Bekkelund a1d9e96a70
Upgrade to TypeScript 2.8.1 (#17617) 2018-04-10 11:41:06 +02:00
Spencer f0d01928db
[@kbn/es] fix promise and CLI error handling (#17596)
* [kbn-es/cluster] fix promise handling to properly route success/failure

* [kbn-es/cli] catch errors that bubble to the CLI and log with a bit of style

* [kbn-es] fix promise handling when building from source

* [kbn-es] check for inverse of .stop() condition

* [kbn-es/cluster] resolve promise is cluster stops cleanly

* [kbn-es/cluster/start] reject if ES exits before starting
2018-04-06 12:58:37 -07:00
Tim Roes 8861b2a434
Fix styling of disabled kuiCheckboxes (#17522)
* Fix styling of disabled kuiCheckboxes

* Fix typo in SASS variable
2018-04-04 13:25:43 +02:00
spalger caca7755cc [yarn] update lockfile 2018-03-28 16:54:36 -07:00
Tyler Smalley 46a5ef1316
[kbn-es] Wait for close event (#17448)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2018-03-28 14:22:53 -07:00
Spencer 56041ca1d0
More attempts to fix procRunner hangs in CI (#17325)
* [kbn-dev-utils/procRunner] try using execa to avoid never-exitting procs

* [kbn-dev-utils/procRunner] don't listen for close event, rely on stdio streams ending
2018-03-28 12:26:11 -07:00
Aleh Zasypkin 346a99865a
[kbn-pm] Implement kbn watch. (#16892) 2018-03-26 17:54:40 +02:00
archana 0f49d67db3
Replace tooling-log instances with @kbn/dev-utils (#17324) 2018-03-23 10:54:38 -05:00
Tyler Smalley e5e025d732
[kbn-es] Allows error to bubble up (#17358)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2018-03-23 07:28:45 -07:00