Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-108777
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Aug 20, 2021
2 parents 13496f0 + a7289d1 commit 880db5e
Show file tree
Hide file tree
Showing 499 changed files with 1,047 additions and 714 deletions.
6 changes: 3 additions & 3 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
"visTypeTagCloud": "src/plugins/vis_type_tagcloud",
"visTypeTimeseries": "src/plugins/vis_type_timeseries",
"visTypeVega": "src/plugins/vis_type_vega",
"visTypeVislib": "src/plugins/vis_type_vislib",
"visTypeXy": "src/plugins/vis_type_xy",
"visTypePie": "src/plugins/vis_type_pie",
"visTypeVislib": "src/plugins/vis_types/vislib",
"visTypeXy": "src/plugins/vis_types/xy",
"visTypePie": "src/plugins/vis_types/pie",
"visualizations": "src/plugins/visualizations",
"visualize": "src/plugins/visualize",
"apmOss": "src/plugins/apm_oss",
Expand Down
6 changes: 3 additions & 3 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ The plugin exposes the static DefaultEditorController class to consume.
|WARNING: Missing README.
|{kib-repo}blob/{branch}/src/plugins/vis_type_pie[visTypePie]
|{kib-repo}blob/{branch}/src/plugins/vis_types/pie[visTypePie]
|WARNING: Missing README.
Expand All @@ -318,11 +318,11 @@ The plugin exposes the static DefaultEditorController class to consume.
|WARNING: Missing README.
|{kib-repo}blob/{branch}/src/plugins/vis_type_vislib[visTypeVislib]
|{kib-repo}blob/{branch}/src/plugins/vis_types/vislib[visTypeVislib]
|WARNING: Missing README.
|{kib-repo}blob/{branch}/src/plugins/vis_type_xy[visTypeXy]
|{kib-repo}blob/{branch}/src/plugins/vis_types/xy[visTypeXy]
|WARNING: Missing README.
Expand Down
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
'<rootDir>/packages/*/jest.config.js',
'<rootDir>/src/*/jest.config.js',
'<rootDir>/src/plugins/*/jest.config.js',
'<rootDir>/src/plugins/vis_types/*/jest.config.js',
'<rootDir>/test/*/jest.config.js',
'<rootDir>/x-pack/plugins/*/jest.config.js',
],
Expand Down
4 changes: 4 additions & 0 deletions packages/kbn-optimizer/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@kbn/babel-preset/node_preset"],
"ignore": ["**/*.test.js"]
}
34 changes: 28 additions & 6 deletions packages/kbn-optimizer/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")

PKG_BASE_NAME = "kbn-optimizer"
PKG_REQUIRE_NAME = "@kbn/optimizer"
Expand Down Expand Up @@ -29,7 +30,7 @@ NPM_MODULE_EXTRA_FILES = [
"README.md"
]

