Commit graph

4074 commits

Author SHA1 Message Date
Sabine
ca3697b7c2 feat(developer): create our own test.keylayout and use it in tests 2025-04-16 14:07:28 +02:00
Sabine
60f588e996 feat(developer): delete interface rule_object; unversion and move testfiles to test/data; use constants to specify folder 2025-04-15 17:38:43 +02:00
Sabine
1634cc0efb feat(developer): remove interface rule_object and use Rule instead 2025-04-14 14:54:24 +02:00
Sabine
b8e4a79211 feat(developer): use NodeAssert.rejects for tests of run() only; other tests changed back to before 2025-04-08 19:53:21 +02:00
Sabine
2a2b214e7f feat(developer): use chai-as-promised instead of { assert } from 'chai' 2025-04-04 18:30:06 +02:00
Sabine
b07202bbf0 feat(developer): add constant for file subfolder; rename rule_object->rules 2025-04-03 17:54:52 +02:00
Sabine
91bdddf714 feat(developer): move convertToUnicodeCodePoint to util.ts 2025-04-03 16:04:22 +02:00
Sabine
ba12920195 feat(developer): move tests for kmn-file-writer and keylayout-file-reader in separate testfiles 2025-04-03 15:10:19 +02:00
Sabine
c08642f569 feat(developer): move read() and write() to modules 2025-04-02 17:20:56 +02:00
Sabine
c39eeff7c6 feat(developer): use fs and path from callbacks 2025-04-01 12:30:14 +02:00
SabineSIL
b89d55e60a
Merge branch 'epic/kmc-convert' into feat/developer/kmc-convert 2025-03-31 18:51:35 +02:00
Sabine
e3e8874091 feat(developer): rename test files according to new standard 2025-03-31 17:50:10 +02:00
Sabine
0fe56a4d88 feat(developer): change use of Backslash as Path Separator; remove all markers 2025-03-31 10:07:05 +02:00
Marc Durdin
4eb03c862e
Merge branch 'epic/kmc-convert' into chore/merge-master-into-kmc-convert 2025-03-31 12:13:38 +07:00
Marc Durdin
ab59fa29b4
Merge branch 'master' into chore/b18s4-merge-beta-to-master 2025-03-29 05:41:03 +07:00
Marc Durdin
a52437c407 chore: Merge branch 'master' into chore/b18s4-merge-beta-to-master 2025-03-29 05:38:08 +07:00
Marc Durdin
de5a02f8ce chore(developer): rewrap detail on semver LDML message 2025-03-29 04:14:38 +07:00
Sabine
91153a3eaa feat(developer): switch to write/not write rules with associated warnings 2025-03-28 20:12:00 +01:00
Sabine
f24ee130c9 feat(developer): add warning for superior rules 2025-03-28 17:47:50 +01:00
Marc Durdin
dbfe03aa8e chore(developer): improve kmc-ldml 'invalid version' message
Suggested by @Nnyny. Give more detail on the semantic version format for
keyboard version, as well as details on the limitations to semver
imposed by the Keyman toolchain.
2025-03-28 15:01:11 +07:00
Sabine
c25e3d2ffb Merge branch 'feat/developer/kmc-convert' of https://github.com/keymanapp/keyman into feat/developer/kmc-convert 2025-03-28 07:40:04 +01:00
Sabine
8cd457dbce feat(developer): add/remove input files 2025-03-28 07:37:55 +01:00
SabineSIL
734c50b18f
Delete developer/src/kmc-convert/data/MySample.keylayout
delete unused input file
2025-03-27 18:38:13 +01:00
SabineSIL
85047d6f77
Delete developer/src/kmc-convert/data/My_dk_Keyboard.keylayout
delete unused input files
2025-03-27 18:37:14 +01:00
SabineSIL
caf11a00e0
Merge branch 'epic/kmc-convert' into feat/developer/kmc-convert 2025-03-27 18:27:44 +01:00
Sabine
c9570b5011 feat(developer): order of modifiers, final check prevent unwritten rule in rare cases 2025-03-27 18:25:14 +01:00
Sabine
7315f6cb35 feat(developer): enable use without specified output file name 2025-03-26 15:53:35 +01:00
Sabine
56c21bd897 feat(developer): add several .keylayout files to git; rearrange methods 2025-03-26 14:21:37 +01:00
Steven R. Loomis
4f22ab0d9e
Merge pull request #13516 from keymanapp/chore/developer/ldmlcov
chore(developer): improve ldml code coverage 🙀
2025-03-24 17:16:34 -05:00
Steven R. Loomis
18e7686b3e chore(developer): fix build message per review comment
Co-authored-by: Marc Durdin <marc@durdin.net>
2025-03-24 12:29:32 -05:00
Sabine
40e3beca29 feat(developer): split createRuleData to createRuleData and reviewRuleInputData | function comments 2025-03-24 17:24:02 +01:00
Sabine
647fb0afcf feat(developer): remove markers, checkIfCapsIsUsed for upper/lower/mixed case case 2025-03-24 15:36:08 +01:00
Sabine
6505f095e6 Merge branch 'feat/developer/kmc-convert' of https://github.com/keymanapp/keyman into feat/developer/kmc-convert 2025-03-24 10:57:58 +01:00
Marc Durdin
86102c405e
Merge pull request #13191 from keymanapp/dependabot/npm_and_yarn/esbuild-0.25.0
chore(deps-dev): bump esbuild from 0.18.20 to 0.25.0
2025-03-24 11:22:00 +07:00
Marc Durdin
9080d156dc chore(developer): use 'statement' instead of 'command' for messages about kmn statements
In compiler messages, for a long time we have inconsistently used
'command' instead of 'statement' when referring to kmn statements. The
kmn language documentation uses 'statement' fairly consistently.
2025-03-22 05:58:06 +07:00
Steven R. Loomis
692ea6ee9e feat(core): improve kmxplus validation tests
- update basic.txt to include the kvk section #12402
- use run() instead of compile()
- move compile()+serialize to a separate subtest
2025-03-21 17:11:03 -05:00
Sabine
b36b0f6dc6 feat(developer): add test for converter 2025-03-21 16:42:35 +01:00
Sabine
cdada430ee feat(developer): review, tidy up 2025-03-20 18:01:25 +01:00
Marc Durdin
bc4462a312
Merge pull request #13532 from keymanapp/fix/developer/13455-ERROR_TextBeforeOrAfterNulInOutput
fix(developer): add validation of `nul` usage in output part of rule
2025-03-19 06:12:54 +07:00
Steven R. Loomis
4e3379c698 feat(core): improve kmxplus validation tests
- ratchet required coverage level to 90%!
- comment out failing run() test though - run() adds an embedded .kvk

