-
Notifications
You must be signed in to change notification settings - Fork 1
/
BUILD.bazel
83 lines (71 loc) · 1.68 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
79
80
81
82
83
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
load("@aspect_rules_jest//jest:defs.bzl", "jest_test")
load("@npm//:defs.bzl", "npm_link_all_packages")
npm_link_all_packages()
PACKAGE_NAMESPACE = "block65"
PACKAGE_NAME = "demonade"
SCOPED_PACKAGE_NAME = "@%s/%s" % (PACKAGE_NAMESPACE, PACKAGE_NAME)
SRCS = glob(
[
"lib/*.ts",
"bin/*.ts",
],
)
TEST_SRCS = glob(
[
"__tests__/**/*",
"tools/jest*",
],
exclude = ["__tests__/__snapshots__/*.snap"],
)
TEST_SNAPSHOT_SRCS = glob(
["__tests__/__snapshots__/*.snap"],
)
DEPS = [
":node_modules/@types/node",
":node_modules/@block65/custom-error",
":node_modules/@block65/logger",
":node_modules/@types/yargs",
":node_modules/yargs",
":node_modules/lilconfig",
":node_modules/chokidar",
":node_modules/find-up",
":node_modules/p-debounce",
]
# deps used just for test srcs (ie dev deps)
TEST_DEPS = [
":node_modules/@jest/globals",
]
ts_project(
name = "compiled",
srcs = SRCS + TEST_SRCS + ["package.json"],
declaration = True,
deps = DEPS + TEST_DEPS,
)
jest_test(
name = "unit",
config = "jest.config.js",
data = [
":compiled",
"package.json",
] + DEPS + TEST_DEPS,
log_level = "debug",
node_options = [
"--experimental-vm-modules",
"--stack-trace-limit=3",
],
snapshots = TEST_SNAPSHOT_SRCS,
)
npm_package(
name = "pkg",
srcs = [
"CREDITS.md",
"LICENSE.md",
"README.md",
"package.json",
":compiled",
],
package = SCOPED_PACKAGE_NAME,
visibility = ["//:__subpackages__"],
)