From d4e4992714b5f91d55dc52a88775bf8932309fb5 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Wed, 4 Oct 2023 12:55:51 +0700 Subject: [PATCH] chore(common): cleanup final Typescript non-ESM metadata Fixes #9262. --- common/models/templates/package.json | 4 +- common/models/wordbreakers/package.json | 3 +- common/predictive-text/testing/index.html | 28 -------- .../one-stage-embedded-webworker/.gitignore | 2 - .../one-stage-embedded-webworker/build.sh | 54 -------------- .../one-stage-embedded-webworker/index.html | 42 ----------- .../one-stage-embedded-webworker/main.ts | 52 -------------- .../tsconfig.json | 13 ---- .../post-blob-webworker/canaryWorker.js | 5 -- .../testing/post-blob-webworker/index.html | 72 ------------------- .../testing/simple-webworker/canaryWorker.js | 9 --- .../testing/simple-webworker/index.html | 55 -------------- .../two-stage-embedded-webworker/.gitignore | 2 - .../two-stage-embedded-webworker/build.sh | 68 ------------------ .../two-stage-embedded-webworker/index.html | 42 ----------- .../two-stage-embedded-webworker/main.ts | 30 -------- .../tsconfig.json | 13 ---- .../worker/canaryWorker.ts | 9 --- .../worker/tsconfig.json | 11 --- common/tools/hextobin/tsconfig.json | 2 +- .../sourcemap-path-remapper/tsconfig.json | 3 +- common/web/es-bundling/tsconfig.json | 2 +- common/web/keyman-version/tsconfig.json | 2 +- common/web/lm-message-types/tsconfig.json | 2 +- common/web/sentry-manager/src/tsconfig.json | 3 +- common/web/types/test/tsconfig.json | 2 +- common/web/types/tsconfig.json | 2 +- core/include/ldml/tsconfig.build.json | 2 +- core/include/ldml/tsconfig.json | 4 +- .../src/common/web/test-helpers/tsconfig.json | 2 +- developer/src/kmc-analyze/tsconfig.json | 2 +- .../src/kmc-keyboard-info/test/tsconfig.json | 1 - developer/src/kmc-kmn/tsconfig.json | 2 +- developer/src/kmc-ldml/tsconfig.json | 2 +- .../src/kmc-model-info/test/tsconfig.json | 1 - developer/src/kmc-model/test/tsconfig.json | 1 - developer/src/kmc/tsconfig.kmc-base.json | 2 +- developer/src/server/tsconfig.json | 2 +- resources/build/version/tsconfig.json | 2 +- tsconfig-base.json => tsconfig.base.json | 15 ++++ tsconfig.cjs.json | 12 ---- tsconfig.esm-base.json | 24 ------- tsconfig.esm.json => tsconfig.json | 44 +++++------- web/tsconfig.base.json | 3 +- 44 files changed, 53 insertions(+), 600 deletions(-) delete mode 100644 common/predictive-text/testing/index.html delete mode 100644 common/predictive-text/testing/one-stage-embedded-webworker/.gitignore delete mode 100755 common/predictive-text/testing/one-stage-embedded-webworker/build.sh delete mode 100644 common/predictive-text/testing/one-stage-embedded-webworker/index.html delete mode 100644 common/predictive-text/testing/one-stage-embedded-webworker/main.ts delete mode 100644 common/predictive-text/testing/one-stage-embedded-webworker/tsconfig.json delete mode 100644 common/predictive-text/testing/post-blob-webworker/canaryWorker.js delete mode 100644 common/predictive-text/testing/post-blob-webworker/index.html delete mode 100644 common/predictive-text/testing/simple-webworker/canaryWorker.js delete mode 100644 common/predictive-text/testing/simple-webworker/index.html delete mode 100644 common/predictive-text/testing/two-stage-embedded-webworker/.gitignore delete mode 100755 common/predictive-text/testing/two-stage-embedded-webworker/build.sh delete mode 100644 common/predictive-text/testing/two-stage-embedded-webworker/index.html delete mode 100644 common/predictive-text/testing/two-stage-embedded-webworker/main.ts delete mode 100644 common/predictive-text/testing/two-stage-embedded-webworker/tsconfig.json delete mode 100644 common/predictive-text/testing/two-stage-embedded-webworker/worker/canaryWorker.ts delete mode 100644 common/predictive-text/testing/two-stage-embedded-webworker/worker/tsconfig.json rename tsconfig-base.json => tsconfig.base.json (65%) delete mode 100644 tsconfig.cjs.json delete mode 100644 tsconfig.esm-base.json rename tsconfig.esm.json => tsconfig.json (87%) diff --git a/common/models/templates/package.json b/common/models/templates/package.json index 0bec0fc88f..33f89cca70 100644 --- a/common/models/templates/package.json +++ b/common/models/templates/package.json @@ -21,9 +21,7 @@ "exports": { ".": "./build/obj/index.js", "./lib": { - "types": "./build/lib/index.d.ts", - "import": "./build/lib/index.mjs", - "require": "./build/lib/index.cjs" + "types": "./build/lib/index.d.ts" }, "./obj/*.js": "./build/obj/*.js" }, diff --git a/common/models/wordbreakers/package.json b/common/models/wordbreakers/package.json index bd8d0157fb..7a03dc9e8f 100644 --- a/common/models/wordbreakers/package.json +++ b/common/models/wordbreakers/package.json @@ -19,8 +19,7 @@ "exports": { ".": "./build/obj/index.js", "./lib": { - "import": "./build/lib/index.mjs", - "require": "./build/lib/index.cjs" + "types": "./build/lib/index.d.ts" }, "./obj/*.js": "./build/obj/*.js" }, diff --git a/common/predictive-text/testing/index.html b/common/predictive-text/testing/index.html deleted file mode 100644 index 8a00094b70..0000000000 --- a/common/predictive-text/testing/index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - LMLayer Testing - - - -

