Commit graph

2036 commits

Author SHA1 Message Date
Eberhard Beilharz
689f664ea0 refactor(web): rename variables and parameter names in KeymanEngine 🧼
Build-bot: skip build:web
Test-bot: skip
2026-05-29 11:59:55 +02:00
Eberhard Beilharz
b5be1d45f0 chore(web): address code review comments 2026-05-29 11:59:33 +02:00
Eberhard Beilharz
bc8a4b6f43 refactor(web): cleanup return types in KeymanEngine
This change explicitly specifies the return types and access for the
functions in KeymanEngine. Also introduce `KeyboardDetails` instead of
`ReturnType<>`.

Test-bot: skip
2026-05-29 11:59:32 +02:00
Eberhard Beilharz
0d266cf873 chore(web): fix red squiggles in .ts test files in vscode
VSCode shows red squiggles under things like `describe` or `it` in
.ts test files for web. This change adds the types to the `tsconfig.json`
file which fixes this problem.

Build-bot: skip build:web
Test-bot: skip
2026-05-29 11:59:04 +02:00
Marc Durdin
9f75726344 chore(web): Merge branch 'master' into chore/web-core-preflight 2026-05-28 13:47:36 +02:00
Eberhard Beilharz
d3269fa247
Merge pull request #16021 from keymanapp/refactor/web/docs
docs(web): reformat and small fixes
2026-05-28 10:31:54 +02:00
Eberhard Beilharz
78ea935fe5
docs(web): reformat and small fixes
- rewrap lines
- change http:// to https://

Build-bot: skip
Test-bot: skip
2026-05-27 19:55:36 +02:00
Eberhard Beilharz
748ad4aa01
chore(web): add filename to link text of manual web tests
This change appends the filename to the description of the tests on
the index page of the manual web tests. This makes it easier to find
the test on the rendered index page when having the directory name
of the test available.

Build-bot: skip
Test-bot: skip
2026-05-27 19:34:09 +02:00
Marc Durdin
49a2887c24
Merge branch 'epic/web-core' into feat/web/varStoresCleanup
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-04-18 01:29:29 +10:00
Marc Durdin
b15f9548ef chore(web): add ref to headless-resources 2026-04-17 17:26:16 +02:00
Marc Durdin
50139a0ebd refactor(web): eliminate nullable variableStoreSerializer code paths
To reduce the number of possible failure cases within KeymanWeb,
require variableStoreSerializer to always be initialized. This impacts
only unit tests in practice. There remains a unit test special case in
the variable store code itself which needs to be removed in the future.

Create a mock VariableStoreTestSerializer class so that unit tests can
run without impacting state or requiring cookies. (We should leverage
this in future tests to verify that variable stores are saved
correctly.)

Establish keyman/test/headless-resources, so that we can include shared
resources such as VariableStoreTestSerializer without creating a
dependency on either DOM or Node.
2026-04-17 15:36:11 +02:00
Eberhard Beilharz
6677c2b198
refactor(web): address code review comments
Co-authored-by: Marc Durdin <marc@durdin.net>
2026-04-17 14:49:10 +02:00
Marc Durdin
2cffc57eb1 chore(web): cleanup variable store interfaces for web-core 2026-04-17 12:59:04 +02:00
Marc Durdin
d6c2b213ee
Merge branch 'epic/web-core' into feat/web/varStoresCleanup 2026-04-17 20:44:06 +10:00
Marc Durdin
7df5b94cc2 refactor(web): simplify VariableStore type
Remove the unnecessary nested set patterns for `VariableStore` and
rename the type to `VariableStores` to match its actual use.
2026-04-17 12:08:58 +02:00
Eberhard Beilharz
115ab18d71
refactor(web): add abstract Keyboard base class
Also rename `JSKeyboardData` → `KeyboardData`.

Test-bot: skip
2026-04-16 22:18:08 +02:00
Eberhard Beilharz
bbad490154
maint(web): cleanup imports
For the files touched in this PR:

- fix the order of the imports according to style guide
- use `node:` prefix for node modules
- add header
2026-03-23 15:43:17 +01:00
Eberhard Beilharz
06f7f22cd0
maint(web): address more code review comments
Co-authored-by: Marc Durdin <marc@durdin.net>
2026-03-23 15:43:17 +01:00
Eberhard Beilharz
745fa36d24
chore(web): Merge branch 'epic/web-core' into maint/web/jstests
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-03-20 18:03:47 +01:00
Eberhard Beilharz
1d9b8cc883
maint(web): address code review comments
- inline consts so that we don't have to export them for unit testing
- create `getKeymanRoot` and `getWebTestResourcesPath` helper functions
  to DRY out the code
- run `languageProcessortests.js` without coverage to prevent a failure
  creating the coverage report.
