Commit graph

1985 commits

Author SHA1 Message Date
Marc Durdin
2f42dd41f0
Merge pull request #9937 from keymanapp/chore/common/npm-prepublish-remove
chore(common): remove prepublish step from package.json
2023-11-06 14:57:43 +11:00
Marc Durdin
3e3fb92d59
Merge pull request #9924 from keymanapp/chore/developer/remove-CompileErrorCodes
chore(developer): remove compile.pas and CompileErrorCodes.pas
2023-11-06 14:57:35 +11:00
Marc Durdin
65b73b7c54
Merge branch 'fix/developer/9939-sentry-support-in-server' into fix/developer/9848-resilient-cache-state-loading 2023-11-06 14:47:08 +11:00
Marc Durdin
ea038c6db8 chore(developer): developer-utils embed 2023-11-06 10:46:48 +07:00
Marc Durdin
8e21925c26 fix(developer): resilience in loading Server config and cache files
Fixes #9848.

Root cause of #9848 is unknown, because the cache state file was filled
with nul bytes. It is unclear how that could have happened, but seems
likely to be external interference.

The cascade was that Server failed to start because it would crash when
attempting to load the cache state file. So this fix resolves that by
handling invalid file exceptions.
2023-11-06 08:30:05 +07:00
Marc Durdin
716cb526b7 fix(developer): Sentry in Server should honour reporting settings
Fixes #9939.

Uses refactored KeymanSentry.ts in developer-utils and updates the
loader in Server to run from that.

The changes to tray.ts and friends are required to deal with a top-level
await issue with the shutdown call.

The top-level await issue is described in detail at
https://marc.durdin.net/2023/11/dynamic-import-on-node-js-with-circular-dependencies-leads-to-interesting-failure-modes/

tl;dr: shutdown needed to do a proper Sentry shutdown. The shutdown code
was in index.ts. This led to a circular dependency and caused a silent
and abrupt exit code 13 in Node.js. Moved shutdown code into shutdown.ts
to resolve this.
2023-11-06 08:18:24 +07:00
Marc Durdin
8e6252c7de fix(developer): move KeymanSentry to developer-utils
Relates to #9939. Splits KeymanSentry.ts into common functionality in
developer-utils, and TestKeymanSentry.ts.
2023-11-05 06:57:01 +07:00
Marc Durdin
ab4fcef9f7 feat(developer): add line number information for more kmw messages
Adds line number context for:
  * Error_VirtualCharacterKeysNotSupportedInKeymanWeb
  * Error_VirtualKeysNotValidForMnemonicLayouts
  * Warn_ExtendedShiftFlagsNotSupportedInKeymanWeb
  * Hint_UnreachableKeyCode
  * Warn_HelpFileMissing
  * Warn_EmbedJsFileMissing
  * Error_NotAnyRequiresVersion14

Line number metadata is not easily accessible where the following
messages are generated, so these are a potential future improvement:
  * Warn_OptionStoreNameInvalid
  * Error_NotSupportedInKeymanWebStore
2023-11-05 06:33:06 +07:00
Marc Durdin
02e1ea59a2 feat(developer): provide line number for some kmw compiler messages
Fixes #9931.

Provide additional line and file context for some KeymanWeb
compiler messages. This change requires debug data in the intermediate
kmx data provided to the kmw compiler, which should have no impact on
the final .js if debug=false.

This commit only addresses line number data in
Error_NotSupportedInKeymanWebContext and
Error_NotSupportedInKeymanWebOutput.

There are other compiler messages which could benefit from this data:
  * Warn_OptionStoreNameInvalid
  * Error_VirtualCharacterKeysNotSupportedInKeymanWeb
  * Error_VirtualKeysNotValidForMnemonicLayouts
  * Warn_ExtendedShiftFlagsNotSupportedInKeymanWeb
  * Hint_UnreachableKeyCode
  * Error_NotSupportedInKeymanWebStore
  * Warn_HelpFileMissing
  * Warn_EmbedJsFileMissing
  * Error_NotAnyRequiresVersion14
2023-11-05 06:12:42 +07:00
Marc Durdin
c5c5b35415 chore(common): remove prepublish step from package.json
Given we've just run a build, this (a) seems unnecessary, and (b) seems
to go wrong in some circumstances anyway, e.g.
https://build.palaso.org/buildConfiguration/Keyman_Developer_Release/421326?buildTab=log&focusLine=19936&linesState=18839&logView=flowAware:

