Merge branch 'epic/kmc-convert' into feat/developer/kmc-convert

This commit is contained in:
SabineSIL 2026-03-13 17:02:38 +01:00 • committed by GitHub
commit a2bacd8ca2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 192 additions and 176 deletions

View file

@ -1,5 +1,23 @@
# Keyman Version History
## 19.0.206 alpha 2026-02-25
* maint(ios): upgrade to Xcode 26.2 (#15498)
## 19.0.205 alpha 2026-02-24
* fix(core): fix iterator in backspace handling (#15596)
* refactor(core): simplify loop for removing text (#15600)
* test(core): add LDML baseline test with minimal keyboard (#15608)
## 19.0.204 alpha 2026-02-20
* maint(web): ensure Web build scripts handle paths with spaces properly (#15598)
## 19.0.203 alpha 2026-02-16
* docs: Add status.keyman.com info to website readme (#15591)
## 19.0.202 alpha 2026-02-12
* fix(linux): check for existing file before trying to install (#15573)

View file

@ -1 +1 @@
19.0.203
19.0.207

View file

@ -233,15 +233,15 @@ void ldml_event_state::emit_backspace() {
// Find out what the last actual character was and remove it.
// attempt to get the last char
// TODO-LDML: emoji backspace
auto end = state->context().rbegin();
while (end != state->context().rend()) {
if (end->type == KM_CORE_CT_CHAR) {
while (!state->context().empty()) {
auto end = state->context().back();
if (end.type == KM_CORE_CT_CHAR) {
actions.code_points_to_delete++;
state->context().pop_back();
return;
}
// else loop again
assert(end->type != KM_CORE_CT_END); // inappropriate here.
assert(end.type != KM_CORE_CT_END); // inappropriate here.
state->context().pop_back();
}
/*
@ -415,26 +415,25 @@ void
ldml_event_state::remove_text(std::u32string &str, size_t length) {
// str is the string to remove, so it should be at least as long as length
assert(length <= str.length());
/** track how many context items have been removed, via push_backspace() */
size_t contextRemoved = 0;
for (auto c = state->context().rbegin(); length > 0 && c != state->context().rend(); c++, contextRemoved++) {
while (length > 0 && !state->context().empty()) {
#ifndef NDEBUG
/** last char of context */
km_core_usv lastCtx = str.back();
#endif
uint8_t type = c->type;
auto lastStateCtx = state->context().back();
uint8_t type = lastStateCtx.type;
assert(type == KM_CORE_BT_CHAR || type == KM_CORE_BT_MARKER);
if (type == KM_CORE_BT_CHAR) {
// single char, drop it
length--;
assert(c->character == lastCtx);
assert(lastStateCtx.character == lastCtx);
str.pop_back();
// Cause prior char to be removed
actions.code_points_to_delete++;
} else if (type == KM_CORE_BT_MARKER) {
assert(length >= 3);
// #3 - the marker.
assert(lastCtx == c->marker);
assert(lastCtx == lastStateCtx.marker);
str.pop_back();
length--;
// #2 - the code
@ -447,13 +446,9 @@ ldml_event_state::remove_text(std::u32string &str, size_t length) {
// Nothing in actions
length--;
}
}
assert(length == 0);
// now, pop the context items
for (size_t i = 0; i < contextRemoved; i++) {
// we don't pop during the above loop because the iterator gets confused
state->context().pop_back();
}
assert(length == 0);
}
void

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Keys that don't show up in a row don't generate an output
@@keys: [K_Q][K_W]
@@expected: q
-->
<keyboard3 xmlns="https://schemas.unicode.org/cldr/45/keyboard3" locale="en" conformsTo="45">
<info author="eb" layout="qwerty" name="k_000_minimal_keyboard" />
<keys>
<!-- no keys listed, keys-Latn-implied.xml will be implicitly imported -->
</keys>
<layers formId="us">
<layer id="base">
<row keys="1" />
<row keys="q" />
</layer>
</layers>
</keyboard3>

View file

@ -1,10 +0,0 @@
<!-- TODO: this is not yet a valid keyboard file
Note that the corresponding .kmx is currently
hand-crafted and semi-valid.
@@keys: [K_A][K_B][K_C]
@@expect:
-->
<keyboard3 />

View file

@ -17,8 +17,7 @@ tests_from_cldr = [
# these have 'embedded' (@@) testdata instead of a separate file
tests_without_testdata = [
# disabling 000 until we have updates to core or to the keyboard so that it passes
# 'k_000_null_keyboard',
'k_000_minimal_keyboard',
'k_002_tinyu32',
'k_003_transform',
'k_004_tinyshift',

View file

@ -40,7 +40,7 @@
namespace {
void print_context(std::u16string &text_store, km_core_state *&test_state, std::vector<km_core_context_item> &test_context);
void print_context(std::u16string &text_store, km_core_state *&test_state, std::list<km_core_context_item> &test_context);
bool g_beep_found = false;
@ -68,10 +68,10 @@ string_to_hex(const std::u16string &input) {
void
copy_context_items_to_vector(km_core_context_item *citems, std::vector<km_core_context_item> &vector) {
vector.clear();
copy_context_items_to_list(km_core_context_item *citems, std::list<km_core_context_item> &list) {
list.clear();
for(km_core_context_item *ci = citems; ci->type != KM_CORE_CT_END; ci++) {
vector.emplace_back(*ci);
list.emplace_back(*ci);
}
}
@ -81,9 +81,9 @@ apply_action(
km_core_state *test_state,
km_core_action_item const &act,
std::u16string &text_store,
std::vector<km_core_context_item> &context,
std::list<km_core_context_item> &context,
km::tests::LdmlTestSource &test_source,
std::vector<km_core_context_item> &test_context) {
std::list<km_core_context_item> &test_context) {
// print_context(text_store, test_state, test_context);
switch (act.type) {
@ -157,21 +157,20 @@ apply_action(
matched_text = true; // no text to match as context is empty.
}
// now, we need to simulate what ldml_processor::emit_backspace() is going to do.
auto end = context.rbegin();
while (end != context.rend()) {
if (end->type == KM_CORE_CT_CHAR) {
test_assert(!matched_text);
test_assert_equal(end->character, ch); // expect popped char to be same as what's in context
matched_text = true;
context.pop_back();
break; // exit on first real char
}
test_assert(end->type != KM_CORE_CT_END); // inappropriate here.
while (!context.empty()) {
if (context.back().type == KM_CORE_CT_CHAR) {
test_assert(!matched_text);
test_assert_equal(context.back().character, ch); // expect popped char to be same as what's in context
matched_text = true;
context.pop_back();
break; // exit on first real char
}
test_assert(matched_text);
test_assert(context.back().type != KM_CORE_CT_END); // inappropriate here.
context.pop_back();
}
test_assert(matched_text);
break;
}
case KM_CORE_IT_PERSIST_OPT:
std::cout << " + TODO-LDML: persist_opt()" << std::endl;
break;
@ -184,9 +183,9 @@ apply_action(
// We replace the cached context with the current application context
km_core_status status = context_items_from_utf16(text_store.c_str(), &new_context_items);
test_assert(status == KM_CORE_STATUS_OK);
copy_context_items_to_vector(new_context_items, context);
copy_context_items_to_list(new_context_items, context);
// also update the test context
copy_context_items_to_vector(new_context_items, test_context);
copy_context_items_to_list(new_context_items, test_context);
// TODO-LDML: now we need to SET the core context!
status = km_core_context_set(km_core_state_context(test_state), new_context_items);
km_core_context_items_dispose(new_context_items);
@ -212,9 +211,9 @@ apply_actions(
km_core_state *test_state,
km_core_actions const *actions,
std::u16string &text_store,
std::vector<km_core_context_item> &context,
std::list<km_core_context_item> &context,
km::tests::LdmlTestSource &test_source,
std::vector<km_core_context_item> &test_context
std::list<km_core_context_item> &test_context
) {
if(actions->do_alert) {
@ -245,7 +244,7 @@ apply_actions(
}
void
print_context(std::u16string &text_store, km_core_state *&test_state, std::vector<km_core_context_item> &test_context) {
print_context(std::u16string &text_store, km_core_state *&test_state, std::list<km_core_context_item> &test_context) {
// Compare context and text store at each step - should be identical
size_t n = 0;
km_core_context_item *citems = nullptr;
@ -280,7 +279,7 @@ print_context(std::u16string &text_store, km_core_state *&test_state, std::vecto
std::cout << "test_context : ";
std::cout.fill('0');
for (auto i = test_context.begin(); i < test_context.end(); i++) {
for (auto i = test_context.begin(); i != test_context.end(); i++) {
switch (i->type) {
case KM_CORE_CT_CHAR:
std::cout << "U+" << std::setw(4) << std::hex << i->character << std::dec << " ";
@ -302,7 +301,7 @@ print_context(std::u16string &text_store, km_core_state *&test_state, std::vecto
* verify the current context
*/
void
verify_context(std::u16string &text_store, km_core_state *&test_state, std::vector<km_core_context_item> &test_context, bool fully_normalized_mode, bool normalization_enabled) {
verify_context(std::u16string &text_store, km_core_state *&test_state, std::list<km_core_context_item> &test_context, bool fully_normalized_mode, bool normalization_enabled) {
// Compare context and text store at each step - should be identical
print_context(text_store, test_state, test_context);
@ -435,7 +434,7 @@ run_test(const km::core::path &source, const km::core::path &compiled, km::tests
g_beep_found = false;
std::vector<km_core_context_item> test_context;
std::list<km_core_context_item> test_context;
km_core_context_item *citems = nullptr;
// setup test_context
@ -448,7 +447,7 @@ run_test(const km::core::path &source, const km::core::path &compiled, km::tests
}
// Make a copy of the setup context for the test
copy_context_items_to_vector(citems, test_context);
copy_context_items_to_list(citems, test_context);
km_core_context_items_dispose(citems);
// Setup baseline text store

View file

@ -60,14 +60,19 @@ The link file also appears locally.
##### Port lookup table
After this, you can access the website at the following ports:
| Website | URL | with website-local-proxy running | Docker Container Name |
|----------------|-----------------------|-----------------------------------|------------------------|
| keyman.com | http://localhost:8053 | http://keyman.com.localhost | keyman-website |
| s.keyman.com | http://localhost:8054 | http://s.keyman.com.localhost | s-keyman-website |
| help.keyman | http://localhost:8055 | http://help.keyman.com.localhost | help-keyman-website |
| keymanweb.com | http://localhost:8057 | http://keymanweb.com.localhost | web-keyman-website |
| | | http://web.keyman.com.localhost | |
| api.keyman.com | http://localhost:8058 | http://api.keyman.com.localhost | api-keyman-com-website |
| Website | URL | with website-local-proxy running | Docker Container Name |
|--------------------|-----------------------|--------------------------------------------|------------------------|
| keyman.com | http://localhost:8053 | http://keyman.com.localhost | keyman-website |
| s.keyman.com | http://localhost:8054 | http://s.keyman.com.localhost | s-keyman-website |
| help.keyman | http://localhost:8055 | http://help.keyman.com.localhost | help-keyman-website |
| keymanweb.com | http://localhost:8057 | http://keymanweb.com.localhost | web-keyman-website |
| | | http://web.keyman.com.localhost | |
| api.keyman.com | http://localhost:8058 | http://api.keyman.com.localhost | api-keyman-com-website |
| status.keyman.com* | http://localhost:8060 | http://status-backend.keyman.com.localhost | status-keyman-website |
| | http://localhost:8061 | http://status.keyman.com.localhost | status-keyman-public |
\* Note that status.keyman.com runs in two containers in development to allow for live reload and separation of logs for backend and frontend.
In production, only port 8060 is used.
#### Remove the Docker container and image
1. Run `./build.sh clean`.
@ -96,15 +101,15 @@ Refer to **Port lookup table** above for Docker container names
The table below shows server-side dependencies for each website
|Website | Depends On |
|----------------------|------------- |
| s.keyman.com | <br><br> |
| downloads.keyman.com | <br><br> |
| api.keyman.com | downloads.keyman.com<br>s.keyman.com |
| keymanweb.com | api.keyman.com |
| Website | Depends On |
|----------------------|----------------------------------------|
| s.keyman.com | <br><br> |
| downloads.keyman.com | <br><br> |
| api.keyman.com | downloads.keyman.com<br>s.keyman.com |
| keymanweb.com | api.keyman.com |
| keyman.com | api.keyman.com<br>downloads.keyman.com |
| help.keyman.com | api.keyman.com<br>downloads.keyman.com |
| status.keyman.com | api.keyman.com<br>downloads.keyman.com |
---------

View file

@ -1,4 +1,4 @@
github "weichsel/ZIPFoundation" ~> 0.9
github "devicekit/DeviceKit" ~> 5.0
github "ashleymills/Reachability.swift"
github "getsentry/sentry-cocoa" ~> 8.38.0
github "getsentry/sentry-cocoa" ~> 8.58

View file

@ -1,4 +1,4 @@
github "ashleymills/Reachability.swift" "v5.2.4"
github "devicekit/DeviceKit" "5.5.0"
github "getsentry/sentry-cocoa" "8.44.0"
github "weichsel/ZIPFoundation" "0.9.19"
github "devicekit/DeviceKit" "5.7.0"
github "getsentry/sentry-cocoa" "8.58.0"
github "weichsel/ZIPFoundation" "0.9.20"

View file

@ -9,6 +9,7 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
## END STANDARD BUILD SCRIPT INCLUDE
. "$KEYMAN_ROOT/resources/build/utils.inc.sh"
. "$KEYMAN_ROOT/web/common.inc.sh"
# ################################ Main script ################################
@ -75,8 +76,6 @@ builder_describe_outputs \
build:tools "/web/build/tools/building/sourcemap-root/index.js" \
build:test-pages "/web/build/test-resources/sentry-manager.js"
BUNDLE_CMD="node ${KEYMAN_ROOT}/web/src/tools/es-bundling/build/common-bundle.mjs"
#### Build action definitions ####
##################### TODO: call child action, verify things work as expected!
@ -107,8 +106,8 @@ precompile() {
# types built-in to Node aren't available, and @web/test-runner doesn't do
# treeshaking when loading the imports. We work around by pre-compiling.
for f in "${DIR}"/*.js; do
${BUNDLE_CMD} "${f}" \
--out "${f%.js}".mjs \
node "${LIB_BUNDLER}" "${f}" \
--out "${f%.js}".mjs \
--format esm
done
}

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
#
BUNDLE_CMD="node $KEYMAN_ROOT/web/src/tools/es-bundling/build/common-bundle.mjs"
LIB_BUNDLER="${KEYMAN_ROOT}/web/src/tools/es-bundling/build/common-bundle.mjs"
# Compiles all build products corresponding to the specified target.
# This should be called from the working directory of a child project's

View file

@ -49,25 +49,25 @@ compile_and_copy() {
BUILD_ROOT="${KEYMAN_ROOT}/web/build/app/browser"
SRC_ROOT="${KEYMAN_ROOT}/web/src/app/browser/src"
$BUNDLE_CMD "${SRC_ROOT}/debug-main.js" \
--out "${BUILD_ROOT}/debug/keymanweb.js" \
--charset "utf8" \
--sourceRoot "@keymanapp/keyman/web/build/app/browser/debug" \
--target "es6"
node "${LIB_BUNDLER}" "${SRC_ROOT}/debug-main.js" \
--out "${BUILD_ROOT}/debug/keymanweb.js" \
--charset "utf8" \
--sourceRoot "@keymanapp/keyman/web/build/app/browser/debug" \
--target "es6"
$BUNDLE_CMD "${SRC_ROOT}/release-main.js" \
--out "${BUILD_ROOT}/release/keymanweb.js" \
--charset "utf8" \
--profile "${BUILD_ROOT}/filesize-profile.log" \
--sourceRoot "@keymanapp/keyman/web/build/app/browser/release" \
--minify \
--target "es6"
node "${LIB_BUNDLER}" "${SRC_ROOT}/release-main.js" \
--out "${BUILD_ROOT}/release/keymanweb.js" \
--charset "utf8" \
--profile "${BUILD_ROOT}/filesize-profile.log" \
--sourceRoot "@keymanapp/keyman/web/build/app/browser/release" \
--minify \
--target "es6"
$BUNDLE_CMD "${BUILD_ROOT}/obj/test-index.js" \
--out "${BUILD_ROOT}/lib/index.mjs" \
--charset "utf8" \
--sourceRoot "@keymanapp/keyman/web/build/app/browser/lib" \
--format esm
node "${LIB_BUNDLER}" "${BUILD_ROOT}/obj/test-index.js" \
--out "${BUILD_ROOT}/lib/index.mjs" \
--charset "utf8" \
--sourceRoot "@keymanapp/keyman/web/build/app/browser/lib" \
--format esm
mkdir -p "$KEYMAN_ROOT/web/build/app/resources/osk"
cp -R "$KEYMAN_ROOT/web/src/resources/osk/." "$KEYMAN_ROOT/web/build/app/resources/osk/"

View file

@ -51,13 +51,13 @@ compile_and_copy() {
for type in ${types[@]}
do
filename="kmwui${type}"
$BUNDLE_CMD "${BUILD_ROOT}/obj/$filename.js" \
--out "${BUILD_ROOT}/debug/$filename.js" \
--sourceRoot "@keymanapp/keyman/web/build/app/ui/debug"
node "${LIB_BUNDLER}" "${BUILD_ROOT}/obj/$filename.js" \
--out "${BUILD_ROOT}/debug/$filename.js" \
--sourceRoot "@keymanapp/keyman/web/build/app/ui/debug"
$BUNDLE_CMD "${BUILD_ROOT}/obj/$filename.js" \
--out "${BUILD_ROOT}/release/$filename.js" \
--sourceRoot "@keymanapp/keyman/web/build/app/ui/release" \
node "${LIB_BUNDLER}" "${BUILD_ROOT}/obj/$filename.js" \
--out "${BUILD_ROOT}/release/$filename.js" \
--sourceRoot "@keymanapp/keyman/web/build/app/ui/release" \
--minify
done

View file

@ -43,19 +43,19 @@ compile_and_copy() {
BUILD_ROOT="${KEYMAN_ROOT}/web/build/app/webview"
SRC_ROOT="${KEYMAN_ROOT}/web/src/app/webview/src"
$BUNDLE_CMD "${SRC_ROOT}/debug-main.js" \
--out "${BUILD_ROOT}/debug/keymanweb-webview.js" \
--charset "utf8" \
--sourceRoot "@keymanapp/keyman/web/build/app/webview/debug" \
--target "es6"
node "${LIB_BUNDLER}" "${SRC_ROOT}/debug-main.js" \
--out "${BUILD_ROOT}/debug/keymanweb-webview.js" \
--charset "utf8" \
--sourceRoot "@keymanapp/keyman/web/build/app/webview/debug" \
--target "es6"
$BUNDLE_CMD "${SRC_ROOT}/release-main.js" \
--out "${BUILD_ROOT}/release/keymanweb-webview.js" \
--charset "utf8" \
--profile "${BUILD_ROOT}/filesize-profile.log" \
--sourceRoot "@keymanapp/keyman/web/build/app/webview/release" \
--minify \
--target "es6"
node "${LIB_BUNDLER}" "${SRC_ROOT}/release-main.js" \
--out "${BUILD_ROOT}/release/keymanweb-webview.js" \
--charset "utf8" \
--profile "${BUILD_ROOT}/filesize-profile.log" \
--sourceRoot "@keymanapp/keyman/web/build/app/webview/release" \
--minify \
--target "es6"
mkdir -p "$KEYMAN_ROOT/web/build/app/resources/osk"
cp -R "$KEYMAN_ROOT/web/src/resources/osk/." "$KEYMAN_ROOT/web/build/app/resources/osk/"

View file

@ -36,8 +36,8 @@ builder_parse "$@"
do_build () {
compile $SUBPROJECT_NAME
$BUNDLE_CMD "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/index.mjs" \
node "${LIB_BUNDLER}" "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/index.mjs" \
--format esm
}

View file

@ -15,8 +15,6 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
SUBPROJECT_NAME=engine/common/web-utils
BUILD_DIR="/web/src/engine/common/web-utils/build"
BUNDLE_CMD="node ${KEYMAN_ROOT}/web/src/tools/es-bundling/build/common-bundle.mjs"
################################ Main script ################################
builder_describe \
@ -37,11 +35,10 @@ function do_build() {
# 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 "${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}/${BUILD_DIR}/obj/index.js" \
--out "${KEYMAN_ROOT}/${BUILD_DIR}/lib/index.mjs" \
node "${LIB_BUNDLER}" "${KEYMAN_ROOT}/${BUILD_DIR}/obj/index.js" \
--out "${KEYMAN_ROOT}/${BUILD_DIR}/lib/index.mjs" \
--format esm
}

View file

@ -34,8 +34,8 @@ builder_parse "$@"
do_build () {
compile $SUBPROJECT_NAME
$BUNDLE_CMD "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/index.mjs" \
node "${LIB_BUNDLER}" "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/index.mjs" \
--format esm
}

View file

@ -35,8 +35,8 @@ builder_parse "$@"
do_build () {
compile $SUBPROJECT_NAME
$BUNDLE_CMD "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/index.mjs" \
node "${LIB_BUNDLER}" "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/index.mjs" \
--format esm
}

View file

@ -36,8 +36,8 @@ builder_parse "$@"
do_build () {
compile $SUBPROJECT_NAME
$BUNDLE_CMD "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/index.mjs" \
node "${LIB_BUNDLER}" "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/index.mjs" \
--format esm
}

View file

@ -31,8 +31,8 @@ builder_parse "$@"
do_build () {
compile "${SUBPROJECT_NAME}"
${BUNDLE_CMD} "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/index.mjs" \
node "${LIB_BUNDLER}" "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/index.mjs" \
--format esm
}

View file

@ -34,16 +34,16 @@ builder_parse "$@"
do_build () {
compile $SUBPROJECT_NAME
$BUNDLE_CMD "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/index.mjs" \
node "${LIB_BUNDLER}" "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/index.mjs" \
--format esm
$BUNDLE_CMD "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/domCloudRequester.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/dom-cloud-requester.mjs" \
node "${LIB_BUNDLER}" "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/domCloudRequester.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/dom-cloud-requester.mjs" \
--format esm
$BUNDLE_CMD "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/nodeCloudRequester.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/node-cloud-requester.mjs" \
node "${LIB_BUNDLER}" "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/nodeCloudRequester.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/node-cloud-requester.mjs" \
--format esm \
--platform node
}

View file

@ -49,20 +49,20 @@ function do_build() {
# Base product - the main keyboard processor
builder_echo "Bundle base product - the main keyboard processor"
${BUNDLE_CMD} "${BUILD_DIR}/obj/index.js" \
--out "${BUILD_DIR}/lib/index.mjs" \
node "${LIB_BUNDLER}" "${BUILD_DIR}/obj/index.js" \
--out "${BUILD_DIR}/lib/index.mjs" \
--format esm
# The DOM-oriented keyboard loader
builder_echo "Bundle the DOM-oriented keyboard loader"
${BUNDLE_CMD} "${BUILD_DIR}/obj/keyboards/loaders/dom-keyboard-loader.js" \
--out "${BUILD_DIR}/lib/dom-keyboard-loader.mjs" \
node "${LIB_BUNDLER}" "${BUILD_DIR}/obj/keyboards/loaders/dom-keyboard-loader.js" \
--out "${BUILD_DIR}/lib/dom-keyboard-loader.mjs" \
--format esm
# The Node-oriented keyboard loader
builder_echo "Bundle the Node-oriented keyboard loader"
${BUNDLE_CMD} "${BUILD_DIR}/obj/keyboards/loaders/node-keyboard-loader.js" \
--out "${BUILD_DIR}/lib/node-keyboard-loader.mjs" \
node "${LIB_BUNDLER}" "${BUILD_DIR}/obj/keyboards/loaders/node-keyboard-loader.js" \
--out "${BUILD_DIR}/lib/node-keyboard-loader.mjs" \
--format esm \
--platform node

View file

@ -41,8 +41,8 @@ builder_parse "$@"
do_build () {
compile $SUBPROJECT_NAME
$BUNDLE_CMD "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/index.mjs" \
node "${LIB_BUNDLER}" "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/index.mjs" \
--format esm
}

View file

@ -49,8 +49,8 @@ do_configure() {
do_build() {
compile "${SUBPROJECT_NAME}"
$BUNDLE_CMD "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/index.mjs" \
node "${LIB_BUNDLER}" "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/index.mjs" \
--format esm
echo "Validating gesture model and set references"

View file

@ -12,8 +12,6 @@ SUBPROJECT_NAME=engine/osk/gesture-processor
. "${KEYMAN_ROOT}/resources/build/utils.inc.sh"
. "$KEYMAN_ROOT/resources/build/node.inc.sh"
BUNDLE_CMD="node $KEYMAN_ROOT/web/src/tools/es-bundling/build/common-bundle.mjs"
BUILD_DIR="/web/src/engine/osk/gesture-processor/build"
################################ Main script ################################
@ -46,8 +44,8 @@ function do_build_module() {
# Build
tsc --build $builder_verbose
$BUNDLE_CMD "${KEYMAN_ROOT}/${BUILD_DIR}/obj/index.js" \
--out "${KEYMAN_ROOT}/${BUILD_DIR}/lib/index.mjs" \
node "$LIB_BUNDLER" "${KEYMAN_ROOT}/${BUILD_DIR}/obj/index.js" \
--out "${KEYMAN_ROOT}/${BUILD_DIR}/lib/index.mjs" \
--format esm
}

View file

@ -9,8 +9,6 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "$KEYMAN_ROOT/web/common.inc.sh"
. "$KEYMAN_ROOT/resources/build/utils.inc.sh"
BUNDLE_CMD="node $KEYMAN_ROOT/web/src/tools/es-bundling/build/common-bundle.mjs"
BASE_DIR="/web/src/engine/osk/gesture-processor"
BUILD_DIR="${BASE_DIR}/build"
@ -71,8 +69,8 @@ function do_build_fixture() {
function do_build_testmodule() {
compile "" "${THIS_SCRIPT_PATH}/unit-test-resources" "${KEYMAN_ROOT}/${BUILD_DIR}/tools"
$BUNDLE_CMD "${KEYMAN_ROOT}/${BUILD_DIR}/tools/obj/index.js" \
--out "${KEYMAN_ROOT}/${BUILD_DIR}/tools/lib/index.mjs" \
node "$LIB_BUNDLER" "${KEYMAN_ROOT}/${BUILD_DIR}/tools/obj/index.js" \
--out "${KEYMAN_ROOT}/${BUILD_DIR}/tools/lib/index.mjs" \
--format "esm"
}

View file

@ -7,7 +7,7 @@ set -eu
# This script operates from the perspective of its own directory.
THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")"
cd $(dirname "$THIS_SCRIPT")
cd "$(dirname "$THIS_SCRIPT")"
# On Windows, `node extractor.cjs` cannot be directly piped; that requires `node.exe`.
# But that doesn't make sense on other platforms, so... wrapper script.

View file

@ -40,8 +40,6 @@ builder_describe_outputs \
build:worker-main "/web/src/engine/worker-main/build/obj/lmlayer.js" \
build:worker-thread "/web/src/engine/worker-thread/build/obj/worker-main.wrapped.js"
BUNDLE_CMD="node ${KEYMAN_ROOT}/web/src/tools/es-bundling/build/common-bundle.mjs"
#### Build action definitions ####
# We can run all clean & configure actions at once without much issue.

View file

@ -13,8 +13,7 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "$KEYMAN_ROOT/resources/build/utils.inc.sh"
. "$KEYMAN_ROOT/resources/build/node.inc.sh"
BUNDLE_CMD="node $KEYMAN_ROOT/web/src/tools/es-bundling/build/common-bundle.mjs"
. "$KEYMAN_ROOT/web/common.inc.sh"
################################ Main script ################################
@ -47,8 +46,8 @@ function do_build() {
tsc -b ./tsconfig.all.json
# esbuild-bundled products at this level are not intended to be used for anything but testing.
$BUNDLE_CMD "${KEYMAN_ROOT}/web/src/engine/predictive-text/worker-main/build/obj/web/index.js" \
--out "${KEYMAN_ROOT}/web/src/engine/predictive-text/worker-main/build/lib/web/index.mjs" \
node "$LIB_BUNDLER" "${KEYMAN_ROOT}/web/src/engine/predictive-text/worker-main/build/obj/web/index.js" \
--out "${KEYMAN_ROOT}/web/src/engine/predictive-text/worker-main/build/lib/web/index.mjs" \
--format esm
}

View file

@ -19,9 +19,7 @@ WORKER_OUTPUT_FILENAME=build/lib/worker-main.js
INTERMEDIATE=./build/intermediate
LIB=./build/lib
bundle_cmd="node ${KEYMAN_ROOT}/web/src/tools/es-bundling/build/common-bundle.mjs"
SRCMAP_CLEANER="node $KEYMAN_ROOT/web/build/tools/building/sourcemap-root/index.js"
SRCMAP_CLEANER="${KEYMAN_ROOT}/web/build/tools/building/sourcemap-root/index.js"
################################ Main script ################################
@ -62,26 +60,26 @@ function do_build() {
# The ES6 target needs no polyfills - we go straight to the wrapped version.
$bundle_cmd src/main/worker-main.ts \
--out $INTERMEDIATE/worker-main.js \
node "$LIB_BUNDLER" src/main/worker-main.ts \
--out $INTERMEDIATE/worker-main.js \
--charset "utf8" \
--target "es6" \
--sourceRoot '@keymanapp/keyman/web/src/engine/predictive-text/worker-thread/src/main'
$SRCMAP_CLEANER \
node "$SRCMAP_CLEANER" \
$INTERMEDIATE/worker-main.js.map \
$INTERMEDIATE/worker-main.js.map \
--clean
$bundle_cmd src/main/worker-main.ts \
--out $INTERMEDIATE/worker-main.min.js \
node "$LIB_BUNDLER" src/main/worker-main.ts \
--out $INTERMEDIATE/worker-main.min.js \
--minify \
--charset "utf8" \
--profile build/filesize-profile.log \
--target "es6" \
--sourceRoot '@keymanapp/keyman/web/src/engine/predictive-text/worker-thread/src/main'
$SRCMAP_CLEANER \
node "$SRCMAP_CLEANER" \
$INTERMEDIATE/worker-main.min.js.map \
$INTERMEDIATE/worker-main.min.js.map \
--clean

View file

@ -39,9 +39,9 @@ fi
if builder_start_action build; then
tsc --build "$THIS_SCRIPT_PATH/src/tsconfig.json"
$BUNDLE_CMD "${KEYMAN_ROOT}/web/src/engine/sentry-manager/build/obj/index.js" \
--out "${KEYMAN_ROOT}/web/src/engine/sentry-manager/build/lib/index.js" \
--sourceRoot "@keymanapp/keyman/web/src/engine/sentry-manager/build/lib/"
node "${LIB_BUNDLER}" "${KEYMAN_ROOT}/web/src/engine/sentry-manager/build/obj/index.js" \
--out "${KEYMAN_ROOT}/web/src/engine/sentry-manager/build/lib/index.js" \
--sourceRoot "@keymanapp/keyman/web/src/engine/sentry-manager/build/lib/"
builder_finish_action success build
fi

View file

@ -31,9 +31,9 @@ builder_parse "$@"
function do_build ( ) {
tsc --build "$THIS_SCRIPT_PATH/tsconfig.json" $builder_verbose
$BUNDLE_CMD "${KEYMAN_ROOT}/web/build/$SUBPROJECT_NAME/obj/renderer_core.js" \
--out "${KEYMAN_ROOT}/web/build/$SUBPROJECT_NAME/lib/bulk_render.js" \
--sourceRoot "@keymanapp/keyman/web/build/$SUBPROJECT_NAME/lib/"
node "${LIB_BUNDLER}" "${KEYMAN_ROOT}/web/build/$SUBPROJECT_NAME/obj/renderer_core.js" \
--out "${KEYMAN_ROOT}/web/build/$SUBPROJECT_NAME/lib/bulk_render.js" \
--sourceRoot "@keymanapp/keyman/web/build/$SUBPROJECT_NAME/lib/"
# To ensure it's available to the testing pages when served via localhost or build agent.
cp "${KEYMAN_ROOT}/node_modules/@zip.js/zip.js/dist/zip.min.js" \

View file

@ -33,8 +33,8 @@ do_build ( ) {
compile $SUBPROJECT_NAME
# Base product - the main keyboard processor
$BUNDLE_CMD "${KEYMAN_ROOT}/web/build/$SUBPROJECT_NAME/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/$SUBPROJECT_NAME/lib/index.mjs" \
node "${LIB_BUNDLER}" "${KEYMAN_ROOT}/web/build/$SUBPROJECT_NAME/obj/index.js" \
--out "${KEYMAN_ROOT}/web/build/$SUBPROJECT_NAME/lib/index.mjs" \
--format esm
}