The boilerplate code for custom lexical models has never really been
tested. For use in a browser/worker context, we need to define
`exports`. The added unit test verifies that the model will build.
Test-bot: skip
Cherry-pick-of: #15777
Relative paths would cause `kmc copy` to fail to find sources files for
the project, because component paths would be constructed incorrectly.
The cleanest fix is to ensure that we always full resolve local file
paths before attempting to copy the project.
Fixes: #15659
Cherry-pick-of: #15700
Without `await`, a 'success' message is always returned, because the
Promise that is returned is not nullish. While the log message was
misleading, the outcome was already correct, because the parent function
`copyProject()` did correctly await the call to `doCopy()`.
Fixes: #15699
Test-bot: skip
Cherry-pick-of: #15701
Use RichEdit's `ITextDocument` interface to retrieve the selection
anchor/caret information, and avoid the side-effects that can arise with
the hacky `EM_GETSEL` / `EM_SETSEL` pattern we used previously.
Changing the selection with `EM_SETSEL` in order to find the anchor
point causes notification messages to be generated that can arrive at an
unexpected time in some text selection scenarios, which ended up with us
having a saved selection in the debugger pointing to the wrong text
range.
The name `Anchor` was a misnomer, because it was actually returning the
caret position, not the anchor for the selection, which is the far side
of the selection from the anchor!
Fixes: #11706
Fixes: KEYMAN-DEVELOPER-18A
The new project UI process detects if the target project folder already
exists in a given path, and asks if the author wants to overwrite it.
However, this has been inconsistently implemented -- in the clone
keyboard case, the process would fail with a message "error KM0B004:
Output path <PATH> already exists, not overwriting". In other cases, no
files would be removed, but existing files would be overwritten where
there was a collision, resulting in a messy project folder.
I have opted to prevent this situation in a consistent manner, requiring
the author to remove the folder themselves in Windows Explorer, even
though this is higher friction, because it pushes them into verifying
that they actually want to delete the contents of the folder.
I also took the opportunity to DRY out this verification process in the
six different New Project dialogs.
Fixes: #15063
Turned on strictNullChecks to verify the file and found a few other
problems in this file. However, there are many null check errors
reported across the kmc-package source which should be addressed in a
future patch. (This is a broader problem for the entire Typescript
source of Keyman.)
Fixes: #15627
Test-bot: skip
Build-bot: skip build:developer
Cherry-pick-of: #15653
While the debugger memo internally uses CRLF, in all references, CRLF
should be converted to CR for consistent text manipulation operations.
This follows a similar fix in the kmn debugger in #13334.
Also addresses review comments from @ermshiperete.
Fixes: #15601
Relates-to: #13334
Cherry-pick-of: #15616
The existing ngrok package is no longer maintained, so this commit
switches to @ngrok/ngrok. However, this means a number of deployment
changes, as the new module uses a node binary module rather than a
standalone executable, and the path to the module is assumed to be on
the Node search path.
The new module also requires VC++ redistributable, so installation of
that has been added to the Server Options dialog.
Use of ngrok with Keyman Developer Server should be in theory possible
with non-Windows platforms with this change, if the user installs the
appropriate @ngrok binary package (e.g. @ngrok/ngrok-darwin-universal)
globally before starting the server.
Fixes: #15625
Build-bot: skip release:developer
Cherry-pick-of: #15626
Test-bot: skip
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
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
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
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
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
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
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
- .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
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
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
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.