-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
78 lines (69 loc) · 1.49 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@aspect_rules_js//js:defs.bzl", "js_binary")
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")
load(":graphql-codegen.bzl", "gqlgen")
load("@jest//jest:defs.bzl", "jest_test")
npm_link_all_packages()
filegroup(
name = "schema",
srcs = ["schema.graphql"],
)
js_binary(
name = "launcher",
data = [
":node_modules/typescript",
"//:node_modules/@graphql-codegen/cli",
"//:node_modules/@graphql-codegen/typescript",
],
entry_point = "graphql-codegen-launcher.mjs",
visibility = ["//visibility:public"],
)
ts_project(
name = "thing",
srcs = [
"main.ts",
"thing.ts",
],
deps = [
":gen_ts",
"//:node_modules/@types/lodash",
"//:node_modules/left-sad",
"//:node_modules/lodash",
],
)
ts_project(
name = "thing_test_src",
srcs = glob(["*.spec.ts"]),
deps = [
":thing",
"//:node_modules/@types/jest",
],
)
js_library(
name = "jest_config",
srcs = ["jest.config.js"],
visibility = ["//visibility:public"],
)
jest_test(
name = "thing_test",
config = ":jest_config",
data = [
":thing_test_src",
],
)
js_binary(
name = "thing_js",
data = [
"thing",
],
entry_point = "main.js",
)
gqlgen(
name = "gen",
out = "types.ts",
config = {
"plugins": ["typescript"],
},
schemas = ":schema",
)