Commit graph

54 commits

Author SHA1 Message Date
Joshua A. Horton
43bf49d1cd change(common/models): adds optional 'testMode' param to LMLayer config 2022-10-31 09:34:22 +07:00
Marc Durdin
2f2d3c72c9 chore(web): move lm-worker into its own folder
This starts the reorg required for splitting the lm worker into its own
module. Tests are still not working. But builds are going.

Some decisions to be made around the final path for wrapping of the
code. I think it may be possible to do something a whole lot more
elegant by moving the wrapping process into the KMW build and leaving
the LM Worker output as a pure tsc output -- given only KMW wants the
wrapped worker anyway (tests aside). The actual wrapping code could
still be in the lm-worker folder.
2022-04-14 15:33:23 +10:00
Marc Durdin
4d94786852 chore(web): replace lerna with npm workspaces and ts projects
Fixes #6320.

Part 1 of moving from lerna to a simpler, maintained monorepo solution,
using TypeScript Projects and NPM Workspaces.

There is more work to be done here. At this point, KeymanWeb builds and
runs without errors, but the built file is substantially different,
mostly in include order.

Using TypeScript Projects, we move away from the need to run build
scripts in various locations for almost all the Typescript modules.

TODO: Embedded versions and tests have not been verified.

TODO: developer/server is not yet verified.

TODO: developer/js (needs a rename!) is not yet verified.

TODO: Currently, the predictive-text folder needs refactoring to move
the construction of the worker wrapper out of the Predictive Text build
and into the final assembly of keymanweb.js (as it should be valid to
run it as a separate .js anyway).

TODO: Most of the `<reference>` paths need to be re-verified. Ideally
there should be no references outside the current module for any given
.ts.

TODO: The embedded vs browser vs node (headless) builds should be tidied
up for consistency so that it's obvious what depends on what. This is
currently messiest in the predictive-text folder, where the output names
diverge from the filenames and the various files are mixed in the same
folder (as evidenced by the exclusions listed in each tsconfig.json).

