Commit graph

2063 commits

Author SHA1 Message Date
Eberhard Beilharz
e593c458b0
maint(web): fix starting local dev server for e2e tests
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
Starting the local dev server before running the e2e tests with
`web/build.sh start` didn't work on Windows. This change now directly
calls `node` to start the server which seems to work cross-platform.

Fixes: #15895
Build-bot: skip build:web
Test-bot: skip
2026-05-13 11:44:32 +02:00
Eberhard Beilharz
d2fb11af90
Merge pull request #15898 from keymanapp/refactor/web/jstests
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
refactor(web): move context tests to typescript
2026-05-04 12:09:02 +02:00
Eberhard Beilharz
1b8f37ef3f
Merge pull request #15899 from keymanapp/chore/web/15894_test-index
chore(web): cleanup `web/src/app/browser/src/test-index.ts` exports

The exports of `test-index.ts` were intended to be used by tests only, but over time they contained also exports that were consumed elsewhere, e.g. in UI classes like `kmwuibutton.ts`. This change removes unused exports, moves test-only classes to a `unitTestEndPoints` container and marks test-only types with `@internal`.

Fixes: #15894
2026-05-04 12:07:32 +02:00
Eberhard Beilharz
90caa120f8
Merge pull request #15893 from keymanapp/refactor/web/kbdProcessor
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
refactor(web): move common code to abstract `KeyboardProcessor` base class

This change moves code that was implemented in both `JSKeyboardProcessor` and `CoreKeyboardProcessor` to the `AbstractKeyboardProcessor`. This got renamed from `KeyboardProcessor` and is now a generic abstract class.

Also removed some of the band-aids in `CoreKeyboardInterface` and `JSKeyboardInterface` that I put in before: Typescript allows implementations to have a slightly different method signature and still matches the interface as long as the used types are derived from the ones specified in the interface.

Follows: #15870
2026-04-30 19:07:23 +02:00
Eberhard Beilharz
925e68c182
refactor(web): move context tests to typescript
Build-bot: skip build:web
Test-bot: skip
2026-04-30 18:34:20 +02:00
Eberhard Beilharz
1bc83f9fcf
chore(web): cleanup web/src/app/browser/src/test-index.ts exports
The export of `test-index.ts` were intended to be used by tests only,
but over time they contained also exports that were consumed else where,
e.g. in UI classes like `kmwuibutton.ts`. This change removes unused
exports, moves test-only classes to a `unitTestEndPoints` container and
marks test-only types with `@internal`.

Build-bot: skip build:web
Test-bot: skip
2026-04-30 17:46:55 +02:00
Eberhard Beilharz
7c460e9b34
Merge pull request #15890 from keymanapp/feat/web/getKbdDetailsType
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
feat(web): clarify return type of `KeymanEngine.getKeyboardDetails` 🧼 🎼

`getKeyboardDetails` can return `null` if `stub` is falsy. This PR changes the return type accordingly to improve type safety.

Follows: #15889
2026-04-28 20:11:26 +02:00
Eberhard Beilharz
16dcfaa0cc
chore(web): Merge branch 'epic/web-core' into feat/web/keyboardDetails 2026-04-28 19:03:16 +02:00
Eberhard Beilharz
10fcfe470a
refactor(web): move common code to abstract KeyboardProcessor base class
This change moves code that was implemented in both `JSKeyboardProcessor`
and `CoreKeyboardProcessor` to the `AbstractKeyboardProcessor`. This got
renamed from `KeyboardProcessor` and is now a generic abstract class.

Also removed some of the band-aids in `CoreKeyboardInterface` and
`JSKeyboardInterface` that I put in before: Typescript allows
implementations to have a slightly different method signature and still
matches the interface as long as the used types are derived from the ones
specified in the interface.

Follows: #15870
Build-bot: skip build:web
Test-bot: skip
2026-04-28 18:59:42 +02:00
Eberhard Beilharz
8c9628791a
feat(web): ignore keyboards without details
This change will ignore keyboards where `getKeyboardDetails` returns
`null` and will not push them to the `detailsForAllKeyboards` array.

Addresses a code review comment.
2026-04-28 18:26:13 +02:00
Eberhard Beilharz
602a740cd9
Merge pull request #15888 from keymanapp/refactor/web/kbdDetails
refactor(web): use `KeyboardDetails` type 🧼 🎼

PR #15856 introduced the `KeyboardDetails` type but overlooked the use in one file.

