diff --git a/package.json b/package.json index 53d9e1ac15dba..84bd703dba4ef 100644 --- a/package.json +++ b/package.json @@ -551,6 +551,7 @@ "@types/jsdom": "^16.2.3", "@types/json-stable-stringify": "^1.0.32", "@types/json5": "^0.0.30", + "@types/kbn__ace": "link:bazel-bin/packages/kbn-ace/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 74c28790ae06e..893216f060b9c 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -76,6 +76,7 @@ filegroup( srcs = [ "//packages/elastic-apm-synthtrace:build_types", "//packages/elastic-datemath:build_types", + "//packages/kbn-ace:build_types", ], ) diff --git a/packages/kbn-ace/BUILD.bazel b/packages/kbn-ace/BUILD.bazel index a13863b765d35..c674f9ae8e00f 100644 --- a/packages/kbn-ace/BUILD.bazel +++ b/packages/kbn-ace/BUILD.bazel @@ -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-ace" PKG_REQUIRE_NAME = "@kbn/ace" +TYPES_PKG_REQUIRE_NAME = "@types/kbn__ace" SOURCE_FILES = glob( [ @@ -78,7 +79,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) @@ -97,3 +98,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-ace/package.json b/packages/kbn-ace/package.json index dfc440812e747..f5775c3b34596 100644 --- a/packages/kbn-ace/package.json +++ b/packages/kbn-ace/package.json @@ -3,6 +3,5 @@ "version": "1.0.0", "private": true, "main": "./target_node/index.js", - "types": "./target_types/index.d.ts", "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/yarn.lock b/yarn.lock index 2f3d3865b54ee..9ae9d163a0463 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5783,6 +5783,10 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.30.tgz#44cb52f32a809734ca562e685c6473b5754a7818" integrity sha512-sqm9g7mHlPY/43fcSNrCYfOeX9zkTTK+euO5E6+CVijSMm5tTjkVdwdqRkY3ljjIAf8679vps5jKUoJBCLsMDA== +"@types/kbn__ace@link:bazel-bin/packages/kbn-ace/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"