Commit graph

188 commits

Author SHA1 Message Date
Eberhard Beilharz
a7083e7960
feat(web): move/add core-adapter module
This change moves the core adapter to core-adapter module which contains
the code to bind to the the WASM core binaries and adds additional type
definitions for Core.

Part-of: #13926
Test-bot: skip
2025-11-14 15:10:20 +01:00
Marc Durdin
aa6b3c328e chore: Merge branch 'epic/web-core' into auto/A19S15-merge-master-into-web-core 2025-11-07 14:23:43 +01:00
Marc Durdin
df212364a2 maint(resources): add repository record for all published packages
While not documented as such, it appears that the repository record is
required with trusted publishing of npm packages.

Test-bot: skip
Build-bot: skip
2025-10-29 14:35:31 +01:00
Marc Durdin
ba411774f6 maint(resources): move NPM package publishing to GitHub Actions
Due to recent changes in NPM package publishing security requirements,
we have to move from TeamCity build to a GitHub Action to publish our
NPM packages, so we can take advantage of trusted publishing. This
change also consolidates and centralizes the npm publishing into
resources/build/ci/npm-publish.sh, which removes a lot of boilerplate
from each of the build.sh scripts, and ensures consistency.

Packages will be `npm pack`ed on PR and test builds, and published in
release builds.

Ref: https://docs.npmjs.com/trusted-publishers
Ref: https://github.blog/changelog/2025-09-29-strengthening-npm-security-important-changes-to-authentication-and-token-management/
Fixes: #14963
Test-bot: skip
Build-bot: release:developer
2025-10-27 16:31:55 +01:00
Marc Durdin
8da5cdd059 chore: Merge remote-tracking branch 'origin/epic/web-core' into chore/merge-master-into-web-core 2025-08-28 10:42:57 +02:00
Marc Durdin
f3fb3ac87b maint(common): move build-utils-ci.inc.sh to ci/ci-publish.inc.sh
Removes a number of unused functions from the file, renames remaining
functions to match our builder script prefix patterns, removes unused
imports from various build scripts (e.g. Android).

Fixes: #14453
2025-08-05 12:54:56 +10:00
Marc Durdin
2726050601 maint(common): rename and move node-related script functions into node.inc.sh
Consolidates the node-related script functions into node.inc.sh, as part
of cleaning up the build scripts and making them easier to maintain into
the future.

Fixes: #14447
2025-08-02 13:34:29 +10:00
Marc Durdin
f394245636 maint(common): consolidate builder scripts
Clarifies the confusing builder.inc.sh / build-utils.sh distinction by
giving the scripts more appropriate names. Most build scripts should use
builder-full.inc.sh; some helper scripts can use builder-basic.inc.sh.
Documented in resources/build/README.md.

Renames:
* resources/build/builder.inc.sh to resources/build/builder-full.inc.sh
* resources/build/build-utils.sh to resources/build/builder-basic.inc.sh

Other changes:
* Moves Android-specific functions out of builder-basic.inc.sh and into
  android/build.sh.
* Renames functions in builder-basic.inc.sh

More functions may be moved from builder-basic.inc.sh into utils.inc.sh
or other scripts in the future.

Fixes: #14065
Build-bot: build all
Test-bot: skip
2025-08-02 08:11:24 +10:00
Marc Durdin
65158a0526 maint(common): rename shellHelperFunctions.sh to utils.inc.sh
Adds documentation for various functions, removes unused functions (a
couple of simple, very lightly used functions were unDRYed; these could
go back the other way across all shell scripts if necessary). TODO items
noted for follow-up refactoring.

Fixes: #14275
Relates-to: #14269
Build-bot: build all
Test-bot: skip
2025-08-02 06:58:40 +10:00
Eberhard Beilharz
819c9cc3fe
chore: Merge branch 'epic/web-core' into chore/merge-master-into-web-core 2025-05-30 18:25:23 +02:00
Steven R. Loomis
4d9551ae07
Merge pull request #14050 from keymanapp/feat/developer/13939-ln-layrcompiler
feat(developer): line numbers for layr compiler
2025-05-27 19:00:41 -05:00
Steven R. Loomis
b681885eca feat(developer): add more tests to layr compiler
- check for duplicate minDeviceWidth
- check for invalid minDeviceWidth

Fixes #13939
2025-05-26 12:30:59 -05:00
Marc Durdin
9f15e7c7ec maint: add empty 'scripts' tag to package.json to silence warning
Also removes './' from front of gosh.js to address another npm cleanup
(from `npm pkg fix`).

