Commit graph

183 commits

Author SHA1 Message Date
Marc Durdin
45a6291a3e refactor(developer): move ttfInfo to developer-utils
We will need ttfInfo in kmc-package, so move it to the shared module.
2025-01-20 09:19:47 +07:00
Marc Durdin
67a1622c42 fix(developer): filter incorrect fonts out of .keyboard_info
The font collection code was somewhat wrong in kmc-keyboard-info. It
collected all fonts referenced in the package, even for multi-keyboard
packages, which meant that the .keyboard_info file listed all fonts for
all languages. Furthermore, if a font was referenced in multiple
language entries in the .kps, then it would be repeated for each
language in the .keyboard_info. This patch addresses both of these bugs.

The good news is that this makes some of the .keyboard_info files
smaller. In particular, fv_all.keyboard_info goes from 4675 lines down
to 695 lines!

Fixes: #12852
2025-01-16 11:04:22 +07:00
Marc Durdin
2c97590904 test(developer): add test for ERROR_DescriptionIsMissing to kmc-keyboard-info
Originally reported in #12202. Check was added in #12204, backported to
17.0.329 in #12207, but #12597 reports this for 17.0.331. So added test
to verify that it is working as expected (it is).

Note that this only applies when using the `--for-publishing` build flag
in kmc, because it is checked in the kmc-keyboard-info stage. Guessing
this is where the confusion arose.

Consolidated tests which used a common pattern for kmc-keyboard-info
calls. The remaining tests do stubs or calls into internal functions, so
they cannot be easily deduped.

Fixes: #12597
2024-12-09 06:22:11 +07:00
Marc Durdin
148938eb1d fix(developer): honour provided script when checking for matching scripts
Fixes: #12765
2024-12-04 12:51:00 +07:00
Marc Durdin
f3191b9297 feat(developer): report on mismatching lang tag scripts when building keyboard-info
This went into kmc-keyboard-info because we already do a lot of
processing there against langtags.json, whereas we do not currently have
langtags.json in kmc-package.

Adds an associated unit test.

Fixes: #12752
2024-12-02 12:20:26 +07:00
Marc Durdin
cd8825d504
Merge pull request #12736 from keymanapp/refactor/developer/unify_test_action
refactor(developer): unify test action
2024-12-01 00:14:11 +01:00
Eberhard Beilharz
66404f9503
chore(developer): rename test files
This change rename the test files for Developer according to the
discussion at the Keyman conference in November 2024.
2024-11-28 14:32:09 +01:00
Marc Durdin
70a32f00d7 refactor(developer): unify test action 2024-11-28 15:16:25 +07:00
Eberhard Beilharz
21736d8817
refactor(developer): output number of tests when running on TC
This change adds the mocha-teamcity-reporter which outputs the running
tests in a special format that TeamCity can interpret. This allows TC
to show which tests run as well as the number of tests run.

Also refactor some of the build scripts to use functions.

Note that we had to explicitly add `--check-coverage=false` (which is the
default) to get successful builds when we run on TC.
2024-11-27 11:41:06 +01:00
Marc Durdin
2a21231aee
Merge pull request #12205 from keymanapp/fix/developer/12193-enforce-version-string-when-no-followkeyboardversion
fix(developer): enforce presence of Version field when FollowKeyboardVersion is not set, in package compiler
2024-08-16 23:12:30 +10:00
Marc Durdin
1cbd061c05 chore(developer): remove impossible test for missing version 2024-08-16 08:54:27 +02:00
Marc Durdin
50d0107f38 fix(developer): enforce presence of kps Info.Description field in info compilers
The Description field should be required for published keyboards and
models, so this change means kmc-keyboard-info and kmc-model-info will
report an error if it is missing.

Relates-to: keymanapp/keyboards#3037
Relates-to: keymanapp/lexical-models#262
Fixes: #12202
2024-08-16 08:04:18 +02:00
Marc Durdin
32b4711659
Merge branch 'master' into refactor/common/9665-move-compiler-interfaces-to-developer 2024-08-07 15:15:45 +10:00
Marc Durdin
e67aed1606 refactor(common): move compiler-interfaces to @keymanapp/developer-utils
This should be the last step in the refactoring.

