Skip to content

Commit

Permalink
refactor: move resize observer to private cdk entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalerba committed Nov 22, 2022
1 parent ec56430 commit b4870f9
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 23 deletions.
1 change: 1 addition & 0 deletions src/cdk/config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CDK_ENTRYPOINTS = [
"listbox",
"menu",
"observers",
"observers/private",
"overlay",
"platform",
"portal",
Expand Down
44 changes: 44 additions & 0 deletions src/cdk/observers/private/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
load(
"//tools:defaults.bzl",
"ng_module",
"ng_test_library",
"ng_web_test_suite",
)

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

ng_module(
name = "private",
srcs = glob(
["**/*.ts"],
exclude = ["**/*.spec.ts"],
),
deps = [
"//src:dev_mode_types",
"//src/cdk/platform",
"@npm//rxjs",
],
)

ng_test_library(
name = "private_tests_lib",
srcs = glob(
["**/*.spec.ts"],
exclude = ["**/*.e2e.spec.ts"],
),
deps = [
":private",
],
)

ng_web_test_suite(
name = "unit_tests",
deps = [
":private_tests_lib",
],
)

filegroup(
name = "source-files",
srcs = glob(["**/*.ts"]),
)
9 changes: 9 additions & 0 deletions src/cdk/observers/private/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* @license
* Copyright Google LLC 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
*/

export * from './shared-resize-observer';
22 changes: 1 addition & 21 deletions src/material/form-field/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ load(
"//tools:defaults.bzl",
"markdown_to_html",
"ng_module",
"ng_test_library",
"ng_web_test_suite",
"sass_binary",
"sass_library",
)
Expand All @@ -20,7 +18,7 @@ ng_module(
deps = [
"//src:dev_mode_types",
"//src/cdk/bidi",
"//src/cdk/observers",
"//src/cdk/observers/private",
"//src/cdk/platform",
"//src/material/core",
"@npm//@angular/forms",
Expand Down Expand Up @@ -81,21 +79,3 @@ filegroup(
name = "source-files",
srcs = glob(["**/*.ts"]),
)

ng_test_library(
name = "form_field_tests_lib",
srcs = glob(
["**/*.spec.ts"],
exclude = ["**/*.e2e.spec.ts"],
),
deps = [
":form-field",
],
)

ng_web_test_suite(
name = "unit_tests",
deps = [
":form_field_tests_lib",
],
)
2 changes: 1 addition & 1 deletion src/material/form-field/directives/floating-label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
OnDestroy,
Output,
} from '@angular/core';
import {SharedResizeObserver} from '../shared-resize-observer';
import {SharedResizeObserver} from '@angular/cdk/observers/private';
import {Subscription} from 'rxjs';

/**
Expand Down
2 changes: 1 addition & 1 deletion tools/public_api_guard/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ generate_test_targets(
[
"//src/cdk",
"//src/material",
] + ["//src/cdk/%s" % e for e in CDK_ENTRYPOINTS] +
] + ["//src/cdk/%s" % e for e in CDK_ENTRYPOINTS if not e.endswith("/private")] +
["//src/material/%s" % e for e in MATERIAL_ENTRYPOINTS + MATERIAL_TESTING_ENTRYPOINTS],
)

Expand Down

0 comments on commit b4870f9

Please sign in to comment.