chore(NA): chore(NA): moving @kbn/std into bazel (#97771) (#97891)

Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
This commit is contained in:
Kibana Machine 2021-04-21 17:54:53 -04:00 committed by GitHub
parent 9d67b3b143
commit d129d275a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 96 additions and 27 deletions

View file

@ -65,6 +65,7 @@ yarn kbn watch-bazel
- @kbn/apm-utils
- @kbn/babel-preset
- @kbn/config-schema
- @kbn/std
- @kbn/tinymath
- @kbn/utility-types

View file

@ -133,7 +133,7 @@
"@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",
"@kbn/std": "link:packages/kbn-std",
"@kbn/std": "link:bazel-bin/packages/kbn-std/npm_module",
"@kbn/tinymath": "link:bazel-bin/packages/kbn-tinymath/npm_module",
"@kbn/ui-framework": "link:packages/kbn-ui-framework",
"@kbn/ui-shared-deps": "link:packages/kbn-ui-shared-deps",

View file

@ -7,6 +7,7 @@ filegroup(
"//packages/kbn-apm-utils:build",
"//packages/kbn-babel-preset:build",
"//packages/kbn-config-schema:build",
"//packages/kbn-std:build",
"//packages/kbn-tinymath:build",
"//packages/kbn-utility-types:build",
],

View file

@ -18,7 +18,6 @@
"@kbn/logging": "link:../kbn-logging",
"@kbn/server-http-tools": "link:../kbn-server-http-tools",
"@kbn/optimizer": "link:../kbn-optimizer",
"@kbn/std": "link:../kbn-std",
"@kbn/dev-utils": "link:../kbn-dev-utils",
"@kbn/utils": "link:../kbn-utils"
}

View file

@ -11,8 +11,7 @@
},
"dependencies": {
"@elastic/safer-lodash-set": "link:../elastic-safer-lodash-set",
"@kbn/logging": "link:../kbn-logging",
"@kbn/std": "link:../kbn-std"
"@kbn/logging": "link:../kbn-logging"
},
"devDependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils",

View file

@ -9,8 +9,5 @@
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build",
"kbn:watch": "yarn build --watch"
},
"dependencies": {
"@kbn/std": "link:../kbn-std"
}
}

View file

@ -13,7 +13,6 @@
"dependencies": {
"@kbn/config": "link:../kbn-config",
"@kbn/dev-utils": "link:../kbn-dev-utils",
"@kbn/std": "link:../kbn-std",
"@kbn/ui-shared-deps": "link:../kbn-ui-shared-deps"
}
}

View file

@ -11,8 +11,7 @@
"kbn:watch": "yarn build --watch"
},
"dependencies": {
"@kbn/crypto": "link:../kbn-crypto",
"@kbn/std": "link:../kbn-std"
"@kbn/crypto": "link:../kbn-crypto"
},
"devDependencies": {
"@kbn/utility-types": "link:../kbn-utility-types"

View file

@ -0,0 +1,85 @@
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-std"
PKG_REQUIRE_NAME = "@kbn/std"
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-utility-types",
"@npm//lodash",
"@npm//query-string",
"@npm//rxjs",
"@npm//tslib",
]
TYPES_DEPS = [
"@npm//@types/jest",
"@npm//@types/lodash",
"@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,12 +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"
},
"devDependencies": {
"@kbn/utility-types": "link:../kbn-utility-types"
}
"private": true
}

View file

@ -1,12 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"declarationDir": "./target",
"incremental": true,
"outDir": "./target",
"stripInternal": true,
"declaration": true,
"declarationMap": true,
"rootDir": "src",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-std/src",
"types": [
@ -16,8 +16,5 @@
},
"include": [
"./src/**/*.ts"
],
"exclude": [
"**/__fixture__/**/*"
]
}

View file

@ -57,15 +57,14 @@ ts_project(
js_library(
name = PKG_BASE_NAME,
srcs = [],
srcs = NPM_MODULE_EXTRA_FILES,
deps = [":tsc"] + DEPS,
package_name = PKG_REQUIRE_NAME,
package_name = "@kbn/utility-types",
visibility = ["//visibility:public"],
)
pkg_npm(
name = "npm_module",
srcs = NPM_MODULE_EXTRA_FILES,
deps = [
":%s" % PKG_BASE_NAME,
]

View file

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