Commit graph

299 commits

Author SHA1 Message Date
Marc Durdin
e9d054ab2c
Merge branch 'master' into refactor/common/9665-move-kvk-file-to-developer 2024-08-07 15:13:41 +10:00
Marc Durdin
88506cea6b
Merge branch 'master' into refactor/common/9665-move-kps-file-type-to-developer 2024-08-07 15:13:10 +10:00
Marc Durdin
7849b7734b
Merge pull request #11531 from keymanapp/refactor/common/9665-move-project-file-type-to-developer
refactor(common): move kpj-related files into developer-utils 🐉
2024-08-07 15:12:31 +10:00
Marc Durdin
118a947882 chore(common): add support for build target platform exclusions
Add `builder_describe_platform` function to builder.inc.sh, associated
documentation and unit test, and use it in Developer and Common build
scripts.

Relates-to: #11755
2024-08-07 09:25:56 +07:00
Marc Durdin
edf47d7f43 refactor(common): move xml2js and related deps to @keymanapp/developer-utils
Fixes: #9665
2024-08-06 05:19:30 +07:00
Marc Durdin
e67aed1606 refactor(common): move compiler-interfaces to @keymanapp/developer-utils
This should be the last step in the refactoring.

Fixes: #9665
2024-08-02 13:49:59 +07:00
Marc Durdin
d3d3ac1eec refactor(common): move LDML keyboard .xml reader/writer and kmx-plus builder to @keymanapp/developer-utils
Relates-to: #9665
2024-08-02 10:23:11 +07:00
Marc Durdin
08803111e5
Merge branch 'refactor/common/9665-move-kvk-file-to-developer' into refactor/common/9665-move-keyman-touch-layout-file-to-developer 2024-08-01 10:35:48 +10:00
Marc Durdin
53551f5662
Merge branch 'refactor/common/9665-move-kps-file-type-to-developer' into refactor/common/9665-move-kvk-file-to-developer 2024-08-01 10:35:33 +10:00
Marc Durdin
ad9ba1f188
Merge branch 'refactor/common/9665-move-project-file-type-to-developer' into refactor/common/9665-move-kps-file-type-to-developer 2024-08-01 10:34:05 +10:00
Marc Durdin
d8986be12f refactor(common): merge master into branch 2024-08-01 07:07:07 +07:00
Marc Durdin
8cd97e5f5d refactor(developer): move kmcmplib message construction to kmc-kmn
* Remove compiler message definitions from kmcmplib
* Add parameterization to compiler message structures
* Translate parameters for existing parameterized messages (except for
  `ERROR_InvalidToken`, which requires a bigger refactor of
  `GetXStringImpl()` and many friends)
* Add columnNumber to message structures (not yet used in kmc-kmn)
* Add filename to message structures (not yet used in kmcmplib)
* Rename `INFO_Info` to `INFO_MinimumCoreEngineVersion` and
  `INFO_MinimumEngineVersion` to `INFO_MinimumWebEngineVersion`

Relates-to: #10866
2024-07-30 10:01:19 +07:00
Marc Durdin
d53b4c8322 test(developer): validate that messages in kmcmplib and kmc-kmn match
Add a unit test to verify that kmn_compiler_errors.h and
kmn-compiler-messages.ts have identical definitions for all errors in
kmcmplib. Then remove mismatched (and unused) messages identified by
this test.
2024-07-28 12:37:58 +07:00
Marc Durdin
6a48f5e550 refactor(developer): align kmcmplib error codes with kmc
Renames kmcmplib error codes to match those in kmc-kmn, and updates the
bitmasks accordingly. Adds a KmnCompilerMessages namespace so a trivial
enum can be declared without risk of clashes with other ERROR_ or
similar messages.
2024-07-28 11:45:03 +07:00
Marc Durdin
c8b055101f refactor(developer): rename CWARN_Info to CINFO_Info 2024-07-28 08:42:57 +07:00
Marc Durdin
091b4042a2 refactor(developer): rename CERR_None and CERR_EndOfFile to STATUS_
These two codes are not true error or message codes, but are used as
return values extensively throughout kmcmplib. The codes are never
passed to message callbacks. As such, I have renamed them to reflect
usage, but opted not to change their values as there would be some risk
in doing so (e.g. use of `!v` vs `v == CERR_None`).
2024-07-27 09:24:13 +07:00
Marc Durdin
a0e786035f refactor(developer): rename error severity masks to match typescript 2024-07-27 09:17:20 +07:00
Marc Durdin
503d9c6ea9 chore(developer): use FATAL_ prefix for fatal errors in kmcmplib 2024-07-27 09:11:03 +07:00
Marc Durdin
1afa4beb01 fix(developer): remove paths from tsconfig.json
Fixes: #12027
2024-07-26 06:59:45 +07:00
Marc Durdin
09a1ad7b69 feat(developer): add hint when index() store is longer than any() store
While it does not cause any problems to have a index() store that is
longer than its corresponding any() store, it often indicates a mistake,
as the trailing characters in the store are ignored. Thus, adding as a
hint (which can be disabled via message suppression) rather than as a
warning or error.

