Commit graph

347 commits

Author SHA1 Message Date
Marc Durdin
e28da7b1dd fix(developer): kmc was overwriting kmx with kvk 2022-09-30 07:54:39 +10:00
Marc Durdin
0b701275fd chore(developer): remove unused var 2022-09-28 15:25:35 +10:00
Marc Durdin
0f961bd674 feat(developer): visual keyboard compiler in kmc
Adds support for building .kvk files to kmc. At present, .kvk will
always be generated, even if the .xml does not have a hardware layer.
2022-09-27 15:16:07 +10:00
Marc Durdin
b6abe7432a feat(developer): emit .kvk plus e2e test
Adds visual-keyboard-compiler and corresponding e2e test.
2022-09-27 15:03:31 +10:00
Marc Durdin
03c3c40f29 chore(developer): remove visual-keyboard-compiler.ts 2022-09-27 13:42:56 +10:00
Marc Durdin
26e32a0124 refactor(developer): split file type management into package
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.
2022-09-27 12:33:10 +10:00
Marc Durdin
52dd3e0e85 refactor(developer): move compiler callbacks out of kvks file reader 2022-09-27 05:04:04 +10:00
Marc Durdin
5c65405f65 refactor(developer): move compiler callbacks out of ldml xml reader 2022-09-27 04:52:00 +10:00
Marc Durdin
9480d8931e chore(developer): remove commented code 2022-09-26 20:41:59 +10:00
Marc Durdin
74fc795c1c feat(developer): refactor CompilerCallbacks in tests
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.
2022-09-26 20:07:00 +10:00
Marc Durdin
50db7a2c9b feat(developer): add schemas for .kvk and .kvks
Also minor tweaks around reading .xml files.
2022-09-26 20:05:52 +10:00
Marc Durdin
c7740a39a2 feat(developer): kvk support
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
2022-09-26 09:29:38 +10:00
Marc Durdin
828cbdf584
Merge pull request #7341 from keymanapp/feat/developer/epic-ldml/7277-kmc-makes-keyboard-packages
feat(developer): fixes to kmc-package for keyboard support 🙀
2022-09-24 10:12:38 +10:00
Marc Durdin
0502d6ccbd
Merge pull request #7342 from keymanapp/chore/epic-ldml/merge-master-to-feature-ldml
chore: merge master into feature-ldml 🙀
2022-09-24 10:12:00 +10:00
Steven R. Loomis
03012248a2 chore(windows): remove crc32 from tike 2022-09-23 11:48:47 -05:00
Steven R. Loomis
700db810e0 fix(core): fix for incorrect earlier fix 2022-09-22 17:26:39 -05:00
Steven R. Loomis
de3225a4f5 Merge remote-tracking branch 'origin/feature-ldml' into chore/core/7276-checksums-epic-ldml 2022-09-22 17:13:27 -05:00
Marc Durdin
33fd8cffba chore(developer): ts v4.8.3 upgrade breaks mocha 10.0.0 with ts-node
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.
2022-09-23 05:25:24 +10:00
Marc Durdin
6f949ad63f chore(developer): fixup dependency type changes
* xml2js, `emptyTag` property: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/59259
* semver `parse` `includePrerelease` property: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/61586#discussion_r939877412
* commander use needed to be declared for hextobin
2022-09-22 11:46:44 +10:00
Steven R. Loomis
93a9509302 chore(core): delete crc32.cpp and crc32.pas from some places 2022-09-21 18:13:19 -05:00
Marc Durdin
cae408edc5 chore: merge feature-ldml into branch 2022-09-21 14:56:45 +10:00
Marc Durdin
f3fbf01d30 feat(developer): fixes to kmc-package for keyboard support
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.
2022-09-21 14:37:08 +10:00
Marc Durdin
bd5f6877bb feat(developer): fixup fixture json 2022-09-21 14:33:04 +10:00
Marc Durdin
2b9a2949a6 feat(developer): kmc-package khmer_angkor fixture 2022-09-21 14:32:42 +10:00
Marc Durdin
55f302d929
Merge pull request #7322 from keymanapp/chore/merge-master-to-feature-ldml
chore: merge master into feature-ldml 🙀
2022-09-20 13:42:40 +10:00
Marc Durdin
d1de02d43e chore(developer): Merge branch 'master' into chore/developer/server-node-gyp-dependency 2022-09-20 10:19:11 +10:00
Marc Durdin
9f290cac21 chore(developer): Merge branch 'master' into chore/developer/server-update-multer-dependency 2022-09-20 10:16:46 +10:00
Marc Durdin
aab9d1aad5 chore(developer): Merge branch 'master' into chore/developer/server-node-gyp-dependency 2022-09-20 10:14:16 +10:00
Steven R. Loomis
66281da0e0
Update developer/src/kmcmpdll/Compiler.cpp
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-09-19 14:59:46 -05:00
Marc Durdin
93a1fc88b9 chore(developer): remove crc generation from kmc-keyboard 2022-09-19 15:30:38 +10:00
Marc Durdin
a59a6c334a chore: update node-windows-trayicon to update node-gyp to 9.1.0 2022-09-19 15:07:24 +10:00
Marc Durdin
3d61d18371 chore(developer): update multer dependency for server
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.
2022-09-19 12:36:51 +10:00
Marc Durdin
ee47e49568 chore(developer): fixup build path for kmc 2022-09-19 08:42:27 +10:00
Marc Durdin
e840f04ccf chore(common): make scripts executable and add pre-commit test 2022-09-19 06:39:13 +10:00
Marc Durdin
5a9495c548 chore(developer): fixup tests for kmlmc, kmlmp 2022-09-19 06:37:30 +10:00
Marc Durdin
4e396224d0 chore(developer): fixup external refs to kmc 2022-09-19 06:36:56 +10:00
Marc Durdin
003f23d7b4 feat(developer): fixup and prepare build scripts and docs for kmc 2022-09-19 06:36:06 +10:00
Marc Durdin
2d55546e55 refactor(developer): command-line wrappers for kmc 2022-09-19 06:33:51 +10:00
Marc Durdin
9c623ed872 refactor(developer): split kmlmc into kmc-model, kmc-model-info, kmc-package 2022-09-19 06:30:50 +10:00
Marc Durdin
97f4951f50 refactor(developer): move kmc modules to kmc-keyboard 2022-09-19 06:26:32 +10:00
dependabot[bot]
93ec6106e1
chore(deps): bump nanoid and mocha
Bumps [nanoid](https://github.com/ai/nanoid) and [mocha](https://github.com/mochajs/mocha). These dependencies needed to be updated together.

Removes `nanoid`

Updates `mocha` from 8.4.0 to 10.0.0
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v8.4.0...v10.0.0)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
- dependency-name: mocha
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-16 21:06:23 +00:00
Steven R. Loomis
d56f6557fb chore(core): deprecate checksum in 16.0 🙀
- do not generate unless version<16.0
- never check checksum