```
07:01:29   > @keymanapp/kmc@17.0.205-alpha prepublishOnly
07:01:29   > npm run build
07:01:29
07:01:31
07:01:31   > @keymanapp/kmc@17.0.205-alpha build
07:01:31   > tsc -b
07:01:31
07:01:35   ../../../common/web/types/build/src/kmx/kmx.d.ts(1,1): error TS1036: Statements are not allowed in ambient contexts.
07:01:35   ../../../common/web/types/build/src/kmx/kmx.d.ts(1,2): error TS1345: An expression of type 'void' cannot be tested for truthiness.
...
```
2023-11-04 07:34:18 +07:00
Marc Durdin
7878864c44
Merge pull request #9935 from keymanapp/chore/developer/9929-common-include-dep-for-kmcmplib
chore(developer): common/include dep for kmcmplib
2023-11-03 18:50:45 +11:00
Marc Durdin
0605d48c94
Merge pull request #9934 from keymanapp/chore/developer/9925-remove-obsolete-settings
chore(developer): remove obsolete 'Allow Multiple Instances' and 'Use Legacy Compiler' options
2023-11-03 18:50:38 +11:00
Marc Durdin
fa30924b54 chore(developer): common/include dep for kmcmplib
Fixes #9929.
2023-11-03 13:31:45 +07:00
Marc Durdin
3336539ec5 chore(developer): remove obsolete 'Allow Multiple Instances' and 'Use Legacy Compiler' options
Fixes #9925.

Allow Multiple Instances is now always true.
Use Legacy Compiler did nothing (there is no legacy compiler!).
2023-11-03 13:24:05 +07:00
Marc Durdin
186132dcb9 fix(developer): kmc code generation for context(n) in context
Fixes #9930.

* Fixes the index offset calculation, with +1 for >=v10.0 keyboards and
  -1 for <v10.0 keyboards (difference is because older version keyboards
  have context offsets calculated in the opposite direction). Note that
  this happened because the `CODE_CONTEXTEX` index is stored in memory
  as 0-based in kmc, but was 1-based in kmcomp.

* Adds unit tests for v9.0 and v10.0 keyboards for `context(n)` in
  context.

* Adds unit tests for v9.0 and v10.0 keyboards for `context(n)` in
  output. These were already correct but now we can be assured that
  they are being tested.

* Enables code coverage for kmw-compiler, and sets a lower threshold for
  pass because coverage is still just over 70%.
2023-11-03 12:29:56 +07:00
Marc Durdin
cd5be3d819
Merge pull request #9917 from keymanapp/fix/developer/9845-server-no-osk-always-visible-on-touch
fix(developer): don't use osk-always-visible on touch devices
2023-11-03 12:22:41 +11:00
Marc Durdin
1ffa3e2494
Merge pull request #9913 from keymanapp/fix/developer/8147-use-KeymanWeb.Codes
fix(developer): use KeymanWeb.Codes for 17.0+
2023-11-03 12:21:34 +11:00
Darcy Wong
a02dde9f1c fix(developer): Revert 14_1 2023-11-03 07:50:44 +07:00
Darcy Wong
16cd8a6e17 fix(developer): Define special touch layout key for other tests 2023-11-03 06:35:47 +07:00
Darcy Wong
bfac2795d1 fix(developer): Fix JSON 2023-11-03 04:57:32 +07:00
Darcy Wong
024b20a839 fix(developer): Define special touch layout key 2023-11-02 21:05:51 +07:00
Darcy Wong
25c54d363c fix(common): Add constants 2023-11-02 17:37:43 +07:00
Darcy Wong
9b8097ea96 fix(developer): import KMX 2023-11-02 16:32:41 +07:00
Darcy Wong
ecae59062b fix(developer): Update keymanweb-osk.ttf font 2023-11-02 15:50:50 +07:00
Darcy Wong
06cf276806
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2023-11-02 13:22:49 +07:00
Marc Durdin
6f6e07975b chore(developer): remove compile.pas and CompileErrorCodes.pas
Fixes #9923.

These are no longer used because we now use kmc for builds. This also
means that the kmcomp-x64-structures test is no longer required, because
that was used to keep the Delphi and C++ structures in sync.

