diff --git a/package.json b/package.json index a3095e0d8225a..19147bc82d4f2 100644 --- a/package.json +++ b/package.json @@ -589,6 +589,7 @@ "@types/kbn__securitysolution-io-ts-list-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-list-types/npm_module_types", "@types/kbn__securitysolution-io-ts-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-types/npm_module_types", "@types/kbn__securitysolution-list-api": "link:bazel-bin/packages/kbn-securitysolution-list-api/npm_module_types", + "@types/kbn__securitysolution-list-constants": "link:bazel-bin/packages/kbn-securitysolution-list-constants/npm_module_types", "@types/license-checker": "15.0.0", "@types/listr": "^0.14.0", "@types/loader-utils": "^1.1.3", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index dbd5a661b5f1b..629d1b0a69193 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -107,6 +107,7 @@ filegroup( "//packages/kbn-securitysolution-io-ts-list-types:build_types", "//packages/kbn-securitysolution-io-ts-types:build_types", "//packages/kbn-securitysolution-list-api:build_types", + "//packages/kbn-securitysolution-list-constants:build_types", ], ) diff --git a/packages/kbn-securitysolution-list-api/BUILD.bazel b/packages/kbn-securitysolution-list-api/BUILD.bazel index 49597ee500707..ed5d11d48a5d4 100644 --- a/packages/kbn-securitysolution-list-api/BUILD.bazel +++ b/packages/kbn-securitysolution-list-api/BUILD.bazel @@ -39,7 +39,7 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "//packages/kbn-securitysolution-io-ts-list-types:npm_module_types", "//packages/kbn-securitysolution-io-ts-utils", - "//packages/kbn-securitysolution-list-constants", + "//packages/kbn-securitysolution-list-constants:npm_module_types", "@npm//fp-ts", "@npm//io-ts", "@npm//@types/jest", diff --git a/packages/kbn-securitysolution-list-constants/BUILD.bazel b/packages/kbn-securitysolution-list-constants/BUILD.bazel index db4dd94091abf..3802e3a581969 100644 --- a/packages/kbn-securitysolution-list-constants/BUILD.bazel +++ b/packages/kbn-securitysolution-list-constants/BUILD.bazel @@ -1,10 +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-list-constants" - PKG_REQUIRE_NAME = "@kbn/securitysolution-list-constants" +TYPES_PKG_REQUIRE_NAME = "@types/kbn__securitysolution-list-constants" SOURCE_FILES = glob( [ @@ -74,7 +74,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"], ) @@ -93,3 +93,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"], +) diff --git a/packages/kbn-securitysolution-list-constants/package.json b/packages/kbn-securitysolution-list-constants/package.json index 37f15fd06b0bc..8900265c30cd2 100644 --- a/packages/kbn-securitysolution-list-constants/package.json +++ b/packages/kbn-securitysolution-list-constants/package.json @@ -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 } diff --git a/packages/kbn-securitysolution-list-hooks/BUILD.bazel b/packages/kbn-securitysolution-list-hooks/BUILD.bazel index 139abf61181dc..d910f61cba1e0 100644 --- a/packages/kbn-securitysolution-list-hooks/BUILD.bazel +++ b/packages/kbn-securitysolution-list-hooks/BUILD.bazel @@ -43,7 +43,7 @@ TYPES_DEPS = [ "//packages/kbn-securitysolution-hook-utils:npm_module_types", "//packages/kbn-securitysolution-io-ts-list-types:npm_module_types", "//packages/kbn-securitysolution-list-api:npm_module_types", - "//packages/kbn-securitysolution-list-constants", + "//packages/kbn-securitysolution-list-constants:npm_module_types", "//packages/kbn-securitysolution-list-utils", "//packages/kbn-securitysolution-utils", "@npm//@types/jest", diff --git a/packages/kbn-securitysolution-list-utils/BUILD.bazel b/packages/kbn-securitysolution-list-utils/BUILD.bazel index 5eafff044ecd9..363bb49f7c47c 100644 --- a/packages/kbn-securitysolution-list-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-list-utils/BUILD.bazel @@ -43,7 +43,7 @@ TYPES_DEPS = [ "//packages/kbn-i18n:npm_module_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-list-constants:npm_module_types", "//packages/kbn-securitysolution-utils", "@npm//@elastic/elasticsearch", "@npm//@types/jest", diff --git a/yarn.lock b/yarn.lock index 6e59d9593b821..9d4c892320823 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5920,6 +5920,10 @@ version "0.0.0" uid "" +"@types/kbn__securitysolution-list-constants@link:bazel-bin/packages/kbn-securitysolution-list-constants/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"