forked from bazel-contrib/rules_nodejs
-
Notifications
You must be signed in to change notification settings - Fork 4
/
BUILD
55 lines (49 loc) · 1.26 KB
/
BUILD
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
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@build_bazel_rules_nodejs//:index.bzl", "generated_file_test", "nodejs_binary", "npm_package_bin")
load("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc")
load("//:index.bzl", "custom_ts_project")
# thin macro around ts_project that sets some implicit dependencies
# while passing though all other attributes
# is used here to show how to generate stardoc for rules that consume rules_nodejs from source
custom_ts_project(
name = "main",
srcs = ["main.ts"],
)
nodejs_binary(
name = "bin",
data = [
":main",
],
entry_point = ":main.ts",
)
bzl_library(
name = "bzl",
srcs = [
"index.bzl",
],
deps = [
"@build_bazel_rules_nodejs//packages/typescript:bzl",
"@build_bazel_rules_typescript//internal:bzl",
],
)
# generation of the docs for the custom_ts_project macro used above
stardoc(
name = "docs",
out = "docs.md",
input = "index.bzl",
deps = [
":bzl",
],
)
# simple set of tests to ensure this process works as expected
npm_package_bin(
name = "capture",
testonly = True,
stdout = "out",
tool = ":bin",
)
generated_file_test(
name = "output_test",
src = "out.golden",
generated = ":out",
)