7d66002da2
* Bump node to ^16 * fix comment * use jest timers * bump mock-fs * Fix core type errors * Unskipping tests that work on my machine * skip new unhandled promise rejection * Fix Nodejs v16 regression due to https://github.com/nodejs/node/issues/38924 * Fix failing concurrent connections collector test * Fix types after merge from master * update servicenow test * Skip unhandledRejection tests * Skip tests with unhandled promise rejection * Fix discover jest failures * bump node to 16.11.1 * revert timeout increase * skip unhandled promise rejection * rm jest import * skip unhandled promise rejection Co-authored-by: Rudolf Meijering <skaapgif@gmail.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tim Roes <tim.roes@elastic.co>
114 lines
2 KiB
Python
114 lines
2 KiB
Python
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-i18n"
|
|
PKG_REQUIRE_NAME = "@kbn/i18n"
|
|
|
|
SOURCE_FILES = glob(
|
|
[
|
|
"src/**/*.ts",
|
|
"src/**/*.tsx",
|
|
"src/core/locales.js",
|
|
"types/**/*.ts",
|
|
],
|
|
exclude = [
|
|
"**/*.test.*",
|
|
"**/__fixtures__/**",
|
|
"**/__snapshots__/**",
|
|
],
|
|
)
|
|
|
|
SRCS = SOURCE_FILES
|
|
|
|
filegroup(
|
|
name = "srcs",
|
|
srcs = SRCS,
|
|
)
|
|
|
|
NPM_MODULE_EXTRA_FILES = [
|
|
"react/package.json",
|
|
"package.json",
|
|
"GUIDELINE.md",
|
|
"README.md"
|
|
]
|
|
|
|
RUNTIME_DEPS = [
|
|
"@npm//intl-format-cache",
|
|
"@npm//intl-messageformat",
|
|
"@npm//intl-relativeformat",
|
|
"@npm//prop-types",
|
|
"@npm//react",
|
|
"@npm//react-intl"
|
|
]
|
|
|
|
TYPES_DEPS = [
|
|
"//packages/kbn-babel-preset",
|
|
"@npm//intl-messageformat",
|
|
"@npm//tslib",
|
|
"@npm//@types/intl-relativeformat",
|
|
"@npm//@types/jest",
|
|
"@npm//@types/node",
|
|
"@npm//@types/prop-types",
|
|
"@npm//@types/react",
|
|
"@npm//@types/react-intl",
|
|
]
|
|
|
|
jsts_transpiler(
|
|
name = "target_node",
|
|
srcs = SRCS,
|
|
build_pkg_name = package_name(),
|
|
)
|
|
|
|
jsts_transpiler(
|
|
name = "target_web",
|
|
srcs = SRCS,
|
|
build_pkg_name = package_name(),
|
|
web = True,
|
|
)
|
|
|
|
ts_config(
|
|
name = "tsconfig",
|
|
src = "tsconfig.json",
|
|
deps = [
|
|
"//:tsconfig.base.json",
|
|
"//:tsconfig.bazel.json",
|
|
],
|
|
)
|
|
|
|
ts_project(
|
|
name = "tsc_types",
|
|
args = ['--pretty'],
|
|
srcs = SRCS,
|
|
deps = TYPES_DEPS,
|
|
declaration = True,
|
|
declaration_map = True,
|
|
emit_declaration_only = True,
|
|
out_dir = "target_types",
|
|
source_map = True,
|
|
root_dir = "src",
|
|
tsconfig = ":tsconfig",
|
|
)
|
|
|
|
js_library(
|
|
name = PKG_BASE_NAME,
|
|
srcs = NPM_MODULE_EXTRA_FILES,
|
|
deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"],
|
|
package_name = PKG_REQUIRE_NAME,
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
pkg_npm(
|
|
name = "npm_module",
|
|
deps = [
|
|
":%s" % PKG_BASE_NAME,
|
|
]
|
|
)
|
|
|
|
filegroup(
|
|
name = "build",
|
|
srcs = [
|
|
":npm_module",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|