From 327e3f70f1032772ef94c8d78ff84ea33e385836 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Thu, 3 Oct 2019 09:14:58 +0200 Subject: [PATCH 01/18] Update TS to 3.7.0-beta --- package.json | 4 ++-- packages/kbn-analytics/package.json | 2 +- packages/kbn-config-schema/package.json | 2 +- packages/kbn-dev-utils/package.json | 2 +- packages/kbn-elastic-idx/package.json | 2 +- packages/kbn-i18n/package.json | 2 +- packages/kbn-pm/package.json | 2 +- test/plugin_functional/plugins/core_plugin_a/package.json | 2 +- test/plugin_functional/plugins/core_plugin_b/package.json | 2 +- .../plugins/core_plugin_legacy/package.json | 2 +- .../plugins/kbn_tp_embeddable_explorer/package.json | 2 +- .../plugins/kbn_tp_sample_panel_action/package.json | 2 +- x-pack/legacy/plugins/apm/cypress/package.json | 2 +- x-pack/package.json | 2 +- yarn.lock | 8 ++++---- 15 files changed, 19 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 8aff95748560d..f46fd0aa52017 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "**/@types/react": "16.8.3", "**/@types/hapi": "^17.0.18", "**/@types/angular": "^1.6.56", - "**/typescript": "3.5.3", + "**/typescript": "3.7.0-beta", "**/graphql-toolkit/lodash": "^4.17.13", "**/isomorphic-git/**/base64-js": "^1.2.1", "**/babel-plugin-inline-react-svg/svgo/js-yaml": "^3.13.1" @@ -444,7 +444,7 @@ "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", "tree-kill": "^1.1.0", - "typescript": "3.5.3", + "typescript": "3.7.0-beta", "typings-tester": "^0.3.2", "vinyl-fs": "^3.0.3", "xml2js": "^0.4.22", diff --git a/packages/kbn-analytics/package.json b/packages/kbn-analytics/package.json index e2f3a59e95a47..f168cb967d4a6 100644 --- a/packages/kbn-analytics/package.json +++ b/packages/kbn-analytics/package.json @@ -17,6 +17,6 @@ "@babel/cli": "7.5.5", "@kbn/dev-utils": "1.0.0", "@kbn/babel-preset": "1.0.0", - "typescript": "3.5.1" + "typescript": "3.7.0-beta" } } diff --git a/packages/kbn-config-schema/package.json b/packages/kbn-config-schema/package.json index cd5ae010f998b..e1e312026f71b 100644 --- a/packages/kbn-config-schema/package.json +++ b/packages/kbn-config-schema/package.json @@ -10,7 +10,7 @@ "kbn:bootstrap": "yarn build" }, "devDependencies": { - "typescript": "3.5.3" + "typescript": "3.7.0-beta" }, "peerDependencies": { "joi": "^13.5.2", diff --git a/packages/kbn-dev-utils/package.json b/packages/kbn-dev-utils/package.json index 2e7e4c5500a3c..2169a9f347fd4 100644 --- a/packages/kbn-dev-utils/package.json +++ b/packages/kbn-dev-utils/package.json @@ -21,7 +21,7 @@ "tslib": "^1.9.3" }, "devDependencies": { - "typescript": "3.5.3", + "typescript": "3.7.0-beta", "@kbn/expect": "1.0.0", "chance": "1.0.18" } diff --git a/packages/kbn-elastic-idx/package.json b/packages/kbn-elastic-idx/package.json index abfaea75357dd..ba59b2a00cfad 100644 --- a/packages/kbn-elastic-idx/package.json +++ b/packages/kbn-elastic-idx/package.json @@ -20,7 +20,7 @@ "@babel/core": "^7.5.5", "@babel/plugin-transform-async-to-generator": "^7.5.0", "jest": "^24.9.0", - "typescript": "3.5.3" + "typescript": "3.7.0-beta" }, "jest": { "testEnvironment": "node" diff --git a/packages/kbn-i18n/package.json b/packages/kbn-i18n/package.json index dff8a3f2f4b78..8328a0406f8b0 100644 --- a/packages/kbn-i18n/package.json +++ b/packages/kbn-i18n/package.json @@ -21,7 +21,7 @@ "del": "^4.1.1", "getopts": "^2.2.4", "supports-color": "^7.0.0", - "typescript": "3.5.3" + "typescript": "3.7.0-beta" }, "dependencies": { "intl-format-cache": "^2.1.0", diff --git a/packages/kbn-pm/package.json b/packages/kbn-pm/package.json index a3d3baed3750b..0d38105a0ccbe 100644 --- a/packages/kbn-pm/package.json +++ b/packages/kbn-pm/package.json @@ -61,7 +61,7 @@ "strip-ansi": "^4.0.0", "strong-log-transformer": "^2.1.0", "tempy": "^0.3.0", - "typescript": "3.5.3", + "typescript": "3.7.0-beta", "unlazy-loader": "^0.1.3", "webpack": "^4.39.2", "webpack-cli": "^3.3.7", diff --git a/test/plugin_functional/plugins/core_plugin_a/package.json b/test/plugin_functional/plugins/core_plugin_a/package.json index 7dede34f3c0cf..735b7759a4b00 100644 --- a/test/plugin_functional/plugins/core_plugin_a/package.json +++ b/test/plugin_functional/plugins/core_plugin_a/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.5.3" + "typescript": "3.7.0-beta" } } diff --git a/test/plugin_functional/plugins/core_plugin_b/package.json b/test/plugin_functional/plugins/core_plugin_b/package.json index 18ff8cf7cc5c9..3746882b95530 100644 --- a/test/plugin_functional/plugins/core_plugin_b/package.json +++ b/test/plugin_functional/plugins/core_plugin_b/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.5.3" + "typescript": "3.7.0-beta" } } diff --git a/test/plugin_functional/plugins/core_plugin_legacy/package.json b/test/plugin_functional/plugins/core_plugin_legacy/package.json index 2ae83b28f7e85..69cbe9ef17a2c 100644 --- a/test/plugin_functional/plugins/core_plugin_legacy/package.json +++ b/test/plugin_functional/plugins/core_plugin_legacy/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.5.3" + "typescript": "3.7.0-beta" } } diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json index 127aa30fe499e..787d33293f779 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json @@ -17,6 +17,6 @@ }, "devDependencies": { "@kbn/plugin-helpers": "9.0.2", - "typescript": "3.5.3" + "typescript": "3.7.0-beta" } } diff --git a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json index 143460ce0a3ad..6fc70af3f1a8b 100644 --- a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json +++ b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json @@ -17,6 +17,6 @@ }, "devDependencies": { "@kbn/plugin-helpers": "9.0.2", - "typescript": "3.5.3" + "typescript": "3.7.0-beta" } } diff --git a/x-pack/legacy/plugins/apm/cypress/package.json b/x-pack/legacy/plugins/apm/cypress/package.json index 98dcd495b8594..e79f84342accb 100644 --- a/x-pack/legacy/plugins/apm/cypress/package.json +++ b/x-pack/legacy/plugins/apm/cypress/package.json @@ -15,7 +15,7 @@ "js-yaml": "^3.13.1", "p-limit": "^2.2.1", "ts-loader": "^6.1.0", - "typescript": "^3.6.3", + "typescript": "3.7.0-beta", "webpack": "^4.40.2" } } diff --git a/x-pack/package.json b/x-pack/package.json index 5a27764bdf9ee..50702bcd70e16 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -174,7 +174,7 @@ "tmp": "0.1.0", "tree-kill": "^1.1.0", "ts-loader": "^6.0.4", - "typescript": "3.5.3", + "typescript": "3.7.0-beta", "vinyl-fs": "^3.0.3", "xml-crypto": "^1.4.0", "yargs": "4.8.1" diff --git a/yarn.lock b/yarn.lock index 9d73d21a044bf..361d2714283e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -28010,10 +28010,10 @@ typescript-fsa@^2.0.0, typescript-fsa@^2.5.0: resolved "https://registry.yarnpkg.com/typescript-fsa/-/typescript-fsa-2.5.0.tgz#1baec01b5e8f5f34c322679d1327016e9e294faf" integrity sha1-G67AG16PXzTDImedEycBbp4pT68= -typescript@3.5.1, typescript@3.5.3, typescript@^3.0.1, typescript@^3.0.3, typescript@^3.2.2, typescript@^3.3.3333, typescript@^3.4.5, typescript@~3.3.3333, typescript@~3.5.3: - version "3.5.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977" - integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g== +typescript@3.7.0-beta, typescript@^3.0.1, typescript@^3.0.3, typescript@^3.2.2, typescript@^3.3.3333, typescript@^3.4.5, typescript@~3.3.3333, typescript@~3.5.3: + version "3.7.0-beta" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.0-beta.tgz#4ad556e0eee14b90ecc39261001690e16e5eeba9" + integrity sha512-4jyCX+IQamrPJxgkABPq9xf+hUN+GWHVxoj+oey1TadCPa4snQl1RKwUba+1dyzYCamwlCxKvZQ3TjyWLhMGBA== typings-tester@^0.3.2: version "0.3.2" From c2a6405bff7683bd08a3568a6be6eb2465e17df6 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Wed, 13 Nov 2019 11:51:05 +0100 Subject: [PATCH 02/18] Upgrade to TypeScript 3.7.2 --- package.json | 4 ++-- packages/kbn-analytics/package.json | 2 +- packages/kbn-config-schema/package.json | 2 +- packages/kbn-dev-utils/package.json | 2 +- packages/kbn-elastic-idx/package.json | 2 +- packages/kbn-i18n/package.json | 2 +- packages/kbn-pm/package.json | 2 +- test/plugin_functional/plugins/core_plugin_a/package.json | 2 +- test/plugin_functional/plugins/core_plugin_b/package.json | 2 +- .../plugins/core_plugin_legacy/package.json | 2 +- .../plugins/kbn_tp_embeddable_explorer/package.json | 2 +- .../plugins/kbn_tp_sample_panel_action/package.json | 2 +- x-pack/legacy/plugins/apm/cypress/package.json | 2 +- x-pack/package.json | 2 +- yarn.lock | 8 ++++---- 15 files changed, 19 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 4bf0bc9e6a13e..30c1c9439145d 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "**/@types/react": "16.8.3", "**/@types/hapi": "^17.0.18", "**/@types/angular": "^1.6.56", - "**/typescript": "3.7.0-beta", + "**/typescript": "3.7.2", "**/graphql-toolkit/lodash": "^4.17.13", "**/isomorphic-git/**/base64-js": "^1.2.1", "**/image-diff/gm/debug": "^2.6.9" @@ -444,7 +444,7 @@ "supertest": "^3.1.0", "supertest-as-promised": "^4.0.2", "tree-kill": "^1.2.1", - "typescript": "3.7.0-beta", + "typescript": "3.7.2", "typings-tester": "^0.3.2", "vinyl-fs": "^3.0.3", "xml2js": "^0.4.22", diff --git a/packages/kbn-analytics/package.json b/packages/kbn-analytics/package.json index f168cb967d4a6..f59fbf4720835 100644 --- a/packages/kbn-analytics/package.json +++ b/packages/kbn-analytics/package.json @@ -17,6 +17,6 @@ "@babel/cli": "7.5.5", "@kbn/dev-utils": "1.0.0", "@kbn/babel-preset": "1.0.0", - "typescript": "3.7.0-beta" + "typescript": "3.7.2" } } diff --git a/packages/kbn-config-schema/package.json b/packages/kbn-config-schema/package.json index d300b91f5e403..71c0ae4bff1f9 100644 --- a/packages/kbn-config-schema/package.json +++ b/packages/kbn-config-schema/package.json @@ -10,7 +10,7 @@ "kbn:bootstrap": "yarn build" }, "devDependencies": { - "typescript": "3.7.0-beta" + "typescript": "3.7.2" }, "peerDependencies": { "joi": "^13.5.2", diff --git a/packages/kbn-dev-utils/package.json b/packages/kbn-dev-utils/package.json index 16269f9d5846d..09753afeb120f 100644 --- a/packages/kbn-dev-utils/package.json +++ b/packages/kbn-dev-utils/package.json @@ -21,7 +21,7 @@ "tslib": "^1.9.3" }, "devDependencies": { - "typescript": "3.7.0-beta", + "typescript": "3.7.2", "@kbn/expect": "1.0.0", "chance": "1.0.18" } diff --git a/packages/kbn-elastic-idx/package.json b/packages/kbn-elastic-idx/package.json index ba59b2a00cfad..9532983942d6b 100644 --- a/packages/kbn-elastic-idx/package.json +++ b/packages/kbn-elastic-idx/package.json @@ -20,7 +20,7 @@ "@babel/core": "^7.5.5", "@babel/plugin-transform-async-to-generator": "^7.5.0", "jest": "^24.9.0", - "typescript": "3.7.0-beta" + "typescript": "3.7.2" }, "jest": { "testEnvironment": "node" diff --git a/packages/kbn-i18n/package.json b/packages/kbn-i18n/package.json index fdc710d255bee..3e25ceb8714df 100644 --- a/packages/kbn-i18n/package.json +++ b/packages/kbn-i18n/package.json @@ -21,7 +21,7 @@ "del": "^5.1.0", "getopts": "^2.2.4", "supports-color": "^7.0.0", - "typescript": "3.7.0-beta" + "typescript": "3.7.2" }, "dependencies": { "intl-format-cache": "^2.1.0", diff --git a/packages/kbn-pm/package.json b/packages/kbn-pm/package.json index 161b213ee0aaf..b05dc5cff58fc 100644 --- a/packages/kbn-pm/package.json +++ b/packages/kbn-pm/package.json @@ -58,7 +58,7 @@ "strip-ansi": "^4.0.0", "strong-log-transformer": "^2.1.0", "tempy": "^0.3.0", - "typescript": "3.7.0-beta", + "typescript": "3.7.2", "unlazy-loader": "^0.1.3", "webpack": "^4.41.0", "webpack-cli": "^3.3.9", diff --git a/test/plugin_functional/plugins/core_plugin_a/package.json b/test/plugin_functional/plugins/core_plugin_a/package.json index 735b7759a4b00..060ae49f43e8a 100644 --- a/test/plugin_functional/plugins/core_plugin_a/package.json +++ b/test/plugin_functional/plugins/core_plugin_a/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.0-beta" + "typescript": "3.7.2" } } diff --git a/test/plugin_functional/plugins/core_plugin_b/package.json b/test/plugin_functional/plugins/core_plugin_b/package.json index 3746882b95530..3eb878b9ed5dc 100644 --- a/test/plugin_functional/plugins/core_plugin_b/package.json +++ b/test/plugin_functional/plugins/core_plugin_b/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.0-beta" + "typescript": "3.7.2" } } diff --git a/test/plugin_functional/plugins/core_plugin_legacy/package.json b/test/plugin_functional/plugins/core_plugin_legacy/package.json index 69cbe9ef17a2c..5f784c7b836a5 100644 --- a/test/plugin_functional/plugins/core_plugin_legacy/package.json +++ b/test/plugin_functional/plugins/core_plugin_legacy/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.0-beta" + "typescript": "3.7.2" } } diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json index e2e9c3da67131..f4988d6b0915d 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json @@ -17,6 +17,6 @@ }, "devDependencies": { "@kbn/plugin-helpers": "9.0.2", - "typescript": "3.7.0-beta" + "typescript": "3.7.2" } } diff --git a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json index 83cc7e49702ef..a8c29c5e95711 100644 --- a/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json +++ b/test/plugin_functional/plugins/kbn_tp_sample_panel_action/package.json @@ -17,6 +17,6 @@ }, "devDependencies": { "@kbn/plugin-helpers": "9.0.2", - "typescript": "3.7.0-beta" + "typescript": "3.7.2" } } diff --git a/x-pack/legacy/plugins/apm/cypress/package.json b/x-pack/legacy/plugins/apm/cypress/package.json index e79f84342accb..b821511ac0b23 100644 --- a/x-pack/legacy/plugins/apm/cypress/package.json +++ b/x-pack/legacy/plugins/apm/cypress/package.json @@ -15,7 +15,7 @@ "js-yaml": "^3.13.1", "p-limit": "^2.2.1", "ts-loader": "^6.1.0", - "typescript": "3.7.0-beta", + "typescript": "3.7.2", "webpack": "^4.40.2" } } diff --git a/x-pack/package.json b/x-pack/package.json index 5a859f18e807c..1e0d19c3f0a94 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -171,7 +171,7 @@ "tmp": "0.1.0", "tree-kill": "^1.2.1", "ts-loader": "^6.0.4", - "typescript": "3.7.0-beta", + "typescript": "3.7.2", "vinyl-fs": "^3.0.3", "whatwg-fetch": "^3.0.0", "xml-crypto": "^1.4.0", diff --git a/yarn.lock b/yarn.lock index 4ad3c3db99501..ce0e2602b1fdc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27891,10 +27891,10 @@ typescript-fsa@^2.0.0, typescript-fsa@^2.5.0: resolved "https://registry.yarnpkg.com/typescript-fsa/-/typescript-fsa-2.5.0.tgz#1baec01b5e8f5f34c322679d1327016e9e294faf" integrity sha1-G67AG16PXzTDImedEycBbp4pT68= -typescript@3.5.3, typescript@3.7.0-beta, typescript@^3.0.1, typescript@^3.0.3, typescript@^3.2.2, typescript@^3.3.3333, typescript@^3.4.5, typescript@~3.3.3333, typescript@~3.5.3: - version "3.7.0-beta" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.0-beta.tgz#4ad556e0eee14b90ecc39261001690e16e5eeba9" - integrity sha512-4jyCX+IQamrPJxgkABPq9xf+hUN+GWHVxoj+oey1TadCPa4snQl1RKwUba+1dyzYCamwlCxKvZQ3TjyWLhMGBA== +typescript@3.5.3, typescript@3.7.2, typescript@^3.0.1, typescript@^3.0.3, typescript@^3.2.2, typescript@^3.3.3333, typescript@^3.4.5, typescript@~3.3.3333, typescript@~3.5.3: + version "3.7.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.2.tgz#27e489b95fa5909445e9fef5ee48d81697ad18fb" + integrity sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ== typings-tester@^0.3.2: version "0.3.2" From 123730963dff9b8fac489924732444497c96e545 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Wed, 13 Nov 2019 12:03:41 +0100 Subject: [PATCH 03/18] Upgrade cypress to 3.5.0 --- .../legacy/plugins/apm/cypress/package.json | 2 +- x-pack/package.json | 2 +- yarn.lock | 22 ++++++++++--------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/x-pack/legacy/plugins/apm/cypress/package.json b/x-pack/legacy/plugins/apm/cypress/package.json index b821511ac0b23..ef8955fcbd1b0 100644 --- a/x-pack/legacy/plugins/apm/cypress/package.json +++ b/x-pack/legacy/plugins/apm/cypress/package.json @@ -11,7 +11,7 @@ "@cypress/snapshot": "^2.1.3", "@cypress/webpack-preprocessor": "^4.1.0", "@types/js-yaml": "^3.12.1", - "cypress": "^3.4.1", + "cypress": "^3.5.0", "js-yaml": "^3.13.1", "p-limit": "^2.2.1", "ts-loader": "^6.1.0", diff --git a/x-pack/package.json b/x-pack/package.json index 1e0d19c3f0a94..160485fad2ae6 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -121,7 +121,7 @@ "cheerio": "0.22.0", "commander": "3.0.0", "copy-webpack-plugin": "^5.0.4", - "cypress": "^3.4.1", + "cypress": "^3.5.5", "enzyme": "^3.10.0", "enzyme-adapter-react-16": "^1.14.0", "enzyme-adapter-utils": "^1.12.0", diff --git a/yarn.lock b/yarn.lock index ce0e2602b1fdc..978f4a951c8a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3930,7 +3930,7 @@ resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-7.0.13.tgz#ca039c23a9e27ebea53e0901ef928ea2a1a6d313" integrity sha512-d7c/C/+H/knZ3L8/cxhicHUiTDxdgap0b/aNJfsmLwFu/iOP17mdgbQsbHA3SJmrzsjD0l3UEE5SN4xxuz5ung== -"@types/sizzle@*": +"@types/sizzle@*", "@types/sizzle@2.3.2": version "2.3.2" resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.2.tgz#a811b8c18e2babab7d542b3365887ae2e4d9de47" integrity sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg== @@ -9178,13 +9178,14 @@ cyclist@~0.2.2: resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" integrity sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA= -cypress@^3.4.1: - version "3.4.1" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-3.4.1.tgz#ca2e4e9864679da686c6a6189603efd409664c30" - integrity sha512-1HBS7t9XXzkt6QHbwfirWYty8vzxNMawGj1yI+Fu6C3/VZJ8UtUngMW6layqwYZzLTZV8tiDpdCNBypn78V4Dg== +cypress@^3.5.5: + version "3.6.1" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-3.6.1.tgz#4420957923879f60b7a5146ccbf81841a149b653" + integrity sha512-6n0oqENdz/oQ7EJ6IgESNb2M7Bo/70qX9jSJsAziJTC3kICfEMmJUlrAnP9bn+ut24MlXQST5nRXhUP5nRIx6A== dependencies: "@cypress/listr-verbose-renderer" "0.4.1" "@cypress/xvfb" "1.2.4" + "@types/sizzle" "2.3.2" arch "2.1.1" bluebird "3.5.0" cachedir "1.3.0" @@ -9211,6 +9212,7 @@ cypress@^3.4.1: request-progress "3.0.0" supports-color "5.5.0" tmp "0.1.0" + untildify "3.0.3" url "0.11.0" yauzl "2.10.0" @@ -28213,6 +28215,11 @@ unstated@^2.1.1: dependencies: create-react-context "^0.1.5" +untildify@3.0.3, untildify@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/untildify/-/untildify-3.0.3.tgz#1e7b42b140bcfd922b22e70ca1265bfe3634c7c9" + integrity sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA== + untildify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/untildify/-/untildify-2.1.0.tgz#17eb2807987f76952e9c0485fc311d06a826a2e0" @@ -28220,11 +28227,6 @@ untildify@^2.0.0: dependencies: os-homedir "^1.0.0" -untildify@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/untildify/-/untildify-3.0.3.tgz#1e7b42b140bcfd922b22e70ca1265bfe3634c7c9" - integrity sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA== - unzip-response@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-1.0.2.tgz#b984f0877fc0a89c2c773cc1ef7b5b232b5b06fe" From 7accd16baf6737fc5d8d0e5f8b28ba8fc6c747fb Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Wed, 13 Nov 2019 12:14:00 +0100 Subject: [PATCH 04/18] Upgrade apollo-link-http --- x-pack/package.json | 2 +- yarn.lock | 45 +++++++++++++++++++++++++++++++++------------ 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/x-pack/package.json b/x-pack/package.json index 160485fad2ae6..daab553367bf9 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -209,7 +209,7 @@ "apollo-client": "^2.3.8", "apollo-link": "^1.2.3", "apollo-link-error": "^1.1.7", - "apollo-link-http": "^1.5.4", + "apollo-link-http": "^1.5.16", "apollo-link-schema": "^1.1.0", "apollo-link-state": "^0.4.1", "apollo-server-errors": "^2.0.2", diff --git a/yarn.lock b/yarn.lock index 978f4a951c8a6..45f9af7f6434b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5125,20 +5125,23 @@ apollo-link-http-common@^0.2.13: ts-invariant "^0.3.2" tslib "^1.9.3" -apollo-link-http-common@^0.2.4: - version "0.2.4" - resolved "https://registry.yarnpkg.com/apollo-link-http-common/-/apollo-link-http-common-0.2.4.tgz#877603f7904dc8f70242cac61808b1f8d034b2c3" - integrity sha512-4j6o6WoXuSPen9xh4NBaX8/vL98X1xY2cYzUEK1F8SzvHe2oFONfxJBTekwU8hnvapcuq8Qh9Uct+gelu8T10g== +apollo-link-http-common@^0.2.15: + version "0.2.15" + resolved "https://registry.yarnpkg.com/apollo-link-http-common/-/apollo-link-http-common-0.2.15.tgz#304e67705122bf69a9abaded4351b10bc5efd6d9" + integrity sha512-+Heey4S2IPsPyTf8Ag3PugUupASJMW894iVps6hXbvwtg1aHSNMXUYO5VG7iRHkPzqpuzT4HMBanCTXPjtGzxg== dependencies: - apollo-link "^1.2.2" + apollo-link "^1.2.13" + ts-invariant "^0.4.0" + tslib "^1.9.3" -apollo-link-http@^1.5.4: - version "1.5.4" - resolved "https://registry.yarnpkg.com/apollo-link-http/-/apollo-link-http-1.5.4.tgz#b80b7b4b342c655b6a5614624b076a36be368f43" - integrity sha512-e9Ng3HfnW00Mh3TI6DhNRfozmzQOtKgdi+qUAsHBOEcTP0PTAmb+9XpeyEEOueLyO0GXhB92HUCIhzrWMXgwyg== +apollo-link-http@^1.5.16: + version "1.5.16" + resolved "https://registry.yarnpkg.com/apollo-link-http/-/apollo-link-http-1.5.16.tgz#44fe760bcc2803b8a7f57fc9269173afb00f3814" + integrity sha512-IA3xA/OcrOzINRZEECI6IdhRp/Twom5X5L9jMehfzEo2AXdeRwAMlH5LuvTZHgKD8V1MBnXdM6YXawXkTDSmJw== dependencies: - apollo-link "^1.2.2" - apollo-link-http-common "^0.2.4" + apollo-link "^1.2.13" + apollo-link-http-common "^0.2.15" + tslib "^1.9.3" apollo-link-schema@^1.1.0: version "1.1.0" @@ -5173,6 +5176,16 @@ apollo-link@^1.2.11: tslib "^1.9.3" zen-observable-ts "^0.8.18" +apollo-link@^1.2.13: + version "1.2.13" + resolved "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.13.tgz#dff00fbf19dfcd90fddbc14b6a3f9a771acac6c4" + integrity sha512-+iBMcYeevMm1JpYgwDEIDt/y0BB7VWyvlm/7x+TIPNLHCTCMgcEgDuW5kH86iQZWo0I7mNwQiTOz+/3ShPFmBw== + dependencies: + apollo-utilities "^1.3.0" + ts-invariant "^0.4.0" + tslib "^1.9.3" + zen-observable-ts "^0.8.20" + apollo-server-core@^1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/apollo-server-core/-/apollo-server-core-1.3.6.tgz#08636243c2de56fa8c267d68dd602cb1fbd323e3" @@ -5224,7 +5237,7 @@ apollo-utilities@^1.2.1: ts-invariant "^0.2.1" tslib "^1.9.3" -apollo-utilities@^1.3.2: +apollo-utilities@^1.3.0, apollo-utilities@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/apollo-utilities/-/apollo-utilities-1.3.2.tgz#8cbdcf8b012f664cd6cb5767f6130f5aed9115c9" integrity sha512-JWNHj8XChz7S4OZghV6yc9FNnzEXj285QYp/nLNh943iObycI5GTDO3NGR9Dth12LRrSFMeDOConPfPln+WGfg== @@ -30507,6 +30520,14 @@ zen-observable-ts@^0.8.18: tslib "^1.9.3" zen-observable "^0.8.0" +zen-observable-ts@^0.8.20: + version "0.8.20" + resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-0.8.20.tgz#44091e335d3fcbc97f6497e63e7f57d5b516b163" + integrity sha512-2rkjiPALhOtRaDX6pWyNqK1fnP5KkJJybYebopNSn6wDG1lxBoFs2+nwwXKoA6glHIrtwrfBBy6da0stkKtTAA== + dependencies: + tslib "^1.9.3" + zen-observable "^0.8.0" + zen-observable@^0.8.0: version "0.8.8" resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.8.tgz#1ea93995bf098754a58215a1e0a7309e5749ec42" From 7a59c52a592db5263300cb23349314c9df66768e Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Wed, 13 Nov 2019 14:16:24 +0100 Subject: [PATCH 05/18] Update prettier --- package.json | 2 +- packages/kbn-pm/package.json | 2 +- packages/kbn-spec-to-console/package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 30c1c9439145d..d9527cf44b96a 100644 --- a/package.json +++ b/package.json @@ -433,7 +433,7 @@ "pngjs": "^3.4.0", "postcss": "^7.0.5", "postcss-url": "^8.0.0", - "prettier": "^1.18.2", + "prettier": "^1.19.1", "proxyquire": "1.8.0", "regenerate": "^1.4.0", "sass-lint": "^1.12.1", diff --git a/packages/kbn-pm/package.json b/packages/kbn-pm/package.json index b05dc5cff58fc..2f9b177be6532 100644 --- a/packages/kbn-pm/package.json +++ b/packages/kbn-pm/package.json @@ -50,7 +50,7 @@ "log-symbols": "^2.2.0", "ncp": "^2.0.0", "ora": "^1.4.0", - "prettier": "^1.18.2", + "prettier": "^1.19.1", "read-pkg": "^5.2.0", "rxjs": "^6.5.3", "spawn-sync": "^1.0.15", diff --git a/packages/kbn-spec-to-console/package.json b/packages/kbn-spec-to-console/package.json index 2e5f897894a90..a6b3e8f96f7db 100644 --- a/packages/kbn-spec-to-console/package.json +++ b/packages/kbn-spec-to-console/package.json @@ -18,7 +18,7 @@ "homepage": "https://github.com/jbudz/spec-to-console#readme", "devDependencies": { "jest": "^24.9.0", - "prettier": "^1.18.2" + "prettier": "^1.19.1" }, "dependencies": { "commander": "^3.0.0", diff --git a/yarn.lock b/yarn.lock index 45f9af7f6434b..b9730bbc28be1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21820,10 +21820,10 @@ prettier@1.16.4: resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.16.4.tgz#73e37e73e018ad2db9c76742e2647e21790c9717" integrity sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g== -prettier@^1.18.2: - version "1.18.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" - integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== +prettier@^1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" + integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== pretty-bytes@^4.0.2: version "4.0.2" From a468d4d43f8edef6378af98287834c9c1514be50 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Wed, 13 Nov 2019 14:17:58 +0100 Subject: [PATCH 06/18] Fix expression types --- src/plugins/expressions/public/types/index.ts | 2 -- x-pack/typings/global-fetch.d.ts | 9 +++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 x-pack/typings/global-fetch.d.ts diff --git a/src/plugins/expressions/public/types/index.ts b/src/plugins/expressions/public/types/index.ts index 87ef810682f60..faceef4f90a6f 100644 --- a/src/plugins/expressions/public/types/index.ts +++ b/src/plugins/expressions/public/types/index.ts @@ -21,8 +21,6 @@ import { ExpressionInterpret } from '../interpreter_provider'; import { TimeRange } from '../../../data/public'; import { Adapters } from '../../../inspector/public'; import { Query } from '../../../data/public'; -import { ExpressionAST } from '../../../expressions/public'; -import { ExpressionArgAST } from '../../../../plugins/expressions/public'; import { esFilters } from '../../../../plugins/data/public'; export { ArgumentType } from './arguments'; diff --git a/x-pack/typings/global-fetch.d.ts b/x-pack/typings/global-fetch.d.ts new file mode 100644 index 0000000000000..b2be5f7f24567 --- /dev/null +++ b/x-pack/typings/global-fetch.d.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +// This type needs to still exist due to apollo-link-http-common hasn't yet updated +// it's usage (https://github.com/apollographql/apollo-link/issues/1131) +declare type GlobalFetch = WindowOrWorkerGlobalScope; From 130099b470009f44b21ff4dc52a14ba46411307f Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Wed, 13 Nov 2019 14:43:55 +0100 Subject: [PATCH 07/18] Fix Lens test typings --- .../lens/public/indexpattern_plugin/datapanel.test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/datapanel.test.tsx b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/datapanel.test.tsx index 11294bedbfff0..affb1accbbef4 100644 --- a/x-pack/legacy/plugins/lens/public/indexpattern_plugin/datapanel.test.tsx +++ b/x-pack/legacy/plugins/lens/public/indexpattern_plugin/datapanel.test.tsx @@ -329,10 +329,10 @@ describe('IndexPattern Data Panel', () => { act(() => { ((inst.setProps as unknown) as (props: unknown) => {})({ ...props, - ...(propChanges || {}), + ...((propChanges as object) || {}), state: { ...props.state, - ...(stateChanges || {}), + ...((stateChanges as object) || {}), }, }); inst.update(); From 39ebc927425d1e2797ee76e416c489d7cd080ad0 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Thu, 14 Nov 2019 12:17:11 +0100 Subject: [PATCH 08/18] Fix ML breakage --- .../plugins/ml/public/data_frame_analytics/common/analytics.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/legacy/plugins/ml/public/data_frame_analytics/common/analytics.ts b/x-pack/legacy/plugins/ml/public/data_frame_analytics/common/analytics.ts index 385d50215cd21..04dff6e0b4dc5 100644 --- a/x-pack/legacy/plugins/ml/public/data_frame_analytics/common/analytics.ts +++ b/x-pack/legacy/plugins/ml/public/data_frame_analytics/common/analytics.ts @@ -11,7 +11,6 @@ import { Subscription } from 'rxjs'; import { idx } from '@kbn/elastic-idx'; import { ml } from '../../services/ml_api_service'; import { getErrorMessage } from '../pages/analytics_management/hooks/use_create_analytics_form'; -import { RegressionEvaluateResponse } from '../common'; export type IndexName = string; export type IndexPattern = string; From 123624afe2f14fe2498891215328be59fcc9fc5f Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Thu, 14 Nov 2019 12:17:26 +0100 Subject: [PATCH 09/18] Fix APM breakage --- .../apm/server/lib/metrics/transform_metrics_chart.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/x-pack/legacy/plugins/apm/server/lib/metrics/transform_metrics_chart.ts b/x-pack/legacy/plugins/apm/server/lib/metrics/transform_metrics_chart.ts index 594a0d35ed176..3764f18a6d692 100644 --- a/x-pack/legacy/plugins/apm/server/lib/metrics/transform_metrics_chart.ts +++ b/x-pack/legacy/plugins/apm/server/lib/metrics/transform_metrics_chart.ts @@ -48,9 +48,10 @@ type GenericMetricsRequest = Overwrite< } >; -export function transformDataToMetricsChart< - TRequest extends GenericMetricsRequest ->(result: ESSearchResponse, chartBase: ChartBase) { +export function transformDataToMetricsChart( + result: ESSearchResponse, + chartBase: ChartBase +) { const { aggregations, hits } = result; const timeseriesData = idx(aggregations, _ => _.timeseriesData); From 3220a282275acf01b4d5ca17eaf5ef57dfb175bc Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Thu, 14 Nov 2019 12:30:11 +0100 Subject: [PATCH 10/18] Fix sinon stub typing --- src/legacy/core_plugins/console/server/request.test.ts | 4 ++-- .../export_types/csv/server/lib/__tests__/hit_iterator.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/legacy/core_plugins/console/server/request.test.ts b/src/legacy/core_plugins/console/server/request.test.ts index 463649a090295..d5504c0f3a3c2 100644 --- a/src/legacy/core_plugins/console/server/request.test.ts +++ b/src/legacy/core_plugins/console/server/request.test.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import http from 'http'; +import http, { ClientRequest } from 'http'; import * as sinon from 'sinon'; import { sendRequest } from './request'; import { URL } from 'url'; @@ -24,7 +24,7 @@ import { fail } from 'assert'; describe(`Console's send request`, () => { let sandbox: sinon.SinonSandbox; - let stub: sinon.SinonStub; + let stub: sinon.SinonStub, ClientRequest>; let fakeRequest: http.ClientRequest; beforeEach(() => { diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/__tests__/hit_iterator.ts b/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/__tests__/hit_iterator.ts index c439c2bbf60eb..20e373a4168af 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/__tests__/hit_iterator.ts +++ b/x-pack/legacy/plugins/reporting/export_types/csv/server/lib/__tests__/hit_iterator.ts @@ -22,7 +22,7 @@ const mockCallEndpoint = sinon.stub(); const mockSearchRequest = {}; const mockConfig: ScrollConfig = { duration: '2s', size: 123 }; let realCancellationToken = new CancellationToken(); -let isCancelledStub: sinon.SinonStub; +let isCancelledStub: sinon.SinonStub<[], boolean>; describe('hitIterator', function() { beforeEach(() => { From c75375fb4df0e7fdc474e9b4e1df00a783ca06fd Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Thu, 14 Nov 2019 13:08:09 +0100 Subject: [PATCH 11/18] Fix beats management types --- .../plugins/beats_management/public/utils/typed_react.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/beats_management/public/utils/typed_react.ts b/x-pack/legacy/plugins/beats_management/public/utils/typed_react.ts index 5557befa9d7e5..dbc0894ab8071 100644 --- a/x-pack/legacy/plugins/beats_management/public/utils/typed_react.ts +++ b/x-pack/legacy/plugins/beats_management/public/utils/typed_react.ts @@ -43,7 +43,9 @@ export const asChildFunctionRenderer = ( } public render() { - return this.props.children(this.getRendererArgs()); + return (this.props.children as ChildFunctionRendererProps['children'])( + this.getRendererArgs() + ); } private getRendererArgs = () => From 5e62e852435032dc7dcc87fbb5e018345e607c71 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Thu, 14 Nov 2019 13:21:32 +0100 Subject: [PATCH 12/18] Fix WMSOptions types --- .../public/components/wms_options.tsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/legacy/core_plugins/tile_map/public/components/wms_options.tsx b/src/legacy/core_plugins/tile_map/public/components/wms_options.tsx index ef6b2eaea1e52..c5ccc3acba610 100644 --- a/src/legacy/core_plugins/tile_map/public/components/wms_options.tsx +++ b/src/legacy/core_plugins/tile_map/public/components/wms_options.tsx @@ -23,23 +23,26 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { TmsLayer } from 'ui/vis/map/service_settings'; +import { Vis } from 'ui/vis'; +import { RegionMapVisParams } from '../../../region_map/public/types'; import { SelectOption, SwitchOption } from '../../../kbn_vislib_vis_types/public/components'; -import { RegionMapOptionsProps } from '../../../region_map/public/components/region_map_options'; import { WmsInternalOptions } from './wms_internal_options'; -import { TileMapOptionsProps } from './tile_map_options'; -import { TileMapVisParams } from '../types'; +import { WMSOptions, TileMapVisParams } from '../types'; + +interface Props { + stateParams: TileMapVisParams | RegionMapVisParams; + setValue: (title: 'wms', options: WMSOptions) => void; + vis: Vis; +} const mapLayerForOption = ({ id }: TmsLayer) => ({ text: id, value: id }); -function WmsOptions({ stateParams, setValue, vis }: TileMapOptionsProps | RegionMapOptionsProps) { +function WmsOptions({ stateParams, setValue, vis }: Props) { const { wms } = stateParams; const { tmsLayers } = vis.type.editorConfig.collections; const tmsLayerOptions = useMemo(() => tmsLayers.map(mapLayerForOption), [tmsLayers]); - const setWmsOption = ( - paramName: T, - value: TileMapVisParams['wms'][T] - ) => + const setWmsOption = (paramName: T, value: WMSOptions[T]) => setValue('wms', { ...wms, [paramName]: value, From a61c57292fcdfadc768a370a36873a14110f067c Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Thu, 14 Nov 2019 15:53:34 +0100 Subject: [PATCH 13/18] Fix ui_filters in APM --- .../plugins/apm/server/routes/ui_filters.ts | 98 +++++++++++-------- 1 file changed, 57 insertions(+), 41 deletions(-) diff --git a/x-pack/legacy/plugins/apm/server/routes/ui_filters.ts b/x-pack/legacy/plugins/apm/server/routes/ui_filters.ts index 36508e53acce7..7c30581617f1a 100644 --- a/x-pack/legacy/plugins/apm/server/routes/ui_filters.ts +++ b/x-pack/legacy/plugins/apm/server/routes/ui_filters.ts @@ -60,17 +60,13 @@ const localUiBaseQueryRt = t.intersection([ rangeRt ]); -function createLocalFiltersRoute< - TPath extends string, - TProjection extends Projection, - TQueryRT extends t.HasProps ->({ +function createLocalFiltersRoute({ path, getProjection, queryRt }: { - path: TPath; - getProjection: GetProjection; + path: string; + getProjection: GetProjection; queryRt: TQueryRT; }) { return createRoute(() => ({ @@ -109,13 +105,25 @@ function createLocalFiltersRoute< })); } -export const servicesLocalFiltersRoute = createLocalFiltersRoute({ +export const servicesLocalFiltersRoute = createLocalFiltersRoute>({ path: `/api/apm/ui_filters/local_filters/services`, getProjection: ({ setup }) => getServicesProjection({ setup }), queryRt: t.type({}) }); -export const transactionGroupsLocalFiltersRoute = createLocalFiltersRoute({ +const transactionGroupsLocalFiltersQueryRt = t.intersection([ + t.type({ + serviceName: t.string, + transactionType: t.string + }), + t.partial({ + transactionName: t.string + }) +]); + +export const transactionGroupsLocalFiltersRoute = createLocalFiltersRoute< + typeof transactionGroupsLocalFiltersQueryRt +>({ path: '/api/apm/ui_filters/local_filters/transactionGroups', getProjection: ({ setup, query }) => { const { transactionType, serviceName, transactionName } = query; @@ -129,18 +137,10 @@ export const transactionGroupsLocalFiltersRoute = createLocalFiltersRoute({ } }); }, - queryRt: t.intersection([ - t.type({ - serviceName: t.string, - transactionType: t.string - }), - t.partial({ - transactionName: t.string - }) - ]) + queryRt: transactionGroupsLocalFiltersQueryRt }); -export const tracesLocalFiltersRoute = createLocalFiltersRoute({ +export const tracesLocalFiltersRoute = createLocalFiltersRoute>({ path: '/api/apm/ui_filters/local_filters/traces', getProjection: ({ setup }) => { return getTransactionGroupsProjection({ @@ -151,7 +151,15 @@ export const tracesLocalFiltersRoute = createLocalFiltersRoute({ queryRt: t.type({}) }); -export const transactionsLocalFiltersRoute = createLocalFiltersRoute({ +const transactionsLocalFiltersQueryRt = t.type({ + transactionType: t.string, + transactionName: t.string, + serviceName: t.string +}); + +export const transactionsLocalFiltersRoute = createLocalFiltersRoute< + typeof transactionsLocalFiltersQueryRt +>({ path: '/api/apm/ui_filters/local_filters/transactions', getProjection: ({ setup, query }) => { const { transactionType, serviceName, transactionName } = query; @@ -162,14 +170,21 @@ export const transactionsLocalFiltersRoute = createLocalFiltersRoute({ transactionName }); }, - queryRt: t.type({ - transactionType: t.string, - transactionName: t.string, + queryRt: transactionsLocalFiltersQueryRt +}); + +const metricsLocalFiltersQueryRt = t.intersection([ + t.type({ serviceName: t.string + }), + t.partial({ + serviceNodeName: t.string }) -}); +]); -export const metricsLocalFiltersRoute = createLocalFiltersRoute({ +export const metricsLocalFiltersRoute = createLocalFiltersRoute< + typeof metricsLocalFiltersQueryRt +>({ path: '/api/apm/ui_filters/local_filters/metrics', getProjection: ({ setup, query }) => { const { serviceName, serviceNodeName } = query; @@ -179,17 +194,16 @@ export const metricsLocalFiltersRoute = createLocalFiltersRoute({ serviceNodeName }); }, - queryRt: t.intersection([ - t.type({ - serviceName: t.string - }), - t.partial({ - serviceNodeName: t.string - }) - ]) + queryRt: metricsLocalFiltersQueryRt +}); + +const errorGroupsLocalFiltersQueryRt = t.type({ + serviceName: t.string }); -export const errorGroupsLocalFiltersRoute = createLocalFiltersRoute({ +export const errorGroupsLocalFiltersRoute = createLocalFiltersRoute< + typeof errorGroupsLocalFiltersQueryRt +>({ path: '/api/apm/ui_filters/local_filters/errorGroups', getProjection: ({ setup, query }) => { const { serviceName } = query; @@ -198,12 +212,16 @@ export const errorGroupsLocalFiltersRoute = createLocalFiltersRoute({ serviceName }); }, - queryRt: t.type({ - serviceName: t.string - }) + queryRt: errorGroupsLocalFiltersQueryRt +}); + +const serviceNodesLocalFiltersQueryRt = t.type({ + serviceName: t.string }); -export const serviceNodesLocalFiltersRoute = createLocalFiltersRoute({ +export const serviceNodesLocalFiltersRoute = createLocalFiltersRoute< + typeof serviceNodesLocalFiltersQueryRt +>({ path: '/api/apm/ui_filters/local_filters/serviceNodes', getProjection: ({ setup, query }) => { return getServiceNodesProjection({ @@ -211,9 +229,7 @@ export const serviceNodesLocalFiltersRoute = createLocalFiltersRoute({ serviceName: query.serviceName }); }, - queryRt: t.type({ - serviceName: t.string - }) + queryRt: serviceNodesLocalFiltersQueryRt }); type BaseQueryType = typeof localUiBaseQueryRt; From ef912fc12ab95bca7b117a66cadabecc84d9a16a Mon Sep 17 00:00:00 2001 From: Dario Gieselaar Date: Thu, 14 Nov 2019 22:46:32 +0100 Subject: [PATCH 14/18] APM: Explicitly type Setup to prevent hitting TS limits --- .../apm/server/lib/helpers/setup_request.ts | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/x-pack/legacy/plugins/apm/server/lib/helpers/setup_request.ts b/x-pack/legacy/plugins/apm/server/lib/helpers/setup_request.ts index dcc034287863a..ab0f47eb04d62 100644 --- a/x-pack/legacy/plugins/apm/server/lib/helpers/setup_request.ts +++ b/x-pack/legacy/plugins/apm/server/lib/helpers/setup_request.ts @@ -7,10 +7,15 @@ import { Legacy } from 'kibana'; import { Server } from 'hapi'; import moment from 'moment'; +import { KibanaConfig } from 'src/legacy/server/kbn_server'; import { getESClient } from './es_client'; import { getUiFiltersES } from './convert_ui_filters/get_ui_filters_es'; -import { PromiseReturnType } from '../../../typings/common'; -import { getApmIndices } from '../settings/apm_indices/get_apm_indices'; +import { + getApmIndices, + ApmIndicesConfig +} from '../settings/apm_indices/get_apm_indices'; +import { ESFilter } from '../../../typings/elasticsearch'; +import { ESClient } from './es_client'; function decodeUiFilters(server: Server, uiFiltersEncoded?: string) { if (!uiFiltersEncoded) { @@ -26,9 +31,20 @@ export interface APMRequestQuery { end?: string; uiFilters?: string; } +// Explicitly type Setup to prevent TS initialization errors +// https://github.com/microsoft/TypeScript/issues/34933 -export type Setup = PromiseReturnType; -export async function setupRequest(req: Legacy.Request) { +export interface Setup { + start: number; + end: number; + uiFiltersES: ESFilter[]; + client: ESClient; + internalClient: ESClient; + config: KibanaConfig; + indices: ApmIndicesConfig; +} + +export async function setupRequest(req: Legacy.Request): Promise { const query = (req.query as unknown) as APMRequestQuery; const { server } = req; const savedObjectsClient = server.savedObjects.getScopedSavedObjectsClient( From 7d848c1765f0e0be0c8742e2db7f1f513a33eadf Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Thu, 14 Nov 2019 23:30:30 +0100 Subject: [PATCH 15/18] Change file name to correct case --- x-pack/typings/{global-fetch.d.ts => global_fetch.d.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename x-pack/typings/{global-fetch.d.ts => global_fetch.d.ts} (100%) diff --git a/x-pack/typings/global-fetch.d.ts b/x-pack/typings/global_fetch.d.ts similarity index 100% rename from x-pack/typings/global-fetch.d.ts rename to x-pack/typings/global_fetch.d.ts From 327cb838f7513919e9afdaf9837cd2a39445bb61 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Fri, 15 Nov 2019 00:42:29 +0100 Subject: [PATCH 16/18] Add styleguide rule for optional chaining --- STYLEGUIDE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/STYLEGUIDE.md b/STYLEGUIDE.md index 5fd3ef5e8ff4b..461d51a3e76e3 100644 --- a/STYLEGUIDE.md +++ b/STYLEGUIDE.md @@ -120,6 +120,7 @@ You should prefer modern language features in a lot of cases, e.g.: * Prefer arrow function over storing `this` (no `const self = this;`) * Prefer template strings over string concatenation * Prefer the spread operator for copying arrays (`[...arr]`) over `arr.slice()` +* Use optional chaining (`?.`) and nullish Coalescing (`??`) over `lodash.get` (and similar utilities) ### Avoid mutability and state From a8b93981dce6087c4a245fc5943f6373a1dcb04a Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Fri, 15 Nov 2019 01:43:50 +0100 Subject: [PATCH 17/18] Update typescript-eslint packages --- package.json | 4 +-- packages/eslint-config-kibana/package.json | 4 +-- yarn.lock | 41 +++++++++++----------- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index 06569f6309893..c0e2acdb578c4 100644 --- a/package.json +++ b/package.json @@ -346,8 +346,8 @@ "@types/uuid": "^3.4.4", "@types/vinyl-fs": "^2.4.11", "@types/zen-observable": "^0.8.0", - "@typescript-eslint/eslint-plugin": "^2.5.0", - "@typescript-eslint/parser": "^2.5.0", + "@typescript-eslint/eslint-plugin": "^2.7.0", + "@typescript-eslint/parser": "^2.7.0", "angular-mocks": "^1.7.8", "archiver": "^3.1.1", "axe-core": "^3.3.2", diff --git a/packages/eslint-config-kibana/package.json b/packages/eslint-config-kibana/package.json index b5079a49c8385..c67629f058d5a 100644 --- a/packages/eslint-config-kibana/package.json +++ b/packages/eslint-config-kibana/package.json @@ -15,8 +15,8 @@ }, "homepage": "https://github.com/elastic/eslint-config-kibana#readme", "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^2.5.0", - "@typescript-eslint/parser": "^2.5.0", + "@typescript-eslint/eslint-plugin": "^2.7.0", + "@typescript-eslint/parser": "^2.7.0", "babel-eslint": "^10.0.3", "eslint": "^6.5.1", "eslint-plugin-babel": "^5.3.0", diff --git a/yarn.lock b/yarn.lock index 105708f3c086f..5bb6bb3da2e47 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4191,24 +4191,24 @@ resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.0.tgz#8b63ab7f1aa5321248aad5ac890a485656dcea4d" integrity sha512-te5lMAWii1uEJ4FwLjzdlbw3+n0FZNOvFXHxQDKeT0dilh7HOzdMzV2TrJVUzq8ep7J4Na8OUYPRLSQkJHAlrg== -"@typescript-eslint/eslint-plugin@^2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.5.0.tgz#101d96743ce3365b3223df73d641078c9b775903" - integrity sha512-ddrJZxp5ns1Lh5ofZQYk3P8RyvKfyz/VcRR4ZiJLHO/ljnQAO8YvTfj268+WJOOadn99mvDiqJA65+HAKoeSPA== +"@typescript-eslint/eslint-plugin@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.7.0.tgz#dff176bdb73dfd7e2e43062452189bd1b9db6021" + integrity sha512-H5G7yi0b0FgmqaEUpzyBlVh0d9lq4cWG2ap0RKa6BkF3rpBb6IrAoubt1NWh9R2kRs/f0k6XwRDiDz3X/FqXhQ== dependencies: - "@typescript-eslint/experimental-utils" "2.5.0" + "@typescript-eslint/experimental-utils" "2.7.0" eslint-utils "^1.4.2" functional-red-black-tree "^1.0.1" regexpp "^2.0.1" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.5.0.tgz#383a97ded9a7940e5053449f6d73995e782b8fb1" - integrity sha512-UgcQGE0GKJVChyRuN1CWqDW8Pnu7+mVst0aWrhiyuUD1J9c+h8woBdT4XddCvhcXDodTDVIfE3DzGHVjp7tUeQ== +"@typescript-eslint/experimental-utils@2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.7.0.tgz#58d790a3884df3041b5a5e08f9e5e6b7c41864b5" + integrity sha512-9/L/OJh2a5G2ltgBWJpHRfGnt61AgDeH6rsdg59BH0naQseSwR7abwHq3D5/op0KYD/zFT4LS5gGvWcMmegTEg== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/typescript-estree" "2.5.0" + "@typescript-eslint/typescript-estree" "2.7.0" eslint-scope "^5.0.0" "@typescript-eslint/experimental-utils@^1.13.0": @@ -4220,14 +4220,14 @@ "@typescript-eslint/typescript-estree" "1.13.0" eslint-scope "^4.0.0" -"@typescript-eslint/parser@^2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.5.0.tgz#858030ddd808fbbe88e03f42e5971efaccb8218a" - integrity sha512-9UBMiAwIDWSl79UyogaBdj3hidzv6exjKUx60OuZuFnJf56tq/UMpdPcX09YmGqE8f4AnAueYtBxV8IcAT3jdQ== +"@typescript-eslint/parser@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.7.0.tgz#b5e6a4944e2b68dba1e7fbfd5242e09ff552fd12" + integrity sha512-ctC0g0ZvYclxMh/xI+tyqP0EC2fAo6KicN9Wm2EIao+8OppLfxji7KAGJosQHSGBj3TcqUrA96AjgXuKa5ob2g== dependencies: "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "2.5.0" - "@typescript-eslint/typescript-estree" "2.5.0" + "@typescript-eslint/experimental-utils" "2.7.0" + "@typescript-eslint/typescript-estree" "2.7.0" eslint-visitor-keys "^1.1.0" "@typescript-eslint/typescript-estree@1.13.0": @@ -4238,16 +4238,17 @@ lodash.unescape "4.0.1" semver "5.5.0" -"@typescript-eslint/typescript-estree@2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.5.0.tgz#40ada624d6217ef092a3a79ed30d947ad4f212ce" - integrity sha512-AXURyF8NcA3IsnbjNX1v9qbwa0dDoY9YPcKYR2utvMHoUcu3636zrz0gRWtVAyxbPCkhyKuGg6WZIyi2Fc79CA== +"@typescript-eslint/typescript-estree@2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.7.0.tgz#34fd98c77a07b40d04d5b4203eddd3abeab909f4" + integrity sha512-vVCE/DY72N4RiJ/2f10PTyYekX2OLaltuSIBqeHYI44GQ940VCYioInIb8jKMrK9u855OEJdFC+HmWAZTnC+Ag== dependencies: debug "^4.1.1" glob "^7.1.4" is-glob "^4.0.1" lodash.unescape "4.0.1" semver "^6.3.0" + tsutils "^3.17.1" "@typescript-eslint/typescript-estree@^1.9.0": version "1.9.0" From 0442cb84a422b460e5251bbcccc2cf5d9c3c57d1 Mon Sep 17 00:00:00 2001 From: Dario Gieselaar Date: Fri, 15 Nov 2019 08:45:53 +0100 Subject: [PATCH 18/18] Revert changes in ui filters routes that are no longer needed --- .../plugins/apm/server/routes/ui_filters.ts | 98 ++++++++----------- 1 file changed, 41 insertions(+), 57 deletions(-) diff --git a/x-pack/legacy/plugins/apm/server/routes/ui_filters.ts b/x-pack/legacy/plugins/apm/server/routes/ui_filters.ts index 7c30581617f1a..36508e53acce7 100644 --- a/x-pack/legacy/plugins/apm/server/routes/ui_filters.ts +++ b/x-pack/legacy/plugins/apm/server/routes/ui_filters.ts @@ -60,13 +60,17 @@ const localUiBaseQueryRt = t.intersection([ rangeRt ]); -function createLocalFiltersRoute({ +function createLocalFiltersRoute< + TPath extends string, + TProjection extends Projection, + TQueryRT extends t.HasProps +>({ path, getProjection, queryRt }: { - path: string; - getProjection: GetProjection; + path: TPath; + getProjection: GetProjection; queryRt: TQueryRT; }) { return createRoute(() => ({ @@ -105,25 +109,13 @@ function createLocalFiltersRoute({ })); } -export const servicesLocalFiltersRoute = createLocalFiltersRoute>({ +export const servicesLocalFiltersRoute = createLocalFiltersRoute({ path: `/api/apm/ui_filters/local_filters/services`, getProjection: ({ setup }) => getServicesProjection({ setup }), queryRt: t.type({}) }); -const transactionGroupsLocalFiltersQueryRt = t.intersection([ - t.type({ - serviceName: t.string, - transactionType: t.string - }), - t.partial({ - transactionName: t.string - }) -]); - -export const transactionGroupsLocalFiltersRoute = createLocalFiltersRoute< - typeof transactionGroupsLocalFiltersQueryRt ->({ +export const transactionGroupsLocalFiltersRoute = createLocalFiltersRoute({ path: '/api/apm/ui_filters/local_filters/transactionGroups', getProjection: ({ setup, query }) => { const { transactionType, serviceName, transactionName } = query; @@ -137,10 +129,18 @@ export const transactionGroupsLocalFiltersRoute = createLocalFiltersRoute< } }); }, - queryRt: transactionGroupsLocalFiltersQueryRt + queryRt: t.intersection([ + t.type({ + serviceName: t.string, + transactionType: t.string + }), + t.partial({ + transactionName: t.string + }) + ]) }); -export const tracesLocalFiltersRoute = createLocalFiltersRoute>({ +export const tracesLocalFiltersRoute = createLocalFiltersRoute({ path: '/api/apm/ui_filters/local_filters/traces', getProjection: ({ setup }) => { return getTransactionGroupsProjection({ @@ -151,15 +151,7 @@ export const tracesLocalFiltersRoute = createLocalFiltersRoute>({ queryRt: t.type({}) }); -const transactionsLocalFiltersQueryRt = t.type({ - transactionType: t.string, - transactionName: t.string, - serviceName: t.string -}); - -export const transactionsLocalFiltersRoute = createLocalFiltersRoute< - typeof transactionsLocalFiltersQueryRt ->({ +export const transactionsLocalFiltersRoute = createLocalFiltersRoute({ path: '/api/apm/ui_filters/local_filters/transactions', getProjection: ({ setup, query }) => { const { transactionType, serviceName, transactionName } = query; @@ -170,21 +162,14 @@ export const transactionsLocalFiltersRoute = createLocalFiltersRoute< transactionName }); }, - queryRt: transactionsLocalFiltersQueryRt -}); - -const metricsLocalFiltersQueryRt = t.intersection([ - t.type({ + queryRt: t.type({ + transactionType: t.string, + transactionName: t.string, serviceName: t.string - }), - t.partial({ - serviceNodeName: t.string }) -]); +}); -export const metricsLocalFiltersRoute = createLocalFiltersRoute< - typeof metricsLocalFiltersQueryRt ->({ +export const metricsLocalFiltersRoute = createLocalFiltersRoute({ path: '/api/apm/ui_filters/local_filters/metrics', getProjection: ({ setup, query }) => { const { serviceName, serviceNodeName } = query; @@ -194,16 +179,17 @@ export const metricsLocalFiltersRoute = createLocalFiltersRoute< serviceNodeName }); }, - queryRt: metricsLocalFiltersQueryRt -}); - -const errorGroupsLocalFiltersQueryRt = t.type({ - serviceName: t.string + queryRt: t.intersection([ + t.type({ + serviceName: t.string + }), + t.partial({ + serviceNodeName: t.string + }) + ]) }); -export const errorGroupsLocalFiltersRoute = createLocalFiltersRoute< - typeof errorGroupsLocalFiltersQueryRt ->({ +export const errorGroupsLocalFiltersRoute = createLocalFiltersRoute({ path: '/api/apm/ui_filters/local_filters/errorGroups', getProjection: ({ setup, query }) => { const { serviceName } = query; @@ -212,16 +198,12 @@ export const errorGroupsLocalFiltersRoute = createLocalFiltersRoute< serviceName }); }, - queryRt: errorGroupsLocalFiltersQueryRt -}); - -const serviceNodesLocalFiltersQueryRt = t.type({ - serviceName: t.string + queryRt: t.type({ + serviceName: t.string + }) }); -export const serviceNodesLocalFiltersRoute = createLocalFiltersRoute< - typeof serviceNodesLocalFiltersQueryRt ->({ +export const serviceNodesLocalFiltersRoute = createLocalFiltersRoute({ path: '/api/apm/ui_filters/local_filters/serviceNodes', getProjection: ({ setup, query }) => { return getServiceNodesProjection({ @@ -229,7 +211,9 @@ export const serviceNodesLocalFiltersRoute = createLocalFiltersRoute< serviceName: query.serviceName }); }, - queryRt: serviceNodesLocalFiltersQueryRt + queryRt: t.type({ + serviceName: t.string + }) }); type BaseQueryType = typeof localUiBaseQueryRt;