Improves build script performance by:
* using built-ins wherever possible (e.g. string splitting)
* eliminating redundant code
* using absolute (to $KEYMAN_ROOT) rather than relative paths to avoid realpath
* removing unnecessary `npm run` calls
BEFORE | AFTER
-------------------------------|----------------------
time ./core/build.sh --help |
real 0m2.116s | real 0m0.874s
user 0m0.578s | user 0m0.198s
sys 0m0.984s | sys 0m0.289s
-------------------------------|----------------------
time ./web/build.sh --help |
real 0m3.523s | real 0m0.757s
user 0m1.166s | user 0m0.320s
sys 0m2.273s | sys 0m0.455s
-------------------------------|----------------------
time ./web/build.sh -d |
real 1m34.750s | real 0m59.974s
user 0m9.721s | user 0m6.284s
sys 0m19.652s | sys 0m13.202s
@keymanapp-test-bot skip
When using the touch 'system' keyboard, the modifier keys are reset by
the kbdMismatch logic introduced in #7543. This is evident in the web
debugger of Keyman Developer, where the system keyboard is easily
accessible.
This maintains the fix from #7543, but removes the `resetContext()`
side-effect.
Fixes up scripts (except under /linux) to use `#!/usr/bin/env bash`
instead of `#!/bin/bash` or `#!/bin/sh` so that we don't end up with
the ancient version of bash supplied with macOS.
This became urgent with this PR, because of bash-4.xisms in
build-utils.sh, for example on line 572:
```
if [[ -v _builder_params[$e] ]]; then
```
Fixes#6788.
Fixes KEYMAN-WEB-22.
Fixes KEYMAN-DEVELOPER-BQ.
Fixes KEYMAN-ANDROID-160.
Fixes a crash introduced in #6473 which was trying to prevent modifier
keys from triggering "fat finger" alternate lookups, due to incomplete
nullish coalescing.
Related to this, from what I can see, a secondary side-effect of the fix
in #6473 was that some key events may have never had their ruleBehaviors
finalized if they matched the `isOnlyLayerSwitchKey` heuristic, leading
to potential issues with edge case 'deadkey+layer switch' keys or keys
that set store values, for example. So this fix also makes the
`isOnlyLayerSwitchKey` test more targeted.
Identified this when adding a Caps Lock layer to sil_euro_latin and
testing the layer switching. At time of fix, the error had been raised
in KeymanWeb, Keyman Developer and Keyman for Android, but not yet
Keyman for iPhone and iPad.