Skip to content

Commit

Permalink
chore(NA): splits types from code on @kbn/analytics (elastic#119869)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic authored and kibanamachine committed Nov 30, 2021
1 parent 017a70f commit dc0c6c0
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 6 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@
"@types/json5": "^0.0.30",
"@types/kbn__ace": "link:bazel-bin/packages/kbn-ace/npm_module_types",
"@types/kbn__alerts": "link:bazel-bin/packages/kbn-alerts/npm_module_types",
"@types/kbn__analytics": "link:bazel-bin/packages/kbn-analytics/npm_module_types",
"@types/kbn__i18n": "link:bazel-bin/packages/kbn-i18n/npm_module_types",
"@types/kbn__i18n-react": "link:bazel-bin/packages/kbn-i18n-react/npm_module_types",
"@types/license-checker": "15.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ filegroup(
"//packages/elastic-datemath:build_types",
"//packages/kbn-ace:build_types",
"//packages/kbn-alerts:build_types",
"//packages/kbn-analytics:build_types",
"//packages/kbn-i18n:build_types",
"//packages/kbn-i18n-react:build_types",
],
Expand Down
26 changes: 22 additions & 4 deletions packages/kbn-analytics/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-analytics"
PKG_REQUIRE_NAME = "@kbn/analytics"
TYPES_PKG_REQUIRE_NAME = "@types/kbn__analytics"

SOURCE_FILES = glob(
[
Expand Down Expand Up @@ -81,7 +82,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 @@ -100,3 +101,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"],
)
1 change: 0 additions & 1 deletion packages/kbn-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"version": "1.0.0",
"description": "Kibana Analytics tool",
"main": "target_node/index.js",
"types": "target_types/index.d.ts",
"browser": "target_web/index.js",
"author": "Ahmad Bamieh <[email protected]>",
"license": "SSPL-1.0 OR Elastic License 2.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-ui-shared-deps-src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUNTIME_DEPS = [
TYPES_DEPS = [
"//packages/elastic-datemath:npm_module_types",
"//packages/elastic-safer-lodash-set",
"//packages/kbn-analytics",
"//packages/kbn-analytics:npm_module_types",
"//packages/kbn-babel-preset",
"//packages/kbn-i18n:npm_module_types",
"//packages/kbn-i18n-react:npm_module_types",
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5770,6 +5770,10 @@
version "0.0.0"
uid ""

"@types/kbn__analytics@link:bazel-bin/packages/kbn-analytics/npm_module_types":
version "0.0.0"
uid ""

"@types/kbn__i18n-react@link:bazel-bin/packages/kbn-i18n-react/npm_module_types":
version "0.0.0"
uid ""
Expand Down

0 comments on commit dc0c6c0

Please sign in to comment.