SRC_DEPS = [
RUNTIME_DEPS = [
"//packages/kbn-config",
"//packages/kbn-dev-utils",
"//packages/kbn-std",
Expand Down Expand Up @@ -59,6 +60,22 @@ SRC_DEPS = [
]

TYPES_DEPS = [
"//packages/kbn-config",
"//packages/kbn-dev-utils",
"//packages/kbn-std",
"//packages/kbn-ui-shared-deps",
"//packages/kbn-utils",
"@npm//chalk",
"@npm//clean-webpack-plugin",
"@npm//cpy",
"@npm//del",
"@npm//execa",
"@npm//jest-diff",
"@npm//lmdb-store",
"@npm//pirates",
"@npm//resize-observer-polyfill",
"@npm//rxjs",
"@npm//zlib",
"@npm//@types/compression-webpack-plugin",
"@npm//@types/jest",
"@npm//@types/json-stable-stringify",
Expand All @@ -72,7 +89,11 @@ TYPES_DEPS = [
"@npm//@types/webpack-sources",
]

DEPS = SRC_DEPS + TYPES_DEPS
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)

ts_config(
name = "tsconfig",
Expand All @@ -84,13 +105,14 @@ ts_config(
)

ts_project(
name = "tsc",
name = "tsc_types",
args = ['--pretty'],
srcs = SRCS,
deps = DEPS,
deps = TYPES_DEPS,
declaration = True,
declaration_map = True,
out_dir = "target",
emit_declaration_only = True,
out_dir = "target_types",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
Expand All @@ -99,7 +121,7 @@ ts_project(
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = DEPS + [":tsc"],
deps = RUNTIME_DEPS + [":target_node", ":tsc_types"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
Expand Down
12 changes: 0 additions & 12 deletions packages/kbn-optimizer/babel.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions packages/kbn-optimizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"version": "1.0.0",
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/index.d.ts"
"main": "./target_node/index.js",
"types": "./target_types/index.d.ts"
}
3 changes: 2 additions & 1 deletion packages/kbn-optimizer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"extends": "../../tsconfig.bazel.json",
"compilerOptions": {
"outDir": "./target/types",
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "./target_types",
"rootDir": "./src",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-optimizer/src",
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-plugin-helpers/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@kbn/babel-preset/node_preset"]
}
25 changes: 19 additions & 6 deletions packages/kbn-plugin-helpers/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")

PKG_BASE_NAME = "kbn-plugin-helpers"
PKG_REQUIRE_NAME = "@kbn/plugin-helpers"
Expand All @@ -26,7 +27,7 @@ NPM_MODULE_EXTRA_FILES = [
"README.md"
]

SRC_DEPS = [
RUNTIME_DEPS = [
"//packages/kbn-dev-utils",
"//packages/kbn-optimizer",
"//packages/kbn-utils",
Expand All @@ -41,6 +42,13 @@ SRC_DEPS = [
]

TYPES_DEPS = [
"//packages/kbn-dev-utils",
"//packages/kbn-optimizer",
"//packages/kbn-utils",
"@npm//del",
"@npm//execa",
"@npm//globby",
"@npm//load-json-file",
"@npm//@types/extract-zip",
"@npm//@types/gulp-zip",
"@npm//@types/inquirer",
Expand All @@ -49,7 +57,11 @@ TYPES_DEPS = [
"@npm//@types/vinyl-fs",
]

DEPS = SRC_DEPS + TYPES_DEPS
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)

ts_config(
name = "tsconfig",
Expand All @@ -61,13 +73,14 @@ ts_config(
)

ts_project(
name = "tsc",
name = "tsc_types",
args = ['--pretty'],
srcs = SRCS,
deps = DEPS,
deps = TYPES_DEPS,
declaration = True,
declaration_map = True,
out_dir = "target",
emit_declaration_only = True,
out_dir = "target_types",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
Expand All @@ -76,7 +89,7 @@ ts_project(
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = DEPS + [":tsc"],
deps = RUNTIME_DEPS + [":target_node", ":tsc_types"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-plugin-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"kibana": {
"devOnly": true
},
"main": "target/index.js",
"types": "target/index.d.ts",
"main": "target_node/index.js",
"types": "target_types/index.d.ts",
"bin": {
"plugin-helpers": "bin/plugin-helpers.js"
}
Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-plugin-helpers/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"extends": "../../tsconfig.bazel.json",
"compilerOptions": {
"outDir": "target",
"target": "ES2018",
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "target_types",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-plugin-helpers/src",
"target": "ES2018",
"types": [
"jest",
"node"
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-test/src/jest/setup/babel_polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
// Note: In theory importing the polyfill should not be needed, as Babel should
// include the necessary polyfills when using `@babel/preset-env`, but for some
// reason it did not work. See https://github.com/elastic/kibana/issues/14506
import '@kbn/optimizer/target/node/polyfill';
import '@kbn/optimizer/target_node/node/polyfill';
1 change: 1 addition & 0 deletions src/dev/build/tasks/copy_source_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const CopySource: Task = {
'!src/dev/**',
'!src/setup_node_env/babel_register/index.js',
'!src/setup_node_env/babel_register/register.js',
'!**/jest.config.js',
'!src/plugins/telemetry/schema/**', // Skip telemetry schemas
'!**/public/**/*.{js,ts,tsx,json,scss}',
'typings/**',
Expand Down
1 change: 1 addition & 0 deletions src/dev/typescript/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const PROJECTS = [

...findProjects('packages/*/tsconfig.json'),
...findProjects('src/plugins/*/tsconfig.json'),
...findProjects('src/plugins/vis_types/*/tsconfig.json'),
...findProjects('x-pack/plugins/*/tsconfig.json'),
...findProjects('examples/*/tsconfig.json'),
...findProjects('x-pack/examples/*/tsconfig.json'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { HttpSetup } from 'kibana/public';
import React, { createContext, useContext } from 'react';

import { useRequest } from '../../../public';
import { useRequest } from '../../../public/request';

import { Privileges, Error as CustomError } from '../types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface EuiCodeEditorProps extends SupportedAriaAttributes, Omit<IAceEd
onBlur?: IAceEditorProps['onBlur'];
onFocus?: IAceEditorProps['onFocus'];
isReadOnly?: boolean;
setOptions: IAceEditorProps['setOptions'];
setOptions?: IAceEditorProps['setOptions'];
cursorStart?: number;
'data-test-subj'?: string;
/**
Expand All @@ -70,7 +70,10 @@ export interface EuiCodeEditorState {

class EuiCodeEditor extends Component<EuiCodeEditorProps, EuiCodeEditorState> {
static defaultProps = {
setOptions: {},
setOptions: {
showLineNumbers: false,
tabSize: 2,
},
};

state: EuiCodeEditorState = {
Expand Down
24 changes: 0 additions & 24 deletions src/plugins/vis_type_pie/tsconfig.json

This file was deleted.

26 changes: 0 additions & 26 deletions src/plugins/vis_type_vislib/tsconfig.json

This file was deleted.

24 changes: 0 additions & 24 deletions src/plugins/vis_type_xy/tsconfig.json

This file was deleted.

Loading

0 comments on commit 880db5e

Please sign in to comment.