Follow-up-of: #15856
Follows: #15887
2026-04-28 18:18:46 +02:00
Eberhard Beilharz
f16d27ca4c
Merge pull request #15887 from keymanapp/refactor/web/renames
refactor(web): rename variables and parameter names in KeymanEngine 🧼 🎼
2026-04-28 17:59:38 +02:00
Eberhard Beilharz
09d2816085
refactor(web): address code review comment
Co-authored-by: Marc Durdin <marc@durdin.net>
2026-04-28 16:52:22 +02:00
Eberhard Beilharz
85e3bf1e39
Merge pull request #15870 from keymanapp/feat/web/loadSerializedOpts
feat(web): get list of store names from stores defined in core

This implements `CoreKeyboardInterface.loadSerializedOptions` by getting the list of all variable store names from Core and then trying to load these.

Also change `VariableStoreSerializer.loadStore` signature so that it can return `undefined`. This allows to return only those options from `loadSerializedOptions` that have a non-default value, i.e. were serialized before.

Follow-up-of: #15470
2026-04-28 16:39:56 +02:00
Eberhard Beilharz
51283454d8
feat(web): clarify return type of KeymanEngine.getKeyboardDetails 🧼
`getKeyboardDetails` can return `null` if `stub` is falsy. This PR changes
the return type accordingly to improve type safety.

Follows: #15889
Build-bot: skip build:web
Test-bot: skip
2026-04-27 17:14:03 +02:00
Eberhard Beilharz
18408185d6
feat(web): implement getting keyboard details for KMX keyboards 🧼
Turns out that we can use `KeyboardStub` for both JS and KMX keyboards.

Follows: #15888
Build-bot: skip build:web
Test-bot: skip
2026-04-27 16:54:10 +02:00
Eberhard Beilharz
269ba67e89
refactor(web): use KeyboardDetails type 🧼
PR #15856 introduced the `KeyboardDetails` type but overlooked the use in
one file.

Follow-up-of: #15856
Follows: #15887
Build-bot: skip build:web
Test-bot: skip
2026-04-27 16:29:42 +02:00
Eberhard Beilharz
3b84867961
refactor(web): rename variables and parameter names in KeymanEngine 🧼
Build-bot: skip build:web
Test-bot: skip
2026-04-27 16:27:15 +02:00
Eberhard Beilharz
8defa88bb9
docs(web): update file header
Having a file header that mentions an old version can be confusing, so
this change updates the file headers for the UI files with the current
header.

Build-bot: skip
Test-bot: skip
2026-04-24 15:51:52 +02:00
Eberhard Beilharz
35ea65cde1
feat(web): get list of store names from stores defined in core
This implements `CoreKeyboardInterface.loadSerializedOptions` by getting
the list of all variable store names from Core and then trying to load
these.

Also change `VariableStoreSerializer.loadStore` signature so that it can
return `undefined`. This allows to return only those options from
`loadSerializedOptions` that have a non-default value, i.e. were
serialized before.

Build-bot: skip build:web
Test-bot: skip
2026-04-23 19:33:17 +02:00
Eberhard Beilharz
0a1a8de744
chore(web): address code review comments
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-04-21 12:11:11 +02:00
Eberhard Beilharz
b16dc6f2f8
refactor(web): cleanup return types in KeymanEngine
Some checks are pending
Keyman Build Summary / Summarize build status checks (push) Waiting to run
This change explicitly specifies the return types and access for the
functions in KeymanEngine. Also introduce `KeyboardDetails` instead of
`ReturnType<>`.

Test-bot: skip
2026-04-20 17:14:55 +02:00
Eberhard Beilharz
b7b03a9960
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-04-20 14:04:03 +02:00
Marc Durdin
407d9dd3b3
Merge pull request #14857 from keymanapp/epic/embed-osk-in-kmx
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
epic: embed-osk-in-kmx 🔱
2026-04-18 03:02:20 +10:00
Marc Durdin
0fb2cd2dc6 chore: Merge branch 'epic/web-core' into epic/embed-osk-in-kmx 2026-04-17 19:01:15 +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
Marc Durdin
2153403e84 refactor(common): introduce modifier-key-constants
Refactor the `getModifierState` and `getStateFromLayer` functions into a
cleaner `modifierStringToState` function, and move from web into common.

Marks existing functions as deprecated but does not update usage at this
time.
2026-04-16 09:17:24 +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
b6b10d1a09 chore: Merge branch 'epic/embed-osk-in-kmx' into auto/A19S24-merge-master-into-embed-osk-in-kmx 2026-03-15 07:42:03 +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
Keyman Server
7b9864810f
Merge branch 'epic/embed-osk-in-kmx' into auto/A19S23-merge-master-into-embed-osk-in-kmx 2026-02-27 08:25:14 +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