Example code:
    store(abc) 'abc'
    store(defg) 'defg'
    any(abc) + 'x' > index(defg, 1)  c generates HINT_IndexStoreLong

Fixes: #10666
2024-07-24 07:35:31 +07:00
Marc Durdin
e6f8765d91
chore: Update developer/src/common/include/kmn_compiler_errors.h 2024-07-23 15:13:07 +10:00
Marc Durdin
dcf1d29bdb
Merge branch 'fix/developer/11814-kmx_u16-buffer-overrun' into fix/developer/11773-prevent-invalid-targets-store-values 2024-07-23 15:11:22 +10:00
Marc Durdin
63ca95ed76 fix(developer): prevent invalid values in targets store
Fixes: #11773
2024-07-03 08:33:15 +10:00
Marc Durdin
83f9169e04
Merge branch 'master' into fix/developer/11643-prevent-non-bmp-chars-in-key-part-of-rule 2024-06-18 07:44:08 +10:00
Marc Durdin
09ee827270 refactor(common): move .keyman-touch-layout reader/writer to @keymanapp/developer-utils
Relates to #9665
2024-06-13 10:24:14 +10:00
Marc Durdin
b0ff102b45
Merge pull request #11735 from keymanapp/fix/developer/11362-verify-email-addresses-in-package
fix(developer): verify email addresses in .kps and .keyboard_info
2024-06-13 10:04:00 +10:00
Marc Durdin
f6105d87d8 refactor(common): fixup tests for kvks-file 2024-06-13 09:31:52 +10:00
Marc Durdin
1c74d9d713 refactor(common): move kvks-file to @keymanapp/developer-utils
Relates to #9665
2024-06-13 08:58:55 +10:00
Marc Durdin
de9ab217e9 refactor(common): move kps-file.ts to @keymanapp/developer-utils
Part of #9665.
2024-06-13 08:57:49 +10:00
Marc Durdin
071fe5ccb5 chore(developer): fixup reference to xml2js 2024-06-13 08:57:27 +10:00
Marc Durdin
185c020bf1 chore(developer): update xml2js reference for kpj-file-reader 2024-06-12 16:43:28 +07:00
Marc Durdin
74e2a8ccea refactor(common): move kpj test fixtures and cleanup post-move
Moves the kpj test fixtures into developer-utils, moves from let to
const in code where required by eslint, and reduces the coverage
threshold in order to get tests to pass for developer-utils.
2024-06-12 16:31:53 +07:00
Marc Durdin
9cf09a5140 refactor(common): move kpj-related files into developer-utils
Relates to #9665.
2024-06-12 16:31:52 +07:00
Marc Durdin
4ed88d8fa6 refactor(developer): move developer-utils files into src/ and sub-folder
In preparation for moving source file types into developer-utils, move
the existing developer-utils files into src/ and src/utils subfolders.
2024-06-12 16:31:50 +07:00
Marc Durdin
2dcc8fb948 fix(developer): prevent non-BMP characters in key part of rule
Currently, keys must be a UTF-16 code unit or a virtual key. Non-BMP
characters are unsupported. Technically, there is space available in the
.kmx `COMP_KEY` structure to accommodate UTF-32 codepoints, from
kmx_file.h:

    KMX_WORD_unaligned Key;
    KMX_WORD_unaligned _reserved;