2026-03-20 15:53:41 +01:00
Marc Durdin
6c6780aa28
Merge pull request #15748 from keymanapp/auto/A19S24-merge-master-into-web-core
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
auto: A19S24 merge master into web-core 🎼
2026-03-17 15:29:10 +11:00
Marc Durdin
2c3b03c78b maint(web): use gosh to execute web server in e2e tests
Fixes: #15758
Test-bot: skip
2026-03-16 16:29:51 +01:00
Marc Durdin
70c54b0b40 chore: Merge branch 'epic/web-core' into auto/A19S24-merge-master-into-web-core
Some checks are pending
Keyman Build Summary / Summarize build status checks (push) Waiting to run
2026-03-16 04:49:38 +01:00
Marc Durdin
659e85033a
Merge pull request #15665 from keymanapp/maint/developer/test-callbacks-cleanup
maint(developer): make `TestCompilerCallbacks` usage more consistent and simplify
2026-03-06 21:00:39 +07:00
Marc Durdin
645e1cd16f chore(web): remove implicit any type when setting processingConfig.itemIdentifier
Not exactly clear what triggered this? Perhaps related to npm package updates,
but hard to see how.

Test-bot: skip
Build-bot: skip build:web
2026-03-05 21:46:40 +01:00
Marc Durdin
529a49431e maint(developer): make TestCompilerCallbacks usage more consistent and simplify
Simplify usage of `TestCompilerCallbacks` by making it responsible for
the `beforeEach` and `afterEach` incantations itself. There are a couple
of more complex usages of `TestCompilerCallbacks` which have been
excluded from this change on purpose.

Renamed `testCallbacks` to `callbacks` in the one place where it was
different.

Hoist @types/node and @types/mocha because inconsistent versions of
@types/mocha were causing compiler errors with this change.

Also added a cast to `fs.readFileSync` to `Uint8Array` to eliminate
compiler warnings/errors in test files.

Fixes: #15654
Test-bot: skip
2026-03-03 16:44:06 +01:00
Eberhard Beilharz
3c525cc244
chore: Merge branch 'epic/web-core' into auto/A19S23-merge-master-into-web-core 2026-02-27 10:19:18 +01:00
Joshua Horton
5c445d470c change(web): remove temp debug shell-script echo statements 2026-02-18 12:59:17 +07:00
Joshua Horton
b7975973af maint(web): ensure Web build scripts handle paths with spaces properly
The command shortcuts that were used by Web
scripts to create bundles via `esbuild` were not
properly handling the $KEYMAN_ROOT path when it
contained a space.  These changes will rectify
this behavior and permit builds for such cases.

Build-bot: skip build:web
Test-bot: skip
2026-02-18 09:14:30 +07:00
Eberhard Beilharz
7f1b925633
chore(web): fix buggy merge 2026-02-13 11:44:33 +01:00
Marc Durdin
ed63b70bb4
Merge branch 'epic/web-core' into auto/A19S22-merge-master-into-web-core 2026-02-13 11:08:05 +07:00
Joshua Horton
b3e045a7a8 change(web): define, utilize cleaner Web test-resource import paths
Build-bot: skip build:web
Test-bot: skip
2026-02-05 10:11:14 -06:00
Eberhard Beilharz
933361a520
feat(web): add and use RTL test keyboard
Build-bot: skip:all, build:web
Test-bot: skip
2026-01-29 14:52:56 +01:00
Eberhard Beilharz
4992268b77
feat(web): add unit test for RTL
This change stubs out `KMXKeyboard.isRTL` and adds a unit test for RTL
with .js and  .kmx (currently skipped) keyboards. Also change some code
to use `Keyboard` instead of `JSKeyboard` and stub out additional methods.

