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
The doModifierPress function was testing against the 'actual' device
rather than the virtual device, which meant that in the web debugger on
a desktop, testing a touch device, it was effectively testing against
the desktop device data rather than the simulated touch device data.
I did not observe any significant differences in behaviour between the
two modes. So I am not 100% confident that this change is necessary. But
it is a little concerning that there was a mismatch here.
Fixes#7616.
Fixes a crash when attempting to infer key cap text from key id, and
cleans up the support for inferred key text so that it works correctly
in the designer.
Also adds a safeguard to KMW to stop invalid key ids causing a crash.
* `builder_has_action` renamed to `builder_start_action`
* `builder_report` renamed to `builder_finish_action`
* `builder_has_action` created to be a silent test for the action
* Added reasonably comprehensive documentation.
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#6910.
Regression introduced in #6874 / #6849 (which themselves were improving
the Caps Lock situation).
Ensures that either `NO_CAPS` or `CAPS` is always set in the modifier
flags.