mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
* [@kbn/dev-utils] break out more pieces * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
180 lines
3.7 KiB
Text
180 lines
3.7 KiB
Text
load("@npm//@bazel/typescript:index.bzl", "ts_config")
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
|
|
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
|
|
|
|
PKG_BASE_NAME = "kbn-dev-utils"
|
|
PKG_REQUIRE_NAME = "@kbn/dev-utils"
|
|
|
|
SOURCE_FILES = glob(
|
|
[
|
|
"src/**/*.ts",
|
|
],
|
|
exclude = [
|
|
"**/*.test.*"
|
|
],
|
|
)
|
|
|
|
SRCS = SOURCE_FILES
|
|
|
|
filegroup(
|
|
name = "srcs",
|
|
srcs = SRCS,
|
|
)
|
|
|
|
filegroup(
|
|
name = "certs",
|
|
srcs = glob(
|
|
[
|
|
"certs/**/*",
|
|
],
|
|
exclude = [
|
|
"**/README.md"
|
|
],
|
|
),
|
|
)
|
|
|
|
NPM_MODULE_EXTRA_FILES = [
|
|
"package.json",
|
|
"README.md",
|
|
":certs",
|
|
]
|
|
|
|
RUNTIME_DEPS = [
|
|
"//packages/kbn-dev-cli-runner",
|
|
"//packages/kbn-dev-cli-errors",
|
|
"//packages/kbn-dev-proc-runner",
|
|
"//packages/kbn-std",
|
|
"//packages/kbn-utils",
|
|
"//packages/kbn-plugin-discovery",
|
|
"//packages/kbn-tooling-log",
|
|
"//packages/kbn-stdio-dev-helpers",
|
|
"//packages/kbn-ci-stats-reporter",
|
|
"//packages/kbn-jest-serializers",
|
|
"//packages/kbn-kibana-json-schema",
|
|
"@npm//@babel/core",
|
|
"@npm//axios",
|
|
"@npm//chalk",
|
|
"@npm//cheerio",
|
|
"@npm//dedent",
|
|
"@npm//execa",
|
|
"@npm//exit-hook",
|
|
"@npm//getopts",
|
|
"@npm//jest-diff",
|
|
"@npm//load-json-file",
|
|
"@npm//markdown-it",
|
|
"@npm//normalize-path",
|
|
"@npm//prettier",
|
|
"@npm//rxjs",
|
|
"@npm//strip-ansi",
|
|
"@npm//sort-package-json",
|
|
"@npm//tar",
|
|
"@npm//tree-kill",
|
|
"@npm//vinyl",
|
|
"@npm//yauzl",
|
|
]
|
|
|
|
TYPES_DEPS = [
|
|
"//packages/kbn-dev-cli-runner:npm_module_types",
|
|
"//packages/kbn-dev-cli-errors:npm_module_types",
|
|
"//packages/kbn-dev-proc-runner:npm_module_types",
|
|
"//packages/kbn-std:npm_module_types",
|
|
"//packages/kbn-utils:npm_module_types",
|
|
"//packages/kbn-plugin-discovery:npm_module_types",
|
|
"//packages/kbn-tooling-log:npm_module_types",
|
|
"//packages/kbn-stdio-dev-helpers:npm_module_types",
|
|
"//packages/kbn-ci-stats-reporter:npm_module_types",
|
|
"//packages/kbn-jest-serializers:npm_module_types",
|
|
"//packages/kbn-kibana-json-schema:npm_module_types",
|
|
"@npm//@babel/parser",
|
|
"@npm//@babel/types",
|
|
"@npm//@types/babel__core",
|
|
"@npm//@types/cheerio",
|
|
"@npm//@types/dedent",
|
|
"@npm//@types/flot",
|
|
"@npm//@types/jest",
|
|
"@npm//@types/markdown-it",
|
|
"@npm//@types/node",
|
|
"@npm//@types/normalize-path",
|
|
"@npm//@types/prettier",
|
|
"@npm//@types/react",
|
|
"@npm//@types/tar",
|
|
"@npm//@types/testing-library__jest-dom",
|
|
"@npm//@types/vinyl",
|
|
"@npm//@types/yauzl",
|
|
"@npm//axios",
|
|
"@npm//execa",
|
|
"@npm//exit-hook",
|
|
"@npm//getopts",
|
|
"@npm//jest-diff",
|
|
"@npm//rxjs",
|
|
"@npm//sort-package-json",
|
|
"@npm//strip-ansi",
|
|
"@npm//tree-kill",
|
|
]
|
|
|
|
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,
|
|
emit_declaration_only = True,
|
|
out_dir = "target_types",
|
|
root_dir = "src",
|
|
tsconfig = ":tsconfig",
|
|
)
|
|
|
|
js_library(
|
|
name = PKG_BASE_NAME,
|
|
srcs = NPM_MODULE_EXTRA_FILES,
|
|
deps = RUNTIME_DEPS + [":target_node"],
|
|
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"],
|
|
)
|
|
|
|
pkg_npm_types(
|
|
name = "npm_module_types",
|
|
srcs = SRCS,
|
|
deps = [":tsc_types"],
|
|
package_name = PKG_REQUIRE_NAME,
|
|
tsconfig = ":tsconfig",
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
filegroup(
|
|
name = "build_types",
|
|
srcs = [
|
|
":npm_module_types",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|