Skip to content

Commit c8632ba

Browse files
committed
build: fix npm package for google-maps
Apparently the `google-maps` package has the same problem as the `material-examples` package where the metadata for the Bazel sub-packages is not incldued in the entry-point of the `@angular/google-maps` entry-point. There are two solutions to make it work with Angular package format: * Making the packages generate flat module bundles and including them as secondary entry-points * Only having one Bazel package so that metadata will be included in the flat module bundle. I chose the latter as the `google-maps` package is still very small and doesn't have a lot of dependencies, so in terms of speed it is even faster to have on package. Also it seems like there were never plans to have secondary entry-points for that package.
1 parent 52e3bdb commit c8632ba

File tree

4 files changed

+21
-95
lines changed

4 files changed

+21
-95
lines changed

src/google-maps/BUILD.bazel

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
package(default_visibility = ["//visibility:public"])
22

33
load("//:packages.bzl", "ROLLUP_GLOBALS")
4-
load("//tools:defaults.bzl", "ng_module", "ng_package")
4+
load("//tools:defaults.bzl", "ng_module", "ng_package", "ng_test_library", "ng_web_test_suite")
55

66
ng_module(
77
name = "google-maps",
88
srcs = glob(
9-
["*.ts"],
9+
["**/*.ts"],
1010
exclude = ["**/*.spec.ts"],
1111
),
1212
module_name = "@angular/google-maps",
1313
deps = [
14-
"//src/google-maps/google-map",
15-
"//src/google-maps/map-marker",
1614
"@npm//@angular/core",
1715
"@npm//@types/googlemaps",
1816
],
@@ -32,3 +30,21 @@ filegroup(
3230
name = "source-files",
3331
srcs = glob(["**/*.ts"]),
3432
)
33+
34+
ng_test_library(
35+
name = "unit_test_sources",
36+
srcs = glob(
37+
["**/*.spec.ts"],
38+
exclude = ["**/*.e2e.spec.ts"],
39+
),
40+
deps = [
41+
":google-maps",
42+
"//src/google-maps/testing",
43+
"@npm//@angular/platform-browser",
44+
],
45+
)
46+
47+
ng_web_test_suite(
48+
name = "unit_tests",
49+
deps = [":unit_test_sources"],
50+
)

src/google-maps/google-map/BUILD.bazel

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/google-maps/map-marker/BUILD.bazel

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/google-maps/testing/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ts_library(
77
testonly = 1,
88
srcs = glob(["**/*.ts"]),
99
deps = [
10-
"//src/google-maps/google-map",
10+
"//src/google-maps",
1111
"@npm//@types/googlemaps",
1212
"@npm//@types/jasmine",
1313
],

0 commit comments

Comments
 (0)