Skip to content

Commit b55bd31

Browse files
devversionalan-agius4
authored andcommitted
fixup! build: migrate @angular-devkit/architect to npm_package
Include JSON files
1 parent 2218b0d commit b55bd31

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

packages/angular_devkit/architect/BUILD.bazel

+11-10
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ licenses(["notice"])
1212

1313
package(default_visibility = ["//visibility:public"])
1414

15-
# @external_begin
1615
ts_json_schema(
1716
name = "builder_input_schema",
1817
src = "src/input-schema.json",
@@ -37,7 +36,14 @@ ts_json_schema(
3736
name = "operator_schema",
3837
src = "builders/operator-schema.json",
3938
)
40-
# @external_end
39+
40+
JSON_FILES = glob(
41+
include = ["**/*.json"],
42+
exclude = [
43+
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
44+
"node_modules/**",
45+
],
46+
)
4147

4248
ts_project(
4349
name = "architect",
@@ -56,13 +62,8 @@ ts_project(
5662
"//packages/angular_devkit/architect:src/progress-schema.ts",
5763
"//packages/angular_devkit/architect:builders/operator-schema.ts",
5864
],
59-
data = glob(
60-
include = ["**/*.json"],
61-
exclude = [
62-
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
63-
"node_modules/**",
64-
],
65-
),
65+
# Ensure tests can execute the output JS, relying on schemas/JSON files.
66+
data = JSON_FILES,
6667
module_name = "@angular-devkit/architect",
6768
deps = [
6869
"//:root_modules/@types/node",
@@ -104,7 +105,7 @@ npm_package(
104105
"//packages/angular_devkit/core:package.json",
105106
],
106107
tags = ["release-package"],
107-
deps = [
108+
deps = JSON_FILES + [
108109
"README.md",
109110
":architect_rjs",
110111
":license",

tools/bazel/npm_package.bzl

+2-5
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,14 @@ def npm_package(
7777
_npm_package(
7878
name = "npm_package",
7979
visibility = visibility,
80-
srcs = [":final_package_json"] + deps,
80+
# Note: Order matters here! Last file takes precedence after replaced prefixes.
81+
srcs = deps + [":final_package_json"],
8182
replace_prefixes = {
8283
"substituted_final/": "",
8384
"substituted_with_tars/": "",
8485
"substituted_with_snapshot_repos/": "",
8586
"substituted/": "",
8687
},
87-
exclude_srcs_patterns = [
88-
# Exclude `node_modules` which may be pulled by the `js_module_output` runfiles.
89-
"node_modules/**/*",
90-
],
9188
allow_overwrites = True,
9289
**kwargs
9390
)

0 commit comments

Comments
 (0)