spiegel-keyman/web/bulk_rendering
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
..
build.sh chore(common): cleanup sh global color variables 2022-03-10 10:12:09 +11:00
compare.html fix(web): bulk rendering docs 2021-01-22 16:07:45 +11:00
index.html fix(web): bulk renderer using video stream capture 2021-01-22 15:51:38 +11:00
README.md fix(web): bulk rendering docs 2021-01-22 16:07:45 +11:00
renderer_core.ts chore(web): replace lerna with npm workspaces and ts projects 2022-04-12 21:02:33 +10:00
tsconfig.json fix(web): bulk renderer using video stream capture 2021-01-22 15:51:38 +11:00

Bulk renderer

This renderer loads all the cloud keyboards from api.keyman.com and renders each of them to the document, saving each render as an inline (data-url) PNG for easy comparison.

Using the bulk renderer

  1. build.sh to build the renderer (must have already built KeymanWeb in ../source/, ./build.sh -debug).
  2. Open index.html (via http, not via file, as otherwise fonts will not be accessible).
  3. If you want a touch layout, use Developer Tools to select the appropriate emulation and then reload the page.
  4. Choose whether you wish to render all layers or just the default layer for each keyboard.
  5. If desired, filter out keyboards by id (regex).
  6. Run the render.
  7. Save the result to a .html file, either before.html or after.html.
  8. When swapping versions, don't forget to rebuild.

compare.html

Compare allows you to load two runs of the renderer side-by-side (simply save the run to either before.html or after.html in this folder). It defaults to a width of 20% which you might need to tweak depending on the size of your display and the width of the OSK images.