Commit graph

3962 commits

Author SHA1 Message Date
Marc Durdin
d7b16aece9 chore(windows): upgrade VC++ projects to v143 (VS2022)
Test-bot: skip
Build-bot: skip release:developer,windows
2025-10-31 13:37:24 +01:00
Marc Durdin
9a9f825119
Merge pull request #15057 from keymanapp/chore/developer/cherry-pick/11706-extra-debugging-redux-bksp
chore(developer): further debugging for assertion failure 🍒 🏠
2025-10-31 07:29:03 +01:00
Marc Durdin
7c5d6f704f chore(developer): add breadcrumbs to trace sporadic crashes on exit
Relates-to: #11916
Test-bot: skip
Cherry-pick-of: #15058
2025-10-30 15:02:42 +01:00
Marc Durdin
ec57939f4d chore(developer): further debugging for assertion failure
Adds breadcrumbs for debug memo to try and narrow down sequence of
events leading to assertion failure with backspace.

Relates-to: #11706
Test-bot: skip
Cherry-pick-of: #15056
2025-10-30 14:36:55 +01:00
Marc Durdin
6449dfe2bf maint(resources): add repository record for all published packages
While not documented as such, it appears that the repository record is
required with trusted publishing of npm packages.

Cherry-pick-of: #15049
Build-bot: skip release:developer
2025-10-30 07:10:45 +01:00
Marc Durdin
1d8cc3afcd maint(developer): reduce coverage threshold for node 24 for dev-utils
I am not entirely clear why the coverage dropped, but I suspect it's due
to code paths that are not activated in node 24. For now, just dropping
coverage threshold to 40%.

Cherry-pick-of: #15042
2025-10-30 07:07:38 +01:00
Marc Durdin
fb26516008 chore(developer): skip git date test for shallow clones
If the repository is a shallow checkout, then the only commit will be
the most recent one, and the test will fail. We could lookup the date of
the most recent test, but it's a pretty meaningless test, so instead we
will skip the test in this scenario.

For example, this happens on GitHub Actions when we do a shallow
checkout. The only risk we have is if we move all builds to shallow
checkouts and end up always skipping this test, but (a) the code is
unlikely to change, and (b) issuse would be  picked up on local builds
in that situation pretty quickly.

Cherry-pick-of: #15042
2025-10-30 07:06:57 +01:00
Marc Durdin
bb32cecea7 maint(resources): move NPM package publishing to GitHub Actions
Due to recent changes in NPM package publishing security requirements,
we have to move from TeamCity build to a GitHub Action to publish our
NPM packages, so we can take advantage of trusted publishing. This
change also consolidates and centralizes the npm publishing into
resources/build/ci/npm-publish.sh, which removes a lot of boilerplate
from each of the build.sh scripts, and ensures consistency.

Packages will be `npm pack`ed on PR and test builds, and published in
release builds.

Ref: https://docs.npmjs.com/trusted-publishers
Ref: https://github.blog/changelog/2025-09-29-strengthening-npm-security-important-changes-to-authentication-and-token-management/
Fixes: #14963
Test-bot: skip
Build-bot: release:developer
Cherry-pick-of: #15029
2025-10-30 07:03:14 +01:00
Marc Durdin
3f1b337ff2
Merge pull request #15006 from keymanapp/fix/developer/cherry-pick/14411-handle-missing-begin-unicode
fix(developer): handle missing `begin Unicode` in KMW compiler 🍒 🏠
2025-10-27 15:40:37 +01:00
Marc Durdin
3233348e97 fix(developer): handle missing begin Unicode in KMW compiler
This probably arose with the move to kmcmplib in WASM, and as it was
never unit tested, we missed it. A simple signed vs unsigned issue.

Fixes: #14411
Test-bot: skip
Cherry-pick-of: #15002
2025-10-24 09:25:28 +02:00
Marc Durdin
b9b97d293b fix(developer): do not treat backslash as a string escape in syntax highlighting
Adjust two incorrect rules that caused backslash to be treated as an
escape in strings in syntax highlighting in .kmn language.

