Skip to content

Commit 1722951

Browse files
committed
feat(google-maps): Add map-marker component
Refactor google-maps module to have a single entry-point, @angular/google-maps, instead of a separate one for every component.
1 parent 047c3f8 commit 1722951

18 files changed

+42
-73
lines changed

packages.bzl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,6 @@ MATERIAL_SCSS_LIBS = [
8080
for p in MATERIAL_PACKAGES
8181
]
8282

83-
GOOGLE_MAPS_PACKAGES = [
84-
"google-map",
85-
]
86-
87-
GOOGLE_MAPS_TARGETS = ["//src/google-maps"] + ["//src/google-maps/%s" % p for p in GOOGLE_MAPS_PACKAGES]
88-
8983
MATERIAL_EXPERIMENTAL_PACKAGES = [
9084
"mdc-button",
9185
"mdc-card",

src/dev-app/google-map/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ng_module(
77
srcs = glob(["**/*.ts"]),
88
assets = ["google-map-demo.html"],
99
deps = [
10-
"//src/google-maps/google-map",
10+
"//src/google-maps",
1111
"@npm//@angular/router",
1212
],
1313
)

src/dev-app/google-map/google-map-demo-module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
import {CommonModule} from '@angular/common';
1010
import {HttpClientJsonpModule, HttpClientModule} from '@angular/common/http';
1111
import {NgModule} from '@angular/core';
12-
import {GoogleMapModule} from '@angular/google-maps/google-map';
12+
import {GoogleMapsModule} from '@angular/google-maps';
1313
import {RouterModule} from '@angular/router';
1414

1515
import {GoogleMapDemo} from './google-map-demo';
1616

1717
@NgModule({
1818
imports: [
1919
CommonModule,
20-
GoogleMapModule,
20+
GoogleMapsModule,
2121
HttpClientJsonpModule,
2222
HttpClientModule,
2323
RouterModule.forChild([{path: '', component: GoogleMapDemo}]),

src/dev-app/system-config.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ var MATERIAL_PACKAGES = [
5555
'tree',
5656
];
5757

58-
var GOOGLE_MAPS_PACKAGES = [
59-
'google-map',
60-
];
61-
6258
var MATERIAL_EXPERIMENTAL_PACKAGES = [
6359
'mdc-button',
6460
'mdc-card',
@@ -103,9 +99,7 @@ MATERIAL_EXPERIMENTAL_PACKAGES.forEach(function(pkgName) {
10399
MATERIAL_PACKAGES.forEach(function(pkgName) {
104100
configureEntryPoint('material', pkgName);
105101
});
106-
GOOGLE_MAPS_PACKAGES.forEach(function(pkgName) {
107-
configureEntryPoint('google-maps', pkgName);
108-
});
102+
configureEntryPoint('google-maps');
109103
configureEntryPoint('youtube-player');
110104

111105
/** Configures the specified package and its entry-point. */

src/dev-app/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@angular/cdk-experimental/*": ["../cdk-experimental/*"],
1515
"@angular/cdk-experimental": ["../cdk-experimental"],
1616
"@angular/material-moment-adapter": ["../material-moment-adapter/public-api.ts"],
17-
"@angular/google-maps/*": ["../google-maps/*"],
17+
"@angular/google-maps": ["../google-maps"],
1818
"@angular/material-examples": ["../../dist/packages/material-examples"]
1919
}
2020
},

src/google-maps/BUILD.bazel

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

3-
load("//:packages.bzl", "GOOGLE_MAPS_PACKAGES", "GOOGLE_MAPS_TARGETS", "ROLLUP_GLOBALS")
3+
load("//:packages.bzl", "ROLLUP_GLOBALS")
44
load("//tools:defaults.bzl", "ng_module", "ng_package")
55

66
# Root "@angular/google-maps" entry-point that does not re-export individual entry-points.
@@ -11,24 +11,25 @@ ng_module(
1111
exclude = ["**/*.spec.ts"],
1212
),
1313
module_name = "@angular/google-maps",
14-
deps = ["//src/google-maps/%s" % p for p in GOOGLE_MAPS_PACKAGES] + [
14+
deps = [
15+
"//src/google-maps/google-map",
1516
"//src/google-maps/map-marker",
1617
"@npm//@angular/core",
1718
"@npm//@types/googlemaps",
1819
],
1920
)
2021

21-
filegroup(
22-
name = "overviews",
23-
srcs = ["//src/google-maps/%s:overview" % name for name in GOOGLE_MAPS_PACKAGES],
24-
)
25-
2622
# Creates the @angular/google-maps package published to npm
2723
ng_package(
2824
name = "npm_package",
2925
srcs = ["package.json"],
3026
entry_point = ":public-api.ts",
3127
entry_point_name = "google-maps",
3228
globals = ROLLUP_GLOBALS,
33-
deps = GOOGLE_MAPS_TARGETS,
29+
deps = [":google-maps"],
30+
)
31+
32+
filegroup(
33+
name = "source-files",
34+
srcs = glob(["**/*.ts"]),
3435
)

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package(default_visibility = ["//visibility:public"])
22

33
load(
44
"//tools:defaults.bzl",
5-
"markdown_to_html",
65
"ng_module",
76
"ng_test_library",
87
"ng_web_test_suite",
@@ -14,7 +13,6 @@ ng_module(
1413
["**/*.ts"],
1514
exclude = ["**/*.spec.ts"],
1615
),
17-
module_name = "@angular/google-maps/google-map",
1816
deps = [
1917
"//src/google-maps/map-marker",
2018
"@npm//@angular/core",
@@ -42,11 +40,6 @@ ng_web_test_suite(
4240
deps = [":unit_test_sources"],
4341
)
4442

45-
markdown_to_html(
46-
name = "overview",
47-
srcs = [":google-map.md"],
48-
)
49-
5043
filegroup(
5144
name = "source-files",
5245
srcs = glob(["**/*.ts"]),

src/google-maps/google-map/google-map-module.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@
88

99
import {NgModule} from '@angular/core';
1010

11-
import {MapMarker, MapMarkerModule} from '../map-marker/index';
12-
1311
import {GoogleMap} from './google-map';
1412

1513
@NgModule({
16-
imports: [MapMarkerModule],
17-
exports: [GoogleMap, MapMarker],
14+
exports: [GoogleMap],
1815
declarations: [GoogleMap],
1916
})
2017
export class GoogleMapModule {

src/google-maps/google-map/google-map.md

Whitespace-only changes.

src/google-maps/google-map/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
export * from './public-api';
9+
export * from './google-map';
10+
export * from './google-map-module';

src/google-maps/google-map/public-api.ts

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

src/google-maps/google-map/tsconfig-build.json

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

src/google-maps/google-maps-module.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {NgModule} from '@angular/core';
10+
11+
import {MapMarker, MapMarkerModule} from './map-marker/index';
12+
13+
import {GoogleMap, GoogleMapModule} from './google-map/index';
14+
15+
@NgModule({
16+
imports: [GoogleMapModule, MapMarkerModule,],
17+
exports: [GoogleMap, MapMarker,],
18+
})
19+
export class GoogleMapsModule {
20+
}

src/google-maps/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
export * from './public-api';
9+
export * from './google-maps-module';

src/google-maps/public-api.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
export * from '@angular/google-maps/google-map';
9+
export {GoogleMap} from './google-map/index';
10+
export {MapMarker} from './map-marker/index';
11+
export * from './google-maps-module';

src/google-maps/tsconfig-build.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
".",
1313
"../../dist/packages/google-maps"
1414
],
15-
"paths": {
16-
"@angular/google-maps/*": ["../../dist/packages/google-maps/*"]
17-
},
1815
"types": [
1916
"googlemaps"
2017
]

src/google-maps/tsconfig-tests.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
"jasmine",
1212
"googlemaps"
1313
],
14-
"paths": {
15-
"@angular/google-maps/*": ["./*"]
16-
}
1714
},
1815
"angularCompilerOptions": {
1916
"strictMetadataEmit": true,

src/google-maps/tsconfig.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
"compilerOptions": {
55
"rootDir": "..",
66
"baseUrl": ".",
7-
"paths": {
8-
"@angular/google-maps": ["./*"]
9-
},
7+
"paths": {},
108
"types": [
119
"jasmine",
1210
"googlemaps"

0 commit comments

Comments
 (0)