Skip to content

Commit

Permalink
build: move BUILD.bazel files for secondary entry points into own folder
Browse files Browse the repository at this point in the history
Without this change, module names will be computed with incorrect paths containing duplicate path fragments (e.g. `@angular-devkit/architect/testing/testing/test-logger`).
  • Loading branch information
filipesilva authored and mgechev committed Apr 7, 2020
1 parent f2d2cd1 commit 5f3f736
Show file tree
Hide file tree
Showing 20 changed files with 413 additions and 334 deletions.
6 changes: 3 additions & 3 deletions packages/angular/cli/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ ts_library(
# strict_checks = False,
deps = [
"//packages/angular_devkit/architect",
"//packages/angular_devkit/architect:node",
"//packages/angular_devkit/architect/node",
"//packages/angular_devkit/core",
"//packages/angular_devkit/core:node",
"//packages/angular_devkit/core/node",
"//packages/angular_devkit/schematics",
"//packages/angular_devkit/schematics:tools",
"//packages/angular_devkit/schematics/tools",
# @node_module: typescript:es2017.object
"@npm//@types/debug",
"@npm//@types/node",
Expand Down
46 changes: 3 additions & 43 deletions packages/angular_devkit/architect/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,6 @@ ts_json_schema(
src = "src/progress-schema.json",
)

ts_library(
name = "node",
srcs = glob(
include = ["node/**/*.ts"],
exclude = [
"**/*_spec.ts",
"**/*_spec_large.ts",
],
),
module_name = "@angular-devkit/architect/node",
module_root = "node/index.d.ts",
# strict_checks = False,
deps = [
":architect",
"//packages/angular_devkit/core",
"//packages/angular_devkit/core:node",
"@npm//@types/node",
"@npm//rxjs",
],
)

ts_library(
name = "architect",
srcs = glob(
Expand All @@ -77,27 +56,7 @@ ts_library(
module_root = "src/index.d.ts",
deps = [
"//packages/angular_devkit/core",
"//packages/angular_devkit/core:node",
"@npm//@types/node",
"@npm//rxjs",
],
)

ts_library(
name = "testing",
srcs = glob(
include = ["testing/**/*.ts"],
exclude = [
"**/*_spec.ts",
"**/*_spec_large.ts",
],
),
module_name = "@angular-devkit/architect/testing",
module_root = "testing/index.d.ts",
deps = [
":architect",
"//packages/angular_devkit/core",
"//packages/angular_devkit/core:node",
"//packages/angular_devkit/core/node",
"@npm//@types/node",
"@npm//rxjs",
],
Expand All @@ -108,7 +67,8 @@ pkg_npm(
name = "npm_package",
deps = [
":architect",
":testing",
"//packages/angular_devkit/architect/node",
"//packages/angular_devkit/architect/testing",
],
)

Expand Down
32 changes: 32 additions & 0 deletions packages/angular_devkit/architect/node/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright Google Inc. All Rights Reserved.
#
# 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

licenses(["notice"]) # MIT

load("@npm_bazel_typescript//:index.bzl", "ts_library")

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


ts_library(
name = "node",
srcs = glob(
include = ["**/*.ts"],
exclude = [
"**/*_spec.ts",
"**/*_spec_large.ts",
],
),
module_name = "@angular-devkit/architect/node",
module_root = "index.d.ts",
# strict_checks = False,
deps = [
"//packages/angular_devkit/architect",
"//packages/angular_devkit/core",
"//packages/angular_devkit/core/node",
"@npm//@types/node",
"@npm//rxjs",
],
)
31 changes: 31 additions & 0 deletions packages/angular_devkit/architect/testing/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright Google Inc. All Rights Reserved.
#
# 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

licenses(["notice"]) # MIT

load("@npm_bazel_typescript//:index.bzl", "ts_library")

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


ts_library(
name = "testing",
srcs = glob(
include = ["**/*.ts"],
exclude = [
"**/*_spec.ts",
"**/*_spec_large.ts",
],
),
module_name = "@angular-devkit/architect/testing",
module_root = "index.d.ts",
deps = [
"//packages/angular_devkit/architect",
"//packages/angular_devkit/core",
"//packages/angular_devkit/core/node",
"@npm//@types/node",
"@npm//rxjs",
],
)
4 changes: 2 additions & 2 deletions packages/angular_devkit/architect_cli/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ ts_library(
module_name = "@angular-devkit/architect-cli",
deps = [
"//packages/angular_devkit/architect",
"//packages/angular_devkit/architect:node",
"//packages/angular_devkit/architect/node",
"//packages/angular_devkit/core",
"//packages/angular_devkit/core:node",
"//packages/angular_devkit/core/node",
"@npm//@types/minimist",
"@npm//@types/node",
"@npm//@types/progress",
Expand Down
4 changes: 2 additions & 2 deletions packages/angular_devkit/benchmark/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ts_library(
module_root = "src/index.d.ts",
deps = [
"//packages/angular_devkit/core",
"//packages/angular_devkit/core:node",
"//packages/angular_devkit/core/node",
"@npm//@types/minimist",
"@npm//@types/node",
"@npm//rxjs",
Expand Down Expand Up @@ -55,7 +55,7 @@ ts_library(
deps = [
":benchmark",
"//packages/angular_devkit/core",
"//packages/angular_devkit/core:node",
"//packages/angular_devkit/core/node",
"@npm//@types/jasmine",
"@npm//@types/node",
"@npm//rxjs",
Expand Down
91 changes: 3 additions & 88 deletions packages/angular_devkit/core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ ts_library(
# @external_end
deps = [
":core",
":node",
"//packages/angular_devkit/core/node:node",
"@npm//@types/jasmine",
"@npm//@types/node",
"@npm//rxjs",
Expand All @@ -88,98 +88,13 @@ jasmine_node_test(
],
)

# @angular-devkit/core/node

ts_library(
name = "node",
srcs = glob(
include = ["node/**/*.ts"],
exclude = [
"node/testing/**/*.ts",
"node/**/*_spec.ts",
"node/**/*_spec_large.ts",
"node/**/*_benchmark.ts",
],
),
module_name = "@angular-devkit/core/node",
module_root = "node/index.d.ts",
# The attribute below is needed in g3 to turn off strict typechecking
# strict_checks = False,
deps = [
":core",
"@npm//@types/node",
"@npm//rxjs",
],
)

ts_library(
name = "node_test_lib",
testonly = True,
srcs = glob(
include = [
"node/**/*_spec.ts",
"node/**/*_spec_large.ts",
],
),
# @external_begin
tsconfig = "//:tsconfig-test.json",
# @external_end
deps = [
":core",
":node",
"//tests/angular_devkit/core/node/jobs:jobs_test_lib",
"@npm//@types/jasmine",
"@npm//@types/node",
"@npm//rxjs",
],
)

jasmine_node_test(
name = "node_test",
srcs = [":node_test_lib"],
# TODO: Audit tests to determine if tests can be run in RBE environments
local = True,
deps = [
"@npm//chokidar",
"@npm//temp",
# @node_module: ajv
# @node_module: fast_json_stable_stringify
# @node_module: magic_string
],
)

# @angular-devkit/core/node/testing

ts_library(
name = "node_testing",
srcs = glob(
include = ["node/testing/**/*.ts"],
exclude = [
"node/testing/**/*_spec.ts",
"node/testing/**/*_spec_large.ts",
"node/testing/**/*_benchmark.ts",
],
),
module_name = "@angular-devkit/core/node/testing",
module_root = "node/testing/index.d.ts",
# The attribute below is needed in g3 to turn off strict typechecking
# strict_checks = False,
deps = [
":core",
":node",
"@npm//@types/jasmine",
"@npm//@types/node",
"@npm//rxjs",
],
)

# @external_begin
pkg_npm(
name = "npm_package",
deps = [
":core",
":node",
":node_testing",
"//packages/angular_devkit/core/node:node",
"//packages/angular_devkit/core/node/testing:testing",
],
)

Expand Down
72 changes: 72 additions & 0 deletions packages/angular_devkit/core/node/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Copyright Google Inc. All Rights Reserved.
#
# 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
package(default_visibility = ["//visibility:public"])

load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

licenses(["notice"]) # MIT License


ts_library(
name = "node",
srcs = glob(
include = ["**/*.ts"],
exclude = [
"testing/**/*.ts",
"**/*_spec.ts",
"**/*_spec_large.ts",
"**/*_benchmark.ts",
],
),
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",
"@npm//rxjs",
],
)

ts_library(
name = "node_test_lib",
testonly = True,
srcs = glob(
include = [
"**/*_spec.ts",
"**/*_spec_large.ts",
],
exclude = [
"testing/**/*.ts",
],
),
# @external_begin
tsconfig = "//:tsconfig-test.json",
# @external_end
deps = [
":node",
"//packages/angular_devkit/core",
"//tests/angular_devkit/core/node/jobs:jobs_test_lib",
"@npm//@types/jasmine",
"@npm//@types/node",
"@npm//rxjs",
],
)

jasmine_node_test(
name = "node_test",
srcs = [":node_test_lib"],
# TODO: Audit tests to determine if tests can be run in RBE environments
local = True,
deps = [
"@npm//chokidar",
"@npm//temp",
# @node_module: ajv
# @node_module: fast_json_stable_stringify
# @node_module: magic_string
],
)
33 changes: 33 additions & 0 deletions packages/angular_devkit/core/node/testing/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright Google Inc. All Rights Reserved.
#
# 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
package(default_visibility = ["//visibility:public"])

load("@npm_bazel_typescript//:index.bzl", "ts_library")

licenses(["notice"]) # MIT License


ts_library(
name = "testing",
srcs = glob(
include = ["**/*.ts"],
exclude = [
"**/*_spec.ts",
"**/*_spec_large.ts",
"**/*_benchmark.ts",
],
),
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:node",
"@npm//@types/jasmine",
"@npm//@types/node",
"@npm//rxjs",
],
)
Loading

0 comments on commit 5f3f736

Please sign in to comment.