TODO: `npm install` should be removed from most build scripts and
instead `npm ci` (#6196) should be run only once from the top-level
folder for any given build. I've had eliminated side-effects from the
`install` action for npm, which makes it easier to reason about state.

TODO: verify_npm_setup and related functions can probably be eliminated.

TODO: most of the build scripts should be largely eliminated for web.

TODO: several ts projects use inconsistent output folders.

TODO: it may be possible to generate a .d.ts for models/types so that
we can use a consistent reference for those as well.

TODO: build.sh, tsconfig.json should always be in the module's top-level
folder, not in a subfolder such as src (e.g. see input-processor/src,
keyboard-processor/src, web/source).

TODO: resources/web-environment should be in common/web.

TODO: other js node_modules imports should be wrapped like es6-shim.

TODO: fix up the publish code for npm modules

TODO: eliminate version numbers from package.json if possible?

Whew, that's most of the stuff I noticed!
2022-04-12 21:02:33 +10:00
jahorton
6d111783e3 fix(common/core/web): predictive context reset 2020-12-03 15:48:18 +07:00
jahorton
25277eaa0e chore(common/core/web): Merge branch 'master' into feat/common/core/web/input-processor-unit-tests 2020-11-10 08:27:15 +07:00
jahorton
70d569a589 feat(common/models): LoadMessage refactor, model load from raw string (for tests) 2020-11-06 14:23:05 +07:00
jahorton
beb19fdf84 feat(common/models): reversion in lm-layer 2020-10-08 15:15:55 +07:00
jahorton
2355db4c46 feat(common/models): 'revert' now uses model's punctuation 2020-10-06 14:14:23 +07:00
jahorton
b9b0ff90b1 fix(common/lmlayer): fixes integrated unit tests 2020-04-17 09:57:35 +07:00
jahorton
250e82d87a refactor(common/lmlayer): reverts the parent/subclass bit, no longer needed 2020-04-17 09:52:48 +07:00
jahorton
38f89ef997 refactor(common/lmlayer): restores original constructor form, drops factories 2020-04-17 09:48:55 +07:00
jahorton
03d29e7755 refactor(common/lmlayer): abstracts interface b/t inner and outer layers 2020-04-14 13:58:19 +07:00
jahorton
c2b011dc2f change(lmlayer): Fixes a few of the 'draft' tweaks to logging from previous commits of this PR 2019-12-02 07:55:38 +07:00
jahorton
4778819203 feat(lmlayer): adds basic error reporting from worker 2019-12-02 07:55:37 +07:00
jahorton
ecddb73862 change(android): gets API 23 working again, but not 19 or 21 (yet) 2019-12-02 07:55:37 +07:00
jahorton
aec96341e9 Addresses most concerns of recent PR review. 2019-07-03 09:41:50 +07:00
jahorton
7f64230824 Initial implementation of direct wordbreak API 2019-07-01 09:50:11 +07:00
jahorton
8184ce3d9b Creates new ModelCompositor class in the LMLayer. 2019-05-27 14:52:44 +07:00
Eddie Antonio Santos
f28a657f41
Things are more work-y... 2019-03-28 10:26:34 -06:00
Joshua A. Horton
a8d6e50b56 Addresses more PR review concerns, renames activateModel -> loadModel. 2019-03-07 08:46:22 +07:00
Joshua A. Horton
b6cc287cb1 Renames the 'uninitialized' state to 'modelless', fixes (most?) docs. 2019-03-06 09:58:29 +07:00
Joshua A. Horton
473ed67b29 Adds a 'config' state to the LMLayer worker. 2019-03-06 09:35:46 +07:00
Joshua A. Horton
263af9c721 Addresses many of Eddie's PR review comments. 2019-03-06 08:24:57 +07:00
Joshua A. Horton
393dc5b270 LMLayer.initialize -> .activateModel, adds .deactivateModel. 2019-03-04 10:25:22 +07:00
Joshua A. Horton
320ac0901d Implements a shutdown() function on LMLayer, killing the worker. 2019-03-04 09:01:34 +07:00
Joshua A. Horton
3c086a8ef6 Fixes LMLayer outer-layer init tests. 2019-03-04 08:28:17 +07:00
Joshua A. Horton
2bf999edee Patches up the integrated tests to work with the model loading change. 2019-02-28 15:52:24 +07:00
Joshua A. Horton
d761a74823 Actually includes the files this time... 2019-02-19 08:52:31 +07:00
Eddie Antonio Santos
b5ff799eea
Move PromiseStore to its own source file. 2019-01-14 14:35:18 -07:00
Eddie Antonio Santos
eb45efe4d0
Change PromiseStore#keep() API: call resolve() immediately instead of returning the callback. 2019-01-14 14:26:09 -07:00
Eddie Antonio Santos
c204f4b793
Implement token tracking in top-level API. 2019-01-14 13:36:57 -07:00
Eddie Antonio Santos
97a59ae8d0
Send back the token in the 'suggestions' message. 2019-01-14 13:17:14 -07:00
Eddie Antonio Santos
427d8064e0
Implement PromiseStore#length. 2019-01-14 10:25:35 -07:00
Eddie Antonio Santos
cceec4ab04
Add promise store and start to test it. 2019-01-14 10:23:59 -07:00
Eddie Antonio Santos
6cf84f09b5
Send 'predict' message to worker. 2019-01-10 16:23:43 -07:00
Joshua A. Horton
ea8b1de557 Minor npm update, adds promise polyfill for IE. 2018-12-03 08:58:11 +07:00
Eddie Antonio Santos
c751646b93
Rename _resolveInitialized to _declareLMLayerReady(). 2018-11-30 13:57:54 -07:00
Eddie Antonio Santos
36e18e4019
Refactor: extract interfaces common to worker and top-level. 2018-11-30 13:43:29 -07:00
Eddie Antonio Santos
d6f9398ad2
Implement initialize callback/response. 2018-11-30 12:35:41 -07:00
Eddie Antonio Santos
ac4167d0be
Define initialize's interface. 2018-11-30 10:48:22 -07:00
Eddie Antonio Santos
81b7510d8b
Implement requiring a Worker instead of a URI. 2018-11-29 20:07:53 -07:00
Joshua A. Horton
cf13caa98e Merge branch 'lmlayer-init' into lmlayer-build-reorg 2018-11-29 23:35:37 +07:00
Joshua A. Horton
18a19734db Gets headless tests working post-reorg, fixes Windows test bug. 2018-11-29 10:12:31 +07:00
Eddie Antonio Santos
8404ef3c13
Comment ALL THE THINGS. 2018-11-28 14:20:09 -07:00
Eddie Antonio Santos
14812ba5ff
Let main script be index.js (implitly). 2018-11-27 15:24:37 -07:00
Eddie Antonio Santos
bc73da7e0e
Link stage 1 and stage 2 code. 2018-11-27 14:45:38 -07:00
Eddie Antonio Santos
ac12cb6f28
Add example to docs for LMLayer.asBlobURI(). 2018-11-27 14:32:37 -07:00
Eddie Antonio Santos
022f34c030
Implement LMLayer.asBlobURI() utility function. 2018-11-27 14:20:33 -07:00
Eddie Antonio Santos
897ed01829
Implement function unwrapping code. 2018-11-27 14:05:21 -07:00
Eddie Antonio Santos
6e540f6b6b
Tests Blobs in the browser only. 2018-11-27 13:53:29 -07:00