Skip to content

Commit

Permalink
build: adjust BUILD file external comment markers
Browse files Browse the repository at this point in the history
Improvements to the syncing process allow for reduced usage of the comment markers.

(cherry picked from commit e402c23)
  • Loading branch information
clydin committed Aug 31, 2022
1 parent 17b7e1b commit a7a3a04
Show file tree
Hide file tree
Showing 16 changed files with 15 additions and 61 deletions.
11 changes: 3 additions & 8 deletions packages/angular/cli/BUILD.bazel
Expand Up @@ -5,12 +5,9 @@

load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("//tools:defaults.bzl", "pkg_npm", "ts_library")
load("//tools:ng_cli_schema_generator.bzl", "cli_json_schema")
load("//tools:toolchain_info.bzl", "TOOLCHAINS_NAMES", "TOOLCHAINS_VERSIONS")

# @external_begin
load("//tools:ts_json_schema.bzl", "ts_json_schema")
load("//tools:ng_cli_schema_generator.bzl", "cli_json_schema")
# @external_end

licenses(["notice"]) # MIT

Expand Down Expand Up @@ -45,10 +42,11 @@ ts_library(
"lib/config/workspace-schema.json",
],
) + [
# @external_begin
"//packages/angular/cli:lib/config/schema.json",
# @external_end
],
module_name = "@angular/cli",
# strict_checks = False,
deps = [
"//packages/angular_devkit/architect",
"//packages/angular_devkit/architect/node",
Expand Down Expand Up @@ -129,7 +127,6 @@ ts_json_schema(
name = "update_schematic_schema",
src = "src/commands/update/schematic/schema.json",
)
# @external_end

ts_library(
name = "angular-cli_test_lib",
Expand All @@ -141,7 +138,6 @@ ts_library(
"node_modules/**",
],
),
# strict_checks = False,
deps = [
":angular-cli",
"//packages/angular_devkit/core",
Expand All @@ -164,7 +160,6 @@ ts_library(
)
]

# @external_begin
genrule(
name = "license",
srcs = ["//:LICENSE"],
Expand Down
1 change: 0 additions & 1 deletion packages/angular/pwa/BUILD.bazel
Expand Up @@ -55,7 +55,6 @@ ts_library(
name = "pwa_test_lib",
testonly = True,
srcs = glob(["pwa/**/*_spec.ts"]),
# strict_checks = False,
deps = [
":pwa",
"//packages/angular_devkit/schematics/testing",
Expand Down
7 changes: 1 addition & 6 deletions packages/angular_devkit/architect/BUILD.bazel
Expand Up @@ -3,14 +3,11 @@
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at https://angular.io/license

load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("//tools:defaults.bzl", "pkg_npm", "ts_library")
load("//tools:toolchain_info.bzl", "TOOLCHAINS_NAMES", "TOOLCHAINS_VERSIONS")

# @external_begin
load("//tools:ts_json_schema.bzl", "ts_json_schema")
load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
# @external_end

licenses(["notice"]) # MIT

Expand Down Expand Up @@ -60,7 +57,6 @@ ts_library(
"//packages/angular_devkit/architect:src/progress-schema.ts",
"//packages/angular_devkit/architect:builders/operator-schema.ts",
],
# strict_checks = False,
data = glob(
include = ["**/*.json"],
exclude = [
Expand All @@ -82,7 +78,6 @@ ts_library(
name = "architect_test_lib",
testonly = True,
srcs = glob(["src/**/*_spec.ts"]),
# strict_checks = False,
deps = [
":architect",
"//packages/angular_devkit/architect/testing",
Expand Down
1 change: 0 additions & 1 deletion packages/angular_devkit/architect/node/BUILD.bazel
Expand Up @@ -17,7 +17,6 @@ ts_library(
),
module_name = "@angular-devkit/architect/node",
module_root = "index.d.ts",
# strict_checks = False,
deps = [
"//packages/angular_devkit/architect",
"//packages/angular_devkit/core",
Expand Down
1 change: 0 additions & 1 deletion packages/angular_devkit/build_angular/BUILD.bazel
Expand Up @@ -198,7 +198,6 @@ ts_library(
],
),
data = glob(["test/**/*"]),
# strict_checks = False,
deps = [
":build_angular",
":build_angular_test_utils",
Expand Down
17 changes: 3 additions & 14 deletions packages/angular_devkit/core/BUILD.bazel
@@ -1,11 +1,8 @@
load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("//tools:defaults.bzl", "pkg_npm", "ts_library")
load("//tools:toolchain_info.bzl", "TOOLCHAINS_NAMES", "TOOLCHAINS_VERSIONS")

# @external_begin
load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
# @external_end

# Copyright Google Inc. All Rights Reserved.
#
# Use of this source code is governed by an MIT-style license that can be
Expand Down Expand Up @@ -36,8 +33,6 @@ ts_library(
),
module_name = "@angular-devkit/core",
module_root = "src/index.d.ts",
# The attribute below is needed in g3 to turn off strict typechecking
# strict_checks = False,
deps = [
"@npm//@types/node",
"@npm//ajv",
Expand All @@ -52,13 +47,13 @@ ts_library(
],
)

# @external_begin

ts_library(
name = "core_test_lib",
testonly = True,
srcs = glob(["src/**/*_spec.ts"]),
data = glob(["src/workspace/json/test/**/*.json"]),
# The attribute below is needed in g3 to turn off strict typechecking
# strict_checks = False,
deps = [
":core",
"//packages/angular_devkit/core/node",
Expand All @@ -71,19 +66,13 @@ ts_library(
name = "core_test_" + toolchain_name,
srcs = [":core_test_lib"],
toolchain = toolchain,
deps = [
# @node_module: ajv
# @node_module: fast_json_stable_stringify
# @node_module: source_map
],
)
for toolchain_name, toolchain in zip(
TOOLCHAINS_NAMES,
TOOLCHAINS_VERSIONS,
)
]

# @external_begin
genrule(
name = "license",
srcs = ["//:LICENSE"],
Expand Down
8 changes: 3 additions & 5 deletions packages/angular_devkit/core/node/BUILD.bazel
Expand Up @@ -24,8 +24,6 @@ ts_library(
data = ["package.json"],
module_name = "@angular-devkit/core/node",
module_root = "index.d.ts",
# The attribute below is needed in g3 to turn off strict typechecking
# strict_checks = False,
deps = [
"//packages/angular_devkit/core",
"@npm//@types/node",
Expand All @@ -34,6 +32,8 @@ ts_library(
],
)

# @external_begin

ts_library(
name = "node_test_lib",
testonly = True,
Expand All @@ -60,13 +60,11 @@ ts_library(
toolchain = toolchain,
deps = [
"@npm//chokidar",
# @node_module: ajv
# @node_module: fast_json_stable_stringify
# @node_module: magic_string
],
)
for toolchain_name, toolchain in zip(
TOOLCHAINS_NAMES,
TOOLCHAINS_VERSIONS,
)
]
# @external_end
2 changes: 0 additions & 2 deletions packages/angular_devkit/core/node/testing/BUILD.bazel
Expand Up @@ -19,8 +19,6 @@ ts_library(
),
module_name = "@angular-devkit/core/node/testing",
module_root = "index.d.ts",
# The attribute below is needed in g3 to turn off strict typechecking
# strict_checks = False,
deps = [
"//packages/angular_devkit/core",
"//packages/angular_devkit/core/node",
Expand Down
10 changes: 3 additions & 7 deletions packages/angular_devkit/schematics/BUILD.bazel
@@ -1,11 +1,8 @@
load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("//tools:defaults.bzl", "pkg_npm", "ts_library")
load("//tools:toolchain_info.bzl", "TOOLCHAINS_NAMES", "TOOLCHAINS_VERSIONS")

# @external_begin
load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
# @external_end

# Copyright Google Inc. All Rights Reserved.
#
# Use of this source code is governed by an MIT-style license that can be
Expand All @@ -26,8 +23,6 @@ ts_library(
"src/**/*_benchmark.ts",
],
),
# The attribute below is needed in g3 to turn off strict typechecking
# strict_checks = False,
data = glob(
include = ["**/*.json"],
exclude = [
Expand All @@ -47,6 +42,8 @@ ts_library(
],
)

# @external_begin

ts_library(
name = "schematics_test_lib",
testonly = True,
Expand Down Expand Up @@ -76,7 +73,6 @@ ts_library(
)
]

# @external_begin
genrule(
name = "license",
srcs = ["//:LICENSE"],
Expand Down
2 changes: 0 additions & 2 deletions packages/angular_devkit/schematics/tasks/BUILD.bazel
Expand Up @@ -21,8 +21,6 @@ ts_library(
data = ["package.json"],
module_name = "@angular-devkit/schematics/tasks",
module_root = "index.d.ts",
# The attribute below is needed in g3 to turn off strict typechecking
# strict_checks = False,
deps = [
"//packages/angular_devkit/core",
"//packages/angular_devkit/core/node",
Expand Down
2 changes: 0 additions & 2 deletions packages/angular_devkit/schematics/tasks/node/BUILD.bazel
Expand Up @@ -19,8 +19,6 @@ ts_library(
),
module_name = "@angular-devkit/schematics/tasks/node",
module_root = "index.d.ts",
# The attribute below is needed in g3 to turn off strict typechecking
# strict_checks = False,
deps = [
"//packages/angular_devkit/core",
"//packages/angular_devkit/core/node",
Expand Down
2 changes: 0 additions & 2 deletions packages/angular_devkit/schematics/tools/BUILD.bazel
Expand Up @@ -23,8 +23,6 @@ ts_library(
data = ["package.json"],
module_name = "@angular-devkit/schematics/tools",
module_root = "index.d.ts",
# The attribute below is needed in g3 to turn off strict typechecking
# strict_checks = False,
deps = [
"//packages/angular_devkit/core",
"//packages/angular_devkit/core/node",
Expand Down
1 change: 0 additions & 1 deletion packages/angular_devkit/schematics_cli/BUILD.bazel
Expand Up @@ -69,7 +69,6 @@ ts_library(
"bin/**/*_spec.ts",
],
),
# strict_checks = False,
deps = [
":schematics_cli",
],
Expand Down
1 change: 0 additions & 1 deletion packages/schematics/angular/BUILD.bazel
Expand Up @@ -56,7 +56,6 @@ ts_library(
"//packages/schematics/angular:" + src.replace(".json", ".ts")
for (src, _) in ALL_SCHEMA_TARGETS
],
# strict_checks = False,
data = glob(
include = [
"collection.json",
Expand Down
4 changes: 1 addition & 3 deletions tools/ng_cli_schema_generator.bzl
Expand Up @@ -3,7 +3,6 @@
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at https://angular.io/license

# @external_begin
def _cli_json_schema_interface_impl(ctx):
args = [
ctx.files.src[0].path,
Expand Down Expand Up @@ -36,11 +35,10 @@ cli_json_schema = rule(
"_binary": attr.label(
default = Label("//tools:ng_cli_schema"),
executable = True,
cfg = "host",
cfg = "exec",
),
},
outputs = {
"json": "%{out}",
},
)
# @external_end
6 changes: 1 addition & 5 deletions tools/ts_json_schema.bzl
Expand Up @@ -3,7 +3,6 @@
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at https://angular.io/license

# @external_begin
def _ts_json_schema_interface_impl(ctx):
args = [
ctx.files.src[0].path,
Expand Down Expand Up @@ -35,14 +34,13 @@ _ts_json_schema_interface = rule(
"_binary": attr.label(
default = Label("//tools:quicktype_runner"),
executable = True,
cfg = "host",
cfg = "exec",
),
},
outputs = {
"ts": "%{out}",
},
)
# @external_end

# Generates a TS file that contains the interface for a JSON Schema file. Takes a single `src`
# argument as input, an optional data field for reference files, and produces a
Expand All @@ -52,11 +50,9 @@ _ts_json_schema_interface = rule(
def ts_json_schema(name, src, data = []):
out = src.replace(".json", ".ts")

# @external_begin
_ts_json_schema_interface(
name = name + ".interface",
src = src,
out = out,
data = data,
)
# @external_end

0 comments on commit a7a3a04

Please sign in to comment.