chore(NA): moving @kbn/apm-utils into bazel (#96227) (#97024)

* chore(NA): moving @kbn/apm-utils into bazel

* chore(NA): add kbn/apm-utils into package.json

* chore(NA): missing standard on build file globs

* chore(NA): be more explicit about incremental setting

* chore(NA): include pretty in the args for ts_project rule

* docs(NA): include package migration completion in the developer getting started

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-04-13 16:20:05 -04:00 committed by GitHub
parent 3279e7fca3
commit c7f4613ddd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 89 additions and 15 deletions

View file

@ -62,5 +62,6 @@ yarn kbn watch-bazel
=== List of Already Migrated Packages to Bazel
- @elastic/datemath
- @kbn/apm-utils

View file

@ -122,7 +122,7 @@
"@kbn/ace": "link:packages/kbn-ace",
"@kbn/analytics": "link:packages/kbn-analytics",
"@kbn/apm-config-loader": "link:packages/kbn-apm-config-loader",
"@kbn/apm-utils": "link:packages/kbn-apm-utils",
"@kbn/apm-utils": "link:bazel-bin/packages/kbn-apm-utils/npm_module",
"@kbn/config": "link:packages/kbn-config",
"@kbn/config-schema": "link:packages/kbn-config-schema",
"@kbn/crypto": "link:packages/kbn-crypto",

View file

@ -3,6 +3,7 @@
filegroup(
name = "build",
srcs = [
"//packages/elastic-datemath:build"
"//packages/elastic-datemath:build",
"//packages/kbn-apm-utils:build"
],
)

View file

@ -4,15 +4,15 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
PKG_BASE_NAME = "elastic-datemath"
PKG_REQUIRE_NAME = "@elastic/datemath"
SOURCE_FILES = [
SOURCE_FILES = glob([
"src/index.ts",
]
])
SRCS = SOURCE_FILES
filegroup(
name = "srcs",
srcs = glob(SOURCE_FILES),
srcs = SRCS,
)
NPM_MODULE_EXTRA_FILES = [

View file

@ -3,6 +3,7 @@
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"incremental": true,
"outDir": "target",
"rootDir": "src",
"sourceMap": true,

View file

@ -0,0 +1,76 @@
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-apm-utils"
PKG_REQUIRE_NAME = "@kbn/apm-utils"
SOURCE_FILES = glob([
"src/index.ts",
])
SRCS = SOURCE_FILES
filegroup(
name = "srcs",
srcs = SRCS,
)
NPM_MODULE_EXTRA_FILES = [
"package.json",
]
SRC_DEPS = [
"@npm//elastic-apm-node",
]
TYPES_DEPS = [
"@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 = [],
deps = [":tsc"] + DEPS,
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
pkg_npm(
name = "npm_module",
srcs = NPM_MODULE_EXTRA_FILES,
deps = [
":%s" % PKG_BASE_NAME,
]
)
filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)

View file

@ -4,10 +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",
"kbn:watch": "yarn build --watch"
}
"private": true
}

View file

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

View file

@ -2616,7 +2616,7 @@
version "0.0.0"
uid ""
"@kbn/apm-utils@link:packages/kbn-apm-utils":
"@kbn/apm-utils@link:bazel-bin/packages/kbn-apm-utils/npm_module":
version "0.0.0"
uid ""