Skip to content

Commit 2ff3603

Browse files
authored
fix: Removes .js files; updates .gitignore; various small fixes. (#247)
1 parent 0f6c9bd commit 2ff3603

File tree

10 files changed

+21
-279
lines changed

10 files changed

+21
-279
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ samples/.env
55

66
# Ignore dist files generated by build.
77
samples/*/dist/
8-
dist/*.js
9-
dist/samples/*/dist/assets/*.js
8+
samples/*/*.js
109

1110
# Ignore playwright outputs
1211
/test-results/

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"version": "1.0.0",
44
"description": "Samples for the Google Maps JavaScript API.",
55
"scripts": {
6-
"build-all": "npm run generate-index && npm run clean && npm run build --workspaces",
7-
"build-prod": "npm run generate-index && npm run clean && npm run build --workspaces && bash post-build.sh",
6+
"build-all": "npm run clean && npm run build --workspaces && npm run generate-index",
87
"clean": "bash samples/clean.sh",
98
"generate-index": "bash samples/generate-index.sh"
109
},

samples/add-map/index.js

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

samples/advanced-markers-animation/index.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

samples/clean.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
22

33
# Remove the global dist/samples folder.
4-
rm -rf "dist/samples"
4+
rm -rf "dist/samples"
5+
rm "dist/index.html"

samples/generate-index.sh

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ echo "PROJECT_ROOT: ${PROJECT_ROOT}"
1515
# Create the output file.
1616
OUTPUT_FILE="index.html"
1717

18+
# Path to the index.html file
19+
INDEX_FILE="${PROJECT_ROOT}/${OUTPUT_FILE}"
20+
21+
# Delete the existing index.html file if it exists
22+
if [ -f "$INDEX_FILE" ]; then
23+
rm "$INDEX_FILE"
24+
fi
25+
1826
# Generate the HTML document.
1927
echo "<!DOCTYPE html>" > "${OUTPUT_FILE}"
2028
echo "<html>" >> "${OUTPUT_FILE}"
@@ -27,17 +35,17 @@ echo "<h1>Maps JSAPI Samples</h1>" >> "${OUTPUT_FILE}"
2735
echo "<ul>" >> "${OUTPUT_FILE}"
2836

2937
# Iterate through sample directories.
30-
find "${SCRIPT_DIR}" -maxdepth 1 -mindepth 1 -type d | while read -r subdir; do
38+
find "${SCRIPT_DIR}" -maxdepth 1 -mindepth 1 -type d | sort | while read -r subdir; do
3139

32-
# Extract the directory name.
33-
DIR_NAME=$(basename "${subdir}")
40+
# Extract the directory name.
41+
DIR_NAME=$(basename "${subdir}")
3442

35-
# Construct the link.
36-
LINK_URL="/samples/${DIR_NAME}/dist"
37-
LINK_TEXT="${DIR_NAME}"
43+
# Construct the link.
44+
LINK_URL="/samples/${DIR_NAME}/dist"
45+
LINK_TEXT="${DIR_NAME}"
3846

39-
# Create the list item.
40-
echo " <li><a href='${LINK_URL}'>${LINK_TEXT}</a></li>" >> "${OUTPUT_FILE}"
47+
# Create the list item.
48+
echo " <li><a href='${LINK_URL}'>${LINK_TEXT}</a></li>" >> "${OUTPUT_FILE}"
4149
done
4250

4351
echo "</ul>" >> "${OUTPUT_FILE}"
@@ -49,4 +57,4 @@ echo "HTML file generated: ${OUTPUT_FILE}"
4957
echo "from ${PROJECT_ROOT}/${OUTPUT_FILE}"
5058
echo "to ${DIST_DIR}/${OUTPUT_FILE}"
5159

52-
echo cp "${PROJECT_ROOT}/${OUTPUT_FILE}" "${DIST_DIR}/${OUTPUT_FILE}"
60+
cp "${PROJECT_ROOT}/${OUTPUT_FILE}" "${DIST_DIR}/${OUTPUT_FILE}"

samples/map-simple/index.js

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

samples/place-autocomplete-element/index.js

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

samples/place-autocomplete-map/index.js

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

samples/place-text-search/index.js

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

0 commit comments

Comments
 (0)