Skip to content

Commit

Permalink
chore(NA): splits types from code on @kbn/securitysolution-io-ts-list…
Browse files Browse the repository at this point in the history
…-types (#121672)
  • Loading branch information
mistic authored Dec 21, 2021
1 parent 8525d36 commit e203be1
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 9 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@
"@types/kbn__securitysolution-es-utils": "link:bazel-bin/packages/kbn-securitysolution-es-utils/npm_module_types",
"@types/kbn__securitysolution-hook-utils": "link:bazel-bin/packages/kbn-securitysolution-hook-utils/npm_module_types",
"@types/kbn__securitysolution-io-ts-alerting-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-alerting-types/npm_module_types",
"@types/kbn__securitysolution-io-ts-list-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-list-types/npm_module_types",
"@types/license-checker": "15.0.0",
"@types/listr": "^0.14.0",
"@types/loader-utils": "^1.1.3",
Expand Down
1 change: 1 addition & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ filegroup(
"//packages/kbn-securitysolution-es-utils:build_types",
"//packages/kbn-securitysolution-hook-utils:build_types",
"//packages/kbn-securitysolution-io-ts-alerting-types:build_types",
"//packages/kbn-securitysolution-io-ts-list-types:build_types",
],
)

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-securitysolution-autocomplete/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ TYPES_DEPS = [
"//packages/kbn-i18n:npm_module_types",
"//packages/kbn-securitysolution-list-hooks",
"//packages/kbn-securitysolution-list-utils",
"//packages/kbn-securitysolution-io-ts-list-types",
"//packages/kbn-securitysolution-io-ts-list-types:npm_module_types",
"@npm//@elastic/eui",
"@npm//@testing-library/react",
"@npm//@testing-library/react-hooks",
Expand Down
26 changes: 22 additions & 4 deletions packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")

PKG_BASE_NAME = "kbn-securitysolution-io-ts-list-types"
PKG_REQUIRE_NAME = "@kbn/securitysolution-io-ts-list-types"
TYPES_PKG_REQUIRE_NAME = "@types/kbn__securitysolution-io-ts-list-types"

SOURCE_FILES = glob(
[
Expand Down Expand Up @@ -82,7 +83,7 @@ ts_project(
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"],
deps = RUNTIME_DEPS + [":target_node", ":target_web"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
Expand All @@ -101,3 +102,20 @@ filegroup(
],
visibility = ["//visibility:public"],
)

pkg_npm_types(
name = "npm_module_types",
srcs = SRCS,
deps = [":tsc_types"],
package_name = TYPES_PKG_REQUIRE_NAME,
tsconfig = ":tsconfig",
visibility = ["//visibility:public"],
)

filegroup(
name = "build_types",
srcs = [
":npm_module_types",
],
visibility = ["//visibility:public"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
"license": "SSPL-1.0 OR Elastic License 2.0",
"browser": "./target_web/index.js",
"main": "./target_node/index.js",
"types": "./target_types/index.d.ts",
"private": true
}
2 changes: 1 addition & 1 deletion packages/kbn-securitysolution-list-api/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUNTIME_DEPS = [
]

TYPES_DEPS = [
"//packages/kbn-securitysolution-io-ts-list-types",
"//packages/kbn-securitysolution-io-ts-list-types:npm_module_types",
"//packages/kbn-securitysolution-io-ts-utils",
"//packages/kbn-securitysolution-list-constants",
"@npm//fp-ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-securitysolution-list-hooks/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RUNTIME_DEPS = [

TYPES_DEPS = [
"//packages/kbn-securitysolution-hook-utils:npm_module_types",
"//packages/kbn-securitysolution-io-ts-list-types",
"//packages/kbn-securitysolution-io-ts-list-types:npm_module_types",
"//packages/kbn-securitysolution-list-api",
"//packages/kbn-securitysolution-list-constants",
"//packages/kbn-securitysolution-list-utils",
Expand Down
4 changes: 3 additions & 1 deletion packages/kbn-securitysolution-list-utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ RUNTIME_DEPS = [
"//packages/kbn-es-query",
"//packages/kbn-i18n",
"//packages/kbn-securitysolution-io-ts-list-types",
"//packages/kbn-securitysolution-io-ts-utils",
"//packages/kbn-securitysolution-list-constants",
"//packages/kbn-securitysolution-utils",
"@npm//lodash",
Expand All @@ -40,7 +41,8 @@ RUNTIME_DEPS = [
TYPES_DEPS = [
"//packages/kbn-es-query:npm_module_types",
"//packages/kbn-i18n:npm_module_types",
"//packages/kbn-securitysolution-io-ts-list-types",
"//packages/kbn-securitysolution-io-ts-list-types:npm_module_types",
"//packages/kbn-securitysolution-io-ts-utils",
"//packages/kbn-securitysolution-list-constants",
"//packages/kbn-securitysolution-utils",
"@npm//@elastic/elasticsearch",
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5908,6 +5908,10 @@
version "0.0.0"
uid ""

"@types/kbn__securitysolution-io-ts-list-types@link:bazel-bin/packages/kbn-securitysolution-io-ts-list-types/npm_module_types":
version "0.0.0"
uid ""

"@types/keyv@*":
version "3.1.1"
resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.1.tgz#e45a45324fca9dab716ab1230ee249c9fb52cfa7"
Expand Down

0 comments on commit e203be1

Please sign in to comment.