This requires a significant refactor to the compiler interfaces to allow
for asynchronous filesystem and network access. For now, only kmc-copy
uses the asynchronous interfaces, but over time we may try and
consolidate them where other compiler modules find them useful. This
adds a big set of unit test fixtures to avoid network instability in
tests (the fixtures can be regenerated by setting environment variable
`TEST_SAVE_FIXTURES`).
- remove vendored xml2js
- add fast-xml-parser@4.5.0
- Rewire the KeymanXMLReader / KeymanXMLWriter to use fast-xml-parser
Four small changes to the test data on the generated .kvks:
- allow " for XML generation (" is legal)
- use the same XML prologue as the actual .kvks files.
- treat <key></key> as <key/> since we can't distinguish
(removed a "_": "" entry)
- remove whitespace because we now can ("_": "\n \n \n") on non-leaf nodes.
This is ignored by the kvks code, but was difficult to maintain roundtrip.
Fixes: #12208
The visual keyboard compiler was never finished in 17.0. This rewrites
it to:
1. Use the kmxplus data rather than reading from xml directly
2. Fill in `visualkeyboard.header.kbdname`
3. Support modifiers
4. Handle encoded characters like `\u{1234}`
5. Handle string variables like `${one}`*
Additional unit tests have been added to verify the behavior of the
visual keyboard compiler in more detail.
TODO-LDML: string variables appear to have a secondary bug -- they seem
to be returning the string 'undefined'. I have disabled the related
tests and will examine this separately, and enable those tests once
fixed.
TODO-LDML: we should probably add a compiler warning + unit test for
`<layers formId="us"><layer id="base">`, because this pattern does not
make sense: when using non-touch forms, the `<layer>` element should use
`modifiers` attribute, and correspondingly, `modifiers` attribute should
_not_ be used when `formId` is `touch`.
Other fixes:
1. The LDML XML reader was relying on its input being a Node.js `Buffer`
even though it was declared `Uint8Array`, as it implicitly used
`Buffer.toString()` to do text conversion. (`Buffer` subclasses from
`Uint8Array`). This breaks when using `Uint8Array` directly and means
we had an implicit dependency on Node.js. See also #12331.
2. XML errors were not captured in the LDML XML reader. See also #12331.
3. The unused and unfinished touch-layout-compiler.ts and
keymanweb-compiler.ts have been removed along with corresponding unit
tests and fixtures. These are replaced by Core implementations; see
#12291.
Fixes: #12395
#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.
Previously running the tests failed because it couldn't find ICU 70 when
running webkit. Ubuntu 24.04 Noble comes with ICU 74. Updating
playwright to 1.46 fixes this.
`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.
This moves `common/predictive-text/` →
`web/src/engine/predictive-text/worker-main/`.
This also moves `common/test/predictive-text/` →
`web/src/test/manual/predictive-text/`. Note though that this testing
tool is still broken.
Fixes: #12134
The way that Server is built for local distribution does not currently
handle transitive dependencies for @keymanapp dependencies well. So,
this adds four dependencies from @keymanapp/developer-utils to Server so
that they will be available in the packaged deployment.
A future improvement could be to package developer-utils using npm
packaging tools, but these struggled with bundling monorepo dependencies
in the past also.