Skip to content
File

Blob: src/workerd/api/node/BUILD.bazel

2.2 KB
1load("//:build/kj_test.bzl", "kj_test")
2load("//:build/wd_cc_library.bzl", "wd_cc_library")
3 
4wd_cc_library(
5 name = "exceptions",
6 srcs = [
7 "exceptions.c++",
8 ],
9 hdrs = [
10 "exceptions.h",
11 ],
12 visibility = ["//visibility:public"],
13 deps = [
14 "//src/workerd/jsg",
15 ],
16)
17 
18wd_cc_library(
19 name = "node",
20 srcs = [
21 "async-hooks.c++",
22 "crypto.c++",
23 "crypto-keys.c++",
24 "diagnostics-channel.c++",
25 "module.c++",
26 "process.c++",
27 "timers.c++",
28 "util.c++",
29 "zlib-util.c++",
30 ],
31 hdrs = [
32 "async-hooks.h",
33 "crypto.h",
34 "diagnostics-channel.h",
35 "module.h",
36 "node.h",
37 "process.h",
38 "timers.h",
39 "util.h",
40 "zlib-util.h",
41 ],
42 implementation_deps = [
43 "@capnp-cpp//src/kj/compat:kj-gzip",
44 ],
45 visibility = ["//visibility:public"],
46 deps = [
47 ":node-core",
48 "//src/node",
49 "//src/rust/api",
50 "//src/workerd/api:streams-compression",
51 "//src/workerd/io",
52 "//src/workerd/util:mimetype",
53 "@capnp-cpp//src/kj/compat:kj-brotli",
54 "@ncrypto",
55 "@zstd",
56 ],
57)
58 
59# node source files that don't depend on io.
60wd_cc_library(
61 name = "node-core",
62 srcs = [
63 "buffer.c++",
64 "i18n.c++",
65 "sqlite.c++",
66 "url.c++",
67 ],
68 hdrs = [
69 "buffer.h",
70 "buffer-string-search.h",
71 "i18n.h",
72 "node-version.h",
73 "sqlite.h",
74 "url.h",
75 ],
76 implementation_deps = [
77 "//src/rust/cxx-integration",
78 "//src/rust/net",
79 "@ada-url",
80 "@nbytes",
81 "@simdutf",
82 ],
83 visibility = ["//visibility:public"],
84 deps = [
85 # Please do not add //src/workerd/io here – this target is intended for code that does not
86 # depend on it, move files to the main node target if needed. That way, the files here don't
87 # need to be rebuilt if there are changes to io.
88 "//src/workerd/io:compatibility-date_capnp",
89 "//src/workerd/jsg",
90 ":exceptions",
91 ],
92)
93 
94kj_test(
95 src = "buffer-test.c++",
96 deps = ["//src/workerd/tests:test-fixture"],
97)