Fixes: #9665
2024-08-02 13:49:59 +07:00
Marc Durdin
d8986be12f refactor(common): merge master into branch 2024-08-01 07:07:07 +07:00
Marc Durdin
eb43f81d43
Update developer/src/kmc-keyboard-info/build.sh 2024-08-01 09:16:29 +10:00
Marc Durdin
dbcc70cfa6
Update developer/src/kmc-keyboard-info/build.sh 2024-08-01 08:58:26 +10:00
Marc Durdin
d1e351a1ac
Revert "chore(developer): remove redundant references from tsconfig.json" 2024-08-01 08:57:27 +10:00
Marc Durdin
1cff1a5084 chore(developer): remove redundant references from tsconfig.json
With the full move to ES Modules, we no longer need to include
`references` in tsconfig.json, as we can rely on package.json and
build.sh dependency management. Note however that `tsc -b` may not work
to build dependencies -- they need to be built using `build.sh`, which
calculates which dependencies need building.

kmc-keyboard-info was missing a dependency link to kmc-package in
build.sh, correcting this at the same time.

Relates-to: #12027
2024-07-27 05:44:22 +07:00
Marc Durdin
1afa4beb01 fix(developer): remove paths from tsconfig.json
Fixes: #12027
2024-07-26 06:59:45 +07:00
Marc Durdin
7d79bb6a2f chore(developer): remove spurious debugger line 2024-07-23 09:06:32 +07:00
Marc Durdin
c5799502dd fix(developer): kmc-keyboard-info: use default version 1.0 if version information missing
Also add unit test.

Fixes: #11856
2024-07-21 15:41:22 +10:00
Marc Durdin
b0ff102b45
Merge pull request #11735 from keymanapp/fix/developer/11362-verify-email-addresses-in-package
fix(developer): verify email addresses in .kps and .keyboard_info
2024-06-13 10:04:00 +10:00
Joshua A. Horton
d07fa7e953 chore(common): eliminate ts-node ref from most subpackages 2024-06-10 10:07:58 +07:00
Joshua A. Horton
e527317d3a fix(common): remove subpackge entries for older TS version 2024-06-10 09:14:03 +07:00
Marc Durdin
2506ff7c01 fix(developer): verify email addresses in .kps and .keyboard_info
Add verification of email address formats to kmc-package,
kmc-keyboard-info, and kmc-model-info. Add corresponding unit tests for
kmc-package and kmc-keyboard-info (kmc-model-info unit tests will be a
later addition). Uses AJV's email validation regex, as we rely on AJV
for schema compliance tests.

Fixes: #11362
Fixes: KEYMAN-DEVELOPER-1XE
2024-06-07 13:30:21 +07:00
Marc Durdin
f9fa1a685e fix(developer): support Windows and Unicode names in .ttf
The ttfmeta library is extremely rudimentary. It does next to no error
checking, and supports only a small part of the TTF spec. It did not
support NAME platforms 0 or 3 (the most common platform, Windows), and
these are encoded in UTF-16BE. This patch adds support for those
platforms and throws if an unsupported platform/encoding is encountered.