Language-Modeling Layer module testing

-

A simple basic WebWorker.

Designed as a baseline functionality test we can run against various platforms as a first-stage canary of sorts. -

An embedded WebWorker prototype.

A prototype for directly embedding a WebWorker's code within a "master" script. -

A better embedded WebWorker prototype.

A prototype for two-stage compilation of a master/slave main-script/WebWorker pair. -

Sending code via a Blob URI

A prototype for sending code over to a WebWorker via a Blob URI reference. - - diff --git a/common/predictive-text/testing/one-stage-embedded-webworker/.gitignore b/common/predictive-text/testing/one-stage-embedded-webworker/.gitignore deleted file mode 100644 index df6361deda..0000000000 --- a/common/predictive-text/testing/one-stage-embedded-webworker/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -main.js -main.js.map \ No newline at end of file diff --git a/common/predictive-text/testing/one-stage-embedded-webworker/build.sh b/common/predictive-text/testing/one-stage-embedded-webworker/build.sh deleted file mode 100755 index f1f727b8c0..0000000000 --- a/common/predictive-text/testing/one-stage-embedded-webworker/build.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env bash -# -# Compiles the Language Modeling Layer for common use in predictive text and autocorrective applications. -# Designed for optimal compatibility with the Keyman Suite. -# - -## START STANDARD BUILD SCRIPT INCLUDE -# adjust relative paths as necessary -THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" -. "${THIS_SCRIPT%/*}/../../../../resources/build/build-utils.sh" -. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" -## END STANDARD BUILD SCRIPT INCLUDE - -display_usage ( ) { - echo "build.sh [-clean]" - echo - echo " -clean to erase pre-existing build products before a re-build" -} - -SOURCE="testing/one-stage-embedded-webworker" - -echo "Node.js + dependencies check" -npm install --no-optional - -if [ $? -ne 0 ]; then - builder_die "Build environment setup error detected! Please ensure Node.js is installed!" -fi - -# A nice, extensible method for -clean operations. Add to this as necessary. -clean ( ) { - rm -rf "./*.js" - if [ $? -ne 0 ]; then - builder_die "Failed to erase the prior build." - fi -} - -# Process command-line arguments -while [[ $# -gt 0 ]] ; do - key="$1" - case $key in - -clean) - clean - ;; - esac - shift # past the processed argument -done - -npm run tsc -- -p $SOURCE/tsconfig.json - -if [ $? -ne 0 ]; then - builder_die "Compilation failed." -fi - -echo "Typescript compilation successful." \ No newline at end of file diff --git a/common/predictive-text/testing/one-stage-embedded-webworker/index.html b/common/predictive-text/testing/one-stage-embedded-webworker/index.html deleted file mode 100644 index 244f4aa283..0000000000 --- a/common/predictive-text/testing/one-stage-embedded-webworker/index.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - Embedded WebWorker test - - - - - - - - - -

