forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
64 lines (55 loc) · 1.5 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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_DIRNAME = "kbn-ambient-storybook-types"
PKG_REQUIRE_NAME = "@kbn/ambient-storybook-types"
SRCS = glob(
[
"*.d.ts",
]
)
filegroup(
name = "srcs",
srcs = SRCS,
)
NPM_MODULE_EXTRA_FILES = [
"package.json",
]
# In this array place runtime dependencies, including other packages and NPM packages
# which must be available for this code to run.
#
# To reference other packages use:
# "//repo/relative/path/to/package"
# eg. "//packages/kbn-utils"
#
# To reference a NPM package use:
# "@npm//name-of-package"
# eg. "@npm//lodash"
RUNTIME_DEPS = [
# Storybook react doesn't depend on these types even though their types use
# them, so we depend on them in this package and import them to make sure that they
# are available to users of the ambient types
"@npm//react-textarea-autosize",
"@npm//@storybook/react-docgen-typescript-plugin",
]
js_library(
name = PKG_DIRNAME,
srcs = SRCS + NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS,
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
pkg_npm(
name = "npm_module",
deps = [":" + PKG_DIRNAME],
)
filegroup(
name = "build",
srcs = [":npm_module"],
visibility = ["//visibility:public"],
)
alias(
name = "npm_module_types",
actual = ":" + PKG_DIRNAME,
visibility = ["//visibility:public"],
)