However, the utility of this is almost nil, as it is very unlikely we
will encounter base keyboards (for mnemonic layouts) that generate any
characters outside the BMP, so there is little value in adding support
for this at this time.

The compiler will generate an error if this is encountered.

Fixes: #11643
2024-06-12 16:23:32 +07:00
Joshua A. Horton
d07fa7e953 chore(common): eliminate ts-node ref from most subpackages 2024-06-10 10:07:58 +07:00
Joshua A. Horton
e527317d3a fix(common): remove subpackge entries for older TS version 2024-06-10 09:14:03 +07:00
Marc Durdin
5cdad488aa
test(developer): add extra email address tests
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2024-06-08 10:46:31 +10:00
Marc Durdin
2506ff7c01 fix(developer): verify email addresses in .kps and .keyboard_info
Add verification of email address formats to kmc-package,
kmc-keyboard-info, and kmc-model-info. Add corresponding unit tests for
kmc-package and kmc-keyboard-info (kmc-model-info unit tests will be a
later addition). Uses AJV's email validation regex, as we rely on AJV
for schema compliance tests.

Fixes: #11362
Fixes: KEYMAN-DEVELOPER-1XE
2024-06-07 13:30:21 +07:00
Marc Durdin
50b28ff3ff fix(developer): treat js files with unrecognized encodings as non-keyboard files
Fixes: KEYMAN-DEVELOPER-201
Fixes: #11687
2024-06-06 06:51:11 +07:00
Marc Durdin
8b2070c339 chore(developer): minor cleanup on scripts
Additional shared script resources for Developer and Windows,
refactor of a code signing function, refactor of clean step in build.sh.
2024-05-20 06:35:11 +07:00
Marc Durdin
8b6d6b0618 chore(developer): cleanup on build scripts
A round of cleanup and consistency for Developer build scripts.
2024-05-20 06:35:05 +07:00
Marc Durdin
ee0fc0ce14 chore(developer): cleanup npm publish
Use a new flag `--npm-publish` in conjunction with `publish` action,
so that the default will always be to `npm pack` if the new flag is not
specified. This flag is also guarded in the actual npm publish code to
ensure that it can only run in the appropriate CI alpha/beta/stable
environment, and not in local or test.

This then also removes the separate `pack` action.

Also removes legacy boilerplate from a number of build scripts.
2024-05-20 06:34:57 +07:00
Marc Durdin
fa57d5c674 chore(developer): final work on build.sh for developer
Now builds from a clean repo:

  developer/src/build.sh configure build test publish

* Splits kmbrowserhost into kmdbrowserhost for Developer; this means
  that Developer Browser Host now inherits the Developer settings rather
  than the Keyman for Windows settings, and simplifies distribution and
  management. The only difference between the two is in the startup code
  so this seems like a good split.

* Cleanup of various build scripts and dependencies.
2024-05-20 06:34:53 +07:00
Marc Durdin
41df6d1cd7 chore(developer): refactor remaining build scripts
This finishes the changes for all build infrastructure for Keyman
Developer to use build.sh.
2024-05-20 06:34:50 +07:00
Marc Durdin
c8a1c6aa39 chore(developer): use builder.inc.sh instead of build-utils.sh in build scripts
also, remove old Makefiles
2024-05-20 06:34:46 +07:00
Marc Durdin
2499ebf4bb chore(developer): move windows common Makefiles to build scripts
Relates to #11317.
2024-05-20 06:34:38 +07:00
Marc Durdin
86c62ff36c chore(developer): transition remaining projects to build.sh
Relates to #11317.

All projects now have a build.sh. Still need to work on inst/, remove
old Makefiles, and update CI.
2024-05-20 06:33:51 +07:00
Joshua A. Horton
398b9e0ae2 chore(common): drops package-specific 'chai', '@types/chai' versions
chore(web): missed leaving these out of the rebase
2024-05-07 14:35:09 +07:00
Marc Durdin
cd8121ef65 chore(common): builder scripts now use /resources/build/builder.inc.sh
Note: there is a bit of potential confusion about the difference between
/resources/builder.inc.sh (the full implementation for builder scripts),
and /resources/build/builder.inc.sh (the source script that builder
scripts should always use).

This allows us to make assumptions that will always be true for builder
scripts that may not be true for other scripts, such as setting base
folder.
2024-05-02 15:54:31 +07:00