* [kbn/ui-shared-deps] split into two packages * fix asset categorizer * update snapshots * reference npm dll from optimizer Co-authored-by: spalger <spalger@users.noreply.github.com> # Conflicts: # .github/CODEOWNERS # src/plugins/interactive_setup/public/single_chars_field.tsx # test/scripts/jenkins_build_kibana.sh
145 lines
2.9 KiB
Python
145 lines
2.9 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-optimizer"
|
|
PKG_REQUIRE_NAME = "@kbn/optimizer"
|
|
|
|
SOURCE_FILES = glob(
|
|
[
|
|
"src/**/*.ts",
|
|
],
|
|
exclude = [
|
|
"**/*.test.*",
|
|
"**/__fixtures__/**",
|
|
"**/__snapshots__/**",
|
|
],
|
|
)
|
|
|
|
SRCS = SOURCE_FILES
|
|
|
|
filegroup(
|
|
name = "srcs",
|
|
srcs = SRCS,
|
|
)
|
|
|
|
NPM_MODULE_EXTRA_FILES = [
|
|
"limits.yml",
|
|
"package.json",
|
|
"postcss.config.js",
|
|
"README.md"
|
|
]
|
|
|
|
RUNTIME_DEPS = [
|
|
"//packages/kbn-config",
|
|
"//packages/kbn-dev-utils",
|
|
"//packages/kbn-std",
|
|
"//packages/kbn-ui-shared-deps-npm",
|
|
"//packages/kbn-ui-shared-deps-src",
|
|
"//packages/kbn-utils",
|
|
"@npm//chalk",
|
|
"@npm//clean-webpack-plugin",
|
|
"@npm//compression-webpack-plugin",
|
|
"@npm//cpy",
|
|
"@npm//del",
|
|
"@npm//execa",
|
|
"@npm//jest-diff",
|
|
"@npm//json-stable-stringify",
|
|
"@npm//lmdb-store",
|
|
"@npm//loader-utils",
|
|
"@npm//node-sass",
|
|
"@npm//normalize-path",
|
|
"@npm//pirates",
|
|
"@npm//resize-observer-polyfill",
|
|
"@npm//rxjs",
|
|
"@npm//source-map-support",
|
|
"@npm//watchpack",
|
|
"@npm//webpack",
|
|
"@npm//webpack-merge",
|
|
"@npm//webpack-sources",
|
|
"@npm//zlib"
|
|
]
|
|
|
|
TYPES_DEPS = [
|
|
"//packages/kbn-config",
|
|
"//packages/kbn-dev-utils",
|
|
"//packages/kbn-std",
|
|
"//packages/kbn-ui-shared-deps-npm",
|
|
"//packages/kbn-ui-shared-deps-src",
|
|
"//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",
|
|
"@npm//@types/loader-utils",
|
|
"@npm//@types/node",
|
|
"@npm//@types/normalize-path",
|
|
"@npm//@types/source-map-support",
|
|
"@npm//@types/watchpack",
|
|
"@npm//@types/webpack",
|
|
"@npm//@types/webpack-merge",
|
|
"@npm//@types/webpack-sources",
|
|
]
|
|
|
|
jsts_transpiler(
|
|
name = "target_node",
|
|
srcs = SRCS,
|
|
build_pkg_name = package_name(),
|
|
)
|
|
|
|
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", ":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"],
|
|
)
|