LM Layer Testing - One-Stage Embedded WebWorkers

-

This page serves as a prototype for embedding a WebWorker's code within its "master" script - across the TypeScript transpilation boundary.

-
- - - -

Return to testing home page

- - diff --git a/common/predictive-text/testing/one-stage-embedded-webworker/main.ts b/common/predictive-text/testing/one-stage-embedded-webworker/main.ts deleted file mode 100644 index 5d15ae88b5..0000000000 --- a/common/predictive-text/testing/one-stage-embedded-webworker/main.ts +++ /dev/null @@ -1,52 +0,0 @@ -// Useful for passing class constructors -type Workable = { - new (...args: any[]): T; - // Requires a static implementation. - onmessage(e: any): void; -}; - -class A { - a(x: number, y: number):number { - return x + y; - } -} - -var WorkerGlobals = { - counter: 0, - a: A -} - -class WorkerCore { - static WorkerGlobals = WorkerGlobals; - //static counter: number; - - static onmessage(e: any) { - WorkerGlobals.counter++; - - console.log("Message received from main page: ", e.data); - - // Forces TypeScript to interpret this line as plain JavaScript, as it uses a non-Worker definition. - // @ts-ignore - postMessage(WorkerGlobals.counter); - } -} - -function createWorkerFromClasses(globals: object, fn: Workable): Worker { - var sep = ";\n"; - let glb = "var WorkerGlobals = " + JSON.stringify(globals); - let wc = "var onmessage = " + fn.onmessage.toString(); - var blob = new Blob([glb, sep, wc], { type: 'text/javascript' }); - let url = URL.createObjectURL(blob); - - return new Worker(url); -} - -var canaryWorker = createWorkerFromClasses(WorkerGlobals, WorkerCore); - -canaryWorker.onmessage = function(e) { - var counter = e.data; // Number of times the WebWorker has been messaged. - console.log("Received message from the WebWorker: " + e.data); - - var txtFeedback = document.getElementById("txtFeedback"); - txtFeedback.value = counter + " click(s)"; -} diff --git a/common/predictive-text/testing/one-stage-embedded-webworker/tsconfig.json b/common/predictive-text/testing/one-stage-embedded-webworker/tsconfig.json deleted file mode 100644 index f1e9be8600..0000000000 --- a/common/predictive-text/testing/one-stage-embedded-webworker/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "allowJs": false, - "module": "none", - "outDir": "./", - "inlineSources": true, - "sourceMap": true, - "target": "es5" - }, - "files" : [ - "main.ts" - ] -} diff --git a/common/predictive-text/testing/post-blob-webworker/canaryWorker.js b/common/predictive-text/testing/post-blob-webworker/canaryWorker.js deleted file mode 100644 index 5c69deace8..0000000000 --- a/common/predictive-text/testing/post-blob-webworker/canaryWorker.js +++ /dev/null @@ -1,5 +0,0 @@ -// receive a message and execute its uri -onmessage = function (e) { - let uri = e.data.uri; - importScripts(uri); -}; diff --git a/common/predictive-text/testing/post-blob-webworker/index.html b/common/predictive-text/testing/post-blob-webworker/index.html deleted file mode 100644 index a04b6be377..0000000000 --- a/common/predictive-text/testing/post-blob-webworker/index.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - Blob URI test - - - - - - - - - -

LM Layer Testing - Sending a function to a WebWorker via a Blob URI test

-

This page sends a function over to the Worker via a Blob URI, and - expects the function to reply back. -

-
- - - -

Return to testing home page

- - diff --git a/common/predictive-text/testing/simple-webworker/canaryWorker.js b/common/predictive-text/testing/simple-webworker/canaryWorker.js deleted file mode 100644 index cf8674d330..0000000000 --- a/common/predictive-text/testing/simple-webworker/canaryWorker.js +++ /dev/null @@ -1,9 +0,0 @@ -var counter = 0; - -onmessage = function(e) { - counter++; - - console.log("Message received from main page: ", e.data); - - postMessage(counter); -} \ No newline at end of file diff --git a/common/predictive-text/testing/simple-webworker/index.html b/common/predictive-text/testing/simple-webworker/index.html deleted file mode 100644 index adbcd30d3e..0000000000 --- a/common/predictive-text/testing/simple-webworker/index.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - Basic WebWorker test - - - - - - - - - -

