Commit graph

126 commits

Author SHA1 Message Date
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
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
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
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
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
Marc Durdin
0f390d47cc chore(common): maintenance on build scripts - cd
Fixes #11324.

* Always `cd "$THIS_SCRIPT_PATH"`
* Remove unnecessary `cd` from all build.sh
* Remove unnecessary `set -eu` from all build.sh (and `# set -x`)
* Replace old build-utils.sh incantation in a few build.sh scripts
2024-05-02 15:54:29 +07:00
Marc Durdin
02f9ce15c4 fix(developer): handle buffer boundaries in four cases
Fixes #11092.

Addresses buffer boundary tests for four cases, so a fatal error is not
returned to the user:
* character range too long (U+1234 .. U+2468)
* extended string too long ('abcde...xxxxx')
* outs too long (store(foo) .... outs(bar))
* virtual key expansion too long ([K_A] .. [K_Z] ...)

See #11136 for additional work arising.
2024-04-02 14:51:33 +07:00
Marc Durdin
2e2af5b0fa refactor(developer): tidy up the sourcemap path fixup 2024-03-25 10:23:14 +07:00
Marc Durdin
287a43ae91 chore(developer): try /dist path 2024-03-25 06:06:45 +07:00
Marc Durdin
2ce8dc5147 chore(developer): test alternate frame patchup 2024-03-22 13:27:53 +07:00
Marc Durdin
03491f5b7e chore(developer): use rewriteFrames integration in kmc 2024-03-22 11:55:04 +07:00
Marc Durdin
310504adb7
Merge pull request #10918 from keymanapp/chore/developer/consolidate-help-links
chore(developer): consolidate external links in Developer messages
2024-03-05 16:07:01 +07:00
Marc Durdin
987a17071d chore(developer): tiny refactor redux 2024-03-04 12:45:28 +07:00
Marc Durdin
90d39f9eaa chore(developer): tiny refactor of urls 2024-03-04 12:44:48 +07:00
Marc Durdin
e64103a02f chore(developer): consolidate external links in Developer messages
Establishes keyman-urls.ts as a single place for any links to external
websites.

I searched all .ts files in Keyman Developer source and replaced
references to websites with function calls here. Note that the names of
individual functions within this class can be easily changed as needed,
as the hard part was the consolidation.
2024-03-04 12:38:07 +07:00
Marc Durdin
9776aa7dbf fix(developer): move osk.ts from developer-utils to kmc-kmn
Fixes #10872. Modifies #10845.

developer-utils is also used by server. Because osk.ts depends on
common-types, this introduced a transitive dependency for
developer-utils. Packaging server for deployment as part of Keyman
Developer is fragile and we need to hand-code our internal dependencies,
as npm bundling struggles with in-repo dependencies. So we need to avoid
introducing extra dependencies into developer-utils at this time.

It turns out that osk.ts is used by kmc-kmn and kmc-analyze. kmc-analyze
already has a dependency on kmc-kmn, so it makes sense to put it there.
2024-03-01 08:47:04 +07:00
Marc Durdin
5062bbad98 feat(developer): adds kmc message command
Realtes to #10207.

Adds a new `kmc message` command which prints detailed information about
any or all compiler messages, in JSON, text, or markdown formats.

Markdown format is emitted to file in a structured way to be deployed to
the help site automatically (coming in a subsequent commit).
2024-02-29 11:05:27 +07:00
Marc Durdin
c7afed7201 refactor(developer): split messages with callstacks into separate generator
Relates to #10207.

In order to include message detail in messages, it is helpful to split
out the exception messages which have a separate parameter, so that
parameter at the same position can be the message detail.

Introduces the CompilerMessageSpecWithException function which takes an
exceptionVar parameter to achieve this differentiation.
2024-02-28 11:34:49 +07:00
Marc Durdin
70a50f0f67 refactor(developer): move osk module from common-types to developer-utils
This module is used only by Keyman Developer compiler. It was originally
in common-types because we didn't have a shared module for Developer.

Moving it to @keymanapp/developer-utils in order to improve its
documentation.
2024-02-26 14:57:27 +07:00
Marc Durdin
a8d0d8454c feat(developer): add api documentation to build
Relates to #10207.

Adds the `api` action to build.sh for each affected module. The `api`
action for each module will generate the api metadata files, and then
the markdown files are generated by /developer/build.sh api.

Note that developer-utils, kmc, and kmcmplib have no api documentation
at this time (and kmcmplib is not Typescript so would need separate
tooling anyway).
2024-02-26 11:45:36 +07:00
Marc Durdin
457275e46f fix(developer): ensure fatal errors report message or made non-fatal
Fixes #10678.

Some messages have been reduced to ERROR instead of FATAL, as they are
not internal compiler errors.

Where fatal messages are raised, the message will now be reported
through correctly to Sentry.
2024-02-20 11:10:39 +07:00
Marc Durdin
898310e6df fix(developer): kmc exit needs to wait for Sentry
Fixes #10488:

1. Use a consistent `exitProcess()` function so that we always wait for Sentry to do its thing.
2. Make `KeymanSentry.isEnabled()` non-async because it is synchronous.
3. Remove duplicate initialization of `KeymanSentry` in kmc.ts.
2024-01-30 14:41:11 +07:00
Marc Durdin
d2580c6a73
Merge pull request #10258 from keymanapp/feat/developer/10150-control-message-severity
feat(developer): add `-m` parameter to kmc to control message severity
2024-01-16 14:01:27 +11:00
Steven R. Loomis
54c77e2de9
Merge pull request #10300 from keymanapp/fix/developer/10291-layer-errs-epic-ldml
fix(developer): quell internal error when  a section fails 🙀
2024-01-02 17:05:00 -06:00
Steven R. Loomis
21a7680278 fix(developer): quell internal error when a section fails 🙀
- when a required section is missing, only throw an internal error IF we haven't already flagged a problem.  for example, if 'vars' fails to compile because of a problem, and we already have an error on file, then don't throw an internal error that 'bksp' depends on uninitialized 'vars'.

- mimic this flow in the test helpers.

- add a test case for this in the test helpers, in test-tran

- add a strictError flag to say that no additional errs are allowed.

Fixes: #10291
2023-12-21 22:14:54 -06:00
Marc Durdin
0ebc5d6aab feat(developer): add -m parameter to control message display
Fixes #10150.

This feature adds a command line parameter to kmc to control the
severity of INFO, HINT and WARN level messages. The severity of any of
these messages can be reduced all the way to INFO, or even disabled, or
increased to ERROR. The compiler and the reporter will honour the new
code and fail builds when failure-level codes are encountered.

Inputs are validated against all the available compiler messages in all
modules. This also provides a good pathway for automated future
documentation generation of compiler messages.

In order to process the input parameters cleanly, have refactored some
of kmc's build command logic.

This commit increases code coverage for kmc to roughly 50%.
2023-12-14 13:17:29 +07:00
Marc Durdin
3d250fecc0 chore(developer): ensure unit tests have default options set 2023-12-12 07:38:13 +07:00
Marc Durdin
89254296db chore(developer): honor prompt to upgrade in kmc
Fixes #10162.
2023-12-11 21:17:00 +07:00