Commit graph

2406 commits

Author SHA1 Message Date
Marc Durdin
b8dcc1b43d
Merge branch 'master' into feat/developer/9948-load-xml-ldml-files 2023-11-15 13:46:52 +11:00
Marc Durdin
26900f7b2c
Merge pull request #9956 from keymanapp/chore/developer/9948-hide-remove-project
chore(developer): hide 'Remove From Project' for v2.0 projects 🦕
2023-11-15 13:46:26 +11:00
Marc Durdin
c060666c0a
Merge pull request #9950 from keymanapp/feat/developer/9869-new-project-description-and-tweaks
feat(developer): New Project - Description field and tweaks 🦕
2023-11-15 13:46:16 +11:00
Marc Durdin
a937f3c7de
Merge pull request #9949 from keymanapp/feat/developer/tike-2.0-projects
feat(developer): Support v2.0 projects in TIKE 🦕
2023-11-15 13:46:07 +11:00
Marc Durdin
a923537ed4 feat(developer): Actions to support LdmlKeyboardEditor
Adds actions to support LdmlKeyboardEditor, and refactors and
reorganizes the existing actions along the way to make them clearer.

Compile, Install, and Uninstall supported at this time
2023-11-08 08:16:11 +07:00
Marc Durdin
7c937e7d94 feat(developer): Split dmActionsDebugger out of dmActionsKeyboardEditor
Because the debugger actions are used only with the kmn keyboard editor,
it makes sense to keep them as a separate module, in preparation for
supporting XmlLdmlKeyboards.
2023-11-08 06:22:50 +07:00
Marc Durdin
befe2b87a1 refactor(developer): add xmlLdml types and form, rename ActiveEditor
Adds XmlLdml keyboard editor form based on the plain text Editor for
now.

ActiveEditor is a name used for multiple purposes. Rename to
ActiveKmnKeyboardEditor and introduce ActiveLdmlKeyboardEditor
alongside.
2023-11-08 06:03:11 +07:00
Marc Durdin
7b8fe32161 feat(developer): Add basic LDML XML keyboard file support to TIKE projects 2023-11-08 05:51:28 +07:00
Darcy Wong
71a9b9d66a
Merge pull request #9846 from keymanapp/chore/developer/non-printing-chars
feat(developer): Add more non-printing characters
2023-11-07 15:20:21 +07:00
Marc Durdin
857017f4ad chore(developer): remove obsolete project code
Removes old state load/save from each project file type, and the
unused WarnAsError property, in preparation for xmlLdmlProjectFile.
2023-11-07 14:57:40 +07:00
Marc Durdin
96e78c6818 chore(developer): fix typo 2023-11-07 14:57:08 +07:00
Marc Durdin
a312f735ad chore(developer): tweak prompt for project upgrade 2023-11-07 14:29:04 +07:00
Marc Durdin
eb97eb94b5 chore(developer): hide 'Remove From Project' for v2.0 projects
Relates to #9948.
2023-11-07 14:26:49 +07:00
Marc Durdin
0285993fcf feat(developer): New Project - Description field and tweaks
Fixes #9869.

Adds a 'Description' field, tweaks Copyright strings, and tweaks
default content for documentation to the New Project wizards and
kmconvert.
2023-11-07 06:04:33 +07:00
Marc Durdin
4c5a91081f feat(developer): Support v2.0 projects in TIKE
Relates to #9948. Starts basic support for v2.0 projects.

For all operating modes:

- Remove blank projects / untitled projects mode
- Add Open Project Folder buttons and links
- Remove Project Save As
- Render uses in-memory XML
- Upgrade to v2.0 project file (along with checks)

For v2.0 projects:

- Remove 'Add File to Project'
- Populate Files to list all files in folder (note: consider efficiency
  here as currently files are parsed for subfile data)
- Version 2.0 project options and defaults
2023-11-07 05:18:25 +07:00
Darcy Wong
5902c764c7
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2023-11-06 15:26:32 +07:00
Darcy Wong
699e1f350b chore(common): Revert other files 2023-11-06 15:25:59 +07:00
Marc Durdin
479da80a1a
Merge pull request #9941 from keymanapp/fix/developer/9848-resilient-cache-state-loading
fix(developer): resilience in loading Server config and cache files
2023-11-06 17:56:04 +11:00
Marc Durdin
946dcdabdf
Merge pull request #9940 from keymanapp/fix/developer/9939-sentry-support-in-server
fix(developer): Sentry in Server should honour reporting settings
2023-11-06 17:55:56 +11:00
Darcy Wong
132c8c7980 fix(developer): Revert test changes 2023-11-06 13:48:31 +07:00
Darcy Wong
56a86a8f87
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2023-11-06 13:42:36 +07:00
Marc Durdin
7a08688ae1
Merge pull request #9938 from keymanapp/feat/developer/9931-line-numbers-for-some-kmw-messages
feat(developer): provide line number for some kmw compiler messages
2023-11-06 14:57:51 +11:00
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