chore(NA): moving @kbn/securitysolution-hook-utils to babel transpiler (#109432) (#109665)

* chore(NA): moving @kbn/securitysolution-hook-utils to babel transpiler

* chore(NA): update packages/kbn-securitysolution-hook-utils/.babelrc

Co-authored-by: Frank Hassanabad <frankhassanabad@gmail.com>

* chore(NA): correct deps

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

Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
Co-authored-by: Frank Hassanabad <frankhassanabad@gmail.com>
This commit is contained in:
Kibana Machine 2021-08-23 12:50:33 -04:00 committed by GitHub
parent d5cfb34c37
commit 24386d92ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 11 deletions

View file

@ -0,0 +1,4 @@
{
"presets": ["@kbn/babel-preset/node_preset"],
"ignore": ["**/*.test.ts", "**/*.test.tsx"]
}

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-securitysolution-hook-utils"
@ -27,19 +28,27 @@ NPM_MODULE_EXTRA_FILES = [
"README.md",
]
SRC_DEPS = [
RUNTIME_DEPS = [
"@npm//@testing-library/react-hooks",
"@npm//react",
"@npm//rxjs",
"@npm//tslib",
]
TYPES_DEPS = [
"@npm//@testing-library/react-hooks",
"@npm//rxjs",
"@npm//tslib",
"@npm//@types/jest",
"@npm//@types/node",
"@npm//@types/react",
]
DEPS = SRC_DEPS + TYPES_DEPS
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)
ts_config(
name = "tsconfig",
@ -51,24 +60,25 @@ ts_config(
)
ts_project(
name = "tsc",
srcs = SRCS,
name = "tsc_types",
args = ["--pretty"],
srcs = SRCS,
deps = TYPES_DEPS,
declaration = True,
declaration_map = True,
out_dir = "target",
emit_declaration_only = True,
out_dir = "target_types",
root_dir = "src",
source_map = True,
tsconfig = ":tsconfig",
deps = DEPS,
)
js_library(
name = PKG_BASE_NAME,
package_name = PKG_REQUIRE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":tsc_types"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
deps = DEPS + [":tsc"],
)
pkg_npm(

View file

@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "Security Solution utilities for React hooks",
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"main": "./target_node/index.js",
"types": "./target_types/index.d.ts",
"private": true
}

View file

@ -3,7 +3,8 @@
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"outDir": "target",
"emitDeclarationOnly": true,
"outDir": "target_types",
"rootDir": "src",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-securitysolution-hook-utils/src",