Fixes: #13833
2025-05-25 06:35:28 +07:00
Marc Durdin
7c42887ead
Merge branch 'epic/web-core' into chore/merge-master-into-web-core 2025-03-31 12:13:48 +07:00
Eberhard Beilharz
1f8f979f61
Update core/include/keyman/keyman_core_api_vkeys.h
Co-authored-by: Marc Durdin <marc@durdin.net>
2025-03-27 15:39:00 +01:00
Eberhard Beilharz
3e3a0dbce1
refactor(linux): mark undocumented keycodes as internal
Several keys that are defined in `winuser.h` were added after Keyman
defined its vkeys and so are not documented in the Keyman docs. This
change adds underscores before and after to mark them as being internal.
It's still useful to have them in the source code because it makes the
mapping between Linux keys and Keyman vkeys easier.

Addresses code review comment.
2025-03-26 16:49:31 +01:00
Eberhard Beilharz
a645fea903
fix(linux): improve key mapping to allow Core to reset context
This change tries to map all keys to corresponding Core VKeys so that
Core sees them and can reset the context if necessary. Previously we
had 0 for most of the keys, which meant that we didn't send them to
Core but instead returned right away. While this doesn't directly fix
the failing user tests described in #12968, it fixes the original tests
in #11172.

Closes: #12968
2025-03-21 18:15:46 +01:00
Eberhard Beilharz
b2cccdd996
feat(core): expose context and actions APIs to WASM 2025-03-03 11:29:17 +01:00
Eberhard Beilharz
c297c66a64
feat(core): expose state and event API to WASM 2025-03-03 11:28:57 +01:00
Marc Durdin
130e697d40
Merge pull request #13230 from keymanapp/chore/merge-master-into-web-core
chore: merge master into web-core
2025-02-14 05:30:04 +07:00
Steven R. Loomis
b54ea40770 chore(developer): update comments per review
- note that 45,46,47 are the same data and so aliased

Fixes: #11307
2025-01-30 23:13:36 -06:00
Steven R. Loomis
b741a88ca0 chore(core,developer): treat CLDR v45, 46, 46.1, 47 as 46
Fixes: #11307
2025-01-30 15:42:30 -06:00
Steven R. Loomis
2c32fb7903 chore(resources, developer,core): CLDR 46 and workaround
Fixes: #11307
- import from CLDR 46, mostly unchanged

Fixes: #12749
- workaround LDML DTD bug CLDR-18138 where base= does not imply base=cldr
2025-01-30 15:41:34 -06:00
Joshua Horton
0d0c339f67
Merge branch 'epic/web-core' into chore/merge-master-into-web-core 2025-01-17 11:37:51 +07:00
Eberhard Beilharz
2e5722705b
feat(web): address code review comments 2025-01-06 15:12:09 +01:00
Eberhard Beilharz
a072171ec8
feat(web): load .kmx keyboard from blob
This change adds the web side of loading a .kmx keyboard from a
blob. It also replaces the `CoreProcessor` class with `CoreFactory`
that allows to directly use the methods defined in WASM without
having to add another wrapper for each method.
2024-12-20 18:01:42 +01:00
Eberhard Beilharz
1bedc62b57
feat(core): expose km_core_keyboard_load_from_blob to WASM 2024-12-09 16:06:31 +01:00
Steven R. Loomis
de3397b476
Merge pull request #12644 from keymanapp/fix/core/12298-get-key-list
fix(core): implement ldml_processor::get_key_list() 🙀
2024-12-09 08:14:44 -06:00
Marc Durdin
4c3b2132ee chore(core): remove km_core_keyboard_load API
Fixes: #12497
2024-12-04 13:38:07 +07:00
Steven R. Loomis
7f3bd30961 feat(core): improvements for get_key_list()
- expand OTHER and ALT / CTRL appropriately
- add KM_CORE_MODIFIER_NONE=0
- disable test of get_key_list() for now

Fixes: #12298
2024-11-29 17:25:31 -06:00
Eberhard Beilharz
3dc3f040de
feat(core): implement loading KMX from blob
- split keyboard loading into loading KMX file into blob and then
  loading the keyboard processor from the blob.
- deprecate `km_core_keyboard_load`
- move file access next to deprecated method. This is now the only place
  that loads a file in Core; unit tests have some more places that
  load files.
- introduce GTest and add unit tests for loading from blob

Cherry-picked from `epic/web-core` branch.

Cherry-Pick-Commit: 1deaa323ad
Cherry-Pick-Commit: 59019cc8b7
Cherry-Pick-Commit: bc46458368
Cherry-Pick-Commit: d06aa29956
Cherry-Pick-Commit: 1c88166f6e
Cherry-Pick-Commit: 069cd21ecd
Cherry-Pick-Commit: 052ae2ec35
Cherry-Pick-Commit: 11a2a3ba3a

