From 71152adf47ae0c7a949d900143318b58a2fdc1fa Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Thu, 8 Dec 2022 15:35:27 +0100 Subject: [PATCH 1/2] Bump build target to es2020 --- CHANGELOG.md | 2 ++ tsconfig.json | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22812b16..1930a3ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ and this project adheres to the end of 2022. Then all potential issues should be fixed. - `fromJSON`/`toJSON` are not generated anymore. They were never needed for CosmJS and do not produce a Cosmos SDK compatible JSON. +- The TypeScript build target is now ES2020, + [analogue to CosmJS 0.30](https://github.com/cosmos/cosmjs/issues/1002). ## [0.5.2] - 2022-10-11 diff --git a/tsconfig.json b/tsconfig.json index 5f1b7759..400671eb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "declaration": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, - "lib": ["es2018"], + "lib": ["es2020"], "module": "commonjs", "moduleResolution": "node", "newLine": "LF", @@ -20,7 +20,7 @@ "rootDir": "src", "sourceMap": true, "strict": true, - "target": "es2018" + "target": "es2020" }, "include": ["src/**/*"] } From 25f484443fb09b2e70c3435fbaf0843a0ab57e6b Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Thu, 8 Dec 2022 15:35:35 +0100 Subject: [PATCH 2/2] Add note on comment output --- tsconfig.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tsconfig.json b/tsconfig.json index 400671eb..8769788b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,6 +15,9 @@ "noUnusedParameters": false, "outDir": "build", "pretty": true, + // We want comments in the .d.ts files. TS does not allow us to remove comments + // from .js output only (https://github.com/microsoft/TypeScript/issues/45187, https://github.com/microsoft/TypeScript/issues/13318). + // So minifiers have to strip them off later on. "removeComments": false, "resolveJsonModule": true, "rootDir": "src",