File tree Expand file tree Collapse file tree 15 files changed +82
-46
lines changed
react-ui-kit-place-details-compact
react-ui-kit-place-details-latlng-compact
react-ui-kit-place-details-latlng
react-ui-kit-place-details
react-ui-kit-search-nearby Expand file tree Collapse file tree 15 files changed +82
-46
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Copy/generate files for doc snippets.
4+
5+ echo " >>>Running react-docs.sh"
6+
7+ # Copy static documentation files as part of the build process.
8+ NAME=$1 # The name of the folder, taken from package.json "build" line.
9+
10+ # /Users/[USERNAME]/git/js-api-samples/samples
11+
12+ SCRIPT_DIR=" $( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd ) " # Script directory (/samples)
13+ PROJECT_ROOT=$( dirname " $SCRIPT_DIR " ) # Get the parent directory (js-api-samples)
14+ DIST_DIR=" ${PROJECT_ROOT} /dist"
15+ SAMPLE_DIR=" ${PROJECT_ROOT} /dist/samples/${NAME} "
16+
17+ echo " PROJECT_ROOT: ${PROJECT_ROOT} "
18+
19+ DOCS_DIR=" ${PROJECT_ROOT} /dist/samples/${NAME} /docs"
20+
21+ # Create two new folders.
22+ mkdir -p ${DOCS_DIR} /src
23+
24+ # Copy files
25+ cp " ${SCRIPT_DIR} /${NAME} /src/app.js" " ${DOCS_DIR} /src/app.js"
26+ cp " ${SCRIPT_DIR} /${NAME} /src/app.tsx" " ${DOCS_DIR} /src/app.tsx"
27+ cp " ${SCRIPT_DIR} /${NAME} /src/styles.css" " ${DOCS_DIR} /src/styles.css"
28+ cp " ${SCRIPT_DIR} /${NAME} /index.html" " ${DOCS_DIR} /index.html"
29+
30+ # Copy the data folder if one is found.
31+ if [ -d " public" ] && [ " $( ls -A public) " ]; then
32+ cp -r public/* " ${DOCS_DIR} /"
33+ fi
Original file line number Diff line number Diff line change 33 "version" : " 1.0.0" ,
44 "type" : " module" ,
55 "scripts" : {
6- "start" : " vite" ,
7- "build" : " tsc && vite build" ,
8- "test" : " tsc" ,
6+ "build" : " tsc && bash ../react-docs.sh react-ui-kit-place-details-compact && npm run build:vite --workspace=. && bash ../dist.sh react-ui-kit-place-details-compact" ,
7+ "test" : " tsc && npm run build:vite --workspace=." ,
8+ "start" : " tsc && vite build --base './' && vite" ,
9+ "build:vite" : " vite build --base './'" ,
910 "preview" : " vite preview"
1011 },
1112 "dependencies" : {
Original file line number Diff line number Diff line change 33 * Copyright 2025 Google LLC. All Rights Reserved.
44 * SPDX-License-Identifier: Apache-2.0
55 */
6- // [START maps_react_ui_kit_place_details_compact]
6+ { /* [START maps_react_ui_kit_place_details_compact] */ }
77import React , { useEffect , useRef } from 'react' ;
88import { createRoot } from 'react-dom/client' ;
99import { APIProvider , useMapsLibrary } from '@vis.gl/react-google-maps' ;
@@ -84,5 +84,5 @@ export function renderToDom(container: HTMLElement) {
8484 </ React . StrictMode >
8585 ) ;
8686}
87- // [END maps_react_ui_kit_place_details_compact]
87+ { /* [END maps_react_ui_kit_place_details_compact] */ }
8888
Original file line number Diff line number Diff line change 11{
2- "name" : " @js-api-samples/react-ui-kit-place-details-by- latlng-compact" ,
2+ "name" : " @js-api-samples/react-ui-kit-place-details-latlng-compact" ,
33 "version" : " 1.0.0" ,
44 "type" : " module" ,
5+
56 "scripts" : {
6- "start" : " vite" ,
7- "build" : " tsc && vite build" ,
8- "test" : " tsc" ,
7+ "build" : " tsc && bash ../react-docs.sh react-ui-kit-place-details-latlng-compact && npm run build:vite --workspace=. && bash ../dist.sh react-ui-kit-place-details-latlng-compact" ,
8+ "test" : " tsc && npm run build:vite --workspace=." ,
9+ "start" : " tsc && vite build --base './' && vite" ,
10+ "build:vite" : " vite build --base './'" ,
911 "preview" : " vite preview"
1012 },
1113 "dependencies" : {
Original file line number Diff line number Diff line change 33 * Copyright 2025 Google LLC. All Rights Reserved.
44 * SPDX-License-Identifier: Apache-2.0
55 */
6- // [START maps_react_ui_kit_place_details_by_latlng_compact]
6+ { /* [START maps_react_ui_kit_place_details_latlng_compact] */ }
77import React , { useEffect , useRef } from 'react' ;
88import { createRoot } from 'react-dom/client' ;
99import { APIProvider , useMapsLibrary } from '@vis.gl/react-google-maps' ;
@@ -85,4 +85,4 @@ export function renderToDom(container: HTMLElement) {
8585 </ React . StrictMode >
8686 ) ;
8787}
88- // [END maps_react_ui_kit_place_details_by_latlng_compact]
88+ { /* [END maps_react_ui_kit_place_details_latlng_compact] */ }
Original file line number Diff line number Diff line change 11{
2- "name" : " @js-api-samples/react-ui-kit-place-details-by- latlng" ,
2+ "name" : " @js-api-samples/react-ui-kit-place-details-latlng" ,
33 "version" : " 1.0.0" ,
44 "type" : " module" ,
5+
56 "scripts" : {
6- "start" : " vite" ,
7- "build" : " tsc && vite build" ,
8- "test" : " tsc" ,
7+ "build" : " tsc && bash ../react-docs.sh react-ui-kit-place-details-latlng && npm run build:vite --workspace=. && bash ../dist.sh react-ui-kit-place-details-latlng" ,
8+ "test" : " tsc && npm run build:vite --workspace=." ,
9+ "start" : " tsc && vite build --base './' && vite" ,
10+ "build:vite" : " vite build --base './'" ,
911 "preview" : " vite preview"
1012 },
1113 "dependencies" : {
Original file line number Diff line number Diff line change 33 * Copyright 2025 Google LLC. All Rights Reserved.
44 * SPDX-License-Identifier: Apache-2.0
55 */
6- // [START maps_react_ui_kit_place_details_by_latlng]
6+ { /* [START maps_react_ui_kit_place_details_by_latlng] */ }
77import React from 'react' ;
88import { createRoot } from 'react-dom/client' ;
99import { APIProvider , useMapsLibrary } from '@vis.gl/react-google-maps' ;
@@ -91,4 +91,4 @@ export function renderToDom(container: HTMLElement) {
9191 </ React . StrictMode >
9292 ) ;
9393}
94- // [END maps_react_ui_kit_place_details_by_latlng]
94+ { /* [END maps_react_ui_kit_place_details_by_latlng] */ }
Original file line number Diff line number Diff line change 33 "version" : " 1.0.0" ,
44 "type" : " module" ,
55 "scripts" : {
6- "start" : " vite" ,
7- "build" : " tsc && vite build" ,
8- "test" : " tsc" ,
6+ "build" : " tsc && bash ../react-docs.sh react-ui-kit-place-details && npm run build:vite --workspace=. && bash ../dist.sh react-ui-kit-place-details" ,
7+ "test" : " tsc && npm run build:vite --workspace=." ,
8+ "start" : " tsc && vite build --base './' && vite" ,
9+ "build:vite" : " vite build --base './'" ,
910 "preview" : " vite preview"
1011 },
1112 "dependencies" : {
Original file line number Diff line number Diff line change 33 * Copyright 2025 Google LLC. All Rights Reserved.
44 * SPDX-License-Identifier: Apache-2.0
55 */
6- // [START maps_react_ui_kit_place_details]
6+ { /* [START maps_react_ui_kit_place_details] */ }
77import React from 'react' ;
88import { createRoot } from 'react-dom/client' ;
99import { APIProvider , useMapsLibrary } from '@vis.gl/react-google-maps' ;
@@ -90,5 +90,5 @@ export function renderToDom(container: HTMLElement) {
9090 </ React . StrictMode >
9191 ) ;
9292}
93- // [END maps_react_ui_kit_place_details]
9493
94+ { /* [END maps_react_ui_kit_place_details] */ }
Original file line number Diff line number Diff line change 1717 "types" : [
1818 " vite/client" ,
1919 " node"
20- ]
20+ ],
21+ "removeComments" : false ,
2122 }
2223 }
You can’t perform that action at this time.
0 commit comments