Commit graph

143 commits

Author SHA1 Message Date
Marc Durdin
52291b1ccb chore(developer): remove unused xml2js references 2023-10-09 06:34:32 +07:00
Marc Durdin
0f5e88192c chore(developer): Update kmc-package xml2js dependency
I missed adding this as a dependency for @keymanapp/kmc-package. because
node has a very lenient dependency search, it found xml2js from other
@keymanapp/common-types, so never caused errors locally.
2023-10-09 06:06:34 +07:00
Marc Durdin
6c944cff65 chore: Merge branch 'epic/package-metadata' into chore/merge-master-into-package-metadata 2023-10-06 11:52:13 +07:00
Marc Durdin
225877f57a feat(common): precompile json schemas to improve performance
Fixes #9640.

This ended up being somewhat more fragile than originally anticipated.
For the `ajv` cli call to get the right versions, we needed to install
ajv as a dev dependency in the top-level package.json as well as at the
common/web/types level.

Ajv does not do all that well with ESM yet, either, so we use esbuild to
transform the compiled validators before building in typescript.
2023-10-05 13:56:53 +07:00
Marc Durdin
1e5c59c33f
Merge branch 'chore/common/9677-version-to-esm' into chore/common/9679-keyman-version-esm-only 2023-10-04 19:07:28 +11:00
Marc Durdin
21f226c0b2
Merge branch 'chore/common/9675-hextobin-to-esm' into chore/common/9677-version-to-esm 2023-10-04 19:07:18 +11:00
Marc Durdin
75a0977cdb chore(developer): fix server tests 2023-10-04 14:17:59 +07:00
Marc Durdin
8c28b96c9f chore(common): convert resources/build/version to ES Modules
Fixes #9677.
2023-10-04 12:21:35 +07:00
Marc Durdin
f432cab851 chore(common): keyman-version now generates only es module 2023-10-04 12:06:46 +07:00
Marc Durdin
fbd9a4b5e8 chore(common): convert resources/build/version to ES Modules
Fixes #9677.
2023-10-04 11:50:53 +07:00
Marc Durdin
94be7bb60c chore(developer): validate emitted .keyboard_info and fix keys
Fixes #9620.

.keyboard_info keys emitted from kmc-keyboard-info had the wrong format
for the example.keys object, which I discovered when I applied the
validation to the kmc-keyboard-info output.
2023-09-25 15:53:20 +07:00
Marc Durdin
508588ef26 chore(developer): developer-utils as private package 2023-09-01 15:58:22 +07:00
Marc Durdin
7f76de4781 chore(developer): add developer-utils as workspace 2023-09-01 10:11:15 +07:00
Marc Durdin
56d64da9a7 chore(developer): npm install and fix import 2023-08-30 16:31:43 +10:00
Marc Durdin
72efe0cd5c feat(developer): markdown conversion for description in package editor 2023-08-17 10:17:52 +07:00
Marc Durdin
fa19eea873 chore(developer): improve kmc sentry reporting on fatal build errors
kmc already reported unhandled exceptions, but any handled fatal errors
were captured and only reported to the user. It is better to report
these to Sentry as these are still unexpected.

I have refactored all the fatal exception messages in various kmc
modules to use a common mechanism, keeping all the Sentry integration in
kmc, now passing exception data up in the `CompilerEvent.exceptionVar`
property.

* I took the opportunity to rename messages.ts to
  infrastructureMessages.ts

* @types/chai was missing which gave intellisense errors in vscode

* normal exit of kmc now provides an opportunity for error reports to
  Sentry to be finalized

* Added a unit test for fatal errors in kmc

* Added a manual test pathway with `SENTRY_CLIENT_TEST_BUILD_EXCEPTION`
  env var to trip the build fatal error mechanism and verify that it
  looks ok; the following shows test runs demonstrate how fatal build
  errors are reported:

