chore(NA): moving @kbn/cli-dev-mode to babel transpiler (#107779) (#107914)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
This commit is contained in:
Kibana Machine 2021-08-09 13:46:35 -04:00 committed by GitHub
parent 158cc73087
commit 6b846f4d48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 12 deletions

View file

@ -0,0 +1,3 @@
{
"presets": ["@kbn/babel-preset/node_preset"]
}

View file

@ -1,5 +1,6 @@
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-cli-dev-mode"
PKG_REQUIRE_NAME = "@kbn/cli-dev-mode"
@ -23,7 +24,7 @@ NPM_MODULE_EXTRA_FILES = [
"README.md"
]
SRC_DEPS = [
RUNTIME_DEPS = [
"//packages/kbn-config",
"//packages/kbn-config-schema",
"//packages/kbn-dev-utils",
@ -46,6 +47,21 @@ SRC_DEPS = [
]
TYPES_DEPS = [
"//packages/kbn-config",
"//packages/kbn-config-schema",
"//packages/kbn-dev-utils",
"//packages/kbn-logging",
"//packages/kbn-optimizer",
"//packages/kbn-server-http-tools",
"//packages/kbn-std",
"//packages/kbn-utils",
"@npm//argsplit",
"@npm//chokidar",
"@npm//elastic-apm-node",
"@npm//execa",
"@npm//moment",
"@npm//rxjs",
"@npm//supertest",
"@npm//@types/hapi__h2o2",
"@npm//@types/hapi__hapi",
"@npm//@types/getopts",
@ -55,7 +71,11 @@ TYPES_DEPS = [
"@npm//@types/supertest",
]
DEPS = SRC_DEPS + TYPES_DEPS
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)
ts_config(
name = "tsconfig",
@ -66,23 +86,24 @@ ts_config(
)
ts_project(
name = "tsc",
name = "tsc_types",
args = ['--pretty'],
srcs = SRCS,
deps = DEPS,
deps = TYPES_DEPS,
declaration = True,
declaration_map = True,
incremental = True,
out_dir = "target",
source_map = True,
emit_declaration_only = True,
incremental = False,
out_dir = "target_types",
root_dir = "src",
source_map = True,
tsconfig = ":tsconfig",
)
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = DEPS + [":tsc"],
deps = RUNTIME_DEPS + [":target_node", ":tsc_types"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)

View file

@ -1,7 +1,7 @@
{
"name": "@kbn/cli-dev-mode",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"main": "./target_node/index.js",
"types": "./target_types/index.d.ts",
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0",
"private": true,

View file

@ -1,10 +1,11 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": true,
"outDir": "./target",
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"incremental": false,
"outDir": "./target_types",
"rootDir": "./src",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-cli-dev-mode/src",