Fixes: #9446
2025-03-18 11:50:28 -05:00
Sabine
169cad76b1 feat(developer): print codepoints instead of numeric character ref. and check for control characters 2025-03-18 14:17:36 +01:00
Marc Durdin
fdd219a481 chore(developer): remove mozhi_malayalam.kmx from baseline fixtures
This is required because it includes rules with nul and other output.
2025-03-18 12:16:40 +07:00
Marc Durdin
5683b370fe fix(developer): add validation of nul usage in output part of rule
If `nul` is used in the output part of a rule, then text or
text-emitting statements cannot also be included in the output of that
rule. This was not enforced in earlier versions of Keyman.

Adds a unit test for the enhanced validation.

Fixes: #13455
Relates-to: keymanapp/keyboards#3379
2025-03-18 09:54:06 +07:00
Sabine
454b0359cb feat(developer): add semicolon where needed; function names 2025-03-17 16:25:32 +01:00
Sabine
794db98409 feat(developer): comment out first occurance+write out later occurance of a rule
if a rule is ambiguous i.e. if it is a C0/C1 rule and has an abiguous C2 or C3 rule we comment out the C0/C1 rule and only use the C2 or C3 rule
c WARNING  + [CAPS K_EQUAL]  > 'ì'  (C0/C1)
+ [CAPS K_EQUAL]  >  dk(A3)				  (C2 or C3)
2025-03-17 11:04:13 +01:00
Marc Durdin
d4540e3c68 chore(developer): use caps for constants in xml-utils 2025-03-17 12:19:10 +07:00
Marc Durdin
7d5c98ddba fix(developer): bump fast-xml-parser to 5.0.9
This is a major dependency version bump (4.5.0 to 5.0.9) which we would
normally avoid during beta. However, we need the fix
NaturalIntelligence/fast-xml-parser#725 for hex escapes in XML, which is
incorporated in 5.0.9.

I have assessed the other changes to fast-xml-parser and found no
breaking changes for us, but I tightened the types in xml-utils
declarations and found some minor inconsistencies which appear to have
no impact, and which I have corrected:
* wrong type in unused parameter to `tagValueProcessor`
* reference to unused property `options.emptyTag`

While doing this, I consolidated the common options for the parser in
order to verify consistency, but made no changes to the resolved
parsing/building options.

Added a test to ldml keyboard reading, to verify that numeric strings
are treated as strings, given the divergence in the `numberParseOptions`
option, and it shows that numeric strings are treated as strings.

Fixes: #13348
2025-03-17 06:22:29 +07:00
Marc Durdin
96a96bef15 fix(developer): add units tests to verify non-BMP numeric entities in XML reader
fast-xml-reader has a bug with numeric entities. See:
  https://github.com/NaturalIntelligence/fast-xml-parser/issues/725

This commit adds a unit test to verify that non-BMP numeric entities
will be parsed correctly. It will fail until we update the
fast-xml-parser dependency.

Relates-to: #13348
2025-03-17 05:50:47 +07:00
Marc Durdin
7b33aed94d chore(developer): reduce kmc coverage to 45%
This was due to platform-specific checks in NodeCompilerCallbacks,
around filename case and drive letters in paths (search terms:
HINT_FilenameHasDifferingCase, verifyFilenameConsistency):

- Linux: 59.01%
- macOS: 60.46%
- Windows: 63.08%

Mitigation: reduce threshold to 45%. More tests will be needed for
kmc-convert before epic merge.
2025-03-15 15:09:18 +07:00
Steven R. Loomis
7487a6bbbe chore(developer): improve code coverage
- add a test for LdmlKeyboardCompiler.run()
- exclude generated abnf files from coverage
2025-03-14 17:20:23 -05:00