```
mcdurdin@THARK MINGW64 /c/Projects/keyman/app/developer/src/kmc (chore/developer/report-fatal-compiler-errors-to-sentry)
$ SENTRY_CLIENT_TEST_BUILD_EXCEPTION=1 node . --error-reporting build
fatal KM05001: Unexpected exception: Error: Test exception from SENTRY_CLIENT_TEST_BUILD_EXCEPTION

Call stack:
Error: Test exception from SENTRY_CLIENT_TEST_BUILD_EXCEPTION
    at build (file:///C:/Projects/keyman/app/developer/src/kmc/build/src/commands/build.js:78:19)
    at Command.<anonymous> (file:///C:/Projects/keyman/app/developer/src/kmc/build/src/commands/build.js:66:24)
    at Command.listener [as _actionHandler] (C:\Projects\keyman\app\node_modules\commander\lib\command.js:482:17)
    at C:\Projects\keyman\app\node_modules\commander\lib\command.js:1283:65
    at Command._chainOrCall (C:\Projects\keyman\app\node_modules\commander\lib\command.js:1177:12)
    at Command._parseCommand (C:\Projects\keyman\app\node_modules\commander\lib\command.js:1283:27)
    at C:\Projects\keyman\app\node_modules\commander\lib\command.js:1081:27
    at Command._chainOrCall (C:\Projects\keyman\app\node_modules\commander\lib\command.js:1177:12)
    at Command._dispatchSubcommand (C:\Projects\keyman\app\node_modules\commander\lib\command.js:1077:23)
    at Command._parseCommand (C:\Projects\keyman\app\node_modules\commander\lib\command.js:1248:19)

    This error has been automatically reported to the Keyman team.
      Identifier:  6f0fca1a26694c22b03f02b2463d39c5
      Application: Keyman Developer
      Reported at: https://sentry.io/organizations/keyman/projects/keyman-developer/events/6f0fca1a26694c22b03f02b2463d39c5/

mcdurdin@THARK MINGW64 /c/Projects/keyman/app/developer/src/kmc (chore/developer/report-fatal-compiler-errors-to-sentry)
$ SENTRY_CLIENT_TEST_BUILD_EXCEPTION=1 node . --no-error-reporting build
fatal KM05001: Unexpected exception: Error: Test exception from SENTRY_CLIENT_TEST_BUILD_EXCEPTION

Call stack:
Error: Test exception from SENTRY_CLIENT_TEST_BUILD_EXCEPTION
    at build (file:///C:/Projects/keyman/app/developer/src/kmc/build/src/commands/build.js:78:19)
    at Command.<anonymous> (file:///C:/Projects/keyman/app/developer/src/kmc/build/src/commands/build.js:66:24)
    at Command.listener [as _actionHandler] (C:\Projects\keyman\app\node_modules\commander\lib\command.js:482:17)
    at C:\Projects\keyman\app\node_modules\commander\lib\command.js:1283:65
    at Command._chainOrCall (C:\Projects\keyman\app\node_modules\commander\lib\command.js:1177:12)
    at Command._parseCommand (C:\Projects\keyman\app\node_modules\commander\lib\command.js:1283:27)
    at C:\Projects\keyman\app\node_modules\commander\lib\command.js:1081:27
    at Command._chainOrCall (C:\Projects\keyman\app\node_modules\commander\lib\command.js:1177:12)
    at Command._dispatchSubcommand (C:\Projects\keyman\app\node_modules\commander\lib\command.js:1077:23)
    at Command._parseCommand (C:\Projects\keyman\app\node_modules\commander\lib\command.js:1248:19)
```
2023-08-09 09:34:44 +07:00
Marc Durdin
cdf026c2ba chore: Merge branch 'feature-kmc-kmw' into chore/merge-master-into-feature-kmc-kmw-a17s18 2023-08-04 12:54:10 +07:00
Marc Durdin
c9e1e82a76
Merge branch 'feature-kmc-kmw' into feat/developer/introduce-kmc-keyboard-info 2023-07-26 19:24:34 +10:00
Marc Durdin
810f0a04ee chore(developer): npm install 2023-07-26 14:57:08 +07:00
Marc Durdin
b369fbb89b feat(developer): implement kmc keyboard_info compiler
Fixes missing components of the kmc-keyboard-info compiler and
integration into kmc. Lots of cleanup making sure that the compiler
actually generates expected output against the keyboards repository.
2023-07-25 14:21:58 +07:00
Marc Durdin
1810434b34 chore: Merge branch 'feature-kmc-kmw' into chore/merge-master-into-kmc-kmw-a17s17 2023-07-21 10:09:33 +07:00
dependabot[bot]
8f72f61cbb
chore(deps-dev): bump word-wrap from 1.2.3 to 1.2.4
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-20 11:17:39 +00:00
Marc Durdin
31ee7bff63 feat(developer): use sentry inject for sourcemap resolution 2023-07-13 06:07:44 +07:00
Marc Durdin
b435471b24 feat(developer): add sentry reporting for kmc
Fixes #9113.

Adds sentry reporting, plus helper functions, for kmc. Includes the
now-standard `-sentry-client-test-exception` command line parameter,
with `kmcmplib` and `event` sub-options available.

Uploads kmc* sourcemaps to sentry on a release build.

On Windows, honours the registry setting for error reporting. Also
includes a command line option `--[no-]error-reporting` (must be used
prior to initial command, e.g. `kmc --no-error-reporting build ...`).
2023-07-11 15:45:41 +07:00
Marc Durdin
de1c171f46 chore(developer): cleanup compiler messages in kmc
Fixes #8795.
Relates to #9090.

Cleans up and makes consistent compiler messages in kmc, and related
unit tests.

Adds support for colorized messages.

After installing chalk for ansi coloring in kmc, @types/node needed to
be brought in sync with the Typescript version, per the suggestion of
checking against `npm dist-tags @types/node`,found in a discussion at
https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/64262#discussioncomment-4905069