Fixes: #14988
Test-bot: skip
Build-bot: skip
Cherry-pick-of: #15001
2025-10-24 09:20:29 +02:00
Marc Durdin
54f586f51b chore(developer): update tests to match 2025-09-19 09:29:00 +02:00
Marc Durdin
1892142c6d fix(developer): remove incorrect offset for compiler error line
Fixes: #13903
2025-09-19 09:28:59 +02:00
Marc Durdin
6c87614b11 chore(developer): upgrade multer to 2.0.2
Relates-to: #14373
Test-bot: skip
2025-07-28 10:52:42 +10:00
Steven R. Loomis
c1f0882957 fix(developer): ldml: make sure .run() validates
- .run() doesn't call validate() and then compile(), so it needs to call compile() with postValidation=true

Fixes: #14067
(cherry picked from commit c70464e23f) and #14068
2025-05-29 12:34:40 -05:00
Marc Durdin
10305b6024 fix(developer): remove ngrok binary at build time
While ngrok.exe was already removed, ngrok (mac? linux?) was still
present in node_modules.

Fixes: #13846
2025-05-09 05:38:38 +02:00
Marc Durdin
da5b05a195
Merge pull request #13640 from keymanapp/fix/developer/13600-follow-remove-redundant-lm-fields-from-kps
fix(developer): remove redundant Name and RTL fields from .kps `LexicalModel`
2025-04-03 05:40:32 +07:00
Marc Durdin
a4f33caf65
Merge pull request #13600 from keymanapp/fix/developer/13576-13593-remove-redundant-keyboard-fields-from-kps
fix(developer): remove redundant keyboard fields from .kps
2025-04-03 05:40:18 +07:00
Marc Durdin
0f05da957f fix(developer): remove redundant Name and RTL fields from .kps LexicalModel
Follows on from the similar changes to `Keyboard` fields in #13600. This
deprecates the `RTL` and `Name` fields. `RTL` was never used. `Name` was
written but never presented to end users, so effectively irrelevant.
`Name` also was present in `File.Description` (already deprecated) for
the corresponding model.js _and_ `Info.Name`, so doubly redundant.

Also updates the schema documentation to mark the deprecated fields.

Relates-to: #13600
2025-04-02 05:39:09 +07:00
Marc Durdin
9c1c417457 fix(developer): add special handling for 'und' in kmc-keyboard-info
This is a workaround for missing 'und' language tag.

`(new Intl.Locale('und')).language` returns `undefined` in V8, as of 31
March 2025. This means we cannot rely on `Intl.Locale` to parse the
bcp47 string for us. The implemented workaround is to replace `und` with
a known-good language subtag, and then swap it back out in later
processing.

Also adds unit test and new warning messages for invalid language tags
that were exposed during testing of this.

Fixes: #13610
2025-03-31 12:30:05 +07:00
Marc Durdin
f9739e5e9b chore(developer): remove unreferenced kps fields from test 2025-03-29 04:21:41 +07:00
Marc Durdin
de5a02f8ce chore(developer): rewrap detail on semver LDML message 2025-03-29 04:14:38 +07: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
Marc Durdin
86d457837f chore(developer): remove unreferenced fields from kmc-generate test fixtures
Relates-to: #13576
2025-03-28 14:59:07 +07:00
Marc Durdin
52d016fe7c chore(developer): remove redundant fields from kps reader unit test
Note: the round-trip test still passes because the XML data passes
basically unmodified through, even though we make no reference to the
fields in the code.

Fixes: #13576
2025-03-28 14:27:08 +07:00
Marc Durdin
9dabcc0306 fix(developer): remove redundant keyboard fields from .kps
The fields 'name', 'version', and 'rtl' were defined in the .kps file,
but were not actually used by the compiler, as kmc-package reads the
metadata from the keyboard file rather than relying on this data, which
often is out of date. This led to confusion for keyboard authors, so
this change removes that metadata from the package.

The one visible side-effect (apart from the data disappearing from
future .kps files) is that the package editor no longer shows this
metadata in the Keyboards view (but as it may be out-of-date, this is
probably a good thing).

