Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
340ab75
added prettier and ran `npx prettier ./samples/ -w`
chrisjshull May 4, 2026
6f88333
clean up library typecasting + fix prettier errors + remove some ts/p…
chrisjshull May 4, 2026
342625c
remove typecasts from querySelector calls
chrisjshull May 4, 2026
24d5d35
clean up library typecasting + fix prettier errors + remove some ts/p…
chrisjshull May 4, 2026
9a1d991
added prettier and ran `npx prettier ./samples/ -w`
chrisjshull May 4, 2026
5b99386
merge
chrisjshull May 4, 2026
a76aee8
Merge branch 'prettier-pass2' into prettier-pass3
chrisjshull May 4, 2026
33980d2
add Prettier Check to test action
chrisjshull May 4, 2026
8a9dae4
for all ts file in /samples/ for all queryselector calls use ! to nar…
chrisjshull May 4, 2026
e358d10
remove more typecasting
chrisjshull May 4, 2026
3942c0e
manually fix ts errors
chrisjshull May 4, 2026
afcaf44
fix json
chrisjshull May 4, 2026
9def90a
exclude fewer files from prettifying and run
chrisjshull May 4, 2026
27e6a9e
ran `npx eslint --fix`
chrisjshull May 4, 2026
147f52a
manual fixes for eslint
chrisjshull May 4, 2026
3c98a43
fix or disable remaining eslint errors
chrisjshull May 4, 2026
311c7ae
comment spacing enforcement
chrisjshull May 4, 2026
42ec048
remove and cleanup for @ts-nocheck
chrisjshull May 4, 2026
04c3068
check eslint test action
chrisjshull May 4, 2026
2faa13c
prettify output code too
chrisjshull May 5, 2026
7948ddc
more google.maps.* removal
chrisjshull May 5, 2026
a5db9b8
Merge branch 'main' of github.com:googlemaps-samples/js-api-samples i…
chrisjshull May 5, 2026
f4a54f7
fix status code check
chrisjshull May 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/blunderbuss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
assign_issues:
- googlemaps/devrel
assign_prs:
- googlemaps/devrel
- googlemaps/devrel
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ updates:
interval: "weekly"
ignore:
- dependency-name: "three"
- dependency-name: "@types/three"
- dependency-name: "@types/three"
2 changes: 1 addition & 1 deletion .github/header-checker-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ sourceFileExtensions:
- .sh
- .swift
- .ts
- .yml
- .yml
2 changes: 1 addition & 1 deletion .github/snippet-bot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
alwaysCreateStatusCheck: true
ignoreFiles:
- "samples/*.sh"
- "samples/*.sh"
2 changes: 1 addition & 1 deletion .github/workflows/approve-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }} # Checkout the PR's head commit
token: ${{ secrets.GH_MERGE_TOKEN }}

- name: Approve PR
run: gh pr review --approve "$PR_URL"
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dist-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
workflow_dispatch:
inputs:
source_run_id:
description: 'ID of the upstream workflow run that triggered this'
description: "ID of the upstream workflow run that triggered this"
required: false
type: string

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
branches:
- main
paths:
- 'samples/**'
- "samples/**"

jobs:
release:
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: '24.x'
node-version: "24.x"

- run: npm i

Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
echo " - samples/$workspace"
rm -rf dist/samples/$workspace
done

- name: Generate Index
run: bash samples/generate-index.sh

Expand Down Expand Up @@ -130,6 +130,6 @@ jobs:
uses: benc-uk/workflow-dispatch@v1
with:
workflow: dist-pr.yml
ref: 'temp-build-branch'
ref: "temp-build-branch"
token: ${{ secrets.GH_APPROVER_TOKEN }} # Use the same token that pushed, it needs 'workflows: write' permissions
inputs: '{ "source_run_id": "${{ github.run_id }}" }' # Optional: Pass the run ID for traceability
38 changes: 25 additions & 13 deletions .github/workflows/playwright.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: Playwright Tests
name: Tests

on:
pull_request:
types: [opened, synchronize, edited]
paths:
- 'samples/**'
- 'e2e/samples.spec.ts'
- 'playwright.config.ts'
- 'package.json'
- "samples/**"
- "e2e/samples.spec.ts"
- "playwright.config.ts"
- "package.json"
push:
branches:
- main
paths:
- 'samples/**'
- 'e2e/samples.spec.ts'
- 'playwright.config.ts'
- 'package.json'
- "samples/**"
- "e2e/samples.spec.ts"
- "playwright.config.ts"
- "package.json"
schedule:
- cron: "0 12 * * *"

Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
if: env.HAS_CHANGES == 'true'
uses: actions/setup-node@v4
with:
node-version: '24.x'
node-version: "24.x"

