chore(NA): moving @kbn/plugin-helpers into bazel (#103181)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Tiago Costa 2021-06-24 04:49:04 +01:00 committed by GitHub
parent d5a760cfd9
commit 59423927cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 102 additions and 8 deletions

View file

@ -87,6 +87,7 @@ yarn kbn watch-bazel
- @kbn/mapbox-gl
- @kbn/monaco
- @kbn/optimizer
- @kbn/plugin-helpers
- @kbn/rule-data-utils
- @kbn/securitysolution-es-utils
- @kbn/securitysolution-hook-utils

View file

@ -467,7 +467,7 @@
"@kbn/expect": "link:bazel-bin/packages/kbn-expect",
"@kbn/optimizer": "link:bazel-bin/packages/kbn-optimizer",
"@kbn/plugin-generator": "link:bazel-bin/packages/kbn-plugin-generator",
"@kbn/plugin-helpers": "link:packages/kbn-plugin-helpers",
"@kbn/plugin-helpers": "link:bazel-bin/packages/kbn-plugin-helpers",
"@kbn/pm": "link:packages/kbn-pm",
"@kbn/storybook": "link:bazel-bin/packages/kbn-storybook",
"@kbn/telemetry-tools": "link:bazel-bin/packages/kbn-telemetry-tools",

View file

@ -31,6 +31,7 @@ filegroup(
"//packages/kbn-monaco:build",
"//packages/kbn-optimizer:build",
"//packages/kbn-plugin-generator:build",
"//packages/kbn-plugin-helpers:build",
"//packages/kbn-rule-data-utils:build",
"//packages/kbn-securitysolution-list-constants:build",
"//packages/kbn-securitysolution-io-ts-types:build",

View 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-plugin-helpers"
PKG_REQUIRE_NAME = "@kbn/plugin-helpers"
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-dev-utils",
"//packages/kbn-optimizer",
"//packages/kbn-utils",
"@npm//del",
"@npm//execa",
"@npm//extract-zip",
"@npm//globby",
"@npm//gulp-zip",
"@npm//inquirer",
"@npm//load-json-file",
"@npm//vinyl-fs",
]
TYPES_DEPS = [
"@npm//@types/extract-zip",
"@npm//@types/gulp-zip",
"@npm//@types/inquirer",
"@npm//@types/jest",
"@npm//@types/node",
"@npm//@types/vinyl-fs",
]
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 = DEPS + [":tsc"],
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

@ -11,9 +11,5 @@
"types": "target/index.d.ts",
"bin": {
"plugin-helpers": "bin/plugin-helpers.js"
},
"scripts": {
"kbn:bootstrap": "rm -rf target && ../../node_modules/.bin/tsc",
"kbn:watch": "../../node_modules/.bin/tsc --watch"
}
}

View file

@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"incremental": true,
"outDir": "target",
"target": "ES2018",
"declaration": true,

View file

@ -26,7 +26,6 @@
"yarn": "^1.21.1"
},
"devDependencies": {
"@kbn/plugin-helpers": "link:../packages/kbn-plugin-helpers",
"@kbn/test": "link:../packages/kbn-test"
}
}

View file

@ -2701,7 +2701,7 @@
version "0.0.0"
uid ""
"@kbn/plugin-helpers@link:packages/kbn-plugin-helpers":
"@kbn/plugin-helpers@link:bazel-bin/packages/kbn-plugin-helpers":
version "0.0.0"
uid ""