5
5
package (default_visibility = ["//visibility:public" ])
6
6
7
7
load ("//tools:defaults.bzl" , "ts_library" )
8
+ load ("@build_bazel_rules_nodejs//:defs.bzl" , "jasmine_node_test" )
8
9
9
10
licenses (["notice" ]) # MIT License
10
11
12
+
13
+ # @angular-devkit/core
14
+
11
15
ts_library (
12
16
name = "core" ,
13
17
srcs = glob (
@@ -20,7 +24,11 @@ ts_library(
20
24
),
21
25
data = glob (["**/*.json" ]),
22
26
module_name = "@angular-devkit/core" ,
23
- module_root = "src" ,
27
+ # Having `module_root = "src` causes `@angular-devkit/core/src/exception/exception` to be
28
+ # resolved to `angular_cli/packages/angular_devkit/core/src/src/exception/exception` (notice
29
+ # double 'src') in `resolveToModuleRoot`.
30
+ # TODO(@filipesilva): figure out if 'src/index.ts' is the correct value, here and in others.
31
+ module_root = "src/index.d.ts" ,
24
32
deps = [
25
33
"@rxjs" ,
26
34
"@rxjs//operators" ,
@@ -33,32 +41,72 @@ ts_library(
33
41
],
34
42
)
35
43
44
+ ts_library (
45
+ name = "core_test_lib" ,
46
+ srcs = glob (
47
+ include = [
48
+ "src/**/*_spec.ts" ,
49
+ "src/**/*_spec_large.ts" ,
50
+ ],
51
+ exclude = [
52
+ # The workspace spec expects workspace.json to be there, but it's not.
53
+ # TODO(@filipesilva): figure out how to resolve these in bazel.
54
+ "src/workspace/workspace_spec.ts" ,
55
+ ],
56
+ ),
57
+ data = [
58
+ "src/workspace/workspace-schema.json"
59
+ ],
60
+ deps = [
61
+ ":core" ,
62
+ ":node" ,
63
+ "@rxjs" ,
64
+ "@rxjs//operators" ,
65
+ # @typings: jasmine
66
+ # @typings: node
67
+ ],
68
+ )
69
+
70
+ jasmine_node_test (
71
+ name = "core_test" ,
72
+ srcs = [":core_test_lib" ],
73
+ )
74
+
75
+
76
+ # @angular-devkit/core/node
77
+
36
78
ts_library (
37
79
name = "node" ,
38
80
srcs = glob (
39
81
include = ["node/**/*.ts" ],
40
82
exclude = [
83
+ "node/testing/**/*.ts" ,
41
84
"node/**/*_spec.ts" ,
42
85
"node/**/*_spec_large.ts" ,
43
- "tools /**/*_benchmark.ts" ,
86
+ "node /**/*_benchmark.ts" ,
44
87
],
45
88
),
46
89
module_name = "@angular-devkit/core/node" ,
47
- module_root = "node" ,
90
+ module_root = "node/index.d.ts " ,
48
91
deps = [
49
- "//packages/angular_devkit/ core" ,
92
+ ": core" ,
50
93
"@rxjs" ,
51
94
"@rxjs//operators" ,
52
95
# @typings: node
53
96
],
54
97
)
55
98
56
99
ts_library (
57
- name = "spec " ,
100
+ name = "node_test_lib " ,
58
101
srcs = glob (
59
102
include = [
60
- "**/*_spec.ts" ,
61
- "**/*_spec_large.ts" ,
103
+ "node/**/*_spec.ts" ,
104
+ "node/**/*_spec_large.ts" ,
105
+ ],
106
+ exclude = [
107
+ # The node resolve spec uses the _devKitRoot global, which isn't available in Bazel.
108
+ # TODO(@filipesilva): figure out an alternative to that global.
109
+ "node/resolve_spec.ts" ,
62
110
],
63
111
),
64
112
deps = [
@@ -70,3 +118,32 @@ ts_library(
70
118
# @typings: node
71
119
],
72
120
)
121
+
122
+ jasmine_node_test (
123
+ name = "node_test" ,
124
+ srcs = [":node_test_lib" ],
125
+ )
126
+
127
+
128
+ # @angular-devkit/core/node/testing
129
+
130
+ ts_library (
131
+ name = "node_testing" ,
132
+ srcs = glob (
133
+ include = ["node/testing/**/*.ts" ],
134
+ exclude = [
135
+ "node/testing/**/*_spec.ts" ,
136
+ "node/testing/**/*_spec_large.ts" ,
137
+ "node/testing/**/*_benchmark.ts" ,
138
+ ],
139
+ ),
140
+ module_name = "@angular-devkit/core/node/testing" ,
141
+ module_root = "node/testing/index.d.ts" ,
142
+ deps = [
143
+ ":core" ,
144
+ ":node" ,
145
+ "@rxjs" ,
146
+ "@rxjs//operators" ,
147
+ # @typings: node
148
+ ],
149
+ )
0 commit comments