LM Layer Testing - basic WebWorker canary

-

This page uses a simple WebWorker useful for ensuring functionality on various platforms.

-
- - - -

Return to testing home page

- - diff --git a/common/predictive-text/testing/two-stage-embedded-webworker/.gitignore b/common/predictive-text/testing/two-stage-embedded-webworker/.gitignore deleted file mode 100644 index 20efd1ec83..0000000000 --- a/common/predictive-text/testing/two-stage-embedded-webworker/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -**/*.js -**/*.js.map \ No newline at end of file diff --git a/common/predictive-text/testing/two-stage-embedded-webworker/build.sh b/common/predictive-text/testing/two-stage-embedded-webworker/build.sh deleted file mode 100755 index dd1854ec00..0000000000 --- a/common/predictive-text/testing/two-stage-embedded-webworker/build.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bash -# -# Compiles the Language Modeling Layer for common use in predictive text and autocorrective applications. -# Designed for optimal compatibility with the Keyman Suite. -# - -## START STANDARD BUILD SCRIPT INCLUDE -# adjust relative paths as necessary -THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" -. "${THIS_SCRIPT%/*}/../../../../resources/build/build-utils.sh" -. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" -## END STANDARD BUILD SCRIPT INCLUDE - -display_usage ( ) { - echo "build.sh [-clean]" - echo - echo " -clean to erase pre-existing build products before a re-build" -} - -SOURCE="testing/two-stage-embedded-webworker" - -COMPILED_WORKER="worker.js" -EMBEDDED_WORKER="embedded_worker.js" - -echo "Node.js + dependencies check" -npm install --no-optional - -if [ $? -ne 0 ]; then - builder_die "Build environment setup error detected! Please ensure Node.js is installed!" -fi - -# A nice, extensible method for -clean operations. Add to this as necessary. -clean ( ) { - rm -rf "./*.js" - if [ $? -ne 0 ]; then - builder_die "Failed to erase the prior build." - fi -} - -# Process command-line arguments -while [[ $# -gt 0 ]] ; do - key="$1" - case $key in - -clean) - clean - ;; - esac - shift # past the processed argument -done - -npm run tsc -- -p $SOURCE/worker/tsconfig.json -if [ $? -ne 0 ]; then - builder_die "Worker compilation failed." -fi - -rm $EMBEDDED_WORKER &> /dev/null - -echo "var LMLayerWorker = function() {" >> $EMBEDDED_WORKER -cat $COMPILED_WORKER >> $EMBEDDED_WORKER -echo "" >> $EMBEDDED_WORKER -echo "}" >> $EMBEDDED_WORKER - -npm run tsc -- -p $SOURCE/tsconfig.json -if [ $? -ne 0 ]; then - builder_die "Final compilation failed." -fi - -echo "Typescript compilation successful." \ No newline at end of file diff --git a/common/predictive-text/testing/two-stage-embedded-webworker/index.html b/common/predictive-text/testing/two-stage-embedded-webworker/index.html deleted file mode 100644 index 244f4aa283..0000000000 --- a/common/predictive-text/testing/two-stage-embedded-webworker/index.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - Embedded WebWorker test - - - - - - - - - -

LM Layer Testing - One-Stage Embedded WebWorkers

-

This page serves as a prototype for embedding a WebWorker's code within its "master" script - across the TypeScript transpilation boundary.

-
- - - -

Return to testing home page

