From 85aee1f5c31c84ba40aef763ed08ff6418d33601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Harrtell?= Date: Mon, 6 Feb 2023 22:10:20 +0100 Subject: [PATCH] Simplify and fix TypeScript compilation output (#7815) * Simplify and fix TypeScript compilation output * Revert deps upgrade --- package.json | 12 ------------ tests/ts/TypeScriptTest.py | 4 +++- tsconfig.json | 4 ++-- tsconfig.mjs.json | 4 ++-- yarn.lock | 2 +- 5 files changed, 8 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 7fcc40a2b6a..4431df775e5 100644 --- a/package.json +++ b/package.json @@ -11,18 +11,6 @@ ], "main": "js/flatbuffers.js", "module": "mjs/flatbuffers.js", - "exports": { - ".": { - "node": { - "import": "./mjs/flatbuffers.js", - "require": "./js/flatbuffers.js" - }, - "default": "./js/flatbuffers.js" - }, - "./js/flexbuffers.js": { - "default": "./js/flexbuffers.js" - } - }, "directories": { "doc": "docs", "test": "tests" diff --git a/tests/ts/TypeScriptTest.py b/tests/ts/TypeScriptTest.py index de607983eae..ae357ef09c4 100755 --- a/tests/ts/TypeScriptTest.py +++ b/tests/ts/TypeScriptTest.py @@ -126,7 +126,9 @@ def esbuild(input, output): print("Running TypeScript Tests...") check_call(NODE_CMD + ["JavaScriptTest"]) -check_call(NODE_CMD + ["JavaScriptTestv1.cjs", "./monster_test_generated.cjs"]) check_call(NODE_CMD + ["JavaScriptUnionVectorTest"]) check_call(NODE_CMD + ["JavaScriptFlexBuffersTest"]) check_call(NODE_CMD + ["JavaScriptComplexArraysTest"]) + +print("Running old v1 TypeScript Tests...") +check_call(NODE_CMD + ["JavaScriptTestv1.cjs", "./monster_test_generated.cjs"]) diff --git a/tsconfig.json b/tsconfig.json index 1636255e792..a8c89f5ad00 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "target": "ES2020", - "module": "CommonJS", + "target": "es2020", + "module": "commonjs", "lib": ["ES2020", "DOM"], "declaration": true, "outDir": "./js", diff --git a/tsconfig.mjs.json b/tsconfig.mjs.json index 4c58d849252..20adaa38bbb 100644 --- a/tsconfig.mjs.json +++ b/tsconfig.mjs.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "target": "ES2020", - "module": "NodeNext", + "target": "es2020", + "module": "es2020", "lib": ["ES2020", "DOM"], "declaration": true, "outDir": "./mjs", diff --git a/yarn.lock b/yarn.lock index 0150fa9813e..8b806a54439 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1169,4 +1169,4 @@ yallist@^4.0.0: yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== \ No newline at end of file