spiegel-keyman/web
Joshua Horton be77d55430
Merge pull request #7036 from keymanapp/fix/web/ui-module-test-stability
fix(web): button, float init timer cleanup
2022-08-16 09:56:23 +07:00
..
bulk_rendering chore(common): builder script :target and --option support 2022-07-25 14:31:58 +10:00
samples chore(web): add 'index.html' to parent links in test pages 2022-06-17 05:58:37 +10:00
source Merge pull request #7036 from keymanapp/fix/web/ui-module-test-stability 2022-08-16 09:56:23 +07:00
testing Merge pull request #6557 from keymanapp/change/web/5943-ie-rooting 2022-06-24 08:35:03 +07:00
tools chore(common): more bin bashes 2022-07-25 16:03:22 +10:00
unit_tests fix(web): fixes previously-unstable unit test 2022-08-02 16:10:04 +07:00
.gitattributes Patches up the /samples pages. 2018-01-08 09:51:19 +07:00
.gitignore chore(web): adjustments for PR review comments 2021-06-16 08:21:39 +07:00
history.md chore: merge stable history 2020-04-29 06:33:31 +10:00
index.html fix(web): recorder operational in new location 2020-05-01 08:06:12 +07:00
LICENSE Move KeymanWeb project to web/ 2017-05-26 11:00:34 +07:00
NOTICE Move KeymanWeb project to web/ 2017-05-26 11:00:34 +07:00
package.json Merge pull request #6557 from keymanapp/change/web/5943-ie-rooting 2022-06-24 08:35:03 +07:00
README.md chore(web): update readme 2022-07-05 12:29:13 +10:00

Keyman Engine for Web

The Original Code is (C) SIL International

Prerequisites

See build configuration for details on how to configure your build environment.


The following folders contain the distribution for Keyman Engine for Web:

source                       Source code
source/resources/osk         OSK resources for inclusion in mobile app builds;
                             keymanweb-osk.ttf is maintained at https://github.com/silnrsi/font-keymanweb-osk
unit_tests                   Automated testing resources

intermediate                 Intermediate compiled code; TypeScript source is compiled here before it is minified.
release/web                  Fully-compiled KeymanWeb modules for testing
release/embedded             Fully-compiled KMEA/KMEI modules for inclusion in mobile app builds
release/unminified/web       Fully-compiled but non-minified KeymanWeb modules
release/unminified/embedded  Fully-compiled KMEA/KMEI modules for inclusion in mobile app builds

samples                      Sample pages demonstrating ways to link with KeymanWeb
testing                      Test-case web-pages for various aspects of KeymanWeb functionality
unit_tests                   A Node-driven test suite for automated testing of KeymanWeb

Usage

Open index.html or samples/index.html in your browser. Be sure to compile Keyman Engine for Web before viewing the pages.

Refer to the samples for usage details.

To view pages using compiled Keyman Engine for Web,

  1. cd to keyman/web/source
  2. Run ./build.sh

build.sh options:

  • -ui
    • to compile desktop user interface modules to output folder
  • -test
    • to compile for testing without copying resources or updating the saved version number.
  • -embed
    • to compile only the KMEA/KMEI embedded engine.
  • -web
    • to compile only the KeymanWeb engine.
  • -debug_embedded
    • to compile a readable version of the embedded KMEA/KMEI code
  • -no_minify
    • to disable the minified '/release/web' and '/release/embedded' build sections.
    • the '/release/unminified/web' and '/release/unminified/embedded' folders will still be built.
  • -clean
    • to erase pre-existing build products before the build.

If more than one target is specified, the last one will take precedence.

Unit Testing

Before running unit tests on Keyman Engine for Web, first run ./build.sh according to the instructions above.

Once the build is complete, running npm test will run the unit testing suite on your local machine in-browser. Alternatively, see unit_tests/test.sh, which the former command executes.

Debugging Unit Tests

  1. During development, to run a specific unit test, change the it to it.only. You can also run all tests under a specific group with describe.only.

  2. From this directory, run ./unit_tests/test.sh -debug. Alternatively, from web/ or any web/ subdirectory,

    npm run test -- -debug
    

    The -- part tells npm to funnel anything to the script as the script's command-line parameters. As long as it's run from somewhere within the web/ folder's hierarchy, that line will always run from web/, as that's where package.json is.

  3. When the browser halts, click the "Debug" button which opens a new debugging tab.

  4. In the Dev console, you can set a breakpoint in your test and refresh the page to debug