Now, the ttfmeta library is unsupported and gone (#11630). It is based
on another library, ttfinfo, last updated 11 years ago. This is not
great. But the other Node libraries that I located introduce further
dependencies or complex builds (e.g. WASM) and that's not great either,
for a function used only in one place in our build environment.

https://learn.microsoft.com/en-us/typography/opentype/spec/name

The test-font-family.ts runs a basic test against Lateef font, and has
a skipped test that can be run (with minor edits) against all fonts in
the keyboard repository. I have done this to verify that there are no
fonts that return errors, but have disabled this test for deployment for
now.

Fixes: #11625
2024-05-31 15:24:47 +07:00
Marc Durdin
76bd22b120 fix(developer): bundle ttfmeta library internally with kmc-keyboard-info
Remove ttfmeta from package.json, and copy only the relevant files into
ttfmeta/ under kmc-keyboard-info. This is a stopgap measure as we will
probably attempt to identify an alternate library in the future.

See also #11625 which is the driver for making this change now.

Fixes: #11630
2024-05-31 14:54:09 +07:00
Marc Durdin
ee0fc0ce14 chore(developer): cleanup npm publish
Use a new flag `--npm-publish` in conjunction with `publish` action,
so that the default will always be to `npm pack` if the new flag is not
specified. This flag is also guarded in the actual npm publish code to
ensure that it can only run in the appropriate CI alpha/beta/stable
environment, and not in local or test.

This then also removes the separate `pack` action.

Also removes legacy boilerplate from a number of build scripts.
2024-05-20 06:34:57 +07:00
Marc Durdin
c8a1c6aa39 chore(developer): use builder.inc.sh instead of build-utils.sh in build scripts
also, remove old Makefiles
2024-05-20 06:34:46 +07:00
Joshua Horton
887a47930f
Merge pull request #11318 from keymanapp/chore/web/chai-update
chore(web): updates chai, @types/chai dependencies 🏃
2024-05-15 14:10:27 +07:00
Joshua A. Horton
398b9e0ae2 chore(common): drops package-specific 'chai', '@types/chai' versions
chore(web): missed leaving these out of the rebase
2024-05-07 14:35:09 +07:00
Dr Mark C. Sinclair
7dc33d1f7a chore(developer): Merge branch 'master' into test/developer/keyboard-info-compiler-unit-tests-3 2024-05-06 11:16:00 +01:00
Marc Durdin
cd8121ef65 chore(common): builder scripts now use /resources/build/builder.inc.sh
Note: there is a bit of potential confusion about the difference between
/resources/builder.inc.sh (the full implementation for builder scripts),
and /resources/build/builder.inc.sh (the source script that builder
scripts should always use).

This allows us to make assumptions that will always be true for builder
scripts that may not be true for other scripts, such as setting base
folder.
2024-05-02 15:54:31 +07:00
Marc Durdin
0f390d47cc chore(common): maintenance on build scripts - cd
Fixes #11324.

* Always `cd "$THIS_SCRIPT_PATH"`
* Remove unnecessary `cd` from all build.sh
* Remove unnecessary `set -eu` from all build.sh (and `# set -x`)
* Replace old build-utils.sh incantation in a few build.sh scripts
2024-05-02 15:54:29 +07:00
Dr Mark C. Sinclair
90e9999657 chore(developer): replace some local variables with constants 2024-04-25 11:36:54 +01:00
Dr Mark C. Sinclair
e2ba026313 chore(developer): rmove unnecessary async from preinit test 2024-04-25 11:09:37 +01:00
Dr Mark C. Sinclair
e742926dba chore(developer): some further elimination of code redundancy 2024-04-23 11:58:04 +01:00
Dr Mark C. Sinclair
0f0b51f80e chore(developer): clarify element tag name in platforms test 2024-04-23 11:30:45 +01:00
Dr Mark C. Sinclair
00d7b6ccc7 chore(developer): Merge branch 'beta' into test/developer/keyboard-info-compiler-messages-unit-tests-2 2024-04-22 10:38:37 +01:00
Dr Mark C. Sinclair
a001bbd105 chore(developer): add code coverage for schema validation failure 2024-04-18 12:46:57 +01:00
Dr Mark C. Sinclair
ebe8911409 chore(developer): delete temporary comment 2024-04-18 12:11:10 +01:00
Dr Mark C. Sinclair
0f60ecda03 chore(developer): add check run sets related packages correctly test 2024-04-18 12:09:52 +01:00
Dr Mark C. Sinclair
e6f40ad73a chore(developer): simplify a TextDecoder.decode stub 2024-04-18 11:21:06 +01:00
Dr Mark C. Sinclair
5e14f009b9 chore(developer): replace khmer_angkor sources with constant 2024-04-18 10:48:48 +01:00
Dr Mark C. Sinclair
65429bd089 chore(developer): replace some fixture paths with constants 2024-04-18 10:26:41 +01:00
Dr Mark C. Sinclair
687fcee296 chore(developer): remove placeholder comment 2024-04-18 09:57:17 +01:00
Dr Mark C. Sinclair
c7f2916f23 chore(developer): add additional test cases to platform test 2024-04-16 11:38:37 +01:00
Dr Mark C. Sinclair
9903972a30 chore(developer): combine three run platform tests into one multi-case 2024-04-16 11:21:37 +01:00
Dr Mark C. Sinclair
cfcc091be1 chore(developer): add check run sets platforms correctly if no targets provided (with .js file in sources but not .kps) test 2024-04-16 10:49:03 +01:00