From 6bdce5bcc858c2724c5009746c0f04ac012891e7 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 20 Aug 2024 12:56:54 +0100 Subject: [PATCH 1/2] Reapply "Add "type" = "module" to ensure it is present (#4350)" (#4352) This reverts commit 8214fd7156b2a8525a977e22bc400dcdb7aec7b1. --- scripts/release/pre-release.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/release/pre-release.sh b/scripts/release/pre-release.sh index 6b47ef180ff..19319fb6105 100755 --- a/scripts/release/pre-release.sh +++ b/scripts/release/pre-release.sh @@ -12,3 +12,6 @@ do jq ".$i = .matrix_lib_$i" package.json > package.json.new && mv package.json.new package.json && yarn prettier --write package.json fi done + +# Ensure that "type": "module" is present +jq '.type = "module"' package.json > package.json.new && mv package.json.new package.json && yarn prettier --write package.json From 2ca07fcd7662edd467ed9c4af8d7c5a589f72135 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 20 Aug 2024 12:58:12 +0100 Subject: [PATCH 2/2] Mark prettier config file as CommonJS I *think* this will fix a problem with the release process in which we saw an error: ``` Error: Invalid configuration for file "/home/runner/work/matrix-js-sdk/matrix-js-sdk/package.json": Error: module is not defined in ES module scope Error: This file is being treated as an ES module because it has a '.js' file extension and '/home/runner/work/matrix-js-sdk/matrix-js-sdk/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension. ``` --- .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