Fixes: #7220
2022-09-16 14:24:01 -05:00
Steven R. Loomis
efd4c83490 chore(core): ignore checksum in 16.0 🙀
- mark as deprecated

Fixes: #7220
2022-09-16 14:24:01 -05:00
Marc Durdin
3f818af46b
chore: Update developer/src/kmc/test/fixtures/sections/meta/invalid-version-1.0.xml 2022-09-16 09:25:57 +10:00
Marc Durdin
ba88412dfe chore(developer): improve kmc validation and corresponding tests
* 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%.
2022-09-14 11:47:14 +10:00
Marc Durdin
110f6ffbbd feat(developer): add kmx metadata to kmxplus compiles
Fixes #7273.

Adds 4 kmx system stores to allow existing configuration tools to load
and process KMXPlus files without modification:

* `TSS_NAME` (first `<name>`)
* `TSS_COMPILEDVERSION` (only if `options.addCompilerVersion == true`)
* `TSS_KEYBOARDVERSION` (from `<version number>`)
* `TSS_TARGETS` (currently always 'desktop', will later include more
  targets)

In order for `TSS_COMPILEDVERSION` to be handled correctly, needed to
plumb in the new `CompilerOptions` interface. This could be a separate
PR, but the changes are not huge, so opted to append the changes here.

Updates related tests and fixtures. Refactored some of the e2e helpers
into helpers/index.ts for use with the metadata-compiler tests.
2022-09-14 09:26:22 +10:00
Marc Durdin
ea902d2f1c
Merge pull request #7225 from keymanapp/fix/developer/7028-touch-layout-desktop-view-has-broken-format
fix(developer): hide key-sizes when in desktop layout in touch layout editor
2022-09-13 11:31:15 +10:00
Marc Durdin
3fd9df5277 chore(core): Merge branch 'feature-ldml' into chore/core/7247-use-builder-for-build-sh 2022-09-13 07:25:10 +10:00
Marc Durdin
3e6d9356c3
Merge pull request #7255 from keymanapp/chore/7222-optional-checksum
chore: make checksum optional 🙀
2022-09-13 06:30:04 +10:00
Marc Durdin
74a6c65710
Merge branch 'feature-ldml' into chore/merge-master-into-feature-ldml 2022-09-12 15:24:19 +10:00