mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
* [type-summarizer] reimplement for broader support * Enable sourceMaps in all packages * include naming collision in summarizePackage test * fix readmes * remove unnecessary transient dependency * remove code that was commented out * remove outdated todo comment * ensure errors triggered by untyped-exports are ligible * remove unused import * break out snippet generation from AstIndexer * refactor several massive files into smaller pieces and add more inline docs * fix typos * update jest snapshots * add sections to readme that points people to the useful parts of the source code along with a high-level overview of how the type-summarizer works * remove --dump flag, it doesn't work * use decName instead of calling names.get a second time * include `export` as invalid name
116 lines
2.2 KiB
Text
116 lines
2.2 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-generate"
|
|
PKG_REQUIRE_NAME = "@kbn/generate"
|
|
|
|
SOURCE_FILES = glob(
|
|
[
|
|
"src/**/*.ts",
|
|
],
|
|
exclude = [
|
|
"**/*.test.*"
|
|
],
|
|
)
|
|
|
|
SRCS = SOURCE_FILES
|
|
|
|
filegroup(
|
|
name = "srcs",
|
|
srcs = SRCS,
|
|
)
|
|
|
|
NPM_MODULE_EXTRA_FILES = glob(["templates/**/*"]) + [
|
|
"package.json",
|
|
]
|
|
|
|
RUNTIME_DEPS = [
|
|
"//packages/kbn-dev-utils",
|
|
"//packages/kbn-bazel-packages",
|
|
"//packages/kbn-utils",
|
|
"//packages/kbn-sort-package-json",
|
|
"@npm//ejs",
|
|
"@npm//micromatch",
|
|
"@npm//normalize-path",
|
|
]
|
|
|
|
TYPES_DEPS = [
|
|
"//packages/kbn-dev-utils:npm_module_types",
|
|
"//packages/kbn-bazel-packages:npm_module_types",
|
|
"//packages/kbn-utils:npm_module_types",
|
|
"//packages/kbn-sort-package-json:npm_module_types",
|
|
"@npm//@types/micromatch",
|
|
"@npm//ejs",
|
|
"@npm//micromatch",
|
|
"@npm//normalize-path",
|
|
"@npm//@types/ejs",
|
|
]
|
|
|
|
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",
|
|
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"],
|
|
)
|