Additional tidying up includes:
* Deprecating a set of functions in compiler-interfaces, bringing them
  together under a new CompilerError class.
  Separating CompilerErrorSeverity and CompilerErrorMask enums.
* Making CompilerError.formatEvent (formerly compilerEventFormat) print
  messages in the same format as NodeCompilerCallbacks (sans coloring).
* Adding a wrapper class for CompilerCallbacks that manages the filename
  reporting, used currently exclusively by kmc itself.
2023-07-10 15:13:48 +07:00
Steven R. Loomis
50f0b3112a Merge remote-tracking branch 'upstream/master' into chore/common-8950-node18-engine 2023-07-04 15:51:37 -05:00
Marc Durdin
d914b6918d chore: Merge branch 'feature-kmc-kmw' into chore/merge-master-into-feature-kmc-kmw-a17s16-start 2023-06-26 14:33:20 +07:00
Joshua Horton
2ac8a4503b
Merge branch 'master' into feature-esmodule-web-engine 2023-06-26 09:09:43 +07:00
dependabot[bot]
7d08b08fb2
chore(deps): bump semver from 7.3.8 to 7.5.2
Bumps [semver](https://github.com/npm/node-semver) from 7.3.8 to 7.5.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.3.8...v7.5.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-24 12:37:06 +00:00
Marc Durdin
0bd2ca4821 refactor(developer): kmc-kmw becomes component of kmc-kmn
Moves kmc-kmw to being a sub-component of kmc-kmn, as it can never be
independently instantiated anyway. Reorganized tests accordingly.

Note that c8 is currently disabled for kmw-compiler, until we add unit
tests for it.
2023-06-20 11:52:23 +07:00
Joshua A. Horton
cb2029bf49 chore(web): cleanup for purely-headless KMW main-thread-module build scripts, esbuild configs 2023-06-14 15:37:30 +07:00
Steven R. Loomis
bdf7ed181e chore: add engine clause to package.json
- will warn if used in node !18
2023-06-13 11:09:43 -05:00
Joshua A. Horton
ea45572c2f chore(web): one minor cleanup bit 2023-06-12 12:22:08 +07:00
Joshua A. Horton
b41b619dfd feat(common/web): adds c8 for web/utils, web/keyboard-processor 2023-06-12 10:51:35 +07:00
Marc Durdin
7ad2df06d9 chore: Merge branch 'feature-kmc-kmw' into chore/merge-master-into-feature-kmc-kmw 2023-06-12 09:31:18 +07:00
Marc Durdin
db06dfd810 chore(developer): Merge branch 'feature-kmc-kmw' into feat/developer/kmc-analyze 2023-06-09 14:00:14 +07:00
Joshua A. Horton
9aea971ac5 chore(common/web): cleanup per PR review 2023-06-09 08:12:39 +07:00
Marc Durdin
f6e52270ed chore(developer): Merge branch 'feature-kmc-kmw' into feat/developer/kmc-analyze 2023-06-08 14:59:28 +07:00
Joshua A. Horton
754da7aa99 chore(web): cleanup, array-spread -> concat conversion 2023-06-08 13:03:25 +07:00
Joshua A. Horton
06434953a8 chore(web): KMW use of importHelpers 2023-06-08 13:03:25 +07:00
Joshua A. Horton
29c85c552c chore(web): minor esbuild version bump to get 'alias' option, adds tslib 2023-06-08 13:03:24 +07:00
Marc Durdin
4c3acaf651 chore(common): update restructure to support typescript 2023-06-08 05:40:48 +07:00
Marc Durdin
db6d8033a0 chore(developer): npm install 2023-06-06 14:39:04 +07:00
Joshua A. Horton
718ca50b23 chore(web): Merge branch 'master' into chore/web/feature-esmodule-a17s14-mid-update 2023-06-06 12:37:15 +07:00
Marc Durdin
7ccd8bed4f chore(developer): fix npm pack for kmc-ldml 2023-05-31 10:24:32 +07:00
Steven R. Loomis
d1b55ddee6 Merge remote-tracking branch 'upstream/master' into feat/developer-7377-transform-format-epic-ldml3 2023-05-16 18:10:49 -05:00
Joshua Horton
5b32a8702d
Merge pull request #8591 from keymanapp/refactor/web/legacy-web-events
refactor(web): proper modularization, implementation of documented API events 🧩
2023-05-15 13:54:46 +07:00
Marc Durdin
6094457f18 chore: package-lock.json again 2023-05-14 12:49:44 +07:00
Marc Durdin
9a4f8de5e2 chore(common): npm install 2023-05-14 12:47:05 +07:00
Joshua A. Horton
d9425bb1ff chore: Merge branch 'master' into feature-esmodule-as17s12-end-update 2023-05-12 11:53:12 +07:00