From 3f14f3c12d92553e5f0b9f02d1cd87f9a6a8bc60 Mon Sep 17 00:00:00 2001 From: William French Date: Thu, 12 Sep 2024 10:36:48 -0700 Subject: [PATCH 1/8] Update package.json adds "type": "module", to test ESM fix --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index e329683b28..7173a8ad46 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "@googlemaps/js-samples", "description": "Samples for Google Maps JavaScript", "version": "2.1.4", + "type": "module", "keywords": [ "google", "javascript", From 816335a928fa775e2e7424d832a313c943ab6dda Mon Sep 17 00:00:00 2001 From: William French Date: Thu, 12 Sep 2024 10:38:54 -0700 Subject: [PATCH 2/8] Update e2e.yml updates actions/checkout to v4 --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index b84b08e205..a501733e15 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -40,7 +40,7 @@ jobs: shard: [1, 2, 3, 4, 5, 6, 7, 8] fail-fast: false steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: lfs: true - uses: actions/cache@v2 From a9a18f2181dd8b314d458c76869da6e17f2587d5 Mon Sep 17 00:00:00 2001 From: William French Date: Thu, 12 Sep 2024 10:42:32 -0700 Subject: [PATCH 3/8] Update e2e.yml update actions/upload-articfact to v4, restored actions/checkout to v2. Chasing around and around, seeking sanity. --- .github/workflows/e2e.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a501733e15..653a59785b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -40,7 +40,7 @@ jobs: shard: [1, 2, 3, 4, 5, 6, 7, 8] fail-fast: false steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v2 with: lfs: true - uses: actions/cache@v2 @@ -66,7 +66,7 @@ jobs: env: CI: true - name: Push test report to artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: failure() with: name: Test Results From 21d4579a435e0b678c95709f702d421df6c7023b Mon Sep 17 00:00:00 2001 From: William French Date: Thu, 12 Sep 2024 10:51:36 -0700 Subject: [PATCH 4/8] fix: Update .eleventy.js to use dynamic imports Updates .eleventy.js to use dynamic imports to try and solve the ESM bug. --- .eleventy.js | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index 3d336a43f5..c4dc4c416f 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,19 +1,33 @@ require("dotenv").config(); -const typescript = require("./src/engines/typescript/sample"); -const typescriptJSX = require("./src/engines/typescript/sample-jsx"); -const sass = require("./src/engines/sass"); -const stripRegionTags = require("./src/transforms/strip-region-tags"); -const stripLicenseHeaders = require("./src/transforms/strip-license-headers"); -const yourAPIKey = require("./src/transforms/your-api-key"); -const format = require("./src/transforms/format"); -const minify = require("./src/transforms/minify"); -const skypack = require("./src/transforms/skypack"); -const fs = require("fs"); -const path = require("path"); -const vite = require("vite"); -const chalk = require("chalk"); -const prettier = require("prettier"); +import { typescript } from "./src/engines/typescript/sample"; +import { typescriptJSX } from "./src/engines/typescript/sample-jsx"; +import { sass } from "./src/engines/sass"; +import { stripRegionTags } from "./src/transforms/strip-region-tags"; +import { stripLicenseHeaders } from "./src/transforms/strip-license-headers"; +import { yourAPIKey } from "./src/transforms/your-api-key"; +import { format } from "./src/transforms/format"; +import { minify } from "./src/transforms/minify"; +import { skypack } from "./src/transforms/minify"; +import { fs } from "fs"; +import { path } from "path"; +import { vite } from "vite"; +import { chalk } from "chalk"; +import { prettier } from "prettier"; +//const typescript = require("./src/engines/typescript/sample"); +//const typescriptJSX = require("./src/engines/typescript/sample-jsx"); +//const sass = require("./src/engines/sass"); +//const stripRegionTags = require("./src/transforms/strip-region-tags"); +//const stripLicenseHeaders = require("./src/transforms/strip-license-headers"); +//const yourAPIKey = require("./src/transforms/your-api-key"); +//const format = require("./src/transforms/format"); +//const minify = require("./src/transforms/minify"); +//const skypack = require("./src/transforms/skypack"); +//const fs = require("fs"); +//const path = require("path"); +//const vite = require("vite"); +//const chalk = require("chalk"); +//const prettier = require("prettier"); module.exports = function (eleventyConfig) { eleventyConfig.addWatchTarget("./shared/**/*"); From e6cb6d92926a9f690e8a180f633209c7da4200f1 Mon Sep 17 00:00:00 2001 From: William French Date: Thu, 12 Sep 2024 10:57:07 -0700 Subject: [PATCH 5/8] Update .eleventy.js Updates dotenv to use import, then calls dotenv. --- .eleventy.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.eleventy.js b/.eleventy.js index c4dc4c416f..7c0de74661 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,4 +1,7 @@ -require("dotenv").config(); +//require("dotenv").config(); + +import { dotenv } from "dotenv"; +dotenv.config(); import { typescript } from "./src/engines/typescript/sample"; import { typescriptJSX } from "./src/engines/typescript/sample-jsx"; From 1dd0714a4b25c9b1f7c95cdeafd195617391046e Mon Sep 17 00:00:00 2001 From: William French Date: Thu, 12 Sep 2024 11:07:49 -0700 Subject: [PATCH 6/8] Update .eleventy.js updates require to import for event emitter --- .eleventy.js | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index 7c0de74661..76bfb9d2c9 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,5 +1,3 @@ -//require("dotenv").config(); - import { dotenv } from "dotenv"; dotenv.config(); @@ -17,20 +15,7 @@ import { path } from "path"; import { vite } from "vite"; import { chalk } from "chalk"; import { prettier } from "prettier"; -//const typescript = require("./src/engines/typescript/sample"); -//const typescriptJSX = require("./src/engines/typescript/sample-jsx"); -//const sass = require("./src/engines/sass"); -//const stripRegionTags = require("./src/transforms/strip-region-tags"); -//const stripLicenseHeaders = require("./src/transforms/strip-license-headers"); -//const yourAPIKey = require("./src/transforms/your-api-key"); -//const format = require("./src/transforms/format"); -//const minify = require("./src/transforms/minify"); -//const skypack = require("./src/transforms/skypack"); -//const fs = require("fs"); -//const path = require("path"); -//const vite = require("vite"); -//const chalk = require("chalk"); -//const prettier = require("prettier"); +import { EventEmitter } from "events"; module.exports = function (eleventyConfig) { eleventyConfig.addWatchTarget("./shared/**/*"); @@ -77,7 +62,8 @@ module.exports = function (eleventyConfig) { .map((d) => d.name); // remove warning https://stackoverflow.com/questions/8313628/node-js-request-how-to-emitter-setmaxlisteners - require("events").EventEmitter.defaultMaxListeners = samples.length * 2; + //require("events").EventEmitter.defaultMaxListeners = samples.length * 2; + EventEmitter.defaultMaxListeners = samples.length * 2; const inlinePlugin = { name: "vite:singlefile", From fb4ef5c4bcfdc1df65da50cddb1c8593b6ca8f10 Mon Sep 17 00:00:00 2001 From: William French Date: Thu, 12 Sep 2024 14:56:32 -0700 Subject: [PATCH 7/8] Update .eleventy.js restore to previous --- .eleventy.js | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index 76bfb9d2c9..3d336a43f5 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,21 +1,19 @@ -import { dotenv } from "dotenv"; -dotenv.config(); - -import { typescript } from "./src/engines/typescript/sample"; -import { typescriptJSX } from "./src/engines/typescript/sample-jsx"; -import { sass } from "./src/engines/sass"; -import { stripRegionTags } from "./src/transforms/strip-region-tags"; -import { stripLicenseHeaders } from "./src/transforms/strip-license-headers"; -import { yourAPIKey } from "./src/transforms/your-api-key"; -import { format } from "./src/transforms/format"; -import { minify } from "./src/transforms/minify"; -import { skypack } from "./src/transforms/minify"; -import { fs } from "fs"; -import { path } from "path"; -import { vite } from "vite"; -import { chalk } from "chalk"; -import { prettier } from "prettier"; -import { EventEmitter } from "events"; +require("dotenv").config(); + +const typescript = require("./src/engines/typescript/sample"); +const typescriptJSX = require("./src/engines/typescript/sample-jsx"); +const sass = require("./src/engines/sass"); +const stripRegionTags = require("./src/transforms/strip-region-tags"); +const stripLicenseHeaders = require("./src/transforms/strip-license-headers"); +const yourAPIKey = require("./src/transforms/your-api-key"); +const format = require("./src/transforms/format"); +const minify = require("./src/transforms/minify"); +const skypack = require("./src/transforms/skypack"); +const fs = require("fs"); +const path = require("path"); +const vite = require("vite"); +const chalk = require("chalk"); +const prettier = require("prettier"); module.exports = function (eleventyConfig) { eleventyConfig.addWatchTarget("./shared/**/*"); @@ -62,8 +60,7 @@ module.exports = function (eleventyConfig) { .map((d) => d.name); // remove warning https://stackoverflow.com/questions/8313628/node-js-request-how-to-emitter-setmaxlisteners - //require("events").EventEmitter.defaultMaxListeners = samples.length * 2; - EventEmitter.defaultMaxListeners = samples.length * 2; + require("events").EventEmitter.defaultMaxListeners = samples.length * 2; const inlinePlugin = { name: "vite:singlefile", From 0d72e4598f5e549b6f0e6d61cecbaa4a52d71a1d Mon Sep 17 00:00:00 2001 From: William French Date: Thu, 12 Sep 2024 15:00:35 -0700 Subject: [PATCH 8/8] Update package.json Moves google.maps manually to 3.58.0 --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 7173a8ad46..cbda09517d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "@googlemaps/js-samples", "description": "Samples for Google Maps JavaScript", "version": "2.1.4", - "type": "module", "keywords": [ "google", "javascript", @@ -48,7 +47,7 @@ "@googlemaps/three": "^4.0.13", "@playwright/test": "^1.44.0", "@types/geojson": "^7946.0.14", - "@types/google.maps": "^3.53.5", + "@types/google.maps": "^3.58.0", "@types/google.visualization": "0.0.73", "@types/jest": "^29.5.6", "@types/react": "^18.3.3",