- - diff --git a/common/predictive-text/testing/two-stage-embedded-webworker/main.ts b/common/predictive-text/testing/two-stage-embedded-webworker/main.ts deleted file mode 100644 index 9eb276d379..0000000000 --- a/common/predictive-text/testing/two-stage-embedded-webworker/main.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Provides the final source for our compiled WebWorker within a wrapping function. -/// - -function createWorker(fn: Function): Worker { - var str_fn = fn.toString(); - - // We now unwrap our WebWorker from its function. - var str_lines = str_fn.split("\n"); - var blob_lines = [] - - for(var i=1; i < str_lines.length -1; i++) { - blob_lines.push(str_lines[i] + "\n"); - } - // Unwrapping complete. - - var blob = new Blob(blob_lines, { type: 'text/javascript' }); - let url = URL.createObjectURL(blob); - - return new Worker(url); -} - -var canaryWorker = createWorker(LMLayerWorker); - -canaryWorker.onmessage = function(e) { - var counter = e.data; // Number of times the WebWorker has been messaged. - console.log("Received message from the WebWorker: " + e.data); - - var txtFeedback = document.getElementById("txtFeedback"); - txtFeedback.value = counter + " click(s)"; -} diff --git a/common/predictive-text/testing/two-stage-embedded-webworker/tsconfig.json b/common/predictive-text/testing/two-stage-embedded-webworker/tsconfig.json deleted file mode 100644 index a25930a70e..0000000000 --- a/common/predictive-text/testing/two-stage-embedded-webworker/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "allowJs": true, - "module": "none", - "outFile": "./main.js", - "inlineSources": true, - "inlineSourceMap": true, - "target": "es5" - }, - "files" : [ - "main.ts" - ] -} diff --git a/common/predictive-text/testing/two-stage-embedded-webworker/worker/canaryWorker.ts b/common/predictive-text/testing/two-stage-embedded-webworker/worker/canaryWorker.ts deleted file mode 100644 index cf8674d330..0000000000 --- a/common/predictive-text/testing/two-stage-embedded-webworker/worker/canaryWorker.ts +++ /dev/null @@ -1,9 +0,0 @@ -var counter = 0; - -onmessage = function(e) { - counter++; - - console.log("Message received from main page: ", e.data); - - postMessage(counter); -} \ No newline at end of file diff --git a/common/predictive-text/testing/two-stage-embedded-webworker/worker/tsconfig.json b/common/predictive-text/testing/two-stage-embedded-webworker/worker/tsconfig.json deleted file mode 100644 index ca8006ba44..0000000000 --- a/common/predictive-text/testing/two-stage-embedded-webworker/worker/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "allowJs": false, - "module": "none", - "outFile": "../worker.js", - "inlineSources": true, - "sourceMap": true, - "lib": ["webworker", "es6"], - "target": "es5" - } -} diff --git a/common/tools/hextobin/tsconfig.json b/common/tools/hextobin/tsconfig.json index db0a65ae9d..55e3f66308 100644 --- a/common/tools/hextobin/tsconfig.json +++ b/common/tools/hextobin/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.esm-base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "rootDir": ".", "outDir": "build/" diff --git a/common/tools/sourcemap-path-remapper/tsconfig.json b/common/tools/sourcemap-path-remapper/tsconfig.json index f9b531b311..72809897bd 100644 --- a/common/tools/sourcemap-path-remapper/tsconfig.json +++ b/common/tools/sourcemap-path-remapper/tsconfig.json @@ -1,12 +1,11 @@ { - "extends": "../../../tsconfig-base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "allowJs": false, "allowSyntheticDefaultImports": true, "declaration": true, "module": "es6", - "moduleResolution": "node", "inlineSourceMap": true, "inlineSources": true, "sourceRoot": "/common/tools/sourcemap-path-remapper/src", diff --git a/common/web/es-bundling/tsconfig.json b/common/web/es-bundling/tsconfig.json index d2ab738acf..a5149b51c6 100644 --- a/common/web/es-bundling/tsconfig.json +++ b/common/web/es-bundling/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.esm-base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "baseUrl": "./", "outDir": "build/", diff --git a/common/web/keyman-version/tsconfig.json b/common/web/keyman-version/tsconfig.json index 03478f6021..0712c03f75 100644 --- a/common/web/keyman-version/tsconfig.json +++ b/common/web/keyman-version/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.esm-base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "outDir": "./build", diff --git a/common/web/lm-message-types/tsconfig.json b/common/web/lm-message-types/tsconfig.json index 124def350d..f9d427f0bf 100644 --- a/common/web/lm-message-types/tsconfig.json +++ b/common/web/lm-message-types/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig-base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "declaration": true, "module": "none", diff --git a/common/web/sentry-manager/src/tsconfig.json b/common/web/sentry-manager/src/tsconfig.json index 490c315dc9..f42eaea73b 100644 --- a/common/web/sentry-manager/src/tsconfig.json +++ b/common/web/sentry-manager/src/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../tsconfig-base.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { "allowJs": true, "allowSyntheticDefaultImports": true, @@ -7,7 +7,6 @@ "inlineSources": true, "lib": ["es6", "dom"], "module": "es6", - "moduleResolution": "Node16", "outDir": "../build/obj", "rootDir": "./", "sourceMap": true, diff --git a/common/web/types/test/tsconfig.json b/common/web/types/test/tsconfig.json index c522129c99..ee468c7fbd 100644 --- a/common/web/types/test/tsconfig.json +++ b/common/web/types/test/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../tsconfig.esm-base.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { "rootDir": ".", diff --git a/common/web/types/tsconfig.json b/common/web/types/tsconfig.json index 5059030c0f..730244e67c 100644 --- a/common/web/types/tsconfig.json +++ b/common/web/types/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.esm-base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "outDir": "build/src/", diff --git a/core/include/ldml/tsconfig.build.json b/core/include/ldml/tsconfig.build.json index 17c809a857..fd0f003272 100644 --- a/core/include/ldml/tsconfig.build.json +++ b/core/include/ldml/tsconfig.build.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.esm-base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "composite": true, "declaration": true, diff --git a/core/include/ldml/tsconfig.json b/core/include/ldml/tsconfig.json index b89c96a018..fa4135b021 100644 --- a/core/include/ldml/tsconfig.json +++ b/core/include/ldml/tsconfig.json @@ -1,10 +1,8 @@ { - "extends": "../../../tsconfig-base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "composite": true, "declaration": true, - "module": "es2020", - "moduleResolution": "node", "rootDir": ".", "outDir": "build/", }, diff --git a/developer/src/common/web/test-helpers/tsconfig.json b/developer/src/common/web/test-helpers/tsconfig.json index 47646be3a6..d7089c703f 100644 --- a/developer/src/common/web/test-helpers/tsconfig.json +++ b/developer/src/common/web/test-helpers/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../../tsconfig.esm-base.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { "rootDir": ".", diff --git a/developer/src/kmc-analyze/tsconfig.json b/developer/src/kmc-analyze/tsconfig.json index 3a9149e121..987abd3cc3 100644 --- a/developer/src/kmc-analyze/tsconfig.json +++ b/developer/src/kmc-analyze/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.esm-base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "outDir": "build/src/", diff --git a/developer/src/kmc-keyboard-info/test/tsconfig.json b/developer/src/kmc-keyboard-info/test/tsconfig.json index bf96b7b150..6d48ad864d 100644 --- a/developer/src/kmc-keyboard-info/test/tsconfig.json +++ b/developer/src/kmc-keyboard-info/test/tsconfig.json @@ -6,7 +6,6 @@ "rootDirs": ["./", "../src/"], "outDir": "../build/test", "esModuleInterop": true, - "moduleResolution": "node16", "allowSyntheticDefaultImports": true, "baseUrl": ".", "paths": { diff --git a/developer/src/kmc-kmn/tsconfig.json b/developer/src/kmc-kmn/tsconfig.json index 04683902ea..4210b750af 100644 --- a/developer/src/kmc-kmn/tsconfig.json +++ b/developer/src/kmc-kmn/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.esm-base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "outDir": "build/src/", diff --git a/developer/src/kmc-ldml/tsconfig.json b/developer/src/kmc-ldml/tsconfig.json index c9ec649b40..fdcf5fd82b 100644 --- a/developer/src/kmc-ldml/tsconfig.json +++ b/developer/src/kmc-ldml/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.esm-base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "outDir": "build/src/", diff --git a/developer/src/kmc-model-info/test/tsconfig.json b/developer/src/kmc-model-info/test/tsconfig.json index bf96b7b150..6d48ad864d 100644 --- a/developer/src/kmc-model-info/test/tsconfig.json +++ b/developer/src/kmc-model-info/test/tsconfig.json @@ -6,7 +6,6 @@ "rootDirs": ["./", "../src/"], "outDir": "../build/test", "esModuleInterop": true, - "moduleResolution": "node16", "allowSyntheticDefaultImports": true, "baseUrl": ".", "paths": { diff --git a/developer/src/kmc-model/test/tsconfig.json b/developer/src/kmc-model/test/tsconfig.json index 3902bed57f..0917ea186a 100644 --- a/developer/src/kmc-model/test/tsconfig.json +++ b/developer/src/kmc-model/test/tsconfig.json @@ -6,7 +6,6 @@ "rootDirs": ["./", "../src/"], "outDir": "../build/test", "esModuleInterop": true, - "moduleResolution": "node16", "allowSyntheticDefaultImports": true, "baseUrl": ".", "paths": { diff --git a/developer/src/kmc/tsconfig.kmc-base.json b/developer/src/kmc/tsconfig.kmc-base.json index f8cff50b3f..6956b6e05d 100644 --- a/developer/src/kmc/tsconfig.kmc-base.json +++ b/developer/src/kmc/tsconfig.kmc-base.json @@ -1,3 +1,3 @@ { - "extends": "../../../tsconfig.esm-base.json", + "extends": "../../../tsconfig.base.json", } diff --git a/developer/src/server/tsconfig.json b/developer/src/server/tsconfig.json index 701a97af6c..e5adde9578 100644 --- a/developer/src/server/tsconfig.json +++ b/developer/src/server/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.esm-base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "target": "es2022", diff --git a/resources/build/version/tsconfig.json b/resources/build/version/tsconfig.json index 9f537c799d..2d99762ca9 100644 --- a/resources/build/version/tsconfig.json +++ b/resources/build/version/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.esm-base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "rootDir": ".", "outDir": "build/", diff --git a/tsconfig-base.json b/tsconfig.base.json similarity index 65% rename from tsconfig-base.json rename to tsconfig.base.json index 8e3eafb6cf..2c56fd7079 100644 --- a/tsconfig-base.json +++ b/tsconfig.base.json @@ -1,5 +1,18 @@ { "compilerOptions": { + "module": "ES2022", + "target": "es2022", + "moduleResolution": "node16", + "forceConsistentCasingInFileNames": true, + "sourceMap": true, + "alwaysStrict": true, + "noImplicitThis": true, + "noImplicitReturns": true, + "noImplicitAny": true, + "strictBindCallApply": true, + "strictFunctionTypes": true, + "noUnusedLocals": true, + "rootDir": ".", // TODO: move all compiler options here @@ -9,7 +22,9 @@ "declarationMap": true, "baseUrl": ".", + "paths": { + "@keymanapp/common-types": ["./common/web/types/src/main"], "@keymanapp/input-processor": ["./common/web/input-processor/src"], "@keymanapp/keyboard-processor": ["./common/web/keyboard-processor/src"], "@keymanapp/keyman": ["./web" ], diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json deleted file mode 100644 index 701d06ce3b..0000000000 --- a/tsconfig.cjs.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - // Lists only CommonJS or 'none' modules; as we move modules from cjs/none to - // esm, we should move them from here into tsconfig.esm.json. Eventually, when - // we have only ES modules, we'll delete this file. - "files": [], - "include": [], - "references": [ - { "path": "./common/predictive-text/testing/one-stage-embedded-webworker/tsconfig.json" }, - { "path": "./common/predictive-text/testing/two-stage-embedded-webworker/tsconfig.json" }, - { "path": "./common/predictive-text/testing/two-stage-embedded-webworker/worker/tsconfig.json" }, - ] -} \ No newline at end of file diff --git a/tsconfig.esm-base.json b/tsconfig.esm-base.json deleted file mode 100644 index d17d505e5c..0000000000 --- a/tsconfig.esm-base.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": "./tsconfig-base.json", - - "compilerOptions": { - "module": "ES2022", - "target": "es2022", - "moduleResolution": "Node16", - "forceConsistentCasingInFileNames": true, - "sourceMap": true, - "alwaysStrict": true, - "noImplicitThis": true, - "noImplicitReturns": true, - "noImplicitAny": true, - "strictBindCallApply": true, - "strictFunctionTypes": true, - "noUnusedLocals": true, - - "paths": { - "@keymanapp/keyman-version": ["./common/web/keyman-version/keyman-version.mts"], - "@keymanapp/common-types": ["./common/web/types/src/main"], - // "@keymanapp/": ["core/include/ldml/ldml-keyboard-constants"], - }, - }, -} diff --git a/tsconfig.esm.json b/tsconfig.json similarity index 87% rename from tsconfig.esm.json rename to tsconfig.json index 0252447c63..497bcf7344 100644 --- a/tsconfig.esm.json +++ b/tsconfig.json @@ -1,19 +1,28 @@ { - // Lists only ES modules; as we move modules from cjs/none to esm, we should - // move them from tsconfig.cjs.json to here. Eventually, when we have only ES - // modules, we can rename this to tsconfig.json. - "files": [], - "include": [], "references": [ { "path": "./core/include/ldml/tsconfig.json" }, - //{ "path": "./developer/src/kmc/test/tsconfig.json" }, + { "path": "./common/models/templates/tsconfig.json" }, + { "path": "./common/models/types/tsconfig.json" }, + { "path": "./common/models/wordbreakers/tsconfig.json" }, + { "path": "./common/predictive-text/tsconfig.json" }, + { "path": "./common/tools/hextobin/" }, + { "path": "./common/web/input-processor/tsconfig.json" }, + { "path": "./common/web/keyboard-processor/tsconfig.json" }, + { "path": "./common/web/keyman-version" }, + { "path": "./common/web/lm-message-types/" }, + { "path": "./common/web/lm-worker/" }, + { "path": "./common/web/recorder/tsconfig.json" }, + { "path": "./common/web/sentry-manager/src/tsconfig.json" }, + { "path": "./common/web/types/" }, + { "path": "./common/web/utils/tsconfig.json" }, + { "path": "./developer/src/common/web/test-helpers/tsconfig.json" }, { "path": "./developer/src/kmc/tsconfig.json" }, - - // { "path": "./developer/src/kmc-analyze/test/tsconfig.json" }, + { "path": "./developer/src/kmc/test/tsconfig.json" }, { "path": "./developer/src/kmc-analyze/tsconfig.json" }, + // { "path": "./developer/src/kmc-analyze/test/tsconfig.json" }, { "path": "./developer/src/kmc-kmn/test/tsconfig.json" }, { "path": "./developer/src/kmc-kmn/tsconfig.json" }, { "path": "./developer/src/kmc-keyboard-info/test/tsconfig.json" }, @@ -28,27 +37,10 @@ { "path": "./developer/src/kmc-package/tsconfig.json" }, { "path": "./developer/src/server/tsconfig.json" }, - { "path": "./common/web/keyman-version" }, - { "path": "./common/web/types/" }, - - { "path": "./common/web/input-processor/tsconfig.json" }, - { "path": "./common/web/keyboard-processor/tsconfig.json" }, - { "path": "./common/web/recorder/tsconfig.json" }, - { "path": "./common/web/sentry-manager/src/tsconfig.json" }, - { "path": "./common/web/utils/tsconfig.json" }, - - { "path": "./common/models/templates/tsconfig.json" }, - { "path": "./common/models/types/tsconfig.json" }, - { "path": "./common/models/wordbreakers/tsconfig.json" }, - { "path": "./common/predictive-text/tsconfig.json" }, + { "path": "./resources/build/version/" }, { "path": "./web/src/tsconfig.all.json" }, // { "path": "./web/tools/recorder/tsconfig.json" }, // { "path": "./web/tools/sourcemap-root/tsconfig.json" }, - { "path": "./common/web/lm-message-types/" }, - { "path": "./common/web/lm-worker/" }, - { "path": "./common/tools/hextobin/" }, - - { "path": "./resources/build/version/" }, ] } \ No newline at end of file diff --git a/web/tsconfig.base.json b/web/tsconfig.base.json index a2b78b7b15..fa60ca26e6 100644 --- a/web/tsconfig.base.json +++ b/web/tsconfig.base.json @@ -1,5 +1,5 @@ { - "extends": "../tsconfig-base.json", + "extends": "../tsconfig.base.json", "compilerOptions": { // Primary settings - the version of ES6 we can target in TS, our downcompile target, @@ -7,7 +7,6 @@ "allowSyntheticDefaultImports": true, "lib": ["es6"], "module": "es6", - "moduleResolution": "Node16", "target": "es5", // Other settings - declaration files, sourcemapping, and other miscellaneous bits.