The RTL functionality will have to be completed when the necessary
extensions to the Core API are implemented (#15482).

Fixes: #15288
Test-bot: skip
2026-01-29 14:52:55 +01:00
Eberhard Beilharz
84aedb8616
refactor(web): rename keyboard.tests.tsjskeyboard.tests.ts
Test-bot: skip
2026-01-29 14:52:55 +01:00
Eberhard Beilharz
e2b31c488b
maint(web): re-add engine .js tests
PR #15093 merged multiple engine modules into one. However, in doing so
we lost the .js tests and ran only the .ts ones. This change re-adds the
.js tests and fixes them where the code diverged since then.

Other changes:
- rename `queryEngine.ts` to `cloudQueryEngine.ts` to match the class name
- remove unused `keyboard-storage/cloud/index.ts`
- expose `CLOUD_TIMEOUT_ERR` and `CLOUD_STUB_REGISTRATION_ERR` as
  `unitTestEndpoints`
- add `test/resources` to exports in `web/package.json`. This was necessary
  because the compiled .ts test files are under `web/build` whereas the
  .js test files are under `web/src` and so the relative paths in imports
  no longer work. Also fix the imports in test files.
- apply fix from #15477 if KEYMAN_ROOT is not set

I'm not happy to put the compiled files under
`web/src/test/auto/resources/build`, but that's the only way I got it
to work. If I put the compiled files in `web/build/test/resources` it
couldn't find the types for `promise-status-async`.

Also, running the .js tests succeeded but then creating the coverage
report failed. I was not able to find the reason or a fix for that. As a
hack to work around this problem we check the number of failed tests
instead of relying on the exit code of the test.

Follows: #15093
Test-bot: skip
2026-01-26 18:05:23 +01:00
Eberhard Beilharz
bfa6dfa412
Merge pull request #15477 from keymanapp/fix/web/tests
fix(web): fix problem with tests if KEYMAN_ROOT is not set 🎼

When running mocha without starting it through `build.sh`/`test.sh` the tests failed if the `KEYMAN_ROOT` environment variable was not set. Things were almost correct, but the undefined `KEYMAN_ROOT` variable added an extra `undefined` subdirectory. This change fixes this problem by setting `KEYMAN_ROOT` relative to the current file. This gets removed by `pathToFileURL` which also adds the absolute path to the current directory since we pass a relative path as argument.
2026-01-26 11:30:22 +01:00
Eberhard Beilharz
fd2a43de95
Update web/src/test/auto/headless/engine/loadKeyboardHelper.ts
Co-authored-by: Marc Durdin <marc@durdin.net>
2026-01-26 08:49:20 +01:00
Eberhard Beilharz
7e972ab49a
Merge pull request #15465 from keymanapp/refactor/web/ProcessorInitOptions
refactor(web): refactor `ProcessorInitOptions` 📏 🎼

This addresses a web-core TODO comment.

This change makes the `options` parameter in the `JSKeyboardProcessor` constructor no longer optional. Also `baseLayout` and `defaultOutputRules` are now required in `ProcessorInitOptions`. For testing purposes we export `DEFAULT_OPTIONS` in a testing endpoint.

The `options` parameter in the `InputProcessor` constructor is no longer optional. Also removes the `DEFAULT_OPTIONS` from
`InputProcessor`.

This change also moves the `ProcessorInitOptions` interface to a separate file and makes `keyboardInterface` a required field.

An alternative approach would have been to get rid of `ProcessorInitOptions` and instead set the `JSKeyboardProcessor` fields after creating the instance. Doing it the implemented way seemed cleaner.
2026-01-22 17:34:08 +01:00
Eberhard Beilharz
7f110d15c5
feat(web): fix build 2026-01-22 17:14:01 +01:00
Eberhard Beilharz
7d57e839ac
chore(web): Merge branch 'epic/web-core' into feat/web/15287_doModifierPress 2026-01-22 17:03:19 +01:00
Eberhard Beilharz
26542576ee
feat(web): address code review comments and fix build 2026-01-22 17:00:33 +01:00
Eberhard Beilharz
54e6a8adef
fix(web): fix problem with tests if KEYMAN_ROOT is not set
When running mocha without starting it through `build.sh`/`test.sh`
the tests failed if the `KEYMAN_ROOT` environment variable was not set.
Things were almost correct, but the undefined `KEYMAN_ROOT` variable
added an extra `undefined` subdirectory. This change fixes this problem
by setting `KEYMAN_ROOT` to the current directory (`.`). This gets
removed by `pathToFileURL` which also adds the absolute path to the
current directory since we pass a relative path as argument.

Build-bot: skip
Test-bot: skip
2026-01-21 15:25:35 +01:00
Eberhard Beilharz
40ce71a63f
refactor(web): address code review comments
The definition of `DEFAULT_PROCESSOR_INIT_OPTIONS` got lost in
last PR.

Test-bot: skip
2026-01-21 13:07:43 +01:00
Eberhard Beilharz
2b56e871f8
chore(web): Merge branch 'epic/web-core' into feat/web/persistopts 2026-01-21 12:44:33 +01:00
Eberhard Beilharz
6ae03c84ca
Merge pull request #15438 from keymanapp/feat/core/optionsupdate
feat(core): expose `km_core_state_options_update` to WASM 🍪 🎼

Part-of: #13426
2026-01-20 14:57:54 +01:00
Eberhard Beilharz
ad10627e1c
chore(web): Merge branch 'refactor/web/defaultRules' into refactor/web/ProcessorInitOptions 2026-01-20 12:12:22 +01:00
Eberhard Beilharz
8ecaae5f21
refactor(web): address code review comments
- remove confusing comment
- move default ProcessorInitOptions to tests folder
- add jsdoc comments to ProcessorInitOptions

Test-bot: skip
2026-01-20 12:10:25 +01:00
Eberhard Beilharz
63173a25ba
feat(developer): address code review comments 2026-01-20 11:47:14 +01:00
Eberhard Beilharz
2641681f89
chore(web): Merge branch 'epic/web-core' into refactor/web/defaultRules 2026-01-20 11:45:09 +01:00