mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
chore(NA): moving @kbn/securitysolution-autocomplete to babel transpiler (#109423)
* chore(NA): moving @kbn/securitysolution-autocomplete to babel transpiler * chore(NA): finetune package * chore(NA): update deps Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
c4d1e7da4a
commit
e340ce61cc
7 changed files with 50 additions and 93 deletions
4
packages/kbn-securitysolution-autocomplete/.babelrc
Normal file
4
packages/kbn-securitysolution-autocomplete/.babelrc
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"presets": ["@kbn/babel-preset/node_preset"],
|
||||
"ignore": ["**/*.test.ts", "**/*.test.tsx"]
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"presets": ["@kbn/babel-preset/webpack_preset"],
|
||||
"ignore": ["**/*.test.ts", "**/*.test.tsx"]
|
||||
}
|
|
@ -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-autocomplete"
|
||||
|
||||
|
@ -25,35 +26,54 @@ filegroup(
|
|||
)
|
||||
|
||||
NPM_MODULE_EXTRA_FILES = [
|
||||
"react/package.json",
|
||||
"package.json",
|
||||
"README.md",
|
||||
]
|
||||
|
||||
SRC_DEPS = [
|
||||
"//packages/kbn-babel-preset",
|
||||
"//packages/kbn-dev-utils",
|
||||
"//packages/kbn-i18n",
|
||||
"//packages/kbn-securitysolution-io-ts-list-types",
|
||||
"//packages/kbn-securitysolution-list-hooks",
|
||||
RUNTIME_DEPS = [
|
||||
"//packages/kbn-es-query",
|
||||
"@npm//@babel/core",
|
||||
"@npm//babel-loader",
|
||||
"//packages/kbn-i18n",
|
||||
"//packages/kbn-securitysolution-list-hooks",
|
||||
"//packages/kbn-securitysolution-list-utils",
|
||||
"//packages/kbn-securitysolution-io-ts-list-types",
|
||||
"@npm//@elastic/eui",
|
||||
"@npm//@testing-library/react",
|
||||
"@npm//@testing-library/react-hooks",
|
||||
"@npm//enzyme",
|
||||
"@npm//moment",
|
||||
"@npm//react",
|
||||
"@npm//resize-observer-polyfill",
|
||||
"@npm//rxjs",
|
||||
"@npm//tslib",
|
||||
]
|
||||
|
||||
TYPES_DEPS = [
|
||||
"@npm//typescript",
|
||||
"//packages/kbn-es-query",
|
||||
"//packages/kbn-i18n",
|
||||
"//packages/kbn-securitysolution-list-hooks",
|
||||
"//packages/kbn-securitysolution-list-utils",
|
||||
"//packages/kbn-securitysolution-io-ts-list-types",
|
||||
"@npm//@elastic/eui",
|
||||
"@npm//@testing-library/react",
|
||||
"@npm//@testing-library/react-hooks",
|
||||
"@npm//moment",
|
||||
"@npm//resize-observer-polyfill",
|
||||
"@npm//@types/enzyme",
|
||||
"@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(),
|
||||
)
|
||||
|
||||
jsts_transpiler(
|
||||
name = "target_web",
|
||||
srcs = SRCS,
|
||||
build_pkg_name = package_name(),
|
||||
config_file = ".babelrc.browser"
|
||||
)
|
||||
|
||||
ts_config(
|
||||
name = "tsconfig",
|
||||
|
@ -64,50 +84,26 @@ ts_config(
|
|||
],
|
||||
)
|
||||
|
||||
ts_config(
|
||||
name = "tsconfig_browser",
|
||||
src = "tsconfig.browser.json",
|
||||
deps = [
|
||||
"//:tsconfig.base.json",
|
||||
"//:tsconfig.browser.json",
|
||||
"//:tsconfig.browser_bazel.json",
|
||||
],
|
||||
)
|
||||
|
||||
ts_project(
|
||||
name = "tsc",
|
||||
name = "tsc_types",
|
||||
args = ["--pretty"],
|
||||
srcs = SRCS,
|
||||
deps = DEPS,
|
||||
allow_js = True,
|
||||
deps = TYPES_DEPS,
|
||||
declaration = True,
|
||||
declaration_dir = "target_types",
|
||||
declaration_map = True,
|
||||
out_dir = "target_node",
|
||||
emit_declaration_only = True,
|
||||
out_dir = "target_types",
|
||||
root_dir = "src",
|
||||
source_map = True,
|
||||
tsconfig = ":tsconfig",
|
||||
)
|
||||
|
||||
ts_project(
|
||||
name = "tsc_browser",
|
||||
args = ['--pretty'],
|
||||
srcs = SRCS,
|
||||
deps = DEPS,
|
||||
allow_js = True,
|
||||
declaration = False,
|
||||
out_dir = "target_web",
|
||||
source_map = True,
|
||||
root_dir = "src",
|
||||
tsconfig = ":tsconfig_browser",
|
||||
)
|
||||
|
||||
js_library(
|
||||
name = PKG_BASE_NAME,
|
||||
package_name = PKG_REQUIRE_NAME,
|
||||
srcs = NPM_MODULE_EXTRA_FILES,
|
||||
deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"],
|
||||
package_name = PKG_REQUIRE_NAME,
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [":tsc", ":tsc_browser"] + DEPS,
|
||||
)
|
||||
|
||||
pkg_npm(
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
env: {
|
||||
web: {
|
||||
presets: ['@kbn/babel-preset/webpack_preset'],
|
||||
},
|
||||
node: {
|
||||
presets: ['@kbn/babel-preset/node_preset'],
|
||||
},
|
||||
},
|
||||
ignore: ['**/*.test.ts', '**/*.test.tsx'],
|
||||
};
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"browser": "../target_web/react",
|
||||
"main": "../target_node/react",
|
||||
"types": "../target_types/react/index.d.ts"
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
"extends": "../../tsconfig.browser_bazel.json",
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"outDir": "./target_web",
|
||||
"declaration": false,
|
||||
"isolatedModules": true,
|
||||
"sourceMap": true,
|
||||
"sourceRoot": "../../../../../packages/kbn-securitysolution-autocomplete/src",
|
||||
"types": [
|
||||
"jest",
|
||||
"node"
|
||||
],
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"src/**/*.tsx",
|
||||
],
|
||||
"exclude": [
|
||||
"**/__fixtures__/**/*"
|
||||
]
|
||||
}
|
|
@ -1,15 +1,14 @@
|
|||
{
|
||||
"extends": "../../tsconfig.bazel.json",
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"declarationDir": "./target_types",
|
||||
"outDir": "target_node",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"outDir": "target_types",
|
||||
"sourceMap": true,
|
||||
"sourceRoot": "../../../../packages/kbn-securitysolution-autocomplete/src",
|
||||
"rootDir": "src",
|
||||
"types": ["jest", "node", "resize-observer-polyfill"]
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
"include": ["src/**/*"],
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue