5dd68dd7b3
## Summary Fixes https://github.com/elastic/kibana/issues/105731, by replacing these `any` types: ```json type IFieldType = any; type IIndexPattern = any; type Filter = any; ``` With the types from `es-query` which are: * IndexPatternFieldBase * IndexPatternBase * Filter Note: I had to do a few creative casting to avoid having to use `FieldSpec` since that is not within the package `es-query` and is not planned to be within that package or another package for at least a while if ever. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
91 lines
1.5 KiB
Python
91 lines
1.5 KiB
Python
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
|
|
|
|
PKG_BASE_NAME = "kbn-securitysolution-list-utils"
|
|
|
|
PKG_REQUIRE_NAME = "@kbn/securitysolution-list-utils"
|
|
|
|
SOURCE_FILES = glob(
|
|
[
|
|
"src/**/*.ts",
|
|
],
|
|
exclude = [
|
|
"**/*.test.*",
|
|
"**/*.mock.*",
|
|
],
|
|
)
|
|
|
|
SRCS = SOURCE_FILES
|
|
|
|
filegroup(
|
|
name = "srcs",
|
|
srcs = SRCS,
|
|
)
|
|
|
|
NPM_MODULE_EXTRA_FILES = [
|
|
"package.json",
|
|
"README.md",
|
|
]
|
|
|
|
SRC_DEPS = [
|
|
"//packages/kbn-i18n",
|
|
"//packages/kbn-securitysolution-list-constants",
|
|
"//packages/kbn-securitysolution-io-ts-list-types",
|
|
"//packages/kbn-securitysolution-utils",
|
|
"//packages/kbn-es-query",
|
|
"@npm//lodash",
|
|
"@npm//tslib",
|
|
]
|
|
|
|
TYPES_DEPS = [
|
|
"@npm//@types/jest",
|
|
"@npm//@types/lodash",
|
|
"@npm//@types/node",
|
|
]
|
|
|
|
DEPS = SRC_DEPS + TYPES_DEPS
|
|
|
|
ts_config(
|
|
name = "tsconfig",
|
|
src = "tsconfig.json",
|
|
deps = [
|
|
"//:tsconfig.base.json",
|
|
],
|
|
)
|
|
|
|
ts_project(
|
|
name = "tsc",
|
|
srcs = SRCS,
|
|
args = ["--pretty"],
|
|
declaration = True,
|
|
declaration_map = True,
|
|
incremental = True,
|
|
out_dir = "target",
|
|
root_dir = "src",
|
|
source_map = True,
|
|
tsconfig = ":tsconfig",
|
|
deps = DEPS,
|
|
)
|
|
|
|
js_library(
|
|
name = PKG_BASE_NAME,
|
|
package_name = PKG_REQUIRE_NAME,
|
|
srcs = NPM_MODULE_EXTRA_FILES,
|
|
visibility = ["//visibility:public"],
|
|
deps = DEPS + [":tsc"],
|
|
)
|
|
|
|
pkg_npm(
|
|
name = "npm_module",
|
|
deps = [
|
|
":%s" % PKG_BASE_NAME,
|
|
],
|
|
)
|
|
|
|
filegroup(
|
|
name = "build",
|
|
srcs = [
|
|
":npm_module",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|