Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
This commit is contained in:
parent
d3ba8ec5aa
commit
9c38f97a07
|
@ -69,6 +69,7 @@ yarn kbn watch-bazel
|
|||
- @kbn/apm-utils
|
||||
- @kbn/babel-code-parser
|
||||
- @kbn/babel-preset
|
||||
- @kbn/config
|
||||
- @kbn/config-schema
|
||||
- @kbn/dev-utils
|
||||
- @kbn/eslint-import-resolver-kibana
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
"@kbn/analytics": "link:bazel-bin/packages/kbn-analytics/npm_module",
|
||||
"@kbn/apm-config-loader": "link:bazel-bin/packages/kbn-apm-config-loader/npm_module",
|
||||
"@kbn/apm-utils": "link:bazel-bin/packages/kbn-apm-utils/npm_module",
|
||||
"@kbn/config": "link:packages/kbn-config",
|
||||
"@kbn/config": "link:bazel-bin/packages/kbn-config/npm_module",
|
||||
"@kbn/config-schema": "link:bazel-bin/packages/kbn-config-schema/npm_module",
|
||||
"@kbn/crypto": "link:packages/kbn-crypto",
|
||||
"@kbn/i18n": "link:packages/kbn-i18n",
|
||||
|
|
|
@ -11,6 +11,7 @@ filegroup(
|
|||
"//packages/kbn-apm-utils:build",
|
||||
"//packages/kbn-babel-code-parser:build",
|
||||
"//packages/kbn-babel-preset:build",
|
||||
"//packages/kbn-config:build",
|
||||
"//packages/kbn-config-schema:build",
|
||||
"//packages/kbn-dev-utils:build",
|
||||
"//packages/kbn-eslint-import-resolver-kibana:build",
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
"devOnly": true
|
||||
},
|
||||
"dependencies": {
|
||||
"@kbn/config": "link:../kbn-config",
|
||||
"@kbn/server-http-tools": "link:../kbn-server-http-tools",
|
||||
"@kbn/optimizer": "link:../kbn-optimizer"
|
||||
}
|
||||
|
|
97
packages/kbn-config/BUILD.bazel
Normal file
97
packages/kbn-config/BUILD.bazel
Normal file
|
@ -0,0 +1,97 @@
|
|||
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
|
||||
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
|
||||
|
||||
PKG_BASE_NAME = "kbn-config"
|
||||
PKG_REQUIRE_NAME = "@kbn/config"
|
||||
|
||||
SOURCE_FILES = glob(
|
||||
[
|
||||
"src/**/*.ts",
|
||||
],
|
||||
exclude = [
|
||||
"**/*.test.*",
|
||||
"**/__fixtures__",
|
||||
"**/__mocks__",
|
||||
"**/__snapshots__"
|
||||
],
|
||||
)
|
||||
|
||||
SRCS = SOURCE_FILES
|
||||
|
||||
filegroup(
|
||||
name = "srcs",
|
||||
srcs = SRCS,
|
||||
)
|
||||
|
||||
NPM_MODULE_EXTRA_FILES = [
|
||||
"package.json",
|
||||
"README.md"
|
||||
]
|
||||
|
||||
SRC_DEPS = [
|
||||
"//packages/elastic-safer-lodash-set",
|
||||
"//packages/kbn-config-schema",
|
||||
"//packages/kbn-logging",
|
||||
"//packages/kbn-std",
|
||||
"//packages/kbn-utility-types",
|
||||
"@npm//js-yaml",
|
||||
"@npm//load-json-file",
|
||||
"@npm//lodash",
|
||||
"@npm//rxjs",
|
||||
"@npm//type-detect",
|
||||
]
|
||||
|
||||
TYPES_DEPS = [
|
||||
"@npm//@types/jest",
|
||||
"@npm//@types/js-yaml",
|
||||
"@npm//@types/lodash",
|
||||
"@npm//@types/node",
|
||||
"@npm//@types/type-detect",
|
||||
]
|
||||
|
||||
DEPS = SRC_DEPS + TYPES_DEPS
|
||||
|
||||
ts_config(
|
||||
name = "tsconfig",
|
||||
src = "tsconfig.json",
|
||||
deps = [
|
||||
"//:tsconfig.base.json",
|
||||
],
|
||||
)
|
||||
|
||||
ts_project(
|
||||
name = "tsc",
|
||||
args = ['--pretty'],
|
||||
srcs = SRCS,
|
||||
deps = DEPS,
|
||||
declaration = True,
|
||||
declaration_map = True,
|
||||
incremental = True,
|
||||
out_dir = "target",
|
||||
source_map = True,
|
||||
root_dir = "src",
|
||||
tsconfig = ":tsconfig",
|
||||
)
|
||||
|
||||
js_library(
|
||||
name = PKG_BASE_NAME,
|
||||
srcs = NPM_MODULE_EXTRA_FILES,
|
||||
deps = [":tsc"] + DEPS,
|
||||
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"],
|
||||
)
|
|
@ -4,9 +4,5 @@
|
|||
"types": "./target/index.d.ts",
|
||||
"version": "1.0.0",
|
||||
"license": "SSPL-1.0 OR Elastic License 2.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "../../node_modules/.bin/tsc",
|
||||
"kbn:bootstrap": "yarn build"
|
||||
}
|
||||
"private": true
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"incremental": false,
|
||||
"incremental": true,
|
||||
"outDir": "./target",
|
||||
"stripInternal": false,
|
||||
"declaration": true,
|
||||
|
|
|
@ -11,8 +11,5 @@
|
|||
"scripts": {
|
||||
"kbn:bootstrap": "../../node_modules/.bin/tsc",
|
||||
"kbn:watch": "../../node_modules/.bin/tsc --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@kbn/config": "link:../kbn-config"
|
||||
}
|
||||
}
|
|
@ -11,7 +11,6 @@
|
|||
"kbn:watch": "yarn build --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@kbn/config": "link:../kbn-config",
|
||||
"@kbn/ui-shared-deps": "link:../kbn-ui-shared-deps"
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue