In order to maintain roughly the current build artifact size, strip out
the unfinished core integration from what we merge with preflight.
Test-bot: skip
Build-bot: release:android,ios,developer,web
The convention is to use the `.d.ts` extension for typescript types, and
that's what is used elsewhere in the `package.json` file. This change
fixes the two instances that had `.d.js`.
The export of `test-index.ts` were intended to be used by tests only,
but over time they contained also exports that were consumed else where,
e.g. in UI classes like `kmwuibutton.ts`. This change removes unused
exports, moves test-only classes to a `unitTestEndPoints` container and
marks test-only types with `@internal`.
Build-bot: skip build:web
Test-bot: skip
To reduce the number of possible failure cases within KeymanWeb,
require variableStoreSerializer to always be initialized. This impacts
only unit tests in practice. There remains a unit test special case in
the variable store code itself which needs to be removed in the future.
Create a mock VariableStoreTestSerializer class so that unit tests can
run without impacting state or requiring cookies. (We should leverage
this in future tests to verify that variable stores are saved
correctly.)
Establish keyman/test/headless-resources, so that we can include shared
resources such as VariableStoreTestSerializer without creating a
dependency on either DOM or Node.
PR #15093 merged multiple engine modules into one. However, in doing so
we lost the .js tests and ran only the .ts ones. This change re-adds the
.js tests and fixes them where the code diverged since then.
Other changes:
- rename `queryEngine.ts` to `cloudQueryEngine.ts` to match the class name
- remove unused `keyboard-storage/cloud/index.ts`
- expose `CLOUD_TIMEOUT_ERR` and `CLOUD_STUB_REGISTRATION_ERR` as
`unitTestEndpoints`
- add `test/resources` to exports in `web/package.json`. This was necessary
because the compiled .ts test files are under `web/build` whereas the
.js test files are under `web/src` and so the relative paths in imports
no longer work. Also fix the imports in test files.
- apply fix from #15477 if KEYMAN_ROOT is not set
I'm not happy to put the compiled files under
`web/src/test/auto/resources/build`, but that's the only way I got it
to work. If I put the compiled files in `web/build/test/resources` it
couldn't find the types for `promise-status-async`.
Also, running the .js tests succeeded but then creating the coverage
report failed. I was not able to find the reason or a fix for that. As a
hack to work around this problem we check the number of failed tests
instead of relying on the exit code of the test.
Follows: #15093
Test-bot: skip
This change moves the core adapter to core-adapter module which contains
the code to bind to the the WASM core binaries and adds additional type
definitions for Core.
Part-of: #13926
Test-bot: skip
In order to simplify and make the build significantly faster, as well as
reduce duplication of configuration files, we have merged most of the
engine modules into a single module, engine:
* engine/attachment
* engine/core-processor
* engine/dom-utils
* engine/element-wrappers
* engine/events
* engine/interfaces
* engine/js-processor
* engine/keyboard
* engine/keyboard-storage
* engine/main
* engine/osk
A few test-specific files have been moved from engine to test, such as
nodeCloudRequester.ts and nodeKeyboardLoader.ts.
Some of the npm audit warnings left after #13897 require an updated `mocha` version to remedy. As we only really use `mocha` to do unit-testing, it should be safe to update if all of our existing tests pass with the new version.
Test-bot: skip
#11746 removed the `ts-node` dependency. Unfortunately that broke running
TypeScript test files with Mocha in VSCode Test Explorer because it no
longer knows what to do with .ts files. This change adds the more modern
`tsx` package as developer dependency, which allows to use Test Explorer
again.
See https://stackoverflow.com/a/77609121.
#11746 removed the `ts-node` dependency. Unfortunately that broke running
TypeScript test files with Mocha in VSCode Test Explorer because it no
longer knows what to do with .ts files. This change adds the more modern
`tsx` package as developer dependency, which allows to use Test Explorer
again.
See https://stackoverflow.com/a/77609121.
`gesture-processor/src/test/auto/browser/web-test-runner.config.mjs`
run the tests on iOS and Android. However, if we enable these browsers
in `web/src/test/auto/dom/web-test-runner.config.mjs` we get failing
tests in osk, therefore these browsers are commented for now.
- add temporary function to Core for this POC
- add new CoreProcessor to access Keyman Core WASM
- add unit tests for new core processor
- add code to KeymanEngine and InputProcessor to load the new CoreProcessor
- add web server to manual tests and new action `start` to build script
This change requires the manual tests to be loaded from a web server
instead of loaded as file, because otherwise the wasm code won't be
loaded.
Currently we always load CoreProcessor. This should be improved in a future
change to only load when it is actually needed.
Part-of: #11293
Move parts of `common/web/keyboard-processor/` →
`web/src/engine/js-processor/`.
Note this temporarily disable tests for keyboard-processor which depend on
js-processor, until #12110 is fixed.
Fixes: #12067