1
- load ("@build_bazel_rules_nodejs//:index.bzl" , "nodejs_binary" )
2
- load ("@aspect_rules_esbuild//esbuild:defs.bzl" , "esbuild" )
1
+ load ("@aspect_rules_js//js:defs.bzl" , "js_binary" )
3
2
load ("//tools:defaults.bzl" , "ts_project" )
4
- load ("@aspect_rules_ts//ts:defs.bzl" , rules_js_tsconfig = "ts_config" )
3
+ load ("@aspect_rules_ts//ts:defs.bzl" , "ts_config" )
5
4
6
5
package (default_visibility = ["//visibility:public" ])
7
6
8
- esbuild (
9
- name = "bin" ,
10
- bundle = True ,
11
- entry_point = ":index.ts" ,
12
- external = [
13
- "typescript" ,
14
- ],
15
- format = "esm" ,
16
- output = "bin.mjs" ,
17
- platform = "node" ,
18
- target = "es2022" ,
19
- deps = [
20
- ":extract_api_to_json_lib" ,
21
- "//:node_modules/@angular/compiler-cli" ,
22
- ],
23
- )
24
-
25
7
ts_project (
26
8
name = "extract_api_to_json_lib" ,
27
9
srcs = glob (
@@ -42,18 +24,13 @@ ts_project(
42
24
)
43
25
44
26
# Action binary for the api_gen bazel rule.
45
- nodejs_binary (
27
+ js_binary (
46
28
name = "extract_api_to_json" ,
47
29
data = [
48
- ":bin " ,
30
+ ":extract_api_to_json_lib " ,
49
31
"//:node_modules/typescript" ,
50
32
],
51
- entry_point = "bin.mjs" ,
52
- # Note: Using the linker here as we need it for ESM. The linker is not
53
- # super reliably when running concurrently on Windows- but we have existing
54
- # actions using the linker. An alternative would be to:
55
- # - bundle the Angular compiler into a CommonJS bundle
56
- # - use the patched resolution- but also patch the ESM imports (similar to how FW does it).
33
+ entry_point = "index.js" ,
57
34
visibility = ["//visibility:public" ],
58
35
)
59
36
@@ -63,7 +40,7 @@ filegroup(
63
40
srcs = glob (["**/*" ]),
64
41
)
65
42
66
- rules_js_tsconfig (
43
+ ts_config (
67
44
name = "tsconfig" ,
68
45
src = "tsconfig.json" ,
69
46
deps = ["//:node_modules/@types/node" ],
0 commit comments