From 31d9f9bfc9db300a303e6605f9cb5f4ee981ed46 Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Thu, 19 Jun 2025 11:35:27 +0100 Subject: [PATCH 1/2] chore: Add type: "module" to package.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This means that .js files will by default be interpreted as ESM rather than CJS—which is correct, since almost all our source files are in fact ES modules using import. This allows removal of test/webdriverio/test/package.json, which was preventing npm scripts (e.g. "npm test") from working properly in that directory. A few config files that do in fact use require() are renamed to .cjs to ensure they are correctly interpreted. --- eslint.config.js => eslint.config.cjs | 0 package.json | 1 + test/webdriverio/{.mocharc.js => .mocharc.cjs} | 0 test/webdriverio/test/package.json | 3 --- test/webdriverio/{webpack.config.js => webpack.config.cjs} | 0 webpack.config.js => webpack.config.cjs | 0 6 files changed, 1 insertion(+), 3 deletions(-) rename eslint.config.js => eslint.config.cjs (100%) rename test/webdriverio/{.mocharc.js => .mocharc.cjs} (100%) delete mode 100644 test/webdriverio/test/package.json rename test/webdriverio/{webpack.config.js => webpack.config.cjs} (100%) rename webpack.config.js => webpack.config.cjs (100%) diff --git a/eslint.config.js b/eslint.config.cjs similarity index 100% rename from eslint.config.js rename to eslint.config.cjs diff --git a/package.json b/package.json index 5d706f41..1b4e02f8 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "wdio:clean": "cd test/webdriverio/test && rm -rf dist", "wdio:run": "npm run wdio:build && cd test/webdriverio/test && npx mocha dist" }, + "type": "module", "main": "./dist/index.js", "module": "./src/index.js", "unpkg": "./dist/index.js", diff --git a/test/webdriverio/.mocharc.js b/test/webdriverio/.mocharc.cjs similarity index 100% rename from test/webdriverio/.mocharc.js rename to test/webdriverio/.mocharc.cjs diff --git a/test/webdriverio/test/package.json b/test/webdriverio/test/package.json deleted file mode 100644 index 3dbc1ca5..00000000 --- a/test/webdriverio/test/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} diff --git a/test/webdriverio/webpack.config.js b/test/webdriverio/webpack.config.cjs similarity index 100% rename from test/webdriverio/webpack.config.js rename to test/webdriverio/webpack.config.cjs diff --git a/webpack.config.js b/webpack.config.cjs similarity index 100% rename from webpack.config.js rename to webpack.config.cjs From 46ecc69ac4b3c2d8f72d47e48fe66b61f0c11a88 Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Thu, 19 Jun 2025 11:45:29 +0100 Subject: [PATCH 2/2] chore: Rename .prettierrc.js -> .cjs --- .prettierrc.js => .prettierrc.cjs | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .prettierrc.js => .prettierrc.cjs (100%) diff --git a/.prettierrc.js b/.prettierrc.cjs similarity index 100% rename from .prettierrc.js rename to .prettierrc.cjs