Skip to content

Commit

Permalink
Updated package name (#80)
Browse files Browse the repository at this point in the history
* Updated package name

* Updates to migration SDK name

* Fixed description
  • Loading branch information
cgalvan authored Jul 30, 2024
1 parent 6dd8009 commit 4ea33d6
Show file tree
Hide file tree
Showing 25 changed files with 64 additions and 86 deletions.
22 changes: 11 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ To send us a pull request, please:
1. Fork the repository.

```
git clone https://github.com/<YOUR_GITHUB_USERNAME>/amazon-location-migration-adapter
cd amazon-location-migration-adapter
git remote add upstream https://github.com/aws-geospatial/amazon-location-migration-adapter.git
git clone https://github.com/<YOUR_GITHUB_USERNAME>/amazon-location-migration
cd amazon-location-migration
git remote add upstream https://github.com/aws-geospatial/amazon-location-migration.git
git remote set-url --push upstream THESE_ARENT_THE_DROIDS_WERE_LOOKING_FOR
```

Expand All @@ -51,9 +51,9 @@ At this point, your remote setup should look something like this:

```
> git remote -v
origin https://github.com/<YOUR_GITHUB_USERNAME>/amazon-location-migration-adapter.git (fetch)
origin https://github.com/<YOUR_GITHUB_USERNAME>/amazon-location-migration-adapter.git (push)
upstream https://github.com/aws-geospatial/amazon-location-migration-adapter.git (fetch)
origin https://github.com/<YOUR_GITHUB_USERNAME>/amazon-location-migration.git (fetch)
origin https://github.com/<YOUR_GITHUB_USERNAME>/amazon-location-migration.git (push)
upstream https://github.com/aws-geospatial/amazon-location-migration.git (fetch)
upstream THESE_ARENT_THE_DROIDS_WERE_LOOKING_FOR (push)
```

Expand All @@ -64,11 +64,11 @@ npm install
```

3. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
4. Build the adapter.
4. Build the SDK.

```
> npm run build
created dist/amazonLocationMigrationAdapter.js in 2.1s
created dist/amazonLocationMigrationSDK.js in 2.1s
```

5. Ensure local tests pass.
Expand All @@ -86,7 +86,7 @@ GitHub provides additional document on [forking a repository](https://help.githu

## Running Examples

Once you have built the migration adapter in your development environment, there are several examples under the `<root>/examples` folder that you can run locally with the built migration adapter.
Once you have built the migration SDK in your development environment, there are several examples under the `<root>/examples` folder that you can run locally with the built migration SDK.

The examples are generated from templates that have placeholder values for your resources (e.g. API keys, map name, place index, etc...). You will need to fill out an `examples/config.json` file with your specific values.

Expand All @@ -98,9 +98,9 @@ cp examples/config.template.json examples/config.json

Next, open your new `examples/config.json` file and fill it in with your resource values. Anytime you run the examples, they will be auto-generated reading from your `examples/config.json`.

Each example has an `index.html` and a `google.html` page, of which the only difference between them is that the `index.html` imports our migration adapter.
Each example has an `index.html` and a `google.html` page, of which the only difference between them is that the `index.html` imports our migration SDK.
The examples also have an `example.js` script that holds the client logic for the example. This client logic is shared between both `index` and `google` example pages
in order to showcase that the client logic can invoke the same `google.maps` APIs, but will be re-routed by the migration adapter for any APIs that the migration adapter supports.
in order to showcase that the client logic can invoke the same `google.maps` APIs, but will be re-routed by the migration SDK for any APIs that the migration SDK supports.

The examples can be generated + hosted on a local webserver with the following command:

Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Amazon Location Migration Adapter
Amazon Location Migration
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Amazon Location Migration Adapter
# Amazon Location Migration SDK

[![Tests](https://github.com/aws-geospatial/amazon-location-migration-adapter/actions/workflows/build.yml/badge.svg)](https://github.com/aws-geospatial/amazon-location-migration-adapter/actions/workflows/build.yml)
[![Tests](https://github.com/aws-geospatial/amazon-location-migration/actions/workflows/build.yml/badge.svg)](https://github.com/aws-geospatial/amazon-location-migration/actions/workflows/build.yml)

The Amazon Location Migration Adapter provides a bridge for users to test migrating their Google Maps application to use [Amazon Location Service](https://aws.amazon.com/location/). The adapter replaces the import of the Google Maps client SDK, which allows the rest of the applications logic to remain untouched, while under the hood it will be making Amazon Location Service requests instead.
The Amazon Location Migration SDK provides a bridge for users to test migrating their Google Maps application to use [Amazon Location Service](https://aws.amazon.com/location/). The SDK replaces the import of the Google Maps client SDK, which allows the rest of the applications logic to remain untouched, while under the hood it will be making Amazon Location Service requests instead.

## Usage

In order to use the adapter, you will first need to create Amazon Location Service resources based on what kinds of Google Maps API calls your application uses.
In order to use the SDK, you will first need to create Amazon Location Service resources based on what kinds of Google Maps API calls your application uses.
Please follow the instructions linked below based on your applications needs:

- Maps - https://docs.aws.amazon.com/location/latest/developerguide/map-prerequisites.html
Expand All @@ -17,7 +17,7 @@ Once you have created your resources, you can create an API key and give it acce

https://docs.aws.amazon.com/location/latest/developerguide/using-apikeys.html

Now that you have your resources and API key, you can replace your Google Maps JavaScript API import with the adapter. Here are examples based on which Google import method your application uses:
Now that you have your resources and API key, you can replace your Google Maps JavaScript API import with the SDK. Here are examples based on which Google import method your application uses:

### Dynamic Library Import

Expand All @@ -34,10 +34,10 @@ If your application uses the [dynamic library import](https://developers.google.
</script>
```
To use the migration adapter, you replace that line with the following (with your AWS region, resource name(s) and API key filled in):
To use the migration SDK, you replace that line with the following (with your AWS region, resource name(s) and API key filled in):
```html
<script src="https://www.unpkg.com/@aws/amazon-location-migration-adapter?region={{REGION}}&map={{MAP_NAME}}&placeIndex={{PLACE_INDEX}}&routeCalculator={{ROUTE_CALCULATOR}}&apiKey={{AMAZON_LOCATION_API_KEY}}"></script>
<script src="https://www.unpkg.com/@aws/amazon-location-migration-sdk?region={{REGION}}&map={{MAP_NAME}}&placeIndex={{PLACE_INDEX}}&routeCalculator={{ROUTE_CALCULATOR}}&apiKey={{AMAZON_LOCATION_API_KEY}}"></script>
```
If there are any resources that your application doesn't use, you can omit those query parameters. Only the `region` and `apiKey` are required.
Expand Down Expand Up @@ -70,12 +70,12 @@ If your application uses the [legacy direct script loading tag](https://develope
></script>
```
To use the migration adapter, you replace that line with the following (with your AWS region, resource name(s) and API key filled in):
To use the migration SDK, you replace that line with the following (with your AWS region, resource name(s) and API key filled in):
```html
<script
async
src="https://www.unpkg.com/@aws/amazon-location-migration-adapter?callback=initMap&region={{REGION}}&map={{MAP_NAME}}&placeIndex={{PLACE_INDEX}}&apiKey={{AMAZON_LOCATION_API_KEY}}"
src="https://www.unpkg.com/@aws/amazon-location-migration-sdk?callback=initMap&region={{REGION}}&map={{MAP_NAME}}&placeIndex={{PLACE_INDEX}}&apiKey={{AMAZON_LOCATION_API_KEY}}"
></script>
```
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// - Origin/destination can be typed/chosen, or can click on map/marker after clearing the field
//
// This is meant to be showcased as the client logic that is able to remain untouched
// and retain the same functionality when using the migration adapter.
// and retain the same functionality when using the Amazon Location Migration SDK.

let map;
let userLocation, originLocation, destinationLocation;
Expand Down
4 changes: 2 additions & 2 deletions examples/advanced/index.template.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<head>
<title>Advanced Example - Migration Adapter</title>
<title>Advanced Example - Migration SDK</title>
<link rel="stylesheet" type="text/css" href="../common/style.css" />
<link rel="stylesheet" type="text/css" href="./advanced.css" />

Expand Down Expand Up @@ -63,6 +63,6 @@
</div>

<!-- Migration script import -->
<script src="../../dist/amazonLocationMigrationAdapter.js?region={{REGION}}&map={{MAP_NAME}}&placeIndex={{PLACE_INDEX}}&routeCalculator={{ROUTE_CALCULATOR}}&apiKey={{AMAZON_LOCATION_API_KEY}}"></script>
<script src="../../dist/amazonLocationMigrationSDK.js?region={{REGION}}&map={{MAP_NAME}}&placeIndex={{PLACE_INDEX}}&routeCalculator={{ROUTE_CALCULATOR}}&apiKey={{AMAZON_LOCATION_API_KEY}}"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/autoComplete/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// a marker is placed at that location and the map moves to the selected place.
//
// This is meant to be showcased as the client logic that is able to remain untouched
// and retain the same functionality when using the migration adapter.
// and retain the same functionality when using the Amazon Location Migration SDK.

let map;
let placesService;
Expand Down
4 changes: 2 additions & 2 deletions examples/autoComplete/index.template.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<head>
<title>AutoComplete Example - Migration Adapter</title>
<title>AutoComplete Example - Migration SDK</title>
<link rel="stylesheet" type="text/css" href="../common/style.css" />

<!-- jQuery imports for example -->
Expand All @@ -19,6 +19,6 @@
<div id="map"></div>

<!-- Migration script import -->
<script src="../../dist/amazonLocationMigrationAdapter.js?region={{REGION}}&map={{MAP_NAME}}&placeIndex={{PLACE_INDEX}}&apiKey={{AMAZON_LOCATION_API_KEY}}"></script>
<script src="../../dist/amazonLocationMigrationSDK.js?region={{REGION}}&map={{MAP_NAME}}&placeIndex={{PLACE_INDEX}}&apiKey={{AMAZON_LOCATION_API_KEY}}"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/basicMap/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// This a basic map example that just has a Google Map.
//
// This is meant to be showcased as the client logic that is able to remain untouched
// and retain the same functionality when using the migration adapter.
// and retain the same functionality when using the Amazon Location Migration SDK.

function initMap() {
const austinCoords = new google.maps.LatLng(30.268193, -97.7457518); // Austin, TX :)
Expand Down
4 changes: 2 additions & 2 deletions examples/basicMap/index.template.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<head>
<title>Basic Map Example - Migration Adapter</title>
<title>Basic Map Example - Migration SDK</title>
<link rel="stylesheet" type="text/css" href="../common/style.css" />

<!-- Client logic example -->
Expand All @@ -14,7 +14,7 @@
<script
async
defer
src="../../dist/amazonLocationMigrationAdapter.js?callback=initMap&region={{REGION}}&map={{MAP_NAME}}&placeIndex={{PLACE_INDEX}}&apiKey={{AMAZON_LOCATION_API_KEY}}"
src="../../dist/amazonLocationMigrationSDK.js?callback=initMap&region={{REGION}}&map={{MAP_NAME}}&placeIndex={{PLACE_INDEX}}&apiKey={{AMAZON_LOCATION_API_KEY}}"
></script>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/directions/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// requests and then draw driving directions.
//
// This is meant to be showcased as the client logic that is able to remain untouched
// and retain the same functionality when using the migration adapter.
// and retain the same functionality when using the Amazon Location Migration SDK.
//
// This example was adapted from https://developers.google.com/maps/documentation/javascript/examples/directions-simple

Expand Down
4 changes: 2 additions & 2 deletions examples/directions/index.template.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<head>
<title>Directions Example - Migration Adapter</title>
<title>Directions Example - Migration SDK</title>
<link rel="stylesheet" type="text/css" href="../common/style.css" />

<!-- Client logic example -->
Expand Down Expand Up @@ -93,7 +93,7 @@
<script
async
defer
src="../../dist/amazonLocationMigrationAdapter.js?callback=initMap&region={{REGION}}&map={{MAP_NAME}}&placeIndex={{PLACE_INDEX}}&routeCalculator={{ROUTE_CALCULATOR}}&apiKey={{AMAZON_LOCATION_API_KEY}}"
src="../../dist/amazonLocationMigrationSDK.js?callback=initMap&region={{REGION}}&map={{MAP_NAME}}&placeIndex={{PLACE_INDEX}}&routeCalculator={{ROUTE_CALCULATOR}}&apiKey={{AMAZON_LOCATION_API_KEY}}"
></script>
</body>
</html>
7 changes: 4 additions & 3 deletions examples/landingPage.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<html>
<head>
<title>Migration Adapter Examples</title>
<title>Migration SDK Examples</title>

<link rel="stylesheet" type="text/css" href="./common/style.css" />
</head>
<body>
<h1>Amazon Location Migration Adapter Examples</h1>
<h1>Amazon Location Migration SDK Examples</h1>
<p>
Here are several example use-cases for using the adapter, along with the same example using only the Google SDK.
Here are several example use-cases for using the Amazon Location Migration SDK, along with the same example using
the Google SDK.
</p>

<div>
Expand Down
2 changes: 1 addition & 1 deletion examples/markers/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// This is an example that shows different ways to customize markers and advanced markers.
//
// This is meant to be showcased as the client logic that is able to remain untouched
// and retain the same functionality when using the migration adapter.
// and retain the same functionality when using the Amazon Location Migration SDK.

function initMap() {
const austinCoords = { lat: 30.268193, lng: -97.7457518 }; // Austin, TX :)
Expand Down
4 changes: 2 additions & 2 deletions examples/markers/index.template.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<head>
<title>Markers Example - Migration Adapter</title>
<title>Markers Example - Migration SDK</title>
<link rel="stylesheet" type="text/css" href="../common/style.css" />

<!-- Client logic example -->
Expand All @@ -14,7 +14,7 @@
<script
async
defer
src="../../dist/amazonLocationMigrationAdapter.js?callback=initMap&region={{REGION}}&map={{MAP_NAME}}&placeIndex={{PLACE_INDEX}}&apiKey={{AMAZON_LOCATION_API_KEY}}"
src="../../dist/amazonLocationMigrationSDK.js?callback=initMap&region={{REGION}}&map={{MAP_NAME}}&placeIndex={{PLACE_INDEX}}&apiKey={{AMAZON_LOCATION_API_KEY}}"
></script>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/newPlaces/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// This example showcases the new Places API.
//
// This is meant to be showcased as the client logic that is able to remain untouched
// and retain the same functionality when using the migration adapter.
// and retain the same functionality when using the Amazon Location Migration SDK.

const austinCoords = { lat: 30.268193, lng: -97.7457518 }; // Austin, TX :)

Expand Down
4 changes: 2 additions & 2 deletions examples/newPlaces/index.template.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<head>
<title>New Places Example - Migration Adapter</title>
<title>New Places Example - Migration SDK</title>
<link rel="stylesheet" type="text/css" href="../common/style.css" />

<!-- Client logic example -->
Expand All @@ -10,6 +10,6 @@
<div id="map"></div>

<!-- Migration script import -->
<script src="../../dist/amazonLocationMigrationAdapter.js?region={{REGION}}&map={{MAP_NAME}}&placeIndex={{PLACE_INDEX}}&apiKey={{AMAZON_LOCATION_API_KEY}}"></script>
<script src="../../dist/amazonLocationMigrationSDK.js?region={{REGION}}&map={{MAP_NAME}}&placeIndex={{PLACE_INDEX}}&apiKey={{AMAZON_LOCATION_API_KEY}}"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws/amazon-location-migration-adapter",
"description": "Amazon Location Migration Adapter for JavaScript",
"name": "@aws/amazon-location-migration-sdk",
"description": "Amazon Location Migration SDK for JavaScript",
"license": "Apache-2.0",
"version": "0.9.0",
"keywords": [],
Expand All @@ -9,10 +9,10 @@
"email": "",
"url": "https://aws.amazon.com/"
},
"homepage": "https://code.amazon.com/packages/AWSWaypointMigrationAdapter",
"homepage": "https://github.com/aws-geospatial/amazon-location-migration",
"repository": {
"type": "git",
"url": "ssh://git.amazon.com/pkg/AWSWaypointMigrationAdapter"
"url": "https://github.com/aws-geospatial/amazon-location-migration"
},
"contributors": [
"Chris Galvan <[email protected]>",
Expand All @@ -21,10 +21,10 @@
"engines": {
"node": ">= 16.0.0"
},
"browser": "./dist/amazonLocationMigrationAdapter.js",
"browser": "./dist/amazonLocationMigrationSDK.js",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"unpkg": "./dist/amazonLocationMigrationAdapter.js",
"unpkg": "./dist/amazonLocationMigrationSDK.js",
"files": [
"./LICENSE.txt",
"./README.md",
Expand Down
6 changes: 3 additions & 3 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import nodePolyfills from "rollup-plugin-polyfill-node";
const banner = `
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Third party license at https://github.com/aws-geospatial/amazon-location-migration-adapter/blob/main/LICENSE-THIRD-PARTY.txt
// Third party license at https://github.com/aws-geospatial/amazon-location-migration/blob/main/LICENSE-THIRD-PARTY.txt
`;

export default {
Expand All @@ -28,13 +28,13 @@ export default {

output: [
{
file: "dist/amazonLocationMigrationAdapter.js",
file: "dist/amazonLocationMigrationSDK.js",
format: "esm",
banner,
plugins: [
getBabelOutputPlugin({
minified: true,
moduleId: "amazonLocationMigrationAdapter",
moduleId: "amazonLocationMigrationSDK",
presets: [["@babel/env", { modules: "umd" }]],
}),
],
Expand Down
2 changes: 1 addition & 1 deletion src/geocoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ interface GeocoderResult {
}

interface GeocoderGeometry {
bounds?: google.maps.LatLngBounds;
bounds?: MigrationLatLngBounds;
location: MigrationLatLng;
}

Expand Down
22 changes: 0 additions & 22 deletions src/google.maps.d.ts

This file was deleted.

Loading

0 comments on commit 4ea33d6

Please sign in to comment.