Skip to content

Commit be3d063

Browse files
gregmagolandgp1130
authored andcommitted
build: exclude nested node_modules laid out by yarn workspaces from all globs
1 parent 8063836 commit be3d063

File tree

12 files changed

+99
-35
lines changed

12 files changed

+99
-35
lines changed

packages/angular/cli/BUILD.bazel

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@ package(default_visibility = ["//visibility:public"])
1818
ts_library(
1919
name = "angular-cli",
2020
srcs = glob(
21-
["**/*.ts"],
22-
exclude = ["**/*_spec.ts"],
21+
include = ["**/*.ts"],
22+
exclude = [
23+
"**/*_spec.ts",
24+
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
25+
"node_modules/**",
26+
],
2327
) + [
2428
"//packages/angular/cli:lib/config/schema.ts",
2529
"//packages/angular/cli:commands/analytics.ts",
@@ -42,11 +46,17 @@ ts_library(
4246
"//packages/angular/cli:commands/run.ts",
4347
"//packages/angular/cli:commands/xi18n.ts",
4448
],
45-
data = glob([
46-
"bin/**/*",
47-
"**/*.json",
48-
"**/*.md",
49-
]),
49+
data = glob(
50+
include = [
51+
"bin/**/*",
52+
"**/*.json",
53+
"**/*.md",
54+
],
55+
exclude = [
56+
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
57+
"node_modules/**",
58+
],
59+
),
5060
module_name = "@angular/cli",
5161
# strict_checks = False,
5262
deps = [
@@ -228,7 +238,13 @@ ts_json_schema(
228238
ts_library(
229239
name = "angular-cli_test_lib",
230240
testonly = True,
231-
srcs = glob(["**/*_spec.ts"]),
241+
srcs = glob(
242+
include = ["**/*_spec.ts"],
243+
exclude = [
244+
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
245+
"node_modules/**",
246+
],
247+
),
232248
# strict_checks = False,
233249
deps = [
234250
":angular-cli",

packages/angular/pwa/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ ts_library(
2525
exclude = [
2626
"pwa/files/**/*",
2727
"**/*_spec.ts",
28+
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
29+
"node_modules/**",
2830
],
2931
) + [
3032
"//packages/angular/pwa:pwa/schema.ts",

packages/angular_devkit/architect/BUILD.bazel

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,13 @@ ts_library(
4949
"//packages/angular_devkit/architect:src/progress-schema.ts",
5050
],
5151
# strict_checks = False,
52-
data = glob(["**/*.json"]),
52+
data = glob(
53+
include = ["**/*.json"],
54+
exclude = [
55+
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
56+
"node_modules/**",
57+
],
58+
),
5359
module_name = "@angular-devkit/architect",
5460
module_root = "src/index.d.ts",
5561
deps = [

packages/angular_devkit/build_ng_packagr/BUILD.bazel

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,11 @@ ts_library(
2626
) + [
2727
"//packages/angular_devkit/build_ng_packagr:src/build/schema.ts",
2828
],
29-
data = glob(
30-
include = [
31-
"package.json",
32-
"builders.json",
33-
"src/build/schema.json",
34-
],
35-
),
29+
data = [
30+
"builders.json",
31+
"package.json",
32+
"src/build/schema.json",
33+
],
3634
module_name = "@angular-devkit/build-ng-packagr",
3735
module_root = "src/index.d.ts",
3836
deps = [

packages/angular_devkit/build_optimizer/BUILD.bazel

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ ts_library(
2424
"src/**/*_benchmark.ts",
2525
],
2626
),
27-
data = glob(
28-
include = [
29-
"package.json",
30-
"webpack-loader/package.json",
31-
],
32-
),
27+
data = [
28+
"package.json",
29+
"webpack-loader/package.json",
30+
],
3331
module_name = "@angular-devkit/build-optimizer",
3432
module_root = "src/index.d.ts",
3533
deps = [

packages/angular_devkit/build_webpack/BUILD.bazel

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,12 @@ ts_library(
3535
"//packages/angular_devkit/build_webpack:src/webpack/schema.ts",
3636
"//packages/angular_devkit/build_webpack:src/webpack-dev-server/schema.ts",
3737
],
38-
data = glob(
39-
include = [
40-
"package.json",
41-
"builders.json",
42-
"src/webpack/schema.json",
43-
"src/webpack-dev-server/schema.json",
44-
],
45-
),
38+
data = [
39+
"builders.json",
40+
"package.json",
41+
"src/webpack-dev-server/schema.json",
42+
"src/webpack/schema.json",
43+
],
4644
module_name = "@angular-devkit/build-webpack",
4745
module_root = "src/index.d.ts",
4846
deps = [

packages/angular_devkit/core/BUILD.bazel

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ ts_library(
2525
"src/**/*_benchmark.ts",
2626
],
2727
),
28-
data = glob(["**/*.json"]) + [
28+
data = glob(
29+
include = ["**/*.json"],
30+
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
31+
exclude = ["node_modules/**"],
32+
) + [
2933
"//packages/angular_devkit/core/third_party/github.com/chalk/supports-color",
3034
],
3135
module_name = "@angular-devkit/core",

packages/angular_devkit/schematics/BUILD.bazel

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ ts_library(
2727
),
2828
# The attribute below is needed in g3 to turn off strict typechecking
2929
# strict_checks = False,
30-
data = glob(["**/*.json"]),
30+
data = glob(
31+
include = ["**/*.json"],
32+
exclude = [
33+
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
34+
"node_modules/**",
35+
],
36+
),
3137
module_name = "@angular-devkit/schematics",
3238
module_root = "src/index.d.ts",
3339
deps = [

packages/angular_devkit/schematics_cli/BUILD.bazel

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ ts_library(
2222
),
2323
# The attribute below is needed in g3 to turn off strict typechecking
2424
# strict_checks = False,
25-
data = glob(["**/*.json"]),
25+
data = glob(
26+
include = ["**/*.json"],
27+
exclude = [
28+
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
29+
"node_modules/**",
30+
],
31+
),
2632
module_name = "@angular-devkit/schematics-cli",
2733
module_root = "bin/schematics.d.ts",
2834
deps = [

packages/schematics/angular/BUILD.bazel

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ ALL_SCHEMA_TARGETS = [
2121
x,
2222
x.replace("/", "_").replace("-", "_").replace(".json", ""),
2323
)
24-
for x in glob(["*/schema.json"])
24+
for x in glob(
25+
include = ["*/schema.json"],
26+
exclude = [
27+
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
28+
"node_modules/**",
29+
],
30+
)
2531
]
2632

2733
# Create all the targets.
@@ -45,6 +51,8 @@ ts_library(
4551
"*/other-files/**/*.ts",
4652
# Exclude test helpers.
4753
"utility/test/**/*.ts",
54+
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
55+
"node_modules/**",
4856
],
4957
) + [
5058
"//packages/schematics/angular:" + src.replace(".json", ".ts")
@@ -60,6 +68,10 @@ ts_library(
6068
"*/files/**/*",
6169
"*/other-files/**/*",
6270
],
71+
exclude = [
72+
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
73+
"node_modules/**",
74+
],
6375
),
6476
module_name = "@schematics/angular",
6577
deps = [
@@ -92,6 +104,10 @@ ts_library(
92104
"**/*_spec.ts",
93105
"utility/test/**/*.ts",
94106
],
107+
exclude = [
108+
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
109+
"node_modules/**",
110+
],
95111
),
96112
# @external_begin
97113
deps = [

packages/schematics/schematics/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ ts_library(
2222
"schematic/files/**",
2323
"blank/project-files/**",
2424
"blank/schematic-files/**",
25+
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
26+
"node_modules/**",
2527
],
2628
) + [
2729
"//packages/schematics/schematics:blank/schema.ts",

packages/schematics/update/BUILD.bazel

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ ts_library(
2222
exclude = [
2323
"**/*_spec.ts",
2424
"**/*_benchmark.ts",
25+
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
26+
"node_modules/**",
2527
],
2628
) + [
2729
"//packages/schematics/update:update/schema.ts",
@@ -53,11 +55,21 @@ ts_json_schema(
5355
ts_library(
5456
name = "update_test_lib",
5557
testonly = True,
56-
srcs = glob(["**/*_spec.ts"]),
58+
srcs = glob(
59+
include = ["**/*_spec.ts"],
60+
exclude = [
61+
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
62+
"node_modules/**",
63+
],
64+
),
5765
data = glob(
5866
include = [
5967
"**/*.json",
6068
],
69+
exclude = [
70+
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
71+
"node_modules/**",
72+
],
6173
),
6274
# @external_begin
6375
deps = [

0 commit comments

Comments
 (0)