chore(NA): moving @kbn/logging into bazel (#98564)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Tiago Costa 2021-04-28 16:01:22 +01:00 committed by GitHub
parent 639f8290ff
commit fb34ba0337
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 89 additions and 13 deletions

View file

@ -69,6 +69,7 @@ yarn kbn watch-bazel
- @kbn/babel-preset
- @kbn/config-schema
- @kbn/expect
- @kbn/logging
- @kbn/std
- @kbn/tinymath
- @kbn/utility-types

View file

@ -132,7 +132,7 @@
"@kbn/interpreter": "link:packages/kbn-interpreter",
"@kbn/io-ts-utils": "link:packages/kbn-io-ts-utils",
"@kbn/legacy-logging": "link:packages/kbn-legacy-logging",
"@kbn/logging": "link:packages/kbn-logging",
"@kbn/logging": "link:bazel-bin/packages/kbn-logging/npm_module",
"@kbn/monaco": "link:packages/kbn-monaco",
"@kbn/server-http-tools": "link:packages/kbn-server-http-tools",
"@kbn/server-route-repository": "link:packages/kbn-server-route-repository",

View file

@ -11,6 +11,7 @@ filegroup(
"//packages/kbn-babel-preset:build",
"//packages/kbn-config-schema:build",
"//packages/kbn-expect:build",
"//packages/kbn-logging:build",
"//packages/kbn-std:build",
"//packages/kbn-tinymath:build",
"//packages/kbn-utility-types:build",

View file

@ -15,7 +15,6 @@
},
"dependencies": {
"@kbn/config": "link:../kbn-config",
"@kbn/logging": "link:../kbn-logging",
"@kbn/server-http-tools": "link:../kbn-server-http-tools",
"@kbn/optimizer": "link:../kbn-optimizer",
"@kbn/dev-utils": "link:../kbn-dev-utils"

View file

@ -9,9 +9,6 @@
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build"
},
"dependencies": {
"@kbn/logging": "link:../kbn-logging"
},
"devDependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils",
"@kbn/utility-types": "link:../kbn-utility-types"

View file

@ -0,0 +1,82 @@
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-logging"
PKG_REQUIRE_NAME = "@kbn/logging"
SOURCE_FILES = glob(
[
"src/**/*.ts",
],
exclude = [
"**/*.test.*"
],
)
SRCS = SOURCE_FILES
filegroup(
name = "srcs",
srcs = SRCS,
)
NPM_MODULE_EXTRA_FILES = [
"package.json",
"README.md"
]
SRC_DEPS = [
"//packages/kbn-std"
]
TYPES_DEPS = [
"@npm//@types/jest",
"@npm//@types/node",
]
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"],
)

View file

@ -4,10 +4,5 @@
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"scripts": {
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build",
"kbn:watch": "yarn build --watch"
}
"types": "./target/index.d.ts"
}

View file

@ -1,11 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"incremental": true,
"outDir": "target",
"stripInternal": false,
"declaration": true,
"declarationMap": true,
"rootDir": "src",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-logging/src",
"types": [

View file

@ -2653,7 +2653,7 @@
version "0.0.0"
uid ""
"@kbn/logging@link:packages/kbn-logging":
"@kbn/logging@link:bazel-bin/packages/kbn-logging/npm_module":
version "0.0.0"
uid ""