Part-of: #11293
Part-of: #8093
2024-11-27 15:30:05 +01: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
Steven R. Loomis
1fe76bcd26
Merge branch 'master' into chore/core/11033-points-not-units 2024-05-07 09:26:07 -05:00
Steven R. Loomis
6706ae0957 chore(core): km_core_cp -> km_core_cu
- km_core_cp represents a 16 bit code unit, not a code point.

Fixes: #11033
2024-05-02 17:39:15 -05: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
Steven R. Loomis
5b1c853557 fix(common,core): support other lookup for modifiers
- the 'other' keyword was incorrectly called 'default'

Fixes: #11072
2024-04-01 23:21:33 -05:00
Steven R. Loomis
313bbd32a7 feat(core): kmx+ scaffolding for modifiers=default
- add a new value, 0x10000 to indicate 'default'

For: #11072
2024-03-28 12:19:41 -05:00
Marc Durdin
7f7bbe5030
chore: Apply suggestions from code review
Co-authored-by: rc-swag <58423624+rc-swag@users.noreply.github.com>
2024-03-22 17:31:28 +11:00
Marc Durdin
7136a69ac8 chore(core): fix links and tweaks docs 2024-03-21 06:12:59 +07:00
Marc Durdin
7bfda9881f chore(core): fix typos 2024-03-20 13:30:05 +07:00
Marc Durdin
216d4afdef chore(core): fix typos 2024-03-20 13:09:09 +07:00
Marc Durdin
56e70b82d1 chore(core): add links to other markdown files for v17 2024-03-20 13:08:24 +07:00
Marc Durdin
f43d5aa53f chore: copy change docs into header as well 2024-03-20 12:58:42 +07:00
Marc Durdin
73daec43c1 chore(core): refresh documentation and add build tool
Refreshes all of the public API header documentation so we have a single
source for the documentation -- the keyman_core_api.h header. A lot of
reformatting but very little change in terms of content.

This is converted into Markdown by api-header-extractor, and the results
can be copied to help.keyman.com.

Will only do the main keyman_core_api.h for v17 release, in interests of
time. The other headers are primarily internal only and have many
deprecated functions also.

Will also leave the full automation of the documentation generation to a
future PR. The script will be there but it won't run during build for
now.
2024-03-20 12:56:08 +07:00
Marc Durdin
83ac78ab7c chore(core): refresh API docs for 17.0
Fixes #10580.
2024-03-13 09:23:07 -05:00
Steven R. Loomis
17a653fa19 chore(core): ldml update out of techpreview 🙀
- updates to support techpreview -> 45
- test changes

Fixes: #10900
2024-03-02 22:40:39 -06:00
Steven R. Loomis
8975a38109 chore(common): ldml update out of techpreview 🙀
- updates to support techpreview -> 45

Fixes: #10900
2024-03-02 22:40:38 -06:00
Marc Durdin
1b88ab99be fix(core): make km_core_state_get_actions() idempotent
Fixes #10582.

Returned struct from the `km_core_state_get_actions()` API is now owned
by the state object. This is a change in API contract. The corresponding
`km_core_actions_dispose()` API has been made private, because there is
never any need for API consumers to call it. As this change is happening
in alpha, we won't bump the ABI version.

`state->app_context` is now guaranteed to be in sync with
`state->context` after `km_core_process_event()`, with the actions
struct populated at that point.

The next and final step in this refactor is to remove the actions queue
altogether from the Core and make that a kmn-only concept, but that will
wait until 18.0. The only consumers of the actions queue are the
kmn-specific interactive debugger in Keyman Developer, and kmn-specific
Input Method eXtensions in Keyman Engine for Windows.
2024-02-01 11:28:08 +07:00
Marc Durdin
9ee5777e48 chore(core): move action apis into keyman_core_api_actions.h
Fixes #10520.

The definitions for `struct km_core_action_item`, `struct
km_core_backspace_item`, `enum km_core_backspace_type`, `enum
km_core_action_type`, `km_core_state_action_items()`,
`km_core_state_queue_action_items()`, `km_core_process_queued_actions()`
are now in keyman_core_api_actions.h rather than in the primary
keyman_core_api.h, as they should not be used by engines in general.

The current users of those APIs are the interactive kmx debugger, and
the IMX integration in Keyman Engine for Windows. Both of these depend
on the old action queue model rather than the actions struct.

In a future version, we may refactor these further to make them apply
directly to the KMX processor, and provide access via an interface to
the KMX processor rather than as a general Core API. Once this change is
made, then Core itself will no longer support action queues at all, and
will expect keyboard processors to fill in an action struct (this is
already done for LDML).
2024-01-31 11:32:09 +07:00