There are some minor details around error message identifiers that are
still present in a handful of places, but they are work for another
time.
2023-11-02 13:12:28 +07:00
Marc Durdin
a1c1658880
Merge pull request #9906 from keymanapp/fix/developer/9444-line-breaks-in-debugger
fix(developer): enable line breaks in debugger
2023-11-02 15:09:27 +11:00
Marc Durdin
38d2c92ecf
Merge pull request #9922 from keymanapp/fix/developer/7851-restore-selection-to-same-key-in-layout-builder
fix(developer): restore selection in layout builder even with duplicate ids
2023-11-02 15:06:32 +11:00
Marc Durdin
6be9fe6012
Merge pull request #9921 from keymanapp/fix/developer/8000-warn-if-layer-switch-key-missing-id
fix(developer): warn if layer switch key is missing ID
2023-11-02 15:06:23 +11:00
Marc Durdin
328f80847f
Merge pull request #9920 from keymanapp/chore/developer/rename-compiler-messages
chore(developer): rename messages.ts for clarity
2023-11-02 15:06:15 +11:00
Marc Durdin
e052178231
Merge pull request #9910 from keymanapp/feat/developer/7891-compile-button-in-toolbar
feat(developer): Compile button in TIKE toolbar
2023-11-02 15:06:03 +11:00
Marc Durdin
a98e5f6837
Merge pull request #9908 from keymanapp/fix/developer/7880-error-if-virtual-key-in-context
fix(developer): raise error if virtual key in context string
2023-11-02 15:05:54 +11:00
Marc Durdin
d9e759a8d2 chore(developer): address review comments 2023-11-02 11:05:23 +07:00
Marc Durdin
4341fc00b0
Merge pull request #9859 from keymanapp/feat/developer/9858-kmc-keyboard-info-extract-font-family
feat(developer): extract font family from .ttf in kmc-keyboard-info
2023-11-02 15:03:09 +11:00
Marc Durdin
c01a37145a chore(developer): address review comments 2023-11-02 11:02:20 +07:00
Marc Durdin
0dac92da57
Merge pull request #9914 from keymanapp/fix/developer/7852-layout-builder-maintain-presentation-during-undo
fix(developer): layout builder - maintain presentation during undo
2023-11-02 14:54:50 +11:00
Marc Durdin
539cfc18d3
Merge pull request #9907 from keymanapp/fix/developer/enable-and-update-tests
fix(developer): enable and update unit tests
2023-11-02 14:53:52 +11:00
Marc Durdin
067b7767c7
Merge pull request #9905 from keymanapp/fix/developer/9849-open-editor-links-in-new-window
fix(developer): open editor links in new window
2023-11-02 14:53:36 +11:00
Marc Durdin
7fec53af81
Merge pull request #9904 from keymanapp/chore/developer/9853-related-package-id-label
chore(developer): change field label to 'Related Package ID' in Related Packages dialog
2023-11-02 14:53:15 +11:00
Marc Durdin
edde4ed76d
Merge pull request #9902 from keymanapp/fix/developer/9899-project-mru
fix(developer): Project MRU now saves correctly
2023-11-02 14:51:33 +11:00
Marc Durdin
45b5db1974
Merge pull request #9844 from keymanapp/chore/developer/verify-kmp-json-output-from-kmc-package
chore(developer): verify kmp.json output from kmc-package
2023-11-02 14:50:50 +11:00
Marc Durdin
bb23a53678
Merge branch 'fix/developer/9885-debug-flag-not-working-in-tike' into fix/developer/8147-use-KeymanWeb.Codes 2023-11-02 14:48:13 +11:00
Marc Durdin
e2ecf5726c
chore: Apply suggestions from code review 2023-11-02 14:17:49 +11:00
Marc Durdin
bd2315dbac fix(developer): restore selection in layout builder even with duplicate ids
Fixes #7851.

Note that this fixes the selection pop issue with duplicate ids in some
scenarios but not all. For example, the undo stack doesn't have enough
detail at this point to be able to track this. This fix addresses the
most egregious issue relating to key size adjustment and similar.
2023-11-01 10:43:48 +07:00
Marc Durdin
15523dfe11 fix(developer): warn if layer switch key is missing ID
Fixes #8000.

In earlier versions of KeymanWeb, it was assumed that layer switch keys
would not necessarily need an identifier, as they would not be
generating a standard KeymanWeb key event. However, this assumption does
not really hold, so we should be warning on missing identifiers for
layer switch keys.
2023-11-01 09:48:13 +07:00
Marc Durdin
0ec76f0761 chore(developer): rename messages.ts for clarity
Renames two messages.ts to kmn-compiler-messages.ts and
kmw-compiler-messages.ts, as otherwise confusion reigns.

Also a minor cleanup of the error messages from touch layout processing,
to clarify message names and return appropriate message for missing
layout file.
2023-11-01 09:30:31 +07:00
Marc Durdin
4ce16a08fc fix(developer): don't use osk-always-visible on touch devices
Fixes #9845.

It seems that the logic for `osk-always-visible` is not quite right on
touch devices -- the OSK disappears on blur but remains touchable -- so
presses in the OSK region emit key events. For Keyman Developer Server,
the simple workaround is to only use `<body class="osk-always-visible">`
when on desktop devices.

We should review the logic for `osk-always-visible` in KeymanWeb, so
that this issue does not arise on touch devices. This patch addresses
the issue in Keyman Developer Server, and matches the behaviour we want
on touch devices in any case, as we don't really want the OSK visible
when blurred, unlike on desktop.
2023-11-01 05:57:13 +07:00
Marc Durdin
c759414e71 fix(developer): layout builder - maintain presentation during undo
Fixes #7852.

When undo is run in the layout builder, it is better to keep the user's
selected presentation if possible. (The selected presentation is not
stored in the undo stack, but is a view property affected by the
currently selected platform.)
2023-11-01 04:59:40 +07:00
Marc Durdin
b26b6a37d7 fix(developer): use KeymanWeb.Codes for 17.0+
Fixes #8147.

Keyboards debug-compiled for web 17.0+ will use `KeymanWeb.Codes.`
instead of `keyman.osk.`.
2023-11-01 04:43:42 +07:00
Marc Durdin
5b9608438e feat(developer): Compile button in TIKE toolbar
Fixes #7891.
2023-10-31 14:20:18 +07:00