Fixes: #13576
Fixes: #13593
2025-03-28 14:07:23 +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
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
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
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
1e4719c823
Merge pull request #13479 from keymanapp/fix/developer/13469-strip-markers-in-kvk-generation
fix(developer): strip markers when generating KVK from LDML
2025-03-13 13:19:37 +07:00
Marc Durdin
7cf86c548f
Merge pull request #13462 from keymanapp/fix/developer/13317-open-unprojected-source-file-in-temp-project
fix(developer): use '-' as placeholder for temp project name in cmdline
2025-03-12 08:55:41 +07:00
Marc Durdin
1f1b6e2b2a
Merge pull request #13459 from keymanapp/fix/developer/13420-load-options-before-use
fix(developer): load Keyman Developer options in Server before use
2025-03-12 08:55:13 +07:00
Marc Durdin
3ad7e78c25
Merge pull request #13457 from keymanapp/fix/developer/13446-improve-message-about-missing-file
fix(developer): add folder text to Error_FileDoesNotExist message
2025-03-12 08:55:02 +07:00
Marc Durdin
09636ac072
Merge pull request #13414 from keymanapp/docs/developer/kmc-patch-readme
docs(developer): fix typos in readme and add link
2025-03-12 08:54:46 +07:00
Marc Durdin
7645627f21 fix(developer): strip markers when generating KVK from LDML
Markers are permitted in key outputs, but when these are used to
generate a .kvk, they should be stripped out.

Also added a test for disp to verify that markers are not transformed in
`<display display=` attribute values.

Fixes: #13469
2025-03-12 08:06:34 +07:00
Marc Durdin
15bea6fd21 fix(developer): use '-' as placeholder for temp project name in cmdline
When launching a new instance of TIKE to open a source file that does
not have an owning project, use '-' as a placeholder for the project
filename, because passing an empty string as a parameter does not work.

Fixes: #13317
2025-03-10 08:31:04 +07:00
Marc Durdin
d2b457b2e4 fix(developer): load Keyman Developer options in Server before use
Fixes: #13420
2025-03-10 06:28:39 +07:00
Marc Durdin
13d5ee8741 fix(developer): add folder text to Error_FileDoesNotExist message
Fixes: #13446
2025-03-10 05:19:09 +07:00
Marc Durdin
37cb3767ac chore(developer): lower threshold for kmc-model-info coverage, work around TeamCity reporter bug 2025-03-05 01:00:03 +03:00
Marc Durdin
060189a1ab chore(developer): drop coverage threshold for developer-utils to 45% 2025-03-05 00:24:41 +03:00
Marc Durdin
1b26d4ff96 docs(developer): fix typos in readme and add link 2025-03-04 13:59:41 +01:00
Marc Durdin
03001bd971 chore(common): add unit test for nul and context() in context part of rule
The compiler and Core appear to be working correctly in this situation;
this test verifies Core's behaviour.

Fixes: #13299
2025-03-04 11:22:35 +01:00
Marc Durdin
accd5e268c
Merge pull request #13326 from keymanapp/fix/developer/13306-13307-include-nul-in-context-offset-kmw-v10
fix(developer): include `nul` in offset calculations for kmw v10 compiler
2025-02-28 23:37:00 +07:00
Marc Durdin
213bbd7d31
Merge pull request #13311 from keymanapp/chore/core/13303-unit-tests-for-nul-index-context
chore(core): add unit tests to validate `nul` with `index` and `context`
2025-02-28 23:36:40 +07:00
Marc Durdin
d6c2657bb0
Merge pull request #13308 from keymanapp/fix/developer/13301-13302-contextex-offset-check
fix(developer): verify `context(n)` offsets are valid in kmcmplib
2025-02-28 23:36:30 +07:00
Marc Durdin
a62735ea4b
Merge pull request #13324 from keymanapp/feat/developer/sensible-initial-dir-for-package-add-file
feat(developer): use .kps folder as initial dir for Add Files
2025-02-28 23:35:15 +07:00