Commit graph

3988 commits

Author SHA1 Message Date
Marc Durdin
d0e6795399 fix(developer): define globalThis for compiled custom lexical models
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
2026-03-24 10:31:37 +01:00
Marc Durdin
7c1f3b68d3
Merge pull request #15703 from keymanapp/fix/developer/cherry-pick/15659-resolve-input-path-for-kmc-copy
fix(developer): resolve input project path for `kmc copy` 🍒 🏠
2026-03-09 16:02:18 +07:00
Marc Durdin
67c7d84959 fix(developer): resolve input project path for kmc copy 🍒
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
2026-03-09 07:10:37 +01:00
Marc Durdin
c99acb4e20 fix(developer): await copier result before reporting success or failure 🍒
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
2026-03-09 06:26:05 +01:00
Marc Durdin
63c8ae0288
Merge pull request #15633 from keymanapp/fix/developer/cherry-pick/15625-ngrok-upgrade
fix(developer): ngrok upgrade 🍒 🏠
2026-03-09 11:23:41 +07:00
Marc Durdin
0e2b1f000c
Merge pull request #15695 from keymanapp/fix/developer/cherry-pick/11706-debug-memo-get-anchor-with-tom-interface
fix(developer): retrieve debug memo anchor without side effects 🍒 🏠
2026-03-06 21:01:47 +07:00
Marc Durdin
ed039332d8 fix(developer): address review comments 2026-03-06 12:26:57 +01:00
Marc Durdin
507dc7a749 fix(developer): retrieve debug memo anchor without side effects
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
2026-03-06 12:26:50 +01:00
Marc Durdin
2053b17299 chore(developer): address review comments
Co-authored-by: Darcy Wong <darcy_wong@sil.org>
2026-03-06 12:23:40 +01:00
Marc Durdin
6843509d24 fix(developer): prevent new projects from overwriting existing projects
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
2026-03-06 12:23:39 +01:00
Marc Durdin
5c5cf73388
Merge pull request #15686 from keymanapp/fix/developer/cherry-pick/13958-setup-feedback
fix(developer): improve UI feedback on upgrade 🍒 🏠
2026-03-05 21:19:45 +07:00
Marc Durdin
f8a1ad2f13 fix(developer): improve UI feedback on upgrade
Show a progress dialog when running the Keyman Developer upgrade
(`-au` parameter).

Fixes: #13958
Test-bot: skip
Cherry-pick-of: #15670
2026-03-05 13:33:39 +01:00
Marc Durdin
0ad94365c1
Merge pull request #15668 from keymanapp/fix/developer/cherry-pick/15630-missing-description-in-windows-import
fix(developer): apply keyboard description in Windows keyboard import 🍒 🏠
2026-03-05 19:19:15 +07:00
Marc Durdin
a431f7b58a
Merge pull request #15664 from keymanapp/fix/developer/cherry-pick/15619-handle-missing-info-section-in-kmp-compiler
fix(developer): package compiler handle missing `info` section in .kps file 🍒 🏠
2026-03-05 19:19:04 +07:00
Marc Durdin
9dacfcd06f
Merge pull request #15662 from keymanapp/fix/developer/cherry-pick/15627-checkPackageInfo-null-return-values
fix(developer): use correct return values and nullish checks in package-validation 🍒 🏠
2026-03-05 19:18:51 +07:00
Marc Durdin
a9b0cbd70f
Merge pull request #15661 from keymanapp/fix/developer/cherry-pick/15621-handle-missing-package-object-in-kps-file
fix(developer): handle .kps file that has no `<Package>` element 🏠 🍒
2026-03-05 19:18:43 +07:00
Marc Durdin
111bd5082e fix(developer): apply keyboard description in Windows keyboard import 🍒
Fixes: #15630
Test-bot: skip
Cherry-pick-of: #15667
2026-03-04 04:58:48 +01:00
Marc Durdin
456bf97d0a chore(developer): cleanup kps file reader per review comments
Co-authored-by: Darcy Wong <darcy_wong@sil.org>
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2026-03-03 14:47:48 +01:00
Marc Durdin
02548dad1b fix(developer): package compiler handle missing info section in .kps file
Fixes: #15619
Fixes: KEYMAN-DEVELOPER-27R
Test-bot: skip
2026-03-03 13:52:16 +01:00
Marc Durdin
a1b0113e14 fix(developer): use correct return values and nullish checks in package-validation 🍒
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
2026-03-03 13:49:18 +01:00
Marc Durdin
71705610c6 fix(developer): handle .kps file that has no <Package> element
Fixes: #15621
Fixes: KEYMAN-DEVELOPER-37D
Test-bot: skip
2026-03-03 13:45:40 +01:00
Marc Durdin
0c55be6ade fix(developer): handle CRLF as CR internally in LDML debugger 🍒
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
2026-03-03 13:43:45 +01:00
Marc Durdin
66162a0610 fix(developer): address review comments
Co-authored-by: Darcy Wong <darcy_wong@sil.org>
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2026-03-02 10:33:44 +01:00
Marc Durdin
20b11ea1b7 docs(developer): refresh ngrok help 2026-02-26 11:45:43 +01:00
Marc Durdin
dfcf18a8a2 fix(developer): ngrok upgrade
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
2026-02-26 11:44:44 +01:00
Meng-Heng
b5a7573b45 chore: update primerprep link 2026-01-19 13:52:27 +07:00
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