- name: Cache npm dependencies
if: env.HAS_CHANGES == 'true'
Expand Down Expand Up @@ -111,14 +111,14 @@ jobs:
- name: Install Playwright Browsers
if: steps.playwright-cache.outputs.cache-hit != 'true' && env.HAS_CHANGES == 'true'
run: npx playwright install chromium --with-deps

- name: Build Changed Workspaces
if: env.HAS_CHANGES == 'true'
run: |
IFS=$'\n'
CHANGED_WORKSPACES_ARRAY=(${STEPS_GET_WORKSPACES_OUTPUTS_CHANGED_WORKSPACES})
echo "Changed Workspaces Array: ${CHANGED_WORKSPACES_ARRAY[@]}"

echo "Building changed workspaces:"
for workspace in "${CHANGED_WORKSPACES_ARRAY[@]}"; do
echo " - samples/$workspace"
Expand All @@ -133,6 +133,18 @@ jobs:
env.HAS_CHANGES == 'true' ||
contains(github.event.pull_request.paths.*, 'samples/generate-index.sh')

- name: Prettier Check
if: env.HAS_CHANGES == 'true'
run: npx prettier ./samples/ --check --log-level warn
env:
CI: true

- name: ESLint Check
if: env.HAS_CHANGES == 'true'
run: npx eslint
env:
CI: true

- name: Run All Playwright Tests
if: env.HAS_CHANGES == 'true'
run: npx playwright test e2e/samples.spec.ts
Expand Down Expand Up @@ -162,7 +174,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24.x'
node-version: "24.x"

- name: Cache npm dependencies
uses: actions/cache@v4
Expand Down
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
index.html
package.json
package-lock.json
dist
22 changes: 22 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": true,
"bracketSameLine": true,
"overrides": [
{
"files": "*.json",
"options": {
"tabWidth": 2
}
},
{
"files": "*.yml",
"options": {
"tabWidth": 2,
"singleQuote": false
}
}
]
}
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Welcome to the js-api-samples repository, the home of Google Maps JavaScript API

## Important Note: Repository Migration in Progress

This repository (`js-api-samples`) is the new home for the Maps JavaScript API samples.
This repository (`js-api-samples`) is the new home for the Maps JavaScript API samples.

We are currently migrating all samples from the old repository (`js-samples`). During this transition,
you may find some samples are still missing or under development.

* [**js-samples GitHub Repository:**](https://github.com/googlemaps/js-samples)
* [**Maps JavaScript API Documentation:**](https://developers.google.com/maps/documentation/javascript/)
- [**js-samples GitHub Repository:**](https://github.com/googlemaps/js-samples)
- [**Maps JavaScript API Documentation:**](https://developers.google.com/maps/documentation/javascript/)

We appreciate your patience as we complete this migration. Please check back regularly for updates.

Expand All @@ -25,11 +25,11 @@ Each example is one atomic unit, for which dependencies must be individually set
### Build samples

1. Run `npm i` to install dependencies. You only need to do this once, and
thereafter only to update dependencies.
thereafter only to update dependencies.
1. Navigate to the top level (`samples/`).

- To build a single sample, run `npm run build --workspace=sample-name/`
- To build all samples, run `npm run build-all`.
- To build a single sample, run `npm run build --workspace=sample-name/`
- To build all samples, run `npm run build-all`.

Build output is copied to the main `dist/` folder. Each individual sample folder
also contains a `dist/` folder, but this is only used by Vite for live preview.
Expand Down Expand Up @@ -57,7 +57,7 @@ This library is not a Google Maps Platform Core Service. Therefore, the Google M

This library is offered via an open source [license](https://www.apache.org/licenses/LICENSE-2.0). It is not governed by the Google Maps Platform Support [Technical Support Services Guidelines](https://cloud.google.com/maps-platform/terms/tssg), the [SLA](https://cloud.google.com/maps-platform/terms/sla), or the [Deprecation Policy](https://cloud.google.com/maps-platform/terms) (however, any Google Maps Platform services used by the library remain subject to the Google Maps Platform Terms of Service).

This library adheres to [semantic versioning](https://semver.org/) to indicate when backwards-incompatible changes are introduced. Accordingly, while the library is in version 0.x, backwards-incompatible changes may be introduced at any time.
This library adheres to [semantic versioning](https://semver.org/) to indicate when backwards-incompatible changes are introduced. Accordingly, while the library is in version 0.x, backwards-incompatible changes may be introduced at any time.

If you find a bug, or have a feature request, please [file an issue]() on GitHub. If you would like to get answers to technical questions from other Google Maps Platform developers, ask through one of our [developer community channels](https://developers.google.com/maps/developer-community). If you'd like to contribute, please check the [Contributing guide]().

Expand Down
Loading
Loading