Compiles a LDML keyboard .xml down to a KeymanWeb .js file. Currently
only supports some metadata.
Next step is to generate touch layout data, then to embed the binary kmx
data.
Fixes#7408.
For kmc*.cmd, enables source maps. If you are running kmc from node on
your own system, you may need to enable source maps in other ways.
Note that error reports should be going through to Sentry, and source
maps should already be used for those.
Splits file format reading, writing, and in-memory structures of .kmx,
.kvk, .kvks, .xml (ldml keyboard) into separate common module. Lots of
little fixups, sorry...
This will make it much easier for us to reuse these readers and writers
in future code.
Now has a shared object for all tests, reset between tests, and if the
test fails, prints any reported compiler messages.
Also updates kvk and kvks tests with refactored names from previous
commit.
Part of #7238.
Supports reading and writing .kvk files, and reading .kvks files,
to/from an in-memory VisualKeyboard object.
TODO:
- Full validation of .kvks files
- Writing .kvks files
- Some cleanup of API surfaces for consistency
Mocha with ts-register was failing with an error for Keyman Developer
Server.
```
Error: Debug Failure. False expression: Non-string value passed to
`ts.resolveTypeReferenceDirective`, likely by a wrapping package working
with an outdated `resolveTypeReferenceDirectives` signature. This is
probably not a problem in TS itself.
```
The `^4.5.4` version reference for typescript was too lax, and so npm
gave us typescript 4.8.3, which was the latest version in use in the
repo in this branch (in kmc-model). This is also why the build only
failed on this branch -- on master branch, the latest version referenced
was still 4.5.4.
Changing to `~4.5.4` ensures that it stayed on the 4.5.x series, and
mocha then ran version 4.5.5 of tsc.
This is something we should resolve when we move the entire repo to tsc
4.8+. Currently we are still on 4.5.
Note: it may be sensible to review all versioning for typescript,
because the minor version changes are causing functionality breaks,
which kinda violates the spirit of semver ("MINOR version when you add
functionality in a backwards compatible manner"). We can be more
restrictive by updating all package.json references to typescript to
`~4.5.4` instead of the current `^4.5.4` in use throughout. If/when we
do this, we will need to check our ts-node references also.
kmc-package had a number of gaps and errors. This fixes a bunch of
problems:
* Wrong case on XML elements
* Wrong metadata in system element
* Missing kmp.json in Files array (needs test in consumer apps later)
* Missing displayFont, oskFont in keyboard elements
* Including copyLocation when == 0
* Including an empty startMenu element
* Incorrect assumptions about location of source files in source/ folder
Note that support for followKeyboardVersion will come later; for now, it
uses the possibly-stale value from the Keyboard element in the .kps
file.
Removes Keyman Developer Server's transitive dependency on dicer by
updating multer to `1.4.5-lts.1`, which updates its dependency on
busboy.
See
https://github.com/expressjs/multer/pull/1097#issuecomment-1141286771
for reasoning behind use of `-lts.1` rather than a full release
version.
At some point in the future, multer will publish a full release with
this fix, at which point we can move back to a full release version.
* Add a bunch of tests for keys
* Add tests for version. (improves meta test coverage to 100%)
* A bit more consistency cleanup also of error message functions.
* Adds a compiler failure (FATAL) if compile fails after validate
passes.
* Overall test coverage now 93.5% lines. Biggest gap still kmx-builder.
All compiler units are >90%.