diff --git a/common/web/build.sh b/common/web/build.sh
index fbc015613f..e255205820 100755
--- a/common/web/build.sh
+++ b/common/web/build.sh
@@ -16,7 +16,6 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
builder_describe "Keyman common web modules" \
:keyman-version \
:types \
- :utils \
clean \
configure \
build \
diff --git a/package-lock.json b/package-lock.json
index 636ee750f1..53333fca5d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -316,18 +316,6 @@
"node": ">=4"
}
},
- "common/web/utils": {
- "name": "@keymanapp/web-utils",
- "license": "MIT",
- "devDependencies": {
- "@keymanapp/keyman-version": "*",
- "@keymanapp/resources-gosh": "*",
- "c8": "^7.12.0",
- "mocha": "^10.0.0",
- "mocha-teamcity-reporter": "^4.0.0",
- "typescript": "^5.4.5"
- }
- },
"core/include/ldml": {
"name": "@keymanapp/ldml-keyboard-constants",
"license": "MIT"
@@ -2824,7 +2812,7 @@
"link": true
},
"node_modules/@keymanapp/web-utils": {
- "resolved": "common/web/utils",
+ "resolved": "web/src/engine/common/web-utils",
"link": true
},
"node_modules/@mdn/browser-compat-data": {
@@ -14707,6 +14695,18 @@
"mocha": "^10.0.0"
}
},
+ "web/src/engine/common/web-utils": {
+ "name": "@keymanapp/web-utils",
+ "license": "MIT",
+ "devDependencies": {
+ "@keymanapp/keyman-version": "*",
+ "@keymanapp/resources-gosh": "*",
+ "c8": "^7.12.0",
+ "mocha": "^10.0.0",
+ "mocha-teamcity-reporter": "^4.0.0",
+ "typescript": "^5.4.5"
+ }
+ },
"web/src/engine/osk/gesture-processor": {
"name": "@keymanapp/gesture-recognizer",
"dependencies": {
diff --git a/tsconfig.base.json b/tsconfig.base.json
index 521ff447fa..9369051820 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -29,7 +29,7 @@
"@keymanapp/keyman": ["./web" ],
"@keymanapp/models-templates": ["./web/src/engine/predictive-text/templates/"],
"@keymanapp/models-wordbreakers": ["./web/src/engine/predictive-text/wordbreakers"],
- "@keymanapp/web-utils": ["./common/web/utils"],
+ "@keymanapp/web-utils": ["./web/src/engine/common/web-utils"],
"@keymanapp/lm-message-types": ["./web/src/engine/predictive-text/types"],
"@keymanapp/keyman-version": ["./common/web/keyman-version"],
"@keymanapp/ldml-keyboard-constants": [ "./core/include/ldml" ],
diff --git a/tsconfig.json b/tsconfig.json
index 51b3a60f72..1afefd74a5 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -8,7 +8,6 @@
{ "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/common/web/utils/tsconfig.json" },
@@ -35,6 +34,7 @@
{ "path": "./resources/build/version/" },
{ "path": "./web/src/tsconfig.all.json" },
+ { "path": "./web/src/engine/common/web-utils" },
{ "path": "./web/src/engine/predictive-text/types/" },
{ "path": "./web/src/engine/predictive-text/templates" },
{ "path": "./web/src/engine/predictive-text/wordbreakers" },
diff --git a/web/README.md b/web/README.md
index f3e723aee8..6b8245c5d2 100644
--- a/web/README.md
+++ b/web/README.md
@@ -84,7 +84,7 @@ graph TD;
KeyboardSpec["/web/src/engine/keyboard"];
JSProc["/web/src/engine/js-processor"];
OSK-->KeyboardSpec;
- WebUtils["@keymanapp/web-utils
(/common/web/utils)"];
+ WebUtils["@keymanapp/web-utils
(/web/src/engine/common/web-utils)"];
KeyboardSpec---->WebUtils;
Wordbreakers["@keymanapp/models-wordbreakers
(/web/src/engine/predictive-text/wordbreakers)"];
Models["@keymanapp/models-templates
(/web/src/engine/predictive-text/templates/)"];
diff --git a/common/web/utils/.c8rc.json b/web/src/engine/common/web-utils/.c8rc.json
similarity index 100%
rename from common/web/utils/.c8rc.json
rename to web/src/engine/common/web-utils/.c8rc.json
diff --git a/common/web/utils/.gitignore b/web/src/engine/common/web-utils/.gitignore
similarity index 100%
rename from common/web/utils/.gitignore
rename to web/src/engine/common/web-utils/.gitignore
diff --git a/common/web/utils/build.sh b/web/src/engine/common/web-utils/build.sh
similarity index 75%
rename from common/web/utils/build.sh
rename to web/src/engine/common/web-utils/build.sh
index 19ab896032..634642f4db 100755
--- a/common/web/utils/build.sh
+++ b/web/src/engine/common/web-utils/build.sh
@@ -5,11 +5,15 @@
## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
-. "${THIS_SCRIPT%/*}/../../../resources/build/builder.inc.sh"
+. "${THIS_SCRIPT%/*}/../../../../../resources/build/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE
+. "${KEYMAN_ROOT}/web/common.inc.sh"
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
+SUBPROJECT_NAME=engine/common/web-utils
+BUILD_DIR="/web/src/engine/common/web-utils/build"
+
BUNDLE_CMD="node $KEYMAN_ROOT/common/web/es-bundling/build/common-bundle.mjs"
################################ Main script ################################
@@ -23,21 +27,21 @@ builder_describe \
builder_describe_outputs \
configure "/node_modules" \
- build "/common/web/utils/build/obj/index.js"
+ build "${BUILD_DIR}/obj/index.js"
builder_parse "$@"
function do_build() {
- tsc --build "$THIS_SCRIPT_PATH/tsconfig.json"
+ tsc --build $builder_verbose "$THIS_SCRIPT_PATH/tsconfig.json"
# May be useful one day, for building a mass .d.ts for KMW as a whole.
# So... tsc does declaration-bundling on its own pretty well, at least for local development.
- tsc --emitDeclarationOnly --outFile ./build/lib/index.d.ts
+ tsc --emitDeclarationOnly --outFile "${KEYMAN_ROOT}/${BUILD_DIR}/lib/index.d.ts"
# One of the functions (timedPromise) is quite helpful for automated testing, even in the DOM.
# So, to make sure it's easily-accessible for the DOM-based tests...
- $BUNDLE_CMD "${KEYMAN_ROOT}/common/web/utils/build/obj/index.js" \
- --out "${KEYMAN_ROOT}/common/web/utils/build/lib/index.mjs" \
+ $BUNDLE_CMD "${KEYMAN_ROOT}/${BUILD_DIR}/obj/index.js" \
+ --out "${KEYMAN_ROOT}/${BUILD_DIR}/lib/index.mjs" \
--format esm
}
@@ -56,4 +60,4 @@ function do_test() {
builder_run_action configure verify_npm_setup
builder_run_action clean rm -rf build/
builder_run_action build do_build
-builder_run_action test do_test
\ No newline at end of file
+builder_run_action test do_test
diff --git a/common/web/utils/package.json b/web/src/engine/common/web-utils/package.json
similarity index 100%
rename from common/web/utils/package.json
rename to web/src/engine/common/web-utils/package.json
diff --git a/common/web/utils/src/deepCopy.ts b/web/src/engine/common/web-utils/src/deepCopy.ts
similarity index 100%
rename from common/web/utils/src/deepCopy.ts
rename to web/src/engine/common/web-utils/src/deepCopy.ts
diff --git a/common/web/utils/src/deviceSpec.ts b/web/src/engine/common/web-utils/src/deviceSpec.ts
similarity index 100%
rename from common/web/utils/src/deviceSpec.ts
rename to web/src/engine/common/web-utils/src/deviceSpec.ts
diff --git a/common/web/utils/src/globalObject.ts b/web/src/engine/common/web-utils/src/globalObject.ts
similarity index 100%
rename from common/web/utils/src/globalObject.ts
rename to web/src/engine/common/web-utils/src/globalObject.ts
diff --git a/common/web/utils/src/index.ts b/web/src/engine/common/web-utils/src/index.ts
similarity index 100%
rename from common/web/utils/src/index.ts
rename to web/src/engine/common/web-utils/src/index.ts
diff --git a/common/web/utils/src/kmwstring.ts b/web/src/engine/common/web-utils/src/kmwstring.ts
similarity index 100%
rename from common/web/utils/src/kmwstring.ts
rename to web/src/engine/common/web-utils/src/kmwstring.ts
diff --git a/common/web/utils/src/managedPromise.ts b/web/src/engine/common/web-utils/src/managedPromise.ts
similarity index 100%
rename from common/web/utils/src/managedPromise.ts
rename to web/src/engine/common/web-utils/src/managedPromise.ts
diff --git a/common/web/utils/src/priority-queue.ts b/web/src/engine/common/web-utils/src/priority-queue.ts
similarity index 100%
rename from common/web/utils/src/priority-queue.ts
rename to web/src/engine/common/web-utils/src/priority-queue.ts
diff --git a/common/web/utils/src/test/deepCopy.js b/web/src/engine/common/web-utils/src/test/deepCopy.js
similarity index 100%
rename from common/web/utils/src/test/deepCopy.js
rename to web/src/engine/common/web-utils/src/test/deepCopy.js
diff --git a/common/web/utils/src/test/managedPromise.js b/web/src/engine/common/web-utils/src/test/managedPromise.js
similarity index 100%
rename from common/web/utils/src/test/managedPromise.js
rename to web/src/engine/common/web-utils/src/test/managedPromise.js
diff --git a/common/web/utils/src/test/priorityQueue.js b/web/src/engine/common/web-utils/src/test/priorityQueue.js
similarity index 100%
rename from common/web/utils/src/test/priorityQueue.js
rename to web/src/engine/common/web-utils/src/test/priorityQueue.js
diff --git a/common/web/utils/src/test/timeoutPromise.js b/web/src/engine/common/web-utils/src/test/timeoutPromise.js
similarity index 100%
rename from common/web/utils/src/test/timeoutPromise.js
rename to web/src/engine/common/web-utils/src/test/timeoutPromise.js
diff --git a/common/web/utils/src/test/versions.js b/web/src/engine/common/web-utils/src/test/versions.js
similarity index 100%
rename from common/web/utils/src/test/versions.js
rename to web/src/engine/common/web-utils/src/test/versions.js
diff --git a/common/web/utils/src/timeoutPromise.ts b/web/src/engine/common/web-utils/src/timeoutPromise.ts
similarity index 100%
rename from common/web/utils/src/timeoutPromise.ts
rename to web/src/engine/common/web-utils/src/timeoutPromise.ts
diff --git a/common/web/utils/src/version.ts b/web/src/engine/common/web-utils/src/version.ts
similarity index 100%
rename from common/web/utils/src/version.ts
rename to web/src/engine/common/web-utils/src/version.ts
diff --git a/common/web/utils/tsconfig.json b/web/src/engine/common/web-utils/tsconfig.json
similarity index 71%
rename from common/web/utils/tsconfig.json
rename to web/src/engine/common/web-utils/tsconfig.json
index cb87a6a7c4..a4d2e57702 100644
--- a/common/web/utils/tsconfig.json
+++ b/web/src/engine/common/web-utils/tsconfig.json
@@ -1,5 +1,5 @@
{
- "extends": "../tsconfig.kmw-main-base.json",
+ "extends": "../../../../tsconfig.base.json",
"compilerOptions": {
"tsBuildInfoFile": "./build/obj/tsconfig.tsbuildinfo",
"baseUrl": "./",
@@ -7,7 +7,7 @@
"rootDir": "./src"
},
"references": [
- { "path": "../keyman-version"}
+ { "path": "../../../../../common/web/keyman-version" },
],
"include": [
"src/*.ts"
diff --git a/web/src/engine/device-detect/build.sh b/web/src/engine/device-detect/build.sh
index 4e25f55bd7..d0ad834320 100755
--- a/web/src/engine/device-detect/build.sh
+++ b/web/src/engine/device-detect/build.sh
@@ -14,7 +14,7 @@ SUBPROJECT_NAME=engine/device-detect
builder_describe "Builds the device-detection component of Keyman Engine for Web (KMW)." \
"@/common/web/keyman-version" \
- "@/common/web/utils" \
+ "@/web/src/engine/common/web-utils" \
"clean" \
"configure" \
"build" \
diff --git a/web/src/engine/device-detect/tsconfig.json b/web/src/engine/device-detect/tsconfig.json
index a53bb60766..3f71dc0f26 100644
--- a/web/src/engine/device-detect/tsconfig.json
+++ b/web/src/engine/device-detect/tsconfig.json
@@ -12,6 +12,6 @@
"references": [
{ "path": "../../../../common/web/keyman-version" },
- { "path": "../../../../common/web/utils" }
+ { "path": "../common/web-utils" }
]
}
diff --git a/web/src/engine/dom-utils/build.sh b/web/src/engine/dom-utils/build.sh
index d2e424db20..f842655c45 100755
--- a/web/src/engine/dom-utils/build.sh
+++ b/web/src/engine/dom-utils/build.sh
@@ -15,7 +15,7 @@ SUBPROJECT_NAME=engine/dom-utils
# ################################ Main script ################################
builder_describe "Builds DOM-utility modules used by the Keyman Engine for Web (KMW)." \
- "@/common/web/utils" \
+ "@/web/src/engine/common/web-utils" \
"@/web/src/engine/keyboard" \
"clean" \
"configure" \
diff --git a/web/src/engine/dom-utils/tsconfig.json b/web/src/engine/dom-utils/tsconfig.json
index dadf4db5c8..aab3cabf87 100644
--- a/web/src/engine/dom-utils/tsconfig.json
+++ b/web/src/engine/dom-utils/tsconfig.json
@@ -12,6 +12,6 @@
"references": [
{ "path": "../keyboard" },
- { "path": "../../../../common/web/utils" }
+ { "path": "../common/web-utils" }
]
}
diff --git a/web/src/engine/events/build.sh b/web/src/engine/events/build.sh
index 1b8993f570..600ca8dc0c 100755
--- a/web/src/engine/events/build.sh
+++ b/web/src/engine/events/build.sh
@@ -13,7 +13,7 @@ SUBPROJECT_NAME=engine/events
# ################################ Main script ################################
builder_describe "Builds specialized event-related modules utilized by Keyman Engine for Web." \
- "@/common/web/utils build" \
+ "@/web/src/engine/common/web-utils build" \
"@/web/src/engine/keyboard build" \
"clean" \
"configure" \
diff --git a/web/src/engine/events/tsconfig.json b/web/src/engine/events/tsconfig.json
index 5d0a45bbab..8ab284c473 100644
--- a/web/src/engine/events/tsconfig.json
+++ b/web/src/engine/events/tsconfig.json
@@ -11,7 +11,7 @@
"include": [ "src/**/*.ts" ],
"references": [
- { "path": "../../../../common/web/utils" },
+ { "path": "../common/web-utils" },
{ "path": "../keyboard" }
]
}
diff --git a/web/src/engine/keyboard/build.sh b/web/src/engine/keyboard/build.sh
index 7b04e478a0..524375d87b 100755
--- a/web/src/engine/keyboard/build.sh
+++ b/web/src/engine/keyboard/build.sh
@@ -21,7 +21,7 @@ builder_describe \
"@/common/web/keyman-version" \
"@/common/web/es-bundling" \
"@/common/web/types" \
- "@/common/web/utils" \
+ "@/web/src/engine/common/web-utils" \
configure \
clean \
build \
diff --git a/web/src/engine/osk/gesture-processor/build.sh b/web/src/engine/osk/gesture-processor/build.sh
index b2ea635d8a..dc2981a79d 100755
--- a/web/src/engine/osk/gesture-processor/build.sh
+++ b/web/src/engine/osk/gesture-processor/build.sh
@@ -19,7 +19,7 @@ BUILD_DIR="/web/src/engine/osk/gesture-processor/build"
builder_describe "Builds the gesture-recognition model for Web-based on-screen keyboards" \
"@/common/web/es-bundling build" \
- "@/common/web/utils build" \
+ "@/web/src/engine/common/web-utils build" \
"clean" \
"configure" \
"build" \
diff --git a/web/src/engine/osk/gesture-processor/tsconfig.json b/web/src/engine/osk/gesture-processor/tsconfig.json
index 0b2d3a87b9..a6c7a8de7a 100644
--- a/web/src/engine/osk/gesture-processor/tsconfig.json
+++ b/web/src/engine/osk/gesture-processor/tsconfig.json
@@ -9,7 +9,7 @@
},
"include": ["./src/engine/**/*.ts"],
"references": [
- { "path": "../../../../../common/web/utils" },
+ { "path": "../../common/web-utils" },
],
"exclude": ["./src/test/**/*.ts", "./src/tools/**/*.ts"]
}
diff --git a/web/src/engine/predictive-text/templates/tsconfig.json b/web/src/engine/predictive-text/templates/tsconfig.json
index 3bf428226b..e8217e9ad9 100644
--- a/web/src/engine/predictive-text/templates/tsconfig.json
+++ b/web/src/engine/predictive-text/templates/tsconfig.json
@@ -9,7 +9,7 @@
},
"references": [
{ "path": "../../../../../common/web/types" },
- { "path": "../../../../../common/web/utils" },
+ { "path": "../../common/web-utils" },
{ "path": "../wordbreakers" }
],
"include": [
diff --git a/web/src/engine/predictive-text/worker-main/src/tsconfig.json b/web/src/engine/predictive-text/worker-main/src/tsconfig.json
index 4cd8f538da..0ee72aedba 100644
--- a/web/src/engine/predictive-text/worker-main/src/tsconfig.json
+++ b/web/src/engine/predictive-text/worker-main/src/tsconfig.json
@@ -8,7 +8,7 @@
"rootDir": "./"
},
"references": [
- { "path": "../../../../../../common/web/utils" },
+ { "path": "../../../common/web-utils" },
{ "path": "../../../../../../common/web/types"},
{ "path": "../../types"}
],
diff --git a/web/src/engine/predictive-text/worker-main/tsconfig.all.json b/web/src/engine/predictive-text/worker-main/tsconfig.all.json
index 430df16c1b..6e7eb4cc80 100644
--- a/web/src/engine/predictive-text/worker-main/tsconfig.all.json
+++ b/web/src/engine/predictive-text/worker-main/tsconfig.all.json
@@ -13,7 +13,7 @@
},
"files": [],
"references": [
- { "path": "../../../../../common/web/utils" },
+ { "path": "../../common/web-utils" },
{ "path": "../../../../../common/web/types"},
{ "path": "../types"},
{ "path": "src/node" },
diff --git a/web/src/engine/predictive-text/worker-thread/tsconfig.json b/web/src/engine/predictive-text/worker-thread/tsconfig.json
index f79c5f8697..252ec84ceb 100644
--- a/web/src/engine/predictive-text/worker-thread/tsconfig.json
+++ b/web/src/engine/predictive-text/worker-thread/tsconfig.json
@@ -22,7 +22,7 @@
{ "path": "../types" },
// modules
{ "path": "../../../../../common/web/keyman-version" },
- { "path": "../../../../../common/web/utils" },
+ { "path": "../../common/web-utils" },
{ "path": "../templates" },
{ "path": "../wordbreakers" },
],
diff --git a/web/src/tools/testing/recorder-core/tsconfig.json b/web/src/tools/testing/recorder-core/tsconfig.json
index 01e1431945..67affcca5e 100644
--- a/web/src/tools/testing/recorder-core/tsconfig.json
+++ b/web/src/tools/testing/recorder-core/tsconfig.json
@@ -15,7 +15,7 @@
"references": [
{ "path": "../../../../../common/web/keyman-version" },
- { "path": "../../../../../common/web/utils/" },
+ { "path": "../../../engine/common/web-utils/" },
{ "path": "../../../engine/predictive-text/types" },
{ "path": "../../../engine/js-processor" },
{ "path": "../../../engine/keyboard" },
diff --git a/web/src/tools/testing/recorder/tsconfig.json b/web/src/tools/testing/recorder/tsconfig.json
index e25a4f6034..a33d2ee5eb 100644
--- a/web/src/tools/testing/recorder/tsconfig.json
+++ b/web/src/tools/testing/recorder/tsconfig.json
@@ -11,7 +11,7 @@
"references": [
{ "path": "../../../../../common/web/keyman-version" },
- { "path": "../../../../../common/web/utils" },
+ { "path": "../../../engine/common/web-utils" },
{ "path": "../../../engine/predictive-text/types" },
{ "path": "../../../app/browser" },
{ "path": "../recorder-core" },